RocketWeb_CustomOptionValidator - Version 1.0.1

Version Notes

Refactored the extension not to overwrite any template files

Download this release

Release Info

Developer RocketWeb
Extension RocketWeb_CustomOptionValidator
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/RocketWeb/All/Helper/Data.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- class RocketWeb_All_Helper_Data extends Mage_Core_Helper_Data {
3
-
4
- }
 
 
 
 
app/code/community/RocketWeb/All/Model/Feed.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- class RocketWeb_All_Model_Feed extends Mage_AdminNotification_Model_Feed {
3
- public function getFeedUrl() {
4
- $url = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://':'http://').'www.rocketweb.com/media/rss-notification.xml';
5
- return $url;
6
- }
7
-
8
-
9
- public function getLastUpdate()
10
- {
11
- return Mage::app()->loadCache('rocketweb_notifications_lastcheck');
12
- }
13
-
14
- public function setLastUpdate()
15
- {
16
- Mage::app()->saveCache(time(), 'rocketweb_notifications_lastcheck');
17
- return $this;
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RocketWeb/All/Model/Observer.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class RocketWeb_All_Model_Observer {
3
- public function updateNotifications($observer) {
4
- if (Mage::getStoreConfig('rocketweb_all/general/enable_notifications')) {
5
- try {
6
- Mage::getModel('rocketweb_all/feed')->checkUpdate();
7
- } catch (Exception $e) {
8
- //silently ignore
9
- }
10
- }
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RocketWeb/All/etc/adminhtml.xml DELETED
@@ -1,23 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <acl>
4
- <resources>
5
- <admin>
6
- <children>
7
- <system>
8
- <children>
9
- <config>
10
- <children>
11
- <rocketweb_all translate="title" module="rocketweb_all">
12
- <title>RocketWeb All</title>
13
- <sort_order>1006000</sort_order>
14
- </rocketweb_all>
15
- </children>
16
- </config>
17
- </children>
18
- </system>
19
- </children>
20
- </admin>
21
- </resources>
22
- </acl>
23
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RocketWeb/All/etc/config.xml DELETED
@@ -1,40 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <RocketWeb_All>
5
- <version>1.0.0</version>
6
- </RocketWeb_All>
7
- </modules>
8
- <global>
9
- <helpers>
10
- <rocketweb_all>
11
- <class>RocketWeb_All_Helper</class>
12
- </rocketweb_all>
13
- </helpers>
14
- <models>
15
- <rocketweb_all>
16
- <class>RocketWeb_All_Model</class>
17
- </rocketweb_all>
18
- </models>
19
- </global>
20
- <adminhtml>
21
- <events>
22
- <controller_action_predispatch>
23
- <observers>
24
- <rocketweb_all>
25
- <type>singleton</type>
26
- <class>rocketweb_all/observer</class>
27
- <method>updateNotifications</method>
28
- </rocketweb_all>
29
- </observers>
30
- </controller_action_predispatch>
31
- </events>
32
- </adminhtml>
33
- <default>
34
- <rocketweb_all>
35
- <general>
36
- <enable_notifications>1</enable_notifications>
37
- </general>
38
- </rocketweb_all>
39
- </default>
40
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RocketWeb/All/etc/system.xml DELETED
@@ -1,42 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <tabs>
4
- <rocketweb_tab>
5
- <label>Rocket Web Extensions</label>
6
- <sort_order>1005001</sort_order>
7
- </rocketweb_tab>
8
- </tabs>
9
- <sections>
10
- <rocketweb_all translate="label" module="rocketweb_all">
11
- <label>General</label>
12
- <tab>rocketweb_tab</tab>
13
- <frontend_type>text</frontend_type>
14
- <sort_order>100</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
- <general translate="label">
20
- <label>Settings</label>
21
- <frontend_type>text</frontend_type>
22
- <sort_order>10</sort_order>
23
- <show_in_default>1</show_in_default>
24
- <show_in_website>1</show_in_website>
25
- <show_in_store>1</show_in_store>
26
- <fields>
27
- <enable_notifications translate="label comment">
28
- <label>Enable notifications?</label>
29
- <comment><![CDATA[]]></comment>
30
- <frontend_type>select</frontend_type>
31
- <source_model>adminhtml/system_config_source_yesno</source_model>
32
- <sort_order>10</sort_order>
33
- <show_in_default>1</show_in_default>
34
- <show_in_website>1</show_in_website>
35
- <show_in_store>1</show_in_store>
36
- </enable_notifications>
37
- </fields>
38
- </general>
39
- </groups>
40
- </rocketweb_all>
41
- </sections>
42
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RocketWeb/CustomOptionValidator/Block/Rewrite/Adminhtml/Catalog/Product/Edit/Tab/Options/Option.php CHANGED
@@ -2,6 +2,14 @@
2
  class RocketWeb_CustomOptionValidator_Block_Rewrite_Adminhtml_Catalog_Product_Edit_Tab_Options_Option
3
  extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option {
4
 
 
 
 
 
 
 
 
 
5
  public function getOptionValues()
6
  {
7
  parent::getOptionValues();
2
  class RocketWeb_CustomOptionValidator_Block_Rewrite_Adminhtml_Catalog_Product_Edit_Tab_Options_Option
3
  extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option {
4
 
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setTemplate('rocketweb_cov/catalog/product/edit/options/option.phtml');
9
+ $this->setCanReadPrice(true);
10
+ $this->setCanEditPrice(true);
11
+ }
12
+
13
  public function getOptionValues()
14
  {
15
  parent::getOptionValues();
app/code/community/RocketWeb/CustomOptionValidator/etc/config.xml CHANGED
@@ -37,6 +37,15 @@
37
  </rocketweb_cov_setup>
38
  </resources>
39
  </global>
 
 
 
 
 
 
 
 
 
40
  <adminhtml>
41
  <layout>
42
  <updates>
37
  </rocketweb_cov_setup>
38
  </resources>
39
  </global>
40
+ <frontend>
41
+ <layout>
42
+ <updates>
43
+ <rocketweb_cov>
44
+ <file>rocketweb_cov.xml</file>
45
+ </rocketweb_cov>
46
+ </updates>
47
+ </layout>
48
+ </frontend>
49
  <adminhtml>
50
  <layout>
51
  <updates>
app/design/adminhtml/default/default/template/{catalog → rocketweb_cov/catalog}/product/edit/options/option.phtml RENAMED
File without changes
app/design/frontend/base/default/layout/rocketweb_cov.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+ <catalog_product_view>
5
+ <reference name="product.info.options">
6
+ <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>rocketweb_cov/catalog/product/view/options/type/text.phtml</template></action>
7
+ </reference>
8
+ </catalog_product_view>
9
+ </layout>
app/design/frontend/base/default/template/{catalog → rocketweb_cov/catalog}/product/view/options/type/text.phtml RENAMED
File without changes
app/etc/modules/RocketWeb_All.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <RocketWeb_All>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </RocketWeb_All>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/etc/modules/RocketWeb_CustomOptionValidator.xml CHANGED
@@ -4,6 +4,9 @@
4
  <RocketWeb_CustomOptionValidator>
5
  <active>true</active>
6
  <codePool>community</codePool>
 
 
 
7
  </RocketWeb_CustomOptionValidator>
8
  </modules>
9
  </config>
4
  <RocketWeb_CustomOptionValidator>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Catalog/>
9
+ </depends>
10
  </RocketWeb_CustomOptionValidator>
11
  </modules>
12
  </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>RocketWeb_CustomOptionValidator</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Add validation to custom product options</summary>
10
  <description>This module brings the power of Magento's form validation to the custom product options</description>
11
- <notes>Initial release</notes>
12
  <authors><author><name>RocketWeb</name><user>rocketweb</user><email>dev@rocketweb.com</email></author></authors>
13
- <date>2012-12-12</date>
14
- <time>10:27:20</time>
15
- <contents><target name="magecommunity"><dir name="RocketWeb"><dir name="CustomOptionValidator"><dir name="Block"><dir name="Adminhtml"><file name="Validators.php" hash="a7348ceed96b90cf6f1ef7ac11d0792b"/></dir><dir name="Rewrite"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Options"><file name="Option.php" hash="794d415489e3530637626d46bad2cd6e"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="877e3b10b9b744d2d5c9a9fcb8844616"/></dir><dir name="Model"><dir name="Validator"><file name="List.php" hash="d17083cfc6094e8b25200d0144257f4e"/><file name="Type.php" hash="f2bbc9696d79d9ff7c487a8b134e071f"/></dir><file name="Validator.php" hash="4b48a10956b1c1ba2f4c7e3761c12213"/></dir><dir name="etc"><file name="config.xml" hash="5f7a4e6639c7f3f3dbb12f7db1219720"/></dir><dir name="sql"><dir name="rocketweb_cov_setup"><file name="mysql4-install-1.0.0.php" hash="fd2d5b23ed0339f12d07c67b99f0582c"/></dir></dir></dir><dir name="All"><dir name="Helper"><file name="Data.php" hash="e6dbd2a24db3d4d7861ef1c147c1fa76"/></dir><dir name="Model"><file name="Feed.php" hash="8e6a50942b3d1e5837a5ea989b9ef490"/><file name="Observer.php" hash="f6a9c8853b162372d9ed6c6bf7e3f86c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="4fd75eb093ed58499256b0104018d523"/><file name="config.xml" hash="f0f72a5904f611a6c8e6d9c6cb074a5b"/><file name="system.xml" hash="90913e8ae8134bbe09c0f0a6552ff395"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RocketWeb_CustomOptionValidator.xml" hash="f1ce6a52c27861a4d544f357c2e8dc84"/><file name="RocketWeb_All.xml" hash="b1c635dc428097a7fca6c9a1da0b7e04"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="rocketweb_cov.xml" hash="9ac2f2898b730b38fedc376e25d84adf"/></dir><dir name="template"><dir name="catalog"><dir name="product"><dir name="edit"><dir name="options"><file name="option.phtml" hash="d0c9f251ac43ad7ef2ee69dec9b2bcfa"/></dir></dir></dir></dir><dir name="rocketweb_cov"><dir name="adminhtml"><file name="validators.phtml" hash="2f356f2ba5d7076985f85155168dba70"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><dir name="options"><dir name="type"><file name="text.phtml" hash="524b03911b5e9766923784ba1cacb2e0"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="rocketweb"><dir name="adminhtml"><file name="custom_option_validation.css" hash="b68a2e4596cff3260ae614bc7c1060be"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="rocketweb"><dir name="adminhtml"><file name="custom_option_validation.js" hash="5b6afe6a66c384ca2227a8c7ccf6c936"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>4.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>RocketWeb_CustomOptionValidator</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Add validation to custom product options</summary>
10
  <description>This module brings the power of Magento's form validation to the custom product options</description>
11
+ <notes>Refactored the extension not to overwrite any template files</notes>
12
  <authors><author><name>RocketWeb</name><user>rocketweb</user><email>dev@rocketweb.com</email></author></authors>
13
+ <date>2012-12-13</date>
14
+ <time>10:14:04</time>
15
+ <contents><target name="magecommunity"><dir name="RocketWeb"><dir name="CustomOptionValidator"><dir name="Block"><dir name="Adminhtml"><file name="Validators.php" hash="a7348ceed96b90cf6f1ef7ac11d0792b"/></dir><dir name="Rewrite"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Options"><file name="Option.php" hash="ff4ebd2464c3527b5a3cc6681350c69d"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="877e3b10b9b744d2d5c9a9fcb8844616"/></dir><dir name="Model"><dir name="Validator"><file name="List.php" hash="d17083cfc6094e8b25200d0144257f4e"/><file name="Type.php" hash="f2bbc9696d79d9ff7c487a8b134e071f"/></dir><file name="Validator.php" hash="4b48a10956b1c1ba2f4c7e3761c12213"/></dir><dir name="etc"><file name="config.xml" hash="37f0a85ad27e99497ae38c64f9b66201"/></dir><dir name="sql"><dir name="rocketweb_cov_setup"><file name="mysql4-install-1.0.0.php" hash="fd2d5b23ed0339f12d07c67b99f0582c"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RocketWeb_CustomOptionValidator.xml" hash="c14603fbb1fe7cd28f6451e866da5dfb"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="rocketweb_cov.xml" hash="9ac2f2898b730b38fedc376e25d84adf"/></dir><dir name="template"><dir name="rocketweb_cov"><dir name="adminhtml"><file name="validators.phtml" hash="2f356f2ba5d7076985f85155168dba70"/></dir><dir name="catalog"><dir name="product"><dir name="edit"><dir name="options"><file name="option.phtml" hash="d0c9f251ac43ad7ef2ee69dec9b2bcfa"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="rocketweb_cov"><dir name="catalog"><dir name="product"><dir name="view"><dir name="options"><dir name="type"><file name="text.phtml" hash="524b03911b5e9766923784ba1cacb2e0"/></dir></dir></dir></dir></dir></dir></dir><dir name="layout"><file name="rocketweb_cov.xml" hash="4019ef10100d6dcfe39b802e5879da50"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="rocketweb"><dir name="adminhtml"><file name="custom_option_validation.css" hash="b68a2e4596cff3260ae614bc7c1060be"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="rocketweb"><dir name="adminhtml"><file name="custom_option_validation.js" hash="5b6afe6a66c384ca2227a8c7ccf6c936"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>4.2.0</min><max>6.0.0</max></php><package><name>RocketWeb_All</name><channel>community</channel><min>1.0.0</min><max>10.0.0</max></package></required></dependencies>
18
  </package>