chat_tidio - Version 1.0.4

Version Notes

Notes

Download this release

Release Info

Developer Tytus Gołas
Extension chat_tidio
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

app/code/local/Tidio/Chat/Block/Adminhtml/Menu.php CHANGED
@@ -15,6 +15,11 @@ class Tidio_Chat_Block_Adminhtml_Menu extends Mage_Adminhtml_Block_Page_Menu
15
  $publicKey = Mage::getStoreConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY);
16
  $privateKey = Mage::getStoreConfig(self::XML_PATH_EXTENSION_PRIVATE_KEY);
17
 
 
 
 
 
 
18
  if ((trim($publicKey) == '') || (trim($privateKey) == '')) {
19
  $keys = $this->_getKeys();
20
  $publicKey = $keys['public_key'];
@@ -23,6 +28,9 @@ class Tidio_Chat_Block_Adminhtml_Menu extends Mage_Adminhtml_Block_Page_Menu
23
  $config = new Mage_Core_Model_Config();
24
  $config->saveConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY, $publicKey);
25
  $config->saveConfig(self::XML_PATH_EXTENSION_PRIVATE_KEY, $privateKey);
 
 
 
26
  }
27
 
28
  $extEnabled = true;//(int) Mage::getStoreConfig(self::XML_PATH_EXTENSION_ENABLED);
15
  $publicKey = Mage::getStoreConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY);
16
  $privateKey = Mage::getStoreConfig(self::XML_PATH_EXTENSION_PRIVATE_KEY);
17
 
18
+ if (Mage::getSingleton('core/session')->getPrivateKey() != '') {
19
+ $publicKey = Mage::getSingleton('core/session')->getPublicKey();
20
+ $privateKey = Mage::getSingleton('core/session')->getPrivateKey();
21
+ }
22
+
23
  if ((trim($publicKey) == '') || (trim($privateKey) == '')) {
24
  $keys = $this->_getKeys();
25
  $publicKey = $keys['public_key'];
28
  $config = new Mage_Core_Model_Config();
29
  $config->saveConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY, $publicKey);
30
  $config->saveConfig(self::XML_PATH_EXTENSION_PRIVATE_KEY, $privateKey);
31
+
32
+ Mage::getSingleton('core/session')->setPrivateKey($privateKey);
33
+ Mage::getSingleton('core/session')->setPublicKey($publicKey);
34
  }
35
 
36
  $extEnabled = true;//(int) Mage::getStoreConfig(self::XML_PATH_EXTENSION_ENABLED);
app/code/local/Tidio/Chat/Block/Script.php CHANGED
@@ -16,6 +16,10 @@ class Tidio_Chat_Block_Script extends Mage_Core_Block_Template
16
  $extEnabled = (int) Mage::getStoreConfig(self::XML_PATH_EXTENSION_ENABLED);
17
  $publicKey = Mage::getStoreConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY);
18
 
 
 
 
 
19
  if ($extEnabled && (trim($publicKey) != '')) {
20
  return true;
21
  }
@@ -25,6 +29,11 @@ class Tidio_Chat_Block_Script extends Mage_Core_Block_Template
25
 
26
  public function getPublicKey()
27
  {
28
- return Mage::getStoreConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY);
 
 
 
 
 
29
  }
30
  }
16
  $extEnabled = (int) Mage::getStoreConfig(self::XML_PATH_EXTENSION_ENABLED);
17
  $publicKey = Mage::getStoreConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY);
18
 
19
+ if (!$publicKey && (Mage::getSingleton('core/session')->getPublicKey() != '')) {
20
+ $publicKey = Mage::getSingleton('core/session')->getPublicKey();
21
+ }
22
+
23
  if ($extEnabled && (trim($publicKey) != '')) {
24
  return true;
25
  }
29
 
30
  public function getPublicKey()
31
  {
32
+ $publicKey = Mage::getStoreConfig(self::XML_PATH_EXTENSION_PUBLIC_KEY);
33
+ if (!$publicKey && (Mage::getSingleton('core/session')->getPublicKey() != '')) {
34
+ $publicKey = Mage::getSingleton('core/session')->getPublicKey();
35
+ }
36
+
37
+ return $publicKey;
38
  }
39
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>chat_tidio</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>GNU G eneral Public License ( GPL )</license>
7
  <channel>community</channel>
@@ -11,8 +11,8 @@
11
  <notes>Notes </notes>
12
  <authors><author><name>Tytus Go&#x142;as</name><user>tytustytus</user><email>tytus@tidio.net</email></author></authors>
13
  <date>2014-09-08</date>
14
- <time>09:42:36</time>
15
- <contents><target name="magelocal"><dir name="Tidio"><dir name="Chat"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="5421d8ac0ae37604f67267bbe4b736be"/></dir><file name="Script.php" hash="4807b8dcd76f35a5b9d59aa8a7521d26"/></dir><dir name="Helper"><file name="Data.php" hash="4c45ffbb6ea2d5a043f7203842e2c079"/></dir><dir name="etc"><file name="config.xml" hash="835fc57ee214b942d59d0309eab31d1b"/><file name="system.xml" hash="ae343f9c2378f7e99252f8fb57b5f6a0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tidio_Chat.xml" hash="9788abdf12bd16ab9f6a83a908a05d31"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tidio_chat.xml" hash="d969c4490a190e2127fd8e7caa5bf294"/></dir><dir name="template"><dir name="tidiochat"><file name="script.phtml" hash="b02b8e0f7bd476473eee0a0453f3491b"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>chat_tidio</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license>GNU G eneral Public License ( GPL )</license>
7
  <channel>community</channel>
11
  <notes>Notes </notes>
12
  <authors><author><name>Tytus Go&#x142;as</name><user>tytustytus</user><email>tytus@tidio.net</email></author></authors>
13
  <date>2014-09-08</date>
14
+ <time>10:52:48</time>
15
+ <contents><target name="magelocal"><dir name="Tidio"><dir name="Chat"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="05b8d87e2bda65bc7f1e9cd2a9b621d9"/></dir><file name="Script.php" hash="3fdcc9d43158c61fd9c422857a877874"/></dir><dir name="Helper"><file name="Data.php" hash="4c45ffbb6ea2d5a043f7203842e2c079"/></dir><dir name="etc"><file name="config.xml" hash="835fc57ee214b942d59d0309eab31d1b"/><file name="system.xml" hash="ae343f9c2378f7e99252f8fb57b5f6a0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tidio_Chat.xml" hash="9788abdf12bd16ab9f6a83a908a05d31"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tidio_chat.xml" hash="d969c4490a190e2127fd8e7caa5bf294"/></dir><dir name="template"><dir name="tidiochat"><file name="script.phtml" hash="b02b8e0f7bd476473eee0a0453f3491b"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>