customtoolbar_module - Version 0.1.2

Version Notes

Bug fixing

Download this release

Release Info

Developer Biztech
Extension customtoolbar_module
Version 0.1.2
Comparing to
See all releases


Code changes from version 0.1.1 to 0.1.2

app/code/local/Biztech/All/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Biztech_All_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Biztech/All/Model/All.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Biztech_All_Model_All extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('all/all');
9
+ }
10
+ }
app/code/local/Biztech/All/Model/Mysql4/All.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Biztech_All_Model_Mysql4_All extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the all_id refers to the key field in your database table.
8
+ $this->_init('all/all', 'all_id');
9
+ }
10
+ }
app/code/local/Biztech/All/Model/Mysql4/All/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Biztech_All_Model_Mysql4_All_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('all/all');
9
+ }
10
+ }
app/code/local/Biztech/All/Model/Source/Updates/Type.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ */
11
+
12
+ class Biztech_All_Model_Source_Updates_Type extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
13
+ {
14
+ const TYPE_UPDATE_RELEASE = 'UPDATE_RELEASE';
15
+ const TYPE_INSTALLED_UPDATE = 'INSTALLED_UPDATE';
16
+ public function toOptionArray()
17
+ {
18
+ return array(
19
+ array('value' => self::TYPE_INSTALLED_UPDATE, 'label' => Mage::helper('all')->__('My extensions updates')),
20
+ array('value' => self::TYPE_UPDATE_RELEASE, 'label' => Mage::helper('all')->__('All extensions updates')),
21
+ );
22
+ }
23
+
24
+ public function getAllOptions()
25
+ {
26
+ return $this->toOptionArray();
27
+ }
28
+
29
+
30
+ public function getLabel($value)
31
+ {
32
+ $options = $this->toOptionArray();
33
+ foreach ($options as $v) {
34
+ if ($v['value'] == $value) {
35
+ return $v['label'];
36
+ }
37
+ }
38
+ return '';
39
+ }
40
+
41
+ public function getGridOptions()
42
+ {
43
+ $items = $this->getAllOptions();
44
+ $out = array();
45
+ foreach ($items as $item) {
46
+ $out[$item['value']] = $item['label'];
47
+ }
48
+ return $out;
49
+ }
50
+ }
app/code/local/Biztech/All/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Biztech_All_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('all')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('all')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Biztech/All/Model/Update.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Biztech_All_Model_Update extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ const UPDATE_NOTIFICATION_FEED_URL = 'http://store.biztechconsultancy.com/rss/catalog/new/store_id/1/';
7
+ public function getInterests()
8
+ {
9
+ $types = @explode(',', Mage::getStoreConfig('all/all_general/interests'));
10
+ return $types;
11
+ }
12
+ public function isExtensionInstalled($code)
13
+ {
14
+
15
+ $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
16
+ foreach ($modules as $moduleName) {
17
+ if ($moduleName == $code) {
18
+ return true;
19
+ }
20
+ }
21
+ return false;
22
+ }
23
+
24
+ public function check()
25
+ {
26
+ if ((time() - Mage::app()->loadCache('biztech_all_updates_feed_lastcheck')) > Mage::getStoreConfig('all/all_general/check_frequency')) {
27
+ $this->refresh();
28
+ }
29
+ }
30
+
31
+ public function refresh()
32
+ {
33
+ $types = array();
34
+ $feedData = array();
35
+ $extensio_module = array();
36
+ try{
37
+ $xml = file_get_contents(self::UPDATE_NOTIFICATION_FEED_URL);
38
+ $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);//LIBXML_NOCDATA LIBXML_NOWARNING
39
+
40
+ $interests = $this->getInterests();
41
+ if(!empty($interests[0])){
42
+ $isInterestedInSelfUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_INSTALLED_UPDATE, $interests);
43
+ $isInterestedInAllUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_UPDATE_RELEASE, $interests);
44
+ $modules = Mage::getConfig()->getNode('modules')->children();
45
+ $modulesArray = (array)$modules;
46
+ foreach($xml->channel->item as $keys=>$extensions) {
47
+ $types[] = (string) $extensions->update_notifications->type;
48
+ $extensions_name = (string)$extensions->update_notifications->extensions;
49
+
50
+ if((string)$extensions->update_notifications->date!=""&&(string)$extensions->update_notifications->extension_title!=""&&(string)$extensions->update_notifications->extension_content!=""&&(string)$extensions->update_notifications->product_url!=""){
51
+ if(!$isInterestedInAllUpgrades){
52
+ if ($this->isExtensionInstalled($extensions_name)) {
53
+ $feedData[] = array(
54
+ 'severity' => 4,
55
+ 'date_added' => (string) $extensions->update_notifications->date,
56
+ 'title' => (string)$extensions->update_notifications->extension_title,
57
+ 'description' => (string)$extensions->update_notifications->extension_content,
58
+ 'url' => (string)$extensions->update_notifications->product_url,
59
+ );
60
+ }
61
+ } else{
62
+ $feedData[] = array(
63
+ 'severity' => 4,
64
+ 'date_added' => (string)$extensions->update_notifications->date,
65
+ 'title' => (string)$extensions->update_notifications->extension_title,
66
+ 'description' => (string)$extensions->update_notifications->extension_content,
67
+ 'url' => (string)$extensions->update_notifications->product_url,
68
+ );
69
+ }
70
+ }
71
+ }
72
+ if ($feedData) {
73
+ foreach($feedData as $data){
74
+ if ((array_intersect($types,$interests) && $isInterestedInSelfUpgrades)) {
75
+ Mage::getModel('adminnotification/inbox')->parse(array_reverse(array($data)));
76
+ }
77
+ }
78
+ }
79
+ Mage::app()->saveCache(time(), 'biztech_all_updates_feed_lastcheck');
80
+ return true;
81
+ }
82
+ }catch (Exception $e) {
83
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
84
+ }
85
+ }
86
+ }
app/code/local/Biztech/All/etc/config.xml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Biztech
5
+ * @package Biztech_All
6
+ * @author ModuleCreator
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Biztech_All>
13
+ <version>0.1.0</version>
14
+ </Biztech_All>
15
+ </modules>
16
+ <frontend>
17
+ <routers>
18
+ <all>
19
+ <use>standard</use>
20
+ <args>
21
+ <module>Biztech_All</module>
22
+ <frontName>all</frontName>
23
+ </args>
24
+ </all>
25
+ </routers>
26
+
27
+ </frontend>
28
+ <admin>
29
+ <routers>
30
+ <all>
31
+ <use>admin</use>
32
+ <args>
33
+ <module>Biztech_All</module>
34
+ <frontName>all</frontName>
35
+ </args>
36
+ </all>
37
+ </routers>
38
+ </admin>
39
+ <adminhtml>
40
+
41
+ <acl>
42
+ <resources>
43
+ <all>
44
+ <title>Allow Everything</title>
45
+ </all>
46
+ <admin>
47
+ <children>
48
+ <Biztech_All>
49
+ <title>All Module</title>
50
+ <sort_order>10</sort_order>
51
+ </Biztech_All>
52
+ </children>
53
+ </admin>
54
+ </resources>
55
+ </acl>
56
+ <events>
57
+ <controller_action_predispatch>
58
+ <observers>
59
+
60
+ <bzall_upds>
61
+ <type>singleton</type>
62
+ <class>all/update</class>
63
+ <method>check</method>
64
+ </bzall_upds>
65
+ </observers>
66
+ </controller_action_predispatch>
67
+ </events>
68
+
69
+ </adminhtml>
70
+ <global>
71
+ <models>
72
+ <all>
73
+ <class>Biztech_All_Model</class>
74
+ <resourceModel>all_mysql4</resourceModel>
75
+ </all>
76
+ <all_mysql4>
77
+ <class>Biztech_All_Model_Mysql4</class>
78
+ <entities>
79
+ <all>
80
+ <table>all</table>
81
+ </all>
82
+ </entities>
83
+ </all_mysql4>
84
+ </models>
85
+ <resources>
86
+ <all_setup>
87
+ <setup>
88
+ <module>Biztech_All</module>
89
+ </setup>
90
+ <connection>
91
+ <use>core_setup</use>
92
+ </connection>
93
+ </all_setup>
94
+ <all_write>
95
+ <connection>
96
+ <use>core_write</use>
97
+ </connection>
98
+ </all_write>
99
+ <all_read>
100
+ <connection>
101
+ <use>core_read</use>
102
+ </connection>
103
+ </all_read>
104
+ </resources>
105
+ <blocks>
106
+ <all>
107
+ <class>Biztech_All_Block</class>
108
+ </all>
109
+ </blocks>
110
+ <helpers>
111
+ <all>
112
+ <class>Biztech_All_Helper</class>
113
+ </all>
114
+ </helpers>
115
+ </global>
116
+ <default>
117
+ <all>
118
+ <all_general>
119
+ <check_frequency>86400</check_frequency>
120
+ </all_general>
121
+ </all>
122
+ </default>
123
+ </config>
app/code/local/Biztech/All/etc/system.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <config>
3
+ <tabs>
4
+ <biztech translate="label" module="all">
5
+ <label>Biztech Extensions</label>
6
+ <sort_order>400</sort_order>
7
+ </biztech>
8
+ </tabs>
9
+ <sections>
10
+ <all translate="label" module="all">
11
+ <label>Info</label>
12
+ <tab>biztech</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>10</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
+
20
+ <all_general translate="label">
21
+ <label>General</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>10</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
+ <fields>
28
+
29
+ <interests translate="label">
30
+ <label>I'd like to be informed by Biztech about:</label>
31
+ <comment></comment>
32
+ <frontend_type>multiselect</frontend_type>
33
+ <sort_order>100</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ <can_be_empty>1</can_be_empty>
38
+ <source_model>all/source_updates_type</source_model>
39
+ </interests>
40
+
41
+ </fields>
42
+ </all_general>
43
+ </groups>
44
+ </all>
45
+ </sections>
46
+ </config>
app/code/local/Biztech/Customtoolbar/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <Biztech_Customtoolbar>
6
- <version>0.1.1</version>
7
  </Biztech_Customtoolbar>
8
  </modules>
9
  <frontend>
3
  <config>
4
  <modules>
5
  <Biztech_Customtoolbar>
6
+ <version>0.1.2</version>
7
  </Biztech_Customtoolbar>
8
  </modules>
9
  <frontend>
app/design/frontend/default/default/template/customtoolbar/toolbar.phtml CHANGED
@@ -103,7 +103,7 @@
103
  ?>
104
  <div class="filter-by" style="float: left; padding-left: 10px;">
105
  <?php
106
- $entity_type_id = 4;
107
  $attributes = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($entity_type_id)->addFieldToFilter("backend_type",array("eq"=>'int'))->addFieldToFilter("frontend_input",array("eq"=>'select'))->addFieldToFilter("used_for_filter_by",array("eq"=>'1'));
108
  ?>
109
  <table><tr><td>
103
  ?>
104
  <div class="filter-by" style="float: left; padding-left: 10px;">
105
  <?php
106
+ $entity_type_id =Mage::getModel('catalog/product')->getResource()->getTypeId();
107
  $attributes = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($entity_type_id)->addFieldToFilter("backend_type",array("eq"=>'int'))->addFieldToFilter("frontend_input",array("eq"=>'select'))->addFieldToFilter("used_for_filter_by",array("eq"=>'1'));
108
  ?>
109
  <table><tr><td>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>customtoolbar_module</name>
4
- <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -16,11 +16,11 @@ Advantages&#xD;
16
  &#x2022; The custom Toolbar module allows your customers to get quick access to regularly used product with specific characteristics.&#xD;
17
  &#x2022; The extension consists of friendly user interface making it easier to use. It can be installed quickly and with ease. &#xD;
18
  </description>
19
- <notes>-Search enhancement</notes>
20
  <authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
21
- <date>2014-02-04</date>
22
- <time>08:52:09</time>
23
- <contents><target name="mageetc"><dir name="modules"><file name="Biztech_Customtoolbar.xml" hash="6cd053117e062b8334759941b84c7806"/></dir></target><target name="magelocal"><dir name="Biztech"><dir name="Customtoolbar"><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="Attribute"><dir name="Edit"><dir name="Tab"><file name="Main.php" hash="46b5eac785f0f40e551b8a43eb71f4ed"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="82893973976fdab398b0d061e8426390"/></dir><dir name="controllers"><file name="IndexController.php" hash="19b0c174b4ee577fa83122e20da6ac79"/></dir><dir name="etc"><file name="config.xml" hash="2f77c9bdf7b94abb8d55b0870fa2c288"/><file name="system.xml" hash="3ccc36394334e30115890a5edffba211"/></dir><dir name="sql"><dir name="customtoolbar_setup"><file name="mysql4-install-0.1.0.php" hash="127973676228a67a8600437da0d08866"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="customtoolbar.xml" hash="33b5081676020676c9e374f54a6da200"/></dir><dir name="template"><dir name="customtoolbar"><file name="toolbar.phtml" hash="624ead685df5857d7fd813a1cf09382e"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="main-bg.png" hash="615e539beac7fc4ad7b6aa7e519ca2ee"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>customtoolbar_module</name>
4
+ <version>0.1.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
16
  &#x2022; The custom Toolbar module allows your customers to get quick access to regularly used product with specific characteristics.&#xD;
17
  &#x2022; The extension consists of friendly user interface making it easier to use. It can be installed quickly and with ease. &#xD;
18
  </description>
19
+ <notes>Bug fixing</notes>
20
  <authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
21
+ <date>2014-06-13</date>
22
+ <time>10:43:31</time>
23
+ <contents><target name="mageetc"><dir name="modules"><file name="Biztech_Customtoolbar.xml" hash="6cd053117e062b8334759941b84c7806"/></dir><dir name="Biztech"><file name="All" hash=""/></dir></target><target name="magelocal"><dir name="Biztech"><dir name="Customtoolbar"><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="Attribute"><dir name="Edit"><dir name="Tab"><file name="Main.php" hash="46b5eac785f0f40e551b8a43eb71f4ed"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="82893973976fdab398b0d061e8426390"/></dir><dir name="controllers"><file name="IndexController.php" hash="19b0c174b4ee577fa83122e20da6ac79"/></dir><dir name="etc"><file name="config.xml" hash="0ac999598aab40703399d0c724ee4f33"/><file name="system.xml" hash="3ccc36394334e30115890a5edffba211"/></dir><dir name="sql"><dir name="customtoolbar_setup"><file name="mysql4-install-0.1.0.php" hash="127973676228a67a8600437da0d08866"/></dir></dir></dir><dir name="All"><dir name="Helper"><file name="Data.php" hash="e856726fd089e7f73ca7de450b696419"/></dir><dir name="Model"><file name="All.php" hash="a9aeeb9c6d7be9cf20414f405efc878d"/><dir name="Mysql4"><dir name="All"><file name="Collection.php" hash="a1909236183d126f38e628b85bb57e81"/></dir><file name="All.php" hash="f02542393eb26eadfb9b92d901d2ac12"/></dir><dir name="Source"><dir name="Updates"><file name="Type.php" hash="fa695bf4764c2d93c7436ed54bde89ba"/></dir></dir><file name="Status.php" hash="30a6f0da7d9d45e1082da532d5f8dabc"/><file name="Update.php" hash="83ceddbab4d621545b9c7c4bccdec7c0"/></dir><dir name="etc"><file name="config.xml" hash="4a017647b9d0bb08f59234fd72f06e4b"/><file name="system.xml" hash="17262087dc933d934e09ac04cafb4c51"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="customtoolbar.xml" hash="33b5081676020676c9e374f54a6da200"/></dir><dir name="template"><dir name="customtoolbar"><file name="toolbar.phtml" hash="ed67c81872dfb5444c98377ceedcfbd8"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="main-bg.png" hash="615e539beac7fc4ad7b6aa7e519ca2ee"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>