Diglin_Chat - Version 2.0.2

Version Notes

- 2.0.2: fix a bug on specific server configuration - Zend_Log error fix
- 2.0.0: Complete new version - support of the new widget and API

Download this release

Release Info

Developer diglin
Extension Diglin_Chat
Version 2.0.2
Comparing to
See all releases


Code changes from version 2.0.1 to 2.0.2

app/code/community/Diglin/Chat/Block/Display.php CHANGED
@@ -67,12 +67,11 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
67
  }
68
 
69
  /**
70
- * @param string $type
71
  * @return \Diglin_Chat_Helper_Data
72
  */
73
- public function getHelper($type = 'chat')
74
  {
75
- return Mage::helper($type);
76
  }
77
 
78
  /**
@@ -83,9 +82,9 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
83
  public function getGreetingsOptions()
84
  {
85
  $data = array();
86
- $data[] = "'online': '" . $this->jsQuoteEscape($this->escapeHtml($this->getHelper()->getOnlineMessage())) . "'";
87
- $data[] = "'offline': '" . $this->jsQuoteEscape($this->escapeHtml($this->getHelper()->getOfflineMessage())) . "'";
88
- //$data[] = "'away': '" . $this->jsQuoteEscape($this->escapeHtml($this->getHelper()->getOfflineGreeting())) . "'";
89
 
90
  if (count($data) > 0) {
91
  $data = implode(',',$data);
@@ -101,14 +100,14 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
101
  */
102
  public function getLanguage()
103
  {
104
- if ($this->getHelper()->getLanguage() == 'auto') {
105
  return null;
106
  }
107
 
108
- if ($this->getHelper()->getLanguage() == 'md') {
109
  return "\$zopim.livechat.setLanguage('" . substr(Mage::app()->getLocale()->getLocale(),0,2)."');" . "\n";
110
  }
111
- return "\$zopim.livechat.setLanguage('" . $this->getHelper()->getLanguage() . "');" . "\n";
112
  }
113
 
114
  /**
@@ -118,8 +117,8 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
118
  */
119
  public function getName()
120
  {
121
- if ($this->getHelper()->allowName() && strlen(trim(Mage::helper('customer')->getCurrentCustomer()->getName())) > 1) {
122
- return "\$zopim.livechat.setName('" . Mage::helper('customer')->getCurrentCustomer()->getName() . "');" . "\n";
123
  }
124
  return;
125
  }
@@ -131,8 +130,8 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
131
  */
132
  public function getEmail()
133
  {
134
- if ($this->getHelper()->allowEmail() && strlen(Mage::helper('customer')->getCurrentCustomer()->getEmail()) > 0) {
135
- return "\$zopim.livechat.setEmail('" . Mage::helper('customer')->getCurrentCustomer()->getEmail() . "');" . "\n";
136
  }
137
  return;
138
  }
@@ -144,7 +143,7 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
144
  */
145
  public function getDisableSound()
146
  {
147
- if ($this->getHelper()->getDisableSound()) {
148
  return "\$zopim.livechat.setDisableSound(true);" . "\n";
149
  }
150
 
@@ -160,8 +159,8 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
160
  {
161
  $out = array();
162
 
163
- if (strlen($this->getHelper()->getWindowTheme()) > 0) {
164
- $out[] = "\$zopim.livechat.theme.setTheme('" . $this->getHelper()->getWindowTheme() . "')";
165
  }
166
 
167
  if (count($out) > 0) {
@@ -180,23 +179,23 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
180
  {
181
  $out = array();
182
 
183
- if ($this->getHelper()->getWindowTheme() == 'simple') {
184
  return;
185
  }
186
 
187
- if (strlen($this->getHelper()->getBubbleTitle()) > 0) {
188
- $out[] = "\$zopim.livechat.bubble.setTitle('" . $this->getHelper()->getBubbleTitle() . "')";
189
  }
190
 
191
- if (strlen($this->getHelper()->getBubbleText()) > 0) {
192
- $out[] = "\$zopim.livechat.bubble.setText('" . $this->getHelper()->getBubbleText() . "')";
193
  }
194
 
195
- if ($this->getHelper()->getBubbleShow() == 'show' || $this->getForceBubbleDisplay()) {
196
  $out[] = "\$zopim.livechat.bubble.show()";
197
- } elseif ($this->getHelper()->getBubbleShow() == 'hide') {
198
  $out[] = "\$zopim.livechat.bubble.hide()";
199
- } elseif ($this->getHelper()->getBubbleShow() == 'reset') { // reset on each page reload
200
  $out[] = "\$zopim.livechat.bubble.reset()";
201
  }
202
 
@@ -216,27 +215,27 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
216
  {
217
  $out = array();
218
 
219
- if (strlen($this->getHelper()->getWindowTitle()) > 0) {
220
- $out[] = "\$zopim.livechat.window.setTitle('" . $this->getHelper()->getWindowTitle() . "')";
221
  }
222
- if (strlen($this->getHelper()->getWindowSize()) > 0) {
223
- $out[] = "\$zopim.livechat.window.setSize('" . $this->getHelper()->getWindowSize() . "')";
224
  }
225
 
226
- // if (strlen($this->getHelper()->getWindowOffsetVertical()) > 0) {
227
- // $out[] = "\$zopim.livechat.window.setOffsetVertical('" . $this->getHelper()->getWindowOffsetVertical() . "')";
228
  // }
229
  //
230
- // if (strlen($this->getHelper()->getWindowOffsetHorizontal()) > 0) {
231
- // $out[] = "\$zopim.livechat.window.setOffsetHorizontal('" . $this->getHelper()->getWindowOffsetHorizontal() . "')";
232
  // }
233
  //
234
- if (strlen($this->getHelper()->getWindowOnShow())) {
235
- $out[] = "\$zopim.livechat.window.onShow('" . $this->getHelper()->getWindowOnShow() . "')";
236
  }
237
 
238
- if (strlen($this->getHelper()->getWindowOnHide())) {
239
- $out[] = "\$zopim.livechat.window.onHide('" . $this->getHelper()->getWindowOnHide() . "')";
240
  }
241
 
242
  if (count($out) > 0) {
@@ -255,32 +254,32 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
255
  {
256
  $out = array();
257
 
258
- // if ($this->getHelper()->getButtonShow() || $this->getForceButtonDisplay()) {
259
  // $out[] = "\$zopim.livechat.button.show()";
260
  // } else {
261
  // $out[] = "\$zopim.livechat.button.hide()";
262
  // }
263
 
264
- if (strlen($this->getHelper()->getButtonPosition()) > 0) {
265
- $out[] = "\$zopim.livechat.button.setPosition('" . $this->getHelper()->getButtonPosition() . "')";
266
- $out[] = "\$zopim.livechat.window.setPosition('" . $this->getHelper()->getButtonPosition() . "')";
267
  }
268
 
269
- if (strlen($this->getHelper()->getButtonPositionMobile()) > 0) {
270
- $out[] = "\$zopim.livechat.button.setPositionMobile('" . $this->getHelper()->getButtonPositionMobile() . "')";
271
  }
272
 
273
- // if ($this->getHelper()->getButtonHideOffline()) {
274
  // $out[] = "\$zopim.livechat.button.setHideWhenOffline(1)";
275
  // }
276
 
277
- // if (($this->getHelper()->getWidgetApi() == 'new')) {
278
- // if (strlen($this->getHelper()->getButtonOffsetVertical()) > 0) {
279
- // $out[] = "\$zopim.livechat.button.setOffsetVertical('" . $this->getHelper()->getButtonOffsetVertical() . "')";
280
  // }
281
  //
282
- // if (strlen($this->getHelper()->getButtonOffsetHorizontal()) > 0) {
283
- // $out[] = "\$zopim.livechat.button.setOffsetHorizontal('" . $this->getHelper()->getButtonOffsetHorizontal() . "')";
284
  // }
285
  // }
286
 
@@ -299,9 +298,9 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
299
  {
300
  $out = array();
301
 
302
- if ($this->getHelper()->getDepartmentsFilter()) {
303
- $departments = explode(',', $this->getHelper()->getDepartmentsFilter());
304
- $out[] = "\$zopim.livechat.departments.filter('" . implode("','", $departments) . "')";
305
  }
306
 
307
  if (count($out) > 0) {
@@ -316,12 +315,12 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
316
  */
317
  // public function getUnreadFlagOptions()
318
  // {
319
- // if ($this->getHelper()->getWidget() != 'classic') {
320
  // return;
321
  // }
322
  //
323
  // $out = array();
324
- // $out[] = "\$zopim.livechat.unreadflag = " . (($this->getHelper()->getUnreadFlag())?'\'enable\'':'\'disable\'');
325
  //
326
  // if (count($out) > 0) {
327
  // return implode(';' . "\n", $out). ';' . "\n";
@@ -338,10 +337,10 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
338
  {
339
  $out = array();
340
 
341
- if ($this->getHelper()->getCookieLawComply()) {
342
  $out [] = "\$zopim.livechat.cookieLaw.comply()";
343
 
344
- if ($this->getHelper()->getCookieLawConsent()) {
345
  $out[] = "\$zopim.livechat.cookieLaw.setDefaultImplicitConsent()";
346
  }
347
  }
@@ -361,20 +360,20 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
361
  {
362
  $out = array();
363
 
364
- if ($this->getHelper()->getWindowTheme() == 'classic') {
365
  return;
366
  }
367
 
368
- if (strlen($this->getHelper()->getConciergeAvatar()) > 0) {
369
- $out[] = "\$zopim.livechat.concierge.setAvatar('" . Mage::getBaseUrl('media') . 'chat/' . $this->getHelper()->getConciergeAvatar() . "')";
370
  }
371
 
372
- if (strlen($this->getHelper()->getConciergeName()) > 0) {
373
- $out[] = "\$zopim.livechat.concierge.setName('" . $this->getHelper()->getConciergeName() . "')";
374
  }
375
 
376
- if (strlen($this->getHelper()->getConciergeTitle()) > 0) {
377
- $out[] = "\$zopim.livechat.concierge.setTitle('" . $this->getHelper()->getConciergeTitle() . "')";
378
  }
379
 
380
  if (!empty($out)) {
@@ -390,24 +389,24 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
390
  */
391
  public function getBadgeOptions()
392
  {
393
- if ($this->getHelper()->getWindowTheme() != 'simple') {
394
  return;
395
  }
396
  $out = array();
397
 
398
- if (strlen($this->getHelper()->getBadgeLayout()) > 0) {
399
- $out[] = "\$zopim.livechat.badge.setLayout('" . $this->getHelper()->getBadgeLayout() . "')";
400
  }
401
 
402
- if (strlen($this->getHelper()->getBadgeText()) > 0) {
403
- $out[] = "\$zopim.livechat.badge.setText('" . $this->getHelper()->getBadgeText() . "')";
404
  }
405
 
406
- if (strlen($this->getHelper()->getBadgeImage()) > 0) {
407
- $out[] = "\$zopim.livechat.badge.setImage('" . Mage::getBaseUrl('media') . 'chat/' . $this->getHelper()->getBadgeImage() . "')";
408
  }
409
 
410
- if ($this->getHelper()->getBadgeShow() == 'hide') {
411
  $out[] = "\$zopim.livechat.badge.hide()";
412
  } else {
413
  $out[] = "\$zopim.livechat.badge.show()";
@@ -428,22 +427,22 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
428
  {
429
  $out = array();
430
 
431
- // if ($this->getHelper()->getWidgetApi() == 'new') {
432
- if (strlen($this->getHelper()->getThemePrimaryColor()) > 0) {
433
- $out[] = "\$zopim.livechat.theme.setColor('#" . ltrim($this->getHelper()->getThemePrimaryColor(), '#') . "', 'primary')";
434
  }
435
 
436
  // Specify Badge Color
437
- if ($this->getHelper()->getWindowTheme() == 'simple' && $this->getHelper()->getBadgeColorPrimary()) {
438
- switch ($this->getHelper()->getBadgeColorPrimary()){
439
  case 'badge_color_primary':
440
- $color = $this->getHelper()->getThemePrimaryColor();
441
  break;
442
  case 'badge_color_customized':
443
  default:
444
- $color = $this->getHelper()->getBadgeColor();
445
  if (empty($color)) {
446
- $color = $this->getHelper()->getThemePrimaryColor();
447
  }
448
  break;
449
 
@@ -454,16 +453,16 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
454
  }
455
 
456
  // Specify Bubble Color
457
- if ($this->getHelper()->getWindowTheme() == 'classic' && $this->getHelper()->getBubbleColorPrimary()) {
458
- switch ($this->getHelper()->getBubbleColorPrimary()){
459
  case 'bubble_color_primary':
460
- $color = $this->getHelper()->getThemePrimaryColor();
461
  break;
462
  case 'bubble_color_customized':
463
  default:
464
- $color = $this->getHelper()->getBubbleColor();
465
  if (empty($color)) {
466
- $color = $this->getHelper()->getThemePrimaryColor();
467
  }
468
  break;
469
 
@@ -478,12 +477,12 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
478
  }
479
 
480
  // } else {
481
- // if (strlen($this->getHelper()->getThemePrimaryColor()) > 0) {
482
- // $out[] = "\$zopim.livechat.window.setColor('#" . ltrim($this->getHelper()->getThemePrimaryColor(), '#') . "')";
483
  // }
484
  //
485
- // if (strlen($this->getHelper()->getBubbleColor()) > 0) {
486
- // $out[] = "\$zopim.livechat.bubble.setColor('#" . ltrim($this->getHelper()->getBubbleColor(), '#') . "')";
487
  // }
488
  // }
489
 
@@ -500,11 +499,11 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
500
  */
501
  protected function _toHtml()
502
  {
503
- if ($this->getHelper()->getEnabled()) {
504
 
505
  $zopimOptions = '';
506
 
507
- if ($this->getHelper()->getConfigType() == 'adv') {
508
  $zopimOptions .= $this->getCookieLawOptions(); // Must be in first place
509
  $zopimOptions .= $this->getDisableSound();
510
  $zopimOptions .= $this->getTheme(); // should be set after setColor/setColors js methods but works better here
@@ -537,7 +536,7 @@ class Diglin_Chat_Block_Display extends Mage_Core_Block_Template
537
  'zopim_chat',
538
  array(
539
  'template' => 'chat/widget.phtml',
540
- 'key' => $this->getHelper()->getKey(),
541
  'zopim_options' => $zopimOptions
542
  )
543
  );
67
  }
68
 
69
  /**
 
70
  * @return \Diglin_Chat_Helper_Data
71
  */
72
+ public function getChatHelper()
73
  {
74
+ return Mage::helper('chat');
75
  }
76
 
77
  /**
82
  public function getGreetingsOptions()
83
  {
84
  $data = array();
85
+ $data[] = "'online': '" . $this->jsQuoteEscape($this->escapeHtml($this->getChatHelper()->getOnlineMessage())) . "'";
86
+ $data[] = "'offline': '" . $this->jsQuoteEscape($this->escapeHtml($this->getChatHelper()->getOfflineMessage())) . "'";
87
+ //$data[] = "'away': '" . $this->jsQuoteEscape($this->escapeHtml($this->getChatHelper()->getOfflineGreeting())) . "'";
88
 
89
  if (count($data) > 0) {
90
  $data = implode(',',$data);
100
  */
101
  public function getLanguage()
102
  {
103
+ if ($this->getChatHelper()->getLanguage() == 'auto') {
104
  return null;
105
  }
106
 
107
+ if ($this->getChatHelper()->getLanguage() == 'md') {
108
  return "\$zopim.livechat.setLanguage('" . substr(Mage::app()->getLocale()->getLocale(),0,2)."');" . "\n";
109
  }
110
+ return "\$zopim.livechat.setLanguage('" . $this->getChatHelper()->getLanguage() . "');" . "\n";
111
  }
112
 
113
  /**
117
  */
118
  public function getName()
119
  {
120
+ if ($this->getChatHelper()->allowName() && strlen(trim(Mage::helper('customer')->getCurrentCustomer()->getName())) > 1) {
121
+ return "\$zopim.livechat.setName('" . $this->jsQuoteEscape(Mage::helper('customer')->getCurrentCustomer()->getName()) . "');" . "\n";
122
  }
123
  return;
124
  }
130
  */
131
  public function getEmail()
132
  {
133
+ if ($this->getChatHelper()->allowEmail() && strlen(Mage::helper('customer')->getCurrentCustomer()->getEmail()) > 0) {
134
+ return "\$zopim.livechat.setEmail('" . $this->jsQuoteEscape(Mage::helper('customer')->getCurrentCustomer()->getEmail()) . "');" . "\n";
135
  }
136
  return;
137
  }
143
  */
144
  public function getDisableSound()
145
  {
146
+ if ($this->getChatHelper()->getDisableSound()) {
147
  return "\$zopim.livechat.setDisableSound(true);" . "\n";
148
  }
149
 
159
  {
160
  $out = array();
161
 
162
+ if (strlen($this->getChatHelper()->getWindowTheme()) > 0) {
163
+ $out[] = "\$zopim.livechat.theme.setTheme('" . $this->getChatHelper()->getWindowTheme() . "')";
164
  }
165
 
166
  if (count($out) > 0) {
179
  {
180
  $out = array();
181
 
182
+ if ($this->getChatHelper()->getWindowTheme() == 'simple') {
183
  return;
184
  }
185
 
186
+ if (strlen($this->getChatHelper()->getBubbleTitle()) > 0) {
187
+ $out[] = "\$zopim.livechat.bubble.setTitle('" . $this->getChatHelper()->getBubbleTitle() . "')";
188
  }
189
 
190
+ if (strlen($this->getChatHelper()->getBubbleText()) > 0) {
191
+ $out[] = "\$zopim.livechat.bubble.setText('" . $this->getChatHelper()->getBubbleText() . "')";
192
  }
193
 
194
+ if ($this->getChatHelper()->getBubbleShow() == 'show' || $this->getForceBubbleDisplay()) {
195
  $out[] = "\$zopim.livechat.bubble.show()";
196
+ } elseif ($this->getChatHelper()->getBubbleShow() == 'hide') {
197
  $out[] = "\$zopim.livechat.bubble.hide()";
198
+ } elseif ($this->getChatHelper()->getBubbleShow() == 'reset') { // reset on each page reload
199
  $out[] = "\$zopim.livechat.bubble.reset()";
200
  }
201
 
215
  {
216
  $out = array();
217
 
218
+ if (strlen($this->getChatHelper()->getWindowTitle()) > 0) {
219
+ $out[] = "\$zopim.livechat.window.setTitle('" . $this->jsQuoteEscape($this->getChatHelper()->getWindowTitle()) . "')";
220
  }
221
+ if (strlen($this->getChatHelper()->getWindowSize()) > 0) {
222
+ $out[] = "\$zopim.livechat.window.setSize('" . $this->getChatHelper()->getWindowSize() . "')";
223
  }
224
 
225
+ // if (strlen($this->getChatHelper()->getWindowOffsetVertical()) > 0) {
226
+ // $out[] = "\$zopim.livechat.window.setOffsetVertical('" . $this->getChatHelper()->getWindowOffsetVertical() . "')";
227
  // }
228
  //
229
+ // if (strlen($this->getChatHelper()->getWindowOffsetHorizontal()) > 0) {
230
+ // $out[] = "\$zopim.livechat.window.setOffsetHorizontal('" . $this->getChatHelper()->getWindowOffsetHorizontal() . "')";
231
  // }
232
  //
233
+ if (strlen($this->getChatHelper()->getWindowOnShow())) {
234
+ $out[] = "\$zopim.livechat.window.onShow('" . $this->getChatHelper()->getWindowOnShow() . "')";
235
  }
236
 
237
+ if (strlen($this->getChatHelper()->getWindowOnHide())) {
238
+ $out[] = "\$zopim.livechat.window.onHide('" . $this->getChatHelper()->getWindowOnHide() . "')";
239
  }
240
 
241
  if (count($out) > 0) {
254
  {
255
  $out = array();
256
 
257
+ // if ($this->getChatHelper()->getButtonShow() || $this->getForceButtonDisplay()) {
258
  // $out[] = "\$zopim.livechat.button.show()";
259
  // } else {
260
  // $out[] = "\$zopim.livechat.button.hide()";
261
  // }
262
 
263
+ if (strlen($this->getChatHelper()->getButtonPosition()) > 0) {
264
+ $out[] = "\$zopim.livechat.button.setPosition('" . $this->getChatHelper()->getButtonPosition() . "')";
265
+ $out[] = "\$zopim.livechat.window.setPosition('" . $this->getChatHelper()->getButtonPosition() . "')";
266
  }
267
 
268
+ if (strlen($this->getChatHelper()->getButtonPositionMobile()) > 0) {
269
+ $out[] = "\$zopim.livechat.button.setPositionMobile('" . $this->getChatHelper()->getButtonPositionMobile() . "')";
270
  }
271
 
272
+ // if ($this->getChatHelper()->getButtonHideOffline()) {
273
  // $out[] = "\$zopim.livechat.button.setHideWhenOffline(1)";
274
  // }
275
 
276
+ // if (($this->getChatHelper()->getWidgetApi() == 'new')) {
277
+ // if (strlen($this->getChatHelper()->getButtonOffsetVertical()) > 0) {
278
+ // $out[] = "\$zopim.livechat.button.setOffsetVertical('" . $this->getChatHelper()->getButtonOffsetVertical() . "')";
279
  // }
280
  //
281
+ // if (strlen($this->getChatHelper()->getButtonOffsetHorizontal()) > 0) {
282
+ // $out[] = "\$zopim.livechat.button.setOffsetHorizontal('" . $this->getChatHelper()->getButtonOffsetHorizontal() . "')";
283
  // }
284
  // }
285
 
298
  {
299
  $out = array();
300
 
301
+ if ($this->getChatHelper()->getDepartmentsFilter()) {
302
+ $departments = explode(',', $this->getChatHelper()->getDepartmentsFilter());
303
+ $out[] = "\$zopim.livechat.departments.filter('" . $this->jsQuoteEscape(implode("','", $departments)) . "')";
304
  }
305
 
306
  if (count($out) > 0) {
315
  */
316
  // public function getUnreadFlagOptions()
317
  // {
318
+ // if ($this->getChatHelper()->getWidget() != 'classic') {
319
  // return;
320
  // }
321
  //
322
  // $out = array();
323
+ // $out[] = "\$zopim.livechat.unreadflag = " . (($this->getChatHelper()->getUnreadFlag())?'\'enable\'':'\'disable\'');
324
  //
325
  // if (count($out) > 0) {
326
  // return implode(';' . "\n", $out). ';' . "\n";
337
  {
338
  $out = array();
339
 
340
+ if ($this->getChatHelper()->getCookieLawComply()) {
341
  $out [] = "\$zopim.livechat.cookieLaw.comply()";
342
 
343
+ if ($this->getChatHelper()->getCookieLawConsent()) {
344
  $out[] = "\$zopim.livechat.cookieLaw.setDefaultImplicitConsent()";
345
  }
346
  }
360
  {
361
  $out = array();
362
 
363
+ if ($this->getChatHelper()->getWindowTheme() == 'classic') {
364
  return;
365
  }
366
 
367
+ if (strlen($this->getChatHelper()->getConciergeAvatar()) > 0) {
368
+ $out[] = "\$zopim.livechat.concierge.setAvatar('" . Mage::getBaseUrl('media') . 'chat/' . $this->getChatHelper()->getConciergeAvatar() . "')";
369
  }
370
 
371
+ if (strlen($this->getChatHelper()->getConciergeName()) > 0) {
372
+ $out[] = "\$zopim.livechat.concierge.setName('" . $this->jsQuoteEscape($this->getChatHelper()->getConciergeName()) . "')";
373
  }
374
 
375
+ if (strlen($this->getChatHelper()->getConciergeTitle()) > 0) {
376
+ $out[] = "\$zopim.livechat.concierge.setTitle('" . $this->jsQuoteEscape($this->getChatHelper()->getConciergeTitle()) . "')";
377
  }
378
 
379
  if (!empty($out)) {
389
  */
390
  public function getBadgeOptions()
391
  {
392
+ if ($this->getChatHelper()->getWindowTheme() != 'simple') {
393
  return;
394
  }
395
  $out = array();
396
 
397
+ if (strlen($this->getChatHelper()->getBadgeLayout()) > 0) {
398
+ $out[] = "\$zopim.livechat.badge.setLayout('" . $this->getChatHelper()->getBadgeLayout() . "')";
399
  }
400
 
401
+ if (strlen($this->getChatHelper()->getBadgeText()) > 0) {
402
+ $out[] = "\$zopim.livechat.badge.setText('" . $this->jsQuoteEscape($this->getChatHelper()->getBadgeText()) . "')";
403
  }
404
 
405
+ if (strlen($this->getChatHelper()->getBadgeImage()) > 0) {
406
+ $out[] = "\$zopim.livechat.badge.setImage('" . Mage::getBaseUrl('media') . 'chat/' . $this->getChatHelper()->getBadgeImage() . "')";
407
  }
408
 
409
+ if ($this->getChatHelper()->getBadgeShow() == 'hide') {
410
  $out[] = "\$zopim.livechat.badge.hide()";
411
  } else {
412
  $out[] = "\$zopim.livechat.badge.show()";
427
  {
428
  $out = array();
429
 
430
+ // if ($this->getChatHelper()->getWidgetApi() == 'new') {
431
+ if (strlen($this->getChatHelper()->getThemePrimaryColor()) > 0) {
432
+ $out[] = "\$zopim.livechat.theme.setColor('#" . ltrim($this->getChatHelper()->getThemePrimaryColor(), '#') . "', 'primary')";
433
  }
434
 
435
  // Specify Badge Color
436
+ if ($this->getChatHelper()->getWindowTheme() == 'simple' && $this->getChatHelper()->getBadgeColorPrimary()) {
437
+ switch ($this->getChatHelper()->getBadgeColorPrimary()){
438
  case 'badge_color_primary':
439
+ $color = $this->getChatHelper()->getThemePrimaryColor();
440
  break;
441
  case 'badge_color_customized':
442
  default:
443
+ $color = $this->getChatHelper()->getBadgeColor();
444
  if (empty($color)) {
445
+ $color = $this->getChatHelper()->getThemePrimaryColor();
446
  }
447
  break;
448
 
453
  }
454
 
455
  // Specify Bubble Color
456
+ if ($this->getChatHelper()->getWindowTheme() == 'classic' && $this->getChatHelper()->getBubbleColorPrimary()) {
457
+ switch ($this->getChatHelper()->getBubbleColorPrimary()){
458
  case 'bubble_color_primary':
459
+ $color = $this->getChatHelper()->getThemePrimaryColor();
460
  break;
461
  case 'bubble_color_customized':
462
  default:
463
+ $color = $this->getChatHelper()->getBubbleColor();
464
  if (empty($color)) {
465
+ $color = $this->getChatHelper()->getThemePrimaryColor();
466
  }
467
  break;
468
 
477
  }
478
 
479
  // } else {
480
+ // if (strlen($this->getChatHelper()->getThemePrimaryColor()) > 0) {
481
+ // $out[] = "\$zopim.livechat.window.setColor('#" . ltrim($this->getChatHelper()->getThemePrimaryColor(), '#') . "')";
482
  // }
483
  //
484
+ // if (strlen($this->getChatHelper()->getBubbleColor()) > 0) {
485
+ // $out[] = "\$zopim.livechat.bubble.setColor('#" . ltrim($this->getChatHelper()->getBubbleColor(), '#') . "')";
486
  // }
487
  // }
488
 
499
  */
500
  protected function _toHtml()
501
  {
502
+ if ($this->getChatHelper()->getEnabled()) {
503
 
504
  $zopimOptions = '';
505
 
506
+ if ($this->getChatHelper()->getConfigType() == 'adv') {
507
  $zopimOptions .= $this->getCookieLawOptions(); // Must be in first place
508
  $zopimOptions .= $this->getDisableSound();
509
  $zopimOptions .= $this->getTheme(); // should be set after setColor/setColors js methods but works better here
536
  'zopim_chat',
537
  array(
538
  'template' => 'chat/widget.phtml',
539
+ 'key' => $this->getChatHelper()->getKey(),
540
  'zopim_options' => $zopimOptions
541
  )
542
  );
app/code/community/Diglin/Chat/etc/config.xml CHANGED
@@ -28,7 +28,7 @@
28
  <config>
29
  <modules>
30
  <Diglin_Chat>
31
- <version>2.0.1</version>
32
  </Diglin_Chat>
33
  </modules>
34
 
28
  <config>
29
  <modules>
30
  <Diglin_Chat>
31
+ <version>2.0.2</version>
32
  </Diglin_Chat>
33
  </modules>
34
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Diglin_Chat</name>
4
- <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -84,11 +84,12 @@
84
  &lt;li&gt;Regarding Zopim Chat itself, please visit &lt;a href="http://bit.ly/1kcTNL5"&gt;http://www.zopim.com&lt;/a&gt;&lt;/li&gt;&#xD;
85
  &lt;li&gt;Code is available on &lt;a href="https://github.com/diglin/Diglin_Chat"&gt;Github&lt;/a&gt;&lt;/li&gt;&#xD;
86
  &lt;/ul&gt;</description>
87
- <notes>- 2.0.0: Complete new version - support of the new widget and API</notes>
 
88
  <authors><author><name>diglin</name><user>diglin</user><email>sly@diglin.com</email></author></authors>
89
- <date>2014-02-13</date>
90
- <time>22:38:09</time>
91
- <contents><target name="mageetc"><dir name="modules"><file name="Diglin_Chat.xml" hash="ee814a25abef4007039bb6b6c7c5095a"/></dir></target><target name="magecommunity"><dir name="Diglin"><dir name="Chat"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Heading.php" hash="7aa859ee89fc458d2915156bc68cefbc"/><file name="Hint.php" hash="b870ee1a0eea1ceb75f27faa72def9f2"/></dir></dir><file name="Dashboard.php" hash="a4d0892fb43ab0115f90b0deee55d893"/></dir><file name="Display.php" hash="8fce07a4a59e149e539c083aa0bece69"/></dir><dir name="Helper"><file name="Data.php" hash="69875b40b36e98dbf1c17af7ebd55868"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Api.php" hash="708d2687281bc14a8c13ff703582cc78"/><file name="Badgecolor.php" hash="cb4a360326283348c749373b027058b8"/><file name="Bubblecolor.php" hash="6bdb70b755e729cd95ce1dd41622255c"/><file name="Buttonposition.php" hash="53e97510125d87df2acea25b3940462c"/><file name="Classicthemes.php" hash="cc7860febf26fbb39983b15b4c756e38"/><file name="Language.php" hash="0842d7854a93f5307d06e7d590a6f5f1"/><file name="Layout.php" hash="6cbf67a004f4e44de213e4cec41061ea"/><file name="Mobileposition.php" hash="6431f2a9d8542b50dade4cfc0ae10afe"/><file name="Showhide.php" hash="24d7405b13060fc111318d3a65b2bcd4"/><file name="Simpleadvanced.php" hash="c41127c2c5cc74f8f57f79bc0270a6df"/><file name="Themes.php" hash="74a9122d0464578ee6e0e06b63ee203b"/><file name="Windowposition.php" hash="1aa8250dc578b816759fb37206c11a25"/><file name="Windowsize.php" hash="3236f370ebe39da335e589a8cf7f92da"/></dir></dir><dir name="Resource"><file name="Setup.php" hash="9935c98bab4a0b328400a69ee44a60fa"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="2567f02f376df74272f08f5fbd93bba0"/></dir></dir><dir name="data"><dir name="diglinchat_setup"><file name="data-upgrade-1.3.0-2.0.1.php" hash="406d1b5f62d8561da856f82111c457a6"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="5ea4a51b111558c1d3c45dde16202753"/><file name="config.xml" hash="f0c5cc9e533ca0ca7f4ed94b453bbf43"/><file name="system.xml" hash="d55a42e0bfef851718035df1574a14b0"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="chat.xml" hash="577c2e765ad336fb5b77ceaef3b16fb2"/></dir><dir name="template"><dir name="chat"><file name="test.phtml" hash="1b617e1f4e3b70c228cd6e03adf81895"/><file name="widget.phtml" hash="523956f4c147661de3d4b15e06f89d89"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="chat.xml" hash="52b06472b199886b05543cf202a5c568"/></dir><dir name="template"><dir name="chat"><file name="account.phtml" hash="71239173d840640ada4a704c484d5044"/><file name="dashboard.phtml" hash="ce622d160176c15ad4d06f9e56295e9c"/></dir></dir></dir></dir></dir></target></contents>
92
  <compatible/>
93
  <dependencies><required><php><min>5.2.9</min><max>6.0.0</max></php></required></dependencies>
94
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Diglin_Chat</name>
4
+ <version>2.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
84
  &lt;li&gt;Regarding Zopim Chat itself, please visit &lt;a href="http://bit.ly/1kcTNL5"&gt;http://www.zopim.com&lt;/a&gt;&lt;/li&gt;&#xD;
85
  &lt;li&gt;Code is available on &lt;a href="https://github.com/diglin/Diglin_Chat"&gt;Github&lt;/a&gt;&lt;/li&gt;&#xD;
86
  &lt;/ul&gt;</description>
87
+ <notes>- 2.0.2: fix a bug on specific server configuration - Zend_Log error fix&#xD;
88
+ - 2.0.0: Complete new version - support of the new widget and API</notes>
89
  <authors><author><name>diglin</name><user>diglin</user><email>sly@diglin.com</email></author></authors>
90
+ <date>2014-05-22</date>
91
+ <time>09:12:10</time>
92
+ <contents><target name="mageetc"><dir name="modules"><file name="Diglin_Chat.xml" hash="ee814a25abef4007039bb6b6c7c5095a"/></dir></target><target name="magecommunity"><dir name="Diglin"><dir name="Chat"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Heading.php" hash="7aa859ee89fc458d2915156bc68cefbc"/><file name="Hint.php" hash="b870ee1a0eea1ceb75f27faa72def9f2"/></dir></dir><file name="Dashboard.php" hash="a4d0892fb43ab0115f90b0deee55d893"/></dir><file name="Display.php" hash="68575831d709b9768e2139d171de9caa"/></dir><dir name="Helper"><file name="Data.php" hash="69875b40b36e98dbf1c17af7ebd55868"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Api.php" hash="708d2687281bc14a8c13ff703582cc78"/><file name="Badgecolor.php" hash="cb4a360326283348c749373b027058b8"/><file name="Bubblecolor.php" hash="6bdb70b755e729cd95ce1dd41622255c"/><file name="Buttonposition.php" hash="53e97510125d87df2acea25b3940462c"/><file name="Classicthemes.php" hash="cc7860febf26fbb39983b15b4c756e38"/><file name="Language.php" hash="0842d7854a93f5307d06e7d590a6f5f1"/><file name="Layout.php" hash="6cbf67a004f4e44de213e4cec41061ea"/><file name="Mobileposition.php" hash="6431f2a9d8542b50dade4cfc0ae10afe"/><file name="Showhide.php" hash="24d7405b13060fc111318d3a65b2bcd4"/><file name="Simpleadvanced.php" hash="c41127c2c5cc74f8f57f79bc0270a6df"/><file name="Themes.php" hash="74a9122d0464578ee6e0e06b63ee203b"/><file name="Windowposition.php" hash="1aa8250dc578b816759fb37206c11a25"/><file name="Windowsize.php" hash="3236f370ebe39da335e589a8cf7f92da"/></dir></dir><dir name="Resource"><file name="Setup.php" hash="9935c98bab4a0b328400a69ee44a60fa"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="2567f02f376df74272f08f5fbd93bba0"/></dir></dir><dir name="data"><dir name="diglinchat_setup"><file name="data-upgrade-1.3.0-2.0.1.php" hash="406d1b5f62d8561da856f82111c457a6"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="5ea4a51b111558c1d3c45dde16202753"/><file name="config.xml" hash="71c1e345cedef83dfe5bc75f8525c8fd"/><file name="system.xml" hash="d55a42e0bfef851718035df1574a14b0"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="chat.xml" hash="577c2e765ad336fb5b77ceaef3b16fb2"/></dir><dir name="template"><dir name="chat"><file name="test.phtml" hash="1b617e1f4e3b70c228cd6e03adf81895"/><file name="widget.phtml" hash="523956f4c147661de3d4b15e06f89d89"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="chat.xml" hash="52b06472b199886b05543cf202a5c568"/></dir><dir name="template"><dir name="chat"><file name="account.phtml" hash="71239173d840640ada4a704c484d5044"/><file name="dashboard.phtml" hash="ce622d160176c15ad4d06f9e56295e9c"/></dir></dir></dir></dir></dir></target></contents>
93
  <compatible/>
94
  <dependencies><required><php><min>5.2.9</min><max>6.0.0</max></php></required></dependencies>
95
  </package>