Reviews_Sidebar - Version 1.0.6

Version Notes

Minor improvements

Download this release

Release Info

Developer Amasty Ltd.
Extension Reviews_Sidebar
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.7 to 1.0.6

Files changed (48) hide show
  1. app/code/community/Amasty/Review/Block/Sidebar.php +5 -3
  2. app/code/community/Amasty/Review/Helper/Data.php +7 -5
  3. app/code/community/Amasty/Review/Model/Mysql4/Collection.php +5 -3
  4. app/code/community/Amasty/Review/etc/adminhtml.xml +7 -0
  5. app/code/community/Amasty/Review/etc/config.xml +7 -0
  6. app/code/community/Amasty/Review/etc/system.xml +7 -0
  7. app/code/local/Amasty/Base/Block/Adminhtml/Debug/Base.php +12 -0
  8. app/code/local/Amasty/Base/Block/Adminhtml/Debug/Conflict.php +73 -0
  9. app/code/local/Amasty/Base/Block/Adminhtml/Debug/Event.php +19 -0
  10. app/code/local/Amasty/Base/Block/Adminhtml/Debug/General.php +62 -0
  11. app/code/local/Amasty/Base/Block/Adminhtml/Debug/Rewrite.php +19 -0
  12. app/code/local/Amasty/Base/Block/Adminhtml/Promo.php +62 -0
  13. app/code/local/Amasty/Base/Block/Adminhtml/Update.php +62 -0
  14. app/code/local/Amasty/Base/Block/Conflicts.php +34 -0
  15. app/code/local/Amasty/Base/Block/Extensions.php +79 -53
  16. app/code/local/Amasty/Base/Block/Store.php +27 -0
  17. app/code/local/Amasty/Base/Helper/Data.php +164 -2
  18. app/code/local/Amasty/Base/Helper/Module.php +216 -0
  19. app/code/local/Amasty/Base/Helper/Promo.php +27 -0
  20. app/code/local/Amasty/Base/Model/Conflict.php +201 -0
  21. app/code/local/Amasty/Base/Model/Feed.php +53 -85
  22. app/code/local/Amasty/Base/Model/Resource/Event/Collection.php +26 -0
  23. app/code/local/Amasty/Base/Model/Source/Updates/Type.php +0 -66
  24. app/code/local/Amasty/Base/controllers/Adminhtml/Ambase/BaseController.php +106 -0
  25. app/code/local/Amasty/Base/etc/adminhtml.xml +20 -1
  26. app/code/local/Amasty/Base/etc/config.xml +134 -90
  27. app/code/local/Amasty/Base/etc/system.xml +106 -37
  28. app/code/local/Amasty/Base/sql/ambase_setup/mysql4-install-1.0.0.php +6 -0
  29. app/code/local/Amasty/Base/sql/ambase_setup/mysql4-upgrade-1.0.0-1.0.1.php +8 -6
  30. app/design/adminhtml/default/default/layout/amasty/ambase/ambase.xml +39 -0
  31. app/design/adminhtml/default/default/template/amasty/ambase/debug/conflict.phtml +118 -0
  32. app/design/adminhtml/default/default/template/amasty/ambase/debug/event.phtml +28 -0
  33. app/design/adminhtml/default/default/template/amasty/ambase/debug/general.phtml +70 -0
  34. app/design/adminhtml/default/default/template/amasty/ambase/debug/rewrite.phtml +62 -0
  35. app/design/adminhtml/default/default/template/amasty/ambase/promo.phtml +36 -0
  36. app/design/adminhtml/default/default/template/amasty/ambase/update.phtml +41 -0
  37. app/design/frontend/{default → base}/default/layout/amreview.xml +7 -0
  38. app/design/frontend/{default → base}/default/template/amreview/sidebar.phtml +7 -0
  39. app/design/frontend/{default → base}/default/template/amreview/sidebar_images.phtml +7 -0
  40. app/etc/modules/Amasty_Base.xml +8 -1
  41. app/etc/modules/Amasty_Review.xml +15 -8
  42. app/locale/en_US/Amasty_Base.csv +40 -0
  43. app/locale/en_US/Amasty_Review.csv +15 -0
  44. js/amasty/ambase/store.js +7 -0
  45. package.xml +10 -11
  46. skin/adminhtml/default/default/css/amasty/ambase/style.css +76 -0
  47. skin/adminhtml/default/default/images/ambase/amasty.png +0 -0
  48. skin/adminhtml/default/default/images/ambase/shop.png +0 -0
app/code/community/Amasty/Review/Block/Sidebar.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
2
- /**
3
- * @copyright Amasty.
4
- */
 
 
5
  class Amasty_Review_Block_Sidebar extends Mage_Core_Block_Template
6
  {
7
  protected function _prepareLayout()
1
  <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Review
6
+ */
7
  class Amasty_Review_Block_Sidebar extends Mage_Core_Block_Template
8
  {
9
  protected function _prepareLayout()
app/code/community/Amasty/Review/Helper/Data.php CHANGED
@@ -1,7 +1,9 @@
1
- <?php
2
  /**
3
- * @copyright Amasty.
4
- */
5
- class Amasty_Review_Helper_Data extends Mage_Core_Helper_Abstract
6
- {
 
 
7
  }
1
+ <?php
2
  /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Review
6
+ */
7
+ class Amasty_Review_Helper_Data extends Mage_Core_Helper_Abstract
8
+ {
9
  }
app/code/community/Amasty/Review/Model/Mysql4/Collection.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
2
- /**
3
- * @copyright Amasty.
4
- */
 
 
5
  class Amasty_Review_Model_Mysql4_Collection extends Mage_Review_Model_Mysql4_Review_Product_Collection
6
  {
7
  // approved reviews plus visible in catalog products plus url revrites data
1
  <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Review
6
+ */
7
  class Amasty_Review_Model_Mysql4_Collection extends Mage_Review_Model_Mysql4_Review_Product_Collection
8
  {
9
  // approved reviews plus visible in catalog products plus url revrites data
app/code/community/Amasty/Review/etc/adminhtml.xml CHANGED
@@ -1,4 +1,11 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
2
  <config>
3
  <acl>
4
  <resources>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Review
7
+ */
8
+ -->
9
  <config>
10
  <acl>
11
  <resources>
app/code/community/Amasty/Review/etc/config.xml CHANGED
@@ -1,4 +1,11 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <Amasty_Review>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Review
7
+ */
8
+ -->
9
  <config>
10
  <modules>
11
  <Amasty_Review>
app/code/community/Amasty/Review/etc/system.xml CHANGED
@@ -1,4 +1,11 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
2
  <config>
3
  <sections>
4
  <amreview translate="label" module="amreview">
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Review
7
+ */
8
+ -->
9
  <config>
10
  <sections>
11
  <amreview translate="label" module="amreview">
app/code/local/Amasty/Base/Block/Adminhtml/Debug/Base.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Adminhtml_Debug_Base extends Mage_Adminhtml_Block_Widget_Form
8
+ {
9
+ function getClassPath($rewrites, $codePool, $rewriteIndex){
10
+ return Amasty_Base_Model_Conflict::getClassPath($codePool[$rewriteIndex], $rewrites[$rewriteIndex]);
11
+ }
12
+ }
app/code/local/Amasty/Base/Block/Adminhtml/Debug/Conflict.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Adminhtml_Debug_Conflict extends Amasty_Base_Block_Adminhtml_Debug_Base
8
+ {
9
+ public function __construct()
10
+ {
11
+ parent::__construct();
12
+ $this->setTemplate('amasty/ambase/debug/conflict.phtml');
13
+ }
14
+
15
+ function getPossibleConflictsList(){
16
+ return Mage::helper("ambase")->getPossibleConflictsList();
17
+ }
18
+
19
+ function getFixUrl($object, $module, $rewrite){
20
+ return Mage::helper("adminhtml")->getUrl("adminhtml/ambase_base/fix", array(
21
+ "object" => $object,
22
+ "module" => $module,
23
+ "rewrite" => $rewrite
24
+ ));
25
+ }
26
+
27
+ function getRollbackUrl($object, $module, $rewrite){
28
+ return Mage::helper("adminhtml")->getUrl("adminhtml/ambase_base/rollback", array(
29
+ "object" => $object,
30
+ "module" => $module,
31
+ "rewrite" => $rewrite
32
+ ));
33
+ }
34
+
35
+ function hasConflict($rewrites){
36
+ $ret = FALSE;
37
+ foreach($rewrites as $rewrite){
38
+ if (strpos($rewrite, "Amasty") === FALSE){
39
+ $ret = TRUE;
40
+ break;
41
+ }
42
+ }
43
+ return $ret;
44
+ }
45
+
46
+ function conflictResolved($codePool, $rewrites){
47
+ $ret = FALSE;
48
+ krsort($rewrites);
49
+
50
+ $extendsClasses = $rewrites;
51
+
52
+ foreach($rewrites as $rewriteIndex => $class){
53
+ unset($extendsClasses[$rewriteIndex]);
54
+
55
+ if (count($extendsClasses) > 0){
56
+ $classPath = $this->getClassPath($rewrites, $codePool, $rewriteIndex);
57
+ $pureClassName = Amasty_Base_Model_Conflict::getPureClassName($class);
58
+
59
+ $lines = file($classPath);
60
+ foreach($lines as $line)
61
+ {
62
+ if(strpos($line, $pureClassName) !== FALSE){
63
+ $ret = TRUE;
64
+ break;
65
+ }
66
+ }
67
+ }
68
+ }
69
+
70
+ return $ret;
71
+ }
72
+ }
73
+ ?>
app/code/local/Amasty/Base/Block/Adminhtml/Debug/Event.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Adminhtml_Debug_Event extends Mage_Adminhtml_Block_Widget_Form
8
+ {
9
+ public function __construct()
10
+ {
11
+ parent::__construct();
12
+ $this->setTemplate('amasty/ambase/debug/event.phtml');
13
+ }
14
+
15
+ function getEventsList()
16
+ {
17
+ return Mage::helper('ambase')->getEventsList();
18
+ }
19
+ }
app/code/local/Amasty/Base/Block/Adminhtml/Debug/General.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Adminhtml_Debug_General extends Amasty_Base_Block_Adminhtml_Debug_Base
8
+ {
9
+ public function __construct()
10
+ {
11
+ parent::__construct();
12
+ $this->setTemplate('amasty/ambase/debug/general.phtml');
13
+ }
14
+
15
+ function getDisableModulesOutput() {
16
+ $config = array();
17
+
18
+ $resource = Mage::getSingleton('core/resource');
19
+ $readConnection = $resource->getConnection('core_read');
20
+
21
+ $tableName = $resource->getTableName('core/config_data');
22
+
23
+ $query = "SELECT * FROM " . $tableName . " WHERE path LIKE '%advanced/modules_disable_output%' AND value = 1";
24
+
25
+ $data = $readConnection->fetchAll($query);
26
+
27
+ foreach($data as $item){
28
+ $config[] = array(
29
+ "name" => str_replace("advanced/modules_disable_output/", "", $item["path"])
30
+ );
31
+ }
32
+
33
+ return $config;
34
+ }
35
+
36
+ function isCompilationEnabled() {
37
+ $ret = FALSE;
38
+
39
+ $configFile = BP . DS . 'includes' . DS . 'config.php';
40
+ if (file_exists($configFile)){
41
+ $config = file_get_contents($configFile);
42
+ $ret = strpos($config, "#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src')") === FALSE;
43
+ }
44
+
45
+ return $ret;
46
+ }
47
+
48
+ function getCrontabConfig() {
49
+
50
+ $resource = Mage::getSingleton('core/resource');
51
+ $readConnection = $resource->getConnection('core_read');
52
+
53
+ $tableName = $resource->getTableName('cron/schedule');
54
+
55
+ $query = "SELECT * FROM " . $tableName . " order by schedule_id desc limit 5";
56
+
57
+ $data = $readConnection->fetchAll($query);
58
+
59
+ return $data;
60
+ }
61
+
62
+ }
app/code/local/Amasty/Base/Block/Adminhtml/Debug/Rewrite.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Adminhtml_Debug_Rewrite extends Amasty_Base_Block_Adminhtml_Debug_Base
8
+ {
9
+ public function __construct()
10
+ {
11
+ parent::__construct();
12
+ $this->setTemplate('amasty/ambase/debug/rewrite.phtml');
13
+ }
14
+
15
+ function getRewritesList(){
16
+ return Mage::helper("ambase")->getRewritesList();
17
+ }
18
+ }
19
+ ?>
app/code/local/Amasty/Base/Block/Adminhtml/Promo.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Adminhtml_Promo extends Mage_Adminhtml_Block_Widget_Form
8
+ {
9
+ protected $_promoHelper;
10
+
11
+ protected function _getPromoHelper()
12
+ {
13
+ if (!$this->_promoHelper)
14
+ {
15
+ $this->_promoHelper = Mage::helper("ambase/promo");
16
+ }
17
+
18
+ return $this->_promoHelper;
19
+ }
20
+
21
+ function getLatestNotification()
22
+ {
23
+ $ret = null;
24
+
25
+ $mageNotifications = !Mage::getStoreConfig('advanced/modules_disable_output/Mage_AdminNotification');
26
+
27
+ $collection = $this->_getPromoHelper()->getNotificationsCollection();
28
+
29
+ $collection->getSelect()
30
+
31
+ ->order('notification_id DESC')
32
+ ->limit(1);
33
+
34
+ if ($this->isSubscribed() && !$mageNotifications)
35
+ {
36
+ $items = array_values($collection->getItems());
37
+
38
+ $ret = count($items) > 0 ? $items[0] : null;
39
+ }
40
+
41
+ return $ret;
42
+ }
43
+
44
+ function getCloseUrl()
45
+ {
46
+ return Mage::helper("adminhtml")->getUrl("adminhtml/ambase_base/closePromo", array(
47
+ ));
48
+ }
49
+
50
+ function getUnsubscribeUrl()
51
+ {
52
+ return Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/ambase", array(
53
+
54
+ ));
55
+ }
56
+
57
+ function isSubscribed()
58
+ {
59
+ return $this->_getPromoHelper()->isSubscribed();
60
+ }
61
+
62
+ }
app/code/local/Amasty/Base/Block/Adminhtml/Update.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Adminhtml_Update extends Mage_Adminhtml_Block_Widget_Form
8
+ {
9
+ protected $_moduleHelper;
10
+
11
+ protected function _getModuleHelper()
12
+ {
13
+ if (!$this->_moduleHelper)
14
+ {
15
+ $controllerModule = Mage::app()->getRequest()->getControllerModule();
16
+ $this->_moduleHelper = Mage::helper("ambase/module")->init($controllerModule);
17
+ }
18
+
19
+ return $this->_moduleHelper;
20
+ }
21
+
22
+ function isNewVersionAvailable()
23
+ {
24
+ return $this->isSubscribed() && $this->_getModuleHelper()->isNewVersionAvailable();
25
+ }
26
+
27
+ function getModuleTitle()
28
+ {
29
+ return $this->_getModuleHelper()->getModuleTitle();
30
+ }
31
+
32
+ function getModuleLink()
33
+ {
34
+ return $this->_getModuleHelper()->getModuleLink();
35
+ }
36
+
37
+ function getModuleCode()
38
+ {
39
+ return $this->_getModuleHelper()->getModuleCode();
40
+ }
41
+
42
+ function getLatestVersion()
43
+ {
44
+ return $this->_getModuleHelper()->getLatestVersion();
45
+ }
46
+
47
+ function getCloseUrl(){
48
+ return Mage::helper("adminhtml")->getUrl("adminhtml/ambase_base/closeUpdate", array(
49
+ 'code' => $this->getModuleCode()
50
+ ));
51
+ }
52
+
53
+ function getUnsubscribeUrl(){
54
+ return Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/ambase", array(
55
+
56
+ ));
57
+ }
58
+
59
+ function isSubscribed(){
60
+ return $this->_getModuleHelper()->isSubscribed();
61
+ }
62
+ }
app/code/local/Amasty/Base/Block/Conflicts.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Conflicts extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
8
+ {
9
+ public function render(Varien_Data_Form_Element_Abstract $element)
10
+ {
11
+ $autoload = Mage::app()->getRequest()->getParam('autoload');
12
+
13
+ $helper = Mage::helper("ambase");
14
+ $html = $this->_getHeaderHtml($element);
15
+
16
+ $ajaxUrl = Mage::helper("adminhtml")->getUrl("adminhtml/ambase_base/ajax");
17
+ $html.= '<div id="ambase_conflicts_container"></div>';
18
+ $html.= '<button id="ambase_conflicts_show" type="button" class="scalable" onclick="ambaseShow(\''.$ajaxUrl.'\')" style=""><span><span><span>'.$helper->__("Show").'</span></span></span></button>&nbsp;&nbsp;&nbsp;';
19
+
20
+ if ($autoload){
21
+ $html .= "<script>
22
+ Event.observe(window, 'load', function(){
23
+ $('ambase_conflicts-head').click();
24
+ $('ambase_conflicts_show').click();
25
+ });
26
+ </script>";
27
+ }
28
+
29
+ // $html .= Mage::getUrl('adminhtml/ambase/download');
30
+ // $html.= Amasty_Base_Model_Conflicts::run();
31
+ $html .= $this->_getFooterHtml($element);
32
+ return $html;
33
+ }
34
+ }
app/code/local/Amasty/Base/Block/Extensions.php CHANGED
@@ -1,29 +1,42 @@
1
  <?php
2
- /**
3
- * @copyright Copyright (c) 2010 Amasty
 
 
4
  */
5
  class Amasty_Base_Block_Extensions extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
6
  {
7
- protected $_dummyElement;
8
- protected $_fieldRenderer;
9
- protected $_values;
10
 
11
  public function render(Varien_Data_Form_Element_Abstract $element)
12
  {
13
- $html = $this->_getHeaderHtml($element);
14
- $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
15
- sort($modules);
16
 
17
  foreach ($modules as $moduleName) {
18
- if (strstr($moduleName, 'Amasty_') === false) {
19
- continue;
20
- }
21
-
22
- if ($moduleName == 'Amasty_Base'){
23
- continue;
24
- }
25
-
26
- $html.= $this->_getFieldHtml($element, $moduleName);
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
  $html .= $this->_getFooterHtml($element);
29
 
@@ -32,61 +45,74 @@ class Amasty_Base_Block_Extensions extends Mage_Adminhtml_Block_System_Config_Fo
32
 
33
  protected function _getFieldRenderer()
34
  {
35
- if (empty($this->_fieldRenderer)) {
36
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
37
- }
38
- return $this->_fieldRenderer;
39
  }
40
 
41
- protected function _getFieldHtml($fieldset, $moduleCode)
42
  {
43
- $currentVer = Mage::getConfig()->getModuleConfig($moduleCode)->version;
44
- if (!$currentVer)
45
  return '';
46
-
47
- $moduleName = substr($moduleCode, strpos($moduleCode, '_') + 1); // in case we have no data in the RSS
48
-
49
- $allExtensions = unserialize(Mage::app()->loadCache('ambase_extensions'));
50
-
 
 
 
 
 
 
 
 
 
 
51
  $status = '<a target="_blank"><img src="'.$this->getSkinUrl('images/ambase/ok.gif').'" title="'.$this->__("Installed").'"/></a>';
52
 
53
- if ($allExtensions && isset($allExtensions[$moduleCode])){
54
- $ext = $allExtensions[$moduleCode];
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  $url = $ext['url'];
57
  $name = $ext['name'];
58
  $lastVer = $ext['version'];
59
 
60
  $moduleName = '<a href="'.$url.'" target="_blank" title="'.$name.'">'.$name."</a>";
61
-
62
- if ($this->_convertVersion($currentVer) < $this->_convertVersion($lastVer)){
63
  $status = '<a href="'.$url.'" target="_blank"><img src="'.$this->getSkinUrl('images/ambase/update.gif').'" alt="'.$this->__("Update available").'" title="'.$this->__("Update available").'"/></a>';
64
  }
65
  }
66
-
67
- //TODO check if module output disabled in future
 
 
 
68
 
69
  $moduleName = $status . ' ' . $moduleName;
70
-
71
- $field = $fieldset->addField($moduleCode, 'label', array(
72
  'name' => 'dummy',
73
  'label' => $moduleName,
74
  'value' => $currentVer,
75
- ))->setRenderer($this->_getFieldRenderer());
76
-
77
- return $field->toHtml();
78
  }
79
-
80
- protected function _convertVersion($v)
81
- {
82
- $digits = @explode(".", $v);
83
- $version = 0;
84
- if (is_array($digits)){
85
- foreach ($digits as $k=>$v){
86
- $version += ($v * pow(10, max(0, (3-$k))));
87
- }
88
-
89
- }
90
- return $version;
91
- }
92
  }
1
  <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
  */
7
  class Amasty_Base_Block_Extensions extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
8
  {
9
+ protected $_dummyElement;
10
+ protected $_fieldRenderer;
11
+ protected $_values;
12
 
13
  public function render(Varien_Data_Form_Element_Abstract $element)
14
  {
15
+ $html = $this->_getHeaderHtml($element);
16
+ $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
17
+ sort($modules);
18
 
19
  foreach ($modules as $moduleName) {
20
+ if (strstr($moduleName, 'Amasty_') === false) {
21
+ if(strstr($moduleName, 'Belitsoft_') === false){
22
+ if(strstr($moduleName, 'Mageplace_') === false){
23
+ if(strstr($moduleName, 'Magpleasure_') === false) {
24
+ continue;
25
+ }
26
+ }
27
+ }
28
+ }
29
+
30
+ if (in_array($moduleName, array(
31
+ 'Amasty_Base', 'Magpleasure_Common', 'Magpleasure_Searchcore'
32
+ ))) {
33
+ continue;
34
+ }
35
+
36
+ if ((string)Mage::getConfig()->getModuleConfig($moduleName)->is_system == 'true')
37
+ continue;
38
+
39
+ $html.= $this->_getFieldHtml($element, $moduleName);
40
  }
41
  $html .= $this->_getFooterHtml($element);
42
 
45
 
46
  protected function _getFieldRenderer()
47
  {
48
+ if (empty($this->_fieldRenderer)) {
49
+ $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
50
+ }
51
+ return $this->_fieldRenderer;
52
  }
53
 
54
+ protected function _getFieldHtml($fieldset, $moduleCode)
55
  {
56
+ $currentVer = Mage::getConfig()->getModuleConfig($moduleCode)->version;
57
+ if (!$currentVer)
58
  return '';
59
+
60
+ // in case we have no data in the RSS
61
+ $moduleName = (string)Mage::getConfig()->getNode('modules/' . $moduleCode . '/name');
62
+ if ($moduleName) {
63
+ $name = $moduleName;
64
+ $url = (string)Mage::getConfig()->getNode('modules/' . $moduleCode . '/url');
65
+ $moduleName = '<a href="' . $url . '" target="_blank" title="' . $name . '">' . $name . "</a>";
66
+ } else {
67
+ $moduleName = substr($moduleCode, strpos($moduleCode, '_') + 1);
68
+ }
69
+
70
+ $baseKey = (string)Mage::getConfig()->getNode('modules/' . $moduleCode . '/baseKey');
71
+
72
+ $allExtensions = Amasty_Base_Helper_Module::getAllExtensions();
73
+
74
  $status = '<a target="_blank"><img src="'.$this->getSkinUrl('images/ambase/ok.gif').'" title="'.$this->__("Installed").'"/></a>';
75
 
76
+ if ($allExtensions && isset($allExtensions[$moduleCode])){
77
+
78
+ $ext = array();
79
+
80
+ if (is_array($allExtensions[$moduleCode]) && !array_key_exists('name', $allExtensions[$moduleCode])){
81
+
82
+ if (!empty($baseKey) && isset($allExtensions[$moduleCode][$baseKey])){
83
+ $ext = $allExtensions[$moduleCode][$baseKey];
84
+
85
+ } else {
86
+ $ext = end($allExtensions[$moduleCode]);
87
+ }
88
+ } else {
89
+ $ext = $allExtensions[$moduleCode];
90
+ }
91
 
92
  $url = $ext['url'];
93
  $name = $ext['name'];
94
  $lastVer = $ext['version'];
95
 
96
  $moduleName = '<a href="'.$url.'" target="_blank" title="'.$name.'">'.$name."</a>";
97
+
98
+ if (version_compare($currentVer, $lastVer, '<')) {
99
  $status = '<a href="'.$url.'" target="_blank"><img src="'.$this->getSkinUrl('images/ambase/update.gif').'" alt="'.$this->__("Update available").'" title="'.$this->__("Update available").'"/></a>';
100
  }
101
  }
102
+
103
+ // in case if module output disabled
104
+ if (Mage::getStoreConfig('advanced/modules_disable_output/' . $moduleCode)) {
105
+ $status = '<a target="_blank"><img src="' . $this->getSkinUrl('images/ambase/bad.gif') . '" alt="' . $this->__('Output disabled') . '" title="' . $this->__('Output disabled') . '"/></a>';
106
+ }
107
 
108
  $moduleName = $status . ' ' . $moduleName;
109
+
110
+ $field = $fieldset->addField($moduleCode, 'label', array(
111
  'name' => 'dummy',
112
  'label' => $moduleName,
113
  'value' => $currentVer,
114
+ ))->setRenderer($this->_getFieldRenderer());
115
+
116
+ return $field->toHtml();
117
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  }
app/code/local/Amasty/Base/Block/Store.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Block_Store extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
8
+ {
9
+ protected $_dummyElement;
10
+ protected $_fieldRenderer;
11
+ protected $_values;
12
+
13
+ public function render(Varien_Data_Form_Element_Abstract $element)
14
+ {
15
+ $html = "<iframe id='amasty_store' src='//amasty.com/store/'></iframe>";
16
+
17
+ return $html;
18
+ }
19
+
20
+ protected function _getFieldRenderer()
21
+ {
22
+ if (empty($this->_fieldRenderer)) {
23
+ $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
24
+ }
25
+ return $this->_fieldRenderer;
26
+ }
27
+ }
app/code/local/Amasty/Base/Helper/Data.php CHANGED
@@ -1,7 +1,169 @@
1
  <?php
2
- /**
3
- * @copyright Copyright (c) 2010 Amasty (http://www.amasty.com)
 
 
4
  */
5
  class Amasty_Base_Helper_Data extends Mage_Core_Helper_Abstract
6
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  }
1
  <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
  */
7
  class Amasty_Base_Helper_Data extends Mage_Core_Helper_Abstract
8
  {
9
+ public function isVersionLessThan($major=1, $minor=4)
10
+ {
11
+ $curr = explode('.', Mage::getVersion()); // 1.3. compatibility
12
+ $need = func_get_args();
13
+ foreach ($need as $k => $v){
14
+ if ($curr[$k] != $v)
15
+ return ($curr[$k] < $v);
16
+ }
17
+ return false;
18
+ }
19
+
20
+ public function isModuleActive($code)
21
+ {
22
+ return ('true' == (string)Mage::getConfig()->getNode('modules/'.$code.'/active'));
23
+ }
24
+
25
+ function getRewritesList(){
26
+ $moduleFiles = glob(Mage::getBaseDir('etc') . DS . 'modules' . DS . '*.xml');
27
+
28
+ if (!$moduleFiles) {
29
+ return false;
30
+ }
31
+
32
+ // load file contents
33
+ $unsortedConfig = new Varien_Simplexml_Config();
34
+ $unsortedConfig->loadString('<config/>');
35
+ $fileConfig = new Varien_Simplexml_Config();
36
+
37
+ foreach($moduleFiles as $filePath) {
38
+ $fileConfig->loadFile($filePath);
39
+ $unsortedConfig->extend($fileConfig);
40
+ }
41
+
42
+ // create sorted config [only active modules]
43
+ $sortedConfig = new Varien_Simplexml_Config();
44
+ $sortedConfig->loadString('<config><modules/></config>');
45
+
46
+ foreach ($unsortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
47
+ if('true' === (string)$moduleNode->active) {
48
+ $sortedConfig->getNode('modules')->appendChild($moduleNode);
49
+ }
50
+ }
51
+
52
+ $fileConfig = new Varien_Simplexml_Config();
53
+
54
+ $_finalResult = array();
55
+
56
+ foreach($sortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
57
+ $codePool = (string)$moduleNode->codePool;
58
+ $configPath = BP . DS . 'app' . DS . 'code' . DS . $codePool . DS . uc_words($moduleName, DS) . DS . 'etc' . DS . 'config.xml';
59
+
60
+ $fileConfig->loadFile($configPath);
61
+
62
+ $rewriteBlocks = array('blocks', 'models', 'helpers');
63
+
64
+ foreach($rewriteBlocks as $param) {
65
+ if(!isset($_finalResult[$param])) {
66
+ $_finalResult[$param] = array();
67
+ }
68
+
69
+ if($rewrites = $fileConfig->getXpath('global/' . $param . '/*/rewrite')) {
70
+ foreach ($rewrites as $rewrite) {
71
+ $parentElement = $rewrite->xpath('../..');
72
+ foreach($parentElement[0] as $moduleKey => $moduleItems) {
73
+ $moduleItemsArray['rewrite'] = array();
74
+ $moduleItemsArray['codePool'] = array();
75
+ foreach ($moduleItems->rewrite as $rewriteLine)
76
+ {
77
+ foreach ($rewriteLine as $key => $value)
78
+ {
79
+ $moduleItemsArray['rewrite'][$key] = (string)$value;
80
+ $moduleItemsArray['codePool'][$key] = $codePool;
81
+ }
82
+ }
83
+ if($moduleItems->rewrite) {
84
+ $_finalResult[$param] = array_merge_recursive($_finalResult[$param], array($moduleKey => $moduleItemsArray));
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ return $_finalResult;
93
+ }
94
+
95
+ /**
96
+ * Retrive possible conflicts list
97
+ *
98
+ * @return array
99
+ */
100
+ function getPossibleConflictsList()
101
+ {
102
+ $_finalResult = $this->getRewritesList();
103
+
104
+ foreach(array_keys($_finalResult) as $groupType) {
105
+
106
+ foreach(array_keys($_finalResult[$groupType]) as $key) {
107
+ // remove some repeating elements after merging all parents
108
+ foreach($_finalResult[$groupType][$key]['rewrite'] as $key1 => $value) {
109
+ if(is_array($value)) {
110
+ $_finalResult[$groupType][$key]['rewrite'][$key1] = array_unique($value);
111
+ }
112
+
113
+ // if rewrites count < 2 - no conflicts - remove
114
+ if(
115
+ (gettype($_finalResult[$groupType][$key]['rewrite'][$key1]) == 'array' && count($_finalResult[$groupType][$key]['rewrite'][$key1]) < 2)
116
+ ||
117
+ gettype($_finalResult[$groupType][$key]['rewrite'][$key1]) == 'string'
118
+ ) {
119
+ unset($_finalResult[$groupType][$key]['rewrite'][$key1]);
120
+ unset($_finalResult[$groupType][$key]['codePool'][$key1]);
121
+ }
122
+ }
123
+
124
+ // clear empty elements
125
+ if(count($_finalResult[$groupType][$key]['rewrite']) < 1) {
126
+ unset($_finalResult[$groupType][$key]);
127
+ }
128
+
129
+
130
+ }
131
+
132
+ // clear empty elements
133
+ if(count($_finalResult[$groupType]) < 1) {
134
+ unset($_finalResult[$groupType]);
135
+ }
136
+
137
+ }
138
+
139
+ return $_finalResult;
140
+ }
141
+
142
+ public function ajaxHtml(){
143
+ return Mage::app()->getLayout()->createBlock('ambase/adminhtml_debug_general')->toHtml() .
144
+ Mage::app()->getLayout()->createBlock('ambase/adminhtml_debug_conflict')->toHtml() .
145
+ Mage::app()->getLayout()->createBlock('ambase/adminhtml_debug_rewrite')->toHtml() .
146
+ Mage::app()->getLayout()->createBlock('ambase/adminhtml_debug_event')->toHtml();
147
+ }
148
+
149
+ public function getParentClasses($class){
150
+ return array_values(class_parents($class));
151
+ }
152
+
153
+ public function getEventsList()
154
+ {
155
+ $scopes = array(
156
+ 'global',
157
+ 'frontend',
158
+ 'adminhtml',
159
+ );
160
+ $collection = Mage::getResourceModel('ambase/event_collection');
161
+
162
+ $data = array();
163
+ foreach ($scopes as $scope) {
164
+ $data = array_merge($data, $collection->_prepareData($scope));
165
+ }
166
+
167
+ return $data;
168
+ }
169
  }
app/code/local/Amasty/Base/Helper/Module.php ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Helper_Module extends Mage_Core_Helper_Abstract
8
+ {
9
+ const INSTALLED_PATH = 'ambase/feed/installed';
10
+ const EXTENSIONS_PATH = 'ambase_extensions';
11
+ const UPDATED_PREFIX = 'ambase/feed/updated_';
12
+
13
+ const URL_EXTENSIONS = 'http://amasty.com/feed-extensions.xml';
14
+ const BASE_MODULE_PERIOD = 3;
15
+ const MODULE_PERIOD = 1;
16
+
17
+ protected $_controllerModule;
18
+ protected $_extension = array(
19
+ 'name' => null,
20
+ 'url' => null,
21
+ 'version' => null
22
+ );
23
+
24
+
25
+ function init($controllerModule)
26
+ {
27
+ $segments = explode('_', $controllerModule);
28
+ $controllerModule = implode('_', array_slice($segments, 0, 2));
29
+ $this->_controllerModule = $controllerModule;
30
+ return $this;
31
+ }
32
+
33
+ static function reload()
34
+ {
35
+ $feedData = array();
36
+ $feedXml = self::getFeedData();
37
+ if ($feedXml && $feedXml->channel && $feedXml->channel->item)
38
+ {
39
+ foreach ($feedXml->channel->item as $item) {
40
+ $code = (string)$item->code;
41
+
42
+ if (!isset($feedData[$code])){
43
+ $feedData[$code] = array();
44
+ }
45
+
46
+ $feedData[$code][(string)$item->title] = array(
47
+ 'name' => (string)$item->title,
48
+ 'url' => (string)$item->link,
49
+ 'version' => (string)$item->version,
50
+ );
51
+ }
52
+
53
+ if ($feedData)
54
+ {
55
+ Mage::app()->saveCache(serialize($feedData), self::EXTENSIONS_PATH);
56
+ }
57
+ }
58
+ }
59
+
60
+
61
+ static function getFeedData()
62
+ {
63
+ if (!extension_loaded('curl')) {
64
+ return null;
65
+ }
66
+
67
+ $curl = new Varien_Http_Adapter_Curl();
68
+ $curl->setConfig(array(
69
+ 'timeout' => 2
70
+ ));
71
+ $curl->write(Zend_Http_Client::GET, self::URL_EXTENSIONS, '1.0');
72
+ $data = $curl->read();
73
+ if ($data === false) {
74
+ return false;
75
+ }
76
+ $data = preg_split('/^\r?$/m', $data, 2);
77
+ $data = trim($data[1]);
78
+ $curl->close();
79
+
80
+ try {
81
+ $xml = new SimpleXMLElement($data);
82
+ }
83
+ catch (Exception $e) {
84
+ return false;
85
+ }
86
+
87
+ return $xml;
88
+ }
89
+
90
+ static function getAllExtensions()
91
+ {
92
+ $ret = @unserialize(Mage::app()->loadCache(self::EXTENSIONS_PATH));
93
+
94
+ if (!$ret)
95
+ {
96
+ self::reload();
97
+ $ret = @unserialize(Mage::app()->loadCache(self::EXTENSIONS_PATH));
98
+ }
99
+
100
+ return $ret;
101
+ }
102
+
103
+ protected function _getExtension()
104
+ {
105
+ if (!$this->_extension || $this->_extension['name'] === null)
106
+ {
107
+ $allExtensions = self::getAllExtensions();
108
+
109
+ if (isset($allExtensions[$this->_controllerModule]))
110
+ {
111
+ $this->_extension = array_pop($allExtensions[$this->_controllerModule]);
112
+ }
113
+ }
114
+ return $this->_extension;
115
+ }
116
+
117
+ function getModuleCode()
118
+ {
119
+ $item = $this->_getExtension();
120
+ return $this->_controllerModule;
121
+ }
122
+
123
+ function getModuleTitle()
124
+ {
125
+ $item = $this->_getExtension();
126
+ return (string) ($item ? $item['name'] : null);
127
+ }
128
+
129
+ function getModuleLink()
130
+ {
131
+ $item = $this->_getExtension();
132
+ return (string) ($item ? $item['url'] : null);
133
+ }
134
+
135
+ function getLatestVersion()
136
+ {
137
+ $item = $this->_getExtension();
138
+ return (string) ($item ? $item['version'] : null);
139
+ }
140
+
141
+ protected function _getInstalledVersion()
142
+ {
143
+ $ret = null;
144
+ $modules = (array)Mage::getConfig()->getNode('modules')->children();
145
+ $moduleCode = $this->getModuleCode();
146
+ if (isset($modules[$moduleCode]))
147
+ {
148
+ $ret = (string)$modules[$moduleCode]->version;
149
+ }
150
+ return $ret;
151
+ }
152
+
153
+ protected function _isAmastyModule()
154
+ {
155
+ return strpos($this->_controllerModule, "Amasty") !== FALSE && $this->_getInstalledVersion() !== NULL;
156
+ }
157
+
158
+ static function baseModuleInstalled()
159
+ {
160
+ $ret = Mage::getStoreConfig(Amasty_Base_Helper_Module::INSTALLED_PATH);
161
+ if (!$ret)
162
+ {
163
+ $ret = time();
164
+ Mage::getConfig()->saveConfig(Amasty_Base_Helper_Module::INSTALLED_PATH, $ret);
165
+ Mage::getConfig()->cleanCache();
166
+ }
167
+ return $ret;
168
+ }
169
+
170
+ function moduleUpdated()
171
+ {
172
+ $path = Amasty_Base_Helper_Module::UPDATED_PREFIX . $this->_controllerModule;
173
+ $ret = Mage::getStoreConfig($path);
174
+ if (!$ret)
175
+ {
176
+ $this->setModuleUpdated();
177
+ }
178
+ return $ret;
179
+ }
180
+
181
+ function setModuleUpdated()
182
+ {
183
+ $path = Amasty_Base_Helper_Module::UPDATED_PREFIX . $this->_controllerModule;
184
+ Mage::getConfig()->saveConfig($path, time());
185
+ Mage::getConfig()->cleanCache();
186
+ }
187
+
188
+ protected function _validateBaseModulePeriod()
189
+ {
190
+ return strtotime("+" . self::BASE_MODULE_PERIOD . " month" , self::baseModuleInstalled()) < time();
191
+ }
192
+
193
+ protected function _validateModulePeriod()
194
+ {
195
+ return strtotime("+" . self::MODULE_PERIOD . " month" , self::moduleUpdated()) < time();
196
+ }
197
+
198
+ function isNewVersionAvailable()
199
+ {
200
+ $ret = false;
201
+ if ($this->_isAmastyModule() && $this->_validateBaseModulePeriod() && $this->_validateModulePeriod())
202
+ {
203
+ if (version_compare($this->getLatestVersion(), $this->_getInstalledVersion(), 'gt'))
204
+ {
205
+
206
+ $ret = true;
207
+ }
208
+ }
209
+ return $ret;
210
+ }
211
+
212
+ function isSubscribed()
213
+ {
214
+ return Mage::getStoreConfig('ambase/feed/update') == 1;
215
+ }
216
+ }
app/code/local/Amasty/Base/Helper/Promo.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Helper_Promo extends Mage_Core_Helper_Abstract
8
+ {
9
+ function getNotificationsCollection()
10
+ {
11
+ $collection = Mage::getModel("adminnotification/inbox")->getCollection();
12
+
13
+ $collection->getSelect()
14
+ ->where('title like "%amasty%" or description like "%amasty%" or url like "%amasty%"')
15
+ ->where('is_read != 1')
16
+ ->where('is_remove != 1');
17
+
18
+ return $collection;
19
+ }
20
+
21
+ function isSubscribed()
22
+ {
23
+ return Mage::getStoreConfig('ambase/feed/promo') == 1;
24
+ }
25
+ }
26
+
27
+ ?>
app/code/local/Amasty/Base/Model/Conflict.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+
8
+ class Amasty_Base_Model_Conflict{
9
+ protected $_log = array();
10
+ protected $_beforeCode = '/* added automatically by conflict fixing tool */ ';
11
+
12
+ protected function _log($m){
13
+ $this->_log[] = $m;
14
+ Mage::log($m, null, 'amasty_conflict_checker.log');
15
+ }
16
+
17
+ function log(){
18
+ return $this->_log;
19
+ }
20
+
21
+ protected function _getRewriteConfig($object, $module, $rewrite){
22
+ $ret = array(
23
+ "classes" => null,
24
+ "codePool" => null
25
+ );
26
+ $conflictsList = Mage::helper("ambase")->getPossibleConflictsList();
27
+ if (isset($conflictsList[$object]) &&
28
+ isset($conflictsList[$object][$module]) &&
29
+ isset($conflictsList[$object][$module]["rewrite"][$rewrite])){
30
+
31
+ $rewriteClasses = $conflictsList[$object][$module]["rewrite"][$rewrite];
32
+ $codePool = $conflictsList[$object][$module]["codePool"][$rewrite];
33
+
34
+ krsort($rewriteClasses);
35
+
36
+ $ret["classes"] = $rewriteClasses;
37
+ $ret["codePool"] = $codePool;
38
+
39
+
40
+ } else {
41
+ throw new Exception("Conflict not found");
42
+ }
43
+
44
+ return $ret;
45
+ }
46
+
47
+ protected function _checkPermissions($config){
48
+ foreach($config["classes"] as $rewriteIndex => $rewriteClass){
49
+ $classPath = self::getClassPath($config['codePool'][$rewriteIndex], $rewriteClass);
50
+
51
+ if (!is_writable($classPath)){
52
+ Mage::throwException('Please add write permissions on the file ' . $classPath);
53
+ }
54
+ }
55
+ }
56
+
57
+ public function fix($object, $module, $rewrite){
58
+
59
+ $config = $this->_getRewriteConfig($object, $module, $rewrite);
60
+
61
+ $this->_checkPermissions($config);
62
+
63
+ $extendsClasses = $config["classes"];
64
+
65
+ foreach($config["classes"] as $rewriteIndex => $rewriteClass){
66
+ unset($extendsClasses[$rewriteIndex]);
67
+
68
+ if (count($extendsClasses) > 0)
69
+ $this->_applyFix($rewriteClass, $extendsClasses, $rewriteIndex, $config["codePool"]);
70
+ }
71
+ }
72
+
73
+ public function rollback($object, $module, $rewrite){
74
+ $config = $this->_getRewriteConfig($object, $module, $rewrite);
75
+
76
+ $this->_checkPermissions($config);
77
+
78
+ $extendsClasses = $config["classes"];
79
+
80
+ foreach($config["classes"] as $rewriteIndex => $rewriteClass){
81
+ unset($extendsClasses[$rewriteIndex]);
82
+
83
+ if (count($extendsClasses) > 0) {
84
+ $classPath = self::getClassPath($config['codePool'][$rewriteIndex], $rewriteClass);
85
+ $backupPath = $this->_getBackupFileName($classPath);
86
+ $backupFixedPath = $this->_getBackupFixedFileName($classPath);
87
+
88
+ if (file_exists($backupPath)){
89
+ rename($classPath, $backupFixedPath);
90
+ $this->_log($classPath . " renamed to " . $backupFixedPath);
91
+ rename($backupPath, $classPath);
92
+ $this->_log($backupPath . " renamed to " . $classPath);
93
+ } else {
94
+ if (file_exists($backupFixedPath)){
95
+ $this->_log("Rollback already completed: " . $classPath);
96
+ } else {
97
+ throw new Exception("Backup not found:" . $backupPath);
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }
103
+
104
+ static function getClassPath($pool, $class){
105
+ return BP . DS . 'app' . DS . 'code' . DS . $pool . DS . uc_words($class, DS) . '.php';
106
+ }
107
+
108
+ protected function _applyFix($class, $extends, $rewriteIndex, $codePool){
109
+ $classPath = self::getClassPath($codePool[$rewriteIndex], $class);
110
+
111
+ if (file_exists($classPath)){
112
+ $parentClasses = Mage::helper("ambase")->getParentClasses($class);
113
+ if (count($parentClasses) > 0){
114
+
115
+ $this->_createPureClass($class, $parentClasses, $classPath, $extends);
116
+ $this->_overwriteExistingClass($class, $parentClasses, $classPath);
117
+ } else {
118
+ throw new Exception("Parent class not found:" . $class);
119
+ }
120
+ } else {
121
+ throw new Exception("Wrong class path:" . $classPath);
122
+ }
123
+ }
124
+
125
+ protected function _createPureClass($class, $parentClasses, $classPath, $extends){
126
+ $tplClass = "class :pure_class extends :extend_class {}";
127
+ $tpl = "if (Mage::getConfig()->getNode('modules/:extend_module/active')) {
128
+ " . $tplClass . "
129
+ }";
130
+
131
+
132
+ $classDir = str_replace(".php", "", $classPath);
133
+
134
+ $purePath = $classDir . DS . "Amasty". DS . "Pure.php";
135
+
136
+ if (!file_exists($classDir)){
137
+ mkdir($classDir);
138
+ $this->_log("Dir created: " . $classDir);
139
+ }
140
+
141
+ if (!file_exists($classDir . DS . "Amasty")){
142
+ mkdir($classDir . DS . "Amasty");
143
+ $this->_log("Dir created: " . $classDir . DS . "Amasty");
144
+ }
145
+
146
+ $pureClassData = array();
147
+
148
+ foreach($extends as $extendClass){
149
+ $moduleName = implode("_", array_slice(explode("_", $extendClass), 0, 2));
150
+ $params = array(
151
+ ":class" => $class,
152
+ ":extend_module" => $moduleName,
153
+ ":extend_class" => $extendClass,
154
+ ":pure_class" => self::getPureClassName($class),
155
+
156
+
157
+ );
158
+ $pureClassData [] = strtr($tpl, $params);
159
+ }
160
+
161
+ $pureClassCode = implode(" else ", $pureClassData);
162
+
163
+ $pureClassCode .= " else { " . strtr($tplClass, array(
164
+ ":pure_class" => self::getPureClassName($class),
165
+ ":extend_class" => $parentClasses[0]
166
+ )) . " }";
167
+
168
+ file_put_contents($purePath, "<?php " . $this->_beforeCode . $pureClassCode . " ?>");
169
+
170
+ $this->_log("File created: " . $purePath);
171
+
172
+ }
173
+
174
+ protected function _overwriteExistingClass($class, $parentClasses, $classPath){
175
+ $classCode = file_get_contents($classPath);
176
+
177
+ $classCodeNew = strtr($classCode, array(
178
+ $parentClasses[0] => self::getPureClassName($class)
179
+ ));
180
+
181
+ if ($classCode != $classCodeNew){
182
+ rename($classPath, $this->_getBackupFileName($classPath));
183
+ $this->_log($classPath . " renamed to " . $this->_getBackupFileName($classPath));
184
+ file_put_contents($classPath, $classCodeNew);
185
+ $this->_log("File created: " . $classPath);
186
+ }
187
+ }
188
+
189
+ static function getPureClassName($class){
190
+ return $class . '_Amasty_Pure';
191
+ }
192
+
193
+ protected function _getBackupFileName($classPath){
194
+ return $classPath . '_ambackup';
195
+ }
196
+
197
+ protected function _getBackupFixedFileName($classPath){
198
+ return $classPath . '_fixed_ambackup';
199
+ }
200
+ }
201
+ ?>
app/code/local/Amasty/Base/Model/Feed.php CHANGED
@@ -1,24 +1,30 @@
1
  <?php
2
- /**
3
- * @copyright Copyright (c) 2010 Amasty (http://www.amasty.com)
 
 
4
  */
5
  class Amasty_Base_Model_Feed extends Mage_AdminNotification_Model_Feed
6
  {
7
  const XML_FREQUENCY_PATH = 'ambase/feed/check_frequency';
8
  const XML_LAST_UPDATE_PATH = 'ambase/feed/last_update';
9
- const XML_ITERESTS = 'ambase/feed/interests';
10
 
11
- const URL_EXTENSIONS = 'http://amasty.com/feed-extensions.xml';
12
  const URL_NEWS = 'http://amasty.com/feed-news.xml';
 
13
 
14
-
15
- public static function check()
16
- {
17
- return Mage::getModel('ambase/feed')->checkUpdate();
18
- }
19
-
 
 
 
 
20
  public function checkUpdate()
21
  {
 
22
  if (($this->getFrequency() + $this->getLastUpdate()) > time()) {
23
  return $this;
24
  }
@@ -29,52 +35,42 @@ class Amasty_Base_Model_Feed extends Mage_AdminNotification_Model_Feed
29
  return $this;
30
  }
31
 
32
- // load all new and relevant updates into inbox
33
- $feedData = array();
34
- $feedXml = $this->getFeedData();
35
- $wasInstalled = gmdate('Y-m-d H:i:s', Mage::getStoreConfig('ambase/feed/installed'));
36
-
37
- if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
38
- foreach ($feedXml->channel->item as $item) {
39
- $date = $this->getDate((string)$item->pubDate);
 
 
 
 
 
 
 
40
 
41
- // compare strings, but they are well-formmatted
42
- if ($date < $wasInstalled){
43
- continue;
 
 
 
 
44
  }
45
- if (!$this->isInteresting($item)){
46
- continue;
 
 
 
 
47
  }
48
-
49
- $feedData[] = array(
50
- 'severity' => 3,
51
- 'date_added' => $this->getDate($date),
52
- 'title' => (string)$item->title,
53
- 'description' => (string)$item->description,
54
- 'url' => (string)$item->link,
55
- );
56
- }
57
- if ($feedData) {
58
- Mage::getModel('adminnotification/inbox')->parse($feedData);
59
  }
60
  }
61
 
62
  //load all available extensions in the cache
63
- $this->_feedUrl = self::URL_EXTENSIONS;
64
- $feedData = array();
65
- $feedXml = $this->getFeedData();
66
- if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
67
- foreach ($feedXml->channel->item as $item) {
68
- $feedData[(string)$item->code] = array(
69
- 'name' => (string)$item->title,
70
- 'url' => (string)$item->link,
71
- 'version' => (string)$item->version,
72
- );
73
- }
74
- if ($feedData) {
75
- Mage::app()->saveCache(serialize($feedData), 'ambase_extensions');
76
- }
77
- }
78
 
79
  return $this;
80
  }
@@ -104,44 +100,16 @@ class Amasty_Base_Model_Feed extends Mage_AdminNotification_Model_Feed
104
  return $this->_feedUrl . $query;
105
  }
106
 
107
- protected function getInterests()
108
- {
109
- return Mage::getStoreConfig(self::XML_ITERESTS);
110
- }
111
-
112
- protected function isInteresting($item)
113
- {
114
- $interests = @explode(',', $this->getInterests());
115
- $types = @explode(':', (string)$item->type);
116
- $extenion = (string)$item->extension;
117
-
118
- $selfUpgrades = array_search(Amasty_Base_Model_Source_Updates_Type::TYPE_INSTALLED_UPDATE, $types);
119
-
120
- foreach ($types as $type){
121
- if (array_search($type, $interests) !== false){
122
- return true;
123
- }
124
-
125
- if ($extenion && ($type == Amasty_Base_Model_Source_Updates_Type::TYPE_UPDATE_RELEASE) && $selfUpgrades){
126
- if ($this->isExtensionInstalled($extenion)){
127
- return true;
128
- }
129
- }
130
- }
131
-
132
- return false;
133
- }
134
-
135
- protected function isExtensionInstalled($code)
136
- {
137
- $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
138
  foreach ($modules as $moduleName) {
139
- if ($moduleName == $code){
140
- return true;
141
- }
142
  }
143
 
144
- return false;
145
- }
146
 
147
  }
1
  <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
  */
7
  class Amasty_Base_Model_Feed extends Mage_AdminNotification_Model_Feed
8
  {
9
  const XML_FREQUENCY_PATH = 'ambase/feed/check_frequency';
10
  const XML_LAST_UPDATE_PATH = 'ambase/feed/last_update';
 
11
 
 
12
  const URL_NEWS = 'http://amasty.com/feed-news.xml';
13
+
14
 
15
+ public function check()
16
+ {
17
+ $this->checkUpdate();
18
+ }
19
+
20
+ protected function _isPromoSubscribed()
21
+ {
22
+ return Mage::helper("ambase/promo")->isSubscribed();
23
+ }
24
+
25
  public function checkUpdate()
26
  {
27
+
28
  if (($this->getFrequency() + $this->getLastUpdate()) > time()) {
29
  return $this;
30
  }
35
  return $this;
36
  }
37
 
38
+ if ($this->_isPromoSubscribed()) {
39
+ // load all new and relevant updates into inbox
40
+ $feedData = array();
41
+ $feedXml = $this->getFeedData();
42
+ $wasInstalled = gmdate('Y-m-d H:i:s', Amasty_Base_Helper_Module::baseModuleInstalled());
43
+
44
+ if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
45
+ foreach ($feedXml->channel->item as $item) {
46
+
47
+ $date = $this->getDate((string)$item->pubDate);
48
+
49
+ // compare strings, but they are well-formmatted
50
+ if ($date < $wasInstalled){
51
+ continue;
52
+ }
53
 
54
+ $feedData[] = array(
55
+ 'severity' => 3,
56
+ 'date_added' => $this->getDate($date),
57
+ 'title' => (string)$item->title,
58
+ 'description' => (string)$item->description,
59
+ 'url' => (string)$item->link,
60
+ );
61
  }
62
+
63
+ if ($feedData) {
64
+ $inbox = Mage::getModel('adminnotification/inbox');
65
+
66
+ if ($inbox)
67
+ $inbox->parse($feedData);
68
  }
 
 
 
 
 
 
 
 
 
 
 
69
  }
70
  }
71
 
72
  //load all available extensions in the cache
73
+ Amasty_Base_Helper_Module::reload();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
  return $this;
76
  }
100
  return $this->_feedUrl . $query;
101
  }
102
 
103
+ protected function isExtensionInstalled($code)
104
+ {
105
+ $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  foreach ($modules as $moduleName) {
107
+ if ($moduleName == $code){
108
+ return true;
109
+ }
110
  }
111
 
112
+ return false;
113
+ }
114
 
115
  }
app/code/local/Amasty/Base/Model/Resource/Event/Collection.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ class Amasty_Base_Model_Resource_Event_Collection extends Varien_Data_Collection
8
+ {
9
+ public function _prepareData($scope) {
10
+ $config = Mage::getConfig()->getNode($scope . '/events')->children();
11
+ $data = array();
12
+
13
+ foreach ($config as $node) {
14
+ $eventName = $node->getName();
15
+
16
+ foreach ($node->observers->children() as $observer) {
17
+ $data[$eventName][] = array(
18
+ 'class' => Mage::getConfig()->getModelClassName((string) $observer->class),
19
+ 'method' => (string) $observer->method,
20
+ 'scope' => $scope
21
+ );
22
+ }
23
+ }
24
+ return $data;
25
+ }
26
+ }
app/code/local/Amasty/Base/Model/Source/Updates/Type.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- /**
3
- * @copyright Copyright (c) 2010 Amasty (http://www.amasty.com)
4
- */
5
- class Amasty_Base_Model_Source_Updates_Type extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
6
- {
7
- const TYPE_PROMO = 'PROMO';
8
- const TYPE_NEW_RELEASE = 'NEW_RELEASE';
9
- const TYPE_UPDATE_RELEASE = 'UPDATE_RELEASE';
10
- const TYPE_INFO = 'INFO';
11
- const TYPE_INSTALLED_UPDATE = 'INSTALLED_UPDATE';
12
-
13
-
14
- public function toOptionArray()
15
- {
16
- $hlp = Mage::helper('ambase');
17
- return array(
18
- array('value' => self::TYPE_INSTALLED_UPDATE, 'label' => $hlp->__('My extensions updates')),
19
- array('value' => self::TYPE_UPDATE_RELEASE, 'label' => $hlp->__('All extensions updates')),
20
- array('value' => self::TYPE_NEW_RELEASE, 'label' => $hlp->__('New Releases')),
21
- array('value' => self::TYPE_PROMO, 'label' => $hlp->__('Promotions/Discounts')),
22
- array('value' => self::TYPE_INFO, 'label' => $hlp->__('Other information'))
23
- );
24
- }
25
-
26
- /**
27
- * Retrive all attribute options
28
- *
29
- * @return array
30
- */
31
- public function getAllOptions()
32
- {
33
- return $this->toOptionArray();
34
- }
35
-
36
-
37
- /**
38
- * Returns label for value
39
- * @param string $value
40
- * @return string
41
- */
42
- public function getLabel($value)
43
- {
44
- $options = $this->toOptionArray();
45
- foreach($options as $v){
46
- if($v['value'] == $value){
47
- return $v['label'];
48
- }
49
- }
50
- return '';
51
- }
52
-
53
- /**
54
- * Returns array ready for use by grid
55
- * @return array
56
- */
57
- public function getGridOptions()
58
- {
59
- $items = $this->getAllOptions();
60
- $out = array();
61
- foreach($items as $item){
62
- $out[$item['value']] = $item['label'];
63
- }
64
- return $out;
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Amasty/Base/controllers/Adminhtml/Ambase/BaseController.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+
8
+ class Amasty_Base_Adminhtml_Ambase_BaseController extends Mage_Adminhtml_Controller_Action
9
+ {
10
+ protected $_moduleHelper;
11
+
12
+ protected function _getModuleHelper($code)
13
+ {
14
+ if (!$this->_moduleHelper)
15
+ {
16
+ $this->_moduleHelper = Mage::helper("ambase/module")->init($code);
17
+ }
18
+
19
+ return $this->_moduleHelper;
20
+ }
21
+
22
+ public function closeUpdateAction()
23
+ {
24
+ $code = Mage::app()->getRequest()->getParam('code');
25
+
26
+ $moduleHelper = $this->_getModuleHelper($code);
27
+
28
+ if ($moduleHelper->isNewVersionAvailable())
29
+ {
30
+ $moduleHelper->setModuleUpdated();
31
+ }
32
+ }
33
+
34
+ public function closePromoAction()
35
+ {
36
+ $collection = Mage::helper("ambase/promo")->getNotificationsCollection();
37
+
38
+ foreach($collection as $notification)
39
+ {
40
+ $notification->setIsRead(true);
41
+ $notification->save();
42
+ }
43
+ }
44
+
45
+ public function ajaxAction()
46
+ {
47
+ $helper = Mage::helper("ambase");
48
+ print $helper->ajaxHtml();
49
+ }
50
+
51
+ public function fixAction()
52
+ {
53
+ $object = Mage::app()->getRequest()->getParam('object');
54
+ $module = Mage::app()->getRequest()->getParam('module');
55
+ $rewrite = Mage::app()->getRequest()->getParam('rewrite');
56
+ if ($module && $rewrite && $object){
57
+
58
+ try {
59
+ $conflict = Mage::getModel("ambase/conflict");
60
+ $conflict->fix($object, $module, $rewrite);
61
+
62
+ foreach($conflict->log() as $m)
63
+ Mage::getSingleton('adminhtml/session')->addNotice($m);
64
+
65
+ } catch (Exception $e) {
66
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
67
+ }
68
+
69
+
70
+ $this->_redirect("adminhtml/system_config/edit", array(
71
+ "section" => "ambase",
72
+ "autoload" => 1
73
+ ));
74
+ }
75
+ }
76
+
77
+ public function rollbackAction()
78
+ {
79
+ $object = Mage::app()->getRequest()->getParam('object');
80
+ $module = Mage::app()->getRequest()->getParam('module');
81
+ $rewrite = Mage::app()->getRequest()->getParam('rewrite');
82
+ if ($module && $rewrite && $object){
83
+ try {
84
+ $conflict = Mage::getModel("ambase/conflict");
85
+ $conflict->rollback($object, $module, $rewrite);
86
+
87
+ foreach($conflict->log() as $m)
88
+ Mage::getSingleton('adminhtml/session')->addNotice($m);
89
+
90
+ } catch (Exception $e) {
91
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
92
+ }
93
+
94
+ $this->_redirect("adminhtml/system_config/edit", array(
95
+ "section" => "ambase",
96
+ "autoload" => 1
97
+ ));
98
+ }
99
+ }
100
+
101
+ protected function _isAllowed()
102
+ {
103
+ return Mage::getSingleton('admin/session')->isAllowed('system/config');
104
+ }
105
+ }
106
+ ?>
app/code/local/Amasty/Base/etc/adminhtml.xml CHANGED
@@ -1,4 +1,11 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
2
  <config>
3
  <acl>
4
  <resources>
@@ -11,9 +18,12 @@
11
  <children>
12
  <config>
13
  <children>
14
- <ambase>
15
  <title>Amasty - Extensions Information</title>
16
  </ambase>
 
 
 
17
  </children>
18
  </config>
19
  </children>
@@ -33,4 +43,13 @@
33
  </observers>
34
  </controller_action_predispatch>
35
  </events>
 
 
 
 
 
 
 
 
 
36
  </config>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Base
7
+ */
8
+ -->
9
  <config>
10
  <acl>
11
  <resources>
18
  <children>
19
  <config>
20
  <children>
21
+ <ambase translate="title">
22
  <title>Amasty - Extensions Information</title>
23
  </ambase>
24
+ <amstore translate="title">
25
+ <title>Amasty - Extensions Store</title>
26
+ </amstore>
27
  </children>
28
  </config>
29
  </children>
43
  </observers>
44
  </controller_action_predispatch>
45
  </events>
46
+ <translate>
47
+ <modules>
48
+ <Amasty_Base>
49
+ <files>
50
+ <default>Amasty_Base.csv</default>
51
+ </files>
52
+ </Amasty_Base>
53
+ </modules>
54
+ </translate>
55
  </config>
app/code/local/Amasty/Base/etc/config.xml CHANGED
@@ -1,91 +1,135 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Amasty_Base>
5
- <version>1.0.1</version>
6
- <platform>ee</platform>
7
- </Amasty_Base>
8
- </modules>
9
-
10
- <global>
11
- <blocks>
12
- <ambase>
13
- <class>Amasty_Base_Block</class>
14
- </ambase>
15
- </blocks>
16
- <resources>
17
- <ambase_setup>
18
- <setup>
19
- <module>Amasty_Base</module>
20
- </setup>
21
- <connection>
22
- <use>core_setup</use>
23
- </connection>
24
- </ambase_setup>
25
- <ambase_write>
26
- <connection>
27
- <use>core_write</use>
28
- </connection>
29
- </ambase_write>
30
- <ambase_read>
31
- <connection>
32
- <use>core_read</use>
33
- </connection>
34
- </ambase_read>
35
- </resources>
36
- <models>
37
- <ambase>
38
- <class>Amasty_Base_Model</class>
39
- </ambase>
40
- </models>
41
- <helpers>
42
- <ambase>
43
- <class>Amasty_Base_Helper</class>
44
- </ambase>
45
- </helpers>
46
- </global>
47
-
48
- <adminhtml>
49
- <acl>
50
- <resources>
51
- <all>
52
- <title>Allow Everything</title>
53
- </all>
54
- <admin>
55
- <children>
56
- <system>
57
- <children>
58
- <config>
59
- <children>
60
- <ambase>
61
- <title>Amasty - Extensions Information</title>
62
- </ambase>
63
- </children>
64
- </config>
65
- </children>
66
- </system>
67
- </children>
68
- </admin>
69
- </resources>
70
- </acl>
71
- <events>
72
- <controller_action_predispatch>
73
- <observers>
74
- <ambase_upds>
75
- <type>singleton</type>
76
- <class>ambase/feed</class>
77
- <method>check</method>
78
- </ambase_upds>
79
- </observers>
80
- </controller_action_predispatch>
81
- </events>
82
- </adminhtml>
83
- <default>
84
- <ambase>
85
- <feed>
86
- <check_frequency>86400</check_frequency>
87
- <interests>INFO,PROMO,UPDATE_RELEASE,NEW_RELEASE,INSTALLED_UPDATE</interests>
88
- </feed>
89
- </ambase>
90
- </default>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Base
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Amasty_Base>
12
+ <version>2.1.7</version>
13
+ </Amasty_Base>
14
+ </modules>
15
+
16
+ <global>
17
+ <blocks>
18
+ <ambase>
19
+ <class>Amasty_Base_Block</class>
20
+ </ambase>
21
+ </blocks>
22
+ <resources>
23
+ <ambase_setup>
24
+ <setup>
25
+ <module>Amasty_Base</module>
26
+ </setup>
27
+ <connection>
28
+ <use>core_setup</use>
29
+ </connection>
30
+ </ambase_setup>
31
+ <ambase_write>
32
+ <connection>
33
+ <use>core_write</use>
34
+ </connection>
35
+ </ambase_write>
36
+ <ambase_read>
37
+ <connection>
38
+ <use>core_read</use>
39
+ </connection>
40
+ </ambase_read>
41
+ </resources>
42
+ <models>
43
+ <ambase>
44
+ <class>Amasty_Base_Model</class>
45
+ <resourceModel>ambase_resource</resourceModel>
46
+ </ambase>
47
+ <ambase_resource>
48
+ <class>Amasty_Base_Model_Resource</class>
49
+ </ambase_resource>
50
+ </models>
51
+ <helpers>
52
+ <ambase>
53
+ <class>Amasty_Base_Helper</class>
54
+ </ambase>
55
+ </helpers>
56
+ </global>
57
+
58
+ <admin>
59
+ <routers>
60
+ <adminhtml>
61
+ <args>
62
+ <modules>
63
+ <Amasty_Base after="Mage_Adminhtml">Amasty_Base_Adminhtml</Amasty_Base>
64
+ </modules>
65
+ </args>
66
+ </adminhtml>
67
+ </routers>
68
+ </admin>
69
+
70
+ <adminhtml>
71
+ <layout>
72
+ <updates>
73
+ <ambase module="Amasty_Base">
74
+ <file>amasty/ambase/ambase.xml</file>
75
+ </ambase>
76
+ </updates>
77
+ </layout>
78
+
79
+ <acl>
80
+ <resources>
81
+ <all>
82
+ <title>Allow Everything</title>
83
+ </all>
84
+ <admin>
85
+ <children>
86
+ <system>
87
+ <children>
88
+ <config>
89
+ <children>
90
+ <ambase translate="title">
91
+ <title>Amasty - Extensions Information</title>
92
+ </ambase>
93
+ <amstore translate="title">
94
+ <title>Amasty - Extensions Store</title>
95
+ </amstore>
96
+ </children>
97
+ </config>
98
+ </children>
99
+ </system>
100
+ </children>
101
+ </admin>
102
+ </resources>
103
+ </acl>
104
+ <events>
105
+ <controller_action_predispatch>
106
+ <observers>
107
+ <ambase_upds>
108
+ <type>singleton</type>
109
+ <class>ambase/feed</class>
110
+ <method>check</method>
111
+ </ambase_upds>
112
+ </observers>
113
+ </controller_action_predispatch>
114
+ </events>
115
+ <translate>
116
+ <modules>
117
+ <Amasty_Base>
118
+ <files>
119
+ <default>Amasty_Base.csv</default>
120
+ </files>
121
+ </Amasty_Base>
122
+ </modules>
123
+ </translate>
124
+ </adminhtml>
125
+
126
+ <default>
127
+ <ambase>
128
+ <feed>
129
+ <check_frequency>86400</check_frequency>
130
+ <update>1</update>
131
+ <promo>1</promo>
132
+ </feed>
133
+ </ambase>
134
+ </default>
135
  </config>
app/code/local/Amasty/Base/etc/system.xml CHANGED
@@ -1,52 +1,121 @@
1
- <?xml version="1.0"?>
 
 
 
 
 
 
 
2
  <config>
3
  <tabs>
4
  <amasty translate="label" module="ambase">
5
- <label>Amasty Extensions</label>
 
 
 
6
  <sort_order>400</sort_order>
7
  </amasty>
8
  </tabs>
9
- <sections>
10
- <ambase translate="label" module="ambase">
11
- <label>General</label>
12
- <tab>amasty</tab>
13
- <frontend_type>text</frontend_type>
14
- <sort_order>777</sort_order>
15
- <show_in_default>1</show_in_default>
16
- <show_in_website>1</show_in_website>
17
- <show_in_store>1</show_in_store>
18
- <groups>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  <extensions translate="label">
20
  <label>Installed Extensions</label>
21
  <frontend_type>text</frontend_type>
22
  <frontend_model>ambase/extensions</frontend_model>
23
- <sort_order>2</sort_order>
24
  <show_in_default>1</show_in_default>
25
  <show_in_website>1</show_in_website>
26
  <show_in_store>1</show_in_store>
27
  </extensions>
28
- <feed>
29
- <label>Notifications</label>
30
- <frontend_type>text</frontend_type>
31
- <sort_order>90</sort_order>
32
- <show_in_default>1</show_in_default>
33
- <show_in_website>1</show_in_website>
34
- <show_in_store>1</show_in_store>
35
- <fields>
36
- <interests translate="label">
37
- <label>I'd like to be informed by Amasty about:</label>
38
- <comment></comment>
39
- <frontend_type>multiselect</frontend_type>
40
- <sort_order>100</sort_order>
41
- <show_in_default>1</show_in_default>
42
- <show_in_website>1</show_in_website>
43
- <show_in_store>1</show_in_store>
44
- <can_be_empty>1</can_be_empty>
45
- <source_model>ambase/source_updates_type</source_model>
46
- </interests>
47
- </fields>
48
- </feed>
49
- </groups>
50
- </ambase>
51
- </sections>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Base
7
+ */
8
+ -->
9
  <config>
10
  <tabs>
11
  <amasty translate="label" module="ambase">
12
+ <label><![CDATA[<div style="position: absolute;"><img id="amasty_block" src="" alt="" border="0" /></div>&nbsp;<script>
13
+ var n = SKIN_URL.indexOf("adminhtml");
14
+ $('amasty_block').src = SKIN_URL.substring(0, n) + "adminhtml/default/default/images/ambase/amasty.png";
15
+ </script>]]></label>
16
  <sort_order>400</sort_order>
17
  </amasty>
18
  </tabs>
19
+ <sections>
20
+ <amstore>
21
+ <label><![CDATA[Extensions Store]]></label>
22
+ <tab>amasty</tab>
23
+ <class>amasty-store-tab</class>
24
+ <frontend_type>text</frontend_type>
25
+ <sort_order>100</sort_order>
26
+ <show_in_default>1</show_in_default>
27
+ <show_in_website>1</show_in_website>
28
+ <show_in_store>1</show_in_store>
29
+ <groups>
30
+ <extensions translate="label">
31
+ <label>Amasty Extensions Store</label>
32
+ <frontend_type>text</frontend_type>
33
+ <frontend_model>ambase/store</frontend_model>
34
+ <sort_order>999</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </extensions>
39
+ </groups>
40
+ </amstore>
41
+ <ambase translate="label" module="ambase">
42
+ <label><![CDATA[Extensions &amp; Notifications]]></label>
43
+ <tab>amasty</tab>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>110</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ <groups>
50
  <extensions translate="label">
51
  <label>Installed Extensions</label>
52
  <frontend_type>text</frontend_type>
53
  <frontend_model>ambase/extensions</frontend_model>
54
+ <sort_order>40</sort_order>
55
  <show_in_default>1</show_in_default>
56
  <show_in_website>1</show_in_website>
57
  <show_in_store>1</show_in_store>
58
  </extensions>
59
+ <feed>
60
+ <label>Notifications</label>
61
+ <frontend_type>text</frontend_type>
62
+ <sort_order>90</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ <fields>
67
+ <update translate="label">
68
+ <label>I`d like to be informed by Amasty Updates about</label>
69
+ <comment><![CDATA[]]></comment>
70
+ <frontend_type>select</frontend_type>
71
+ <source_model>adminhtml/system_config_source_yesno</source_model>
72
+ <sort_order>1</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>1</show_in_store>
76
+ </update>
77
+ <promo translate="label">
78
+ <label>I`d like to be informed by Amasty Promos about</label>
79
+ <comment><![CDATA[]]></comment>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>adminhtml/system_config_source_yesno</source_model>
82
+ <sort_order>1</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ </promo>
87
+
88
+ <!-- <interests translate="label">
89
+ <label>I'd like to be informed by Amasty about:</label>
90
+ <comment></comment>
91
+ <frontend_type>multiselect</frontend_type>
92
+ <sort_order>100</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>1</show_in_website>
95
+ <show_in_store>1</show_in_store>
96
+ <can_be_empty>1</can_be_empty>
97
+ <source_model>ambase/source_updates_type</source_model>
98
+ </interests>-->
99
+ </fields>
100
+ </feed>
101
+ <conflicts translate="label">
102
+ <label><![CDATA[Troubleshooter<script>
103
+ function ambaseShow(url){
104
+ new Ajax.Request(url, {
105
+ onSuccess: function(response) {
106
+ $("ambase_conflicts_container").update(response.transport.response)
107
+ }
108
+ });
109
+ }
110
+ </script>]]></label>
111
+ <frontend_type>text</frontend_type>
112
+ <frontend_model>ambase/conflicts</frontend_model>
113
+ <sort_order>200</sort_order>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>1</show_in_store>
117
+ </conflicts>
118
+ </groups>
119
+ </ambase>
120
+ </sections>
121
  </config>
app/code/local/Amasty/Base/sql/ambase_setup/mysql4-install-1.0.0.php CHANGED
@@ -1,3 +1,9 @@
1
  <?php
 
 
 
 
 
 
2
  $this->startSetup();
3
  $this->endSetup();
1
  <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+
8
  $this->startSetup();
9
  $this->endSetup();
app/code/local/Amasty/Base/sql/ambase_setup/mysql4-upgrade-1.0.0-1.0.1.php CHANGED
@@ -1,17 +1,19 @@
1
  <?php
 
 
 
 
 
 
2
  $this->startSetup();
3
 
4
- Mage::getModel('core/config_data')
5
- ->setScope('default')
6
- ->setPath('ambase/feed/installed')
7
- ->setValue(time())
8
- ->save();
9
 
10
  $feedData = array();
11
  $feedData[] = array(
12
  'severity' => 4,
13
  'date_added' => gmdate('Y-m-d H:i:s', time()),
14
- 'title' => 'Amasty\'s extension has been installed. Check the Admin > Configuration > Amasty section.',
15
  'description' => 'You can see versions of the installed extensions right in the admin, as well as configure notifications about major updates.',
16
  'url' => 'http://amasty.com/news/updates-and-notifications-configuration-9.html'
17
  // 'url' => Mage::getModel('adminhtml/url')->getUrl('adminhtml/system_config/edit', array('section'=>'ambase')),
1
  <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+
8
  $this->startSetup();
9
 
10
+ Amasty_Base_Helper_Module::baseModuleInstalled();
 
 
 
 
11
 
12
  $feedData = array();
13
  $feedData[] = array(
14
  'severity' => 4,
15
  'date_added' => gmdate('Y-m-d H:i:s', time()),
16
+ 'title' => 'Amasty`s extension has been installed. Remember to flush all cache, recompile, log-out and log back in.',
17
  'description' => 'You can see versions of the installed extensions right in the admin, as well as configure notifications about major updates.',
18
  'url' => 'http://amasty.com/news/updates-and-notifications-configuration-9.html'
19
  // 'url' => Mage::getModel('adminhtml/url')->getUrl('adminhtml/system_config/edit', array('section'=>'ambase')),
app/design/adminhtml/default/default/layout/amasty/ambase/ambase.xml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Base
7
+ */
8
+ -->
9
+ <layout>
10
+ <adminhtml_system_config_edit>
11
+ <reference name="head">
12
+ <action method="addCss">
13
+ <name>css/amasty/ambase/style.css</name>
14
+ </action>
15
+ <action method="addJs">
16
+ <name>amasty/ambase/store.js</name>
17
+ </action>
18
+ </reference>
19
+ </adminhtml_system_config_edit>
20
+ <adminhtml_ambase_base_ajax>
21
+ <reference name="root">
22
+ <action method="setTemplate">
23
+ <template>empty.phtml</template>
24
+ </action>
25
+ </reference>
26
+ </adminhtml_ambase_base_ajax>
27
+ <default>
28
+ <reference name="root">
29
+ <reference name="notifications">
30
+ <block type="ambase/adminhtml_promo" name="ampromo" as="ampromo" after="messages" template="amasty/ambase/promo.phtml"></block>
31
+ </reference>
32
+
33
+ <reference name="content">
34
+ <block type="ambase/adminhtml_update" name="amupdate" as="amupdate" template="amasty/ambase/update.phtml"></block>
35
+ </reference>
36
+
37
+ </reference>
38
+ </default>
39
+ </layout>
app/design/adminhtml/default/default/template/amasty/ambase/debug/conflict.phtml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ ?>
8
+ <?php
9
+ $conflictsList = $this->getPossibleConflictsList();
10
+ foreach($conflictsList as $objectKey => $objectsList){
11
+ ?>
12
+ <div class="ambase-debug-header"><?php echo ucfirst($objectKey);?></div>
13
+ <div class="ambase-debug-section">
14
+ <table cellspacing="0">
15
+ <?php
16
+ foreach($objectsList as $moduleKey => $conflicts) {
17
+ if (isset($conflicts["rewrite"]))
18
+ foreach($conflicts["rewrite"] as $rewriteKey => $rewrites){
19
+ $codePool = $conflicts["codePool"][$rewriteKey];
20
+
21
+ ;
22
+
23
+ ?>
24
+ <tr>
25
+ <td><?php
26
+ echo uc_words($moduleKey, " ") . " ";
27
+ echo uc_words($rewriteKey, " ");
28
+ // foreach(explode("_", $rewriteKey) as $rewritePartKey){
29
+ // echo ucfirst($rewritePartKey) . " ";
30
+ // }
31
+ ?></td>
32
+ <td>
33
+ <?php
34
+ foreach($rewrites as $rewriteIndex => $rewrite){
35
+ $rewriteParts = explode("_", $rewrite);
36
+
37
+ foreach(array_slice($rewriteParts, 0, 2) as $rewritePart){
38
+ echo ucfirst($rewritePart) . " ";
39
+ }
40
+ echo "<br/>";
41
+ }
42
+
43
+
44
+ ?>
45
+ </td>
46
+ <td>
47
+ <?php
48
+
49
+
50
+ if ($this->hasConflict($rewrites)){
51
+
52
+ if ( ! $this->conflictResolved($codePool, $rewrites)){
53
+ ?>
54
+ <button type="button" class="scalable save" onclick="document.location.href='<?php echo $this->getFixUrl($objectKey, $moduleKey, $rewriteKey); ?>'" style="">
55
+ <span><span><span><?php echo $this->__("Fix")?></span></span></span>
56
+ </button>
57
+ <?php
58
+ } else {
59
+ ?>
60
+ <button type="button" class="scalable" onclick="document.location.href='<?php echo $this->getRollbackUrl($objectKey, $moduleKey, $rewriteKey); ?>'" style="">
61
+ <span><span><span><?php echo $this->__("Rollback")?></span></span></span>
62
+ </button>
63
+ <?php
64
+ }
65
+ $instructionId = uniqid("ambase_instr");
66
+ krsort($rewrites);
67
+ $extends = $rewrites;
68
+
69
+ ?>
70
+ <div onclick="$(<?php print $instructionId?>).toggleClassName('ambase-hidden', true);" class="ambase-show-instruction"><?php echo $this->__("Show instructions")?></div>
71
+ <div class="ambase-instruction ambase-hidden" id="<?php echo $instructionId;?>">
72
+ <ul>
73
+ <?php foreach($rewrites as $rewriteIndex => $rewriteClass){
74
+ unset($extends[$rewriteIndex]);
75
+ $extendsValues = array_values($extends);
76
+
77
+ $parentClasses = Mage::helper("ambase")->getParentClasses($rewriteClass);
78
+ if (count($extendsValues) > 0) {
79
+ ?>
80
+ <li><?php
81
+ echo $this->__("Open file");
82
+ echo "&nbsp;<b>";
83
+ echo $this->getClassPath($rewrites, $codePool, $rewriteIndex);
84
+ echo "</b>";
85
+ ?></li>
86
+ <li><?php
87
+ echo $this->__("Replace");
88
+ echo "&nbsp;<b>" . $parentClasses[0];
89
+ echo "</b>&nbsp;";
90
+ echo $this->__("to");
91
+ echo "&nbsp;<b>" . $extendsValues[0];
92
+ echo "</b>";
93
+ ?></li>
94
+ <?php }
95
+
96
+ }?>
97
+ <li style="text-decoration: underline;"><?php echo $this->__("Clear magento cache and all external caches like APC (if any).")?></li>
98
+ </ul>
99
+ </div>
100
+ <?php
101
+ } else {
102
+ ?>
103
+ <div class="green"><?php echo $this->__("No actions required")?></div>
104
+ <?php
105
+ }
106
+ ?>
107
+ </td>
108
+ </tr>
109
+ <?php
110
+ }
111
+ }
112
+ ?>
113
+ </table>
114
+ </div>
115
+ <?php
116
+ }
117
+ ?>
118
+
app/design/adminhtml/default/default/template/amasty/ambase/debug/event.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+
8
+ $events = $this->getEventsList();
9
+ ?>
10
+
11
+ <div class="ambase-debug-header ambase-debug-header-click" onclick="$('ambase-debug-section-events').toggle();"><?php echo $this->__('Events');?></div>
12
+ <div class="ambase-debug-section" id="ambase-debug-section-events" style="display:none;">
13
+ <table cellspacing="0">
14
+ <?php foreach ($events as $name => $event): ?>
15
+ <tr>
16
+ <td style="padding-right: 10px;"><?php echo $name; ?></td>
17
+ <td>
18
+ <?php foreach ($event as $listener): ?>
19
+ <?php echo $listener['class']; ?> (<?php echo $listener['scope'];?>)
20
+ <div class='ambase-file'>
21
+ <?php echo $this->__('method');?>: <?php echo $listener['method']; ?>
22
+ </div>
23
+ <?php endforeach; ?>
24
+ </td>
25
+ </tr>
26
+ <?php endforeach; ?>
27
+ </table>
28
+ </div>
app/design/adminhtml/default/default/template/amasty/ambase/debug/general.phtml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ ?>
8
+ <div class="ambase-debug-header"><?php echo $this->__("General")?></div>
9
+ <div class="ambase-debug-section">
10
+ <table cellspacing="0">
11
+ <tr>
12
+ <td><?php echo $this->__("Compilation")?></td>
13
+ <td>
14
+ <?php if ($this->isCompilationEnabled()) { ?>
15
+ <span class="red"><?php echo $this->__("On")?></span>
16
+ <?php } else { ?>
17
+ <span class="green"><?php echo $this->__("Off")?></span>
18
+ <?php }?>
19
+ </td>
20
+ </tr>
21
+ <tr>
22
+ <td><?php echo $this->__("Disabled output")?></td>
23
+ <td>
24
+ <?php if (count($this->getDisableModulesOutput()) > 0) {?>
25
+ <div class="red"><?php
26
+ foreach($this->getDisableModulesOutput() as $module){
27
+ echo $module['name']."<br/>";
28
+ }
29
+ ?></div>
30
+ <?php } else { ?>
31
+ <span class="green"><?php echo $this->__("No")?></span>
32
+
33
+ <?php } ?>
34
+ </td>
35
+ </tr>
36
+ <tr>
37
+ <td><?php echo $this->__("Cron")?></td>
38
+ <td><?php
39
+ $crontabConfig = $this->getCrontabConfig();
40
+ if (count($crontabConfig) === 0){
41
+ echo '<div class="red">';
42
+ echo $this->__('No cron jobs found') . "</div>";
43
+ echo "<a target='_blank' href='https://support.amasty.com/index.php?/Knowledgebase/Article/View/72/24/magento-cron'>" . $this->__("Learn more") . "</a>";
44
+ } else {
45
+ ?>
46
+ <table>
47
+ <?php foreach ($crontabConfig as $crontabRow){ ?>
48
+ <tr>
49
+ <td style="padding: 0px 5px;"><?php echo $crontabRow['job_code'];?></td>
50
+ <td style="padding: 0px 5px;"><?php echo $crontabRow['status'];?></td>
51
+ <td style="padding: 0px 5px;"><?php echo $crontabRow['created_at'];?></td>
52
+ </tr>
53
+ <?php }?>
54
+ </table>
55
+
56
+ <?php
57
+
58
+
59
+
60
+
61
+ // if (is_array($crontabConfig)){
62
+ // echo implode("<br/>", $crontabConfig);
63
+ // } else {
64
+ // echo $crontabConfig;
65
+ // }
66
+ }
67
+ ?></td>
68
+ </tr>
69
+ </table>
70
+ </div>
app/design/adminhtml/default/default/template/amasty/ambase/debug/rewrite.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ ?>
8
+ <div class="ambase-debug-header ambase-debug-header-click" onclick="$('ambase-debug-section').toggle();"><?php echo $this->__("Rewrites");?></div>
9
+ <div class="ambase-debug-section" id="ambase-debug-section" style="display:none;">
10
+ <table cellspacing="0">
11
+
12
+
13
+ <?php
14
+ $_finalResult = $this->getRewritesList();
15
+ foreach(array_keys($_finalResult) as $groupType) {
16
+
17
+ foreach(array_keys($_finalResult[$groupType]) as $key) {
18
+ // remove some repeating elements after merging all parents
19
+ foreach($_finalResult[$groupType][$key]['rewrite'] as $key1 => $value) {
20
+ $codePool = $_finalResult[$groupType][$key]["codePool"][$key1];
21
+
22
+ $_classes = array();
23
+ if(is_array($value)) {
24
+ $_classes = array_unique($value);
25
+ } else {
26
+ $value = array($value);
27
+ $_classes = $value;
28
+ $codePool = array($codePool);
29
+ }
30
+ ?>
31
+ <tr>
32
+ <td><?php
33
+ echo uc_words($key, " ") . " ";
34
+ echo uc_words($key1, " ");
35
+ ?></td>
36
+ <td>
37
+ <?php
38
+ foreach($_classes as $_class){
39
+ $_index = array_search($_class, $value);
40
+
41
+ $_classParts = explode("_", $_class);
42
+
43
+ foreach(array_slice($_classParts, 0, 2) as $classPart){
44
+ echo ucfirst($classPart) . " ";
45
+
46
+ }
47
+ echo "<div class='ambase-file'>";
48
+ echo $this->getClassPath($value, $codePool, $_index);
49
+ echo "</div>";
50
+
51
+
52
+ }
53
+ ?>
54
+ </td>
55
+ </tr>
56
+ <?php
57
+ }
58
+ }
59
+ }
60
+ ?>
61
+ </table>
62
+ </div>
app/design/adminhtml/default/default/template/amasty/ambase/promo.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ ?>
8
+ <?php
9
+ $notification = $this->getLatestNotification();
10
+
11
+ if ($notification) {
12
+
13
+ $closeUrl = $this->getCloseUrl();
14
+ $unsubscribeUrl = $this->getUnsubscribeUrl();
15
+
16
+ ?>
17
+ <div class="notification-global" id="amasty-update-notification">
18
+ <strong class="label"><?php echo $this->__("Latest Message:")?></strong>&nbsp;<?php echo $notification->getTitle()?>
19
+
20
+ <?php if($notification->getUrl()) {?>
21
+ &nbsp;<a href="<?php echo $notification->getUrl();?>" onclick="this.target='_blank';"><?php echo $this->__("Read details")?></a>
22
+ <?php }?>
23
+
24
+ <span class="f-right">
25
+ <a href="#" onclick="Effect.toggle('amasty-update-notification', 'blind', { duration: 0.1 });new Ajax.Request('<?php echo $closeUrl;?>', {
26
+ onCreate: function(request) {
27
+ Ajax.Responders.unregister(varienLoaderHandler.handler);
28
+ },
29
+ onSuccess: function(transport) {
30
+ Ajax.Responders.register(varienLoaderHandler.handler);
31
+ }
32
+ }); return false;"><?php echo $this->__("Close")?></a>&nbsp;|&nbsp;<a style="color: #A3A3A3;" href="<?php echo $unsubscribeUrl;?>"><?php echo $this->__("Unsubscribe")?></a>
33
+ </span>
34
+ </div>
35
+
36
+ <?php }?>
app/design/adminhtml/default/default/template/amasty/ambase/update.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Base
6
+ */
7
+ ?>
8
+ <?php
9
+ if ($this->isNewVersionAvailable())
10
+ {
11
+
12
+ $closeUrl = $this->getCloseUrl();
13
+ $unsubscribeUrl = $this->getUnsubscribeUrl();
14
+ ?>
15
+ <div id="amasty-promo-notification">
16
+ <ul class="messages">
17
+ <li class="notice-msg">
18
+ <ul>
19
+ <li>
20
+
21
+ <?php echo $this->__("New version %s is available for the %s by Amasty", $this->getLatestVersion(), $this->getModuleTitle())?>.&nbsp;<?php echo $this->__("See")?>&nbsp;<a href="<?php echo $this->getModuleLink();?>" onclick="this.target='_blank';"><?php echo $this->__("change-log")?></a>
22
+
23
+ <span class="f-right">
24
+ <a href="#" onclick="Effect.toggle('amasty-promo-notification', 'blind', { duration: 0.1 });new Ajax.Request('<?php echo $closeUrl;?>', {
25
+ onCreate: function(request) {
26
+ Ajax.Responders.unregister(varienLoaderHandler.handler);
27
+ },
28
+ onSuccess: function(transport) {
29
+ Ajax.Responders.register(varienLoaderHandler.handler);
30
+ }
31
+ }); return false;"><?php echo $this->__("Close")?></a>&nbsp;|&nbsp;<a style="color: #A3A3A3;" href="<?php echo $unsubscribeUrl;?>"><?php echo $this->__("Unsubscribe")?></a>
32
+ </span>
33
+
34
+ </li>
35
+ </ul>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ <?php
40
+ }
41
+ ?>
app/design/frontend/{default → base}/default/layout/amreview.xml RENAMED
@@ -1,4 +1,11 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
2
  <layout version="0.1.0">
3
  <default>
4
  <reference name="right">
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Review
7
+ */
8
+ -->
9
  <layout version="0.1.0">
10
  <default>
11
  <reference name="right">
app/design/frontend/{default → base}/default/template/amreview/sidebar.phtml RENAMED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  <?php $reviews = $this->getReviews() ?>
2
  <?php if ($reviews && $reviews->count() > 0) : ?>
3
  <div class="block block-review">
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Review
6
+ */
7
+ ?>
8
  <?php $reviews = $this->getReviews() ?>
9
  <?php if ($reviews && $reviews->count() > 0) : ?>
10
  <div class="block block-review">
app/design/frontend/{default → base}/default/template/amreview/sidebar_images.phtml RENAMED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  <?php $reviews = $this->getReviews() ?>
2
  <?php if ($reviews && $reviews->count() > 0) : ?>
3
  <div class="block block-review">
1
+ <?php
2
+ /**
3
+ * @author Amasty Team
4
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
5
+ * @package Amasty_Review
6
+ */
7
+ ?>
8
  <?php $reviews = $this->getReviews() ?>
9
  <?php if ($reviews && $reviews->count() > 0) : ?>
10
  <div class="block block-review">
app/etc/modules/Amasty_Base.xml CHANGED
@@ -1,4 +1,11 @@
1
- <?xml version="1.0"?>
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <Amasty_Base>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Base
7
+ */
8
+ -->
9
  <config>
10
  <modules>
11
  <Amasty_Base>
app/etc/modules/Amasty_Review.xml CHANGED
@@ -1,9 +1,16 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Amasty_Review>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </Amasty_Review>
8
- </modules>
 
 
 
 
 
 
 
9
  </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @author Amasty Team
5
+ * @copyright Copyright (c) 2016 Amasty (https://www.amasty.com)
6
+ * @package Amasty_Review
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Amasty_Review>
12
+ <active>true</active>
13
+ <codePool>community</codePool>
14
+ </Amasty_Review>
15
+ </modules>
16
  </config>
app/locale/en_US/Amasty_Base.csv ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Extensions Store","Extensions Store"
2
+ "Amasty Extensions Store","Amasty Extensions Store"
3
+ "Extensions &amp; Notifications","Extensions &amp; Notifications"
4
+ "Installed Extensions","Installed Extensions"
5
+ "Notifications","Notifications"
6
+ "I`d like to be informed by Amasty Updates about","I`d like to be informed by Amasty Updates about"
7
+ "I`d like to be informed by Amasty Promos about","I`d like to be informed by Amasty Promos about"
8
+ "Amasty - Extensions Information","Amasty - Extensions Information"
9
+ "Amasty - Extensions Store","Amasty - Extensions Store"
10
+ "Show","Show"
11
+ "Installed","Installed"
12
+ "Update available","Update available"
13
+ "Output disabled","Output disabled"
14
+ "Fix","Fix"
15
+ "Rollback","Rollback"
16
+ "Show instructions","Show instructions"
17
+ "Open file","Open file"
18
+ "Replace","Replace"
19
+ "to","to"
20
+ "Clear magento cache and all external caches like APC (if any).","Clear magento cache and all external caches like APC (if any)."
21
+ "No actions required","No actions required"
22
+ "General","General"
23
+ "Compilation","Compilation"
24
+ "On","On"
25
+ "Off","Off"
26
+ "Disabled output","Disabled output"
27
+ "No","No"
28
+ "Cron","Cron"
29
+ "No cron jobs found","No cron jobs found"
30
+ "Learn more","Learn more"
31
+ "Rewrites","Rewrites"
32
+ "Latest Message:","Latest Message:"
33
+ "Read details","Read details"
34
+ "Close","Close"
35
+ "Unsubscribe","Unsubscribe"
36
+ "New version %s is available for the %s by Amasty","New version %s is available for the %s by Amasty"
37
+ "See","See"
38
+ "change-log","change-log"
39
+ "Events","Events"
40
+ "method","method"
app/locale/en_US/Amasty_Review.csv ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Reviews Sidebar,Reviews Sidebar
2
+ Show Random,Show Random
3
+ Reviews in block,Reviews in block
4
+ Words Count,Words Count
5
+ Display Rating,Display Rating
6
+ Minimal Rating,Minimal Rating Allowed
7
+ Use Category,Use Category
8
+ Hide already viewed,Hide already viewed
9
+ Display Only Summary Rating,Display Only Summary Rating
10
+ For example 4.8 or 3.5. Set 0 to show all reviews,For example 4.8 or 3.5. Set to zero to display all reviews.
11
+ Show reviews from the current category only,"If set to ""Yes"", the system shows reviews from the current category only."
12
+ Show only unique reviews per user session. Recommended if you have a lot of reviews.,"If set to ""Yes"", the system shows only unique reviews during a user session. Recommended if you have a lot of reviews."
13
+ Recent Reviews,Recent Reviews
14
+ Review by %s,Review by %s
15
+
js/amasty/ambase/store.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ Event.observe(window, 'message', function(e){
2
+ if (e.data.action == 'setHeight')
3
+ {
4
+ var height = e.data.height;
5
+ $('amasty_store').setStyle({height: height+'px'});
6
+ }
7
+ });
package.xml CHANGED
@@ -1,19 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Reviews_Sidebar</name>
4
- <version>1.0.7</version>
5
  <stability>stable</stability>
6
- <license>AFL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Reviews sidebar block</summary>
10
- <description>Reviews sidebar block</description>
11
- <notes>Bugfix
12
- * Product images</notes>
13
- <authors><author><name>Amasty Team</name><user>auto-converted</user><email>amastysupport@gmail.com</email></author></authors>
14
- <date>2011-06-06</date>
15
- <time>10:20:01</time>
16
- <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="ambase"><file name="bad.gif" hash="b8379f1ba7ab552ca46b9d5fd0452345"/><file name="ok.gif" hash="a38bc2ee6e116e39c6e2e3013ee50f5e"/><file name="update.gif" hash="8342e11f7739fcfa25134707f0536ed6"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Amasty"><dir name="Base"><dir name="Block"><file name="Extensions.php" hash="e0f76a6c0e9d3db6f634562cbb0266bc"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2134fcecc3d5cb639a2446dded0032d5"/><file name="config.xml" hash="d4da2c9935b894c6362576209905ff89"/><file name="system.xml" hash="d7e5cda7d0b09152931039fdf1d4b2bc"/></dir><dir name="Helper"><file name="Data.php" hash="dd3a5d1f14acb20f3a86c43d50fe0dd4"/></dir><dir name="Model"><file name="Feed.php" hash="86fb0e24d6b1c9706caf69c908e710ad"/><dir name="Source"><dir name="Updates"><file name="Type.php" hash="dbb958c4aa01c61578cfb22a1c88a482"/></dir></dir></dir><dir name="sql"><dir name="ambase_setup"><file name="mysql4-install-1.0.0.php" hash="ba30c778afd0f4a959ec9f86d439ea0a"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="f3190a47b20973b8526213c60c96b304"/></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Amasty"><dir name="Review"><dir name="Block"><file name="Sidebar.php" hash="c464d4b8fd7c8a74f3ce4f7f8a2c5562"/></dir><dir name="etc"><file name="adminhtml.xml" hash="95bdba467b5adbf7920b239fc0e1a003"/><file name="config.xml" hash="1d233517e4695870ba93c46123e4760a"/><file name="system.xml" hash="2092043aa2bbe5a673319f9d3bbac1a1"/></dir><dir name="Helper"><file name="Data.php" hash="e21dbd2eb8bbbb330f01d9f1c0c6785a"/></dir><dir name="Model"><dir name="Mysql4"><file name="Collection.php" hash="f5efffbf317f19b6e949a084075bde7b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="amreview.xml" hash="df5b539c074f466e863cff47a4c98ac5"/></dir><dir name="template"><dir name="amreview"><file name="sidebar.phtml" hash="9012ef6ac60dedc69c70c03439a0d506"/><file name="sidebar_images.phtml" hash="be4ff35b0a3e092f5c9f5bfdeb1f2e0c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amasty_Base.xml" hash="651f99cee7568ab645fdef118f7933ca"/><file name="Amasty_Review.xml" hash="84f047ff01bce56c789217157cdcfd53"/></dir></target></contents>
17
  <compatible/>
18
- <dependencies/>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Reviews_Sidebar</name>
4
+ <version>1.0.6</version>
5
  <stability>stable</stability>
6
+ <license>commercial</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Reviews Sidebar extension by Amasty</summary>
10
+ <description>Show block with reviews on all pages to add more credibility to your Magento store.</description>
11
+ <notes>Minor improvements</notes>
12
+ <authors><author><name>Amasty Ltd.</name><user>MAG000001054</user><email>support@amasty.com</email></author></authors>
13
+ <date>2016-08-02</date>
14
+ <time>10:43:41</time>
15
+ <contents><target name="magecommunity"><dir name="Amasty"><dir name="Review"><dir name="Block"><file name="Sidebar.php" hash="3a9e7f268592702784f3143032082fd2"/></dir><dir name="Helper"><file name="Data.php" hash="719604edc96b8cc1768b576ce5c31911"/></dir><dir name="Model"><dir name="Mysql4"><file name="Collection.php" hash="466def29e57751a93c317902e94e0111"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="90de29993b2ed10caf449e7ce000f164"/><file name="config.xml" hash="17d5f75510243e2aef0e78e63089fd9d"/><file name="system.xml" hash="3cdf88c906417012a4c436851496dddf"/></dir></dir></dir></target><target name="magelocal"><dir name="Amasty"><dir name="Base"><dir name="Block"><dir name="Adminhtml"><dir name="Debug"><file name="Base.php" hash="9b9231fde7d248689b4bc2d3d526307a"/><file name="Conflict.php" hash="37f6b12a1f597b28adfa1732271dad74"/><file name="Event.php" hash="fef62a2f34d6c2be299d3abd447439fd"/><file name="General.php" hash="e8db92028abcddeffb0a7263f63ef363"/><file name="Rewrite.php" hash="94e33f56d868b77b734259c681576a3e"/></dir><file name="Promo.php" hash="5e5f5dee640d7f765173e0a08881aa74"/><file name="Update.php" hash="311e754b6d6e94d4e5a8b017d4c1ecbe"/></dir><file name="Conflicts.php" hash="d3e8c17d33284578c4cbcff69dc264bd"/><file name="Extensions.php" hash="58d34e5aed0ae2fe6791ab6c88a20c05"/><file name="Store.php" hash="df5275f68ece25a4bfdeb2d223a345da"/></dir><dir name="Helper"><file name="Data.php" hash="f670903623cdcbeebc21c4ea77a7b703"/><file name="Module.php" hash="de86c98ec0b9dbfc47580e80bd308c10"/><file name="Promo.php" hash="09e70e27f98c3d987c7e7474f8412531"/></dir><dir name="Model"><file name="Conflict.php" hash="539b32bd96ab45335603c3420dfc08d4"/><file name="Feed.php" hash="709126893ad69f15c07084acbeeb3551"/><dir name="Resource"><dir name="Event"><file name="Collection.php" hash="5a3cf7becff4b1bb517cf5e8cf743fb3"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Ambase"><file name="BaseController.php" hash="df8a096ef0b4171a4896d8aa1f984117"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ceca9dc9372834b36cd6cfd985bf9fcb"/><file name="config.xml" hash="f445927829a60c31f6b2d088fea7fa75"/><file name="system.xml" hash="ef6bbd90062b2420445350e535d9e4e3"/></dir><dir name="sql"><dir name="ambase_setup"><file name="mysql4-install-1.0.0.php" hash="9a368f80f1199d743706c697189bff6d"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="2552bd2de7a1464466a19d20a925e236"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="amasty"><dir name="ambase"><file name="ambase.xml" hash="500cfe2d3c821a989411c7aec15a52b0"/></dir></dir></dir><dir name="template"><dir name="amasty"><dir name="ambase"><dir name="debug"><file name="conflict.phtml" hash="fc21612b3acf14327f43e40bde38c0ba"/><file name="event.phtml" hash="aae6fa07f57b073b79e4c8f75457b809"/><file name="general.phtml" hash="08b6134acb311b43048c14834728adca"/><file name="rewrite.phtml" hash="bd7e4d5198efca382f4d38787f834f30"/></dir><file name="promo.phtml" hash="d1178a52bf324d0335ccd57e330eb8ef"/><file name="update.phtml" hash="2ce8f5982733dbda0846db29e2088a38"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="amreview.xml" hash="dad0892eacdb7a389e90d13b2b1a01ce"/></dir><dir name="template"><dir name="amreview"><file name="sidebar.phtml" hash="f810d572b545dd90a676c0ae6d6530ec"/><file name="sidebar_images.phtml" hash="35093a8bffd3a666b3f48aa9466826fd"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amasty_Base.xml" hash="ef85aa59b81c13d7e4597f20966b9a23"/><file name="Amasty_Review.xml" hash="735aa186b456a0734e7dd547ee87befd"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Amasty_Base.csv" hash="4d08e35129a4994680c81c4f93eee557"/><file name="Amasty_Review.csv" hash="d47ea1584674b49bab67bb93eb334316"/></dir></target><target name="mageweb"><dir name="js"><dir name="amasty"><dir name="ambase"><file name="store.js" hash="af39fe63cf0adafe6d2d9b60ac4bdbb4"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="amasty"><dir name="ambase"><file name="style.css" hash="ecbdd48a8acd42d7aba5896c9029112f"/></dir></dir></dir><dir name="images"><dir name="ambase"><file name="amasty.png" hash="df5b432f2a65d397d89fea1087e9fd0f"/><file name="bad.gif" hash="b8379f1ba7ab552ca46b9d5fd0452345"/><file name="ok.gif" hash="a38bc2ee6e116e39c6e2e3013ee50f5e"/><file name="shop.png" hash="810bbb4f3e286627e211d5e6f7190257"/><file name="update.gif" hash="8342e11f7739fcfa25134707f0536ed6"/></dir></dir></dir></dir></dir></target></contents>
 
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>
skin/adminhtml/default/default/css/amasty/ambase/style.css ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #amasty_store
2
+ {
3
+ border: none;
4
+ height: 1700px; /* fallback */
5
+ width: 100%;
6
+ }
7
+
8
+ .amasty-store-tab
9
+ {
10
+ position: relative;
11
+ }
12
+
13
+ .amasty-store-tab span:after
14
+ {
15
+ top: 0;
16
+ right: 3px;
17
+ position: absolute;
18
+ content: " ";
19
+ display: block;
20
+ background: url(../../../images/ambase/shop.png) no-repeat;
21
+ width: 55px;
22
+ height: 23px;
23
+ }
24
+
25
+ .ambase-debug-section{
26
+ background: #FFF;
27
+ padding: 10px;
28
+ border: 1px solid #d6d6d6;
29
+ }
30
+
31
+ .ambase-debug-section table td{
32
+ padding: 5px 10px;
33
+ vertical-align: top;
34
+ }
35
+
36
+ .ambase-debug-section .green{
37
+ color: green;
38
+ }
39
+
40
+ .ambase-debug-section .red{
41
+ color: red;
42
+ }
43
+
44
+ .ambase-debug-header{
45
+ font-weight: bold;
46
+ padding: 10px 0px;
47
+ font-size: 1.3em;
48
+ }
49
+
50
+ .ambase-show-instruction{
51
+ color: grey;
52
+ text-decoration: underline;
53
+ cursor: pointer;
54
+ }
55
+
56
+ .ambase-instruction{
57
+ font-size: 0.8em;
58
+ }
59
+
60
+ .ambase-instruction li{
61
+ margin: 0;
62
+ }
63
+
64
+ .ambase-file{
65
+ font-size: 0.8em;
66
+ color: grey;
67
+ }
68
+
69
+ .ambase-debug-header-click{
70
+ text-decoration: underline;
71
+ cursor: pointer;
72
+ }
73
+
74
+ .ambase-hidden{
75
+ visibility: hidden;
76
+ }
skin/adminhtml/default/default/images/ambase/amasty.png ADDED
Binary file
skin/adminhtml/default/default/images/ambase/shop.png ADDED
Binary file