mobilenow - Version 1.0.0

Version Notes

Highly tested release. More themes and options to follow.

Download this release

Release Info

Developer Redstage, LLC / MobileNowApp.com
Extension mobilenow
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (175) hide show
  1. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow.php +16 -0
  2. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit.php +48 -0
  3. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Form.php +17 -0
  4. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Bannerimagedisplay.php +23 -0
  5. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Clayoutmessage.php +23 -0
  6. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Custombuttons.php +53 -0
  7. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customcatalog.php +23 -0
  8. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customlayoutbuttons.php +47 -0
  9. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customlink.php +83 -0
  10. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customtext.php +21 -0
  11. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Generalthemesavebutton.php +22 -0
  12. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Hlayoutmessage.php +21 -0
  13. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Logoimagedisplay.php +23 -0
  14. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Playoutmessage.php +23 -0
  15. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Advsettings.php +126 -0
  16. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Design.php +652 -0
  17. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Form.php +96 -0
  18. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Layout.php +299 -0
  19. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tabs.php +67 -0
  20. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Grid.php +103 -0
  21. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenowbackend.php +12 -0
  22. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Renderer/Merge.php +48 -0
  23. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Renderer/Status.php +17 -0
  24. app/code/community/Redstage/Mobilenow/Block/Adminhtml/Renderer/Themename.php +13 -0
  25. app/code/community/Redstage/Mobilenow/Block/Adminhtml/System/Config/Form/Button.php +41 -0
  26. app/code/community/Redstage/Mobilenow/Block/Adminhtml/System/Config/Form/Link.php +23 -0
  27. app/code/community/Redstage/Mobilenow/Block/Home.php +51 -0
  28. app/code/community/Redstage/Mobilenow/Block/Left.php +8 -0
  29. app/code/community/Redstage/Mobilenow/Block/Toolbar.php +121 -0
  30. app/code/community/Redstage/Mobilenow/Helper/Catalogpage.php +294 -0
  31. app/code/community/Redstage/Mobilenow/Helper/Cms/Page.php +104 -0
  32. app/code/community/Redstage/Mobilenow/Helper/Data.php +603 -0
  33. app/code/community/Redstage/Mobilenow/Helper/Homepage.php +359 -0
  34. app/code/community/Redstage/Mobilenow/Helper/Theme.php +273 -0
  35. app/code/community/Redstage/Mobilenow/Model/Corelayoutlink.php +12 -0
  36. app/code/community/Redstage/Mobilenow/Model/Corelayoutupdate.php +12 -0
  37. app/code/community/Redstage/Mobilenow/Model/Design/Package.php +221 -0
  38. app/code/community/Redstage/Mobilenow/Model/Layout/Update.php +17 -0
  39. app/code/community/Redstage/Mobilenow/Model/Mobilenow.php +11 -0
  40. app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutlink.php +9 -0
  41. app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutlink/Collection.php +10 -0
  42. app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutupdate.php +9 -0
  43. app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutupdate/Collection.php +10 -0
  44. app/code/community/Redstage/Mobilenow/Model/Mysql4/Mobilenow.php +160 -0
  45. app/code/community/Redstage/Mobilenow/Model/Mysql4/Mobilenow/Collection.php +81 -0
  46. app/code/community/Redstage/Mobilenow/Model/Mysql4/Themelayoutsettings.php +9 -0
  47. app/code/community/Redstage/Mobilenow/Model/Mysql4/Themelayoutsettings/Collection.php +9 -0
  48. app/code/community/Redstage/Mobilenow/Model/Mysql4/Themestore.php +9 -0
  49. app/code/community/Redstage/Mobilenow/Model/Mysql4/Themestore/Collection.php +10 -0
  50. app/code/community/Redstage/Mobilenow/Model/Mysql4/Themesubsettings.php +23 -0
  51. app/code/community/Redstage/Mobilenow/Model/Mysql4/Themesubsettings/Collection.php +10 -0
  52. app/code/community/Redstage/Mobilenow/Model/Resource/Layout.php +86 -0
  53. app/code/community/Redstage/Mobilenow/Model/Themelayoutsettings.php +12 -0
  54. app/code/community/Redstage/Mobilenow/Model/Themestore.php +12 -0
  55. app/code/community/Redstage/Mobilenow/Model/Themesubsettings.php +18 -0
  56. app/code/community/Redstage/Mobilenow/controllers/Adminhtml/IndexController.php +33 -0
  57. app/code/community/Redstage/Mobilenow/controllers/Adminhtml/MobilenowController.php +911 -0
  58. app/code/community/Redstage/Mobilenow/controllers/Adminhtml/MobilenowbackendController.php +10 -0
  59. app/code/community/Redstage/Mobilenow/controllers/IndexController.php +21 -0
  60. app/code/community/Redstage/Mobilenow/etc/adminhtml.xml +23 -0
  61. app/code/community/Redstage/Mobilenow/etc/config.xml +212 -0
  62. app/code/community/Redstage/Mobilenow/etc/system.xml +122 -0
  63. app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-install-0.1.0.php +98 -0
  64. app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.0-0.1.1.php +26 -0
  65. app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.1-0.1.2.php +15 -0
  66. app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.2-0.1.3.php +10 -0
  67. app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.3-0.1.4.php +15 -0
  68. app/design/adminhtml/default/default/layout/admin.xml +82 -0
  69. app/design/adminhtml/default/default/layout/adminnotification.xml +38 -0
  70. app/design/adminhtml/default/default/layout/api2.xml +147 -0
  71. app/design/adminhtml/default/default/layout/authorizenet.xml +35 -0
  72. app/design/adminhtml/default/default/layout/bundle.xml +118 -0
  73. app/design/adminhtml/default/default/layout/captcha.xml +48 -0
  74. app/design/adminhtml/default/default/layout/catalog.xml +332 -0
  75. app/design/adminhtml/default/default/layout/centinel.xml +70 -0
  76. app/design/adminhtml/default/default/layout/cms.xml +95 -0
  77. app/design/adminhtml/default/default/layout/compiler.xml +35 -0
  78. app/design/adminhtml/default/default/layout/connect.xml +73 -0
  79. app/design/adminhtml/default/default/layout/currencysymbol.xml +34 -0
  80. app/design/adminhtml/default/default/layout/customer.xml +126 -0
  81. app/design/adminhtml/default/default/layout/dataflow.xml +59 -0
  82. app/design/adminhtml/default/default/layout/downloadable.xml +97 -0
  83. app/design/adminhtml/default/default/layout/giftmessage.xml +82 -0
  84. app/design/adminhtml/default/default/layout/importexport.xml +33 -0
  85. app/design/adminhtml/default/default/layout/index.xml +45 -0
  86. app/design/adminhtml/default/default/layout/main.xml +291 -0
  87. app/design/adminhtml/default/default/layout/mobilenow.xml +27 -0
  88. app/design/adminhtml/default/default/layout/moneybookers.xml +28 -0
  89. app/design/adminhtml/default/default/layout/newsletter.xml +67 -0
  90. app/design/adminhtml/default/default/layout/oauth.xml +194 -0
  91. app/design/adminhtml/default/default/layout/pagecache.xml +35 -0
  92. app/design/adminhtml/default/default/layout/promo.xml +101 -0
  93. app/design/adminhtml/default/default/layout/report.xml +55 -0
  94. app/design/adminhtml/default/default/layout/rss.xml +45 -0
  95. app/design/adminhtml/default/default/layout/sales.xml +1080 -0
  96. app/design/adminhtml/default/default/layout/search.xml +35 -0
  97. app/design/adminhtml/default/default/layout/tag.xml +88 -0
  98. app/design/adminhtml/default/default/layout/widget.xml +69 -0
  99. app/design/adminhtml/default/default/layout/xmlconnect.xml +237 -0
  100. app/design/adminhtml/default/default/locale/en_US/translate.csv +201 -0
  101. app/design/adminhtml/default/default/template/access_denied.phtml +40 -0
  102. app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml +105 -0
  103. app/design/adminhtml/default/default/template/api/roleinfo.phtml +47 -0
  104. app/design/adminhtml/default/default/template/api/roles.phtml +37 -0
  105. app/design/adminhtml/default/default/template/api/rolesedit.phtml +143 -0
  106. app/design/adminhtml/default/default/template/api/rolesusers.phtml +28 -0
  107. app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml +85 -0
  108. app/design/adminhtml/default/default/template/api/userinfo.phtml +52 -0
  109. app/design/adminhtml/default/default/template/api/usernroles.phtml +31 -0
  110. app/design/adminhtml/default/default/template/api/userroles.phtml +45 -0
  111. app/design/adminhtml/default/default/template/api/users.phtml +40 -0
  112. app/design/adminhtml/default/default/template/api2/attribute/buttons.phtml +53 -0
  113. app/design/adminhtml/default/default/template/api2/attribute/resource.phtml +158 -0
  114. app/design/adminhtml/default/default/template/api2/permissions/user/edit/tab/roles/js.phtml +59 -0
  115. app/design/adminhtml/default/default/template/api2/role/buttons.phtml +52 -0
  116. app/design/adminhtml/default/default/template/api2/role/users_grid_js.phtml +122 -0
  117. app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml +56 -0
  118. app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml +157 -0
  119. app/design/adminhtml/default/default/template/backup/dialogs.phtml +164 -0
  120. app/design/adminhtml/default/default/template/backup/left.phtml +27 -0
  121. app/design/adminhtml/default/default/template/backup/list.phtml +40 -0
  122. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml +95 -0
  123. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/checkbox.phtml +52 -0
  124. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/multi.phtml +49 -0
  125. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/radio.phtml +65 -0
  126. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/select.phtml +55 -0
  127. app/design/adminhtml/default/default/template/bundle/product/edit/bundle.phtml +76 -0
  128. app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml +235 -0
  129. app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/search.phtml +35 -0
  130. app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/selection.phtml +352 -0
  131. app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml +411 -0
  132. app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml +341 -0
  133. app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml +398 -0
  134. app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml +340 -0
  135. app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml +415 -0
  136. app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml +118 -0
  137. app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml +115 -0
  138. app/design/adminhtml/default/default/template/captcha/zend.phtml +56 -0
  139. app/design/adminhtml/default/default/template/catalog/category/checkboxes/tree.phtml +199 -0
  140. app/design/adminhtml/default/default/template/catalog/category/edit.phtml +198 -0
  141. app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml +258 -0
  142. app/design/adminhtml/default/default/template/catalog/category/tree.phtml +480 -0
  143. app/design/adminhtml/default/default/template/catalog/category/widget/tree.phtml +202 -0
  144. app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml +56 -0
  145. app/design/adminhtml/default/default/template/catalog/product.phtml +47 -0
  146. app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml +338 -0
  147. app/design/adminhtml/default/default/template/catalog/product/attribute/new/created.phtml +54 -0
  148. app/design/adminhtml/default/default/template/catalog/product/attribute/options.phtml +223 -0
  149. app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml +461 -0
  150. app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml +26 -0
  151. app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml +27 -0
  152. app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml +41 -0
  153. app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml +36 -0
  154. app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml +54 -0
  155. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml +60 -0
  156. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml +95 -0
  157. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml +45 -0
  158. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml +106 -0
  159. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml +94 -0
  160. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml +31 -0
  161. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml +103 -0
  162. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml +39 -0
  163. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml +42 -0
  164. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml +36 -0
  165. app/design/adminhtml/default/default/template/catalog/product/created.phtml +59 -0
  166. app/design/adminhtml/default/default/template/catalog/product/edit.phtml +133 -0
  167. app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml +61 -0
  168. app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml +181 -0
  169. app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml +120 -0
  170. app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml +148 -0
  171. app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml +57 -0
  172. app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml +351 -0
  173. app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml +53 -0
  174. app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml +61 -0
  175. app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml +173 -0
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow extends Mage_Adminhtml_Block_Widget_Grid_Container{
5
+
6
+ public function __construct()
7
+ {
8
+
9
+ $this->_controller = "adminhtml_mobilenow";
10
+ $this->_blockGroup = "mobilenow";
11
+ $this->_headerText = Mage::helper("mobilenow")->__("MobileNow: Manage Mobile Themes");
12
+ $this->_addButtonLabel = Mage::helper("mobilenow")->__("Add New Mobile Theme");
13
+ parent::__construct();
14
+
15
+ }
16
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->_objectId = "theme_id";
8
+ $this->_blockGroup = "mobilenow";
9
+ $this->_controller = "adminhtml_mobilenow";
10
+ $this->_removeButton("save", "label", Mage::helper("mobilenow")->__("Save Theme"));
11
+ $this->_removeButton("reset", "label", Mage::helper("mobilenow")->__("Reset"));
12
+ $this->_updateButton("delete", "label", Mage::helper("mobilenow")->__("Delete Theme"));
13
+ $this->_addButton("saveas", array(
14
+ "label" => Mage::helper("mobilenow")->__("Save As.."),
15
+ "onclick" => "javascript:showSaveAsPopup(this);",
16
+ "class" => "inline_save_as_top",
17
+ "title" => '',
18
+ ), -100);
19
+ $this->_addButton("saveandcontinue", array(
20
+ "label" => Mage::helper("mobilenow")->__("Save And Continue Edit"),
21
+ "onclick" => "saveAndContinueEdit()",
22
+ "class" => "save",
23
+ ), -100);
24
+ $this->_formScripts[] = "
25
+ function saveAndContinueEdit(){
26
+ editForm.submit($('edit_form').action+'back/edit/');
27
+ }
28
+ function continueToDesign()
29
+ {
30
+ if(editForm.validate())
31
+ {
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ }";
35
+ }
36
+ public function getHeaderText()
37
+ {
38
+ if( Mage::registry("mobilenow_data") && Mage::registry("mobilenow_data")->getId() )
39
+ {
40
+ return Mage::helper("mobilenow")->__("MobileNow: Edit Theme '%s'", $this->htmlEscape(Mage::registry("mobilenow_data")->getThemeName()));
41
+ }
42
+ else
43
+ {
44
+ return Mage::helper("mobilenow")->__("MobileNow: Create a New Mobile Theme");
45
+
46
+ }
47
+ }
48
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ "id" => "edit_form",
8
+ "action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
9
+ "method" => "post",
10
+ "enctype" =>"multipart/form-data",
11
+ )
12
+ );
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Bannerimagedisplay.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Bannerimagedisplay extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ $logo_name = Mage::registry("subsettings_data")->getBannerFielname();
12
+
13
+ $dir_path = Mage::getBaseDir('media').DS.'mobilenow_theme_images/banner/'.$logo_name;
14
+ if(@file_exists($dir_path) && $logo_name != ''){
15
+ $m_logo = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobilenow_theme_images/banner/'.$logo_name;
16
+ $html = '<tr><td class="label "></td><td class="value "><img src="'.$m_logo.'" id="banner_preview" width="70"/></td></tr>';
17
+ } else {
18
+ $html = '<tr><td class="label "></td><td class="value "><img src="" id="banner_preview" width="70" /></td></tr>';
19
+ }
20
+ return $html;
21
+ }
22
+ }
23
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Clayoutmessage.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Clayoutmessage extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+
12
+ $html = '
13
+ <tr><td class="label "></td><td class="value "></td></tr><tr>
14
+ <td class="value " colspan="2">
15
+ <span class="message-italic">Organize the order of elements on the Catalog below. Be sure to preview your changes before saving and publishing your theme as certain
16
+ changes can make your page confusing. If you want to exclude any elements - go back to the Theme Design Section</span>
17
+ </td>
18
+ </tr>
19
+ <tr>';
20
+ return $html;
21
+ }
22
+ }
23
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Custombuttons.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Custombuttons extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ //You can write html for your button here
12
+ $displayResetToDefault='';
13
+ if(Mage::registry("subsettings_data")->getParent()!=0)
14
+ {
15
+ $checkForParentToReset=Mage::getModel('mobilenow/themesubsettings')->load(Mage::registry("subsettings_data")->getParent());
16
+ if($checkForParentToReset->getPrimary()==1) $displayResetToDefault=1;
17
+ else $displayResetToDefault='';
18
+ }
19
+ $html = '
20
+ <tr>
21
+ <td class="value" colspan="2">
22
+ <!--<button class="scalable save_as save" type="button" title="Save As.." id="save_as"><span>Save As..</span></button>-->
23
+ <a class="inline_save_as link_button_cls scalable save" title="" href="#inline_save_as"><span class="save">Save As..</span></a>
24
+ </td>
25
+ </tr>
26
+ <tr>
27
+ <td class="value" colspan="2">
28
+ <!--<button class="scalable save" type="button" title="Save Settings.." id="save_settings"><span>Save Settings..</span></button>-->
29
+ <a class="save_settings_link link_button_cls scalable save" title="" href="#inline_save_setting" id="save_settings_old"><span class="save">Save Settings..</span></a>
30
+ </td>
31
+ </tr>';
32
+ if($displayResetToDefault || (Mage::registry("subsettings_data")->getParent()==0 && Mage::registry("subsettings_data")->getPrimary()==1)){
33
+ $html .= '<tr><td class="value" style="width:372px;"></td></tr>
34
+ <tr><td class="value" colspan="2">
35
+ <!--<button class="scalable" type="button" title="Reset Settings to Default" id="reset_settings"><span>Reset Settings to Default</span></button>-->
36
+ <a class="reset_settings_link link_button_rst scalable" title="" href="#inline_reset_setting" id="reset_settings" href="#"><span>Reset Settings to Default</span></a>
37
+ </td></tr>';
38
+ }
39
+ $html .= '</tr>';
40
+ if(!$displayResetToDefault && Mage::registry("subsettings_data")->getPrimary()==0){
41
+ $html.='<tr><td class="value" style="width:330px;"></td></tr>
42
+ <tr>
43
+ <td class="value" colspan="2">
44
+ <!--<button class="scalable delete" type="button" title="Delete Custom Sub Settings" id="delete_settings"><span class="delete">Delete Custom Sub Settings</span></button>-->
45
+ <a class="inline_delete link_button_dlt scalable delete" title="" href="#inline_delete"><span class="delete">Delete Custom Sub Settings</span></a>
46
+ </td>
47
+ </tr>
48
+ ';
49
+ }
50
+ return $html;
51
+ }
52
+ }
53
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customcatalog.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Customcatalog extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ //You can write html for your button here
12
+ $html = '<tr>
13
+ <td class="value" colspan="2">
14
+ <strong>Product Views</strong>
15
+ <hr/>';
16
+ /*<strong>List View - <a href="#" class="link-color">View in Preview Window</a></strong>*/
17
+ $html .= ' <strong>List View</strong>
18
+ </td>
19
+ </tr>';
20
+ return $html;
21
+ }
22
+ }
23
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customlayoutbuttons.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Customlayoutbuttons extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ //You can write html for your button here
12
+ $displayResetToDefault='';
13
+ if(Mage::registry("subsettings_data")->getParent()!=0)
14
+ {
15
+ $checkForParentToReset=Mage::getModel('mobilenow/themesubsettings')->load(Mage::registry("subsettings_data")->getParent());
16
+ if($checkForParentToReset->getPrimary()==1) $displayResetToDefault=1;
17
+ else $displayResetToDefault='';
18
+ }
19
+ $html = ' <tr>
20
+ <td class="value" colspan="2">
21
+ <a class="inline_save_as link_button_cls scalable save" title="" href="#inline_save_as_layout"><span class="save">Save As..</span></a>
22
+ </td>
23
+ </tr>
24
+ <tr>
25
+ <td class="value" colspan="2">
26
+ <a class="save_settings_link link_button_cls scalable save" title="" href="#inline_save_setting_layout""><span class="save">Save Settings..</span></a>
27
+ </td>
28
+ </tr>';
29
+ if($displayResetToDefault || (Mage::registry("subsettings_data")->getParent()==0 && Mage::registry("subsettings_data")->getPrimary()==1)){
30
+ $html .='<tr><td class="value" style="width:372px;"></td></tr>
31
+ <tr>
32
+ <td class="value" colspan="2">
33
+ <a class="reset_settings_link link_button_rst scalable" title="" href="#inline_reset_setting_layout"><span>Reset Settings to Default</span></a>
34
+ </td>
35
+ </tr>';}
36
+ if(!$displayResetToDefault && Mage::registry("subsettings_data")->getPrimary()==0){
37
+ $html .='<tr><td class="value" style="width:330px;"></td></tr>
38
+ <tr>
39
+ <td class="value" colspan="2">
40
+ <a class="inline_delete link_button_dlt scalable delete" title="" href="#inline_delete_layout"><span class="delete">Delete Custom Sub Settings</span></a>
41
+ </td>
42
+ </tr>
43
+ ';}
44
+ return $html;
45
+ }
46
+ }
47
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customlink.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Customlink extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ //Retriving the values for all text box
12
+ if(Mage::registry("subsettings_data"))
13
+ {
14
+ if(Mage::registry("subsettings_data")->getHeaderLinkHomeName()!=''){$headerLinkHomeName=Mage::registry("subsettings_data")->getHeaderLinkHomeName();}
15
+ if(Mage::registry("subsettings_data")->getFooterLinkHomeName()!='')$footerLinkHomeName=Mage::registry("subsettings_data")->getFooterLinkHomeName();
16
+ if(Mage::registry("subsettings_data")->getHeaderLinkLoginName()!='')$headerLinkLoginName=Mage::registry("subsettings_data")->getHeaderLinkLoginName();
17
+ if(Mage::registry("subsettings_data")->getFooterLinkLoginName()!='')$footerLinkLoginName=Mage::registry("subsettings_data")->getFooterLinkLoginName();
18
+ if(Mage::registry("subsettings_data")->getHeaderLinkMyaccountName()!='')$headerLinkMyaccountName=Mage::registry("subsettings_data")->getHeaderLinkMyaccountName();
19
+ if(Mage::registry("subsettings_data")->getFooterLinkMyaccountName()!='')$footerLinkMyaccountName=Mage::registry("subsettings_data")->getFooterLinkMyaccountName();
20
+ if(Mage::registry("subsettings_data")->getHeaderLinkWishlistName()!='')$headerLinkWishlistName=Mage::registry("subsettings_data")->getHeaderLinkWishlistName();
21
+ if(Mage::registry("subsettings_data")->getFooterLinkWishlistName()!='')$footerLinkWishlistName=Mage::registry("subsettings_data")->getFooterLinkWishlistName();
22
+ //Checking for selected checkbox
23
+ if(Mage::registry("subsettings_data")->getHeaderLinkHome()==1)$headerLinkHome='checked="checked" value="1"';
24
+ if(Mage::registry("subsettings_data")->getFooterLinkHome()==1)$footerLinkHome='checked="checked" value="1"';
25
+ if(Mage::registry("subsettings_data")->getHeaderLinkLogin()==1)$headerLinkLogin='checked="checked" value="1"';
26
+ if(Mage::registry("subsettings_data")->getFooterLinkLogin()==1)$footerLinkLogin='checked="checked" value="1"';
27
+ if(Mage::registry("subsettings_data")->getHeaderLinkMyaccount()==1)$headerLinkMyaccount='checked="checked" value="1"';
28
+ if(Mage::registry("subsettings_data")->getFooterLinkMyaccount()==1)$footerLinkMyaccount='checked="checked" value="1"';
29
+ if(Mage::registry("subsettings_data")->getHeaderLinkWishlist()==1)$headerLinkWishlist='checked="checked" value="1"';
30
+ if(Mage::registry("subsettings_data")->getFooterLinkWishlist()==1)$footerLinkWishlist='checked="checked" value="1"';
31
+ }
32
+ $html = '<tr>
33
+ <td class="value"><label>Links</label>
34
+ </td><td>
35
+ <table cellspacing="0" cellpadding="0" width="360px">
36
+ <tr>
37
+ <td class="value">
38
+ <table cellspacing="0" cellpadding="0" width="100%">
39
+ <tr height="30px">
40
+ <td width="130px">&nbsp;</td>
41
+ <td width="100px" align="center">Header</td>
42
+ <td width="185px" align="center">Sort Order</td>
43
+ <td width="100px" align="center">Footer</td>
44
+ <td width="185px" align="center">Sort Order</td>
45
+ </tr>
46
+ <tr height="30px">
47
+ <td>Home</td>
48
+ <td align="center"><input type="checkbox" id="header_link_home" name="header_link_home" '.$headerLinkHome.' onclick="this.value = this.checked ? 1 : 0;"/></td>
49
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="header_link_home_name" name="header_link_home_name" value="'.$headerLinkHomeName.'"/></td>
50
+ <td align="center"><input type="checkbox" id="footer_link_home" name="footer_link_home" '.$footerLinkHome.' onclick="this.value = this.checked ? 1 : 0;"/></td>
51
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="footer_link_home_name" name="footer_link_home_name" value="'.$footerLinkHomeName.'"/></td>
52
+ </tr>
53
+ <tr height="30px">
54
+ <td>Log in</td>
55
+ <td align="center"><input type="checkbox" id="header_link_login" name="header_link_login"'.$headerLinkLogin.' onclick="this.value = this.checked ? 1 : 0;"/></td>
56
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="header_link_login_name" name="header_link_login_name" value="'.$headerLinkLoginName.'"/></td>
57
+ <td align="center"><input type="checkbox" id="footer_link_login" name="footer_link_login" '.$footerLinkLogin.' onclick="this.value = this.checked ? 1 : 0;"/></td>
58
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="footer_link_login_name" name="footer_link_login_name" value="'.$footerLinkLoginName.'"/></td>
59
+ </tr>
60
+ <tr height="30px">
61
+ <td>My Account</td>
62
+ <td align="center"><input type="checkbox" id="header_link_myaccount" name="header_link_myaccount" '.$headerLinkMyaccount.' onclick="this.value = this.checked ? 1 : 0;"/></td>
63
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="header_link_myaccount_name" name="header_link_myaccount_name" value="'.$headerLinkMyaccountName.'"/></td>
64
+ <td align="center"><input type="checkbox" id="footer_link_myaccount" name="footer_link_myaccount" '.$footerLinkMyaccount.' onclick="this.value = this.checked ? 1 : 0;"/></td>
65
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="footer_link_myaccount_name" name="footer_link_myaccount_name" value="'.$footerLinkMyaccountName.'"/></td>
66
+ </tr>
67
+ <tr height="30px">
68
+ <td>Wishlist</td>
69
+ <td align="center"><input type="checkbox" id="header_link_wishlist" name="header_link_wishlist" '.$headerLinkWishlist.' onclick="this.value = this.checked ? 1 : 0;"/></td>
70
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="header_link_wishlist_name" name="header_link_wishlist_name" value="'.$headerLinkWishlistName.'"/></td>
71
+ <td align="center"><input type="checkbox" id="footer_link_wishlist" name="footer_link_wishlist" '.$footerLinkWishlist.' onclick="this.value = this.checked ? 1 : 0;"/></td>
72
+ <td align="center"><input type="textbox" class="design_small validate-number input-text" id="footer_link_wishlist_name" name="footer_link_wishlist_name" value="'.$footerLinkWishlistName.'"/></td>
73
+ </tr>
74
+ </table>
75
+ </td>
76
+ </tr>
77
+ </table>
78
+ </td>
79
+ </tr>';
80
+ return $html;
81
+ }
82
+ }
83
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Customtext.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Customtext extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ //You can write html for your button here
12
+ $html = '<tr>
13
+ <td class="value" colspan="2">
14
+ <strong>Default Buttons Color Settings</strong>
15
+ <hr/>
16
+ </td>
17
+ </tr>';
18
+ return $html;
19
+ }
20
+ }
21
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Generalthemesavebutton.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Generalthemesavebutton extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ //You can write html for your button here
12
+ $html = '<tr> <td class="label">&nbsp;</td>
13
+ <td class="value">
14
+ <button style="" onclick="continueToDesign()" class="scalable save continue_step" type="button" title="Save" id="general_theme_save">
15
+ <span><span><span>Save</span></span></span>
16
+ </button>
17
+ </td>
18
+ </tr>';
19
+ return $html;
20
+ }
21
+ }
22
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Hlayoutmessage.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Hlayoutmessage extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ $html = '
12
+ <tr><td class="label "></td><td class="value "></td></tr><tr>
13
+ <td class="value " colspan="2">
14
+ <span class="message-italic">Organize the order of elements on the Header/Footer and Homepage. Be sure to preview your changes before saving and publishing your theme as certain
15
+ changes can make your page confusing. If you want to exclude any elements - go back to the Theme Design Section</span>
16
+ </td>
17
+ </tr>';
18
+ return $html;
19
+ }
20
+ }
21
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Logoimagedisplay.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Logoimagedisplay extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ $logo_name = Mage::registry("subsettings_data")->getLogo();
12
+
13
+ $dir_path = Mage::getBaseDir('media').DS.'mobilenow_theme_images/logo/'.$logo_name;
14
+ if(@file_exists($dir_path) && $logo_name != ''){
15
+ $m_logo = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobilenow_theme_images/logo/'.$logo_name;
16
+ $html = '<tr><td class="label "></td><td class="value "><img src="'.$m_logo.'" id="logo_preview" width="70"/></td></tr>';
17
+ } else {
18
+ $html = '<tr><td class="label "></td><td class="value "><img src="" id="logo_preview" width="70" /></td></tr>';
19
+ }
20
+ return $html;
21
+ }
22
+ }
23
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Renderer/Playoutmessage.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Renderer_Playoutmessage extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ /**
5
+ * renderer
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ */
9
+
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+
12
+ $html = '
13
+ <tr><td class="label "></td><td class="value "></td></tr><tr>
14
+ <td class="value " colspan="2">
15
+ <span class="message-italic">Organize the order of elements on the Product Page below. Be sure to preview your changes before saving and publishing your theme as certain
16
+ changes can make your page confusing. If you want to exclude any elements - go back to the Theme Design Section</span>
17
+ </td>
18
+ </tr>
19
+ <tr>';
20
+ return $html;
21
+ }
22
+ }
23
+ ?>
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Advsettings.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Tab_Advsettings extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ /**
5
+ * Class constructor
6
+ *
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->setTemplate('mobilenow/widget/advsettings.phtml');
12
+ }
13
+ protected function _prepareForm()
14
+ {
15
+ if(Mage::registry("mobilenow_data"))
16
+ {
17
+ $reg_data = Mage::registry("mobilenow_data");
18
+ $socialLinkData = json_decode($reg_data['social_links']);
19
+ $cartInputData = json_decode($reg_data['cart_inputs']);
20
+ if($socialLinkData->show_social_links ==1)$social_checked=true;
21
+ if($cartInputData->show_cart_discount ==1)$cart_discount_checked=true;
22
+ if($cartInputData->show_cart_shipping_quote ==1)$cart_shippng_quote_checked=true;
23
+ }
24
+ $form = new Varien_Data_Form();
25
+ $this ->setForm($form);
26
+
27
+ $fieldset = $form->addFieldset("preset_advsettings_subsettings", array("legend"=>Mage::helper("mobilenow")->__("Mobile Theme Advanced Settings")));
28
+ $fieldset ->addField("ip_override", "text", array(
29
+ "label" => Mage::helper("mobilenow")->__("IP override"),
30
+ "class" => "",
31
+ "required" => false,
32
+ "name" => "ip_override",
33
+ "note" => "When this setting is enabled (by having an IP in the text box), your activated themes will ONLY show up for this IP address for testing purposes."
34
+ ));
35
+ $fieldset->addField('custom_css', 'textarea', array(
36
+ 'label' => Mage::helper('mobilenow')->__('Custom CSS Override'),
37
+ 'name' => 'custom_css',
38
+ 'class' => '',
39
+ 'required' => false,
40
+ "note" => "If you want to override any CSS classes, you may do that here!"
41
+ ));
42
+ $fieldset->addField('show_social_links', 'checkbox', array(
43
+ 'label' => Mage::helper('mobilenow')->__('Show Social Links?'),
44
+ 'name' => 'show_social_links',
45
+ 'class' => '',
46
+ 'required' => false,
47
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
48
+ 'checked' => $social_checked,
49
+ ));
50
+ $fieldset ->addField("facebook_link", "text", array(
51
+ "label" => Mage::helper("mobilenow")->__("Facebook"),
52
+ "class" => "",
53
+ "required" => false,
54
+ "name" => "facebook_link",
55
+ ));
56
+ $fieldset ->addField("twitter_link", "text", array(
57
+ "label" => Mage::helper("mobilenow")->__("Twitter"),
58
+ "class" => "",
59
+ "required" => false,
60
+ "name" => "twitter_link",
61
+ ));
62
+ $fieldset ->addField("pinterest_link", "text", array(
63
+ "label" => Mage::helper("mobilenow")->__("Pinterest"),
64
+ "class" => "",
65
+ "required" => false,
66
+ "name" => "pinterest_link",
67
+ ));
68
+ $fieldset ->addField("google_link", "text", array(
69
+ "label" => Mage::helper("mobilenow")->__("Google+"),
70
+ "class" => "",
71
+ "required" => false,
72
+ "name" => "google_link",
73
+ "note" => "Input your social profile links above and the social icons will appear in the footer of your theme."
74
+ ));
75
+ $fieldset->addField('show_cart_discount', 'checkbox', array(
76
+ 'label' => Mage::helper('mobilenow')->__('Cart - Show Discount Code Input'),
77
+ 'name' => 'show_cart_discount',
78
+ 'class' => '',
79
+ 'required' => false,
80
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
81
+ 'checked' => $cart_discount_checked,
82
+ ));
83
+ $fieldset->addField('show_cart_shipping_quote', 'checkbox', array(
84
+ 'label' => Mage::helper('mobilenow')->__('Cart - Show Shipping Quote Input'),
85
+ 'name' => 'show_cart_shipping_quote',
86
+ 'class' => '',
87
+ 'required' => false,
88
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
89
+ 'checked' => $cart_shippng_quote_checked,
90
+ ));
91
+ $fieldset->addField('analytics', 'textarea', array(
92
+ 'label' => Mage::helper('mobilenow')->__('Analytics'),
93
+ 'name' => 'analytics',
94
+ 'class' => '',
95
+ 'required' => false
96
+ ));
97
+ if (Mage::getSingleton("adminhtml/session")->getMobilenowData())
98
+ {
99
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getMobilenowData());
100
+ Mage::getSingleton("adminhtml/session")->setMobilenowData(null);
101
+ }
102
+ elseif(Mage::registry("mobilenow_data"))
103
+ {
104
+ $prefiled_values = Mage::registry("mobilenow_data")->getData();
105
+
106
+
107
+ //advanced settings page
108
+ $socialLinkData = json_decode($prefiled_values['social_links']);
109
+ $cartInputData = json_decode($prefiled_values['cart_inputs']);
110
+
111
+ $prefiled_values['custom_css'] = $prefiled_values['css_override'];
112
+ $prefiled_values['show_social_links'] = $socialLinkData->show_social_links;
113
+ $prefiled_values['facebook_link'] = $socialLinkData->facebook_link;
114
+ $prefiled_values['twitter_link'] = $socialLinkData->twitter_link;
115
+ $prefiled_values['pinterest_link'] = $socialLinkData->pinterest_link;
116
+ $prefiled_values['google_link'] = $socialLinkData->google_link;
117
+ $prefiled_values['show_cart_discount'] = $cartInputData->show_cart_discount;
118
+ $prefiled_values['show_cart_shipping_quote'] = $cartInputData->show_cart_shipping_quote;
119
+
120
+
121
+ $form->setValues($prefiled_values);
122
+ }
123
+ return parent::_prepareForm();
124
+ }
125
+
126
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Design.php ADDED
@@ -0,0 +1,652 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Tab_Design extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ /**
5
+ * Class constructor
6
+ *
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->setTemplate('mobilenow/widget/design.phtml');
12
+ }
13
+ protected function _prepareForm()
14
+ {
15
+ if(Mage::registry("subsettings_data"))
16
+ {
17
+ if(Mage::registry("subsettings_data")->getShowSearchCartArea()==1)$checked=true;
18
+ if(Mage::registry("subsettings_data")->getShowHomePageBanner()==1)$bannerChecked=true;
19
+ if(Mage::registry("subsettings_data")->getShowNewsletter()==1)$newsletterChecked=true;
20
+ if(Mage::registry("subsettings_data")->getShowBreadcrumbs()==1)$breadChecked=true;
21
+ if(Mage::registry("subsettings_data")->getShowGridListChoice()==1)$gridChecked=true;
22
+ if(Mage::registry("subsettings_data")->getShowSortbyDropdown()==1)$sortChecked=true;
23
+ if(Mage::registry("subsettings_data")->getShowImageBorder()==1)$ImBorderChecked=true;
24
+ if(Mage::registry("subsettings_data")->getShowReviewStars()==1)$reviewsChecked=true;
25
+ if(Mage::registry("subsettings_data")->getShowLearnMore()==1)$cataloglearnChecked=true;
26
+ if(Mage::registry("subsettings_data")->getShowAddToCart()==1)$addtocartChecked=true;
27
+ if(Mage::registry("subsettings_data")->getShowGridlines()==1)$gridlinesChecked=true;
28
+ if(Mage::registry("subsettings_data")->getShowProductImageBorder()==1)$prImBorderChecked=true;
29
+ if(Mage::registry("subsettings_data")->getShowProductAvailability()==1)$shAvlChecked=true;
30
+ if(Mage::registry("subsettings_data")->getShowProductWishlistLink()==1)$shprdwishChecked=true;
31
+ if(Mage::registry("subsettings_data")->getShowProductReviewsSummary()==1)$shprdrevChecked=true;
32
+ if(Mage::registry("subsettings_data")->getShowProductDescription()==1)$shprddesChecked =true;
33
+ if(Mage::registry("subsettings_data")->getShowProductAdditionalInformation()==1)$shadditionalChecked=true;
34
+ if(Mage::registry("subsettings_data")->getShowFullReviewsOnProductPage()==1)$shflreChecked=true;
35
+ if(Mage::registry("subsettings_data")->getShowRelatedProducts()==1)$shrlChecked=true;
36
+ }
37
+ $form = new Varien_Data_Form();
38
+ $this ->setForm($form);
39
+ $fieldset = $form->addFieldset("preset_subsettings",array('class'=>'preset_subsettings'));
40
+ if($this->getRequest()->getParam('id'))
41
+ $newRedrict = Mage::helper('adminhtml')->getUrl('*/*/edit',array('id'=>$this->getRequest()->getParam("id")));
42
+ else
43
+ $newRedrict = Mage::helper('adminhtml')->getUrl('*/*/new',array('id'=>$this->getRequest()->getParam("id")));
44
+
45
+ $fieldset->addField('preset_sub_settings', 'select', array(
46
+ 'label' => Mage::helper('mobilenow')->__('Preset Sub Settings'),
47
+ 'class' => 'select_theme_name',
48
+ 'required' => false,
49
+ 'name' => 'preset_sub_settings',
50
+ 'onclick' => "",
51
+ 'onchange' => 'preloadSubsettings(\''.$newRedrict.'\')',
52
+ 'values' => Mage::helper('mobilenow')->getSubsettings()
53
+ ));
54
+ $fieldset->addField('custom_design_buttons', 'text', array(
55
+ 'name'=>'custom_design_buttons',
56
+ ));
57
+ $form->getElement('custom_design_buttons')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_custombuttons'));
58
+ /*******************************************General / Home Page**********************************************/
59
+ $fieldset = $form->addFieldset('general_homepage',array());
60
+ $fieldset ->addField('base_mobile_theme', 'select', array(
61
+ 'label' => Mage::helper('mobilenow')->__('Base Mobile Theme'),
62
+ 'values' => array('1'=>'Blank / Text'),
63
+ 'name' => 'base_mobile_theme',
64
+ 'class' => '',
65
+ 'required' => false
66
+ ));
67
+ $fieldset->addField('logo_fielname', 'hidden', array(
68
+ 'label' => '',
69
+ 'name' => 'logo_fielname',
70
+ ));
71
+ $fieldset->addField('logo_preview_filename', 'hidden', array(
72
+ 'label' => '',
73
+ 'name' => 'logo_preview_filename',
74
+ ));
75
+ $fieldset->addField('logo_image_display', 'text', array(
76
+ 'name'=>'logo_image_display',
77
+ ));
78
+ $form->getElement('logo_image_display')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_logoimagedisplay'));
79
+ $fieldset->addField('logo', 'file', array(
80
+ 'label' => Mage::helper('mobilenow')->__('Logo'),
81
+ 'value' => 'Uplaod',
82
+ 'name' => 'logo'
83
+ ));
84
+ $fieldset->addField('background_color', 'text', array(
85
+ 'label' => Mage::helper('mobilenow')->__('Background Color'),
86
+ 'name' => 'background_color',
87
+ 'class' => 'minicolors input-color',
88
+ 'value' => '#aaaaaa',
89
+ 'required' => false
90
+ ));
91
+ $fieldset->addField('custom_design_link', 'text', array(
92
+ 'name'=>'custom_design_link',
93
+ ));
94
+ $form->getElement('custom_design_link')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_customlink'));
95
+ $fieldset->addField('links_color', 'text', array(
96
+ 'label' => Mage::helper('mobilenow')->__('Links Color'),
97
+ 'name' => 'links_color',
98
+ 'class' => 'minicolors input-color',
99
+ 'value' => '#aaaaaa',
100
+ 'required' => false
101
+ ));
102
+ $fieldset->addField('text_color', 'text', array(
103
+ 'label' => Mage::helper('mobilenow')->__('Text Color'),
104
+ 'name' => 'text_color',
105
+ 'class' => 'minicolors input-color',
106
+ 'value' => '#aaaaaa',
107
+ 'required' => false
108
+ ));
109
+ $fieldset->addField('show_search_cart_area', 'checkbox', array(
110
+ 'label' => Mage::helper('mobilenow')->__('Show Search / Cart Area'),
111
+ 'name' => 'show_search_cart_area',
112
+ 'class' => '',
113
+ 'required' => false,
114
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
115
+ 'checked' => $checked,
116
+ ));
117
+ $fieldset->addField('search_cart_bg_color', 'text', array(
118
+ 'label' => Mage::helper('mobilenow')->__('Search / Cart Area Backgorund Color'),
119
+ 'name' => 'search_cart_bg_color',
120
+ 'class' => 'minicolors input-color',
121
+ 'value' => '#aaaaaa',
122
+ 'required' => false
123
+ ));
124
+ $fieldset->addField('cart_link_color', 'text', array(
125
+ 'label' => Mage::helper('mobilenow')->__('Cart Link Color'),
126
+ 'name' => 'cart_link_color',
127
+ 'class' => 'minicolors input-color',
128
+ 'value' => '#aaaaaa',
129
+ 'required' => false
130
+ ));
131
+ $fieldset->addField('show_home_page_banner', 'checkbox', array(
132
+ 'label' => Mage::helper('mobilenow')->__('Show Homepage Banner'),
133
+ 'name' => 'show_home_page_banner',
134
+ 'class' => '',
135
+ 'required' => false,
136
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
137
+ 'checked' => $bannerChecked,
138
+ ));
139
+ $fieldset->addField('banner_image_display', 'text', array(
140
+ 'name'=>'banner_image_display',
141
+ ));
142
+ $form->getElement('banner_image_display')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_bannerimagedisplay'));
143
+ $fieldset->addField('banner_fielname', 'hidden', array(
144
+ 'label' => '',
145
+ 'name' => 'banner_fielname',
146
+ ));
147
+ $fieldset->addField('banner_preview_filename', 'hidden', array(
148
+ 'label' => '',
149
+ 'name' => 'banner_preview_filename',
150
+ ));
151
+ $fieldset->addField('homepage_banner', 'file', array(
152
+ 'label' => Mage::helper('mobilenow')->__('Homepage Banner'),
153
+ 'value' => 'Uplaod',
154
+ 'name' => 'homepage_banner'
155
+ ));
156
+ $fieldset->addField('homepage_banner_url', 'text', array(
157
+ 'label' => Mage::helper('mobilenow')->__('Homepage Banner URL'),
158
+ 'name' => 'homepage_banner_url',
159
+ 'class' => '',
160
+ 'required' => false
161
+ ));
162
+ $fieldset->addField('subheader_section', 'textarea', array(
163
+ 'label' => Mage::helper('mobilenow')->__('SubHeader Section [HTML] (empty = Off)'),
164
+ 'name' => 'subheader_section',
165
+ 'class' => '',
166
+ 'required' => false
167
+ ));
168
+
169
+ $fieldset->addField('categories1', 'radios', array(
170
+ 'label' => Mage::helper('mobilenow')->__('Categories'),
171
+ 'name' => 'categories',
172
+ 'value' => '1',
173
+ 'values' => array(
174
+ array('value'=>'1')
175
+ ),
176
+ 'after_element_html' => '<label class="radio_label" for="categories1">Mobile Menu</label>'
177
+ ));
178
+ $fieldset->addField('categories2', 'radios', array(
179
+ 'label' =>'',
180
+ 'name' => 'categories',
181
+ 'value' => '2',
182
+ 'values' => array(
183
+ array('value'=>'2')
184
+ ),
185
+ 'after_element_html' => '<label class="radio_label " for="categories2">Show All</label>'
186
+ ));
187
+ // $fieldset->addField('categories', 'radios', array(
188
+ // 'label' => Mage::helper('mobilenow')->__('Categories'),
189
+ // 'name' => 'categories',
190
+ // 'onclick' => "",
191
+ // 'onchange' => "",
192
+ // 'value' => '1',
193
+ // 'values' => array(
194
+ // array('value'=>'1','label'=>'Mobile Menu'),
195
+ // array('value'=>'2','label'=>'Show All'),
196
+ // )
197
+ // ));
198
+ $fieldset->addField('categories_background_color', 'text', array(
199
+ 'label' => Mage::helper('mobilenow')->__('Categories Background Color'),
200
+ 'name' => 'categories_background_color',
201
+ 'class' => 'minicolors input-color',
202
+ 'value' => '#aaaaaa',
203
+ 'required' => false
204
+ ));
205
+ $fieldset->addField('show_newsletter', 'checkbox', array(
206
+ 'label' => Mage::helper('mobilenow')->__('Show Newsletter'),
207
+ 'name' => 'show_newsletter',
208
+ 'class' => '',
209
+ 'required' => false,
210
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
211
+ 'checked' => $newsletterChecked,
212
+ ));
213
+ $fieldset->addField('newsletter_area_backgorund', 'text', array(
214
+ 'label' => Mage::helper('mobilenow')->__('Newsletter Area Background'),
215
+ 'name' => 'newsletter_area_backgorund',
216
+ 'class' => 'minicolors input-color',
217
+ 'value' => '#aaaaaa',
218
+ 'required' => false
219
+ ));
220
+ $fieldset->addField('homepage_custom_code', 'textarea', array(
221
+ 'label' => Mage::helper('mobilenow')->__('Homepage Custom Code [HTML] (empty = Off)'),
222
+ 'name' => 'homepage_custom_code',
223
+ 'class' => '',
224
+ 'required' => false
225
+ ));
226
+ $fieldset->addField('pre_footer_section', 'textarea', array(
227
+ 'label' => Mage::helper('mobilenow')->__('Pre-Footer Section [HTML] (empty = Off)'),
228
+ 'name' => 'pre_footer_section',
229
+ 'class' => '',
230
+ 'required' => false
231
+ ));
232
+ $fieldset->addField('footer_section', 'textarea', array(
233
+ 'label' => Mage::helper('mobilenow')->__('Footer Section [HTML] (empty = Off)'),
234
+ 'name' => 'footer_section',
235
+ 'class' => '',
236
+ 'required' => false
237
+ ));
238
+ // $fieldset->addField('show_desktop_version_link', 'checkbox', array(
239
+ // 'label' => Mage::helper('mobilenow')->__('Show Desktop Version Link?'),
240
+ // 'name' => 'show_desktop_version_link',
241
+ // 'class' => '',
242
+ // 'required' => false
243
+ // ));
244
+ $fieldset->addField('custom_design_title', 'text', array(
245
+ 'name'=>'custom_design_title',
246
+ ));
247
+ $form->getElement('custom_design_title')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_customtext'));
248
+ $fieldset->addField('button_background_color', 'text', array(
249
+ 'label' => Mage::helper('mobilenow')->__('Button Background Color'),
250
+ 'name' => 'button_background_color',
251
+ 'class' => 'minicolors input-color',
252
+ 'value' => '#aaaaaa',
253
+ 'required' => false
254
+ ));
255
+ $fieldset->addField('button_text_color', 'text', array(
256
+ 'label' => Mage::helper('mobilenow')->__('Button Text Color'),
257
+ 'name' => 'button_text_color',
258
+ 'class' => 'minicolors input-color',
259
+ 'value' => '#aaaaaa',
260
+ 'required' => false
261
+ ));
262
+ $fieldset->addField('button_border_color', 'text', array(
263
+ 'label' => Mage::helper('mobilenow')->__('Button Border Color'),
264
+ 'name' => 'button_border_color',
265
+ 'class' => 'minicolors input-color',
266
+ 'value' => '#aaaaaa',
267
+ 'required' => false
268
+ ));
269
+ /*******************************************Catalog Page**********************************************/
270
+ $fieldset = $form->addFieldset('catalog_page',array());
271
+ $fieldset->addField('show_breadcrumbs', 'checkbox', array(
272
+ 'label' => Mage::helper('mobilenow')->__('Show Breadcrumbs'),
273
+ 'name' => 'show_breadcrumbs',
274
+ 'class' => '',
275
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
276
+ 'required' => false,
277
+ 'checked' => $breadChecked
278
+ ));
279
+ $fieldset->addField('breadcrumbs_bg_color', 'text', array(
280
+ 'label' => Mage::helper('mobilenow')->__('Breadcrumbs Background Color'),
281
+ 'name' => 'breadcrumbs_bg_color',
282
+ 'class' => 'minicolors input-color',
283
+ 'value' => '#aaaaaa',
284
+ 'required' => false
285
+ ));
286
+ $fieldset->addField('breadcrumbs_font_color', 'text', array(
287
+ 'label' => Mage::helper('mobilenow')->__('Breadcrumbs Font Color'),
288
+ 'name' => 'breadcrumbs_font_color',
289
+ 'class' => 'minicolors input-color',
290
+ 'value' => '#aaaaaa',
291
+ 'required' => false
292
+ ));
293
+ /* $fieldset->addField('default_catalog_view', 'radios', array(
294
+ 'label' => Mage::helper('mobilenow')->__('Default Catalog View'),
295
+ 'name' => 'default_catalog_view',
296
+ 'onclick' => "",
297
+ 'onchange' => "",
298
+ 'value' => '1',
299
+ 'values' => array(
300
+ array('value'=>'1','label'=>' Grid'),
301
+ array('value'=>'2','label'=>' List'),
302
+ )
303
+ ));
304
+ $fieldset->addField('show_grid_list_choice', 'checkbox', array(
305
+ 'label' => Mage::helper('mobilenow')->__('Show Grid / List Choice'),
306
+ 'name' => 'show_grid_list_choice',
307
+ 'class' => '',
308
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
309
+ 'required' => false,
310
+ 'checked' => $gridChecked
311
+ )); */
312
+ $fieldset->addField('number_of_products_choice_steps', 'text', array(
313
+ 'label' => Mage::helper('mobilenow')->__('Number of Products Choice Steps (Comma delimited, ALL = Show All)'),
314
+ 'name' => 'number_of_products_choice_steps',
315
+ 'class' => 'validate-per-page-value-list input-color',
316
+ 'required' => false
317
+ ));
318
+ $fieldset->addField('number_of_products_per_page', 'text', array(
319
+ 'label' => Mage::helper('mobilenow')->__('Number of Products Per Page (default) ALL = Show All'),
320
+ 'name' => 'number_of_products_per_page',
321
+ 'class' => 'validate-per-page-value input-color',
322
+ 'required' => false
323
+ ));
324
+ $fieldset->addField('show_sortby_dropdown', 'checkbox', array(
325
+ 'label' => Mage::helper('mobilenow')->__('Show Sort By Dropdown'),
326
+ 'name' => 'show_sortby_dropdown',
327
+ 'class' => '',
328
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
329
+ 'required' => false,
330
+ 'checked'=>$sortChecked
331
+ ));
332
+ $fieldset->addField('sort_options', 'checkboxes', array(
333
+ 'label' => Mage::helper('mobilenow')->__('Sort Options'),
334
+ 'name' => 'sort_options[]',
335
+ 'values' => array(
336
+ array('value'=>'1','label'=>'Position'),
337
+ array('value'=>'2','label'=>'Price High -> Low'),
338
+ array('value'=>'3','label'=>'Price Low -> High'),
339
+ array('value'=>'4','label'=>'Name A -> Z'),
340
+ array('value'=>'5','label'=>'Name Z -> A'),
341
+ ),
342
+ 'onclick' => "",
343
+ 'onchange' => "",
344
+ 'value' => array('1', '5'),
345
+ ));
346
+ $fieldset->addField('toolbar_bg_color', 'text', array(
347
+ 'label' => Mage::helper('mobilenow')->__('Toolbar Background Color'),
348
+ 'name' => 'toolbar_bg_color',
349
+ 'class' => 'minicolors input-color',
350
+ 'value' => '#aaaaaa',
351
+ 'required' => false
352
+ ));
353
+ $fieldset->addField('toolbar_text_color', 'text', array(
354
+ 'label' => Mage::helper('mobilenow')->__('Toolbar Text Color'),
355
+ 'name' => 'toolbar_text_color',
356
+ 'class' => 'minicolors input-color',
357
+ 'value' => '#aaaaaa',
358
+ 'required' => false
359
+ ));
360
+ $fieldset->addField('show_pagination', 'radios', array(
361
+ 'label' => Mage::helper('mobilenow')->__('Show Pagination'),
362
+ 'name' => 'show_pagination',
363
+ 'onclick' => "",
364
+ 'onchange' => "",
365
+ 'value' => '1',
366
+ 'values' => array(
367
+ array('value'=>'1','label'=>' Top'),
368
+ array('value'=>'2','label'=>' Bottom'),
369
+ array('value'=>'3','label'=>' Both'),
370
+ )
371
+ ));
372
+ $fieldset->addField('pagination_bg_color', 'text', array(
373
+ 'label' => Mage::helper('mobilenow')->__('Pagination Background Color'),
374
+ 'name' => 'pagination_bg_color',
375
+ 'class' => 'minicolors input-color',
376
+ 'value' => '#aaaaaa',
377
+ 'required' => false
378
+ ));
379
+ $fieldset->addField('pagination_button_bg_color', 'text', array(
380
+ 'label' => Mage::helper('mobilenow')->__('Pagination Buttons Background Color'),
381
+ 'name' => 'pagination_button_bg_color',
382
+ 'class' => 'minicolors input-color',
383
+ 'value' => '#aaaaaa',
384
+ 'required' => false
385
+ ));
386
+ $fieldset->addField('pagination_button_text_color', 'text', array(
387
+ 'label' => Mage::helper('mobilenow')->__('Pagination Button Text Color'),
388
+ 'name' => 'pagination_button_text_color',
389
+ 'class' => 'minicolors input-color',
390
+ 'value' => '#aaaaaa',
391
+ 'required' => false
392
+ ));
393
+ $fieldset->addField('custom_design_catalog', 'text', array(
394
+ 'name'=>'custom_design_catalog',
395
+ ));
396
+ $form->getElement('custom_design_catalog')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_customcatalog'));
397
+ $fieldset->addField('show_image_border', 'checkbox', array(
398
+ 'label' => Mage::helper('mobilenow')->__('Show Image Border'),
399
+ 'name' => 'show_image_border',
400
+ 'class' => '',
401
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
402
+ 'required' => false,
403
+ 'checked'=>$ImBorderChecked
404
+ ));
405
+ $fieldset->addField('image_border_color', 'text', array(
406
+ 'label' => Mage::helper('mobilenow')->__('Image Border Color'),
407
+ 'name' => 'image_border_color',
408
+ 'class' => 'minicolors input-color',
409
+ 'value' => '#aaaaaa',
410
+ 'required' => false
411
+ ));
412
+ $fieldset->addField('catalog_image_width', 'text', array(
413
+ 'label' => Mage::helper('mobilenow')->__('Image Border Width (px)'),
414
+ 'name' => 'catalog_image_width',
415
+ 'class' => '',
416
+ 'required' => false,
417
+ "note" => "Please enter a value less than 5"
418
+ ));
419
+ $fieldset->addField('product_title_color', 'text', array(
420
+ 'label' => Mage::helper('mobilenow')->__('Product Title Color'),
421
+ 'name' => 'product_title_color',
422
+ 'class' => 'minicolors input-color',
423
+ 'value' => '#aaaaaa',
424
+ 'required' => false
425
+ ));
426
+ $fieldset->addField('product_price_color', 'text', array(
427
+ 'label' => Mage::helper('mobilenow')->__('Product Price Color'),
428
+ 'name' => 'product_price_color',
429
+ 'class' => 'minicolors input-color',
430
+ 'value' => '#aaaaaa',
431
+ 'required' => false
432
+ ));
433
+ $fieldset->addField('product_special_price_color', 'text', array(
434
+ 'label' => Mage::helper('mobilenow')->__('Product Special Price Color'),
435
+ 'name' => 'product_special_price_color',
436
+ 'class' => 'minicolors input-color',
437
+ 'value' => '#aaaaaa',
438
+ 'required' => false
439
+ ));
440
+ $fieldset->addField('show_review_stars', 'checkbox', array(
441
+ 'label' => Mage::helper('mobilenow')->__('Show Review stars'),
442
+ 'name' => 'show_review_stars',
443
+ 'class' => '',
444
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
445
+ 'required' => false,
446
+ 'checked'=>$reviewsChecked
447
+ ));
448
+ $fieldset->addField('review_star_color', 'text', array(
449
+ 'label' => Mage::helper('mobilenow')->__('Review Stars Color'),
450
+ 'name' => 'review_star_color',
451
+ 'class' => 'minicolors input-color',
452
+ 'value' => '#aaaaaa',
453
+ 'required' => false
454
+ ));
455
+ $fieldset->addField('show_learn_more', 'checkbox', array(
456
+ 'label' => Mage::helper('mobilenow')->__('Show "Learn More" Link'),
457
+ 'name' => 'show_learn_more',
458
+ 'class' => '',
459
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
460
+ 'required' => false,
461
+ 'checked'=>$cataloglearnChecked
462
+ ));
463
+ $fieldset->addField('show_add_to_cart', 'checkbox', array(
464
+ 'label' => Mage::helper('mobilenow')->__('Show Add To Cart Button'),
465
+ 'name' => 'show_add_to_cart',
466
+ 'class' => '',
467
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
468
+ 'required' => false,
469
+ 'checked'=>$addtocartChecked
470
+ ));
471
+ $fieldset->addField('add_to_cart_button_bg_color', 'text', array(
472
+ 'label' => Mage::helper('mobilenow')->__('Add To Cart Button Background Color'),
473
+ 'name' => 'add_to_cart_button_bg_color',
474
+ 'class' => 'minicolors input-color',
475
+ 'value' => '#aaaaaa',
476
+ 'required' => false
477
+ ));
478
+ $fieldset->addField('add_to_cart_button_font_color', 'text', array(
479
+ 'label' => Mage::helper('mobilenow')->__('Add To Cart Button Font Color'),
480
+ 'name' => 'add_to_cart_button_font_color',
481
+ 'class' => 'minicolors input-color',
482
+ 'value' => '#aaaaaa',
483
+ 'required' => false
484
+ ));
485
+ $fieldset->addField('add_to_cart_button_border_color', 'text', array(
486
+ 'label' => Mage::helper('mobilenow')->__('Add To Cart Button Border Color'),
487
+ 'name' => 'add_to_cart_button_border_color',
488
+ 'class' => 'minicolors input-color',
489
+ 'value' => '#aaaaaa',
490
+ 'required' => false
491
+ ));
492
+ $fieldset->addField('show_gridlines', 'checkbox', array(
493
+ 'label' => Mage::helper('mobilenow')->__('Show Gridlines'),
494
+ 'name' => 'show_gridlines',
495
+ 'class' => '',
496
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
497
+ 'required' => false,
498
+ 'checked'=>$gridlinesChecked
499
+ ));
500
+ $fieldset->addField('gridlines_color', 'text', array(
501
+ 'label' => Mage::helper('mobilenow')->__('Gridlines Color'),
502
+ 'name' => 'gridlines_color',
503
+ 'class' => 'minicolors input-color',
504
+ 'value' => '#aaaaaa',
505
+ 'required' => false
506
+ ));
507
+ /*******************************************Product Page**********************************************/
508
+ $fieldset = $form->addFieldset('produt_page', array());
509
+ $fieldset->addField('productpage_title_color', 'text', array(
510
+ 'label' => Mage::helper('mobilenow')->__('Product Title Color'),
511
+ 'name' => 'productpage_title_color',
512
+ 'class' => 'minicolors input-color',
513
+ 'value' => '#aaaaaa',
514
+ 'required' => false
515
+ ));
516
+ $fieldset->addField('show_product_image_border', 'checkbox', array(
517
+ 'label' => Mage::helper('mobilenow')->__('Show Image Border'),
518
+ 'name' => 'show_product_image_border',
519
+ 'class' => '',
520
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
521
+ 'required' => false,
522
+ 'checked'=>$prImBorderChecked
523
+ ));
524
+ $fieldset->addField('product_image_border_color', 'text', array(
525
+ 'label' => Mage::helper('mobilenow')->__('Image Border Color'),
526
+ 'name' => 'product_image_border_color',
527
+ 'class' => 'minicolors input-color',
528
+ 'value' => '#aaaaaa',
529
+ 'required' => false
530
+ ));
531
+ $fieldset->addField('product_image_width', 'text', array(
532
+ 'label' => Mage::helper('mobilenow')->__('Image Width (px)'),
533
+ 'name' => 'product_image_width',
534
+ 'class' => '',
535
+ 'required' => false
536
+ ));
537
+ $fieldset->addField('show_product_availability', 'checkbox', array(
538
+ 'label' => Mage::helper('mobilenow')->__('Show Availability'),
539
+ 'name' => 'show_product_availability',
540
+ 'class' => '',
541
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
542
+ 'required' => false,
543
+ 'checked'=>$shAvlChecked
544
+ ));
545
+ $fieldset->addField('show_product_wishlist_link', 'checkbox', array(
546
+ 'label' => Mage::helper('mobilenow')->__('Show Wishlist Link'),
547
+ 'name' => 'show_product_wishlist_link',
548
+ 'class' => '',
549
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
550
+ 'required' => false,
551
+ 'checked'=>$shprdwishChecked
552
+ ));
553
+ $fieldset->addField('show_product_reviews_summary', 'checkbox', array(
554
+ 'label' => Mage::helper('mobilenow')->__('Show Reviews Summary'),
555
+ 'name' => 'show_product_reviews_summary',
556
+ 'class' => '',
557
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
558
+ 'required' => false,
559
+ 'checked'=>$shprdrevChecked
560
+ ));
561
+ $fieldset->addField('show_product_description', 'checkbox', array(
562
+ 'label' => Mage::helper('mobilenow')->__('Show Description'),
563
+ 'name' => 'show_product_description',
564
+ 'class' => '',
565
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
566
+ 'required' => false,
567
+ 'checked'=>$shprddesChecked
568
+ ));
569
+ $fieldset->addField('product_description_color', 'text', array(
570
+ 'label' => Mage::helper('mobilenow')->__('Product description Color'),
571
+ 'name' => 'product_description_color',
572
+ 'class' => 'minicolors input-color',
573
+ 'value' => '#aaaaaa',
574
+ 'required' => false
575
+ ));
576
+ $fieldset->addField('show_product_additional_information', 'checkbox', array(
577
+ 'label' => Mage::helper('mobilenow')->__('Show Additional Information'),
578
+ 'name' => 'show_product_additional_information',
579
+ 'class' => '',
580
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
581
+ 'required' => false,
582
+ 'checked'=>$shadditionalChecked
583
+ ));
584
+ $fieldset->addField('additional_information_bg_color', 'text', array(
585
+ 'label' => Mage::helper('mobilenow')->__('Additional information background Color'),
586
+ 'name' => 'additional_information_bg_color',
587
+ 'class' => 'minicolors input-color',
588
+ 'value' => '#aaaaaa',
589
+ 'required' => false
590
+ ));
591
+ $fieldset->addField('additional_information_font_color', 'text', array(
592
+ 'label' => Mage::helper('mobilenow')->__('Additional information font Color'),
593
+ 'name' => 'additional_information_font_color',
594
+ 'class' => 'minicolors input-color',
595
+ 'value' => '#aaaaaa',
596
+ 'required' => false
597
+ ));
598
+ $fieldset->addField('show_full_reviews_on_product_page', 'checkbox', array(
599
+ 'label' => Mage::helper('mobilenow')->__('Show Full Reviews on Product Page'),
600
+ 'name' => 'show_full_reviews_on_product_page',
601
+ 'class' => '',
602
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
603
+ 'required' => false,
604
+ 'checked'=>$shflreChecked
605
+ ));
606
+ $fieldset->addField('full_reviews_bg_color', 'text', array(
607
+ 'label' => Mage::helper('mobilenow')->__('Reviews background Color'),
608
+ 'name' => 'full_reviews_bg_color',
609
+ 'class' => 'minicolors input-color',
610
+ 'value' => '#aaaaaa',
611
+ 'required' => false
612
+ ));
613
+ $fieldset->addField('full_reviews_font_color', 'text', array(
614
+ 'label' => Mage::helper('mobilenow')->__('Reviews font Color'),
615
+ 'name' => 'full_reviews_font_color',
616
+ 'class' => 'minicolors input-color',
617
+ 'value' => '#aaaaaa',
618
+ 'required' => false
619
+ ));
620
+ $fieldset->addField('show_related_products', 'checkbox', array(
621
+ 'label' => Mage::helper('mobilenow')->__('Show Related Products'),
622
+ 'name' => 'show_related_products',
623
+ 'class' => '',
624
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
625
+ 'required' => false,
626
+ 'checked'=>$shrlChecked
627
+ ));
628
+ $fieldset->addField('hidden_selected_val', 'hidden', array(
629
+ 'label' => Mage::helper('mobilenow')->__(''),
630
+ 'name' => 'hidden_selected_val',
631
+ 'class' => '',
632
+ 'required' => false
633
+ ));
634
+ $fieldset->addField('hidden_action_val', 'hidden', array(
635
+ 'label' => Mage::helper('mobilenow')->__(''),
636
+ 'name' => 'hidden_action_val',
637
+ 'class' => '',
638
+ 'required' => false
639
+ ));
640
+ if (Mage::getSingleton("adminhtml/session")->getSubsettingsData())
641
+ {
642
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getSubsettingsData());
643
+ Mage::getSingleton("adminhtml/session")->setSubsettingsData(null);
644
+ }
645
+ elseif(Mage::registry("subsettings_data"))
646
+ {
647
+ $form->setValues(Mage::registry("subsettings_data")->getData());
648
+ }
649
+ return parent::_prepareForm();
650
+ }
651
+
652
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Form.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->setTemplate('mobilenow/widget/form.phtml');
8
+ }
9
+ protected function _prepareForm()
10
+ {
11
+ $form = new Varien_Data_Form();
12
+ $this ->setForm($form);
13
+ $fieldset = $form->addFieldset("mobilenow_form", array("legend"=>Mage::helper("mobilenow")->__("Mobile Theme Basic Settings")));
14
+ $fieldset ->addField("theme_name", "text", array(
15
+ "label" => Mage::helper("mobilenow")->__("Theme Name"),
16
+ "class" => "required-entry",
17
+ "required" => true,
18
+ "name" => "theme_name",
19
+ ));
20
+ $fieldset ->addField("mobile_device_design_interface", "select", array(
21
+ "label" => Mage::helper("mobilenow")->__("Mobile Device Design Interface"),
22
+ "values" => Mage::helper("mobilenow")->getValueArrayMobileDevice(),
23
+ "name" => "mobile_device_design_interface",
24
+ "class" => "required-entry",
25
+ "required" => true,
26
+ "note" => "This version of MobileNow has a iPhone/SmartPhone design interface. Future versions will include iPad, 7 Inch Tablets and other Android interfaces.",
27
+ ));
28
+ $fieldset ->addField("user_agent_regex_values", "multiselect", array(
29
+ "label" => Mage::helper("mobilenow")->__("User Agent RegEx Values"),
30
+ "values" => Mage::helper("mobilenow")->getValueArrayUserAgent(),
31
+ "name" => "user_agent_regex_values",
32
+ "class" => "required-entry",
33
+ "required" => true,
34
+ "note" => "<span>Choose the user agents that you want to trigger this mobile theme.</span><br><br><span>Hold CTRL + Click to select multiple values.</span><br><br><span>You can change this value in the future, if you create additional themes.</span>",
35
+ ));
36
+ if (!Mage::app()->isSingleStoreMode()) {
37
+ $fieldset ->addField('store_id', 'multiselect', array(
38
+ "name" => "stores[]",
39
+ "label" => Mage::helper("mobilenow")->__("Store View"),
40
+ "title" => Mage::helper("mobilenow")->__("Store View"),
41
+ "required" => true,
42
+ "values" => Mage::getSingleton("adminhtml/system_store")
43
+ ->getStoreValuesForForm(false, true),
44
+ ));
45
+ }
46
+ else {
47
+ $fieldset ->addField("store_id", "hidden", array(
48
+ "name" => "stores[]",
49
+ "value" => Mage::app()->getStore(true)->getId()
50
+ ));
51
+ }
52
+ $fieldset ->addField("user_agent_regex_custom_values", "text", array(
53
+ "label" => Mage::helper("mobilenow")->__("User Agent RegEx Custom Values"),
54
+ "class" => "",
55
+ "required" => false,
56
+ "name" => "user_agent_regex_custom_values",
57
+ "note" => "Input your custom User Agent RegEx Values separated by the Pipe \"|\" Character.",
58
+ ));
59
+ $fieldset ->addField("exclude_user_agent_regex_custom_values", "text", array(
60
+ "label" => Mage::helper("mobilenow")->__("Exclude User Agent RegEx Custom Values"),
61
+ "class" => "",
62
+ "required" => false,
63
+ "name" => "exclude_user_agent_regex_custom_values",
64
+ "note" => "You can force the exclusion of any User Agent in this custom field.",
65
+ ));
66
+ $fieldset ->addField("status", "select", array(
67
+ "label" => Mage::helper("mobilenow")->__("Status"),
68
+ "values" => Mage::helper("mobilenow")->getValueArrayStatus(),
69
+ "name" => "status",
70
+ "class" => "required-entry",
71
+ "required" => true,
72
+ ));
73
+ $fieldset->addField('hidden_theme_sub_setting_name', 'hidden', array(
74
+ 'label' => Mage::helper('mobilenow')->__(''),
75
+ 'name' => 'hidden_theme_sub_setting_name',
76
+ 'class' => '',
77
+ 'required' => false
78
+ ));
79
+ $fieldset->addField('general_theme_savebutton', 'text', array(
80
+ 'name'=>'general_theme_savebutton',
81
+ ));
82
+ $form->getElement('general_theme_savebutton')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_generalthemesavebutton'));
83
+
84
+
85
+ if (Mage::getSingleton("adminhtml/session")->getMobilenowData())
86
+ {
87
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getMobilenowData());
88
+ Mage::getSingleton("adminhtml/session")->setMobilenowData(null);
89
+ }
90
+ elseif(Mage::registry("mobilenow_data"))
91
+ {
92
+ $form->setValues(Mage::registry("mobilenow_data")->getData());
93
+ }
94
+ return parent::_prepareForm();
95
+ }
96
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tab/Layout.php ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Tab_Layout extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ /**
5
+ * Class constructor
6
+ *
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->setTemplate('mobilenow/widget/layout.phtml');
12
+ }
13
+ protected function _prepareForm()
14
+ {
15
+ $form = new Varien_Data_Form();
16
+ $this ->setForm($form);
17
+
18
+ $fieldset = $form->addFieldset("preset_layout_subsettings",array('class'=>'preset_subsettings'));
19
+ if($this->getRequest()->getParam('edit'))
20
+ $newRedrict = Mage::helper('adminhtml')->getUrl('*/*/edit',array('id'=>$this->getRequest()->getParam("id")));
21
+ else
22
+ $newRedrict = Mage::helper('adminhtml')->getUrl('*/*/new',array('id'=>$this->getRequest()->getParam("id")));
23
+ $fieldset->addField('preset_layout_sub_settings', 'select', array(
24
+ 'label' => Mage::helper('mobilenow')->__('Preset Sub Settings'),
25
+ 'class' => 'select_theme_name',
26
+ 'required' => false,
27
+ 'name' => 'preset_layout_sub_settings',
28
+ 'onclick' => "",
29
+ 'onchange' => 'preloadLayoutSubsettings(\''.$newRedrict.'\')',
30
+ 'values' => Mage::helper('mobilenow')->getSubsettings()
31
+ ));
32
+ $fieldset->addField('custom_layout_buttons', 'text', array(
33
+ 'name'=>'custom_layout_buttons',
34
+ ));
35
+ $form->getElement('custom_layout_buttons')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_customlayoutbuttons'));
36
+
37
+
38
+ /*******************************************General / Home Page**********************************************/
39
+ $fieldset = $form->addFieldset('general_layout_homepage',array());
40
+
41
+ $fieldset->addField('homepage_layout_head_message', 'text', array(
42
+ 'name'=>'homepage_layout_head_message',
43
+ ));
44
+ $form->getElement('homepage_layout_head_message')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_hlayoutmessage'));
45
+
46
+ $fieldsetHLayout = $fieldset->addFieldset('general_layout_h_fields',array('class'=>'layout-fields'));
47
+
48
+ $fieldsetHLayout->addField('h_layout_heading', 'note', array(
49
+ 'label'=>'Block Name',
50
+ 'text' => 'Sort Order',
51
+ ));
52
+ $fieldsetHLayout->addField('h_layout_search_cart', 'text', array(
53
+ 'label' => Mage::helper('mobilenow')->__('Search/Cart'),
54
+ 'name' => 'h_layout_search_cart',
55
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
56
+ 'required' => false
57
+ ));
58
+ $fieldsetHLayout->addField('h_layout_sub_header', 'text', array(
59
+ 'label' => Mage::helper('mobilenow')->__('Sub Header'),
60
+ 'name' => 'h_layout_sub_header',
61
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
62
+ 'required' => false
63
+ ));
64
+ $fieldsetHLayout->addField('h_layout_banner', 'text', array(
65
+ 'label' => Mage::helper('mobilenow')->__('Feature Banner'),
66
+ 'name' => 'h_layout_banner',
67
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
68
+ 'required' => false
69
+ ));
70
+ $fieldsetHLayout->addField('h_layout_feature', 'text', array(
71
+ 'label' => Mage::helper('mobilenow')->__('Homepage Feature'),
72
+ 'name' => 'h_layout_feature',
73
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
74
+ 'required' => false
75
+ ));
76
+ $fieldsetHLayout->addField('h_layout_categories', 'text', array(
77
+ 'label' => Mage::helper('mobilenow')->__('Categories'),
78
+ 'name' => 'h_layout_categories',
79
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
80
+ 'required' => false
81
+ ));
82
+ $fieldsetHLayout->addField('h_layout_news_signup', 'text', array(
83
+ 'label' => Mage::helper('mobilenow')->__('Newsletter Signup'),
84
+ 'name' => 'h_layout_news_signup',
85
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
86
+ 'required' => false
87
+ ));
88
+
89
+ /*******************************************Catalog Page**********************************************/
90
+ $fieldset = $form->addFieldset('catalog_layout_page',array());
91
+
92
+ $fieldset->addField('catalog_layout_head_message', 'text', array(
93
+ 'name'=>'catalog_layout_head_message',
94
+ ));
95
+ $form->getElement('catalog_layout_head_message')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_clayoutmessage'));
96
+
97
+ $fieldsetCLayout = $fieldset->addFieldset('general_layout_c_fields',array('class'=>'layout-fields'));
98
+
99
+ $fieldsetCLayout->addField('c_layout_heading', 'note', array(
100
+ 'label'=>'Block Name',
101
+ 'text' => 'Sort Order',
102
+ ));
103
+ $fieldsetCLayout->addField('c_layout_breadcrumbs', 'text', array(
104
+ 'label' => Mage::helper('mobilenow')->__('Breadcrumbs'),
105
+ 'name' => 'c_layout_breadcrumbs',
106
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
107
+ 'required' => false
108
+ ));
109
+ $fieldsetCLayout->addField('c_layout_toolbar', 'text', array(
110
+ 'label' => Mage::helper('mobilenow')->__('Toolbar'),
111
+ 'name' => 'c_layout_toolbar',
112
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
113
+ 'required' => false
114
+ ));
115
+ $fieldsetCLayout->addField('c_layout_pag_top', 'text', array(
116
+ 'label' => Mage::helper('mobilenow')->__('Pagination (top)'),
117
+ 'name' => 'c_layout_pag_top',
118
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
119
+ 'required' => false
120
+ ));
121
+
122
+ //for grid
123
+ // $fieldsetCLayout = $fieldset->addFieldset('general_layout_c_fields_grid',array('class'=>'layout-fields layout-grid-listheading'));
124
+ //
125
+ // $fieldsetCLayout->addField('c_grid_layout_heading', 'note', array(
126
+ // 'text'=>'Product Grid View - <a class="headlink" href="">view in preview</a>'
127
+ // ));
128
+ // $fieldsetCLayout->addField('c_grid_layout_product_image', 'text', array(
129
+ // 'label' => Mage::helper('mobilenow')->__('Product - Image'),
130
+ // 'name' => 'c_grid_layout_product_image',
131
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
132
+ // 'required' => false
133
+ // ));
134
+ // $fieldsetCLayout->addField('c_grid_layout_product_title', 'text', array(
135
+ // 'label' => Mage::helper('mobilenow')->__('Product - Title'),
136
+ // 'name' => 'c_grid_layout_product_title',
137
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
138
+ // 'required' => false
139
+ // ));
140
+ // $fieldsetCLayout->addField('c_grid_layout_product_price', 'text', array(
141
+ // 'label' => Mage::helper('mobilenow')->__('Product - Price'),
142
+ // 'name' => 'c_grid_layout_product_price',
143
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
144
+ // 'required' => false
145
+ // ));
146
+ // $fieldsetCLayout->addField('c_grid_layout_product_review', 'text', array(
147
+ // 'label' => Mage::helper('mobilenow')->__('Product - Review Summary'),
148
+ // 'name' => 'c_grid_layout_product_review',
149
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
150
+ // 'required' => false
151
+ // ));
152
+ // $fieldsetCLayout->addField('c_grid_layout_product_learn', 'text', array(
153
+ // 'label' => Mage::helper('mobilenow')->__('Product - Learn More'),
154
+ // 'name' => 'c_grid_layout_product_learn',
155
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
156
+ // 'required' => false
157
+ // ));
158
+ // $fieldsetCLayout->addField('c_grid_layout_product_addtocart', 'text', array(
159
+ // 'label' => Mage::helper('mobilenow')->__('Product - Add to Cart'),
160
+ // 'name' => 'c_grid_layout_product_addtocart',
161
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
162
+ // 'required' => false
163
+ // ));
164
+
165
+
166
+ //for list
167
+ $fieldsetCLayout = $fieldset->addFieldset('general_layout_c_fields_list',array('class'=>'layout-fields layout-grid-listheading'));
168
+
169
+ $fieldsetCLayout->addField('c_list_layout_heading', 'note', array(
170
+ 'text'=>'Product List View - <a class="headlink" href="">view in preview</a>'
171
+ ));
172
+ // $fieldsetCLayout->addField('c_list_layout_product_image', 'text', array(
173
+ // 'label' => Mage::helper('mobilenow')->__('Product - Image'),
174
+ // 'name' => 'c_list_layout_product_image',
175
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
176
+ // 'required' => false
177
+ // ));
178
+ // $fieldsetCLayout->addField('c_list_layout_product_title', 'text', array(
179
+ // 'label' => Mage::helper('mobilenow')->__('Product - Title'),
180
+ // 'name' => 'c_list_layout_product_title',
181
+ // 'class' => 'sort_order validate-digits validate-greater-than-zero',
182
+ // 'required' => false
183
+ // ));
184
+ $fieldsetCLayout->addField('c_list_layout_product_price', 'text', array(
185
+ 'label' => Mage::helper('mobilenow')->__('Product - Price'),
186
+ 'name' => 'c_list_layout_product_price',
187
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
188
+ 'required' => false
189
+ ));
190
+ $fieldsetCLayout->addField('c_list_layout_product_review', 'text', array(
191
+ 'label' => Mage::helper('mobilenow')->__('Product - Review Summary'),
192
+ 'name' => 'c_list_layout_product_review',
193
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
194
+ 'required' => false
195
+ ));
196
+ $fieldsetCLayout->addField('c_list_layout_product_learn', 'text', array(
197
+ 'label' => Mage::helper('mobilenow')->__('Product - Learn More'),
198
+ 'name' => 'c_list_layout_product_learn',
199
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
200
+ 'required' => false
201
+ ));
202
+ $fieldsetCLayout->addField('c_list_layout_product_addtocart', 'text', array(
203
+ 'label' => Mage::helper('mobilenow')->__('Product - Add to Cart'),
204
+ 'name' => 'c_list_layout_product_addtocart',
205
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
206
+ 'required' => false
207
+ ));
208
+
209
+
210
+
211
+ /*******************************************Product Page**********************************************/
212
+ $fieldset = $form->addFieldset('produt_layout_page',array());
213
+
214
+ $fieldset->addField('product_layout_head_message', 'text', array(
215
+ 'name'=>'product_layout_head_message',
216
+ ));
217
+ $form->getElement('product_layout_head_message')->setRenderer($this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_edit_renderer_playoutmessage'));
218
+ //Product page Top section
219
+ $fieldsetPTLayout = $fieldset->addFieldset('general_layout_pt_fields',array('class'=>'layout-fields'));
220
+
221
+ $fieldsetPTLayout->addField('pt_layout_heading', 'note', array(
222
+ 'label'=>'Block Name',
223
+ 'text' => 'Sort Order',
224
+ ));
225
+ $fieldsetPTLayout->addField('p_layout_availability', 'text', array(
226
+ 'label' => Mage::helper('mobilenow')->__('Availability'),
227
+ 'name' => 'p_layout_availability',
228
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
229
+ 'required' => false
230
+ ));
231
+ $fieldsetPTLayout->addField('p_layout_pricing', 'text', array(
232
+ 'label' => Mage::helper('mobilenow')->__('Pricing'),
233
+ 'name' => 'p_layout_pricing',
234
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
235
+ 'required' => false
236
+ ));
237
+ $fieldsetPTLayout->addField('p_layout_addtocart', 'text', array(
238
+ 'label' => Mage::helper('mobilenow')->__('Customize / Add to Cart'),
239
+ 'name' => 'p_layout_addtocart',
240
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
241
+ 'required' => false
242
+ ));
243
+ $fieldsetPTLayout->addField('p_layout_wishlist', 'text', array(
244
+ 'label' => Mage::helper('mobilenow')->__('Wishlist Link'),
245
+ 'name' => 'p_layout_wishlist',
246
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
247
+ 'required' => false
248
+ ));
249
+ $fieldsetPTLayout->addField('p_layout_review', 'text', array(
250
+ 'label' => Mage::helper('mobilenow')->__('Review Summary'),
251
+ 'name' => 'p_layout_review',
252
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
253
+ 'required' => false
254
+ ));
255
+ // Product page Bottom section
256
+ $fieldsetPBLayout = $fieldset->addFieldset('general_layout_pb_fields',array('class'=>'layout-fields'));
257
+
258
+ $fieldsetPBLayout->addField('pb_layout_heading', 'note', array(
259
+ 'label'=>'Block Name',
260
+ 'text' => 'Sort Order',
261
+ ));
262
+ $fieldsetPBLayout->addField('p_layout_desc', 'text', array(
263
+ 'label' => Mage::helper('mobilenow')->__('Description'),
264
+ 'name' => 'p_layout_desc',
265
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
266
+ 'required' => false
267
+ ));
268
+ $fieldsetPBLayout->addField('p_layout_additionalinfo', 'text', array(
269
+ 'label' => Mage::helper('mobilenow')->__('Additional Information'),
270
+ 'name' => 'p_layout_additionalinfo',
271
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
272
+ 'required' => false
273
+ ));
274
+ $fieldsetPBLayout->addField('p_layout_fullreview', 'text', array(
275
+ 'label' => Mage::helper('mobilenow')->__('Full Reviews'),
276
+ 'name' => 'p_layout_fullreview',
277
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
278
+ 'required' => false
279
+ ));
280
+ $fieldsetPBLayout->addField('p_layout_relatedproduct', 'text', array(
281
+ 'label' => Mage::helper('mobilenow')->__('Related Products'),
282
+ 'name' => 'p_layout_relatedproduct',
283
+ 'class' => 'sort_order validate-digits validate-greater-than-zero',
284
+ 'required' => false
285
+ ));
286
+
287
+
288
+ if (Mage::getSingleton("adminhtml/session")->getSubsettingsData())
289
+ {
290
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getSubsettingsData());
291
+ Mage::getSingleton("adminhtml/session")->setSubsettingsData(null);
292
+ }
293
+ elseif(Mage::registry("subsettings_data"))
294
+ {
295
+ $form->setValues(Mage::registry("subsettings_data")->getData());
296
+ }
297
+ return parent::_prepareForm();
298
+ }
299
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Edit/Tabs.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId("mobilenow_tabs");
8
+ $this->setDestElementId("edit_form");
9
+ $this->setTitle(Mage::helper("mobilenow")->__("Add New Mobile Theme"));
10
+ }
11
+ protected function _beforeToHtml()
12
+ {
13
+ $this->addTab("form_section", array(
14
+ "label" => Mage::helper("mobilenow")->__("General Theme Settings"),
15
+ "title" => Mage::helper("mobilenow")->__("General Theme Settings"),
16
+ "content" => $this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit_tab_form")->toHtml(),
17
+ ));
18
+ if(Mage::app()->getRequest()->getActionName()!='new'){
19
+ $this->addTab("design", array(
20
+ "label" => Mage::helper("mobilenow")->__("Theme Design"),
21
+ "title" => Mage::helper("mobilenow")->__("Theme Design"),
22
+ "content" => $this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit_tab_design")->toHtml(),
23
+ ));
24
+ $this->addTab("theme_layouts", array(
25
+ "label" => Mage::helper("mobilenow")->__("Theme Layouts"),
26
+ "title" => Mage::helper("mobilenow")->__("Theme Layouts"),
27
+ "content" =>$this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit_tab_layout")->toHtml(),
28
+ ));
29
+ $this->addTab("advanced_settings", array(
30
+ "label" => Mage::helper("mobilenow")->__("Advanced Settings"),
31
+ "title" => Mage::helper("mobilenow")->__("Advanced Settings"),
32
+ "content" => $this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit_tab_advsettings")->toHtml(),
33
+ ));
34
+ }
35
+ /*$this->addTab("analytics", array(
36
+ "label" => Mage::helper("mobilenow")->__("Analytics"),
37
+ "title" => Mage::helper("mobilenow")->__("Analytics"),
38
+ "content" => 'Analytics content will be updated soon',
39
+ ));
40
+ $this->addTab("submission_history", array(
41
+ "label" => Mage::helper("mobilenow")->__("Submission History"),
42
+ "title" => Mage::helper("mobilenow")->__("Submission History"),
43
+ "content" => 'Submission History content will be updated soon',
44
+ ));
45
+ $this->addTab("cache_management", array(
46
+ "label" => Mage::helper("mobilenow")->__("Cache Management"),
47
+ "title" => Mage::helper("mobilenow")->__("Cache Management"),
48
+ "content" => 'Cache Management content will be updated soon',
49
+ ));
50
+ $this->addTab("social_networking", array(
51
+ "label" => Mage::helper("mobilenow")->__("Social Networking"),
52
+ "title" => Mage::helper("mobilenow")->__("Social Networking"),
53
+ "content" => 'Social Networking content will be updated soon',
54
+ ));
55
+ $this->addTab("push_notification", array(
56
+ "label" => Mage::helper("mobilenow")->__("Push Notification"),
57
+ "title" => Mage::helper("mobilenow")->__("Push Notification"),
58
+ "content" => 'Push Notification content will be updated soon',
59
+ ));*/
60
+ //if($this->getRequest()->getParam('load_id') || $this->getRequest()->getParam('reset_id'))
61
+ //$this->setActiveTab('design');
62
+ if($this->getRequest()->getParam('active_tab'))
63
+ $this->setActiveTab($this->getRequest()->getParam('active_tab'));
64
+ return parent::_beforeToHtml();
65
+ }
66
+
67
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenow/Grid.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenow_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId("mobilenowGrid");
10
+ $this->setDefaultSort("theme_id");
11
+ $this->setDefaultDir("ASC");
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel("mobilenow/mobilenow")->getCollection();
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+ protected function _prepareColumns()
22
+ {
23
+ /*$this ->addColumn("theme_id", array(
24
+ "header"=> Mage::helper("mobilenow")->__("ID"),
25
+ "align" =>"right",
26
+ "width" => "50px",
27
+ "type" => "number",
28
+ "index" => "theme_id",
29
+ ));*/
30
+ $this ->addColumn('theme_name', array(
31
+ "header"=> Mage::helper("mobilenow")->__("Mobile Theme Name"),
32
+ "index" => 'theme_name',
33
+ 'renderer'=> new Redstage_Mobilenow_Block_Adminhtml_Renderer_Themename,
34
+ ));
35
+ if (!Mage::app()->isSingleStoreMode()) {
36
+ $this->addColumn('store_id', array(
37
+ 'header' => Mage::helper('cms')->__('Store View'),
38
+ 'index' => 'store_id',
39
+ 'type' => 'store',
40
+ 'store_all' => true,
41
+ 'store_view' => true,
42
+ 'sortable' => false,
43
+ 'filter_condition_callback'
44
+ => array($this, '_filterStoreCondition'),
45
+ ));
46
+ }
47
+ $this->addColumn('mobile_device_design_interface', array(
48
+ 'header' => Mage::helper('mobilenow')->__('Mobile Device & User Agents'),
49
+ 'index' => 'mobile_device_design_interface',
50
+ 'type' => 'options',
51
+ 'options'=>Mage::helper("mobilenow")->getGridOptionArrayMobileDevice(),
52
+ 'renderer'=> new Redstage_Mobilenow_Block_Adminhtml_Renderer_Merge,
53
+ ));
54
+ $this->addColumn('status', array(
55
+ 'header' => Mage::helper('mobilenow')->__('Status'),
56
+ 'index' => 'status',
57
+ 'type' => 'options',
58
+ 'options'=>Mage::helper("mobilenow")->getOptionArrayStatus(),
59
+ ));
60
+ $this->addColumn('change_status', array(
61
+ 'header' => Mage::helper('mobilenow')->__('Change Status'),
62
+ 'index' => 'change_status',
63
+ 'filter' => false,
64
+ 'sortable' => false,
65
+ 'renderer'=> new Redstage_Mobilenow_Block_Adminhtml_Renderer_Status,
66
+ ));
67
+ //$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
68
+ //$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
69
+
70
+ return parent::_prepareColumns();
71
+ }
72
+
73
+ public function getRowUrl($row)
74
+ {
75
+ return $this->getUrl("*/*/edit", array("id" => $row->getId()));
76
+ }
77
+ // protected function _prepareMassaction()
78
+ // {
79
+ // $this->setMassactionIdField('theme_id');
80
+ // $this->getMassactionBlock()->setFormFieldName('theme_ids');
81
+ // $this->getMassactionBlock()->setUseSelectAll(true);
82
+ // $this->getMassactionBlock()->addItem('remove_mobilenow', array(
83
+ // 'label'=> Mage::helper('mobilenow')->__('Remove Mobilenow'),
84
+ // 'url' => $this->getUrl('*/adminhtml_mobilenow/massRemove'),
85
+ // 'confirm' => Mage::helper('mobilenow')->__('Are you sure?')
86
+ // ));
87
+ // return $this;
88
+ // }
89
+ protected function _afterLoadCollection()
90
+ {
91
+ $this->getCollection()->walk('afterLoad');
92
+ parent::_afterLoadCollection();
93
+ }
94
+
95
+ protected function _filterStoreCondition($collection, $column)
96
+ {
97
+ if (!$value = $column->getFilter()->getValue()) {
98
+ return;
99
+ }
100
+
101
+ $this->getCollection()->addStoreFilter($value);
102
+ }
103
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Mobilenowbackend.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Block_Adminhtml_Mobilenowbackend extends Mage_Adminhtml_Block_Template {
4
+
5
+ /**
6
+ * Initialize block
7
+ */
8
+ public function __construct()
9
+ {
10
+ $this->setTemplate('mobilenow/mobilenowbackend.phtml');
11
+ }
12
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Renderer/Merge.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Renderer_Merge extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ // Get all the array of Mobile Device Design Interface from the grid
7
+ $mobileDeviceOptionArray=Mage::helper("mobilenow")->getOptionArrayMobileDevice();
8
+ // Get all the array of User Agent RegEx Values from the grid
9
+ $userAgentRegxValues=Mage::helper("mobilenow")->getOptionArrayUserAgent();
10
+ if ($row->getData('mobile_device_design_interface') != NULL || $row->getData('user_agent_regex_values') != NULL)
11
+ {
12
+ //Mobile Device Design Interface processed
13
+ $mobileDevice = $row->getData('mobile_device_design_interface');
14
+ if (array_key_exists($mobileDevice, $mobileDeviceOptionArray))
15
+ {
16
+ $mobileDeviceValue=$mobileDeviceOptionArray[$mobileDevice];
17
+ }
18
+ //User Agent RegEx Values processed
19
+ $userAgent = $row->getData('user_agent_regex_values');
20
+ $explodeUserAgents=explode(',',$userAgent);
21
+ if (!empty($explodeUserAgents))
22
+ {
23
+ foreach ($explodeUserAgents as $explodeUserAgent)
24
+ {
25
+ if (array_key_exists($explodeUserAgent,$userAgentRegxValues))
26
+ {
27
+ $userAgentRegxValue[]=$userAgentRegxValues[$explodeUserAgent];
28
+ }
29
+ }
30
+ }
31
+ $userAgentRegxValue= implode('|',$userAgentRegxValue);
32
+ if ($userAgent != NULL)
33
+ {
34
+ return $mobileDeviceValue . '<br> ['.$userAgentRegxValue.']';
35
+ }
36
+ else
37
+ {
38
+ return $mobileDeviceValue;
39
+ }
40
+ }
41
+ else
42
+ {
43
+ return Mage::helper('mobilenow')->__('No Mobile Device & User Agents Assigned');
44
+ }
45
+ }
46
+ }?>
47
+
48
+
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Renderer/Status.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Renderer_Status extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ if ($row->getData('status')==0)
7
+ {
8
+ return '<a class="grid_link" href="'.Mage::helper("adminhtml")->getUrl("mobilenow/adminhtml_mobilenow/status",array('status_id'=>$row->getData('status'),'theme_id'=>$row->getData('theme_id'))).'" title="Click Here To Activate Theme">Activate Theme</a>';
9
+ }
10
+ else
11
+ {
12
+ return '<a class="grid_link" href="'.Mage::helper("adminhtml")->getUrl("mobilenow/adminhtml_mobilenow/status",array('status_id'=>$row->getData('status'),'theme_id'=>$row->getData('theme_id'))).'" title="Click Here To Deactivate Theme">Deactivate Theme</a>';
13
+ }
14
+ }
15
+ }?>
16
+
17
+
app/code/community/Redstage/Mobilenow/Block/Adminhtml/Renderer/Themename.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_Renderer_Themename extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ if($row->getData('theme_name')!='')
7
+ {
8
+ return $row->getData('theme_name').'<a class="edit_link_grid" href="'.Mage::helper("adminhtml")->getUrl("mobilenow/adminhtml_mobilenow/edit",array('id'=>$row->getData('theme_id'))).'"><img src="'.$this->getSkinUrl("mobilenow_images/edit1.png").'" width="16" height="16"/><span class="grid_edit_link_text">Edit</a></a>';
9
+ }
10
+ }
11
+ }?>
12
+
13
+
app/code/community/Redstage/Mobilenow/Block/Adminhtml/System/Config/Form/Button.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_System_Config_Form_Button extends Mage_Adminhtml_Block_System_Config_Form_Field{
3
+
4
+ /*
5
+ * Set template
6
+ */
7
+ protected function _construct()
8
+ {
9
+ parent::_construct();
10
+ $this->setTemplate('mobilenow/system/config/button.phtml');
11
+ }
12
+
13
+ /**
14
+ * Return element html
15
+ *
16
+ * @param Varien_Data_Form_Element_Abstract $element
17
+ * @return string
18
+ */
19
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
20
+ {
21
+ return $this->_toHtml();
22
+ }
23
+ /**
24
+ * Generate button html
25
+ *
26
+ * @return string
27
+ */
28
+ public function getButtonHtml()
29
+ {
30
+ $connectUrl=Mage::helper('adminhtml')->getUrl('mobilenow/adminhtml_mobilenow/mobileConnect');
31
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
32
+ ->setData(array(
33
+ 'id' => 'connect_mobile_now_button',
34
+ 'label' => $this->helper('adminhtml')->__('Connect Account to Mobile Now'),
35
+ 'onclick' => 'connectWithMobilenow(\''.$connectUrl.'\')'
36
+ ));
37
+
38
+ return $button->toHtml();
39
+ }
40
+
41
+ }
app/code/community/Redstage/Mobilenow/Block/Adminhtml/System/Config/Form/Link.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Adminhtml_System_Config_Form_Link extends Mage_Adminhtml_Block_System_Config_Form_Field{
3
+
4
+ /*
5
+ * Set template
6
+ */
7
+ protected function _construct()
8
+ {
9
+ parent::_construct();
10
+ $this->setTemplate('mobilenow/system/config/link.phtml');
11
+ }
12
+
13
+ /**
14
+ * Return element html
15
+ *
16
+ * @param Varien_Data_Form_Element_Abstract $element
17
+ * @return string
18
+ */
19
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
20
+ {
21
+ return $this->_toHtml();
22
+ }
23
+ }
app/code/community/Redstage/Mobilenow/Block/Home.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Home extends Mage_Core_Block_Template{
3
+
4
+ public function __construct()
5
+ {
6
+ $this->setTemplate('mobilenow/home.phtml');
7
+
8
+
9
+ }
10
+
11
+ public function mobileLinks()
12
+ {
13
+ if (!$this->helper('customer')->isLoggedIn() )
14
+ {
15
+ $loginlabel ='Log In';
16
+ $loginurl =$this->getUrl('customer/account/login/',array());
17
+ }
18
+ else
19
+ {
20
+ $loginlabel ='Logout';
21
+ $loginurl =$this->getUrl('customer/account/logout/',array());
22
+ }
23
+ $menu['home'] = array('label' => 'Home','url'=>Mage::getBaseUrl() );
24
+ $menu['login'] = array('label' => $loginlabel,'url'=>$loginurl );
25
+ $menu['account'] = array('label' => 'My Account','url'=>$this->getUrl('customer/account/'));
26
+ $menu['wishlist']= array('label' => 'Wishlist','url'=>$this->getUrl('wishlist'));
27
+
28
+ if($this->getData('home') != '')
29
+ $links['home'] = $this->getData('home');
30
+ if($this->getData('login') != '')
31
+ $links['login'] = $this->getData('login');
32
+ if($this->getData('account') != '')
33
+ $links['account'] = $this->getData('account');
34
+ if($this->getData('wishlist') != '')
35
+ $links['wishlist'] = $this->getData('wishlist');
36
+
37
+ //$links = array_flip($links);
38
+ asort($links);
39
+ foreach($links as $k=>&$link){
40
+ $link=$menu[$k];
41
+ }
42
+ return $links;
43
+ }
44
+
45
+
46
+
47
+
48
+ }
49
+
50
+
51
+
app/code/community/Redstage/Mobilenow/Block/Left.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Block_Left extends Mage_Core_Block_Template{
3
+
4
+
5
+
6
+
7
+
8
+ }
app/code/community/Redstage/Mobilenow/Block/Toolbar.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
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
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Catalog
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Product list toolbar
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Catalog
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Redstage_Mobilenow_Block_Toolbar extends Mage_Core_Block_Template
36
+ {
37
+
38
+ function getCustomToolBarHtml()
39
+ {
40
+
41
+ $toolBarBlock = Mage::app()->getLayout()->createBlock('catalog/product_list_toolbar');
42
+ $toolBarBlock->setData('pager',$this->getData('pager'));
43
+ $toolBarBlock->setData('sortbox',$this->getData('sortbox'));
44
+ $toolBarBlock->setData('breadcrumb',$this->getData('breadcrumb'));
45
+ $toolBarBlock->setData('showbreadcrumb',$this->getData('showbreadcrumb'));
46
+
47
+ $toolBarBlock->setData('_current_grid_mode', 'list');
48
+ $toolBarBlock->disableParamsMemorizing();
49
+
50
+ $pagerlimitlist =explode(',', $this->getData('pagerlimitlist'));
51
+ if('all'== strtolower($pagerlimitlist[0])){
52
+ $mode= 'list';
53
+ $perPageConfigKey = 'catalog/frontend/' . $mode . '_per_page_values';
54
+ $perPageValues = (string)Mage::getStoreConfig($perPageConfigKey);
55
+ $perPageValues = explode(',', $perPageValues);
56
+ $perPageValues = array_combine($perPageValues, $perPageValues);
57
+ $pagerlimitlist= $perPageValues + array('all'=>$this->__('All'));
58
+
59
+ //$toolBarBlock->addPagerLimit('list', 'All', '');
60
+ //$toolBarBlock->setDefaultListPerPage('All');
61
+
62
+ }else{
63
+
64
+ }
65
+
66
+ foreach ($pagerlimitlist as $key => $value) {
67
+ $toolBarBlock->addPagerLimit('list', $value, '');
68
+ }
69
+
70
+ if (in_array($this->getData('defaultlistperpage'), $pagerlimitlist)) {
71
+
72
+
73
+ $toolBarBlock->setDefaultListPerPage( ucfirst($this->getData('defaultlistperpage')) );
74
+ //$toolBarBlock->setData('_current_limit', '10');
75
+ }
76
+ //$toolBarBlock->
77
+
78
+ $toolBarBlock->disableParamsMemorizing();
79
+
80
+
81
+ //echo $toolBarBlock->getDefaultPerPageValue();
82
+ //$toolBarBlock->setData('_current_grid_mode', 'list');
83
+
84
+ $pagerBlock = Mage::app()->getLayout()->createBlock('page/html_pager');
85
+ // $pagerBlock->setDefaultListPerPage('10');
86
+
87
+ $toolBarBlock->setChild('product_list_toolbar_pager',$pagerBlock);
88
+ $productList = Mage::app()->getLayout()->createBlock('catalog/product_list');
89
+
90
+ $toolBarBlock->setCollection($productList->getLoadedProductCollection());
91
+ //$toolBarBlock->setDefaultListPerPage('10');
92
+ return $toolBarBlock->toHtml();
93
+
94
+
95
+ /*$toolbar = Mage::app()->getLayout()->createBlock('catalog/product_list_toolbar');
96
+ $pager = Mage::app()->getLayout()->createBlock('page/html_pager');
97
+ $toolbar->setChild('product_list_toolbar_pager',$pager);
98
+
99
+ // called prepare sortable parameters
100
+ $collection = $this->_getProductCollection();
101
+
102
+ // use sortable parameters
103
+ if ($orders = $this->getAvailableOrders()) {
104
+ $toolbar->setAvailableOrders($orders);
105
+ }
106
+ if ($sort = $this->getSortBy()) {
107
+ $toolbar->setDefaultOrder($sort);
108
+ }
109
+ if ($dir = $this->getDefaultDirection()) {
110
+ $toolbar->setDefaultDirection($dir);
111
+ }
112
+ if ($modes = $this->getModes()) {
113
+ $toolbar->setModes($modes);
114
+ }
115
+ // set collection to toolbar and apply sort
116
+ $toolbar->setCollection($collection);
117
+ return $toolbar->toHtml();*/
118
+
119
+ }
120
+
121
+ }
app/code/community/Redstage/Mobilenow/Helper/Catalogpage.php ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Helper_Catalogpage extends Mage_Core_Helper_Abstract
3
+ {
4
+ // function for generationg catalog layout xml
5
+ static public function generateCatalogPageLayoutXML($post_data)
6
+ {
7
+ $themeSubSettings['c_pagelayoutmain'] = array();
8
+ $themeSubSettings['c_pagelayoutmain']['c_layout_breadcrumbs'] = 0;
9
+ $themeSubSettings['c_pagelayoutmain']['c_layout_toolbar'] = 0;
10
+ $themeSubSettings['c_pagelayoutmain']['c_layout_pag_top'] = 0;
11
+ if($post_data['c_layout_breadcrumbs'] > 0)
12
+ $themeSubSettings['c_pagelayoutmain']['c_layout_breadcrumbs'] = $post_data['c_layout_breadcrumbs'];
13
+ if($post_data['c_layout_toolbar'] > 0)
14
+ $themeSubSettings['c_pagelayoutmain']['c_layout_toolbar'] = $post_data['c_layout_toolbar'];
15
+ if($post_data['c_layout_pag_top'] > 0)
16
+ $themeSubSettings['c_pagelayoutmain']['c_layout_pag_top'] = $post_data['c_layout_pag_top'];
17
+
18
+ if(count($themeSubSettings['c_pagelayoutmain']) > 0){
19
+ asort($themeSubSettings['c_pagelayoutmain']);
20
+ }
21
+ $c_main_sort_xml = array();
22
+ if(!$post_data['show_breadcrumbs'] ||$post_data['show_breadcrumbs'] != '1'){
23
+ $c_main_sort_xml['c_layout_breadcrumbs'] = '<action method="setData"><name>showbreadcrumb</name><value>0</value></action>';
24
+ } else {
25
+ $c_main_sort_xml['c_layout_breadcrumbs'] = '<action method="setData"><name>showbreadcrumb</name><value>1</value></action><action method="setData"><name>breadcrumb</name><value>'.$themeSubSettings['c_pagelayoutmain']['c_layout_breadcrumbs'].'</value></action>';
26
+ }
27
+ // if(!$post_data['show_sortby_dropdown'] ||$post_data['show_sortby_dropdown'] != '1'){
28
+ // $c_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>showsortbydropdown</name><value>0</value></action>';
29
+ // } else {
30
+ // $c_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>showsortbydropdown</name><value>1</value></action>';
31
+ // }
32
+ $c_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>sortbox</name><value>'.$themeSubSettings['c_pagelayoutmain']['c_layout_toolbar'].'</value></action>';
33
+ if(!$post_data['show_pagination'] ||$post_data['show_pagination'] == '2'){
34
+ $c_main_sort_xml['c_layout_pag_top'] = '';
35
+ } else {
36
+ $c_main_sort_xml['c_layout_pag_top'] = '<action method="setData"><name>pager</name><value>'.$themeSubSettings['c_pagelayoutmain']['c_layout_pag_top'].'</value></action>';
37
+ }
38
+
39
+ $themeSubSettings['c_bottom_pagelayoutmain'] = array();
40
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'] = 0;
41
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_pag_top'] = 0;
42
+ if($post_data['c_layout_toolbar'] > 0)
43
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'] = $post_data['c_layout_toolbar'];
44
+ if($post_data['c_layout_pag_top'] > 0)
45
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_pag_top'] = $post_data['c_layout_pag_top'];
46
+
47
+ if(count($themeSubSettings['c_bottom_pagelayoutmain']) > 0){
48
+ asort($themeSubSettings['c_bottom_pagelayoutmain']);
49
+ }
50
+ $c_bottom_main_sort_xml = array();
51
+ // if(!$post_data['show_sortby_dropdown'] ||$post_data['show_sortby_dropdown'] != '1'){
52
+ // $c_bottom_main_sort_xml['c_layout_toolbar'] = '';
53
+ // } else {
54
+ // $c_bottom_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>sortbox</name><value>'.$themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'].'</value></action>';
55
+ // }
56
+ $c_bottom_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>sortbox</name><value>'.$themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'].'</value></action>';
57
+ if(!$post_data['show_pagination'] ||$post_data['show_pagination'] == '1'){
58
+ $c_bottom_main_sort_xml['c_layout_pag_top'] = '';
59
+ } else {
60
+ $c_bottom_main_sort_xml['c_layout_pag_top'] = '<action method="setData"><name>pager</name><value>'.$themeSubSettings['c_bottom_pagelayoutmain']['c_layout_pag_top'].'</value></action>';
61
+ }
62
+
63
+ $catalog_layout_xml = '';
64
+
65
+ $catalog_layout_xml .= '<remove name="newsletter"/><reference name="root">
66
+ <action method="unsetChild"><name>breadcrumbs</name></action>
67
+ </reference>';
68
+ // $catalog_layout_xml .= '<reference name="left">
69
+ // <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
70
+ // </reference>';
71
+ $catalog_layout_xml .='<reference name="content">';
72
+
73
+ $catalog_layout_xml .= '
74
+ <block type="mobilenow/toolbar" name="custom_toolbar" template="catalog/product/list/customtoolbar.phtml">';
75
+ foreach($themeSubSettings['c_pagelayoutmain'] as $cmkey=>$cmvalue){
76
+ $catalog_layout_xml .= $c_main_sort_xml[$cmkey];
77
+ }
78
+
79
+ $catalog_layout_xml .='
80
+ <action method="setData"><name>pagerlimitlist</name><value>'.$post_data['number_of_products_choice_steps'].'</value></action>
81
+ <action method="setData"><name>defaultlistperpage</name><value>'.$post_data['number_of_products_per_page'].'</value></action>
82
+ </block>';
83
+
84
+ $themeSubSettings['c_listpagelayoutmain'] = array();
85
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_price'] = 0;
86
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_review'] = 0;
87
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_learn'] = 0;
88
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_addtocart'] = 0;
89
+ if($post_data['c_list_layout_product_price'] > 0)
90
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_price'] = $post_data['c_list_layout_product_price'];
91
+ if($post_data['c_list_layout_product_review'] > 0)
92
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_review'] = $post_data['c_list_layout_product_review'];
93
+ if($post_data['c_list_layout_product_learn'] > 0)
94
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_learn'] = $post_data['c_list_layout_product_learn'];
95
+ if($post_data['c_list_layout_product_addtocart'] > 0)
96
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_addtocart'] = $post_data['c_list_layout_product_addtocart'];
97
+ //
98
+
99
+ $c_list_sort_xml = array();
100
+ $c_list_sort_xml['c_list_layout_product_price'] = '<action method="setData"><name>price</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_price'].'</value></action>';
101
+ $c_list_sort_xml['c_list_layout_product_review'] = '<action method="setData"><name>ratings</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_review'].'</value></action>';
102
+ $c_list_sort_xml['c_list_layout_product_learn'] = '<action method="setData"><name>cart</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_learn'].'</value></action>';
103
+ $c_list_sort_xml['c_list_layout_product_addtocart'] = ' <action method="setData"><name>more</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_addtocart'].'</value></action>';
104
+
105
+ $catalog_layout_xml .='
106
+ <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
107
+ <block type="catalog/product_list" name="product_list" template="catalog/product/mobilelist.phtml">';
108
+ if($post_data['show_review_stars'] && $post_data['show_review_stars'] == '1'){
109
+ $catalog_layout_xml .= '<action method="setData"><name>showstar</name><value>1</value></action>';
110
+ }
111
+ if($post_data['show_add_to_cart'] && $post_data['show_add_to_cart'] == '1'){
112
+ $catalog_layout_xml .= '<action method="setData"><name>showcartbtn</name><value>1</value></action>';
113
+ }
114
+ if($post_data['show_learn_more'] && $post_data['show_learn_more'] == '1'){
115
+ $catalog_layout_xml .= '<action method="setData"><name>showlernmore</name><value>1</value></action>';
116
+ }
117
+
118
+ foreach($c_list_sort_xml as $c_listkey=>$c_listvalue){
119
+ $catalog_layout_xml .= $c_listvalue;
120
+ }
121
+
122
+ $catalog_layout_xml .= '
123
+ <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
124
+ <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
125
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
126
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
127
+ <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
128
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
129
+ </block>
130
+ </block>
131
+ ';
132
+ $catalog_layout_xml .= '<block type="mobilenow/toolbar" name="custom_toolbar_bottom" template="catalog/product/list/customtoolbar.phtml">';
133
+ foreach($themeSubSettings['c_bottom_pagelayoutmain'] as $cmbkey=>$cmbvalue){
134
+ $catalog_layout_xml .= $c_bottom_main_sort_xml[$cmbkey];
135
+ }
136
+ $catalog_layout_xml .='
137
+ <action method="setData"><name>pagerlimitlist</name><value>'.$post_data['number_of_products_choice_steps'].'</value></action>
138
+ <action method="setData"><name>defaultlistperpage</name><value>'.$post_data['number_of_products_per_page'].'</value></action>
139
+ </block>';
140
+
141
+ $catalog_layout_xml .='</reference>';
142
+
143
+ return $catalog_layout_xml;
144
+ }
145
+
146
+
147
+ // function for generationg catalog search page layout xml
148
+ static public function generateCatalogSearchPageLayoutXML($post_data)
149
+ {
150
+ $themeSubSettings['c_pagelayoutmain'] = array();
151
+ $themeSubSettings['c_pagelayoutmain']['c_layout_breadcrumbs'] = 0;
152
+ $themeSubSettings['c_pagelayoutmain']['c_layout_toolbar'] = 0;
153
+ $themeSubSettings['c_pagelayoutmain']['c_layout_pag_top'] = 0;
154
+ if($post_data['c_layout_breadcrumbs'] > 0)
155
+ $themeSubSettings['c_pagelayoutmain']['c_layout_breadcrumbs'] = $post_data['c_layout_breadcrumbs'];
156
+ if($post_data['c_layout_toolbar'] > 0)
157
+ $themeSubSettings['c_pagelayoutmain']['c_layout_toolbar'] = $post_data['c_layout_toolbar'];
158
+ if($post_data['c_layout_pag_top'] > 0)
159
+ $themeSubSettings['c_pagelayoutmain']['c_layout_pag_top'] = $post_data['c_layout_pag_top'];
160
+
161
+ if(count($themeSubSettings['c_pagelayoutmain']) > 0){
162
+ asort($themeSubSettings['c_pagelayoutmain']);
163
+ }
164
+ $c_main_sort_xml = array();
165
+ if(!$post_data['show_breadcrumbs'] ||$post_data['show_breadcrumbs'] != '1'){
166
+ $c_main_sort_xml['c_layout_breadcrumbs'] = '<action method="setData"><name>showbreadcrumb</name><value>0</value></action>';
167
+ } else {
168
+ $c_main_sort_xml['c_layout_breadcrumbs'] = '<action method="setData"><name>showbreadcrumb</name><value>1</value></action><action method="setData"><name>breadcrumb</name><value>'. $themeSubSettings['c_pagelayoutmain']['c_layout_breadcrumbs'].'</value></action>';
169
+ }
170
+ // if(!$post_data['show_sortby_dropdown'] ||$post_data['show_sortby_dropdown'] != '1'){
171
+ // $c_main_sort_xml['c_layout_toolbar'] = '';
172
+ // } else {
173
+ // $c_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>sortbox</name><value>'.$themeSubSettings['c_pagelayoutmain']['c_layout_toolbar'].'</value></action>';
174
+ // }
175
+ $c_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>sortbox</name><value>'.$themeSubSettings['c_pagelayoutmain']['c_layout_toolbar'].'</value></action>';
176
+ if(!$post_data['show_pagination'] || $post_data['show_pagination'] == '2'){
177
+ $c_main_sort_xml['c_layout_pag_top'] = '';
178
+ } else {
179
+ $c_main_sort_xml['c_layout_pag_top'] = '<action method="setData"><name>pager</name><value>'.$themeSubSettings['c_pagelayoutmain']['c_layout_pag_top'].'</value></action>';
180
+ }
181
+ $themeSubSettings['c_bottom_pagelayoutmain'] = array();
182
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'] = 0;
183
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_pag_top'] = 0;
184
+ if($post_data['c_layout_toolbar'] > 0)
185
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'] = $post_data['c_layout_toolbar'];
186
+ if($post_data['c_layout_pag_top'] > 0)
187
+ $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_pag_top'] = $post_data['c_layout_pag_top'];
188
+
189
+ if(count($themeSubSettings['c_bottom_pagelayoutmain']) > 0){
190
+ asort($themeSubSettings['c_bottom_pagelayoutmain']);
191
+ }
192
+ $c_bottom_main_sort_xml = array();
193
+ // if(!$post_data['show_sortby_dropdown'] ||$post_data['show_sortby_dropdown'] != '1'){
194
+ // $c_bottom_main_sort_xml['c_layout_toolbar'] = '';
195
+ // } else {
196
+ // $c_bottom_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>sortbox</name><value>'.$themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'].'</value></action>';
197
+ // }
198
+ $c_bottom_main_sort_xml['c_layout_toolbar'] = '<action method="setData"><name>sortbox</name><value>'.$themeSubSettings['c_bottom_pagelayoutmain']['c_layout_toolbar'].'</value></action>';
199
+ if(!$post_data['show_pagination'] ||$post_data['show_pagination'] == '1'){
200
+ $c_bottom_main_sort_xml['c_layout_pag_top'] = '';
201
+ } else {
202
+ $c_bottom_main_sort_xml['c_layout_pag_top'] = '<action method="setData"><name>pager</name><value>'. $themeSubSettings['c_bottom_pagelayoutmain']['c_layout_pag_top'].'</value></action>';
203
+ }
204
+
205
+ $catalog_layout_xml = '';
206
+
207
+ $catalog_layout_xml .= '<remove name="newsletter"/><reference name="root">
208
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
209
+ <action method="unsetChild"><name>breadcrumbs</name></action>
210
+ </reference>';
211
+ $catalog_layout_xml .= '<reference name="left">
212
+ <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
213
+ </reference>';
214
+ $catalog_layout_xml .='<reference name="content">';
215
+
216
+ $catalog_layout_xml .= '
217
+ <block type="mobilenow/toolbar" name="custom_toolbar" template="catalog/product/list/customtoolbar.phtml">';
218
+ foreach($themeSubSettings['c_pagelayoutmain'] as $cmkey=>$cmvalue){
219
+ $catalog_layout_xml .= $c_main_sort_xml[$cmkey];
220
+ }
221
+
222
+ $catalog_layout_xml .='
223
+ <action method="setData"><name>pagerlimitlist</name><value>'.$post_data['number_of_products_choice_steps'].'</value></action>
224
+ <action method="setData"><name>defaultlistperpage</name><value>'.$post_data['number_of_products_per_page'].'</value></action>
225
+ </block>';
226
+
227
+ $themeSubSettings['c_listpagelayoutmain'] = array();
228
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_price'] = 0;
229
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_review'] = 0;
230
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_learn'] = 0;
231
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_addtocart'] = 0;
232
+ if($post_data['c_list_layout_product_price'] > 0)
233
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_price'] = $post_data['c_list_layout_product_price'];
234
+ if($post_data['c_list_layout_product_review'] > 0)
235
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_review'] = $post_data['c_list_layout_product_review'];
236
+ if($post_data['c_list_layout_product_learn'] > 0)
237
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_learn'] = $post_data['c_list_layout_product_learn'];
238
+ if($post_data['c_list_layout_product_addtocart'] > 0)
239
+ $themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_addtocart'] = $post_data['c_list_layout_product_addtocart'];
240
+ //
241
+ $c_list_sort_xml = array();
242
+ $c_list_sort_xml['c_list_layout_product_price'] = '<action method="setData"><name>price</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_price'].'</value></action>';
243
+ $c_list_sort_xml['c_list_layout_product_review'] = '<action method="setData"><name>ratings</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_review'].'</value></action>';
244
+ $c_list_sort_xml['c_list_layout_product_learn'] = '<action method="setData"><name>cart</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_learn'].'</value></action>';
245
+ $c_list_sort_xml['c_list_layout_product_addtocart'] = ' <action method="setData"><name>more</name><value>'.$themeSubSettings['c_listpagelayoutmain']['c_list_layout_product_addtocart'].'</value></action>';
246
+
247
+
248
+ $catalog_layout_xml .='
249
+ <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
250
+ <block type="catalog/product_list" name="search_result_list" template="catalog/product/mobilelist.phtml">';
251
+ if($post_data['show_review_stars'] && $post_data['show_review_stars'] == '1'){
252
+ $catalog_layout_xml .= '<action method="setData"><name>showstar</name><value>1</value></action>';
253
+ }
254
+ if($post_data['show_add_to_cart'] && $post_data['show_add_to_cart'] == '1'){
255
+ $catalog_layout_xml .= '<action method="setData"><name>showcartbtn</name><value>1</value></action>';
256
+ }
257
+ if($post_data['show_learn_more'] && $post_data['show_learn_more'] == '1'){
258
+ $catalog_layout_xml .= '<action method="setData"><name>showlernmore</name><value>1</value></action>';
259
+ }
260
+
261
+ foreach($c_list_sort_xml as $c_listkey=>$c_listvalue){
262
+ $catalog_layout_xml .= $c_listvalue;
263
+ }
264
+
265
+ $catalog_layout_xml .= '
266
+ <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
267
+ <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
268
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
269
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
270
+ <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
271
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
272
+ </block>
273
+ <action method="setListOrders"/>
274
+ <action method="setListModes"/>
275
+ <action method="setListCollection"/>
276
+ </block>
277
+ ';
278
+
279
+ $catalog_layout_xml .= '<block type="mobilenow/toolbar" name="custom_toolbar_bottom" template="catalog/product/list/customtoolbar.phtml">';
280
+ foreach($themeSubSettings['c_bottom_pagelayoutmain'] as $cmbkey=>$cmbvalue){
281
+ $catalog_layout_xml .= $c_bottom_main_sort_xml[$cmbkey];
282
+ }
283
+ $catalog_layout_xml .='
284
+ <action method="setData"><name>pagerlimitlist</name><value>'.$post_data['number_of_products_choice_steps'].'</value></action>
285
+ <action method="setData"><name>defaultlistperpage</name><value>'.$post_data['number_of_products_per_page'].'</value></action>
286
+ </block>';
287
+
288
+ $catalog_layout_xml .='</reference>';
289
+
290
+ return $catalog_layout_xml;
291
+ }
292
+
293
+ }
294
+
app/code/community/Redstage/Mobilenow/Helper/Cms/Page.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Helper_Cms_Page extends Mage_Cms_Helper_Page
4
+ {
5
+
6
+ public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId = null)
7
+ {
8
+ return $this->_renderPage($action, $pageId);
9
+ }
10
+
11
+ /**
12
+ * Renders CMS page
13
+ *
14
+ * @param Mage_Core_Controller_Front_Action $action
15
+ * @param integer $pageId
16
+ * @param bool $renderLayout
17
+ * @return boolean
18
+ */
19
+ protected function _renderPage(Mage_Core_Controller_Varien_Action $action, $pageId = null, $renderLayout = true)
20
+ {
21
+
22
+ $page = Mage::getSingleton('cms/page');
23
+ if (!is_null($pageId) && $pageId!==$page->getId()) {
24
+ $delimeterPosition = strrpos($pageId, '|');
25
+ if ($delimeterPosition) {
26
+ $pageId = substr($pageId, 0, $delimeterPosition);
27
+ }
28
+
29
+ $page->setStoreId(Mage::app()->getStore()->getId());
30
+ if (!$page->load($pageId)) {
31
+ return false;
32
+ }
33
+ }
34
+
35
+ if (!$page->getId()) {
36
+ return false;
37
+ }
38
+
39
+ $inRange = Mage::app()->getLocale()
40
+ ->isStoreDateInInterval(null, $page->getCustomThemeFrom(), $page->getCustomThemeTo());
41
+
42
+ if(!Mage::getSingleton('core/session')->getMobileNowId()){
43
+ if ($page->getCustomTheme()) {
44
+ if ($inRange) {
45
+ list($package, $theme) = explode('/', $page->getCustomTheme());
46
+ Mage::getSingleton('core/design_package')
47
+ ->setPackageName($package)
48
+ ->setTheme($theme);
49
+ }
50
+ }
51
+ }
52
+
53
+ $action->getLayout()->getUpdate()
54
+ ->addHandle('default')
55
+ ->addHandle('cms_page');
56
+
57
+ $action->addActionLayoutHandles();
58
+ $package = Mage::getSingleton('core/design_package')->getPackageName();
59
+
60
+ if ($page->getRootTemplate() && $package!='redstage-mobilenow') {
61
+ $handle = ($page->getCustomRootTemplate()
62
+ && $page->getCustomRootTemplate() != 'empty'
63
+ && $inRange) ? $page->getCustomRootTemplate() : $page->getRootTemplate();
64
+ $action->getLayout()->helper('page/layout')->applyHandle($handle);
65
+ }
66
+
67
+ Mage::dispatchEvent('cms_page_render', array('page' => $page, 'controller_action' => $action));
68
+
69
+ $action->loadLayoutUpdates();
70
+ $layoutUpdate = ($page->getCustomLayoutUpdateXml() && $inRange)
71
+ ? $page->getCustomLayoutUpdateXml() : $page->getLayoutUpdateXml();
72
+ $action->getLayout()->getUpdate()->addUpdate($layoutUpdate);
73
+ $action->generateLayoutXml()->generateLayoutBlocks();
74
+
75
+ $contentHeadingBlock = $action->getLayout()->getBlock('page_content_heading');
76
+ if ($contentHeadingBlock) {
77
+ $contentHeading = $this->escapeHtml($page->getContentHeading());
78
+ $contentHeadingBlock->setContentHeading($contentHeading);
79
+ }
80
+
81
+ if ($page->getRootTemplate() && $package!='redstage-mobilenow') {
82
+ $action->getLayout()->helper('page/layout')
83
+ ->applyTemplate($page->getRootTemplate());
84
+ }
85
+
86
+ /* @TODO: Move catalog and checkout storage types to appropriate modules */
87
+ $messageBlock = $action->getLayout()->getMessagesBlock();
88
+ foreach (array('catalog/session', 'checkout/session', 'customer/session') as $storageType) {
89
+ $storage = Mage::getSingleton($storageType);
90
+ if ($storage) {
91
+ $messageBlock->addStorageType($storageType);
92
+ $messageBlock->addMessages($storage->getMessages(true));
93
+ }
94
+ }
95
+
96
+ if ($renderLayout) {
97
+ $action->renderLayout();
98
+ }
99
+
100
+ return true;
101
+ }
102
+
103
+
104
+ }
app/code/community/Redstage/Mobilenow/Helper/Data.php ADDED
@@ -0,0 +1,603 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ static public function getOptionArrayMobileDevice()
5
+ {
6
+ $data_array=array();
7
+ $data_array['']='Please select Device Type';
8
+ $data_array[1]='iPhone';
9
+ return($data_array);
10
+ }
11
+ static public function getGridOptionArrayMobileDevice()
12
+ {
13
+ $data_array=array();
14
+ $data_array[1]='iPhone';
15
+ return($data_array);
16
+ }
17
+ static public function getValueArrayMobileDevice()
18
+ {
19
+ $data_array=array();
20
+ foreach(Redstage_Mobilenow_Helper_Data::getOptionArrayMobileDevice() as $k=>$v)
21
+ {
22
+ $data_array[]=array('value'=>$k,'label'=>$v);
23
+ }
24
+ return($data_array);
25
+ }
26
+ static public function getOptionArrayUserAgent()
27
+ {
28
+ $data_array=array();
29
+ $data_array[0]='ALL';
30
+ $data_array[1]='iPhone';
31
+ $data_array[2]='iPod';
32
+ $data_array[3]='BlackBerry';
33
+ $data_array[4]='Palm';
34
+ $data_array[5]='Googlebot-Mobile';
35
+ $data_array[6]='mobi';
36
+ $data_array[7]='Safari Mobile';
37
+ $data_array[8]='Windows Mobile';
38
+ $data_array[9]='Android';
39
+ $data_array[10]='Mini';
40
+ $data_array[11]='mobile';
41
+ $data_array[12]='Nokia';
42
+ $data_array[13]='SymbianOS';
43
+ $data_array[14]='iPad';
44
+ $data_array[15]='Silk';
45
+ $data_array[16]='Kindle';
46
+ $data_array[17]='Xoom';
47
+ $data_array[18]='SCH-I800';
48
+ $data_array[19]='Tablet';
49
+ return($data_array);
50
+ }
51
+ static public function getValueArrayUserAgent()
52
+ {
53
+ $data_array=array();
54
+ foreach(Redstage_Mobilenow_Helper_Data::getOptionArrayUserAgent() as $k=>$v)
55
+ {
56
+ $data_array[]=array('value'=>$k,'label'=>$v);
57
+ }
58
+ return($data_array);
59
+ }
60
+ static public function getOptionArrayStatus()
61
+ {
62
+ $data_array=array();
63
+ $data_array[1]='Active';
64
+ $data_array[0]='Inactive';
65
+ return($data_array);
66
+ }
67
+ static public function getValueArrayStatus()
68
+ {
69
+ $data_array=array();
70
+ foreach(Redstage_Mobilenow_Helper_Data::getOptionArrayStatus() as $k=>$v)
71
+ {
72
+ $data_array[]=array('value'=>$k,'label'=>$v);
73
+ }
74
+ return($data_array);
75
+ }
76
+ public function getSubsettings()
77
+ {
78
+ $getAllSubSettings=Mage::getModel("mobilenow/themesubsettings")->getCollection();
79
+ foreach($getAllSubSettings as $getAllSubSetting)
80
+ {
81
+ if($getAllSubSetting->getSubsetname()!='')
82
+ $data_array[$getAllSubSetting->getID()]=$getAllSubSetting->getSubsetname();
83
+ }
84
+ return($data_array);
85
+ }
86
+ public function processThemeDesignFormData($post_data,$button_type = '',$lastRecordId,$createnewThemeFlag,$preview = '0')
87
+ {
88
+ if($preview == '1'){
89
+ $themeSubSettings['css_filename'] = md5($lastRecordId.'_preview').'.css';
90
+ }else {
91
+ $themeSubSettings['css_filename'] = md5($lastRecordId).'.css';
92
+ }
93
+ //echo '<pre>'; print_r($post_data); echo '</pre>';
94
+ if($lastRecordId)
95
+ {
96
+ if('saveas_subset' != $button_type){
97
+ if($createnewThemeFlag)
98
+ {
99
+ $themeSubSettings['themeid']='';
100
+ $themeSubSettings['subsetname']=$post_data['hidden_theme_sub_setting_name'];
101
+ }
102
+ else
103
+ {
104
+ $themeSubSettings['themeid']=$lastRecordId;
105
+ $themeSubSettings['subsetname']='';
106
+ }
107
+ }else{
108
+ $themeSubSettings['subsetname']=$post_data['hidden_theme_sub_setting_name'];
109
+ $themeSubSettings['themeid']='';
110
+ }
111
+ }
112
+ else
113
+ {
114
+ $themeSubSettings['subsetname']=$post_data['hidden_theme_sub_setting_name'];
115
+ $themeSubSettings['themeid']='';
116
+ }
117
+ if($preview == '0'){
118
+ //Logo
119
+ // if($_FILES['logo']['name']!=''){ $themeSubSettings['logo']=time().$_FILES['logo']['name'];}//else{$themeSubSettings['logo']='';}
120
+ // if(trim($themeSubSettings['logo'])!='')
121
+ // {
122
+ // $path = Mage::getBaseDir('media').DS.'mobilenow_theme_images'.DS.'logo'.DS;
123
+ // $uploader = new Varien_File_Uploader('logo');
124
+ // $uploader->setAllowedExtensions(array('jpg','jpeg','png','gif'));
125
+ // $uploader->setAllowCreateFolders(true);
126
+ // $uploader->setAllowRenameFiles(false);
127
+ // $uploader->setFilesDispersion(false);
128
+ // $uploader->save($path,$themeSubSettings['logo']);
129
+ // if($post_data['logo_fielname'] != ''){
130
+ // @unlink($path.$post_data['logo_fielname']);
131
+ // }
132
+ // }
133
+ //var_dump($post_data['logo_preview_filename']);die;
134
+ if($post_data['logo_preview_filename'] != ''){
135
+ $themeSubSettings['logo'] = $post_data['logo_preview_filename'];
136
+ if($lastRecordId){
137
+ $path = Mage::getBaseDir('media').DS.'mobilenow_theme_images'.DS.'logo';
138
+ $newfile = $path.DS.$post_data['logo_preview_filename'];
139
+ $file = $path.DS.'preview'.DS.$lastRecordId.DS.$post_data['logo_preview_filename'];
140
+ //var_dump($post_data['logo_fielname']);var_dump($newfile);die;
141
+ if (copy($file, $newfile)) {
142
+ if($post_data['logo_fielname'] != ''){
143
+ //@unlink($path.DS.$post_data['logo_fielname']);
144
+ }
145
+ //rmdir($path.DS.'preview'.DS.$lastRecordId);die;
146
+ $new_path = $path.DS.'preview'.DS.$lastRecordId;
147
+ //$this->remove_dir($new_path);
148
+ }
149
+ }
150
+ } else if($post_data['logo_fielname'] != ''){
151
+ $themeSubSettings['logo'] = $post_data['logo_fielname'];
152
+ }
153
+ } else {
154
+ if($post_data['logo_preview_filename'] != ''){
155
+ $themeSubSettings['logo'] ='preview'.DS.$lastRecordId.DS.$post_data['logo_preview_filename'];
156
+ } else if($post_data['logo_fielname'] != ''){
157
+ $themeSubSettings['logo'] = $post_data['logo_fielname'];
158
+ }
159
+ }
160
+ //Body background color
161
+ $themeSubSettings['bgcolor']=$post_data['background_color'];
162
+ //Links
163
+ $homeSearchCartArr=array('header_link_home'=>$post_data['header_link_home'], 'header_link_home_name'=>$post_data['header_link_home_name'],
164
+ 'footer_link_home'=>$post_data['footer_link_home'], 'footer_link_home_name'=>$post_data['footer_link_home_name'],
165
+ 'header_link_login'=>$post_data['header_link_login'], 'header_link_login_name'=>$post_data['header_link_login_name'],
166
+ 'footer_link_login'=>$post_data['footer_link_login'], 'footer_link_login_name'=>$post_data['footer_link_login_name'],
167
+ 'header_link_myaccount'=>$post_data['header_link_myaccount'], 'header_link_myaccount_name'=>$post_data['header_link_myaccount_name'],
168
+ 'footer_link_myaccount'=>$post_data['footer_link_myaccount'], 'footer_link_myaccount_name'=>$post_data['footer_link_myaccount_name'],
169
+ 'header_link_wishlist'=>$post_data['header_link_wishlist'], 'header_link_wishlist_name'=>$post_data['header_link_wishlist_name'],
170
+ 'footer_link_wishlist'=>$post_data['footer_link_wishlist'], 'footer_link_wishlist_name'=>$post_data['footer_link_wishlist_name'],
171
+ 'links_color'=>$post_data['links_color']);
172
+ $themeSubSettings['links']= json_encode($homeSearchCartArr);
173
+ //Text Color
174
+ $themeSubSettings['textcolor']= $post_data['text_color'];
175
+ //Search / Cart Area
176
+ $themeSubSettings['searchcart']= json_encode(array('show_search_cart_area'=>$post_data['show_search_cart_area'],'search_cart_bg_color'=>$post_data['search_cart_bg_color'],'cart_link_color'=>$post_data['cart_link_color']));
177
+ //Homepage Banner
178
+ if($preview == '0'){
179
+ // if($_FILES['homepage_banner']['name']!=''){ $homePageBannerImage=time().$_FILES['homepage_banner']['name'];}else{$homePageBannerImage='';}
180
+ // $homePageBannerarr=array('show_home_page_banner'=>$post_data['show_home_page_banner'],
181
+ // 'homepage_banner'=>$homePageBannerImage,
182
+ // 'homepage_banner_url'=>$post_data['homepage_banner_url']);
183
+ // if(trim($homePageBannerImage)!=''){
184
+ // $path = Mage::getBaseDir('media').DS.'mobilenow_theme_images'.DS.'banner'.DS;
185
+ // $uploader = new Varien_File_Uploader('homepage_banner');
186
+ // $uploader->setAllowedExtensions(array('jpg','jpeg','png','gif'));
187
+ // $uploader->setAllowCreateFolders(true);
188
+ // $uploader->setAllowRenameFiles(false);
189
+ // $uploader->setFilesDispersion(false);
190
+ // $uploader->save($path,$homePageBannerImage);
191
+ // if($post_data['banner_fielname'] != ''){
192
+ // @unlink($path.$post_data['banner_fielname']);
193
+ // }
194
+ // }else{
195
+ // if($post_data['banner_fielname'] != ''){
196
+ // $homePageBannerarr['homepage_banner'] = $post_data['banner_fielname'];
197
+ // }
198
+ // }
199
+
200
+ $homePageBannerImage = '';
201
+ if($post_data['banner_preview_filename'] != ''){
202
+ $homePageBannerImage = $post_data['banner_preview_filename'];
203
+ if($lastRecordId){
204
+ $path = Mage::getBaseDir('media').DS.'mobilenow_theme_images'.DS.'banner';
205
+ $newfile = $path.DS.$post_data['banner_preview_filename'];
206
+ $file = $path.DS.'preview'.DS.$lastRecordId.DS.$post_data['banner_preview_filename'];
207
+ //var_dump($post_data['logo_fielname']);var_dump($newfile);die;
208
+ if (copy($file, $newfile)) {
209
+ if($post_data['banner_fielname'] != ''){
210
+ //@unlink($path.DS.$post_data['banner_fielname']);
211
+ }
212
+ //rmdir($path.DS.'preview'.DS.$lastRecordId);die;
213
+ $new_path = $path.DS.'preview'.DS.$lastRecordId;
214
+ //$this->remove_dir($new_path);
215
+ }
216
+ }
217
+ } else {
218
+ $homePageBannerImage = $post_data['banner_fielname'];
219
+ }
220
+ $homePageBannerarr=array('show_home_page_banner'=>$post_data['show_home_page_banner'],
221
+ 'homepage_banner'=>$homePageBannerImage,
222
+ 'homepage_banner_url'=>$post_data['homepage_banner_url']);
223
+ } else{
224
+ $homePageBannerImage = '';
225
+ if($post_data['banner_preview_filename'] != ''){
226
+ $homePageBannerImage = 'preview'.DS.$lastRecordId.DS.$post_data['banner_preview_filename'];
227
+ } else {
228
+ $homePageBannerImage = $post_data['banner_fielname'];
229
+ }
230
+ $homePageBannerarr=array('show_home_page_banner'=>$post_data['show_home_page_banner'],
231
+ 'homepage_banner'=>$homePageBannerImage,
232
+ 'homepage_banner_url'=>$post_data['homepage_banner_url']);
233
+ }
234
+
235
+ $themeSubSettings['homepagebanner']=json_encode($homePageBannerarr);
236
+ //SubHeader Section
237
+ $themeSubSettings['subheadersection']=$post_data['subheader_section'];
238
+ //Categories
239
+ $themeSubSettings['categories']=json_encode(array('categories'=>$post_data['categories'],'categories_background_color'=>$post_data['categories_background_color']));
240
+ //Newsletter
241
+ $themeSubSettings['newsletter']= json_encode(array('show_newsletter'=>$post_data['show_newsletter'],'newsletter_area_backgorund'=>$post_data['newsletter_area_backgorund']));
242
+ //Home page custom code
243
+ $themeSubSettings['homepagecustomcode']=$post_data['homepage_custom_code'];
244
+ //Pre footer section
245
+ $themeSubSettings['prefootersection']=$post_data['pre_footer_section'];
246
+ //Footer section
247
+ $themeSubSettings['footersection']=$post_data['footer_section'];
248
+ //Default Buttons Color Settings
249
+ $themeSubSettings['buttoncolor']=json_encode(array('button_background_color'=>$post_data['button_background_color'],'button_text_color'=>$post_data['button_text_color'],'button_border_color'=>$post_data['button_border_color']));
250
+ /////////////////////Catalog Page settings
251
+ //Breadcrumbs
252
+ $themeSubSettings['breadcrumb']= json_encode(array('show_breadcrumbs'=>$post_data['show_breadcrumbs'],'breadcrumbs_bg_color'=>$post_data['breadcrumbs_bg_color'],'breadcrumbs_font_color'=>$post_data['breadcrumbs_font_color']));
253
+ //Catalog View
254
+ //$themeSubSettings['catalogview']= json_encode(array('default_catalog_view'=>$post_data['default_catalog_view'],'show_grid_list_choice'=>$post_data['show_grid_list_choice']));
255
+ //Number of Products Per Page
256
+ $themeSubSettings['numberofproductsperpage']=$post_data['number_of_products_per_page'];
257
+ //Number of Products Choice Steps
258
+ $themeSubSettings['numberofproductschoice']=$post_data['number_of_products_choice_steps'];
259
+ //Sort By
260
+ $themeSubSettings['catalogsortby']=json_encode(array('show_sortby_dropdown'=>$post_data['show_sortby_dropdown'],'sort_options'=>implode(',',$post_data['sort_options'])));
261
+ //Toolbar
262
+ $themeSubSettings['toolbarcolor']=json_encode(array('toolbar_bg_color'=>$post_data['toolbar_bg_color'],'toolbar_text_color'=>$post_data['toolbar_text_color']));
263
+ //Pagination
264
+ $themeSubSettings['pagination']=json_encode(array('show_pagination'=>$post_data['show_pagination'],'pagination_bg_color'=>$post_data['pagination_bg_color'],'pagination_button_bg_color'=>$post_data['pagination_button_bg_color'],'pagination_button_text_color'=>$post_data['pagination_button_text_color']));
265
+ //Image Border
266
+ $themeSubSettings['catalogimagedetails']=json_encode(array('show_image_border'=>$post_data['show_image_border'],'image_border_color'=>$post_data['image_border_color'],'catalog_image_width'=>$post_data['catalog_image_width']));
267
+ //Product color
268
+ $themeSubSettings['catalogproductcolor']=json_encode(array('product_title_color'=>$post_data['product_title_color'],'product_price_color'=>$post_data['product_price_color'],'product_special_price_color'=>$post_data['product_special_price_color']));
269
+ //Reviews
270
+ $themeSubSettings['catalogreviews']=json_encode(array('show_review_stars'=>$post_data['show_review_stars'],'review_star_color'=>$post_data['review_star_color']));
271
+ //Learn more link
272
+ $themeSubSettings['cataloglearnmore']=$post_data['show_learn_more'];
273
+ //Add To Cart Button
274
+ $themeSubSettings['catalogaddtocart']=json_encode(array('show_add_to_cart'=>$post_data['show_add_to_cart'],'add_to_cart_button_bg_color'=>$post_data['add_to_cart_button_bg_color'],'add_to_cart_button_font_color'=>$post_data['add_to_cart_button_font_color'],'add_to_cart_button_border_color'=>$post_data['add_to_cart_button_border_color']));
275
+ //Show gridlines
276
+ $themeSubSettings['cataloggridlines']=json_encode(array('show_gridlines'=>$post_data['show_gridlines'],'gridlines_color'=>$post_data['gridlines_color']));
277
+ //////////product Page///////////
278
+ //Product title color
279
+ $themeSubSettings['producttitlecolor']=$post_data['productpage_title_color'];
280
+ //Image border
281
+ $themeSubSettings['productimagedetails']=json_encode(array('show_product_image_border'=>$post_data['show_product_image_border'],'product_image_border_color'=>$post_data['product_image_border_color'],'product_image_width'=>$post_data['product_image_width']));
282
+ //Show other details
283
+ $themeSubSettings['showproductdeails']=json_encode(array('show_product_availability'=>$post_data['show_product_availability'],
284
+ 'show_product_wishlist_link'=>$post_data['show_product_wishlist_link'],
285
+ 'show_product_reviews_summary'=>$post_data['show_product_reviews_summary'],
286
+ 'show_product_description'=>$post_data['show_product_description'],
287
+ 'product_description_color'=>$post_data['product_description_color'],
288
+ 'show_product_additional_information'=>$post_data['show_product_additional_information'],
289
+ 'additional_information_bg_color'=>$post_data['additional_information_bg_color'],
290
+ 'additional_information_font_color'=>$post_data['additional_information_font_color'],
291
+ 'show_full_reviews_on_product_page'=>$post_data['show_full_reviews_on_product_page'],
292
+ 'full_reviews_bg_color'=>$post_data['full_reviews_bg_color'],
293
+ 'full_reviews_font_color'=>$post_data['full_reviews_font_color'],
294
+ 'show_related_products'=>$post_data['show_related_products'],
295
+ ));
296
+
297
+ //saving homepage layout settings
298
+ $themeSubSettings['homepagelayoutmain']=json_encode(array('h_layout_search_cart'=>$post_data['h_layout_search_cart'],
299
+ 'h_layout_sub_header'=>$post_data['h_layout_sub_header'],
300
+ 'h_layout_banner'=>$post_data['h_layout_banner'],
301
+ 'h_layout_feature'=>$post_data['h_layout_feature'],
302
+ 'h_layout_categories'=>$post_data['h_layout_categories'],
303
+ 'h_layout_news_signup'=>$post_data['h_layout_news_signup']
304
+ ));
305
+
306
+ //saving catalog main layout settings
307
+ $themeSubSettings['cataloglayoutmain']=json_encode(array('c_layout_breadcrumbs'=>$post_data['c_layout_breadcrumbs'],
308
+ 'c_layout_toolbar'=>$post_data['c_layout_toolbar'],
309
+ 'c_layout_pag_top'=>$post_data['c_layout_pag_top']
310
+ ));
311
+
312
+
313
+ //saving catalog grid layout settings
314
+ // $themeSubSettings['cataloglayoutgrid']=json_encode(array('c_grid_layout_product_image'=>$post_data['c_grid_layout_product_image'],
315
+ // 'c_grid_layout_product_title'=>$post_data['c_grid_layout_product_title'],
316
+ // 'c_grid_layout_product_price'=>$post_data['c_grid_layout_product_price'],
317
+ // 'c_grid_layout_product_review'=>$post_data['c_grid_layout_product_review'],
318
+ // 'c_grid_layout_product_learn'=>$post_data['c_grid_layout_product_learn'],
319
+ // 'c_grid_layout_product_addtocart'=>$post_data['c_grid_layout_product_addtocart']
320
+ // ));
321
+
322
+ //saving catalog list layout settings
323
+ $themeSubSettings['cataloglayoutlist']=json_encode(array('c_list_layout_product_image'=>$post_data['c_list_layout_product_image'],
324
+ 'c_list_layout_product_title'=>$post_data['c_list_layout_product_title'],
325
+ 'c_list_layout_product_price'=>$post_data['c_list_layout_product_price'],
326
+ 'c_list_layout_product_review'=>$post_data['c_list_layout_product_review'],
327
+ 'c_list_layout_product_learn'=>$post_data['c_list_layout_product_learn'],
328
+ 'c_list_layout_product_addtocart'=>$post_data['c_list_layout_product_addtocart']
329
+ ));
330
+
331
+ //saving product page layout settings
332
+ $themeSubSettings['productlayoutmain']=json_encode(array('ptop_layout_settings'=>array('p_layout_availability'=>$post_data['p_layout_availability'],
333
+ 'p_layout_pricing'=>$post_data['p_layout_pricing'],
334
+ 'p_layout_addtocart'=>$post_data['p_layout_addtocart'],
335
+ 'p_layout_wishlist'=>$post_data['p_layout_wishlist'],
336
+ 'p_layout_review'=>$post_data['p_layout_review']),
337
+ 'pbottom_layout_settings'=>array('p_layout_desc'=>$post_data['p_layout_desc'],
338
+ 'p_layout_additionalinfo'=>$post_data['p_layout_additionalinfo'],
339
+ 'p_layout_fullreview'=>$post_data['p_layout_fullreview'],
340
+ 'p_layout_relatedproduct'=>$post_data['p_layout_relatedproduct'])
341
+ ));
342
+
343
+ return $themeSubSettings;
344
+ }
345
+ public function setDesignAndLayoutFormData($subsettingsModel,$getSubsetDefaultId,$subsetParentId)
346
+ {
347
+ /*Condition that checks if a theme has a subset assigned and it's present, assigns the Parent value as preset
348
+ dropdown value*/
349
+ if($subsetParentId!='')$getSubsetDefaultId=$subsetParentId;
350
+ else $getSubsetDefaultId=$getSubsetDefaultId;
351
+ //Background Color
352
+ //Links
353
+ $decodeLinksData=json_decode($subsettingsModel->getLinks());
354
+ //Search / Cart
355
+ $decodeSearchCartData=json_decode($subsettingsModel->getSearchcart());
356
+ //Home Page Banner
357
+ $decodeHomeBannerData=json_decode($subsettingsModel->getHomepagebanner());
358
+ //SubHeader Section
359
+ $subsettingsModel->setData('subheader_section', $subsettingsModel->getSubheadersection());
360
+ //Categories
361
+ $decodeCategoryData=json_decode($subsettingsModel->getCategories());
362
+ //Newsletter
363
+ $decodeNewsletterData=json_decode($subsettingsModel->getNewsletter());
364
+ //Homepage Custom Code
365
+ //Pre-Footer Section
366
+ //Footer Section
367
+ // Buttons Color
368
+ $decodeButtonData=json_decode($subsettingsModel->getButtoncolor());
369
+ /////////////////////Catalog Page///////////////////////////
370
+ //Breadcrumbs
371
+ $decodeBreadcrumbData=json_decode($subsettingsModel->getBreadcrumb());
372
+ //Catalog view
373
+ $decodeCatalogviewbData=json_decode($subsettingsModel->getCatalogview());
374
+ //Number of Products Per Page (default) ALL = Show All
375
+ // Sort By
376
+ $decodeCatalogsortbybData=json_decode($subsettingsModel->getCatalogsortby());
377
+ //Toolbar
378
+ $decodeToolbarData=json_decode($subsettingsModel->getToolbarcolor());
379
+ //Pagination
380
+ $decodePaginationData=json_decode($subsettingsModel->getPagination());
381
+ //Image Border
382
+ $decodeImageborderData=json_decode($subsettingsModel->getCatalogimagedetails());
383
+ //Product Color
384
+ $decodeProductColorData=json_decode($subsettingsModel->getCatalogproductcolor());
385
+ //Review Stars
386
+ $decodeReviewstarsData=json_decode($subsettingsModel->getCatalogreviews());
387
+ //Learnmore
388
+ //Add to cart
389
+ $decodeAddtocartData=json_decode($subsettingsModel->getCatalogaddtocart());
390
+ //Gridlines
391
+ $decodeGridlinesData=json_decode($subsettingsModel->getCataloggridlines());
392
+ /////////////////////Product Page///////////////////////////
393
+ //Product Title
394
+ //Imageborder
395
+ $decodeProductImageborderData=json_decode($subsettingsModel->getProductimagedetails());
396
+ //Show
397
+ $decodeProductShowData=json_decode($subsettingsModel->getShowproductdeails());
398
+ //echo '<pre>'; print_r($subsettingsModel->getShowproductdeails()); echo '</pre>';exit;
399
+ //Homepage Layout
400
+ $hLayoutData = json_decode($subsettingsModel->getHomepagelayoutmain());
401
+ //Catalog Layout main
402
+ $cLayoutData = json_decode($subsettingsModel->getCataloglayoutmain());
403
+ //Catalog grid layout
404
+ $cLayoutGridData = json_decode($subsettingsModel->getCataloglayoutgrid());
405
+ //Catalog grid layout
406
+ $cLayoutListData = json_decode($subsettingsModel->getCataloglayoutlist());
407
+ //Product page
408
+ $pLayoutData = json_decode($subsettingsModel->getProductlayoutmain());
409
+
410
+ //var_dump($hLayoutData->h_layout_search_cart);
411
+ $subsettingsModel->setData('preset_sub_settings', $getSubsetDefaultId)
412
+ ->setData('background_color', $subsettingsModel->getBgcolor())
413
+ ->setData('logo_fielname', $subsettingsModel->logo)
414
+ ->setData('header_link_home', $decodeLinksData->header_link_home)
415
+ ->setData('header_link_home_name', $decodeLinksData->header_link_home_name)
416
+ ->setData('footer_link_home', $decodeLinksData->footer_link_home)
417
+ ->setData('footer_link_home_name', $decodeLinksData->footer_link_home_name)
418
+ ->setData('header_link_login', $decodeLinksData->header_link_login)
419
+ ->setData('header_link_login_name', $decodeLinksData->header_link_login_name)
420
+ ->setData('footer_link_login', $decodeLinksData->footer_link_login)
421
+ ->setData('footer_link_login_name', $decodeLinksData->footer_link_login_name)
422
+ ->setData('header_link_myaccount', $decodeLinksData->header_link_myaccount)
423
+ ->setData('header_link_myaccount_name', $decodeLinksData->header_link_myaccount_name)
424
+ ->setData('footer_link_myaccount', $decodeLinksData->footer_link_myaccount)
425
+ ->setData('footer_link_myaccount_name', $decodeLinksData->footer_link_myaccount_name)
426
+ ->setData('header_link_wishlist', $decodeLinksData->header_link_wishlist)
427
+ ->setData('header_link_wishlist_name', $decodeLinksData->header_link_wishlist_name)
428
+ ->setData('footer_link_wishlist', $decodeLinksData->footer_link_wishlist)
429
+ ->setData('footer_link_wishlist_name', $decodeLinksData->footer_link_wishlist_name)
430
+ ->setData('links_color', $decodeLinksData->links_color)
431
+ ->setData('text_color', $subsettingsModel->getTextcolor())
432
+ ->setData('show_search_cart_area', $decodeSearchCartData->show_search_cart_area)
433
+ ->setData('search_cart_bg_color', $decodeSearchCartData->search_cart_bg_color)
434
+ ->setData('cart_link_color', $decodeSearchCartData->cart_link_color)
435
+ ->setData('show_home_page_banner', $decodeHomeBannerData->show_home_page_banner)
436
+ ->setData('banner_fielname', $decodeHomeBannerData->homepage_banner)
437
+ ->setData('homepage_banner_url', $decodeHomeBannerData->homepage_banner_url)
438
+ ->setData('categories1', $decodeCategoryData->categories)
439
+ ->setData('categories2', $decodeCategoryData->categories)
440
+ ->setData('categories_background_color', $decodeCategoryData->categories_background_color)
441
+ ->setData('show_newsletter', $decodeNewsletterData->show_newsletter)
442
+ ->setData('newsletter_area_backgorund', $decodeNewsletterData->newsletter_area_backgorund)
443
+ ->setData('homepage_custom_code', $subsettingsModel->getHomepagecustomcode())
444
+ ->setData('pre_footer_section', $subsettingsModel->getPrefootersection())
445
+ ->setData('footer_section', $subsettingsModel->getFootersection())
446
+ ->setData('button_background_color', $decodeButtonData->button_background_color)
447
+ ->setData('button_text_color', $decodeButtonData->button_text_color)
448
+ ->setData('button_border_color', $decodeButtonData->button_border_color)
449
+ ->setData('show_breadcrumbs', $decodeBreadcrumbData->show_breadcrumbs)
450
+ ->setData('breadcrumbs_bg_color', $decodeBreadcrumbData->breadcrumbs_bg_color)
451
+ ->setData('breadcrumbs_font_color', $decodeBreadcrumbData->breadcrumbs_font_color)
452
+ //->setData('default_catalog_view', $decodeCatalogviewbData->default_catalog_view)
453
+ //->setData('show_grid_list_choice', $decodeCatalogviewbData->show_grid_list_choice)
454
+ ->setData('number_of_products_per_page', $subsettingsModel->getNumberofproductsperpage())
455
+ ->setData('number_of_products_choice_steps', $subsettingsModel->getNumberofproductschoice())
456
+ ->setData('show_sortby_dropdown', $decodeCatalogsortbybData->show_sortby_dropdown)
457
+ ->setData('sort_options', explode(',',$decodeCatalogsortbybData->sort_options))
458
+ ->setData('toolbar_bg_color', $decodeToolbarData->toolbar_bg_color)
459
+ ->setData('toolbar_text_color', $decodeToolbarData->toolbar_text_color)
460
+ ->setData('show_pagination', $decodePaginationData->show_pagination)
461
+ ->setData('pagination_bg_color', $decodePaginationData->pagination_bg_color)
462
+ ->setData('pagination_button_bg_color', $decodePaginationData->pagination_button_bg_color)
463
+ ->setData('pagination_button_text_color', $decodePaginationData->pagination_button_text_color)
464
+ ->setData('show_image_border', $decodeImageborderData->show_image_border)
465
+ ->setData('image_border_color', $decodeImageborderData->image_border_color)
466
+ ->setData('catalog_image_width', $decodeImageborderData->catalog_image_width)
467
+ ->setData('product_title_color', $decodeProductColorData->product_title_color)
468
+ ->setData('product_price_color', $decodeProductColorData->product_price_color)
469
+ ->setData('product_special_price_color', $decodeProductColorData->product_special_price_color)
470
+ ->setData('show_review_stars', $decodeReviewstarsData->show_review_stars)
471
+ ->setData('review_star_color', $decodeReviewstarsData->review_star_color)
472
+ ->setData('show_learn_more', $subsettingsModel->getCataloglearnmore())
473
+ ->setData('show_add_to_cart', $decodeAddtocartData->show_add_to_cart)
474
+ ->setData('add_to_cart_button_bg_color', $decodeAddtocartData->add_to_cart_button_bg_color)
475
+ ->setData('add_to_cart_button_font_color', $decodeAddtocartData->add_to_cart_button_font_color)
476
+ ->setData('add_to_cart_button_border_color', $decodeAddtocartData->add_to_cart_button_border_color)
477
+ ->setData('show_gridlines', $decodeGridlinesData->show_gridlines)
478
+ ->setData('gridlines_color', $decodeGridlinesData->gridlines_color)
479
+ ->setData('productpage_title_color', $subsettingsModel->getProducttitlecolor())
480
+ ->setData('show_product_image_border', $decodeProductImageborderData->show_product_image_border)
481
+ ->setData('product_image_border_color', $decodeProductImageborderData->product_image_border_color)
482
+ ->setData('product_image_width', $decodeProductImageborderData->product_image_width)
483
+ ->setData('show_product_availability', $decodeProductShowData->show_product_availability)
484
+ ->setData('show_product_wishlist_link', $decodeProductShowData->show_product_wishlist_link)
485
+ ->setData('show_product_reviews_summary', $decodeProductShowData->show_product_reviews_summary)
486
+ ->setData('show_product_description', $decodeProductShowData->show_product_description)
487
+ ->setData('product_description_color', $decodeProductShowData->product_description_color)
488
+ ->setData('show_product_additional_information', $decodeProductShowData->show_product_additional_information)
489
+ ->setData('additional_information_bg_color', $decodeProductShowData->additional_information_bg_color)
490
+ ->setData('additional_information_font_color', $decodeProductShowData->additional_information_font_color)
491
+ ->setData('show_full_reviews_on_product_page', $decodeProductShowData->show_full_reviews_on_product_page)
492
+ ->setData('full_reviews_bg_color', $decodeProductShowData->full_reviews_bg_color)
493
+ ->setData('full_reviews_font_color', $decodeProductShowData->full_reviews_font_color)
494
+ ->setData('show_related_products', $decodeProductShowData->show_related_products)
495
+ ->setData('preset_layout_sub_settings', $getSubsetDefaultId)
496
+ ->setData('h_layout_search_cart', $hLayoutData->h_layout_search_cart)
497
+ ->setData('h_layout_sub_header', $hLayoutData->h_layout_sub_header)
498
+ ->setData('h_layout_banner', $hLayoutData->h_layout_banner)
499
+ ->setData('h_layout_feature', $hLayoutData->h_layout_feature)
500
+ ->setData('h_layout_categories', $hLayoutData->h_layout_categories)
501
+ ->setData('h_layout_news_signup', $hLayoutData->h_layout_news_signup)
502
+ ->setData('c_layout_breadcrumbs', $cLayoutData->c_layout_breadcrumbs)
503
+ ->setData('c_layout_toolbar', $cLayoutData->c_layout_toolbar)
504
+ ->setData('c_layout_pag_top', $cLayoutData->c_layout_pag_top)
505
+ ->setData('c_grid_layout_product_image', $cLayoutGridData->c_grid_layout_product_image)
506
+ ->setData('c_grid_layout_product_title', $cLayoutGridData->c_grid_layout_product_title)
507
+ ->setData('c_grid_layout_product_price', $cLayoutGridData->c_grid_layout_product_price)
508
+ ->setData('c_grid_layout_product_review', $cLayoutGridData->c_grid_layout_product_review)
509
+ ->setData('c_grid_layout_product_learn', $cLayoutGridData->c_grid_layout_product_learn)
510
+ ->setData('c_grid_layout_product_addtocart', $cLayoutGridData->c_grid_layout_product_addtocart)
511
+ ->setData('c_list_layout_product_image', $cLayoutListData->c_list_layout_product_image)
512
+ ->setData('c_list_layout_product_title', $cLayoutListData->c_list_layout_product_title)
513
+ ->setData('c_list_layout_product_price', $cLayoutListData->c_list_layout_product_price)
514
+ ->setData('c_list_layout_product_review', $cLayoutListData->c_list_layout_product_review)
515
+ ->setData('c_list_layout_product_learn', $cLayoutListData->c_list_layout_product_learn)
516
+ ->setData('c_list_layout_product_addtocart', $cLayoutListData->c_list_layout_product_addtocart)
517
+ ->setData('p_layout_availability', $pLayoutData->ptop_layout_settings->p_layout_availability)
518
+ ->setData('p_layout_pricing', $pLayoutData->ptop_layout_settings->p_layout_pricing)
519
+ ->setData('p_layout_addtocart', $pLayoutData->ptop_layout_settings->p_layout_addtocart)
520
+ ->setData('p_layout_wishlist', $pLayoutData->ptop_layout_settings->p_layout_wishlist)
521
+ ->setData('p_layout_review', $pLayoutData->ptop_layout_settings->p_layout_review)
522
+ ->setData('p_layout_desc', $pLayoutData->pbottom_layout_settings->p_layout_desc)
523
+ ->setData('p_layout_additionalinfo', $pLayoutData->pbottom_layout_settings->p_layout_additionalinfo)
524
+ ->setData('p_layout_fullreview', $pLayoutData->pbottom_layout_settings->p_layout_fullreview)
525
+ ->setData('p_layout_relatedproduct', $pLayoutData->pbottom_layout_settings->p_layout_relatedproduct);
526
+ return $subsettingsModel;
527
+ }
528
+ static public function _disableModule($moduleName)
529
+ {
530
+ $configValue = Mage::getStoreConfig('mobilenowsettings/mobilenowgeneral/status');
531
+ $subscriptionstatus = json_decode(Mage::getStoreConfig('mobilenowsettings/mobilenowaccount/subscription'));
532
+ if($configValue==0 || $subscriptionstatus->subscritionStatus=='inactive'|| $subscriptionstatus->subscritionStatus=='' || $subscriptionstatus->daysRemaining<=0)
533
+ {
534
+ $outputPath = "advanced/modules_disable_output/$moduleName";
535
+ if (!Mage::getStoreConfig($outputPath))
536
+ {
537
+ if($configValue==0)
538
+ {
539
+ Mage::getSingleton("adminhtml/session")->addError('No account set up or Mobile Now is inactive. Check System->Configuration->MobileNow to set up your account within the application and check that the system is active. Sign up for a FREE account at mobilenowapp.com to activate the extension. If you have already set this up, clear your Magento and browser cache.' );
540
+ }
541
+ elseif($subscriptionstatus->subscritionStatus=='inactive'|| $subscriptionstatus->subscritionStatus=='')
542
+ {
543
+ Mage::getSingleton("adminhtml/session")->addError('There is no account set up in the configuration panel. Go to mobilenowapp.com to sign up for a free account' );
544
+ }
545
+ elseif($subscriptionstatus->daysRemaining<=0)
546
+ {
547
+ Mage::getSingleton("adminhtml/session")->addError('Your trial period has expired. Please upgrade your account to a Gold Membership at mobilenowapp.com.' );
548
+ }
549
+ Mage::app()->getStore()->setConfig($outputPath, true);
550
+ }
551
+ }
552
+ }
553
+ static public function getPreviewCategoryUrl()
554
+ {
555
+ //////////////////GetCategory Id to load in Iframe///////////////////////
556
+ $previewCat=Mage::getModel('catalog/category');
557
+ $categoryId = $previewCat->getCollection()->getLastItem();
558
+ if($categoryId->getId())
559
+ {
560
+ $CategoryId=$categoryId->getId();
561
+ $previewCat->load($CategoryId);
562
+ $categoryURL=$previewCat->getUrlPath();
563
+ }
564
+ else
565
+ {
566
+ $categoryURL='';
567
+ }
568
+ return $categoryURL;
569
+ }
570
+ static public function getPreviewProductUrl()
571
+ {
572
+ ///////////////Get product ID to Load in Iframe///////////////////////
573
+ $previewProduct=Mage::getModel('catalog/product');
574
+ $previewProductId = $previewProduct->getCollection()->getFirstItem();
575
+ if($previewProductId->getId())
576
+ {
577
+ $ProductId=$previewProductId->getId();
578
+ $previewProduct->load($ProductId);
579
+ $productURL=$previewProduct->getUrlPath();
580
+ }
581
+ else
582
+ {
583
+ $productURL='';
584
+ }
585
+ return $productURL;
586
+ }
587
+
588
+ public function remove_dir($dir) {
589
+ if (is_dir($dir)) {
590
+ $objects = scandir($dir);
591
+ foreach ($objects as $object) {
592
+ if ($object != "." && $object != "..") {
593
+ if (filetype($dir."/".$object) == "dir") rmdir($dir."/".$object); else unlink($dir."/".$object);
594
+ }
595
+ }
596
+ reset($objects);
597
+ rmdir($dir);
598
+ }
599
+ }
600
+
601
+
602
+ }
603
+
app/code/community/Redstage/Mobilenow/Helper/Homepage.php ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Helper_Homepage extends Mage_Core_Helper_Abstract
3
+ {
4
+ // function for generationg homepage layout xml
5
+ static public function generateHomePageLayoutXML($post_data)
6
+ {
7
+
8
+ $themeSubSettings['homepagelayoutmain'] = array();
9
+ $themeSubSettings['homepagelayoutmain']['h_layout_search_cart'] = 0;
10
+ $themeSubSettings['homepagelayoutmain']['h_layout_sub_header'] = 0;
11
+ $themeSubSettings['homepagelayoutmain']['h_layout_banner'] = 0;
12
+ $themeSubSettings['homepagelayoutmain']['h_layout_feature'] = 0;
13
+ $themeSubSettings['homepagelayoutmain']['h_layout_categories'] = 0;
14
+ $themeSubSettings['homepagelayoutmain']['h_layout_news_signup'] = 0;
15
+ if($post_data['h_layout_search_cart'] > 0)
16
+ $themeSubSettings['homepagelayoutmain']['h_layout_search_cart'] = $post_data['h_layout_search_cart'];
17
+ if($post_data['h_layout_sub_header'] > 0)
18
+ $themeSubSettings['homepagelayoutmain']['h_layout_sub_header'] = $post_data['h_layout_sub_header'];
19
+ if($post_data['h_layout_banner'] > 0)
20
+ $themeSubSettings['homepagelayoutmain']['h_layout_banner'] = $post_data['h_layout_banner'];
21
+ if($post_data['h_layout_feature'] > 0)
22
+ $themeSubSettings['homepagelayoutmain']['h_layout_feature'] = $post_data['h_layout_feature'];
23
+ if($post_data['h_layout_categories'] > 0)
24
+ $themeSubSettings['homepagelayoutmain']['h_layout_categories'] = $post_data['h_layout_categories'];
25
+ if($post_data['h_layout_news_signup'] > 0)
26
+ $themeSubSettings['homepagelayoutmain']['h_layout_news_signup'] = $post_data['h_layout_news_signup'];
27
+
28
+
29
+ $header_nodes = '';
30
+ if($post_data['header_link_home'] && $post_data['header_link_home'] == '1'){
31
+ if($post_data['header_link_home_name'] > 0) {
32
+ $header_nodes .=' <action method="setData"><name>home</name><value>'.$post_data['header_link_home_name'].'</value></action>';
33
+ } else {
34
+ $header_nodes .=' <action method="setData"><name>home</name><value>0</value></action>';
35
+ }
36
+ }
37
+ if($post_data['header_link_login'] && $post_data['header_link_login'] == '1'){
38
+ if($post_data['header_link_login_name'] > 0) {
39
+ $header_nodes .=' <action method="setData"><name>login</name><value>'.$post_data['header_link_login_name'].'</value></action>';
40
+ } else {
41
+ $header_nodes .=' <action method="setData"><name>login</name><value>0</value></action>';
42
+ }
43
+ }
44
+ if($post_data['header_link_myaccount'] && $post_data['header_link_myaccount'] == '1'){
45
+ if($post_data['header_link_myaccount_name'] > 0) {
46
+ $header_nodes .=' <action method="setData"><name>account</name><value>'.$post_data['header_link_myaccount_name'].'</value></action>';
47
+ } else {
48
+ $header_nodes .=' <action method="setData"><name>account</name><value>0</value></action>';
49
+ }
50
+ }
51
+ if($post_data['header_link_wishlist'] && $post_data['header_link_wishlist'] == '1'){
52
+ if($post_data['header_link_wishlist_name'] > 0) {
53
+ $header_nodes .=' <action method="setData"><name>wishlist</name><value>'.$post_data['header_link_wishlist_name'].'</value></action>';
54
+ } else {
55
+ $header_nodes .=' <action method="setData"><name>wishlist</name><value>0</value></action>';
56
+ }
57
+ }
58
+ $footer_nodes = '';
59
+ if($post_data['footer_link_home'] && $post_data['footer_link_home'] == '1'){
60
+ if($post_data['footer_link_home_name'] > 0) {
61
+ $footer_nodes .=' <action method="setData"><name>home</name><value>'.$post_data['footer_link_home_name'].'</value></action>';
62
+ } else {
63
+ $footer_nodes .=' <action method="setData"><name>home</name><value>0</value></action>';
64
+ }
65
+ }
66
+ if($post_data['footer_link_login'] && $post_data['footer_link_login'] == '1'){
67
+ if($post_data['footer_link_login_name'] > 0) {
68
+ $footer_nodes .=' <action method="setData"><name>login</name><value>'.$post_data['footer_link_login_name'].'</value></action>';
69
+ } else {
70
+ $footer_nodes .=' <action method="setData"><name>login</name><value>0</value></action>';
71
+ }
72
+ }
73
+ if($post_data['footer_link_myaccount'] && $post_data['footer_link_myaccount'] == '1'){
74
+ if($post_data['footer_link_myaccount_name'] > 0) {
75
+ $footer_nodes .=' <action method="setData"><name>account</name><value>'.$post_data['footer_link_myaccount_name'].'</value></action>';
76
+ } else {
77
+ $footer_nodes .=' <action method="setData"><name>account</name><value>0</value></action>';
78
+ }
79
+ }
80
+ if($post_data['footer_link_wishlist'] && $post_data['footer_link_wishlist'] == '1'){
81
+ if($post_data['footer_link_wishlist_name'] > 0) {
82
+ $footer_nodes .=' <action method="setData"><name>wishlist</name><value>'.$post_data['footer_link_wishlist_name'].'</value></action>';
83
+ } else {
84
+ $footer_nodes .=' <action method="setData"><name>wishlist</name><value>0</value></action>';
85
+ }
86
+ }
87
+ $pre_footer_content = '';
88
+ if($post_data['pre_footer_section'] && $post_data['pre_footer_section'] != ''){
89
+ $pre_footer_content .= '<block type="mobilenow/home" name="prefootercontent" template="mobilenow/prefootercontent.phtml"/>';
90
+ }
91
+ $footer_content = '';
92
+ if($post_data['footer_section'] && $post_data['footer_section'] != ''){
93
+ $footer_content .= '<block type="mobilenow/home" name="footercontent" template="mobilenow/footercontent.phtml"/>';
94
+ }
95
+
96
+
97
+ //print_r($themeSubSettings['homepagelayoutmain']);
98
+ //echo '</pre>';
99
+ $h_org_xml = array();
100
+ if(!$post_data['show_search_cart_area'] ||$post_data['show_search_cart_area'] != '1'){
101
+ $h_org_xml['h_layout_search_cart'] = '';
102
+ } else {
103
+ $h_org_xml['h_layout_search_cart'] = '
104
+ <block type="mobilenow/home" name="catalog.search" template="mobilenow/search-panel.phtml">
105
+ <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
106
+ </block>';
107
+ }
108
+ if(!$post_data['subheader_section'] || trim($post_data['subheader_section']) == ''){
109
+ $h_org_xml['h_layout_sub_header'] = '';
110
+ } else{
111
+ $h_org_xml['h_layout_sub_header'] = '<block type="mobilenow/home" name="subheader" template="mobilenow/subheader.phtml"/>';
112
+ }
113
+ if(!$post_data['show_home_page_banner'] ||$post_data['show_home_page_banner'] != '1'){
114
+ $h_org_xml['h_layout_banner'] = '';
115
+ } else {
116
+ $h_org_xml['h_layout_banner'] = '<block type="mobilenow/home" name="homebanner" template="mobilenow/banner.phtml"/>';
117
+ }
118
+ //finding out category menu type
119
+ $menu_type = '';
120
+ if(!$post_data['categories'] ||$post_data['categories'] != ''){
121
+ $menu_type = '<action method="setData"><name>menutype</name><value>'.$post_data['categories'].'</value></action>';
122
+ }
123
+
124
+ $h_org_xml['h_layout_categories'] = '
125
+ <block type="mobilenow/home" name="catalog.topnav" template="mobilenow/nav.phtml">'.
126
+ $menu_type
127
+ .'
128
+ <block type="catalog/navigation" name="catalog_footernav" as="catalog_footernav" template="catalog/navigation/mobile-menu.phtml"/>
129
+ <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
130
+ <label>Navigation Bar</label>
131
+ <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
132
+ </block>
133
+ </block>';
134
+ if(!$post_data['homepage_custom_code'] || trim($post_data['homepage_custom_code']) == ''){
135
+ $h_org_xml['h_layout_feature'] = '';
136
+ } else{
137
+ $h_org_xml['h_layout_feature'] = '<block type="mobilenow/home" name="homepagefeature" template="mobilenow/customhome.phtml"/>';
138
+ }
139
+ if(!$post_data['show_newsletter'] ||$post_data['show_newsletter'] != '1'){
140
+ $h_org_xml['h_layout_news_signup'] = '';
141
+ } else {
142
+ $h_org_xml['h_layout_news_signup'] = '<block type="newsletter/subscribe" name="newsletter" template="newsletter/subscribe.phtml"/>';
143
+ }
144
+
145
+ // $h_i = 0;
146
+ // foreach($themeSubSettings['homepagelayoutmain'] as $hkey=>$hvalue){
147
+ // $hvar[$h_i] = $h_org_xml[$hkey];
148
+ // $h_i++;
149
+ // }
150
+
151
+ $h_layout_xml = '
152
+ <remove name="breadcrumbs" />
153
+ <remove name="right"/>
154
+ <remove name="content"/>
155
+ <reference name="root">
156
+ <action method="setTemplate"><template>page/mobilenow-home.phtml</template></action>
157
+ </reference>
158
+ <reference name="header">';
159
+ if($header_nodes != ''){
160
+ $h_layout_xml .='<block type="mobilenow/home" name="mobilelinks" as="mobilelinks" template="mobilenow/toplinks.phtml">'.$header_nodes.'</block>';
161
+ }
162
+ $h_layout_xml .='
163
+ <block type="mobilenow/home" name="homepage" as="homepage">';
164
+ if(count($themeSubSettings['homepagelayoutmain']) > 0){
165
+
166
+ //echo '<pre>';
167
+
168
+ asort($themeSubSettings['homepagelayoutmain']);
169
+ foreach($themeSubSettings['homepagelayoutmain'] as $hkey=>$hvalue){
170
+ $h_layout_xml .= $h_org_xml[$hkey];
171
+ }
172
+ }
173
+ $h_layout_xml .='
174
+ </block>
175
+ </reference>
176
+ <reference name="footer">
177
+ <action method="unsetChildren"/>';
178
+ $h_layout_xml .= $pre_footer_content;
179
+ if($footer_nodes != ''){
180
+ $h_layout_xml .='<block type="mobilenow/home" name="mobilelinks-footer" as="mobilelinks-footer" template="mobilenow/footerlinks.phtml">'.$footer_nodes.'</block>';
181
+ }
182
+ $h_layout_xml .= $footer_content;
183
+ $h_layout_xml .='
184
+ </reference>
185
+ ';
186
+
187
+
188
+ //echo($h_layout_xml);
189
+
190
+ //die;
191
+
192
+ return $h_layout_xml;
193
+
194
+
195
+
196
+
197
+ }
198
+
199
+ // function for generationg Default layout xml
200
+ static public function generateDefaultPageLayoutXML($post_data,$css_name)
201
+ {
202
+ $themeSubSettings['homepagelayoutmain'] = array();
203
+ $themeSubSettings['homepagelayoutmain']['h_layout_search_cart'] = 0;
204
+ $themeSubSettings['homepagelayoutmain']['h_layout_sub_header'] = 0;
205
+ $themeSubSettings['homepagelayoutmain']['h_layout_banner'] = 0;
206
+ $themeSubSettings['homepagelayoutmain']['h_layout_feature'] = 0;
207
+ $themeSubSettings['homepagelayoutmain']['h_layout_categories'] = 0;
208
+ $themeSubSettings['homepagelayoutmain']['h_layout_news_signup'] = 0;
209
+ if($post_data['h_layout_search_cart'] > 0)
210
+ $themeSubSettings['homepagelayoutmain']['h_layout_search_cart'] = $post_data['h_layout_search_cart'];
211
+ if($post_data['h_layout_sub_header'] > 0)
212
+ $themeSubSettings['homepagelayoutmain']['h_layout_sub_header'] = $post_data['h_layout_sub_header'];
213
+ if($post_data['h_layout_categories'] > 0)
214
+ $themeSubSettings['homepagelayoutmain']['h_layout_categories'] = $post_data['h_layout_categories'];
215
+ if($post_data['h_layout_news_signup'] > 0)
216
+ $themeSubSettings['homepagelayoutmain']['h_layout_news_signup'] = $post_data['h_layout_news_signup'];
217
+
218
+ $header_nodes = '';
219
+ if($post_data['header_link_home'] && $post_data['header_link_home'] == '1'){
220
+ if($post_data['header_link_home_name'] > 0) {
221
+ $header_nodes .=' <action method="setData"><name>home</name><value>'.$post_data['header_link_home_name'].'</value></action>';
222
+ } else {
223
+ $header_nodes .=' <action method="setData"><name>home</name><value>0</value></action>';
224
+ }
225
+ }
226
+ if($post_data['header_link_login'] && $post_data['header_link_login'] == '1'){
227
+ if($post_data['header_link_login_name'] > 0) {
228
+ $header_nodes .=' <action method="setData"><name>login</name><value>'.$post_data['header_link_login_name'].'</value></action>';
229
+ } else {
230
+ $header_nodes .=' <action method="setData"><name>login</name><value>0</value></action>';
231
+ }
232
+ }
233
+ if($post_data['header_link_myaccount'] && $post_data['header_link_myaccount'] == '1'){
234
+ if($post_data['header_link_myaccount_name'] > 0) {
235
+ $header_nodes .=' <action method="setData"><name>account</name><value>'.$post_data['header_link_myaccount_name'].'</value></action>';
236
+ } else {
237
+ $header_nodes .=' <action method="setData"><name>account</name><value>0</value></action>';
238
+ }
239
+ }
240
+ if($post_data['header_link_wishlist'] && $post_data['header_link_wishlist'] == '1'){
241
+ if($post_data['header_link_wishlist_name'] > 0) {
242
+ $header_nodes .=' <action method="setData"><name>wishlist</name><value>'.$post_data['header_link_wishlist_name'].'</value></action>';
243
+ } else {
244
+ $header_nodes .=' <action method="setData"><name>wishlist</name><value>0</value></action>';
245
+ }
246
+ }
247
+ $footer_nodes = '';
248
+ if($post_data['footer_link_home'] && $post_data['footer_link_home'] == '1'){
249
+ if($post_data['footer_link_home_name'] > 0) {
250
+ $footer_nodes .=' <action method="setData"><name>home</name><value>'.$post_data['footer_link_home_name'].'</value></action>';
251
+ } else {
252
+ $footer_nodes .=' <action method="setData"><name>home</name><value>0</value></action>';
253
+ }
254
+ }
255
+ if($post_data['footer_link_login'] && $post_data['footer_link_login'] == '1'){
256
+ if($post_data['footer_link_login_name'] > 0) {
257
+ $footer_nodes .=' <action method="setData"><name>login</name><value>'.$post_data['footer_link_login_name'].'</value></action>';
258
+ } else {
259
+ $footer_nodes .=' <action method="setData"><name>login</name><value>0</value></action>';
260
+ }
261
+ }
262
+ if($post_data['footer_link_myaccount'] && $post_data['footer_link_myaccount'] == '1'){
263
+ if($post_data['footer_link_myaccount_name'] > 0) {
264
+ $footer_nodes .=' <action method="setData"><name>account</name><value>'.$post_data['footer_link_myaccount_name'].'</value></action>';
265
+ } else {
266
+ $footer_nodes .=' <action method="setData"><name>account</name><value>0</value></action>';
267
+ }
268
+ }
269
+ if($post_data['footer_link_wishlist'] && $post_data['footer_link_wishlist'] == '1'){
270
+ if($post_data['footer_link_wishlist_name'] > 0) {
271
+ $footer_nodes .=' <action method="setData"><name>wishlist</name><value>'.$post_data['footer_link_wishlist_name'].'</value></action>';
272
+ } else {
273
+ $footer_nodes .=' <action method="setData"><name>wishlist</name><value>0</value></action>';
274
+ }
275
+ }
276
+
277
+ $footer_content = '';
278
+ if($post_data['footer_section'] && $post_data['footer_section'] != ''){
279
+ $footer_content .= '<block type="mobilenow/home" name="footercontent" template="mobilenow/footercontent.phtml"/>';
280
+ }
281
+
282
+
283
+ //print_r($themeSubSettings['homepagelayoutmain']);
284
+ //echo '</pre>';
285
+ $h_org_xml = array();
286
+ if(!$post_data['show_search_cart_area'] ||$post_data['show_search_cart_area'] != '1'){
287
+ $h_org_xml['h_layout_search_cart'] = '';
288
+ } else {
289
+ $h_org_xml['h_layout_search_cart'] = '
290
+ <block type="mobilenow/home" name="catalog.search" template="mobilenow/search-panel.phtml">
291
+ <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
292
+ </block>';
293
+ }
294
+ if(!$post_data['subheader_section'] || trim($post_data['subheader_section']) == ''){
295
+ $h_org_xml['h_layout_sub_header'] = '';
296
+ } else{
297
+ $h_org_xml['h_layout_sub_header'] = '<block type="mobilenow/home" name="subheader" template="mobilenow/subheader.phtml"/>';
298
+ }
299
+
300
+ //finding out category menu type
301
+ $menu_type = '';
302
+ if(!$post_data['categories'] ||$post_data['categories'] != ''){
303
+ $menu_type = '<action method="setData"><name>menutype</name><value>'.$post_data['categories'].'</value></action>';
304
+ }
305
+
306
+ $h_org_xml['h_layout_categories'] = '
307
+ <block type="mobilenow/home" name="catalog.topnav" template="mobilenow/nav.phtml">'.
308
+ $menu_type
309
+ .'
310
+ <block type="catalog/navigation" name="catalog_footernav" as="catalog_footernav" template="catalog/navigation/mobile-menu.phtml"/>
311
+ <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
312
+ <label>Navigation Bar</label>
313
+ <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
314
+ </block>
315
+ </block>';
316
+ // if(!$post_data['show_newsletter'] ||$post_data['show_newsletter'] != '1'){
317
+ // $h_org_xml['h_layout_news_signup'] = '';
318
+ // } else {
319
+ // $h_org_xml['h_layout_news_signup'] = '<block type="newsletter/subscribe" name="newsletter" template="newsletter/subscribe.phtml"/>';
320
+ // }
321
+
322
+
323
+
324
+
325
+ $default_layout_xml = '
326
+ <remove name="right"/>
327
+ <reference name="root">
328
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
329
+ </reference>
330
+ <reference name="head">
331
+ <block type="core/text" name="include_themecss">
332
+ <action method="setText"><text><![CDATA[<link rel="stylesheet" type="text/css" href="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobilenow_theme_css/'.$css_name.'.css?'.time().'" media="all"/>]]></text></action>
333
+ </block> </reference>
334
+ <reference name="header">';
335
+ if($header_nodes != ''){
336
+ $default_layout_xml .='<block type="mobilenow/home" name="mobilelinks" as="mobilelinks" template="mobilenow/toplinks.phtml">'.$header_nodes.'</block>';
337
+ }
338
+ $default_layout_xml .='
339
+ <block type="mobilenow/home" name="homepage" as="homepage">';
340
+ if(count($themeSubSettings['homepagelayoutmain']) > 0){
341
+ asort($themeSubSettings['homepagelayoutmain']);
342
+ foreach($themeSubSettings['homepagelayoutmain'] as $hkey=>$hvalue){
343
+ $default_layout_xml .= $h_org_xml[$hkey];
344
+ }
345
+ }
346
+ $default_layout_xml .='
347
+ </block>';
348
+ $default_layout_xml .='</reference>';
349
+ $default_layout_xml .= '<reference name="footer">
350
+ <action method="unsetChildren"/>';
351
+ if($footer_nodes != ''){
352
+ $default_layout_xml .='<block type="mobilenow/home" name="mobilelinks-footer" as="mobilelinks-footer" template="mobilenow/footerlinks.phtml">'.$footer_nodes.'</block>';
353
+ }
354
+ $default_layout_xml .= $footer_content;
355
+ $default_layout_xml .='</reference>';
356
+ return $default_layout_xml;
357
+ }
358
+ }
359
+
app/code/community/Redstage/Mobilenow/Helper/Theme.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Helper_Theme extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ protected $_themeId = null;
6
+ public function __construct()
7
+ {
8
+ $this->_themeId = Mage::getSingleton('core/session')->getMobileNowId();
9
+ $this->_from = Mage::getSingleton('core/session')->getLoadFrom();
10
+
11
+ }
12
+ public function getTheme()
13
+ {
14
+ // return Mage::getSingleton('checkout/cart');
15
+ }
16
+
17
+ public function getThemeId()
18
+ {
19
+ return $this->_themeId;
20
+ }
21
+
22
+ public function getThemeData($val=''){
23
+ if ($val== '') return false;
24
+ $subsettings = unserialize(Mage::app()->getCache()->load("Mobiletheme".$this->_from.$this->_themeId));
25
+ $subsettings->getData($val) ;
26
+ //echo $subsettings;
27
+ $final = $subsettings->getData($val) ;
28
+ // return $final = json_decode($subsettings->getData($val));
29
+ $check_json = json_decode($final);
30
+ if (is_object($check_json))
31
+ return $check_json;
32
+ else
33
+ return $final;
34
+ }
35
+
36
+ public function getSortbox(){
37
+ // /$sort_array=array();
38
+ $sort_array[1]=array('label'=>'Position','order'=>'position','dir'=>'asc');
39
+ $sort_array[2]=array('label'=>'Price High -&gt Low','order'=>'price','dir'=>'desc');
40
+ $sort_array[3]=array('label'=>'Price Low -&gt High','order'=>'price','dir'=>'asc');
41
+ $sort_array[4]=array('label'=>'Name A -&gt Z','order'=>'name','dir'=>'asc');
42
+ $sort_array[5]=array('label'=>'Name Z -&gt A','order'=>'name','dir'=>'desc');
43
+ return $sort_array ;
44
+ }
45
+
46
+ //$a = $this->helper('mobilenow/theme')->getThemeData('homepagebanner');
47
+ // $this->helper('mobilenow/theme')->getThemeId()
48
+
49
+ function generateThemeCssFile($css_var_arr) {
50
+ $values_array = array();
51
+
52
+ $css_content = '.page{background-color: {%background_color%} ;}
53
+ .header-container .search-panel {
54
+ background-color: {%search_cart_area_bg_color%};
55
+ }
56
+
57
+
58
+ a, a:not(img), a span:not(.price) {
59
+ color: {%links_color%} !important;
60
+ }
61
+
62
+ a:focus, a:active, a:not(img):focus, a:not(img):active, a span:not(.price):focus, a span:not(.price):active {
63
+ color: {%links_color%} !important;
64
+ }
65
+
66
+ a:hover, a:not(img):hover, a span:not(.price):hover {
67
+ text-decoration: none !important;
68
+ border-bottom-color: {%links_color%} !important;
69
+ color: {%links_color%} !important;
70
+ border-bottom: 1px solid {%links_color%};
71
+ }
72
+
73
+ body, p, fieldset, table, span:not(.counter), span:not(.price), span span:not(.label), label, h1, h2, h3, h4, h5, h6,
74
+ input[type="text"], input[type="password"], input[type="date"], input[type="datetime"], input[type="datetime-local"],
75
+ input[type="month"], input[type="week"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"],
76
+ input[type="time"], input[type="url"], textarea {
77
+ color: {%text_color%} !important;
78
+ }
79
+
80
+ .nav-container #nav, .nav-container #nav ul a, .top-bar, .top-bar-section ul, #mobile-menu li {
81
+ background-color: {%categories_bg_color%};
82
+ }
83
+ .nav-container #nav li a{border-bottom:{%categories_bg_borderwidth%}px solid {%categories_bg_color%}; }
84
+
85
+ ul.title-area .name a { color: {%text_color%} !important;}
86
+
87
+ button.secondary, .button.secondary {
88
+ background-color: {%button_bg_color%} !important;
89
+ border-color: {%button_border_color%} !important;
90
+ color: {%button_text_color%} !important;
91
+ }
92
+ div.breadcrumbs {
93
+ background: none repeat scroll 0 0 {%breadcrumb_bg_color%} !important;
94
+ }
95
+ div.breadcrumbs span, div.breadcrumbs a, div.breadcrumbs span {
96
+ color: {%breadcrumb_font_color%} !important;
97
+ }
98
+ div.breadcrumbs a:hover {
99
+ text-decoration: none !important;
100
+ border-bottom-color: {%breadcrumb_font_color%};
101
+ color: {%breadcrumb_font_color%} !important;
102
+ border-bottom: 1px solid {%breadcrumb_font_color%};
103
+ }
104
+ .toolbar-panel {
105
+ background-color: {%toolbar_bg_color%} !important;
106
+ }
107
+ .toolbar-panel label {
108
+ color: {%toolbar_text_color%} !important;
109
+ }
110
+ .pager-panel {
111
+ background: none repeat scroll 0 0 {%pagination_panel_bg_color%} !important;
112
+ color: {%pagination_button_text_color%} !important;
113
+ }
114
+ .pager-panel a.previous, .pager-panel a.link {
115
+ background: none repeat scroll 0 0 {%pagination_button_bg_color%} !important;
116
+ color: {%pagination_button_text_color%} !important;
117
+ text-decoration: none !important;
118
+ border-bottom: 1px solid {%pagination_button_bg_color%} !important;
119
+ }
120
+ .pager-panel a.previous span.notch, .pager-panel a.link span.notch {
121
+ border: 11px solid transparent;
122
+ border-right: 11px solid {%pagination_button_bg_color%} !important;
123
+ border-right: 11px solid {%pagination_button_bg_color%} !important;
124
+ }
125
+ .pager-panel a.previous span.counter, .pager-panel a.link span.counter {
126
+ color: {%pagination_button_text_color%} !important;
127
+ }
128
+ .pager-panel a.next {
129
+ background: none repeat scroll 0 0 {%pagination_button_bg_color%} !important;
130
+ color: {%pagination_button_text_color%} !important;
131
+ border-bottom: 1px solid {%pagination_button_bg_color%} !important;
132
+ }
133
+ .pager-panel a.next span.notch {
134
+ border: 11px solid transparent;
135
+ border-left: 11px solid {%pagination_button_bg_color%} !important;
136
+ border-left: 11px solid {%pagination_button_bg_color%} !important;
137
+ }
138
+ .pager-panel a.next span.counter {
139
+ color: {%pagination_button_text_color%} !important;
140
+ }
141
+ .pager-panel ul.pagination li .arrow .notch:hover {
142
+ text-decoration: none !important;
143
+ border-color: {%pagination_button_bg_color%} !important;
144
+ }
145
+ .pager-panel ul.pagination .arrow a:hover, .pager-panel ul.pagination ul.pagination .arrow a:active, .pager-panel ul.pagination ul.pagination li .arrow a:focus, .pager-panel ul.pagination ul.pagination li .arrow a:focus span.notch, .pager-panel ul.pagination ul.pagination li .arrow .notch:hover {
146
+ text-decoration: none !important;
147
+ background: none repeat scroll 0 0 {%pagination_button_bg_color%} !important;
148
+ }
149
+
150
+ .products-list .item {
151
+ border-bottom: {%gridlines_color_width%}px solid {%gridlines_color%} !important;
152
+ }
153
+ .products-list .item .product-image {
154
+ border: {%image_border_width%}px solid {%image_border_color%} !important;
155
+ }
156
+ .product-view .product-image img{
157
+ border: {%product_image_border_width%}px solid {%product_image_border_color%} !important;
158
+ }
159
+
160
+ .product-name {
161
+ color: {%product_title_color%} !important;
162
+ text-decoration: none !important;
163
+ }
164
+ .products-list h2.product-name a {
165
+ color: {%product_title_color%} !important;
166
+ text-decoration: underline !important;
167
+ }
168
+ .products-list h2.product-name a:hover {
169
+ text-decoration: none !important;
170
+ color: {%product_title_color%} !important;
171
+ border-bottom: 1px solid {%product_title_color%} !important;
172
+ }
173
+ .product-name h3,h2.product-name a {
174
+ color: {%productpage_title_color%} !important;
175
+ }
176
+ h2.product-name a:hover{
177
+ color: {%productpage_title_color%} !important;
178
+ text-decoration: none !important;
179
+ border-bottom: 1px solid {%productpage_title_color%} !important;
180
+ }
181
+ .regular-price span.price, .regular-price span.price-label, .minimal-price span.price, .minimal-price span.price-label,.mobile-price .cart-price span.price,
182
+ .special-price .price{
183
+ color: {%product_price_color%} !important;
184
+ font-weight: bold;
185
+ }
186
+
187
+ .price-box a span.price {
188
+ color: {%product_special_price_color%} !important;
189
+ }
190
+ .price-box a:hover span.price {
191
+ text-decoration: none !important;
192
+ border-bottom-color: {%product_special_price_color%};
193
+ color: {%product_special_price_color%} !important;
194
+ border-bottom: 1px solid {%product_special_price_color%};
195
+ }
196
+
197
+ .rating-box .rating {
198
+ color: {%review_star_color%} !important;
199
+ }
200
+
201
+ .add-to-cart button.secondary, .add-to-cart .button.secondary {
202
+ background-color: {%add_to_cart_bg_color%} !important;
203
+ border-color: {%add_to_cart_border_color%} !important;
204
+ color: {%add_to_cart_button_text_color%} !important;
205
+ margin :0px!important;
206
+ }
207
+ .addtocart.secondary, .addtocart.secondary {
208
+ background-color: {%add_to_cart_bg_color%} !important;
209
+ border-color: {%add_to_cart_border_color%} !important;
210
+ color: {%add_to_cart_button_text_color%} !important;
211
+ margin :0px!important;
212
+ }
213
+ .block-subscribe {
214
+ background-color: {%newsletter_bg_color%} !important;
215
+ }
216
+ .products-list .item .product-image-mobilelist{width:auto !important;}
217
+ a.menucart,a.mycarticon{color:{%cart_link_color%} !important;}
218
+ a.menucart:hover,a.mycarticon:hover{color:{%cart_link_color%} !important;border-bottom-color:{%cart_link_color%} !important;}
219
+ .product-view .product-collateral .box-description h2,
220
+ .product-view .product-collateral .box-additional h2,
221
+ .product-view .product-collateral .box-up-sell h2,
222
+ .product-view .product-collateral .box-tags h2,
223
+ .product-view .product-collateral .block-related h2,
224
+ .product-view .product-collateral .box-reviews h2
225
+ {
226
+ background: {%breadcrumb_bg_color%} !important;
227
+ padding:5px 3px;
228
+ color: {%breadcrumb_font_color%} !important;
229
+ }
230
+ .product-view .product-collateral .box-description .std {
231
+ color: {%product_description_color%} !important;
232
+ }
233
+ #product-attribute-specs-table table tr.even,#product-attribute-specs-table table tr.alt, #product-attribute-specs-table table tr:nth-of-type(2n) {
234
+ background: {%additional_information_bg_color%} !important;
235
+ color :{%additional_information_font_color%}!important;
236
+ }
237
+ #product-attribute-specs-table > tbody {
238
+ background: {%additional_information_bg_color%} !important;
239
+ color :{%additional_information_font_color%} !important;
240
+ }
241
+
242
+ #product-attribute-specs-table tbody tr, #product-attribute-specs-table tbody td {
243
+ background: {%additional_information_bg_color%} !important;
244
+ border: 1px solid {%background_color%};
245
+ color : {%additional_information_font_color%} !important;
246
+ }
247
+ .box-collateral.box-reviews >*{
248
+ background: {%full_reviews_bg_color%} !important;
249
+ color :{%full_reviews_font_color%} !important;
250
+ }
251
+ ';
252
+ $matches = array();
253
+ preg_match_all("/\{\%([a-z_A-Z0-9]*)\%\}/", $css_content, $matches);
254
+ $variables_array = $matches[1];
255
+
256
+ if (count($variables_array) > 0)
257
+ foreach ($variables_array as $key) {
258
+ $values_array[] = $css_var_arr[$key];
259
+ }
260
+
261
+ $new_variables_array = array();
262
+ foreach ($variables_array as $variable) {
263
+ $new_variables_array[] = '/\{\%' . $variable . '\%\}/';
264
+ }
265
+ $body_content = preg_replace($new_variables_array, $values_array, $css_content);
266
+
267
+
268
+ return $body_content;
269
+ }
270
+
271
+ }
272
+
273
+
app/code/community/Redstage/Mobilenow/Model/Corelayoutlink.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Model_Corelayoutlink extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+ parent::_construct();
7
+ $this->_init("mobilenow/corelayoutlink");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Redstage/Mobilenow/Model/Corelayoutupdate.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Model_Corelayoutupdate extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+ parent::_construct();
7
+ $this->_init("mobilenow/corelayoutupdate");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Redstage/Mobilenow/Model/Design/Package.php ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Redstage_Mobilenow_Model_Design_Package extends Mage_Core_Model_Design_Package
5
+ {
6
+ private static $_regexMatchCache = array();
7
+ private static $_customThemeTypeCache = array();
8
+
9
+ public function setPackageName($name = '')
10
+ {
11
+ //echo $_SERVER['HTTP_USER_AGENT'];exit;
12
+ $cache = Mage::app()->getCache();
13
+ $fr_admin = Mage::app()->getRequest()->getParam('isadmin');
14
+ $ld_theme_id = Mage::app()->getRequest()->getParam('theme_id');
15
+ $preview = Mage::app()->getRequest()->getParam('preview') ? Mage::app()->getRequest()->getParam('preview'):0;
16
+
17
+ if( Mage::helper('core')->isModuleEnabled('Redstage_Mobilenow')){
18
+
19
+ if($fr_admin==1 && $ld_theme_id){
20
+ $themePackage = $this->_getThemesettingsValue($ld_theme_id);
21
+ $m_themeid = $ld_theme_id;
22
+ $themePackage_name = 'redstage-mobilenow';
23
+ $from='preview';
24
+ Mage::getSingleton('core/session')->setMobileNowId($m_themeid);
25
+ Mage::getSingleton('core/session')->setLoadFrom($from);
26
+
27
+ }
28
+ else{
29
+ $themePackage = $this->_checkUserAgentAgainstmobileNow();
30
+ $from='front';
31
+ $m_themeid =$themePackage['id'];
32
+ if ($themePackage['ip_override']) {
33
+ if ($themePackage['ip_override'] == $_SERVER['REMOTE_ADDR']){
34
+ $themePackage_name= $themePackage['val'];
35
+ Mage::getSingleton('core/session')->setMobileNowId($themePackage['id']);
36
+ Mage::getSingleton('core/session')->setLoadFrom($from);
37
+ }else{
38
+ $themePackage=null;
39
+ $themePackage_name= null;
40
+ Mage::getSingleton('core/session')->setMobileNowId('');
41
+ }
42
+
43
+ } else{
44
+ $themePackage_name= $themePackage['val'];
45
+ Mage::getSingleton('core/session')->setMobileNowId($themePackage['id']);
46
+ Mage::getSingleton('core/session')->setLoadFrom($from);
47
+ }
48
+ }
49
+
50
+
51
+ if(!$cache->load("Mobiletheme".$from.$m_themeid)){
52
+ $themeSubSettingsModel = Mage::getModel('mobilenow/themesubsettings');
53
+ //$selectCurrentRecord = $themeSubSettingsModel->load($m_themeid,'themeid');
54
+ $attributes = array('themeid'=> $m_themeid, 'preview'=> $preview);
55
+
56
+ $selectCurrentRecord=$themeSubSettingsModel->loadByAttributes($attributes);
57
+
58
+ $selectCurrentRecord->setData('social_links',$themePackage['social_links']) ;
59
+ $selectCurrentRecord->setData('cart_inputs',$themePackage['cart_inputs']) ;
60
+ $selectCurrentRecord->setData('analytics',$themePackage['analytics']) ;
61
+ $cache->save(serialize($selectCurrentRecord), "Mobiletheme".$from.$m_themeid, array(), 60*60);
62
+ }
63
+ }
64
+ //echo $themePackage_name;
65
+ if (empty($name)) {
66
+ // see, if exceptions for user-agents defined in config
67
+
68
+ $customPackage = $this->_checkUserAgentAgainstRegexps('design/package/ua_regexp');
69
+ if ($customPackage) {
70
+ $this->_name = $customPackage;
71
+ }
72
+ elseif ($themePackage) {
73
+ $this->_name = $themePackage_name;
74
+
75
+ }
76
+ else {
77
+ $this->_name = Mage::getStoreConfig('design/package/name', $this->getStore());
78
+ }
79
+ }
80
+ else {
81
+ $this->_name = $name;
82
+ }
83
+
84
+ // make sure not to crash, if wrong package specified
85
+ if (!$this->designPackageExists($this->_name, $this->getArea())) {
86
+ $this->_name = self::DEFAULT_PACKAGE;
87
+ }
88
+
89
+ return $this;
90
+ }
91
+
92
+
93
+
94
+ protected function _checkUserAgentAgainstmobileNow($regexpsConfigPath='design/mobile_now')
95
+ {
96
+ if (empty($_SERVER['HTTP_USER_AGENT'])) {
97
+ return false;
98
+ }
99
+
100
+ if (!empty(self::$_customThemeTypeCache[$regexpsConfigPath])) {
101
+ return self::$_customThemeTypeCache[$regexpsConfigPath];
102
+ }
103
+
104
+
105
+ $regexps = $this->_generateRegexparryfromMobileNow();
106
+
107
+ if (empty($regexps)) {
108
+ return false;
109
+ }
110
+
111
+ if( $this->_getExcludePackageByUserAgent($regexps))
112
+ return false;
113
+ else{
114
+ return self::getPackageByUserAgent($regexps, $regexpsConfigPath);
115
+ }
116
+
117
+ return self::getPackageByUserAgent($regexps, $regexpsConfigPath);
118
+ }
119
+
120
+
121
+ protected function _generateRegexparryfromMobileNow(){
122
+ $store_id = Mage::app()->getStore()->getId();
123
+ $collection = Mage::getModel("mobilenow/mobilenow")->getCollection();
124
+ $resource = Mage::getSingleton('core/resource');
125
+
126
+ $collection->getSelect()
127
+ ->join(
128
+ array('lk'=>$resource->getTableName('mobilenow/themestore')),
129
+ 'lk.theme_id = main_table.theme_id',
130
+ array('lk.store_id','lk.theme_id')
131
+ );
132
+ $collection->addStoreFilter($store_id);
133
+ $exp_chek =array();
134
+ foreach($collection as $themes){
135
+ if($themes->getStatus()){
136
+ $agents = Mage::helper('mobilenow')->getOptionArrayUserAgent();
137
+ if(0==$themes->getUserAgentRegexValues()){
138
+ $reg_val =array_keys($agents);
139
+ array_shift($reg_val);
140
+ }else
141
+ $reg_val = explode(',', $themes->getUserAgentRegexValues());
142
+ $reg_piped='';
143
+
144
+ foreach($reg_val as $val){
145
+ $reg_piped .=$agents[$val].'|';
146
+ $exp_chek[$themes->getThemeId()]['regexp'] =rtrim($reg_piped.$themes->getUserAgentRegexCustomValues(),'|');
147
+ $exp_chek[$themes->getThemeId()]['value'] = 'redstage-mobilenow';
148
+ $exp_chek[$themes->getThemeId()]['exclude'] = $themes->getExcludeUserAgentRegexCustomValues() ;
149
+ $exp_chek[$themes->getThemeId()]['ip_override'] = $themes->getIpOverride() ;
150
+ $exp_chek[$themes->getThemeId()]['social_links'] = $themes->getSocialLinks() ;
151
+ $exp_chek[$themes->getThemeId()]['cart_inputs'] = $themes->getCartInputs() ;
152
+ $exp_chek[$themes->getThemeId()]['analytics'] = $themes->getAnalytics() ;
153
+ }
154
+
155
+ }
156
+ }
157
+ return $exp_chek;
158
+
159
+ }
160
+
161
+ protected function _getThemesettingsValue($ld_theme_id){
162
+
163
+ $themes = Mage::getModel("mobilenow/mobilenow")->load($ld_theme_id);
164
+
165
+ $settings['ip_override'] = $themes->getIpOverride() ;
166
+ $settings['social_links'] = $themes->getSocialLinks() ;
167
+ $settings['cart_inputs'] = $themes->getCartInputs() ;
168
+ $settings['analytics'] = $themes->getAnalytics() ;
169
+
170
+ return $settings ;
171
+ }
172
+ protected function _getExcludePackageByUserAgent(array $rules)
173
+ {
174
+
175
+ if(isset($rule['exclude'])){
176
+ foreach ($rules as $rule) {
177
+ $regexp = '/' . trim($rule['exclude'], '/') . '/';
178
+ if (@preg_match($regexp, $_SERVER['HTTP_USER_AGENT'])) {
179
+ //echo $rule['exclude'];
180
+ return true;
181
+ }
182
+ }
183
+ }
184
+ return false;
185
+ }
186
+
187
+ public static function getPackageByUserAgent(array $rules, $regexpsConfigPath = 'path_mock')
188
+ {
189
+ foreach ($rules as $id=> $rule) {
190
+ if (!empty(self::$_regexMatchCache[$rule['regexp']][$_SERVER['HTTP_USER_AGENT']])) {
191
+
192
+ $pkg['val']=$rule['value'];
193
+ $pkg['ip_override']=$rule['ip_override'];
194
+ $pkg['social_links']=$rule['social_links'];
195
+ $pkg['cart_inputs']=$rule['cart_inputs'];
196
+ $pkg['analytics']=$rule['analytics'];
197
+ $pkg['id']=$id;
198
+ self::$_customThemeTypeCache[$regexpsConfigPath] = $pkg;
199
+ return $pkg;
200
+ }
201
+
202
+ $regexp = '/' . trim($rule['regexp'], '/') . '/';
203
+
204
+ if (@preg_match($regexp, $_SERVER['HTTP_USER_AGENT'])) {
205
+ self::$_regexMatchCache[$rule['regexp']][$_SERVER['HTTP_USER_AGENT']] = true;
206
+
207
+ $pkg['val']=$rule['value'];
208
+ $pkg['id']=$id;
209
+ $pkg['ip_override']=$rule['ip_override'];
210
+ $pkg['social_links']=$rule['social_links'];
211
+ $pkg['cart_inputs']=$rule['cart_inputs'];
212
+ $pkg['analytics']=$rule['analytics'];
213
+ self::$_customThemeTypeCache[$regexpsConfigPath] = $pkg;
214
+ return $pkg;
215
+ }
216
+ }
217
+
218
+ return false;
219
+ }
220
+
221
+ }
app/code/community/Redstage/Mobilenow/Model/Layout/Update.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Redstage_Mobilenow_Model_Layout_update extends Mage_Core_Model_Layout_Update
5
+ {
6
+ public function saveCache()
7
+ {
8
+ if (!Mage::app()->useCache('layout')) {
9
+ return false;
10
+ }
11
+ $str = $this->asString();
12
+ $tags = $this->getHandles();
13
+ $tags[] = self::LAYOUT_GENERAL_CACHE_TAG;
14
+ return Mage::app()->saveCache($str, $this->getCacheId().Mage::getSingleton('core/session')->getMobileNowId().Mage::getSingleton('core/session')->getLoadFrom(), $tags, null);
15
+ }
16
+ }
17
+
app/code/community/Redstage/Mobilenow/Model/Mobilenow.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Model_Mobilenow extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+
7
+ $this->_init("mobilenow/mobilenow");
8
+
9
+ }
10
+ }
11
+
app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutlink.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Corelayoutlink extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("mobilenow/corelayoutlink", "layout_link_id");
7
+ }
8
+
9
+ }
app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutlink/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Corelayoutlink_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init("mobilenow/corelayoutlink");
8
+ }
9
+ }
10
+
app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutupdate.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Corelayoutupdate extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("mobilenow/corelayoutupdate", "layout_update_id");
7
+ }
8
+
9
+ }
app/code/community/Redstage/Mobilenow/Model/Mysql4/Corelayoutupdate/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Corelayoutupdate_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init("mobilenow/corelayoutupdate");
8
+ }
9
+ }
10
+
app/code/community/Redstage/Mobilenow/Model/Mysql4/Mobilenow.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Mobilenow extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("mobilenow/mobilenow", "theme_id");
7
+ }
8
+ protected function _beforeSave(Mage_Core_Model_Abstract $object)
9
+ {
10
+ $arrayUserAgent=Mage::helper("mobilenow")->getOptionArrayUserAgent();
11
+ if($object->getStatus()==1)
12
+ {
13
+ $allStores = Mage::app()->getStores();
14
+ foreach ($allStores as $_eachStoreId => $val)
15
+ {
16
+ $_storeId[] = Mage::app()->getStore($_eachStoreId)->getId();
17
+ }
18
+ if(implode('',$object->getStores())==0){
19
+ $checkStores=$_storeId;
20
+ }
21
+ else{
22
+ $checkStores=$object->getStores();
23
+ $checkStores[]='0';
24
+ }
25
+ //print_r($object->getData());
26
+ //$themeStoreCollection = Mage::getModel('mobilenow/themestore')->getCollection()->addFieldToFilter('store_id', $object->getStores());
27
+ $themeStoreCollection =$this->_getReadAdapter()->select()->from(array('themestore' => $this->getTable('mobilenow/themestore')))->where('themestore.store_id IN (?)', $checkStores);
28
+ //echo $themeStoreCollection;exit;
29
+ $themeStoreCollection=$this->_getReadAdapter()->fetchAll($themeStoreCollection);
30
+ foreach($themeStoreCollection as $themeStore)
31
+ {
32
+ /////////////// Processing values from DB on each iteration////////
33
+ $mobilenowCollection=Mage::getModel('mobilenow/mobilenow')->load($themeStore['theme_id']);
34
+ if($object->getThemeId()!=$mobilenowCollection->getThemeID() && $mobilenowCollection->getStatus()==1){
35
+ $collectionUserAgent=explode(',',$mobilenowCollection->getUserAgentRegexValues());
36
+ foreach($collectionUserAgent as $collectAgent)
37
+ {
38
+ $finalCollectionUserAgent[]=$arrayUserAgent[$collectAgent];
39
+ }
40
+ $customCollectionUserAgentValues=explode('|',$mobilenowCollection->getUserAgentRegexCustomValues());
41
+ $mergedCollectionUserAgent=array_filter(array_map('strtolower',array_merge($finalCollectionUserAgent,$customCollectionUserAgentValues)));
42
+ //echo '<pre>';print_r($mergedCollectionUserAgent);echo '</pre>';
43
+ /////////////// Processing User posted values////////
44
+ $objectUserAgent=explode(',',$object->getUserAgentRegexValues());
45
+ foreach($objectUserAgent as $objectAgent)
46
+ {
47
+ $finalobjectUserAgent[]=$arrayUserAgent[$objectAgent];
48
+ }
49
+ $objectCustomUserAgent=explode('|',$object->getUserAgentRegexCustomValues());
50
+ $mergedObjectUserAgent=array_filter(array_map('strtolower',array_merge($finalobjectUserAgent,$objectCustomUserAgent)));
51
+ $resultUseragent=array_intersect($mergedObjectUserAgent,$mergedCollectionUserAgent);
52
+ if (!empty($resultUseragent) || in_array('all',$mergedCollectionUserAgent) || in_array('all',$mergedObjectUserAgent))
53
+ {
54
+ Mage::throwException(Mage::helper('mobilenow')->__('The selected User Agents and Store View combination already exists.'));
55
+ }
56
+ }
57
+ }
58
+ }
59
+ //Check for the subscription details Free/Active subscription
60
+ //echo '<pre>';print_r($object->getData());echo '</pre>';exit;
61
+ if(Mage::getStoreConfig('mobilenowsettings/mobilenowaccount/subscription'))
62
+ $MnSubscription=json_decode(Mage::getStoreConfig('mobilenowsettings/mobilenowaccount/subscription'));
63
+ if(($MnSubscription->productId==2 && $object->getStatus()==1) || ($MnSubscription->productId==5 && $object->getStatus()==1))
64
+ Mage::throwException(Mage::helper('mobilenow')->__('You cannot activate theme, because you are using a Free account.'));
65
+ }
66
+ protected function _afterSave(Mage_Core_Model_Abstract $object)
67
+ {
68
+ $oldStores = $this->lookupStoreIds($object->getId());
69
+ $newStores = (array)$object->getStores();
70
+
71
+ $table = $this->getTable('mobilenow/themestore');
72
+ $insert = array_diff($newStores, $oldStores);
73
+ $delete = array_diff($oldStores, $newStores);
74
+
75
+ if ($delete) {
76
+ $where = array(
77
+ 'theme_id = ?' => (int) $object->getId(),
78
+ 'store_id IN (?)' => $delete
79
+ );
80
+
81
+ $this->_getWriteAdapter()->delete($table, $where);
82
+ }
83
+
84
+ if ($insert) {
85
+ $data = array();
86
+
87
+ foreach ($insert as $storeId) {
88
+ $data[] = array(
89
+ 'theme_id' => (int) $object->getId(),
90
+ 'store_id' => (int) $storeId
91
+ );
92
+ }
93
+
94
+ $this->_getWriteAdapter()->insertMultiple($table, $data);
95
+ }
96
+
97
+ return parent::_afterSave($object);
98
+
99
+ }
100
+ public function load(Mage_Core_Model_Abstract $object, $value, $field = null)
101
+ {
102
+ if (!is_numeric($value) && is_null($field)) {
103
+ $field = 'identifier';
104
+ }
105
+
106
+ return parent::load($object, $value, $field);
107
+ }
108
+ protected function _afterLoad(Mage_Core_Model_Abstract $object)
109
+ {
110
+ if ($object->getId()) {
111
+ $stores = $this->lookupStoreIds($object->getId());
112
+ $object->setData('store_id', $stores);
113
+ $object->setData('stores', $stores);
114
+ }
115
+
116
+ return parent::_afterLoad($object);
117
+ }
118
+ protected function _getLoadSelect($field, $value, $object)
119
+ {
120
+ $select = parent::_getLoadSelect($field, $value, $object);
121
+
122
+ if ($object->getStoreId()) {
123
+ $stores = array(
124
+ (int) $object->getStoreId(),
125
+ Mage_Core_Model_App::ADMIN_STORE_ID,
126
+ );
127
+
128
+ $select->join(
129
+ array('cbs' => $this->getTable('mobilenow/themestore')),
130
+ $this->getMainTable().'.theme_id = cbs.theme_id',
131
+ array('store_id')
132
+ )/*->where('is_active = ?', 1)*/
133
+ ->where('cbs.store_id in (?) ', $stores)
134
+ ->order('store_id DESC')
135
+ ->limit(1);
136
+ }
137
+
138
+ return $select;
139
+ }
140
+ /**
141
+ * Get store ids to which specified item is assigned
142
+ *
143
+ * @param int $id
144
+ * @return array
145
+ */
146
+ public function lookupStoreIds($id)
147
+ {
148
+ $adapter = $this->_getReadAdapter();
149
+
150
+ $select = $adapter->select()
151
+ ->from($this->getTable('mobilenow/themestore'), 'store_id')
152
+ ->where('theme_id = :theme_id');
153
+
154
+ $binds = array(
155
+ ':theme_id' => (int) $id
156
+ );
157
+
158
+ return $adapter->fetchCol($select, $binds);
159
+ }
160
+ }
app/code/community/Redstage/Mobilenow/Model/Mysql4/Mobilenow/Collection.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Mobilenow_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct(){
5
+ $this->_init("mobilenow/mobilenow");
6
+ $this->_map['fields']['store'] = 'store_table.store_id';
7
+ }
8
+ /**
9
+ * Add filter by store
10
+ *
11
+ * @param int|Mage_Core_Model_Store $store
12
+ * @param bool $withAdmin
13
+ * @return Mage_Cms_Model_Resource_Block_Collection
14
+ */
15
+ public function addStoreFilter($store, $withAdmin = true)
16
+ {
17
+ if ($store instanceof Mage_Core_Model_Store) {
18
+ $store = array($store->getId());
19
+ }
20
+
21
+ if (!is_array($store)) {
22
+ $store = array($store);
23
+ }
24
+
25
+ if ($withAdmin) {
26
+ $store[] = Mage_Core_Model_App::ADMIN_STORE_ID;
27
+ }
28
+ $this->addFilter('store', array('in' => $store), 'public');
29
+
30
+ return $this;
31
+ }
32
+ /**
33
+ * Get SQL for get record count.
34
+ * Extra GROUP BY strip added.
35
+ *
36
+ * @return Varien_Db_Select
37
+ */
38
+ public function getSelectCountSql()
39
+ {
40
+ /*Previous Code
41
+ $countSelect = parent::getSelectCountSql();
42
+ $countSelect->reset(Zend_Db_Select::GROUP);
43
+ return $countSelect;*/
44
+ $this->_renderFilters();
45
+ $countSelect = clone $this->getSelect();
46
+ $countSelect->reset(Zend_Db_Select::ORDER);
47
+ $countSelect->reset(Zend_Db_Select::LIMIT_COUNT);
48
+ $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
49
+ $countSelect->reset(Zend_Db_Select::COLUMNS);
50
+ if(count($this->getSelect()->getPart(Zend_Db_Select::GROUP)) > 0)
51
+ {
52
+ $countSelect->reset(Zend_Db_Select::GROUP);
53
+ $countSelect->distinct(true);
54
+ $group = $this->getSelect()->getPart(Zend_Db_Select::GROUP);
55
+ $countSelect->columns("COUNT(DISTINCT ".implode(", ", $group).")");
56
+ }
57
+ else
58
+ {
59
+ $countSelect->columns('COUNT(*)');
60
+ }
61
+ return $countSelect;
62
+ }
63
+
64
+ /**
65
+ * Join store relation table if there is store filter
66
+ */
67
+ protected function _renderFiltersBefore()
68
+ {
69
+ //if ($this->getFilter('store')) {
70
+ $this->getSelect()->join(
71
+ array('store_table' => $this->getTable('mobilenow/themestore')),'main_table.theme_id = store_table.theme_id',array())->group('main_table.theme_id');
72
+
73
+ /*
74
+ * Allow analytic functions usage because of one field grouping
75
+ */
76
+ $this->_useAnalyticFunction = true;
77
+ //}
78
+ return parent::_renderFiltersBefore();
79
+ }
80
+ }
81
+
app/code/community/Redstage/Mobilenow/Model/Mysql4/Themelayoutsettings.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Themelayoutsettings extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("mobilenow/themelayoutsettings", "id");
7
+ }
8
+
9
+ }
app/code/community/Redstage/Mobilenow/Model/Mysql4/Themelayoutsettings/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Themelayoutsettings_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init("mobilenow/themelayoutsettings");
8
+ }
9
+ }
app/code/community/Redstage/Mobilenow/Model/Mysql4/Themestore.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Themestore extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("mobilenow/themestore", "theme_id");
7
+ }
8
+
9
+ }
app/code/community/Redstage/Mobilenow/Model/Mysql4/Themestore/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Themestore_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init("mobilenow/themestore");
8
+ }
9
+ }
10
+
app/code/community/Redstage/Mobilenow/Model/Mysql4/Themesubsettings.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Themesubsettings extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("mobilenow/themesubsettings", "id");
7
+ }
8
+ public function loadByAttributes($attributes)
9
+ {
10
+ $adapter = $this->_getReadAdapter();
11
+ $where = array();
12
+ foreach ($attributes as $attributeCode=> $value) {
13
+ $where[] = sprintf('%s=:%s', $attributeCode, $attributeCode);
14
+ }
15
+ $select = $adapter->select()
16
+ ->from($this->getMainTable())
17
+ ->where(implode(' AND ', $where));
18
+
19
+ $binds = $attributes;
20
+
21
+ return $adapter->fetchRow($select, $binds);
22
+ }
23
+ }
app/code/community/Redstage/Mobilenow/Model/Mysql4/Themesubsettings/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Model_Mysql4_Themesubsettings_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init("mobilenow/themesubsettings");
8
+ }
9
+ }
10
+
app/code/community/Redstage/Mobilenow/Model/Resource/Layout.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Model_Resource_Layout extends Mage_Core_Model_Resource_Layout
4
+ {
5
+
6
+ public function fetchUpdatesByHandle($handle, $params = array())
7
+ {
8
+ $fr_admin = Mage::app()->getRequest()->getParam('isadmin');
9
+ $ld_theme_id = Mage::app()->getRequest()->getParam('theme_id');
10
+ $preview = Mage::app()->getRequest()->getParam('preview') ? Mage::app()->getRequest()->getParam('preview'):0;
11
+ if($fr_admin==1 && $ld_theme_id){
12
+ $store = Mage::app()->getRequest()->getParam('store_id');
13
+
14
+
15
+ }else{
16
+ $store = Mage::app()->getStore()->getId();
17
+
18
+ }
19
+
20
+ if(Mage::getSingleton('core/session')->getMobileNowId()){
21
+
22
+ $bind = array(
23
+ 'store_id' => $store,
24
+ 'area' => Mage::getSingleton('core/design_package')->getArea(),
25
+ 'package' => 'redstage-mobilenow',
26
+ 'theme' => 'default'
27
+ );
28
+ }else{
29
+ $bind = array(
30
+ 'store_id' => $store,
31
+ 'area' => Mage::getSingleton('core/design_package')->getArea(),
32
+ 'package' => Mage::getSingleton('core/design_package')->getPackageName(),
33
+ 'theme' => Mage::getSingleton('core/design_package')->getTheme('layout')
34
+ );
35
+ }
36
+
37
+
38
+ foreach ($params as $key => $value) {
39
+ if (isset($bind[$key])) {
40
+ $bind[$key] = $value;
41
+ }
42
+ }
43
+ $bind['layout_update_handle'] = $handle;
44
+ $result = '';
45
+
46
+ $readAdapter = $this->_getReadAdapter();
47
+ if ($readAdapter) {
48
+ if(Mage::getSingleton('core/session')->getMobileNowId()){
49
+ $select = $readAdapter->select()
50
+ ->from(array('layout_update' => $this->getMainTable()), array('xml'))
51
+ ->join(array('link'=>$this->getTable('core/layout_link')),
52
+ 'link.layout_update_id=layout_update.layout_update_id',
53
+ '')
54
+ ->join(array('theme'=>$this->getTable('mobilenow/themelayoutsettings')),
55
+ 'theme.layout_link_id=link.layout_link_id AND theme.layout_update_id=layout_update.layout_update_id',
56
+ '')
57
+ ->where('link.store_id IN (0, :store_id)')
58
+ ->where('link.area = :area')
59
+ ->where('link.package = :package')
60
+ ->where('link.theme = :theme')
61
+ ->where('layout_update.handle = :layout_update_handle')
62
+ ->where('theme.theme_id ='.Mage::getSingleton('core/session')->getMobileNowId())
63
+ ->where('theme.preview ='.$preview)
64
+ ->order('layout_update.sort_order ' . Varien_Db_Select::SQL_ASC);
65
+ }else{
66
+ $select = $readAdapter->select()
67
+ ->from(array('layout_update' => $this->getMainTable()), array('xml'))
68
+ ->join(array('link'=>$this->getTable('core/layout_link')),
69
+ 'link.layout_update_id=layout_update.layout_update_id',
70
+ '')
71
+ ->where('link.store_id IN (0, :store_id)')
72
+ ->where('link.area = :area')
73
+ ->where('link.package = :package')
74
+ ->where('link.theme = :theme')
75
+ ->where('layout_update.handle = :layout_update_handle')
76
+ ->order('layout_update.sort_order ' . Varien_Db_Select::SQL_ASC);
77
+ }
78
+
79
+
80
+ $result = join('', $readAdapter->fetchCol($select, $bind));
81
+ }
82
+
83
+ return $result;
84
+ }
85
+
86
+ }
app/code/community/Redstage/Mobilenow/Model/Themelayoutsettings.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Model_Themelayoutsettings extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+ parent::_construct();
7
+ $this->_init("mobilenow/themelayoutsettings");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Redstage/Mobilenow/Model/Themestore.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Model_Themestore extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+ parent::_construct();
7
+ $this->_init("mobilenow/themestore");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Redstage/Mobilenow/Model/Themesubsettings.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_Mobilenow_Model_Themesubsettings extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+ parent::_construct();
7
+ $this->_init("mobilenow/themesubsettings");
8
+
9
+ }
10
+
11
+ public function loadByAttributes($attributes)
12
+ {
13
+ $this->setData($this->getResource()->loadByAttributes($attributes));
14
+ return $this;
15
+ }
16
+
17
+ }
18
+
app/code/community/Redstage/Mobilenow/controllers/Adminhtml/IndexController.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_title($this->__("Mobile Now App"));
8
+ $this->renderLayout();
9
+ }
10
+ public function createthemeAction()
11
+ {
12
+ $this->loadLayout()->_setActiveMenu('mobilenow/createtheme');
13
+ $this->renderLayout();
14
+ }
15
+ public function managethemeAction()
16
+ {
17
+ $this->loadLayout()->_setActiveMenu('mobilenow/managetheme');
18
+ $this->renderLayout();
19
+ }
20
+ public function manageaccountAction()
21
+ {
22
+ $this->loadLayout()->_setActiveMenu('mobilenow/manageaccount');
23
+ $this->renderLayout();
24
+ }
25
+ public function configoptAction()
26
+ {
27
+ Mage::app()->getResponse()->setRedirect(Mage::helper('adminhtml')->getUrl("adminhtml/system_config/"));
28
+ }
29
+ public function helpAction()
30
+ {
31
+ $this->_redirectUrl('http://mobilenowapp.com/');
32
+ }
33
+ }
app/code/community/Redstage/Mobilenow/controllers/Adminhtml/MobilenowController.php ADDED
@@ -0,0 +1,911 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Adminhtml_MobilenowController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ protected function _initAction()
5
+ {
6
+ $this->loadLayout()->_setActiveMenu("mobilenow/mobilenow")->_addBreadcrumb(Mage::helper("adminhtml")->__("Mobilenow Manager"),Mage::helper("adminhtml")->__("Mobilenow Manager"));
7
+ return $this;
8
+ }
9
+ public function indexAction()
10
+ {
11
+ $this->_title($this->__("Mobilenow"));
12
+ $this->_title($this->__("MobileNow: Manage Mobile Themes"));
13
+ Mage::helper("mobilenow")->_disableModule('Redstage_Mobilenow');
14
+ $this->_initAction();
15
+ $this->renderLayout();
16
+ }
17
+ public function editAction()
18
+ {
19
+ $this->_title($this->__("Mobilenow"));
20
+ $this->_title($this->__("Mobilenow"));
21
+ $this->_title($this->__("Edit Item"));
22
+ Mage::helper("mobilenow")->_disableModule('Redstage_Mobilenow');
23
+ $id = $this->getRequest()->getParam("id");
24
+ $tab_data= $this->getRequest()->getParam("tab");
25
+ $loadId=$this->getRequest()->getParam('load_id');
26
+ $loadReset=$this->getRequest()->getParam('reset_delete');
27
+ $model = Mage::getModel("mobilenow/mobilenow")->load($id);
28
+ if ($model->getId())
29
+ {
30
+ Mage::register("mobilenow_data", $model);
31
+ $this->_loadSubsettings($loadId,$loadReset);
32
+ $this->loadLayout();
33
+ $this->_setActiveMenu("mobilenow/mobilenow");
34
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Mobilenow Manager"), Mage::helper("adminhtml")->__("Mobilenow Manager"));
35
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Mobilenow Description"), Mage::helper("adminhtml")->__("Mobilenow Description"));
36
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
37
+ $this->_addContent($this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit"))->_addLeft($this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit_tabs"));
38
+ $this->renderLayout();
39
+ }
40
+ else
41
+ {
42
+ //Mage::getSingleton("adminhtml/session")->addError(Mage::helper("mobilenow")->__("Item does not exist."));
43
+ $this->_redirect("*/*/new",array('active_tab'=>$this->getRequest()->getParam('active_tab'),
44
+ 'design_subtab'=>$this->getRequest()->getParam('design_subtab'),
45
+ 'layout_subtab'=>$this->getRequest()->getParam('layout_subtab'),
46
+ 'load_id' => $this->getRequest()->getParam('load_id')
47
+ ));
48
+ }
49
+ }
50
+ public function newAction()
51
+ {
52
+ //$this->_title($this->__("Mobilenow"));
53
+ $this->_title($this->__("MobileNow: Create New Mobile Theme"));
54
+ Mage::helper("mobilenow")->_disableModule('Redstage_Mobilenow');
55
+ $id = $this->getRequest()->getParam("id");
56
+ $model = Mage::getModel("mobilenow/mobilenow")->load($id);
57
+ $loadReset=$this->getRequest()->getParam('reset_delete');
58
+ $loadId=$this->getRequest()->getParam('load_id');
59
+ $this->_loadSubsettings($loadId,$loadReset);
60
+ $data = Mage::getSingleton("adminhtml/session")->getFormData(true);
61
+ if (!empty($data)) {
62
+ $model->setData($data);
63
+ }
64
+ Mage::register("mobilenow_data", $model);
65
+ $this->loadLayout();
66
+ $this->_setActiveMenu("mobilenow/mobilenow");
67
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
68
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Mobilenow Manager"), Mage::helper("adminhtml")->__("Mobilenow Manager"));
69
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Mobilenow Description"), Mage::helper("adminhtml")->__("Mobilenow Description"));
70
+ $this->_addContent($this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit"))->_addLeft($this->getLayout()->createBlock("mobilenow/adminhtml_mobilenow_edit_tabs"));
71
+ $this->renderLayout();
72
+ }
73
+ public function saveAction()
74
+ {
75
+
76
+ $post_data=$this->getRequest()->getPost();
77
+ $button_type = $this->getRequest()->getParam('buttontype');
78
+ // echo '<pre>'; print_r($post_data); echo '</pre>';exit;
79
+ if($post_data['show_learn_more']!=1)$post_data['show_learn_more']=0;
80
+ if ($post_data)
81
+ {
82
+ try
83
+ {
84
+ $themeSubSettingsModel = Mage::getModel('mobilenow/themesubsettings');
85
+ $arg_array = array();
86
+ if($this->getRequest()->getParam("active_tab")){
87
+ $arg_array['active_tab'] = $this->getRequest()->getParam("active_tab");
88
+ }
89
+ if($this->getRequest()->getParam("design_subtab")){
90
+ $arg_array['design_subtab'] = $this->getRequest()->getParam("design_subtab");
91
+ }
92
+ if($this->getRequest()->getParam("layout_subtab")){
93
+ $arg_array['layout_subtab'] = $this->getRequest()->getParam("layout_subtab");
94
+ }
95
+ if($this->getRequest()->getParam("load_id")){
96
+ $arg_array['load_id'] = $this->getRequest()->getParam("load_id");
97
+ }
98
+ if(!$post_data['hidden_action_val'])
99
+ $arg_array['loadPreivew'] = 1;
100
+ //This Condition saves the Theme and the respective Sub Settings
101
+ if (!$this->getRequest()->getParam("savesubsettings"))
102
+ {
103
+ if( !$post_data['stores']) $this->_redirect("*/*/");
104
+ $createnewThemeFlag='';
105
+ $saveAsTop=$this->getRequest()->getParam("savenew");
106
+ $post_data['user_agent_regex_values']=implode(',',$post_data['user_agent_regex_values']);
107
+ //Save Theme
108
+ // saving advanced settings
109
+ $post_data['css_override'] = $post_data['custom_css'];
110
+ $post_data['social_links'] = json_encode(array('show_social_links'=>$post_data['show_social_links'],
111
+ 'facebook_link'=>$post_data['facebook_link'],
112
+ 'twitter_link'=>$post_data['twitter_link'],
113
+ 'pinterest_link'=>$post_data['pinterest_link'],
114
+ 'google_link'=>$post_data['google_link']
115
+ ));
116
+ $post_data['cart_inputs'] = json_encode(array('show_cart_discount'=>$post_data['show_cart_discount'],
117
+ 'show_cart_shipping_quote'=>$post_data['show_cart_shipping_quote']));
118
+
119
+
120
+ $model = Mage::getModel("mobilenow/mobilenow");
121
+ if(!$saveAsTop)
122
+ {
123
+ $model->addData($post_data)->setId($this->getRequest()->getParam("id"))->save();
124
+ }
125
+ else
126
+ {
127
+ $createnewThemeFlag=1;
128
+ $post_data['theme_name']=$post_data['hidden_theme_sub_setting_name'];
129
+ $model->addData($post_data)->save();
130
+ }
131
+ //Save Preset Subsettings with respect to Theme
132
+ $saveProcessedData=Mage::helper("mobilenow")->ProcessThemeDesignFormData($post_data,'',$model->getId(),$createnewThemeFlag);
133
+ //Check for values whether to save / Update in themesubsettings table
134
+ $selectAttributes = array('themeid'=> $model->getId(), 'preview'=> 0);
135
+ $selectCurrentRecord=$themeSubSettingsModel->loadByAttributes($selectAttributes);
136
+ //$selectCurrentRecord=$themeSubSettingsModel->load($model->getId(),'themeid');
137
+
138
+ // preset_sub_settings and preset_layout_sub_settings will have the same value
139
+ if(!$saveAsTop)
140
+ $saveProcessedData['parent']=$post_data['preset_sub_settings'];
141
+ else
142
+ $saveProcessedData['parent']=0;
143
+ //If Condition will updated the record in themesubsettings table and else will insert a new record
144
+ if($selectCurrentRecord->getId())
145
+ {
146
+ $ThemesubsetId=$selectCurrentRecord->getId();
147
+ $themeSubSettingsModel->setData($saveProcessedData)->setId($ThemesubsetId)->save();
148
+ }
149
+ else
150
+ {
151
+ /* if($saveAsTop)
152
+ {
153
+ //Create new subsetting
154
+ $themeSubSettingsModel->setData($saveProcessedData)->save();
155
+ $saveProcessedData['parent']=$themeSubSettingsModel->getId();
156
+ $saveProcessedData['themeid']=$model->getId();
157
+ $saveProcessedData['subsetname']='';
158
+ }*/
159
+ //Insert the same record and assign it to a theme
160
+ if($post_data['hidden_action_val'])
161
+ $themeSubSettingsModel->setData($saveProcessedData)->save();
162
+ }
163
+
164
+ //Check for values whether to save / Update in themesubsettings table
165
+ $themeSubSettingsModelDel = Mage::getModel('mobilenow/themesubsettings');
166
+ $attributesDel = array('themeid'=> $model->getId(), 'preview'=> 1);
167
+ $selectCurrentRecordDel=$themeSubSettingsModelDel->loadByAttributes($attributesDel);
168
+ if($selectCurrentRecordDel->getId()){
169
+ $selectCurrentRecordDel->delete();
170
+ }
171
+
172
+ $css_var_arr = $this->__setCssVariables($post_data);
173
+ $csspath = Mage::getBaseDir('media').DS.'mobilenow_theme_css'.DS;
174
+ $css_file_name = Mage::getBaseDir('media').DS.'mobilenow_theme_css'.DS.md5($model->getId()).'.css';
175
+ mkdir($csspath);
176
+ $css_string = Mage::helper('mobilenow/theme')->generateThemeCssFile($css_var_arr);
177
+ if (file_exists($css_file_name) ){
178
+ @unlink($css_file_name);
179
+ }
180
+ if($post_data['custom_css'] != ''){
181
+ $css_string .= $post_data['custom_css'];
182
+ }
183
+
184
+ file_put_contents($css_file_name, $css_string);
185
+ // generating homepage layout xml
186
+
187
+
188
+ // echo $css_string;die;
189
+ // echo $css_string;die;
190
+
191
+
192
+ // generating homepage layout xml
193
+ $home_xml_string = Mage::helper('mobilenow/homepage')->generateHomePageLayoutXML($post_data);
194
+
195
+ if($home_xml_string != ''){
196
+ $this->__saveHomePageLayoutXML($model->getId(),$home_xml_string,'cms_index_index',$post_data['stores']);
197
+ }
198
+
199
+
200
+ // generating default layout xml
201
+ $default_xml_string = Mage::helper('mobilenow/homepage')->generateDefaultPageLayoutXML($post_data,md5($model->getId()));
202
+ if($default_xml_string != ''){
203
+ $this->__saveHomePageLayoutXML($model->getId(),$default_xml_string,'default',$post_data['stores']);
204
+ }
205
+
206
+ // generating catalog layout xml
207
+ $catalog_xml_string = Mage::helper('mobilenow/catalogpage')->generateCatalogPageLayoutXML($post_data);
208
+ //echo $catalog_xml_string;die;
209
+ if($catalog_xml_string != ''){
210
+ $this->__saveHomePageLayoutXML($model->getId(),$catalog_xml_string,'catalog_category_layered',$post_data['stores']);
211
+ }
212
+ // generating catalog layout xml
213
+ $catalog_default_xml_string = Mage::helper('mobilenow/catalogpage')->generateCatalogPageLayoutXML($post_data);
214
+ //echo $catalog_xml_string;die;
215
+ if($catalog_default_xml_string != ''){
216
+ $this->__saveHomePageLayoutXML($model->getId(),$catalog_default_xml_string,'catalog_category_default',$post_data['stores']);
217
+ }
218
+ // generating catalog search page layout xml
219
+ $catalog_search_xml_string = Mage::helper('mobilenow/catalogpage')->generateCatalogSearchPageLayoutXML($post_data);
220
+ //echo $catalog_search_xml_string;die;
221
+ if($catalog_search_xml_string != ''){
222
+ $this->__saveHomePageLayoutXML($model->getId(),$catalog_search_xml_string,'catalogsearch_result_index',$post_data['stores']);
223
+ }
224
+ if($this->getRequest()->getParam("id")){
225
+ $cache = Mage::app()->getCache();
226
+ $cache->remove("Mobilethemefront".$this->getRequest()->getParam("id"));
227
+ $cache = Mage::app()->getCache();
228
+ $cache->remove("Mobilethemepreview".$this->getRequest()->getParam("id"));
229
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Theme was updated successfully"));
230
+ } else {
231
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Theme was successfully saved"));
232
+ }
233
+ Mage::getSingleton("adminhtml/session")->setMobilenowData(false);
234
+ if ($this->getRequest()->getParam("back"))
235
+ {
236
+ $arg_array["id"] = $model->getId();
237
+ $this->_redirect("*/*/edit", $arg_array);
238
+ return;
239
+ }
240
+ $this->_redirect("*/*/",$arg_array);
241
+ return;
242
+ }
243
+ /****************************************Save Theme Sub setting only starts here************************************/
244
+ else
245
+ {
246
+ //Condition updates the value in each records (Edit subsettings)
247
+ if($post_data['hidden_selected_val']!='')
248
+ {
249
+
250
+ $themeSubSettingsModel->load($post_data['hidden_selected_val']);
251
+ //Condition to teset primary / Default subsetting
252
+ if($themeSubSettingsModel->getPrimary()==1 || $themeSubSettingsModel->getDefaultsubsetting()==1)
253
+ {
254
+ //If Primary / Default throughs errior messgae
255
+ Mage::getSingleton("adminhtml/session")->addError('Default / Pre-defined Preset Sub Settings Cannot be edited. Please create a new theme.');
256
+ //$themeSubSettingsModel->setData($saveProcessedData)->setId($post_data['hidden_selected_val']);
257
+ // Condition to check whether we are from new/edit action
258
+ if ($this->getRequest()->getParam("back"))
259
+ {
260
+ //Set the parameter and redirect
261
+ $arg_array["id"] = $this->getRequest()->getParam("id");
262
+ $this->_redirect("*/*/edit", $arg_array);
263
+ return;
264
+ }
265
+ $this->_redirect("*/*/",$arg_array);
266
+ return;
267
+ }
268
+ else
269
+ {
270
+ $saveProcessedData=Mage::helper("mobilenow")->ProcessThemeDesignFormData($post_data,'',$this->getRequest()->getParam("id"));
271
+ //Set The Data to update
272
+ $getsubsetIdToSet=$themeSubSettingsModel->getcollection()->addFieldToFilter('themeid',$this->getRequest()->getParam("id"))->addFieldToFilter('preview','0')->getFirstItem();
273
+ $saveProcessedData['parent']=$post_data['preset_sub_settings'];
274
+ $currentSubsetId= $getsubsetIdToSet->getId();
275
+ $themeSubSettingsModel->setData($saveProcessedData)->setId($currentSubsetId);
276
+ $arg_array["load_id"] = $post_data['hidden_selected_val'];
277
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Preset Sub Settings was sucessfully Updated"));
278
+ }
279
+ }
280
+ else
281
+ {
282
+ $saveProcessedData=Mage::helper("mobilenow")->ProcessThemeDesignFormData($post_data,$button_type,$this->getRequest()->getParam("id"));
283
+ //Set the Data to Insert
284
+ $themeSubSettingsModel->setData($saveProcessedData);
285
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Preset Sub Settings was successfully saved"));
286
+ }
287
+ //save Data
288
+ $themeSubSettingsModel->save();
289
+ if ($this->getRequest()->getParam("back"))
290
+ {
291
+ $arg_array["id"] = $this->getRequest()->getParam("id");
292
+ if(!$arg_array["load_id"])
293
+ $arg_array["load_id"] = $themeSubSettingsModel->getId();
294
+ $this->_redirect("*/*/edit", $arg_array);
295
+ return;
296
+ }
297
+ $this->_redirect("*/*/",$arg_array);
298
+ return;
299
+ }
300
+ }
301
+ catch (Exception $e) {
302
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
303
+ Mage::getSingleton("adminhtml/session")->setMobilenowData($this->getRequest()->getPost());
304
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
305
+ return;
306
+ }
307
+
308
+ }
309
+ }
310
+ public function deleteAction()
311
+ {
312
+ if( $this->getRequest()->getParam("id") > 0 ) {
313
+ try {
314
+ $model = Mage::getModel("mobilenow/mobilenow");
315
+ $model->setId($this->getRequest()->getParam("id"))->delete();
316
+ $subsetModel= Mage::getModel("mobilenow/themesubsettings")->load($this->getRequest()->getParam("id"),'themeid');
317
+ $subsetDeleteId=$subsetModel->getId();
318
+ $subsetModel->setId($subsetDeleteId)->delete();
319
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Theme was successfully deleted"));
320
+ $this->_redirect("*/*/");
321
+ }
322
+ catch (Exception $e) {
323
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
324
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
325
+ }
326
+ }
327
+ $this->_redirect("*/*/");
328
+ }
329
+ public function massRemoveAction()
330
+ {
331
+ try {
332
+ $ids = $this->getRequest()->getPost('theme_ids', array());
333
+ foreach ($ids as $id) {
334
+ $model = Mage::getModel("mobilenow/mobilenow");
335
+ $model->setId($id)->delete();
336
+ }
337
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
338
+ }
339
+ catch (Exception $e) {
340
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
341
+ }
342
+ $this->_redirect('*/*/');
343
+ }
344
+ /**
345
+ * Export order grid to CSV format
346
+ */
347
+ public function exportCsvAction()
348
+ {
349
+ $fileName = 'mobilenow.csv';
350
+ $grid = $this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_grid');
351
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
352
+ }
353
+ /**
354
+ * Export order grid to Excel XML format
355
+ */
356
+ public function exportExcelAction()
357
+ {
358
+ $fileName = 'mobilenow.xml';
359
+ $grid = $this->getLayout()->createBlock('mobilenow/adminhtml_mobilenow_grid');
360
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
361
+ }
362
+ /**
363
+ * Redirected To Mobilenowapp
364
+ */
365
+ public function helpAction()
366
+ {
367
+ $this->_redirectUrl('https://mobilenowapp.com/am/login/index');
368
+ }
369
+ public function statusAction()
370
+ {
371
+ $id=$this->getRequest()->getParam('theme_id');
372
+ $status=$this->getRequest()->getParam('status_id');
373
+ try
374
+ {
375
+ if ($status==0)
376
+ {
377
+ $data=array('status'=>1);
378
+ $correspondingMsg='Theme has been activated successfully';
379
+ }
380
+ else
381
+ {
382
+ $data=array('status'=>0);
383
+ $correspondingMsg='Theme has been deactivated successfully';
384
+ }
385
+ $model = Mage::getModel('mobilenow/mobilenow')->load($id)->addData($data);
386
+ if($model->setId($id)->save())
387
+ {
388
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__($correspondingMsg));
389
+ }
390
+ }
391
+ catch (Exception $e)
392
+ {
393
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
394
+ }
395
+ $this->_redirect('*/*/');
396
+ }
397
+ public function _loadSubsettings($loadId,$loadReset)
398
+ {
399
+ $getSubsettings=Mage::getModel("mobilenow/themesubsettings");
400
+ $id=$this->getRequest()->getParam("id");
401
+ $subsetParentId='';
402
+ if($loadId!='')
403
+ {
404
+ $checkLoadIdInParent=$getSubsettings->getcollection()->addFieldToFilter('parent',$loadId)->addFieldToFilter('themeid',$id)->getFirstItem();
405
+ if($checkLoadIdInParent->getParent())
406
+ {
407
+ $getSubsetDefaultId=$checkLoadIdInParent->getId();
408
+ $subsetParentId=$checkLoadIdInParent->getParent();
409
+ }
410
+ else
411
+ {
412
+ $getSubsetDefaultId=$loadId;
413
+ }
414
+ }
415
+ else
416
+ {
417
+ //Check whether we are in edit/new action
418
+ if($this->getRequest()->getParam("id"))
419
+ {
420
+ $checkThemeidInSubset=$getSubsettings->load($this->getRequest()->getParam("id"),'themeid');
421
+ $subsetParentId=$checkThemeidInSubset->getParent();
422
+ }
423
+ if($subsetParentId!='')
424
+ {
425
+ $getSubsetDefaultId=$checkThemeidInSubset->getId();
426
+ }
427
+ else
428
+ {
429
+ if($loadReset)
430
+ {
431
+ $getSubsetDefaultId=$loadReset;
432
+ }
433
+ else
434
+ {
435
+ $getDefaultIds=$getSubsettings->load(1,'defaultsubsetting');
436
+ $getSubsetDefaultId=$getDefaultIds->getId();
437
+ }
438
+ }
439
+ }
440
+ $subsettingsModel=$getSubsettings->load($getSubsetDefaultId);
441
+ $setBothFormData=Mage::helper("mobilenow")->setDesignAndLayoutFormData($subsettingsModel,$getSubsetDefaultId,$subsetParentId);
442
+ return Mage::register("subsettings_data", $setBothFormData);
443
+ }
444
+ public function deleteSettingsAction()
445
+ {
446
+ if($this->getRequest()->getParam('delete_id') > 0)
447
+ {
448
+ try
449
+ {
450
+ $model = Mage::getModel("mobilenow/themesubsettings");
451
+ $getModelData=$model->load($this->getRequest()->getParam("delete_id"));
452
+ if($getModelData->getPrimary()!=1 && $getModelData->getDefaultsubsetting()!=1)
453
+ {
454
+ $restrictDelete=$model->load($this->getRequest()->getParam("delete_id"),'parent');
455
+ if($restrictDelete->getParent())
456
+ {
457
+ Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminhtml")->__("Sub settings is used by Theme, cannot be Deleted"));
458
+ }
459
+ else
460
+ {
461
+ $model->setId($this->getRequest()->getParam("delete_id"))->delete();
462
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Preset Sub Settings was successfully deleted"));
463
+ }
464
+ $this->_mobilenowRedirect();
465
+ }
466
+ else
467
+ {
468
+ $this->_loadSubsettings($this->getRequest()->getParam("delete_id"));
469
+ Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminhtml")->__("Default / Pre-defined Preset Sub Settings Cannot be deleted"));
470
+ $this->_mobilenowRedirect();
471
+ }
472
+ }
473
+ catch (Exception $e)
474
+ {
475
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
476
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
477
+ }
478
+ }
479
+ // $this->_redirect("*/*/");
480
+ }
481
+ public function _mobilenowRedirect($resetDeleteId)
482
+ {
483
+ //$arg_array = array();
484
+ if($this->getRequest()->getParam("active_tab"))
485
+ $arg_array['active_tab'] = $this->getRequest()->getParam("active_tab");
486
+ if($this->getRequest()->getParam("design_subtab"))
487
+ $arg_array['design_subtab'] = $this->getRequest()->getParam("design_subtab");
488
+ if($this->getRequest()->getParam("layout_subtab"))
489
+ $arg_array['layout_subtab'] = $this->getRequest()->getParam("layout_subtab");
490
+ if($resetDeleteId)
491
+ $arg_array['reset_delete'] = $resetDeleteId;
492
+
493
+ if($this->getRequest()->getParam("id")!='')
494
+ {$arg_array['id'] = $this->getRequest()->getParam("id");
495
+ $this->_redirect("*/*/edit", $arg_array);
496
+ }
497
+ else
498
+ {
499
+ $this->_redirect("*/*/new",$arg_array);
500
+ }
501
+ }
502
+ public function checkUniqueNameSaveAction()
503
+ {
504
+ $checkUniqueName=$this->getRequest()->getParam('subsetname');
505
+ $collectionCheck=Mage::getModel('mobilenow/themesubsettings')->load($checkUniqueName,'subsetname');
506
+ echo $collectionCheck->getId();
507
+ }
508
+ public function resetSubsettingsAction()
509
+ {
510
+ $getSubsettings=Mage::getModel("mobilenow/themesubsettings");
511
+ if($this->getRequest()->getParam("reset_id"))
512
+ {
513
+ $resetDeleteId=$this->getRequest()->getParam("reset_delete");
514
+ $resetCheck=$getSubsettings->getcollection()->addFieldToFilter('parent',$resetDeleteId)->addFieldToFilter('themeid',$this->getRequest()->getParam("id"))->getFirstItem();
515
+ if($resetCheck->getParent())
516
+ {
517
+ $resetProceedDelete=$resetCheck->getId();
518
+ $getSubsettings->setId($resetProceedDelete)->delete();
519
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Preset Sub Settings was successfully Reset to Default."));
520
+ }
521
+ else
522
+ {
523
+ Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminhtml")->__("Preset Sub Settings cannot reset further."));
524
+ }
525
+ $this->_mobilenowRedirect($this->getRequest()->getParam("reset_delete"));
526
+ }
527
+ }
528
+
529
+ // function for saving homepage layout xml
530
+ public function __saveHomePageLayoutXML($theme_id,$home_xml_string,$handle,$stores = array(),$preview = 0){
531
+ //selecting layout update id
532
+ $themeLayoutSettingsCollection = Mage::getModel('mobilenow/themelayoutsettings')->getCollection();
533
+ $themeLayoutSettingsCollection->addFieldToFilter('main_table.theme_id',$theme_id);
534
+ if($preview == 1){
535
+ $themeLayoutSettingsCollection->addFieldToFilter('main_table.preview',$preview);
536
+ }
537
+ $themeLayoutSettingsCollection->addFieldToFilter('layoutupdate.handle',$handle);
538
+ $themeLayoutSettingsCollection->getSelect()->group('main_table.layout_update_id')->join( array('layoutupdate'=>'core_layout_update'), 'main_table.layout_update_id = layoutupdate.layout_update_id',array('layoutupdate.handle'));
539
+ $currentThemeSetings = $themeLayoutSettingsCollection->getData();
540
+
541
+ //$collection->getSelect()->join( array('table_alias'=>$this->getTable('module/table_name')), 'main_table.foreign_id = table_alias.primary_key', array('table_alias.*'), 'schema_name_if_different');
542
+
543
+
544
+ // echo $themeLayoutSettingsCollection->printLogQuery(true);die;
545
+ //echo '<pre>';print_r($currentThemeSetings);echo '</pre>';
546
+ // var_dump($currentThemeSetings[0]['layout_update_id']);die;
547
+
548
+
549
+ if($preview == 0){
550
+ $themeLayoutSettingsCollectionDel = Mage::getModel('mobilenow/themelayoutsettings')->getCollection();
551
+ $themeLayoutSettingsCollectionDel->addFieldToFilter('main_table.theme_id',$theme_id);
552
+ $themeLayoutSettingsCollectionDel->addFieldToFilter('main_table.preview',1);
553
+ $themeLayoutSettingsCollectionDel->addFieldToFilter('layoutupdate.handle',$handle);
554
+ $themeLayoutSettingsCollectionDel->getSelect()->group('main_table.layout_update_id')->join( array('layoutupdate'=>'core_layout_update'), 'main_table.layout_update_id = layoutupdate.layout_update_id',array('layoutupdate.handle'));
555
+ $currentThemeSetingsDel = $themeLayoutSettingsCollectionDel->getData();
556
+ if(is_array($currentThemeSetingsDel) && count($currentThemeSetingsDel) > 0) {
557
+ $coreLayoutUpdateModelDel = Mage::getModel('mobilenow/corelayoutupdate');
558
+
559
+ foreach($currentThemeSetingsDel as $delThem){ //print_r($delThem['layout_update_id']);die;
560
+ //$coreLayoutUpdateCollection->addFieldToFilter('layout_update_id',$delThem['layout_update_id']);
561
+ $coreLayoutUpdateModelDel->load($delThem['layout_update_id'])->delete();
562
+ }
563
+ }
564
+ }
565
+
566
+ $coreLayoutUpdateModel = Mage::getModel('mobilenow/corelayoutupdate');
567
+ //for updating the existing record
568
+ if(is_array($currentThemeSetings) && count($currentThemeSetings) > 0) {
569
+ if($currentThemeSetings[0]['layout_update_id']){
570
+ $coreLayoutUpdateModel->setLayoutUpdateId($currentThemeSetings[0]['layout_update_id']);
571
+ }
572
+ }
573
+ $coreLayoutUpdateModel->setHandle($handle);
574
+ $coreLayoutUpdateModel->setXml($home_xml_string);
575
+ $coreLayoutUpdateModel->setSortOrder(0);
576
+ $coreLayoutUpdateModel->save();
577
+ //for deleting related records from core_layout_link and themelayoutsettings
578
+ if(is_array($currentThemeSetings) && count($currentThemeSetings) > 0) {
579
+
580
+ $coreLayoutLinkCollection = Mage::getModel('mobilenow/corelayoutlink')->getCollection();
581
+ $ids = array();
582
+ foreach($currentThemeSetings as $currentTh) {
583
+ $ids[] = $currentTh['layout_update_id'];
584
+ }
585
+ // $coreLayoutLinkCollection->addFieldToFilter('layout_update_id', $currentThemeSetings[0]['layout_update_id']);
586
+ $coreLayoutLinkCollection->addFieldToFilter('layout_update_id', array('in' => $ids));
587
+ foreach($coreLayoutLinkCollection as $corelayout){
588
+ $corelayout->delete();
589
+ }
590
+
591
+ }
592
+
593
+ foreach($stores as $store_id){
594
+ $coreLayoutLinkModel = Mage::getModel('mobilenow/corelayoutlink');
595
+ $coreLayoutLinkModel->setStoreId($store_id);
596
+ $coreLayoutLinkModel->setArea('frontend');
597
+ $coreLayoutLinkModel->setPackage('redstage-mobilenow');
598
+ $coreLayoutLinkModel->setTheme('default');
599
+ $coreLayoutLinkModel->setLayoutUpdateId($coreLayoutUpdateModel->getLayoutUpdateId());
600
+ $coreLayoutLinkModel->save();
601
+ $themeLayoutSettingsModel = Mage::getModel('mobilenow/themelayoutsettings');
602
+ $themeLayoutSettingsModel->setThemeId($theme_id);
603
+ $themeLayoutSettingsModel->setLayoutLinkId($coreLayoutLinkModel->getLayoutLinkId());
604
+ $themeLayoutSettingsModel->setLayoutUpdateId($coreLayoutUpdateModel->getLayoutUpdateId());
605
+ $themeLayoutSettingsModel->setPreview($preview);
606
+ $themeLayoutSettingsModel->save();
607
+ }
608
+ }
609
+ public function mobileConnectAction()
610
+ {
611
+ $email=$this->getRequest()->getParam('email');
612
+ $username=$this->getRequest()->getParam('username');
613
+ $password=$this->getRequest()->getParam('password');
614
+ $this->_thirdPartyAuthenticate($url,$email,$username,$password,'connect');
615
+ }
616
+ public function disconnectMobilenowAction()
617
+ {
618
+ $subscriptionstatus = json_decode(Mage::getStoreConfig('mobilenowsettings/mobilenowaccount/subscription'));
619
+ if($subscriptionstatus->subscritionStatus=='active')
620
+ {
621
+ $subscriptionstatus->subscritionStatus='inactive';
622
+ }
623
+ $subscriptionstatus=json_encode($subscriptionstatus);
624
+ $mobilenowConfigSave = new Mage_Core_Model_Config();
625
+ $mobilenowConfigSave ->saveConfig('mobilenowsettings/mobilenowaccount/subscription', $subscriptionstatus, 'default', 0);
626
+ $deactivateAllThemes=Mage::getModel('mobilenow/mobilenow');
627
+ $collectionthemes=$deactivateAllThemes->getCollection()->addFieldToFilter('status',1);
628
+ foreach($collectionthemes as $deactivateAllTheme)
629
+ {
630
+ $changeStatus['status']=0;
631
+ $currThemeId=$deactivateAllTheme->getThemeId();
632
+ $deactivateAllThemes->load($currThemeId)->addData($changeStatus)->setId($currThemeId)->save();
633
+ }
634
+ Mage::app()->cleanCache();
635
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Your MobileNow account settings has been disconnected."));
636
+ $this->_redirect("adminhtml/system_config/edit/section/mobilenowsettings/");
637
+ }
638
+ public function refreshMobilenowACtion()
639
+ {
640
+ $email=$this->getRequest()->getParam('email');
641
+ $username=Mage::getStoreConfig('mobilenowsettings/mobilenowaccount/username');
642
+ $password=Mage::getStoreConfig('mobilenowsettings/mobilenowaccount/password');
643
+ $this->_thirdPartyAuthenticate($url,$email,$username,$password,'refresh');
644
+ }
645
+ public function _thirdPartyAuthenticate($url,$email,$username,$password,$status)
646
+ {
647
+ // $certUrl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/www.mobilenowapp.com';
648
+ $key='mrrzwfNuE0ACLCDZyOMR';
649
+ $url = 'https://mobilenowapp.com/am/api/check-access/by-login-pass?_key='.$key.'&login='.$email.'&pass='.$password;
650
+ //open connection
651
+ $ch = curl_init();
652
+ //set the url, number of POST vars, POST data
653
+ curl_setopt($ch, CURLOPT_URL,$url);
654
+ curl_setopt($ch, CURLOPT_HEADER, 0);
655
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
656
+ // curl_setopt($ch, CURLOPT_USERPWD, 'secure:6f2TGHt4_');
657
+ // curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
658
+ curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
659
+ curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
660
+ //execute post
661
+ $result = curl_exec($ch);
662
+ $resultDecode=json_decode($result);
663
+ $memberDetails=array();
664
+ $memberDetails['ok']=$resultDecode->ok;
665
+ if($resultDecode->name) $memberDetails['name']=$resultDecode->name;
666
+ if($resultDecode->subscriptions)
667
+ {
668
+ $memberSubscriptions=$resultDecode->subscriptions;
669
+ foreach($memberSubscriptions as $key=>$memberSubscription)
670
+ {
671
+ $subscribe['productId']=$key;
672
+ $subscribe['subscrptionDate']=$memberSubscription;
673
+ /*if($key==2)
674
+ {*/
675
+ $dateExpire=$memberSubscription;
676
+ $today = date("Y-m-d");
677
+ $days = (strtotime($dateExpire) - strtotime($today)) / (60 * 60 * 24);
678
+ $subscribe['daysRemaining']=$days;
679
+ $resultDecode->daysRemaining=$days;
680
+ //}
681
+ $subscribe['subscritionStatus']='active';
682
+ }
683
+ $memberDetails['subscriptions']=json_encode($subscribe);
684
+ }
685
+ if($resultDecode->msg) $memberDetails['msg']=$resultDecode->msg;
686
+ if($memberDetails['ok'])
687
+ {
688
+ $mobilenowConfigSave = new Mage_Core_Model_Config();
689
+ $mobilenowConfigSave->saveConfig('mobilenowsettings/mobilenowaccount/subscription', $memberDetails['subscriptions'], 'default', 0);
690
+ $mobilenowConfigSave->saveConfig('mobilenowsettings/mobilenowaccount/email', $email, 'default', 0);
691
+ $mobilenowConfigSave->saveConfig('mobilenowsettings/mobilenowaccount/username', $username, 'default', 0);
692
+ $mobilenowConfigSave->saveConfig('mobilenowsettings/mobilenowaccount/password', $password, 'default', 0);
693
+ }
694
+ Mage::app()->cleanCache();
695
+ /* if(curl_exec($ch) === false)
696
+ {
697
+ echo 'Curl error: ' . curl_error($ch);
698
+ }
699
+ else
700
+ {
701
+ echo 'Operation completed without any errors';
702
+ }*/
703
+ print_r(json_encode($resultDecode));
704
+ //close connection
705
+ curl_close($ch);
706
+ }
707
+
708
+ public function __setCssVariables($post_data){
709
+ $css_var_arr = array();
710
+ $css_var_arr['background_color'] = $post_data['background_color'];
711
+ $css_var_arr['search_cart_area_bg_color'] = $post_data['search_cart_bg_color'];
712
+ $css_var_arr['cart_link_color'] = $post_data['cart_link_color'];
713
+ $css_var_arr['links_color'] = $post_data['links_color'];
714
+ $css_var_arr['text_color'] = $post_data['text_color'];
715
+ $css_var_arr['categories_bg_color'] = $post_data['categories_background_color'];
716
+ $css_var_arr['categories_bg_borderwidth'] = ($post_data['categories_background_color'] != '')?'1':'0';
717
+ $css_var_arr['button_bg_color'] = $post_data['button_background_color'];
718
+ $css_var_arr['button_border_color'] = $post_data['button_border_color'];
719
+ $css_var_arr['button_text_color'] = $post_data['button_text_color'];
720
+
721
+ $css_var_arr['breadcrumb_bg_color'] = $post_data['breadcrumbs_bg_color'];
722
+ $css_var_arr['breadcrumb_font_color'] = $post_data['breadcrumbs_font_color'];
723
+
724
+ $css_var_arr['toolbar_bg_color'] = $post_data['toolbar_bg_color'];
725
+ $css_var_arr['toolbar_text_color'] = $post_data['toolbar_text_color'];
726
+ $css_var_arr['pagination_panel_bg_color'] = $post_data['pagination_bg_color'];
727
+ $css_var_arr['pagination_button_bg_color'] = $post_data['pagination_button_bg_color'];
728
+ $css_var_arr['pagination_button_text_color'] = $post_data['pagination_button_text_color'];
729
+
730
+ $css_var_arr['image_border_color'] = $post_data['image_border_color'];
731
+ $css_var_arr['image_border_width'] = ($post_data['show_image_border'] != '')?(($post_data['catalog_image_width'] != '')?$post_data['catalog_image_width']:'1'):'0';
732
+ $css_var_arr['product_title_color'] = $post_data['product_title_color'];
733
+ $css_var_arr['product_price_color'] = $post_data['product_price_color'];
734
+ $css_var_arr['product_special_price_color'] = $post_data['product_special_price_color'];
735
+ $css_var_arr['review_star_color'] = $post_data['review_star_color'];
736
+
737
+ $css_var_arr['add_to_cart_bg_color'] = $post_data['add_to_cart_button_bg_color'];
738
+ $css_var_arr['add_to_cart_button_text_color'] = $post_data['add_to_cart_button_font_color'];
739
+ $css_var_arr['add_to_cart_border_color'] = $post_data['add_to_cart_button_border_color'];
740
+ $css_var_arr['gridlines_color'] = $post_data['gridlines_color'];
741
+ $css_var_arr['gridlines_color_width'] = ($post_data['gridlines_color'] != '')?'1':'0';
742
+ $css_var_arr['newsletter_bg_color'] = $post_data['newsletter_area_backgorund'];
743
+
744
+ $css_var_arr['productpage_title_color'] = $post_data['productpage_title_color'];
745
+ $css_var_arr['product_image_border_color'] = $post_data['product_image_border_color'];
746
+ $css_var_arr['product_image_border_width'] = ($post_data['product_image_border_color'] != '')?'1':'0';
747
+ $css_var_arr['product_description_color'] = $post_data['product_description_color'];
748
+ $css_var_arr['additional_information_bg_color'] = $post_data['additional_information_bg_color'];
749
+ $css_var_arr['additional_information_font_color'] = $post_data['additional_information_font_color'];
750
+ $css_var_arr['full_reviews_bg_color'] = $post_data['full_reviews_bg_color'];
751
+ $css_var_arr['full_reviews_font_color'] = $post_data['full_reviews_font_color'];
752
+ return $css_var_arr;
753
+ }
754
+ public function updatePreviewAction()
755
+ {
756
+ $post_data=$this->getRequest()->getPost();
757
+ if($post_data['show_learn_more']!=1)$post_data['show_learn_more']=0;
758
+ if(!isset($post_data['stores']) || count($post_data['stores']) == 0){
759
+ $post_data['stores'] = array(0);
760
+ }
761
+ if ($post_data & $post_data['stores'])
762
+ {
763
+ try
764
+ {
765
+ $themeSubSettingsModel = Mage::getModel('mobilenow/themesubsettings');
766
+ if ($this->getRequest()->getParam("theme_id")){
767
+ $theme_id = $this->getRequest()->getParam("theme_id");
768
+ $model = Mage::getModel("mobilenow/mobilenow")->load($theme_id,'theme_id');
769
+
770
+ $createnewThemeFlag='';
771
+ //Save Preset Subsettings with respect to Theme
772
+ $saveProcessedData=Mage::helper("mobilenow")->ProcessThemeDesignFormData($post_data,'',$model->getId(),$createnewThemeFlag,'1');
773
+
774
+ //Check for values whether to save / Update in themesubsettings table
775
+ $attributes = array('themeid'=> $model->getId(), 'preview'=> 1);
776
+ $selectCurrentRecord=$themeSubSettingsModel->loadByAttributes($attributes);
777
+ // preset_sub_settings and preset_layout_sub_settings will have the same value
778
+ $saveProcessedData['parent']=$post_data['preset_sub_settings'];
779
+ //If Condition will updated the record in themesubsettings table and else will insert a new record
780
+ if($selectCurrentRecord->getId())
781
+ {
782
+ $ThemesubsetId=$selectCurrentRecord->getId();
783
+ $themeSubSettingsModel->setData($saveProcessedData)->setId($ThemesubsetId)->save();
784
+ }
785
+ else
786
+ {
787
+ $saveProcessedData['preview'] = 1;
788
+ //Insert the same record and assign it to a theme
789
+ $themeSubSettingsModel->setData($saveProcessedData)->save();
790
+ }
791
+ $css_var_arr = $this->__setCssVariables($post_data);
792
+ $csspath = Mage::getBaseDir('media').DS.'mobilenow_theme_css'.DS;
793
+ $css_file_name = Mage::getBaseDir('media').DS.'mobilenow_theme_css'.DS.md5($model->getId().'_preview').'.css';
794
+ mkdir($csspath);
795
+ $css_string = Mage::helper('mobilenow/theme')->generateThemeCssFile($css_var_arr);
796
+ if (file_exists($css_file_name) ){
797
+ @unlink($css_file_name);
798
+ }
799
+ if($post_data['custom_css'] != ''){
800
+ $css_string .= $post_data['custom_css'];
801
+ }
802
+
803
+ file_put_contents($css_file_name, $css_string);
804
+ // generating homepage layout xml
805
+
806
+
807
+ // echo $css_string;die;
808
+ // echo $css_string;die;
809
+
810
+
811
+ // generating homepage layout xml
812
+ $home_xml_string = Mage::helper('mobilenow/homepage')->generateHomePageLayoutXML($post_data);
813
+
814
+ if($home_xml_string != ''){
815
+ $this->__saveHomePageLayoutXML($model->getId(),$home_xml_string,'cms_index_index',$post_data['stores'],1);
816
+ }
817
+
818
+
819
+ // generating default layout xml
820
+ $default_xml_string = Mage::helper('mobilenow/homepage')->generateDefaultPageLayoutXML($post_data,md5($model->getId().'_preview'));
821
+ if($default_xml_string != ''){
822
+ $this->__saveHomePageLayoutXML($model->getId(),$default_xml_string,'default',$post_data['stores'],1);
823
+ }
824
+
825
+ // generating catalog layout xml
826
+ $catalog_xml_string = Mage::helper('mobilenow/catalogpage')->generateCatalogPageLayoutXML($post_data);
827
+ //echo $catalog_xml_string;die;
828
+ if($catalog_xml_string != ''){
829
+ $this->__saveHomePageLayoutXML($model->getId(),$catalog_xml_string,'catalog_category_layered',$post_data['stores'],1);
830
+ }
831
+ // generating catalog layout xml
832
+ $catalog_default_xml_string = Mage::helper('mobilenow/catalogpage')->generateCatalogPageLayoutXML($post_data);
833
+ //echo $catalog_xml_string;die;
834
+ if($catalog_default_xml_string != ''){
835
+ $this->__saveHomePageLayoutXML($model->getId(),$catalog_default_xml_string,'catalog_category_default',$post_data['stores'],1);
836
+ }
837
+ // generating catalog search page layout xml
838
+ $catalog_search_xml_string = Mage::helper('mobilenow/catalogpage')->generateCatalogSearchPageLayoutXML($post_data);
839
+ //echo $catalog_search_xml_string;die;
840
+ if($catalog_search_xml_string != ''){
841
+ $this->__saveHomePageLayoutXML($model->getId(),$catalog_search_xml_string,'catalogsearch_result_index',$post_data['stores'],1);
842
+ }
843
+
844
+ $cache = Mage::app()->getCache();
845
+ $cache->remove("Mobilethemepreview".$theme_id);
846
+
847
+ echo 'success';die;
848
+
849
+ }else{
850
+ echo 'failed';
851
+
852
+ }
853
+ die;
854
+ }
855
+ catch (Exception $e) {
856
+ echo $e->getMessage();
857
+
858
+ die;
859
+ }
860
+
861
+ }
862
+ }
863
+
864
+ public function uploadDesignImageAction(){
865
+ $theme_id = $this->getRequest()->getParam("theme_id");
866
+ $data = array();
867
+ $data['mesasage'] = 'success';
868
+ $data['preview_name'] = '';
869
+ if ($this->getRequest()->getParam("upload_type") == 'logo'){
870
+ if($_FILES['logo']['name']!=''){ $logo = time().str_replace(' ', '_',$_FILES['logo']['name']);}//else{$themeSubSettings['logo']='';}
871
+ if(trim($logo)!='')
872
+ {
873
+ try{
874
+ $path = Mage::getBaseDir('media').DS.'mobilenow_theme_images'.DS.'logo'.DS.'preview'.DS.$theme_id;
875
+ $uploader = new Varien_File_Uploader('logo');
876
+ $uploader->setAllowedExtensions(array('jpg','jpeg','png','gif'));
877
+ $uploader->setAllowCreateFolders(true);
878
+ $uploader->setAllowRenameFiles(false);
879
+ $uploader->setFilesDispersion(false);
880
+ $uploader->save($path,$logo);
881
+ $data['preview_name'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobilenow_theme_images'.DS.'logo'.DS.'preview'.DS.$theme_id.DS.$logo;
882
+ } catch (Exception $e) {
883
+ $data['mesasage'] = $e->getMessage();
884
+ }
885
+ }
886
+ $data['logo_image_name'] = $logo;
887
+ echo json_encode($data);
888
+ exit;
889
+ } else if($this->getRequest()->getParam("upload_type") == 'banner'){
890
+ if($_FILES['homepage_banner']['name']!=''){ $logo = time().str_replace(' ', '_',$_FILES['homepage_banner']['name']);}//else{$themeSubSettings['logo']='';}
891
+ if(trim($logo)!='')
892
+ {
893
+ try{
894
+ $path = Mage::getBaseDir('media').DS.'mobilenow_theme_images'.DS.'banner'.DS.'preview'.DS.$theme_id;
895
+ $uploader = new Varien_File_Uploader('homepage_banner');
896
+ $uploader->setAllowedExtensions(array('jpg','jpeg','png','gif'));
897
+ $uploader->setAllowCreateFolders(true);
898
+ $uploader->setAllowRenameFiles(false);
899
+ $uploader->setFilesDispersion(false);
900
+ $uploader->save($path,$logo);
901
+ $data['preview_name'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobilenow_theme_images'.DS.'banner'.DS.'preview'.DS.$theme_id.DS.$logo;
902
+ } catch (Exception $e) {
903
+ $data['mesasage'] = $e->getMessage();
904
+ }
905
+ }
906
+ $data['banner_image_name'] = $logo;
907
+ echo json_encode($data);
908
+ exit;
909
+ }
910
+ }
911
+ }
app/code/community/Redstage/Mobilenow/controllers/Adminhtml/MobilenowbackendController.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_Adminhtml_MobilenowbackendController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_title($this->__("Backend Page Title"));
8
+ $this->renderLayout();
9
+ }
10
+ }
app/code/community/Redstage/Mobilenow/controllers/IndexController.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Redstage_Mobilenow_IndexController extends Mage_Core_Controller_Front_Action{
3
+ public function IndexAction() {
4
+
5
+ $this->loadLayout();
6
+ $this->getLayout()->getBlock("head")->setTitle($this->__("Mobile Now"));
7
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
8
+ $breadcrumbs->addCrumb("home", array(
9
+ "label" => $this->__("Home Page"),
10
+ "title" => $this->__("Home Page"),
11
+ "link" => Mage::getBaseUrl()
12
+ ));
13
+
14
+ $breadcrumbs->addCrumb("mobile now", array(
15
+ "label" => $this->__("Mobile Now"),
16
+ "title" => $this->__("Mobile Now")
17
+ ));
18
+ $this->renderLayout();
19
+
20
+ }
21
+ }
app/code/community/Redstage/Mobilenow/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <mobilenowsettings translate="title" module="mobilenow">
12
+ <title>Settings Section</title>
13
+ <sort_order>101</sort_order>
14
+ </mobilenowsettings>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Redstage/Mobilenow/etc/config.xml ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Redstage_Mobilenow>
5
+ <version>0.1.4</version>
6
+ </Redstage_Mobilenow>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <mobilenow>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Redstage_Mobilenow</module>
14
+ <frontName>mobilenow</frontName>
15
+ </args>
16
+ </mobilenow>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <mobilenow>
21
+ <file>mobilenow.xml</file>
22
+ </mobilenow>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <helpers>
28
+ <cms>
29
+ <rewrite>
30
+ <page>Redstage_Mobilenow_Helper_Cms_Page</page>
31
+ </rewrite>
32
+ </cms>
33
+ <mobilenow>
34
+ <class>Redstage_Mobilenow_Helper</class>
35
+ </mobilenow>
36
+ </helpers>
37
+ <blocks>
38
+ <mobilenow>
39
+ <class>Redstage_Mobilenow_Block</class>
40
+ </mobilenow>
41
+ </blocks>
42
+ <models>
43
+ <core>
44
+ <rewrite>
45
+ <design_package>Redstage_Mobilenow_Model_Design_Package</design_package>
46
+ <layout_update>Redstage_Mobilenow_Model_Layout_Update</layout_update>
47
+ </rewrite>
48
+ </core>
49
+ <core_resource>
50
+ <rewrite>
51
+ <layout>Redstage_Mobilenow_Model_Resource_Layout</layout>
52
+ </rewrite>
53
+ </core_resource>
54
+
55
+ <mobilenow>
56
+ <class>Redstage_Mobilenow_Model</class>
57
+ <resourceModel>mobilenow_mysql4</resourceModel>
58
+ </mobilenow>
59
+ <mobilenow_mysql4>
60
+ <class>Redstage_Mobilenow_Model_Mysql4</class>
61
+ <entities>
62
+ <mobilenow>
63
+ <table>themesettings</table>
64
+ </mobilenow>
65
+ <themestore>
66
+ <table>theme_store_id</table>
67
+ </themestore>
68
+ <themesubsettings>
69
+ <table>themesubsettings</table>
70
+ </themesubsettings>
71
+ <corelayoutupdate>
72
+ <table>core_layout_update</table>
73
+ </corelayoutupdate>
74
+ <corelayoutlink>
75
+ <table>core_layout_link</table>
76
+ </corelayoutlink>
77
+ <themelayoutsettings>
78
+ <table>themelayoutsettings</table>
79
+ </themelayoutsettings>
80
+ </entities>
81
+ </mobilenow_mysql4>
82
+ </models>
83
+ <resources>
84
+ <mobilenow_setup>
85
+ <setup>
86
+ <module>Redstage_Mobilenow</module>
87
+ </setup>
88
+ <connection>
89
+ <use>core_setup</use>
90
+ </connection>
91
+ </mobilenow_setup>
92
+ <mobilenow_write>
93
+ <connection>
94
+ <use>core_write</use>
95
+ </connection>
96
+ </mobilenow_write>
97
+ <mobilenow_read>
98
+ <connection>
99
+ <use>core_read</use>
100
+ </connection>
101
+ </mobilenow_read>
102
+ </resources>
103
+ </global>
104
+ <admin>
105
+ <routers>
106
+ <mobilenow>
107
+ <use>admin</use>
108
+ <args>
109
+ <module>Redstage_Mobilenow</module>
110
+ <frontName>mobilenow</frontName>
111
+ </args>
112
+ </mobilenow>
113
+ </routers>
114
+ </admin>
115
+ <adminhtml>
116
+ <menu>
117
+ <mobilenow module="mobilenow">
118
+ <title>MobileNow</title>
119
+ <sort_order>90</sort_order>
120
+ <children>
121
+ <!--<mobilenowbackend module="mobilenow">
122
+ <title>Backend Page Title</title>
123
+ <sort_order>0</sort_order>
124
+ <action>mobilenow/adminhtml_mobilenowbackend</action>
125
+ </mobilenowbackend>-->
126
+ <createtheme module="mobilenow">
127
+ <title>Add New Mobile Theme</title>
128
+ <sort_order>1</sort_order>
129
+ <action>mobilenow/adminhtml_mobilenow/new</action>
130
+ </createtheme>
131
+ <managetheme module="mobilenow">
132
+ <title>Manage Mobile Themes</title>
133
+ <sort_order>2</sort_order>
134
+ <action>mobilenow/adminhtml_mobilenow/index</action>
135
+ </managetheme>
136
+ <manageaccount module="mobilenow">
137
+ <title>Manage / Upgrade MyAccount</title>
138
+ <sort_order>3</sort_order>
139
+ <action>adminhtml/system_config/edit/section/mobilenowsettings</action>
140
+ </manageaccount>
141
+ <configopt module="mobilenow">
142
+ <title>Configuration Options</title>
143
+ <sort_order>4</sort_order>
144
+ <action>adminhtml/system_config/edit/section/mobilenowsettings</action>
145
+ </configopt>
146
+ <help module="mobilenow">
147
+ <title>Help &amp; Documentation</title>
148
+ <sort_order>5</sort_order>
149
+ <action>mobilenow/adminhtml_mobilenow/help</action>
150
+ </help>
151
+ </children>
152
+ </mobilenow>
153
+ </menu>
154
+ <acl>
155
+ <resources>
156
+ <all>
157
+ <title>Allow Everything</title>
158
+ </all>
159
+ <admin>
160
+ <children>
161
+ <mobilenow translate="title" module="mobilenow">
162
+ <title>MobileNow</title>
163
+ <sort_order>1000</sort_order>
164
+ <children>
165
+ <!--<mobilenowbackend translate="title">
166
+ <title>Backend Page Title</title>
167
+ </mobilenowbackend>-->
168
+ <createtheme translate="title">
169
+ <title>Add New Mobile Theme</title>
170
+ <sort_order>1</sort_order>
171
+ </createtheme>
172
+ <managetheme translate="title">
173
+ <title>Manage Mobile Themes</title>
174
+ <sort_order>2</sort_order>
175
+ </managetheme>
176
+ <manageaccount translate="title">
177
+ <title>Manage/Upgrade My Account</title>
178
+ <sort_order>3</sort_order>
179
+ </manageaccount>
180
+ <configopt translate="title">
181
+ <title>Configuration Options</title>
182
+ <sort_order>4</sort_order>
183
+ </configopt>
184
+ <help translate="title">
185
+ <title>Help &amp; Documentation</title>
186
+ <sort_order>5</sort_order>
187
+ </help>
188
+ </children>
189
+ </mobilenow>
190
+ </children>
191
+ </admin>
192
+ </resources>
193
+ </acl>
194
+ <layout>
195
+ <updates>
196
+ <mobilenow>
197
+ <file>mobilenow.xml</file>
198
+ </mobilenow>
199
+ </updates>
200
+ </layout>
201
+ </adminhtml>
202
+ <stores>
203
+ <admin>
204
+ <dev>
205
+ <debug>
206
+ <template_hints>0</template_hints>
207
+ <template_hints_blocks>0</template_hints_blocks>
208
+ </debug>
209
+ </dev>
210
+ </admin>
211
+ </stores>
212
+ </config>
app/code/community/Redstage/Mobilenow/etc/system.xml ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <mobilenow translate="label" module="mobilenow">
5
+ <label>Mobile Now</label>
6
+ <sort_order>101</sort_order>
7
+ </mobilenow>
8
+ </tabs>
9
+ <sections>
10
+ <mobilenowsettings translate="label" module="mobilenow">
11
+ <label>Settings</label>
12
+ <tab>mobilenow</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
+ <mobilenowaccount translate="label">
20
+ <label>Mobile Now Account Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>0</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
+ <comment><![CDATA[
27
+ <table class="form-list" id="current_membership_level" cellpadding="0" cellspaceing="0" width="63%">
28
+ <tr id="current_membership_level_error_row">
29
+ <td colspan="2"><span id="connect_error" style="color:red"></span></td>
30
+ </tr>
31
+ <tr id="current_membership_level_text_row">
32
+ <td class="label">Current Membership Level:</td>
33
+ <td class="value"><strong>No Account Set Up - <a href="https://mobilenowapp.com/pricing" target="_blank">Click here to Get Your Free Account!</strong></a></td>
34
+ </tr>
35
+ </table>
36
+ ]]></comment>
37
+ <fields>
38
+ <email translate="label">
39
+ <label>E-mail</label>
40
+ <frontend_type>text</frontend_type>
41
+ <validate>validate-email</validate>
42
+ <sort_order>1</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ <comment>Please enter email</comment>
47
+ </email>
48
+ <username translate="label">
49
+ <label>Username</label>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>2</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ <comment>Please enter username</comment>
56
+ </username>
57
+ <password translate="label">
58
+ <label>Password</label>
59
+ <frontend_type>password</frontend_type>
60
+ <sort_order>3</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ <comment>Please enter password</comment>
65
+ </password>
66
+ <subscription translate="label">
67
+ <label>Password</label>
68
+ <frontend_type>text</frontend_type>
69
+ <sort_order>3</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <comment>Please enter password</comment>
74
+ </subscription>
75
+ <link translate="label">
76
+ <label>Manage Account URL</label>
77
+ <frontend_type>link</frontend_type>
78
+ <frontend_model>mobilenow/adminhtml_system_config_form_link</frontend_model>
79
+ <sort_order>4</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ </link>
84
+
85
+ <button translate="label">
86
+ <label></label>
87
+ <frontend_type>button</frontend_type>
88
+ <frontend_model>mobilenow/adminhtml_system_config_form_button</frontend_model>
89
+ <sort_order>5</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </button>
94
+ </fields>
95
+ </mobilenowaccount>
96
+ <mobilenowgeneral translate="label">
97
+ <label>General Settings</label>
98
+ <frontend_type>text</frontend_type>
99
+ <sort_order>1</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ <comment><![CDATA[
104
+ <i>MobileNow v1.0.1 - <a href="https://mobilenowapp.com/am/login/index" style="color:#EA7601">Click Here To Check For Updates</a></i>
105
+ ]]></comment>
106
+ <fields>
107
+ <status translate="label">
108
+ <label>Enabled</label>
109
+ <frontend_type>select</frontend_type>
110
+ <source_model>adminhtml/system_config_source_yesno</source_model>
111
+ <sort_order>1</sort_order>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ <comment>Please select the status</comment>
116
+ </status>
117
+ </fields>
118
+ </mobilenowgeneral>
119
+ </groups>
120
+ </mobilenowsettings>
121
+ </sections>
122
+ </config>
app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $sql=<<<SQLTEXT
5
+ DROP TABLE IF EXISTS {$this->getTable('theme_store_id')};
6
+ DROP TABLE IF EXISTS {$this->getTable('themesubsettings')};
7
+ DROP TABLE IF EXISTS {$this->getTable('themelayoutsettings')};
8
+ DROP TABLE IF EXISTS {$this->getTable('themesettings')};
9
+ CREATE TABLE IF NOT EXISTS `themesettings` (
10
+ `theme_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
11
+ `theme_name` varchar(255) NOT NULL,
12
+ `mobile_device_design_interface` int(11) NOT NULL,
13
+ `user_agent_regex_values` varchar(255) NOT NULL,
14
+ `user_agent_regex_custom_values` varchar(255) NOT NULL,
15
+ `exclude_user_agent_regex_custom_values` varchar(255) NOT NULL,
16
+ `ip_override` VARCHAR( 255 ) NOT NULL,
17
+ `css_override` TEXT NOT NULL,
18
+ `social_links` VARCHAR( 255 ) NOT NULL,
19
+ `cart_inputs` VARCHAR( 255 ) NOT NULL,
20
+ `analytics` TEXT NOT NULL,
21
+ `status` int(11) NOT NULL,
22
+ `theme_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
23
+ PRIMARY KEY (`theme_id`)
24
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
25
+ CREATE TABLE {$this->getTable('theme_store_id')} (
26
+ `theme_id` int(11) unsigned NOT NULL COMMENT 'Theme ID',
27
+ `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
28
+ PRIMARY KEY (`theme_id`,`store_id`)
29
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
30
+ ALTER TABLE {$this->getTable('theme_store_id')}
31
+ ADD CONSTRAINT `FK_THEME_ID` FOREIGN KEY (`theme_id`) REFERENCES {$this->getTable('themesettings')} (`theme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
32
+ ADD CONSTRAINT `FK_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES {$this->getTable('core_store')} (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
33
+ CREATE TABLE IF NOT EXISTS `themesubsettings` (
34
+ `id` int(10) NOT NULL AUTO_INCREMENT,
35
+ `defaultsubsetting` int(10) NOT NULL,
36
+ `subsetname` varchar(255) NOT NULL,
37
+ `primary` int(10) NOT NULL,
38
+ `logo` varchar(255) NOT NULL,
39
+ `bgcolor` varchar(255) NOT NULL,
40
+ `links` text NOT NULL,
41
+ `textcolor` varchar(255) NOT NULL,
42
+ `searchcart` text NOT NULL,
43
+ `homepagebanner` text NOT NULL,
44
+ `subheadersection` text NOT NULL,
45
+ `categories` text NOT NULL,
46
+ `newsletter` text NOT NULL,
47
+ `homepagecustomcode` text NOT NULL,
48
+ `prefootersection` text NOT NULL,
49
+ `footersection` text NOT NULL,
50
+ `buttoncolor` text NOT NULL,
51
+ `breadcrumb` text NOT NULL,
52
+ `catalogview` text NOT NULL,
53
+ `numberofproductsperpage` varchar(255) NOT NULL,
54
+ `numberofproductschoice` varchar(255) NOT NULL,
55
+ `catalogsortby` text NOT NULL,
56
+ `toolbarcolor` text NOT NULL,
57
+ `pagination` text NOT NULL,
58
+ `catalogimagedetails` text NOT NULL,
59
+ `catalogproductcolor` text NOT NULL,
60
+ `catalogreviews` text NOT NULL,
61
+ `cataloglearnmore` text NOT NULL,
62
+ `catalogaddtocart` text NOT NULL,
63
+ `cataloggridlines` text NOT NULL,
64
+ `producttitlecolor` text NOT NULL,
65
+ `productimagedetails` text NOT NULL,
66
+ `showproductdeails` text NOT NULL,
67
+ `homepagelayoutmain` text NOT NULL,
68
+ `cataloglayoutmain` text NOT NULL,
69
+ `cataloglayoutgrid` text NOT NULL,
70
+ `cataloglayoutlist` text NOT NULL,
71
+ `productlayoutmain` text NOT NULL,
72
+ `parent` INT(10) NOT NULL,
73
+ `themeid` int(10) NOT NULL,
74
+ `preview` tinyint(1) NOT NULL DEFAULT '0',
75
+ `css_filename` VARCHAR( 255 ) NOT NULL,
76
+ `dateinserted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
77
+ PRIMARY KEY (`id`)
78
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
79
+ CREATE TABLE IF NOT EXISTS `themelayoutsettings` (
80
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
81
+ `theme_id` int(11) unsigned NOT NULL,
82
+ `layout_link_id` int(10) unsigned NOT NULL,
83
+ `preview` tinyint(1) NOT NULL DEFAULT '0',
84
+ PRIMARY KEY (`id`),
85
+ KEY `theme_id` (`theme_id`),
86
+ KEY `layout_link_id` (`layout_link_id`)
87
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
88
+ ALTER TABLE `themelayoutsettings`
89
+ ADD CONSTRAINT `themelayoutsettings_ibfk_2` FOREIGN KEY (`theme_id`) REFERENCES `themesettings` (`theme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
90
+ ADD CONSTRAINT `themelayoutsettings_ibfk_1` FOREIGN KEY (`layout_link_id`) REFERENCES `core_layout_link` (`layout_link_id`) ON DELETE CASCADE ON UPDATE CASCADE;
91
+ SQLTEXT;
92
+
93
+ $installer->run($sql);
94
+ //demo
95
+ //Mage::getModel('core/url_rewrite')->setId(null);
96
+ //demo
97
+ $installer->endSetup();
98
+
app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.0-0.1.1.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $themesettings = array(
6
+ array( 'theme_name' => 'preview','mobile_device_design_interface' => '1','user_agent_regex_values' => '0','user_agent_regex_custom_values' => '','exclude_user_agent_regex_custom_values' => '','ip_override' => '','css_override' => '','social_links' => '{"show_social_links":null,"facebook_link":"","twitter_link":"","pinterest_link":"","google_link":""}','cart_inputs' => '{"show_cart_discount":null,"show_cart_shipping_quote":null}','status' => '1')
7
+ );
8
+
9
+ foreach ($themesettings as $settings) {
10
+ $installer->getConnection()->insertForce($installer->getTable('themesettings'), $settings);
11
+ }
12
+
13
+
14
+ /*$data = array(
15
+ array('id' => '1','defaultsubsetting' => '1','subsetname' => 'black fashion','primary' => '1','logo' => '','bgcolor' => '#808783','links' => '{"header_link_home":"1","header_link_home_name":"1","footer_link_home":"1","footer_link_home_name":"1","header_link_login":"1","header_link_login_name":"2","footer_link_login":"1","footer_link_login_name":"2","header_link_myaccount":"1","header_link_myaccount_name":"3","footer_link_myaccount":"1","footer_link_myaccount_name":"3","header_link_wishlist":"1","header_link_wishlist_name":"4","footer_link_wishlist":"1","footer_link_wishlist_name":"4","links_color":"#bdb6b6"}','textcolor' => '#1f1b1b','searchcart' => '{"show_search_cart_area":"1","search_cart_bg_color":"#857d7d","cart_link_color":"#857d7d"}','homepagebanner' => '{"show_home_page_banner":"1","homepage_banner":"","homepage_banner_url":"black fashion"}','subheadersection' => 'black fashion','categories' => '{"categories":"2","categories_background_color":"#b8aaaa"}','newsletter' => '{"show_newsletter":"1","newsletter_area_backgorund":"#857575"}','homepagecustomcode' => 'blackfashion','prefootersection' => 'black fashion','footersection' => 'black fashion','buttoncolor' => '{"button_background_color":"#ad1010","button_text_color":"#cc2929","button_border_color":"#0f0d0d"}','breadcrumb' => '{"show_breadcrumbs":"1","breadcrumbs_bg_color":"#c2b8b8","breadcrumbs_font_color":"#383434"}','catalogview' => '{"default_catalog_view":"2","show_grid_list_choice":"1"}','numberofproductsperpage' => '5','numberofproductschoice' => '5,10,15,20','catalogsortby' => '{"show_sortby_dropdown":"1","sort_options":"1,2,3,4,5"}','toolbarcolor' => '{"toolbar_bg_color":"#ada3a3","toolbar_text_color":"#5c4e4e"}','pagination' => '{"show_pagination":"2","pagination_bg_color":"#bfb5b5","pagination_button_bg_color":"#9e9393","pagination_button_text_color":"#9e8b8b"}','catalogimagedetails' => '{"show_image_border":"1","image_border_color":"#baafaf","catalog_image_width":""}','catalogproductcolor' => '{"product_title_color":"#403838","product_price_color":"#7d7676","product_special_price_color":"#8c8181"}','catalogreviews' => '{"show_review_stars":"1","review_star_color":"#c2b8b8"}','cataloglearnmore' => '1','catalogaddtocart' => '{"show_add_to_cart":"1","add_to_cart_button_bg_color":"#9ba6b0","add_to_cart_button_font_color":"#8a7f89","add_to_cart_button_border_color":"#5f6c7a"}','cataloggridlines' => '{"show_gridlines":"1","gridlines_color":"#9a9e98"}','producttitlecolor' => '#b3a3a3','productimagedetails' => '{"show_product_image_border":"1","product_image_border_color":"#826b6b","product_image_width":""}','showproductdeails' => '{"show_product_availability":"1","show_product_wishlist_link":"1","show_product_reviews_summary":"1","show_product_description":"1","show_product_additional_information":"1","show_full_reviews_on_product_page":"1","show_related_products":"1"}','homepagelayoutmain' => '{"h_layout_search_cart":"1","h_layout_sub_header":"2","h_layout_banner":"3","h_layout_feature":"4","h_layout_categories":"5","h_layout_news_signup":"6"}','cataloglayoutmain' => '{"c_layout_breadcrumbs":"1","c_layout_toolbar":"2","c_layout_pag_top":"3"}','cataloglayoutgrid' => '{"c_grid_layout_product_image":"1","c_grid_layout_product_title":"2","c_grid_layout_product_price":"3","c_grid_layout_product_review":"4","c_grid_layout_product_learn":"5","c_grid_layout_product_addtocart":"6"}','cataloglayoutlist' => '{"c_list_layout_product_image":"1","c_list_layout_product_title":"2","c_list_layout_product_price":"3","c_list_layout_product_review":"4","c_list_layout_product_learn":"5","c_list_layout_product_addtocart":"6"}','productlayoutmain' => '{"ptop_layout_settings":{"p_layout_availability":"1","p_layout_pricing":"2","p_layout_addtocart":"3","p_layout_wishlist":"4","p_layout_review":"5"},"pbottom_layout_settings":{"p_layout_desc":"1","p_layout_additionalinfo":"2","p_layout_fullreview":"3","p_layout_relatedproduct":"4"}}','parent' => '0','themeid' => '0','dateinserted' => '2013-08-26 18:12:10'),
16
+ array('id' => '2','defaultsubsetting' => '0','subsetname' => 'green forest','primary' => '1','logo' => '','bgcolor' => '#1aeb24','links' => '{"header_link_home":"1","header_link_home_name":"1","footer_link_home":"1","footer_link_home_name":"1","header_link_login":"1","header_link_login_name":"2","footer_link_login":"1","footer_link_login_name":"2","header_link_myaccount":"1","header_link_myaccount_name":"3","footer_link_myaccount":"1","footer_link_myaccount_name":"3","header_link_wishlist":"1","header_link_wishlist_name":"4","footer_link_wishlist":"1","footer_link_wishlist_name":"4","links_color":"#80db44"}','textcolor' => '#0df763','searchcart' => '{"show_search_cart_area":"1","search_cart_bg_color":"#1be05d","cart_link_color":"#1be05d"}','homepagebanner' => '{"show_home_page_banner":"1","homepage_banner":"","homepage_banner_url":"Green forest"}','subheadersection' => 'Green forest','categories' => '{"categories":"2","categories_background_color":"#7bf70f"}','newsletter' => '{"show_newsletter":"1","newsletter_area_backgorund":"#14fa68"}','homepagecustomcode' => 'Green forest','prefootersection' => 'Green forest','footersection' => 'Green forest','buttoncolor' => '{"button_background_color":"#14fa32","button_text_color":"#26eb30","button_border_color":"#25f59b"}','breadcrumb' => '{"show_breadcrumbs":"1","breadcrumbs_bg_color":"#1ce65f","breadcrumbs_font_color":"#18f523"}','catalogview' => '{"default_catalog_view":"2","show_grid_list_choice":"1"}','numberofproductsperpage' => '5','numberofproductschoice' => '5,10,15,20','catalogsortby' => '{"show_sortby_dropdown":"1","sort_options":"1,2,3,4,5"}','toolbarcolor' => '{"toolbar_bg_color":"#14fa14","toolbar_text_color":"#0ceb39"}','pagination' => '{"show_pagination":"2","pagination_bg_color":"#0afc63","pagination_button_bg_color":"#96ed2b","pagination_button_text_color":"#65f518"}','catalogimagedetails' => '{"show_image_border":"1","image_border_color":"#0fff23","catalog_image_width":""}','catalogproductcolor' => '{"product_title_color":"#15ed0e","product_price_color":"#0eebbf","product_special_price_color":"#b1f011"}','catalogreviews' => '{"show_review_stars":"1","review_star_color":"#12fa38"}','cataloglearnmore' => '1','catalogaddtocart' => '{"show_add_to_cart":"1","add_to_cart_button_bg_color":"#17fa6a","add_to_cart_button_font_color":"#a4fa0f","add_to_cart_button_border_color":"#0ef599"}','cataloggridlines' => '{"show_gridlines":"1","gridlines_color":"#00ff40"}','producttitlecolor' => '#71deab','productimagedetails' => '{"show_product_image_border":"1","product_image_border_color":"#519e64","product_image_width":""}','showproductdeails' => '{"show_product_availability":"1","show_product_wishlist_link":"1","show_product_reviews_summary":"1","show_product_description":"1","show_product_additional_information":"1","show_full_reviews_on_product_page":"1","show_related_products":"1"}','homepagelayoutmain' => '{"h_layout_search_cart":"1","h_layout_sub_header":"2","h_layout_banner":"3","h_layout_feature":"4","h_layout_categories":"5","h_layout_news_signup":"6"}','cataloglayoutmain' => '{"c_layout_breadcrumbs":"1","c_layout_toolbar":"2","c_layout_pag_top":"3"}','cataloglayoutgrid' => '{"c_grid_layout_product_image":"1","c_grid_layout_product_title":"2","c_grid_layout_product_price":"3","c_grid_layout_product_review":"4","c_grid_layout_product_learn":"5","c_grid_layout_product_addtocart":"6"}','cataloglayoutlist' => '{"c_list_layout_product_image":"1","c_list_layout_product_title":"2","c_list_layout_product_price":"3","c_list_layout_product_review":"4","c_list_layout_product_learn":"5","c_list_layout_product_addtocart":"6"}','productlayoutmain' => '{"ptop_layout_settings":{"p_layout_availability":"1","p_layout_pricing":"2","p_layout_addtocart":"3","p_layout_wishlist":"4","p_layout_review":"5"},"pbottom_layout_settings":{"p_layout_desc":"1","p_layout_additionalinfo":"2","p_layout_fullreview":"3","p_layout_relatedproduct":"4"}}','parent' => '0','themeid' => '0','dateinserted' => '2013-08-26 18:12:10')
17
+ );*/
18
+ $data = array(
19
+ array('id' => '1','defaultsubsetting' => '1','subsetname' => 'Mobilenow default','primary' => '0','logo' => '1381160198linkedinsucks.GIF','bgcolor' => '#ffffff','links' => '{"header_link_home":"1","header_link_home_name":"1","footer_link_home":"1","footer_link_home_name":"1","header_link_login":"1","header_link_login_name":"2","footer_link_login":"1","footer_link_login_name":"2","header_link_myaccount":"1","header_link_myaccount_name":"3","footer_link_myaccount":"1","footer_link_myaccount_name":"3","header_link_wishlist":"1","header_link_wishlist_name":"4","footer_link_wishlist":"1","footer_link_wishlist_name":"4","links_color":"#0a0909"}','textcolor' => '#1f1b1b','searchcart' => '{"show_search_cart_area":"1","search_cart_bg_color":"#1f72c8","cart_link_color":"#ffffff"}','homepagebanner' => '{"show_home_page_banner":"1","homepage_banner":"1380280298Banner.png","homepage_banner_url":"black fashion"}','subheadersection' => '<div style="padding:5px;color:#1f72c8;">Free Shipping over $50!</div>','categories' => '{"categories":"1","categories_background_color":"#b8aaaa"}','newsletter' => '{"show_newsletter":"1","newsletter_area_backgorund":"#b8aaaa"}','homepagecustomcode' => 'blackfashion','prefootersection' => 'black fashion','footersection' => 'black fashion','buttoncolor' => '{"button_background_color":"#e08d37","button_text_color":"#f5f2f2","button_border_color":"#ffffff"}','breadcrumb' => '{"show_breadcrumbs":"1","breadcrumbs_bg_color":"#c2b8b8","breadcrumbs_font_color":"#383434"}','catalogview' => '','numberofproductsperpage' => '10','numberofproductschoice' => '5,10,15,20','catalogsortby' => '{"show_sortby_dropdown":"1","sort_options":"1,2,3,4,5"}','toolbarcolor' => '{"toolbar_bg_color":"#ada3a3","toolbar_text_color":"#5c4e4e"}','pagination' => '{"show_pagination":"2","pagination_bg_color":"#bfb5b5","pagination_button_bg_color":"#9e9393","pagination_button_text_color":"#9e8b8b"}','catalogimagedetails' => '{"show_image_border":"1","image_border_color":"#baafaf","catalog_image_width":""}','catalogproductcolor' => '{"product_title_color":"#403838","product_price_color":"#7d7676","product_special_price_color":"#8c8181"}','catalogreviews' => '{"show_review_stars":"1","review_star_color":"#c2b8b8"}','cataloglearnmore' => '1','catalogaddtocart' => '{"show_add_to_cart":"1","add_to_cart_button_bg_color":"#9ba6b0","add_to_cart_button_font_color":"#8a7f89","add_to_cart_button_border_color":"#5f6c7a"}','cataloggridlines' => '{"show_gridlines":"1","gridlines_color":"#9a9e98"}','producttitlecolor' => '#b3a3a3','productimagedetails' => '{"show_product_image_border":"1","product_image_border_color":"#826b6b","product_image_width":""}','showproductdeails' => '{"show_product_availability":"1","show_product_wishlist_link":"1","show_product_reviews_summary":"1","show_product_description":"1","product_description_color":"#826b6b","show_product_additional_information":"1","additional_information_bg_color":"#826b6b","additional_information_font_color":"#826b6b","show_full_reviews_on_product_page":"1","full_reviews_bg_color":"#826b6b","full_reviews_font_color":"#826b6b","show_related_products":"1"}','homepagelayoutmain' => '{"h_layout_search_cart":"1","h_layout_sub_header":"2","h_layout_banner":"3","h_layout_feature":"4","h_layout_categories":"5","h_layout_news_signup":"6"}','cataloglayoutmain' => '{"c_layout_breadcrumbs":"1","c_layout_toolbar":"2","c_layout_pag_top":"3"}','cataloglayoutgrid' => '','cataloglayoutlist' => '{"c_list_layout_product_image":null,"c_list_layout_product_title":null,"c_list_layout_product_price":"3","c_list_layout_product_review":"4","c_list_layout_product_learn":"5","c_list_layout_product_addtocart":"6"}','productlayoutmain' => '{"ptop_layout_settings":{"p_layout_availability":"1","p_layout_pricing":"2","p_layout_addtocart":"3","p_layout_wishlist":"4","p_layout_review":"5"},"pbottom_layout_settings":{"p_layout_desc":"1","p_layout_additionalinfo":"2","p_layout_fullreview":"3","p_layout_relatedproduct":"4"}}','parent' => '0','themeid' => '0','preview' => '0','dateinserted' => '2013-10-07 21:13:12','css_filename' => 'a5771bce93e200c36f7cd9dfd0e5deaa.css'),
20
+ array('id' => '2','defaultsubsetting' => '0','subsetname' => 'Black fashion','primary' => '0','logo' => '1380512898Logo.png','bgcolor' => '#fcfcfc','links' => '{"header_link_home":"1","header_link_home_name":"1","footer_link_home":"1","footer_link_home_name":"1","header_link_login":"1","header_link_login_name":"2","footer_link_login":"1","footer_link_login_name":"2","header_link_myaccount":"1","header_link_myaccount_name":"3","footer_link_myaccount":"1","footer_link_myaccount_name":"3","header_link_wishlist":"1","header_link_wishlist_name":"4","footer_link_wishlist":"1","footer_link_wishlist_name":"4","links_color":"#0a0909"}','textcolor' => '#141313','searchcart' => '{"show_search_cart_area":"1","search_cart_bg_color":"#b8aaaa","cart_link_color":"#ffffff"}','homepagebanner' => '{"show_home_page_banner":"1","homepage_banner":"1380513075Banner.jpg","homepage_banner_url":"Free shipping!!!!"}','subheadersection' => 'Sub header seciton!!!!','categories' => '{"categories":"1","categories_background_color":"#b8aaaa"}','newsletter' => '{"show_newsletter":"1","newsletter_area_backgorund":"#b8aaaa"}','homepagecustomcode' => 'Homepage custom code!!!!','prefootersection' => 'Pre-footer section!!!','footersection' => '@2013 Copy rights| Terms and Conditions','buttoncolor' => '{"button_background_color":"#0f0e0e","button_text_color":"#f5eded","button_border_color":"#998080"}','breadcrumb' => '{"show_breadcrumbs":"1","breadcrumbs_bg_color":"#c2b8b8","breadcrumbs_font_color":"#383434"}','catalogview' => '{"default_catalog_view":"2","show_grid_list_choice":"1"}','numberofproductsperpage' => '10','numberofproductschoice' => '5,10,15,20','catalogsortby' => '{"show_sortby_dropdown":"1","sort_options":"1,2,3,4,5"}','toolbarcolor' => '{"toolbar_bg_color":"#ada3a3","toolbar_text_color":"#5c4e4e"}','pagination' => '{"show_pagination":"2","pagination_bg_color":"#bfb5b5","pagination_button_bg_color":"#9e9393","pagination_button_text_color":"#9e8b8b"}','catalogimagedetails' => '{"show_image_border":"1","image_border_color":"#baafaf","catalog_image_width":""}','catalogproductcolor' => '{"product_title_color":"#403838","product_price_color":"#7d7676","product_special_price_color":"#8c8181"}','catalogreviews' => '{"show_review_stars":"1","review_star_color":"#c2b8b8"}','cataloglearnmore' => '1','catalogaddtocart' => '{"show_add_to_cart":"1","add_to_cart_button_bg_color":"#9ba6b0","add_to_cart_button_font_color":"#8a7f89","add_to_cart_button_border_color":"#5f6c7a"}','cataloggridlines' => '{"show_gridlines":"1","gridlines_color":"#9a9e98"}','producttitlecolor' => '#b3a3a3','productimagedetails' => '{"show_product_image_border":"1","product_image_border_color":"#826b6b","product_image_width":""}','showproductdeails' => '{"show_product_availability":"1","show_product_wishlist_link":"1","show_product_reviews_summary":"1","show_product_description":"1","product_description_color":"#826b6b","show_product_additional_information":"1","additional_information_bg_color":"#826b6b","additional_information_font_color":"#826b6b","show_full_reviews_on_product_page":"1","full_reviews_bg_color":"#826b6b","full_reviews_font_color":"#826b6b","show_related_products":"1"}','homepagelayoutmain' => '{"h_layout_search_cart":"1","h_layout_sub_header":"2","h_layout_banner":"3","h_layout_feature":"4","h_layout_categories":"5","h_layout_news_signup":"6"}','cataloglayoutmain' => '{"c_layout_breadcrumbs":"1","c_layout_toolbar":"2","c_layout_pag_top":"3"}','cataloglayoutgrid' => '','cataloglayoutlist' => '{"c_list_layout_product_image":null,"c_list_layout_product_title":null,"c_list_layout_product_price":"3","c_list_layout_product_review":"4","c_list_layout_product_learn":"5","c_list_layout_product_addtocart":"6"}','productlayoutmain' => '{"ptop_layout_settings":{"p_layout_availability":"1","p_layout_pricing":"2","p_layout_addtocart":"3","p_layout_wishlist":"4","p_layout_review":"5"},"pbottom_layout_settings":{"p_layout_desc":"1","p_layout_additionalinfo":"2","p_layout_fullreview":"3","p_layout_relatedproduct":"4"}}','parent' => '0','themeid' => '0','preview' => '0','dateinserted' => '2013-09-25 13:22:44','css_filename' => 'd41d8cd98f00b204e9800998ecf8427e.css') );
21
+
22
+ foreach ($data as $bind) {
23
+ $installer->getConnection()->insertForce($installer->getTable('themesubsettings'), $bind);
24
+ }
25
+
26
+ ?>
app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+ ALTER TABLE `themelayoutsettings` ADD `layout_update_id` INT( 10 ) UNSIGNED NOT NULL ,
9
+ ADD INDEX ( `layout_update_id` );
10
+ ALTER TABLE `themelayoutsettings` ADD FOREIGN KEY ( `layout_update_id` ) REFERENCES `core_layout_update` (
11
+ `layout_update_id`
12
+ ) ON DELETE CASCADE ON UPDATE CASCADE ;
13
+ ");
14
+ $installer->endSetup();
15
+ ?>
app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.2-0.1.3.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+ INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`) VALUES (NULL, 'default', '0', 'mobilenowsettings/mobilenowaccount/subscription', '0');");
9
+ $installer->endSetup();
10
+ ?>
app/code/community/Redstage/Mobilenow/sql/mobilenow_setup/mysql4-upgrade-0.1.3-0.1.4.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ /*$installer->run("
8
+ ALTER TABLE `themesettings` ADD `ip_override` VARCHAR( 255 ) NOT NULL AFTER `exclude_user_agent_regex_custom_values` ,
9
+ ADD `css_override` TEXT NOT NULL AFTER `ip_override` ,
10
+ ADD `social_links` VARCHAR( 255 ) NOT NULL AFTER `css_override` ,
11
+ ADD `cart_inputs` VARCHAR( 255 ) NOT NULL AFTER `social_links`,
12
+ ADD `analytics` TEXT NOT NULL AFTER `cart_inputs`;");
13
+ $installer->endSetup();*/
14
+
15
+ ?>
app/design/adminhtml/default/default/layout/admin.xml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <!-- admin acl users edit page -->
31
+ <adminhtml_permissions_user_edit>
32
+ <reference name="left">
33
+ <block type="adminhtml/permissions_user_edit_tabs" name="adminhtml.permissions.user.edit.tabs"/>
34
+ </reference>
35
+ <reference name="content">
36
+ <block type="adminhtml/permissions_user_edit" name="adminhtml.permissions.user.edit"/>
37
+ </reference>
38
+ <reference name="js">
39
+ <block type="adminhtml/template" name="adminhtml.permissions.user.roles.grid.js" template="permissions/user_roles_grid_js.phtml"/>
40
+ </reference>
41
+ </adminhtml_permissions_user_edit>
42
+
43
+ <!-- admin acl roles grid page -->
44
+ <adminhtml_permissions_role_index>
45
+ <reference name="content">
46
+ <block type="adminhtml/permissions_roles" name="adminhtml.permission.role.index" template="permissions/roles.phtml">
47
+ <block type="adminhtml/permissions_grid_role" name="adminhtml.permission.role.grid" as="grid"/>
48
+ </block>
49
+ </reference>
50
+ </adminhtml_permissions_role_index>
51
+ <adminhtml_permissions_role_rolegrid>
52
+ <remove name="root"/>
53
+ <block type="adminhtml/permissions_grid_role" name="adminhtml.permission.role.grid"/>
54
+ </adminhtml_permissions_role_rolegrid>
55
+
56
+ <!-- admin acl roles edit page -->
57
+ <adminhtml_permissions_role_editrole>
58
+ <reference name="left">
59
+ <block type="adminhtml/permissions_editroles" name="adminhtml.permissions.editroles"/>
60
+ </reference>
61
+ </adminhtml_permissions_role_editrole>
62
+ <adminhtml_system_config_edit>
63
+ <reference name="left">
64
+ <block type="adminhtml/system_config_switcher" name="adminhtml.system.config.switcher" before="-"/>
65
+ </reference>
66
+ </adminhtml_system_config_edit>
67
+ <adminhtml_dashboard_index>
68
+ <reference name="content">
69
+ <block type="adminhtml/dashboard" name="dashboard">
70
+ <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher" template="store/switcher.phtml">
71
+ <action method="setUseConfirm"><params>0</params></action>
72
+ </block>
73
+ </block>
74
+ </reference>
75
+ </adminhtml_dashboard_index>
76
+ <adminhtml_cache_index>
77
+ <reference name="content">
78
+ <block type="adminhtml/cache" name="cache"></block>
79
+ <block type="adminhtml/cache_additional" name="cache.additional" template="system/cache/additional.phtml"></block>
80
+ </reference>
81
+ </adminhtml_cache_index>
82
+ </layout>
app/design/adminhtml/default/default/layout/adminnotification.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <default>
31
+ <reference name="notifications">
32
+ <block type="adminhtml/notification_toolbar" name="notification_toolbar" as="notification_toolbar" acl="system/adminnotification/show_toolbar" template="notification/toolbar.phtml" />
33
+ </reference>
34
+ <reference name="notifications">
35
+ <block type="adminhtml/notification_window" name="notification_window" as="notification_window" acl="system/adminnotification/show_toolbar" template="notification/window.phtml" />
36
+ </reference>
37
+ </default>
38
+ </layout>
app/design/adminhtml/default/default/layout/api2.xml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <adminhtml_api2_role_index>
30
+ <reference name="content">
31
+ <block type="api2/adminhtml_roles" name="api2_roles"/>
32
+ </reference>
33
+ </adminhtml_api2_role_index>
34
+
35
+ <adminhtml_api2_role_new>
36
+ <reference name="left">
37
+ <block type="api2/adminhtml_roles_tabs" name="adminhtml.role.edit.tabs">
38
+ <block type="api2/adminhtml_roles_tab_info" name="adminhtml.role.edit.tab.info"/>
39
+ <block type="api2/adminhtml_roles_tab_resources" name="adminhtml.role.edit.tab.resources" template="permissions/rolesedit.phtml"/>
40
+ <action method="addTab">
41
+ <id>api2_role_section_info</id>
42
+ <block>adminhtml.role.edit.tab.info</block>
43
+ </action>
44
+ <action method="addTab">
45
+ <id>api2_role_section_resources</id>
46
+ <block>adminhtml.role.edit.tab.resources</block>
47
+ </action>
48
+ </block>
49
+ </reference>
50
+ <reference name="content">
51
+ <block type="api2/adminhtml_roles_buttons" name="adminhtml.roles.buttons"/>
52
+ </reference>
53
+ <reference name="head">
54
+ <action method="setCanLoadExtJs">
55
+ <flag>1</flag>
56
+ </action>
57
+ </reference>
58
+ </adminhtml_api2_role_new>
59
+
60
+ <adminhtml_api2_role_edit>
61
+ <reference name="left">
62
+ <block type="api2/adminhtml_roles_tabs" name="adminhtml.role.edit.tabs">
63
+ <block type="api2/adminhtml_roles_tab_info" name="adminhtml.role.edit.tab.info"/>
64
+ <block type="api2/adminhtml_roles_tab_resources" name="adminhtml.role.edit.tab.resources" template="permissions/rolesedit.phtml"/>
65
+ <block type="api2/adminhtml_roles_tab_users" name="adminhtml.role.edit.tab.users"/>
66
+ <action method="addTab">
67
+ <id>api2_role_section_info</id>
68
+ <block>adminhtml.role.edit.tab.info</block>
69
+ </action>
70
+ <action method="addTab">
71
+ <id>api2_role_section_resources</id>
72
+ <block>adminhtml.role.edit.tab.resources</block>
73
+ </action>
74
+ <action method="addTab">
75
+ <id>roleUsersGrid</id>
76
+ <block>adminhtml.role.edit.tab.users</block>
77
+ </action>
78
+ </block>
79
+ </reference>
80
+ <reference name="content">
81
+ <block type="api2/adminhtml_roles_buttons" name="adminhtml.roles.buttons"/>
82
+ </reference>
83
+ <reference name="head">
84
+ <action method="setCanLoadExtJs">
85
+ <flag>1</flag>
86
+ </action>
87
+ </reference>
88
+ <reference name="js">
89
+ <block type="adminhtml/template" name="adminhtml.role.js.users.grid" template="api2/role/users_grid_js.phtml"/>
90
+ </reference>
91
+ </adminhtml_api2_role_edit>
92
+
93
+ <adminhtml_api2_role_grid>
94
+ <remove name="root"/>
95
+ <block type="api2/adminhtml_roles_grid" name="api2_roles.grid" output="toHtml"/>
96
+ </adminhtml_api2_role_grid>
97
+
98
+ <adminhtml_api2_role_usersgrid>
99
+ <remove name="root"/>
100
+ <block type="api2/adminhtml_roles_tab_users" name="adminhtml.role.edit.tab.users" output="toHtml"/>
101
+ </adminhtml_api2_role_usersgrid>
102
+
103
+ <!-- admin acl users edit page -->
104
+ <adminhtml_permissions_user_edit>
105
+ <reference name="adminhtml.permissions.user.edit.tabs">
106
+ <block type="api2/adminhtml_permissions_user_edit_tab_roles" name="adminhtml.permissions.user.edit.tab.roles"/>
107
+ <action method="addTabAfter">
108
+ <id>api2_roles_section</id>
109
+ <block>adminhtml.permissions.user.edit.tab.roles</block>
110
+ <after>roles_section</after>
111
+ </action>
112
+ </reference>
113
+ <reference name="js">
114
+ <block type="adminhtml/template" name="adminhtml.permissions.user.edit.tab.roles.js" template="api2/permissions/user/edit/tab/roles/js.phtml"/>
115
+ </reference>
116
+ </adminhtml_permissions_user_edit>
117
+
118
+ <!-- ACL attributes -->
119
+ <adminhtml_api2_attribute_index>
120
+ <reference name="content">
121
+ <block type="api2/adminhtml_attribute" name="api2.attribute"/>
122
+ </reference>
123
+ </adminhtml_api2_attribute_index>
124
+
125
+ <adminhtml_api2_attribute_edit>
126
+ <reference name="left">
127
+ <block type="api2/adminhtml_attribute_tabs" name="api2.attribute.edit.tabs">
128
+ <block type="api2/adminhtml_attribute_tab_resource" name="api2.attribute.tab.resource" template="api2/attribute/resource.phtml"/>
129
+ <action method="addTab">
130
+ <name>api2_attribute_section_resources</name>
131
+ <block>api2.attribute.tab.resource</block>
132
+ </action>
133
+ </block>
134
+ </reference>
135
+ <reference name="content">
136
+ <block type="api2/adminhtml_attribute_edit" name="edit_form">
137
+ <block type="api2/adminhtml_attribute_edit_form" name="form"/>
138
+ </block>
139
+ </reference>
140
+ <reference name="head">
141
+ <action method="setCanLoadExtJs">
142
+ <flag>1</flag>
143
+ </action>
144
+ </reference>
145
+ </adminhtml_api2_attribute_edit>
146
+ <!-- EOF ACL attributes -->
147
+ </layout>
app/design/adminhtml/default/default/layout/authorizenet.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+ <adminhtml_sales_order_create_index>
31
+ <reference name="head">
32
+ <action method="addJs"><file>mage/directpost.js</file></action>
33
+ </reference>
34
+ </adminhtml_sales_order_create_index>
35
+ </layout>
app/design/adminhtml/default/default/layout/bundle.xml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <!--
32
+ Layout handle for budle products
33
+ -->
34
+
35
+ <!--<default>
36
+ <reference name="left">
37
+ <action method="setData"><attribute>attributeTabs</attribute><attributeType>bundle/adminhtml_catalog_product_edit_tab_attributes</attributeType></action>
38
+ </reference>
39
+ </default>-->
40
+
41
+ <adminhtml_catalog_product_bundle>
42
+ <reference name="product_tabs">
43
+ <action method="addTab"><name>bundle_items</name><block>bundle/adminhtml_catalog_product_edit_tab_bundle</block></action>
44
+ <action method="bindShadowTabs"><first>bundle_items</first><second>customer_options</second></action>
45
+ </reference>
46
+ </adminhtml_catalog_product_bundle>
47
+
48
+ <adminhtml_sales_order_view>
49
+ <reference name="order_items">
50
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_view_items_renderer</block><template>bundle/sales/order/view/items/renderer.phtml</template></action>
51
+ </reference>
52
+ </adminhtml_sales_order_view>
53
+
54
+ <adminhtml_sales_order_invoice_new>
55
+ <reference name="order_items">
56
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/invoice/create/items/renderer.phtml</template></action>
57
+ </reference>
58
+ </adminhtml_sales_order_invoice_new>
59
+
60
+ <adminhtml_sales_order_invoice_updateqty>
61
+ <reference name="order_items">
62
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/invoice/create/items/renderer.phtml</template></action>
63
+ </reference>
64
+ </adminhtml_sales_order_invoice_updateqty>
65
+
66
+ <adminhtml_sales_order_invoice_view>
67
+ <reference name="invoice_items">
68
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/invoice/view/items/renderer.phtml</template></action>
69
+ </reference>
70
+ </adminhtml_sales_order_invoice_view>
71
+
72
+ <adminhtml_sales_order_shipment_new>
73
+ <reference name="order_items">
74
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/shipment/create/items/renderer.phtml</template></action>
75
+ </reference>
76
+ </adminhtml_sales_order_shipment_new>
77
+
78
+ <adminhtml_sales_order_shipment_view>
79
+ <reference name="shipment_items">
80
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/shipment/view/items/renderer.phtml</template></action>
81
+ </reference>
82
+ </adminhtml_sales_order_shipment_view>
83
+
84
+ <adminhtml_sales_order_creditmemo_new>
85
+ <reference name="order_items">
86
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/creditmemo/create/items/renderer.phtml</template></action>
87
+ </reference>
88
+ </adminhtml_sales_order_creditmemo_new>
89
+
90
+ <adminhtml_sales_order_creditmemo_updateqty>
91
+ <reference name="order_items">
92
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/creditmemo/create/items/renderer.phtml</template></action>
93
+ </reference>
94
+ </adminhtml_sales_order_creditmemo_updateqty>
95
+
96
+ <adminhtml_sales_order_creditmemo_view>
97
+ <reference name="creditmemo_items">
98
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/creditmemo/view/items/renderer.phtml</template></action>
99
+ </reference>
100
+ </adminhtml_sales_order_creditmemo_view>
101
+
102
+ <adminhtml_customer_wishlist>
103
+ <reference name="customer.wishlist.edit.tab">
104
+ <action method="addProductConfigurationHelper"><type>bundle</type><name>bundle/catalog_product_configuration</name></action>
105
+ </reference>
106
+ </adminhtml_customer_wishlist>
107
+
108
+ <PRODUCT_TYPE_bundle>
109
+ <reference name="product.composite.fieldset">
110
+ <block type="bundle/adminhtml_catalog_product_composite_fieldset_bundle" before="product.composite.fieldset.options" name="product.composite.fieldset.bundle" template="bundle/product/composite/fieldset/options/bundle.phtml">
111
+ <action method="addRenderer"><type>select</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_select</block></action>
112
+ <action method="addRenderer"><type>multi</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_multi</block></action>
113
+ <action method="addRenderer"><type>radio</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_radio</block></action>
114
+ <action method="addRenderer"><type>checkbox</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_checkbox</block></action>
115
+ </block>
116
+ </reference>
117
+ </PRODUCT_TYPE_bundle>
118
+ </layout>
app/design/adminhtml/default/default/layout/captcha.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+ <adminhtml_index_login>
31
+ <reference name="form.additional.info">
32
+ <block type="captcha/captcha" name="captcha">
33
+ <action method="setFormId"><formId>backend_login</formId></action>
34
+ <action method="setImgWidth"><width>226</width></action>
35
+ <action method="setImgHeight"><width>50</width></action>
36
+ </block>
37
+ </reference>
38
+ </adminhtml_index_login>
39
+ <adminhtml_index_forgotpassword>
40
+ <reference name="form.additional.info">
41
+ <block type="captcha/captcha" name="captcha">
42
+ <action method="setFormId"><formId>backend_forgotpassword</formId></action>
43
+ <action method="setImgWidth"><width>226</width></action>
44
+ <action method="setImgHeight"><width>50</width></action>
45
+ </block>
46
+ </reference>
47
+ </adminhtml_index_forgotpassword>
48
+ </layout>
app/design/adminhtml/default/default/layout/catalog.xml ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_catalog_product_index>
31
+ <referense name="head">
32
+ <action method="setTitle" translate="title"><title>Catalog</title></action>
33
+ </referense>
34
+ <reference name="menu">
35
+ <action method="setActive"><menupath>catalog/products</menupath></action>
36
+ </reference>
37
+ <reference name="content">
38
+ <block type="adminhtml/catalog_product" name="products_list">
39
+ <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher">
40
+ <action method="setUseConfirm"><params>0</params></action>
41
+ </block>
42
+ </block>
43
+ </reference>
44
+ </adminhtml_catalog_product_index>
45
+
46
+ <adminhtml_catalog_product_new>
47
+ <update handle="editor"/>
48
+ <reference name="content">
49
+ <block type="adminhtml/catalog_product_edit" name="product_edit"></block>
50
+ </reference>
51
+ <reference name="left">
52
+ <block type="adminhtml/catalog_product_edit_tabs" name="product_tabs"></block>
53
+ </reference>
54
+ <reference name="js">
55
+ <block type="adminhtml/catalog_product_edit_js" template="catalog/product/js.phtml" name="catalog_product_js"></block>
56
+ <block type="core/template" template="catalog/wysiwyg/js.phtml"/>
57
+ </reference>
58
+ </adminhtml_catalog_product_new>
59
+
60
+ <adminhtml_catalog_product_edit>
61
+ <update handle="editor"/>
62
+ <reference name="content">
63
+ <block type="adminhtml/catalog_product_edit" name="product_edit"></block>
64
+ </reference>
65
+ <reference name="left">
66
+ <block type="adminhtml/store_switcher" name="store_switcher" before="-"></block>
67
+ <block type="adminhtml/catalog_product_edit_tabs" name="product_tabs"></block>
68
+ </reference>
69
+ <reference name="js">
70
+ <block type="adminhtml/catalog_product_edit_js" template="catalog/product/js.phtml" name="catalog_product_js"></block>
71
+ <block type="core/template" name="catalog.wysiwyg.js" template="catalog/wysiwyg/js.phtml"/>
72
+ </reference>
73
+ </adminhtml_catalog_product_edit>
74
+
75
+ <adminhtml_catalog_product_categories>
76
+ <block type="core/text_list" name="root" output="toHtml">
77
+ <block type="adminhtml/catalog_product_edit_tab_categories" name="catalog.product.edit.tab.categories"/>
78
+ </block>
79
+ </adminhtml_catalog_product_categories>
80
+
81
+ <adminhtml_catalog_product_reviews>
82
+ <block type="core/text_list" name="root" output="toHtml">
83
+ <block type="adminhtml/catalog_product_edit_tab_reviews" name="admin.product.reviews"/>
84
+ </block>
85
+ </adminhtml_catalog_product_reviews>
86
+
87
+ <adminhtml_catalog_product_taggrid>
88
+ <block type="core/text_list" name="root" output="toHtml">
89
+ <block type="adminhtml/catalog_product_edit_tab_tag" name="admin.product.tags"/>
90
+ </block>
91
+ </adminhtml_catalog_product_taggrid>
92
+
93
+ <adminhtml_catalog_product_tagcustomergrid>
94
+ <block type="core/text_list" name="root" output="toHtml">
95
+ <block type="adminhtml/catalog_product_edit_tab_tag_customer" name="admin.product.tags.customers"/>
96
+ </block>
97
+ </adminhtml_catalog_product_tagcustomergrid>
98
+
99
+ <adminhtml_catalog_product_options>
100
+ <block type="core/text_list" name="root" output="toHtml">
101
+ <block type="adminhtml/catalog_product_edit_tab_options" name="admin.product.options"/>
102
+ </block>
103
+ </adminhtml_catalog_product_options>
104
+
105
+ <adminhtml_catalog_product_grid>
106
+ <block type="core/text_list" name="root" output="toHtml">
107
+ <block type="adminhtml/catalog_product_grid" name="admin.product.grid"/>
108
+ </block>
109
+ </adminhtml_catalog_product_grid>
110
+
111
+ <adminhtml_catalog_product_related>
112
+ <block type="core/text_list" name="root" output="toHtml">
113
+ <block type="adminhtml/catalog_product_edit_tab_related" name="catalog.product.edit.tab.related"/>
114
+ <block type="adminhtml/widget_grid_serializer" name="related_grid_serializer">
115
+ <reference name="related_grid_serializer">
116
+ <action method="initSerializerBlock">
117
+ <grid_block_name>catalog.product.edit.tab.related</grid_block_name>
118
+ <data_callback>getSelectedRelatedProducts</data_callback>
119
+ <hidden_input_name>links[related]</hidden_input_name>
120
+ <reload_param_name>products_related</reload_param_name>
121
+ </action>
122
+ <action method="addColumnInputName">
123
+ <input_name>position</input_name>
124
+ </action>
125
+ </reference>
126
+ </block>
127
+ </block>
128
+ </adminhtml_catalog_product_related>
129
+
130
+ <adminhtml_catalog_product_relatedgrid>
131
+ <block type="core/text_list" name="root" output="toHtml">
132
+ <block type="adminhtml/catalog_product_edit_tab_related" name="catalog.product.edit.tab.related"/>
133
+ </block>
134
+ </adminhtml_catalog_product_relatedgrid>
135
+
136
+ <adminhtml_catalog_product_superconfig>
137
+ <block type="adminhtml/catalog_product_edit_tab_super_config_grid" name="admin.product.edit.tab.super.config.grid" output="toHtml" />
138
+ </adminhtml_catalog_product_superconfig>
139
+
140
+ <adminhtml_catalog_product_alertspricegrid>
141
+ <block type="adminhtml/catalog_product_edit_tab_alerts_price" name="admin.product.edit.tab.alerts.price" output="toHtml" />
142
+ </adminhtml_catalog_product_alertspricegrid>
143
+
144
+ <adminhtml_catalog_product_alertsstockgrid>
145
+ <block type="adminhtml/catalog_product_edit_tab_alerts_stock" name="admin.product.edit.tab.alerts.stock" output="toHtml" />
146
+ </adminhtml_catalog_product_alertsstockgrid>
147
+
148
+ <adminhtml_catalog_product_upsell>
149
+ <block type="core/text_list" name="root" output="toHtml">
150
+ <block type="adminhtml/catalog_product_edit_tab_upsell" name="catalog.product.edit.tab.upsell"/>
151
+ <block type="adminhtml/widget_grid_serializer" name="upsell_grid_serializer">
152
+ <reference name="upsell_grid_serializer">
153
+ <action method="initSerializerBlock">
154
+ <grid_block_name>catalog.product.edit.tab.upsell</grid_block_name>
155
+ <data_callback>getSelectedUpsellProducts</data_callback>
156
+ <hidden_input_name>links[upsell]</hidden_input_name>
157
+ <reload_param_name>products_upsell</reload_param_name>
158
+ </action>
159
+ <action method="addColumnInputName">
160
+ <input_name>position</input_name>
161
+ </action>
162
+ </reference>
163
+ </block>
164
+ </block>
165
+ </adminhtml_catalog_product_upsell>
166
+
167
+ <adminhtml_catalog_product_upsellgrid>
168
+ <block type="core/text_list" name="root" output="toHtml">
169
+ <block type="adminhtml/catalog_product_edit_tab_upsell" name="catalog.product.edit.tab.upsell"/>
170
+ </block>
171
+ </adminhtml_catalog_product_upsellgrid>
172
+
173
+ <adminhtml_catalog_product_crosssell>
174
+ <block type="core/text_list" name="root" output="toHtml">
175
+ <block type="adminhtml/catalog_product_edit_tab_crosssell" name="catalog.product.edit.tab.crosssell"/>
176
+ <block type="adminhtml/widget_grid_serializer" name="crosssell_grid_serializer">
177
+ <reference name="crosssell_grid_serializer">
178
+ <action method="initSerializerBlock">
179
+ <grid_block_name>catalog.product.edit.tab.crosssell</grid_block_name>
180
+ <data_callback>getSelectedCrossSellProducts</data_callback>
181
+ <hidden_input_name>links[crosssell]</hidden_input_name>
182
+ <reload_param_name>products_crosssell</reload_param_name>
183
+ </action>
184
+ <action method="addColumnInputName">
185
+ <input_name>position</input_name>
186
+ </action>
187
+ </reference>
188
+ </block>
189
+ </block>
190
+ </adminhtml_catalog_product_crosssell>
191
+
192
+ <adminhtml_catalog_product_crosssellgrid>
193
+ <block type="core/text_list" name="root" output="toHtml">
194
+ <block type="adminhtml/catalog_product_edit_tab_crosssell" name="catalog.product.edit.tab.crosssell"/>
195
+ </block>
196
+ </adminhtml_catalog_product_crosssellgrid>
197
+ <!--
198
+ Layout handle for simple products
199
+ -->
200
+
201
+ <adminhtml_catalog_product_simple />
202
+
203
+ <!--
204
+ Layout handle for grouped products
205
+ -->
206
+ <adminhtml_catalog_product_grouped>
207
+ <reference name="product_tabs">
208
+ <action method="addTab"><name>super</name><block>adminhtml/catalog_product_edit_tab_super_group</block></action>
209
+ </reference>
210
+ </adminhtml_catalog_product_grouped>
211
+
212
+ <adminhtml_catalog_product_supergroup>
213
+ <block type="core/text_list" name="root" output="toHtml">
214
+ <block type="adminhtml/catalog_product_edit_tab_super_group" name="catalog.product.edit.tab.super.group" />
215
+ <block type="adminhtml/widget_grid_serializer" name="grouped_grid_serializer">
216
+ <reference name="grouped_grid_serializer">
217
+ <action method="initSerializerBlock">
218
+ <grid_block_name>catalog.product.edit.tab.super.group</grid_block_name>
219
+ <data_callback>getSelectedGroupedProducts</data_callback>
220
+ <hidden_input_name>links[grouped]</hidden_input_name>
221
+ <reload_param_name>products_grouped</reload_param_name>
222
+ </action>
223
+ <action method="addColumnInputName">
224
+ <input_name>qty</input_name>
225
+ <input_name>position</input_name>
226
+ </action>
227
+ </reference>
228
+ </block>
229
+ </block>
230
+ </adminhtml_catalog_product_supergroup>
231
+
232
+ <adminhtml_catalog_product_supergroupgridonly>
233
+ <block type="core/text_list" name="root">
234
+ <block type="adminhtml/catalog_product_edit_tab_super_group" name="catalog.product.edit.tab.super.group" />
235
+ </block>
236
+ </adminhtml_catalog_product_supergroupgridonly>
237
+ <!--
238
+ Layout handle for configurable products
239
+ -->
240
+
241
+ <adminhtml_catalog_product_configurable_new>
242
+ <remove name="product_tabs"/>
243
+ <reference name="left">
244
+ <block type="adminhtml/catalog_product_edit_tabs_configurable" name="configurable_product_tabs"></block>
245
+ </reference>
246
+ </adminhtml_catalog_product_configurable_new>
247
+
248
+ <adminhtml_catalog_product_configurable>
249
+ <reference name="product_tabs">
250
+ <action method="addTab"><name>configurable</name><block>adminhtml/catalog_product_edit_tab_super_config</block></action>
251
+ <action method="bindShadowTabs"><first>configurable</first><second>customer_options</second></action>
252
+ </reference>
253
+ </adminhtml_catalog_product_configurable>
254
+
255
+ <adminhtml_catalog_product_action_attribute_edit>
256
+ <reference name="left">
257
+ <block type="adminhtml/store_switcher" name="store_switcher" template="store/switcher.phtml" />
258
+ <block type="adminhtml/catalog_product_edit_action_attribute_tabs" name="attributes_tabs">
259
+ <block type="adminhtml/catalog_product_edit_action_attribute_tab_attributes" name="tab_attributes"/>
260
+ <block type="adminhtml/catalog_product_edit_action_attribute_tab_inventory" name="tab_inventory" template="catalog/product/edit/action/inventory.phtml" />
261
+ <block type="adminhtml/catalog_product_edit_action_attribute_tab_websites" name="tab_websites" template="catalog/product/edit/action/websites.phtml" />
262
+ <action method="addTab"><name>attributes</name><block>tab_attributes</block></action>
263
+ <action method="addTab"><name>inventory</name><block>tab_inventory</block></action>
264
+ <action method="addTab"><name>websites</name><block>tab_websites</block></action>
265
+ </block>
266
+ </reference>
267
+ <reference name="content">
268
+ <block type="adminhtml/catalog_product_edit_action_attribute" name="attribute" template="catalog/product/edit/action/attribute.phtml" />
269
+ </reference>
270
+ </adminhtml_catalog_product_action_attribute_edit>
271
+
272
+ <adminhtml_catalog_product_attribute_edit>
273
+ <reference name="left">
274
+ <block type="adminhtml/catalog_product_attribute_edit_tabs" name="attribute_edit_tabs"></block>
275
+ </reference>
276
+ <reference name="content">
277
+ <block type="adminhtml/catalog_product_attribute_edit" name="attribute_edit_content"></block>
278
+ </reference>
279
+ <reference name="js">
280
+ <block type="adminhtml/template" name="attribute_edit_js" template="catalog/product/attribute/js.phtml"></block>
281
+ </reference>
282
+ </adminhtml_catalog_product_attribute_edit>
283
+
284
+ <adminhtml_catalog_category_edit>
285
+ <update handle="editor"/>
286
+ <reference name="left">
287
+ <block name="category.tree" type="adminhtml/catalog_category_tree" template="catalog/category/tree.phtml" />
288
+ </reference>
289
+ <reference name="content">
290
+ <block name="category.edit" type="adminhtml/catalog_category_edit" template="catalog/category/edit.phtml" />
291
+ </reference>
292
+ <reference name="js">
293
+ <block type="core/template" template="catalog/wysiwyg/js.phtml" name="catalog.wysiwyg.js" />
294
+ </reference>
295
+ </adminhtml_catalog_category_edit>
296
+
297
+ <ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE>
298
+ <block type="adminhtml/catalog_product_composite_fieldset" name="product.composite.fieldset" output="toHtml">
299
+ <block name="product.composite.fieldset.options" type="adminhtml/catalog_product_composite_fieldset_options" template="catalog/product/composite/fieldset/options.phtml">
300
+ <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/composite/fieldset/options/type/text.phtml</template></action>
301
+ <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/composite/fieldset/options/type/file.phtml</template></action>
302
+ <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/composite/fieldset/options/type/select.phtml</template></action>
303
+ <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/composite/fieldset/options/type/date.phtml</template></action>
304
+ <block type="core/template" name="product.composite.fieldset.options.js" as="options_js" template="catalog/product/composite/fieldset/options/js.phtml"/>
305
+ </block>
306
+ <block type="adminhtml/catalog_product_composite_fieldset_qty" name="product.composite.fieldset.qty" template="catalog/product/composite/fieldset/qty.phtml"/>
307
+ </block>
308
+ </ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE>
309
+
310
+ <ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR>
311
+ <block type="adminhtml/catalog_product_composite_error" name="product.composite.error" output="toHtml" />
312
+ </ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR>
313
+
314
+ <ADMINHTML_CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT>
315
+ <block type="adminhtml/catalog_product_composite_update_result" name="product.composite.update.result" output="toHtml" />
316
+ </ADMINHTML_CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT>
317
+ <!--
318
+ Additional block in composite_fieldset block dependant on product type
319
+ -->
320
+ <PRODUCT_TYPE_configurable>
321
+ <reference name="product.composite.fieldset">
322
+ <block type="adminhtml/catalog_product_composite_fieldset_configurable" name="product.composite.fieldset.configurable" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/configurable.phtml" />
323
+ </reference>
324
+ </PRODUCT_TYPE_configurable>
325
+ <PRODUCT_TYPE_grouped>
326
+ <reference name="product.composite.fieldset">
327
+ <block type="adminhtml/catalog_product_composite_fieldset_grouped" name="product.composite.fieldset.grouped" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/grouped.phtml"/>
328
+ <remove name="product.composite.fieldset.qty"/>
329
+ </reference>
330
+ </PRODUCT_TYPE_grouped>
331
+
332
+ </layout>
app/design/adminhtml/default/default/layout/centinel.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+
31
+ <adminhtml_centinel_index_authenticationstart>
32
+ <block type="centinel/authentication_start" name="root" output="toHtml" template="centinel/authentication/start.phtml"/>
33
+ </adminhtml_centinel_index_authenticationstart>
34
+
35
+ <adminhtml_centinel_index_authenticationcomplete>
36
+ <block type="centinel/authentication_complete" name="root" output="toHtml" template="centinel/authentication/complete.phtml"/>
37
+ </adminhtml_centinel_index_authenticationcomplete>
38
+
39
+ <adminhtml_sales_order_create_index>
40
+ <reference name="head">
41
+ <action method="addJs"><script>mage/adminhtml/sales/centinel.js</script></action>
42
+ </reference>
43
+ <reference name="data">
44
+ <block type="centinel/adminhtml_validation" as="card_validation" name="card_validation" template="sales/order/create/abstract.phtml">
45
+ <block type="centinel/adminhtml_validation_form" template="centinel/validation/form.phtml" name="form" />
46
+ </block>
47
+ </reference>
48
+ </adminhtml_sales_order_create_index>
49
+
50
+ <adminhtml_sales_order_create_start>
51
+ <update handle="adminhtml_sales_order_create_index"/>
52
+ </adminhtml_sales_order_create_start>
53
+
54
+ <adminhtml_sales_order_create_load_block_data>
55
+ <reference name="data">
56
+ <block type="centinel/adminhtml_validation" as="card_validation" name="card_validation" template="sales/order/create/abstract.phtml">
57
+ <block type="centinel/adminhtml_validation_form" template="centinel/validation/form.phtml" name="form" />
58
+ </block>
59
+ </reference>
60
+ </adminhtml_sales_order_create_load_block_data>
61
+
62
+ <adminhtml_sales_order_create_load_block_card_validation>
63
+ <reference name="content">
64
+ <block type="centinel/adminhtml_validation" as="card_validation" name="card_validation" template="sales/order/create/abstract.phtml">
65
+ <block type="centinel/adminhtml_validation_form" template="centinel/validation/form.phtml" name="form" />
66
+ </block>
67
+ </reference>
68
+ </adminhtml_sales_order_create_load_block_card_validation>
69
+
70
+ </layout>
app/design/adminhtml/default/default/layout/cms.xml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_cms_page_index>
31
+ <reference name="content">
32
+ <block type="adminhtml/cms_page" name="cms_page"></block>
33
+ </reference>
34
+ </adminhtml_cms_page_index>
35
+
36
+ <adminhtml_cms_page_new>
37
+ <update handle="adminhtml_cms_page_edit" />
38
+ </adminhtml_cms_page_new>
39
+
40
+ <adminhtml_cms_page_edit>
41
+ <update handle="editor"/>
42
+ <reference name="content">
43
+ <block type="adminhtml/cms_page_edit" name="cms_page_edit"></block>
44
+ </reference>
45
+ <reference name="left">
46
+ <block type="adminhtml/cms_page_edit_tabs" name="cms_page_edit_tabs">
47
+ <block type="adminhtml/cms_page_edit_tab_main" name="cms_page_edit_tab_main" />
48
+ <block type="adminhtml/cms_page_edit_tab_content" name="cms_page_edit_tab_content" />
49
+ <block type="adminhtml/cms_page_edit_tab_design" name="cms_page_edit_tab_design" />
50
+ <block type="adminhtml/cms_page_edit_tab_meta" name="cms_page_edit_tab_meta" />
51
+ <action method="addTab"><name>main_section</name><block>cms_page_edit_tab_main</block></action>
52
+ <action method="addTab"><name>content_section</name><block>cms_page_edit_tab_content</block></action>
53
+ <action method="addTab"><name>design_section</name><block>cms_page_edit_tab_design</block></action>
54
+ <action method="addTab"><name>meta_section</name><block>cms_page_edit_tab_meta</block></action>
55
+ </block>
56
+ </reference>
57
+ </adminhtml_cms_page_edit>
58
+
59
+ <adminhtml_cms_block_index>
60
+ <reference name="content">
61
+ <block type="adminhtml/cms_block" name="cms_block"></block>
62
+ </reference>
63
+ </adminhtml_cms_block_index>
64
+
65
+ <adminhtml_cms_block_new>
66
+ <update handle="adminhtml_cms_block_edit" />
67
+ </adminhtml_cms_block_new>
68
+
69
+ <adminhtml_cms_block_edit>
70
+ <update handle="editor"/>
71
+ <reference name="content">
72
+ <block type="adminhtml/cms_block_edit" name="cms_block_edit"></block>
73
+ </reference>
74
+ </adminhtml_cms_block_edit>
75
+
76
+ <adminhtml_cms_wysiwyg_images_index>
77
+ <remove name="footer" />
78
+ <remove name="head" />
79
+ <reference name="left">
80
+ <block name="wysiwyg_images.js" type="adminhtml/cms_wysiwyg_images_content" template="cms/browser/js.phtml" />
81
+ <block name="wysiwyg_images.tree" type="adminhtml/cms_wysiwyg_images_tree" template="cms/browser/tree.phtml" />
82
+ </reference>
83
+ <reference name="content">
84
+ <block name="wysiwyg_images.content" type="adminhtml/cms_wysiwyg_images_content" template="cms/browser/content.phtml">
85
+ <block name="wysiwyg_images.uploader" type="adminhtml/cms_wysiwyg_images_content_uploader" template="cms/browser/content/uploader.phtml" />
86
+ <block name="wysiwyg_images.newfolder" type="adminhtml/cms_wysiwyg_images_content_newfolder" template="cms/browser/content/newfolder.phtml" />
87
+ </block>
88
+ </reference>
89
+ </adminhtml_cms_wysiwyg_images_index>
90
+
91
+ <adminhtml_cms_wysiwyg_images_contents>
92
+ <block name="wysiwyg_images.files" type="adminhtml/cms_wysiwyg_images_content_files" template="cms/browser/content/files.phtml" output="toHtml" />
93
+ </adminhtml_cms_wysiwyg_images_contents>
94
+
95
+ </layout>
app/design/adminhtml/default/default/layout/compiler.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_compiler_process_index>
31
+ <reference name="content">
32
+ <block type="compiler/process" name="compiler_process" template="compiler/process.phtml"></block>
33
+ </reference>
34
+ </adminhtml_compiler_process_index>
35
+ </layout>
app/design/adminhtml/default/default/layout/connect.xml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_extension_custom_edit>
31
+ <reference name="content">
32
+ <block type="connect/adminhtml_extension_custom_edit" name="connect_extension_edit"></block>
33
+ </reference>
34
+ <reference name="left">
35
+ <block type="connect/adminhtml_extension_custom_edit_tabs" name="connect_extension_edit_tabs">
36
+ <block type="connect/adminhtml_extension_custom_edit_tab_package" name="tab_package"
37
+ template="connect/extension/custom/package.phtml" />
38
+ <block type="connect/adminhtml_extension_custom_edit_tab_release" name="tab_release"
39
+ template="connect/extension/custom/release.phtml" />
40
+ <block type="connect/adminhtml_extension_custom_edit_tab_authors" name="tab_authors"
41
+ template="connect/extension/custom/authors.phtml" />
42
+ <block type="connect/adminhtml_extension_custom_edit_tab_depends" name="tab_depends"
43
+ template="connect/extension/custom/depends.phtml" />
44
+ <block type="connect/adminhtml_extension_custom_edit_tab_contents" name="tab_contents"
45
+ template="connect/extension/custom/contents.phtml" />
46
+ <block type="connect/adminhtml_extension_custom_edit_tab_local" name="tab_local" />
47
+
48
+ <action method="addTab"><name>package_info</name><block>tab_package</block></action>
49
+ <action method="addTab"><name>release_info</name><block>tab_release</block></action>
50
+ <action method="addTab"><name>authors</name><block>tab_authors</block></action>
51
+ <action method="addTab"><name>dependencies</name><block>tab_depends</block></action>
52
+ <action method="addTab"><name>contents</name><block>tab_contents</block></action>
53
+ <action method="addTab"><name>load_local_package</name><block>tab_local</block></action>
54
+ </block>
55
+ </reference>
56
+ </adminhtml_extension_custom_edit>
57
+
58
+ <adminhtml_extension_custom_loadtab>
59
+ <block type="core/text_list" name="root">
60
+ <block type="connect/adminhtml_extension_custom_edit_tab_load" name="connect_extension_load_local_package_grid"
61
+ template="connect/extension/custom/load.phtml">
62
+ <block type="connect/adminhtml_extension_custom_edit_tab_grid" name="local_package_grid" />
63
+ </block>
64
+ </block>
65
+ </adminhtml_extension_custom_loadtab>
66
+
67
+ <adminhtml_extension_custom_grid>
68
+ <block type="core/text_list" name="root">
69
+ <block type="connect/adminhtml_extension_custom_edit_tab_grid" name="connect_extension_edit_local_package_grid" />
70
+ </block>
71
+ </adminhtml_extension_custom_grid>
72
+ </layout>
73
+
app/design/adminhtml/default/default/layout/currencysymbol.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <adminhtml_system_currencysymbol_index>
30
+ <reference name="content">
31
+ <block type="currencysymbol/adminhtml_system_currencysymbol" name="mage.system.currencysymbol" template="currencysymbol/grid.phtml"/>
32
+ </reference>
33
+ </adminhtml_system_currencysymbol_index>
34
+ </layout>
app/design/adminhtml/default/default/layout/customer.xml ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_customer_edit>
31
+ <reference name="content">
32
+ <block type="adminhtml/customer_edit" name="customer_edit"></block>
33
+ </reference>
34
+ <reference name="head">
35
+ <block type="adminhtml/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
36
+ <action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
37
+ <action method="addJs"><file>varien/configurable.js</file></action>
38
+ </reference>
39
+ <reference name="left">
40
+ <block type="adminhtml/customer_edit_tabs" name="customer_edit_tabs">
41
+ <block type="adminhtml/customer_edit_tab_view" name="customer_edit_tab_view" template="customer/tab/view.phtml">
42
+ <block type="adminhtml/customer_edit_tab_view_sales" name="sales" template="customer/tab/view/sales.phtml" before="-" />
43
+ <block type="adminhtml/customer_edit_tab_view_accordion" name="accordion" />
44
+ </block>
45
+ <action method="addTab"><name>customer_edit_tab_view</name><block>customer_edit_tab_view</block></action>
46
+ </block>
47
+ </reference>
48
+ <reference name="js">
49
+ <block type="adminhtml/template" template="customer/edit/js.phtml" name="customer.edit.js" as="customer_edit_js"></block>
50
+ </reference>
51
+ </adminhtml_customer_edit>
52
+ <adminhtml_customer_group_index>
53
+ <reference name="content">
54
+ <block type="adminhtml/customer_group" name="customer_group"></block>
55
+ </reference>
56
+ </adminhtml_customer_group_index>
57
+ <adminhtml_customer_wishlist>
58
+ <block type="adminhtml/customer_edit_tab_wishlist" name="customer.wishlist.edit.tab" output="toHtml" />
59
+ </adminhtml_customer_wishlist>
60
+
61
+ <adminhtml_customer_orders>
62
+ <block type="core/text_list" name="root" output="toHtml">
63
+ <block type="adminhtml/customer_edit_tab_orders" name="adminhtml.customer.edit.tab.orders"/>
64
+ </block>
65
+ </adminhtml_customer_orders>
66
+
67
+ <adminhtml_customer_carts>
68
+ <block type="core/text_list" name="root" output="toHtml">
69
+ <block type="adminhtml/customer_edit_tab_carts" name="admin.customer.carts"/>
70
+ </block>
71
+ </adminhtml_customer_carts>
72
+
73
+ <adminhtml_customer_viewcart>
74
+ <block type="core/text_list" name="root" output="toHtml">
75
+ <block type="adminhtml/customer_edit_tab_view_cart" name="admin.customer.view.cart"/>
76
+ </block>
77
+ </adminhtml_customer_viewcart>
78
+
79
+ <adminhtml_customer_viewwishlist>
80
+ <block type="core/text_list" name="root" output="toHtml">
81
+ <block type="adminhtml/customer_edit_tab_view_wishlist" name="admin.customer.view.wishlist"/>
82
+ </block>
83
+ </adminhtml_customer_viewwishlist>
84
+
85
+ <adminhtml_customer_lastorders>
86
+ <block type="core/text_list" name="root" output="toHtml">
87
+ <block type="adminhtml/customer_edit_tab_view_orders" name="admin.customer.lastorders"/>
88
+ </block>
89
+ </adminhtml_customer_lastorders>
90
+
91
+ <adminhtml_customer_productreviews>
92
+ <block type="core/text_list" name="root" output="toHtml">
93
+ <block type="adminhtml/customer_edit_tab_reviews" name="admin.customer.reviews"/>
94
+ </block>
95
+ </adminhtml_customer_productreviews>
96
+
97
+ <adminhtml_customer_producttags>
98
+ <block type="core/text_list" name="root" output="toHtml">
99
+ <block type="adminhtml/customer_edit_tab_tag" name="admin.customer.tags"/>
100
+ </block>
101
+ </adminhtml_customer_producttags>
102
+
103
+ <adminhtml_customer_taggrid>
104
+ <block type="core/text_list" name="root" output="toHtml">
105
+ <block type="adminhtml/customer_edit_tab_tag" name="admin.customer.tags"/>
106
+ </block>
107
+ </adminhtml_customer_taggrid>
108
+
109
+ <adminhtml_customer_newsletter>
110
+ <block type="core/text_list" name="root" output="toHtml">
111
+ <block type="adminhtml/customer_edit_tab_newsletter_grid" name="admin.customer.newsletter.grid"/>
112
+ </block>
113
+ </adminhtml_customer_newsletter>
114
+
115
+ <adminhtml_customer_grid>
116
+ <block type="core/text_list" name="root" output="toHtml">
117
+ <block type="adminhtml/customer_grid" name="admin.customer.grid"/>
118
+ </block>
119
+ </adminhtml_customer_grid>
120
+
121
+ <adminhtml_customer_cart>
122
+ <block type="core/text_list" name="root" output="toHtml">
123
+ <block type="adminhtml/customer_edit_tab_cart" name="admin.customer.view.edit.cart" />
124
+ </block>
125
+ </adminhtml_customer_cart>
126
+ </layout>
app/design/adminhtml/default/default/layout/dataflow.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <adminhtml_system_convert_gui_run>
32
+ <remove name="root"/>
33
+ <block type="adminhtml/page" name="convert_root" output="toHtml" template="page.phtml">
34
+ <block type="adminhtml/page_head" name="convert_root_head" as="head" template="page/head.phtml">
35
+ <action method="addJs"><script>prototype/prototype.js</script></action>
36
+ <action method="addJs"><script>prototype/validation.js</script></action>
37
+ <action method="addJs"><script>varien/js.js</script></action>
38
+ <action method="addJs"><script>mage/translate.js</script></action>
39
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
40
+ </block>
41
+ <block type="adminhtml/system_convert_profile_run" name="system_convert_profile_run" template="system/convert/profile/process.phtml" output="toHtml"/>
42
+ </block>
43
+ </adminhtml_system_convert_gui_run>
44
+
45
+ <adminhtml_system_convert_profile_run>
46
+ <remove name="root"/>
47
+ <block type="adminhtml/page" name="convert_root" output="toHtml" template="page.phtml">
48
+ <block type="adminhtml/page_head" name="convert_root_head" as="head" template="page/head.phtml">
49
+ <action method="addJs"><script>prototype/prototype.js</script></action>
50
+ <action method="addJs"><script>prototype/validation.js</script></action>
51
+ <action method="addJs"><script>varien/js.js</script></action>
52
+ <action method="addJs"><script>mage/translate.js</script></action>
53
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
54
+ </block>
55
+ <block type="adminhtml/system_convert_profile_run" name="system_convert_profile_run" template="system/convert/profile/process.phtml" output="toHtml"/>
56
+ </block>
57
+ </adminhtml_system_convert_profile_run>
58
+
59
+ </layout>
app/design/adminhtml/default/default/layout/downloadable.xml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <adminhtml_catalog_product_downloadable>
32
+ <reference name="product_tabs">
33
+ <action method="addTab"><name>downloadable_items</name><block>downloadable/adminhtml_catalog_product_edit_tab_downloadable</block></action>
34
+ </reference>
35
+ </adminhtml_catalog_product_downloadable>
36
+
37
+ <adminhtml_sales_order_view>
38
+ <reference name="order_items">
39
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_order_view_items_renderer_default</block><template>downloadable/sales/order/view/items/renderer/downloadable.phtml</template></action>
40
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/name.phtml</template></action>
41
+ </reference>
42
+ </adminhtml_sales_order_view>
43
+
44
+ <adminhtml_sales_order_invoice_new>
45
+ <reference name="order_items">
46
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml</template></action>
47
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/invoice/name.phtml</template></action>
48
+ </reference>
49
+ </adminhtml_sales_order_invoice_new>
50
+
51
+ <adminhtml_sales_order_invoice_updateqty>
52
+ <reference name="order_items">
53
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml</template></action>
54
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/invoice/name.phtml</template></action>
55
+ </reference>
56
+ </adminhtml_sales_order_invoice_updateqty>
57
+
58
+ <adminhtml_sales_order_invoice_view>
59
+ <reference name="invoice_items">
60
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/invoice/view/items/renderer/downloadable.phtml</template></action>
61
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/invoice/name.phtml</template></action>
62
+ </reference>
63
+ </adminhtml_sales_order_invoice_view>
64
+
65
+ <adminhtml_sales_order_creditmemo_new>
66
+ <reference name="order_items">
67
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml</template></action>
68
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/creditmemo/name.phtml</template></action>
69
+ </reference>
70
+ </adminhtml_sales_order_creditmemo_new>
71
+
72
+ <adminhtml_sales_order_creditmemo_updateqty>
73
+ <reference name="order_items">
74
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml</template></action>
75
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/creditmemo/name.phtml</template></action>
76
+ </reference>
77
+ </adminhtml_sales_order_creditmemo_updateqty>
78
+
79
+ <adminhtml_sales_order_creditmemo_view>
80
+ <reference name="creditmemo_items">
81
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/creditmemo/view/items/renderer/downloadable.phtml</template></action>
82
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/creditmemo/name.phtml</template></action>
83
+ </reference>
84
+ </adminhtml_sales_order_creditmemo_view>
85
+
86
+ <adminhtml_customer_wishlist>
87
+ <reference name="customer.wishlist.edit.tab">
88
+ <action method="addProductConfigurationHelper"><type>downloadable</type><name>downloadable/catalog_product_configuration</name></action>
89
+ </reference>
90
+ </adminhtml_customer_wishlist>
91
+
92
+ <PRODUCT_TYPE_downloadable>
93
+ <reference name="product.composite.fieldset">
94
+ <block type="downloadable/adminhtml_catalog_product_composite_fieldset_downloadable" name="product.composite.fieldset.downloadable" before="product.composite.fieldset.options" template="downloadable/product/composite/fieldset/downloadable.phtml" />
95
+ </reference>
96
+ </PRODUCT_TYPE_downloadable>
97
+ </layout>
app/design/adminhtml/default/default/layout/giftmessage.xml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_sales_order_view>
31
+ <reference name="order_item_extra_info">
32
+ <block type="giftmessage/adminhtml_sales_order_view_giftoptions" name="gift_options_link" template="giftmessage/sales/order/view/giftoptions.phtml">
33
+ <block type="giftmessage/adminhtml_sales_order_view_items" name="gift_options_item_data" template="giftmessage/sales/order/view/items.phtml" />
34
+ </block>
35
+ </reference>
36
+ <reference name="order_tab_info">
37
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
38
+ <block type="giftmessage/adminhtml_sales_order_view_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
39
+ </block>
40
+ </reference>
41
+ </adminhtml_sales_order_view>
42
+
43
+ <adminhtml_sales_order_create_index>
44
+ <reference name="order_item_extra_info">
45
+ <block type="giftmessage/adminhtml_sales_order_create_giftoptions" name="gift_options_link" template="giftmessage/sales/order/create/giftoptions.phtml">
46
+ <block type="giftmessage/adminhtml_sales_order_create_items" name="gift_options_item_data" template="giftmessage/sales/order/create/items.phtml" />
47
+ </block>
48
+ </reference>
49
+ <reference name="items_grid">
50
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
51
+ <block type="giftmessage/adminhtml_sales_order_create_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
52
+ </block>
53
+ </reference>
54
+ </adminhtml_sales_order_create_index>
55
+
56
+ <adminhtml_sales_order_create_load_block_data>
57
+ <reference name="order_item_extra_info">
58
+ <block type="giftmessage/adminhtml_sales_order_create_giftoptions" name="gift_options_link" template="giftmessage/sales/order/create/giftoptions.phtml">
59
+ <block type="giftmessage/adminhtml_sales_order_create_items" name="gift_options_item_data" template="giftmessage/sales/order/create/items.phtml" />
60
+ </block>
61
+ </reference>
62
+ <reference name="items_grid">
63
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
64
+ <block type="giftmessage/adminhtml_sales_order_create_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
65
+ </block>
66
+ </reference>
67
+ </adminhtml_sales_order_create_load_block_data>
68
+
69
+ <adminhtml_sales_order_create_load_block_items>
70
+ <reference name="order_item_extra_info">
71
+ <block type="giftmessage/adminhtml_sales_order_create_giftoptions" name="gift_options_link" template="giftmessage/sales/order/create/giftoptions.phtml">
72
+ <block type="giftmessage/adminhtml_sales_order_create_items" name="gift_options_item_data" template="giftmessage/sales/order/create/items.phtml" />
73
+ </block>
74
+ </reference>
75
+ <reference name="items_grid">
76
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
77
+ <block type="giftmessage/adminhtml_sales_order_create_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
78
+ </block>
79
+ </reference>
80
+ </adminhtml_sales_order_create_load_block_items>
81
+ </layout>
82
+
app/design/adminhtml/default/default/layout/importexport.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_import_index>
4
+ <reference name="content">
5
+ <block type="adminhtml/template" template="importexport/import/form/before.phtml" name="import.form.before" alias="form_before"/>
6
+ <block type="importexport/adminhtml_import_edit" name="import.form.container"/>
7
+ <block type="adminhtml/template" template="importexport/import/form/after.phtml" name="import.form.after" alias="form_after"/>
8
+ </reference>
9
+ </adminhtml_import_index>
10
+ <adminhtml_import_validate>
11
+ <block type="importexport/adminhtml_import_frame_result" template="importexport/import/frame/result.phtml" name="import.frame.result" alias="import_frame_result" output="toHtml"/>
12
+ </adminhtml_import_validate>
13
+ <adminhtml_import_start>
14
+ <block type="importexport/adminhtml_import_frame_result" template="importexport/import/frame/result.phtml" name="import.frame.result" alias="import_frame_result" output="toHtml"/>
15
+ </adminhtml_import_start>
16
+ <adminhtml_import_busy>
17
+ <reference name="content">
18
+ <block type="core/template" template="importexport/busy.phtml" name="busy" alias="busy"/>
19
+ </reference>
20
+ </adminhtml_import_busy>
21
+ <adminhtml_export_index>
22
+ <reference name="content">
23
+ <block type="adminhtml/template" template="importexport/export/form/before.phtml" name="export.form.before" alias="form_before"/>
24
+ <block type="importexport/adminhtml_export_edit" name="export.form.container"/>
25
+ <block type="adminhtml/template" template="importexport/export/form/after.phtml" name="export.form.after" alias="form_after"/>
26
+ </reference>
27
+ </adminhtml_export_index>
28
+ <adminhtml_export_getfilter>
29
+ <block type="core/text_list" name="root">
30
+ <block type="importexport/adminhtml_export_filter" name="export.filter"/>
31
+ </block>
32
+ </adminhtml_export_getfilter>
33
+ </layout>
app/design/adminhtml/default/default/layout/index.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <default>
30
+ <reference name="notifications">
31
+ <block type="index/adminhtml_notifications" name="index_notifications" template="index/notifications.phtml"></block>
32
+ </reference>
33
+ </default>
34
+
35
+ <adminhtml_process_edit>
36
+ <reference name="content">
37
+ <block type="index/adminhtml_process_edit" name="process_edit"></block>
38
+ </reference>
39
+ <reference name="left">
40
+ <block type="index/adminhtml_process_edit_tabs" name="index_edit_tabs">
41
+ <action method="addTab"><name>main_section</name><block>index/adminhtml_process_edit_tab_main</block></action>
42
+ </block>
43
+ </reference>
44
+ </adminhtml_process_edit>
45
+ </layout>
app/design/adminhtml/default/default/layout/main.xml ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+
29
+ Supported layout update handles (action):
30
+
31
+
32
+ Supported layout update handles (special):
33
+ - adminhtml
34
+ - default
35
+ - admin_noroute
36
+ - admin_denied
37
+ - preview
38
+ - systemPreview
39
+ -->
40
+
41
+ <layout>
42
+
43
+ <!--
44
+ Form key for inserting into various forms
45
+ -->
46
+ <formkey>
47
+ <block type="core/template" name="formkey" as="formkey" template="formkey.phtml"/>
48
+ </formkey>
49
+
50
+ <!--
51
+ Default layout, loads most of the pages
52
+ -->
53
+
54
+ <default>
55
+ <block type="adminhtml/page" name="root" output="toHtml" template="page.phtml">
56
+ <block type="adminhtml/page_head" name="head" as="head" template="page/head.phtml">
57
+ <action method="setTitle" translate="title"><title>Magento Admin</title></action>
58
+ <action method="addJs"><script>prototype/prototype.js</script></action>
59
+ <action method="addItem"><type>js</type><name>extjs/fix-defer-before.js</name><params/><if/><condition>can_load_ext_js</condition></action>
60
+ <action method="addJs"><script>prototype/window.js</script></action>
61
+ <action method="addJs"><script>scriptaculous/builder.js</script></action>
62
+ <action method="addJs"><script>scriptaculous/effects.js</script></action>
63
+ <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
64
+ <action method="addJs"><script>scriptaculous/controls.js</script></action>
65
+ <action method="addJs"><script>scriptaculous/slider.js</script></action>
66
+ <action method="addJs"><script>lib/ccard.js</script></action>
67
+ <action method="addJs"><script>prototype/validation.js</script></action>
68
+ <action method="addJs"><script>varien/js.js</script></action>
69
+ <action method="addJs"><script>mage/translate.js</script></action>
70
+
71
+ <action method="addJs"><script>mage/adminhtml/hash.js</script></action>
72
+ <action method="addJs"><script>mage/adminhtml/events.js</script></action>
73
+ <action method="addJs"><script>mage/adminhtml/loader.js</script></action>
74
+ <action method="addJs"><script>mage/adminhtml/grid.js</script></action>
75
+ <action method="addJs"><script>mage/adminhtml/tabs.js</script></action>
76
+ <action method="addJs"><script>mage/adminhtml/form.js</script></action>
77
+ <action method="addJs"><script>mage/adminhtml/accordion.js</script></action>
78
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
79
+ <action method="addJs"><script>mage/adminhtml/uploader.js</script></action>
80
+ <action method="addJs"><script>mage/adminhtml/product.js</script></action>
81
+
82
+ <action method="addCss"><name>reset.css</name></action>
83
+ <action method="addCss"><name>boxes.css</name></action>
84
+ <action method="addCss"><name>custom.css</name></action>
85
+
86
+ <action method="addItem"><type>skin_css</type><name>iestyles.css</name><params/><if>lt IE 8</if></action>
87
+ <action method="addItem"><type>skin_css</type><name>below_ie7.css</name><params/><if>lt IE 7</if></action>
88
+ <action method="addItem"><type>skin_css</type><name>ie7.css</name><params/><if>IE 7</if></action>
89
+
90
+ <action method="addCss"><name>print.css</name><params>media="print"</params></action>
91
+
92
+ <action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params>defer</params><if>lt IE 7</if></action>
93
+ <action method="addItem"><type>js</type><name>varien/iehover-fix.js</name><params/><if>lt IE 7</if></action>
94
+
95
+ <action method="addItem"><type>skin_css</type><name>menu.css</name><params>media="screen, projection"</params></action>
96
+
97
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
98
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
99
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
100
+
101
+ <action method="addItem"><type>js</type><name>extjs/ext-tree.js</name><params/><if/><condition>can_load_ext_js</condition></action>
102
+ <action method="addItem"><type>js</type><name>extjs/fix-defer.js</name><params/><if/><condition>can_load_ext_js</condition></action>
103
+ <action method="addItem"><type>js</type><name>extjs/ext-tree-checkbox.js</name><params/><if/><condition>can_load_ext_js</condition></action>
104
+ <action method="addItem"><type>js_css</type><name>extjs/resources/css/ext-all.css</name><params/><if/><condition>can_load_ext_js</condition></action>
105
+ <action method="addItem"><type>js_css</type><name>extjs/resources/css/ytheme-magento.css</name><params/><if/><condition>can_load_ext_js</condition></action>
106
+
107
+ <action method="addItem"><type>js</type><name>mage/adminhtml/rules.js</name><params/><if/><condition>can_load_rules_js</condition></action>
108
+
109
+ <action method="addItem"><type>js</type><name>mage/adminhtml/wysiwyg/tiny_mce/setup.js</name><params/><if/><condition>can_load_tiny_mce</condition></action>
110
+
111
+ <block type="core/html_calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"/>
112
+ </block>
113
+
114
+ <block type="adminhtml/page_notices" name="global_notices" as="global_notices" template="page/notices.phtml" />
115
+ <block type="adminhtml/page_header" name="header" as="header"></block>
116
+ <block type="adminhtml/page_menu" name="menu" as="menu"></block>
117
+ <block type="core/text_list" name="notifications" as="notifications">
118
+ <block type="adminhtml/notification_baseurl" name="notification_baseurl" as="notification_baseurl" template="notification/baseurl.phtml"></block>
119
+ <block type="adminhtml/cache_notifications" name="cache_notifications" template="system/cache/notifications.phtml"></block>
120
+ <block type="adminhtml/notification_survey" name="notification_survey" template="notification/survey.phtml"/>
121
+ <block type="adminhtml/notification_security" name="notification_security" as="notification_security" template="notification/security.phtml"></block>
122
+ </block>
123
+ <block type="adminhtml/widget_breadcrumbs" name="breadcrumbs" as="breadcrumbs"></block>
124
+
125
+ <!--<update handle="formkey"/> this won't work, see the try/catch and a jammed exception in Mage_Core_Model_Layout::createBlock() -->
126
+ <block type="core/template" name="formkey" as="formkey" template="formkey.phtml"/>
127
+
128
+ <!-- deprecated since 1.7.0.0 see Mage_Page_Block_Js_Translate -->
129
+ <block type="page/js_translate" name="js_translate" as="js_translate" template="page/js/translate.phtml"/>
130
+ <block type="core/text_list" name="left" as="left"/>
131
+ <block type="core/text_list" name="content" as="content"/>
132
+ <block type="core/messages" name="messages" as="messages"/>
133
+ <block type="core/text_list" name="js" as="js"/>
134
+ <block type="adminhtml/page_footer" name="footer" as="footer">
135
+ <action method="setBugreportUrl"><url>http://www.magentocommerce.com/bug-tracking</url></action>
136
+ </block>
137
+ <block type="core/profiler" name="profiler" as="profiler"/>
138
+ <block type="core/text_list" name="before_body_end" as="before_body_end"/>
139
+
140
+ </block>
141
+ </default>
142
+
143
+ <!--
144
+ Layout for pop up windows
145
+ -->
146
+ <popup>
147
+ <update handle="default"/>
148
+ <remove name="header"/>
149
+ <remove name="menu"/>
150
+ <reference name="root">
151
+ <action method="setTemplate"><template>popup.phtml</template></action>
152
+ </reference>
153
+ </popup>
154
+
155
+ <!--
156
+ Layout for overlay pop up windows
157
+ -->
158
+ <overlay_popup>
159
+ <update handle="popup"/>
160
+ <reference name="root">
161
+ <action method="setTemplate"><template>overlay_popup.phtml</template></action>
162
+ </reference>
163
+ </overlay_popup>
164
+
165
+ <!--
166
+ Layout for editor element
167
+ -->
168
+ <editor>
169
+ <reference name="head">
170
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
171
+ <action method="addJs"><script>mage/adminhtml/variables.js</script></action>
172
+ <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
173
+ <action method="addJs"><script>lib/flex.js</script></action>
174
+ <action method="addJs"><script>lib/FABridge.js</script></action>
175
+ <action method="addJs"><script>mage/adminhtml/flexuploader.js</script></action>
176
+ <action method="addJs"><script>mage/adminhtml/browser.js</script></action>
177
+ <action method="addJs"><script>prototype/window.js</script></action>
178
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
179
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
180
+ </reference>
181
+ </editor>
182
+
183
+ <!--
184
+ No page found
185
+ -->
186
+
187
+ <adminhtml_noroute>
188
+ <reference name="content">
189
+ <block type="core/text" name="content.noRoute">
190
+ <action method="setText" translate="text" module="adminhtml"><text><![CDATA[<h1 class="page-heading">404 Error</h1><p>Page not found.</p>]]></text></action>
191
+ </block>
192
+ </reference>
193
+ </adminhtml_noroute>
194
+
195
+ <!--
196
+ Access denied
197
+ -->
198
+
199
+ <adminhtml_denied>
200
+ <reference name="content">
201
+ <block type="adminhtml/denied" name="content.denied" template="access_denied.phtml"/>
202
+ </reference>
203
+ </adminhtml_denied>
204
+
205
+ <!--
206
+ Base preview layout (?)
207
+ -->
208
+
209
+ <preview>
210
+ <block type="core/template" name="root" output="toHtml" template="newsletter/template/preview.phtml">
211
+ <block type="adminhtml/newsletter_template_preview" name="content" as="content"></block>
212
+ </block>
213
+ </preview>
214
+
215
+ <newsletter_template_preview>
216
+ <block type="core/template" name="root" output="toHtml" template="newsletter/template/preview.phtml">
217
+ <block type="adminhtml/newsletter_template_preview" name="content" as="content"></block>
218
+ </block>
219
+ </newsletter_template_preview>
220
+
221
+ <newsletter_template_preview_switcher>
222
+ <block type="core/template" name="root" output="toHtml" template="newsletter/template/preview/iframeswitcher.phtml">
223
+ <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher" />
224
+ <block type="adminhtml/newsletter_template_preview_form" name="preview_form" />
225
+ </block>
226
+ </newsletter_template_preview_switcher>
227
+
228
+ <newsletter_queue_preview>
229
+ <block type="core/template" name="root" output="toHtml" template="newsletter/queue/preview.phtml">
230
+ <block type="adminhtml/newsletter_queue_preview" name="content" as="content"></block>
231
+ </block>
232
+ </newsletter_queue_preview>
233
+
234
+ <!--
235
+ Base customer alerts preview layout (?)
236
+ -->
237
+
238
+ <alert_preview>
239
+ <block type="core/template" name="root" output="toHtml" template="alert/template/preview.phtml">
240
+ <block type="adminhtml/alert_template_preview" name="content" as="content"></block>
241
+ </block>
242
+ </alert_preview>
243
+ <!--
244
+ Base preview layout
245
+ -->
246
+
247
+ <systemPreview>
248
+ <block type="core/template" name="root" output="toHtml" template="system/email/template/preview.phtml">
249
+ <block type="adminhtml/system_email_template_preview" name="content" as="content"></block>
250
+ </block>
251
+ </systemPreview>
252
+
253
+ <adminhtml_dashboard_customersmost>
254
+ <block type="core/text_list" name="root" output="toHtml">
255
+ <block type="adminhtml/dashboard_tab_customers_most" name="adminhtml.dashboard.tab.customers.most"/>
256
+ </block>
257
+ </adminhtml_dashboard_customersmost>
258
+
259
+ <adminhtml_dashboard_customersnewest>
260
+ <block type="core/text_list" name="root" output="toHtml">
261
+ <block type="adminhtml/dashboard_tab_customers_newest" name="adminhtml.dashboard.tab.customers.newest"/>
262
+ </block>
263
+ </adminhtml_dashboard_customersnewest>
264
+
265
+ <adminhtml_dashboard_productsviewed>
266
+ <block type="core/text_list" name="root" output="toHtml">
267
+ <block type="adminhtml/dashboard_tab_products_viewed" name="adminhtml.dashboard.tab.products.viewed"/>
268
+ </block>
269
+ </adminhtml_dashboard_productsviewed>
270
+
271
+ <adminhtml_index_login>
272
+ <block type="core/text_list" name="root" output="toHtml">
273
+ <block type="adminhtml/template" name="content" template="login.phtml">
274
+ <block type="core/text_list" name="form.additional.info" />
275
+ </block>
276
+ </block>
277
+ </adminhtml_index_login>
278
+
279
+ <adminhtml_index_forgotpassword>
280
+ <block type="core/text_list" name="root" output="toHtml">
281
+ <block type="adminhtml/template" name="content" template="forgotpassword.phtml">
282
+ <block type="core/text_list" name="form.additional.info" />
283
+ </block>
284
+ </block>
285
+ </adminhtml_index_forgotpassword>
286
+ <!--
287
+ Empty hanle for ajax response etc.
288
+ -->
289
+ <empty>
290
+ </empty>
291
+ </layout>
app/design/adminhtml/default/default/layout/mobilenow.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addItem"><type>skin_js</type><name>js/jquery-1.10.2.min.js</name></action>
6
+ <action method="addItem"><type>skin_js</type><name>js/mobilenow.js</name></action>
7
+ <action method="addItem"><type>skin_js</type><name>js/jquery-ui-1.10.3.custom.js</name></action>
8
+ <action method="addItem"><type>skin_js</type><name>js/jquery.minicolors.js</name></action>
9
+ <action method="addItem"><type>skin_js</type><name>js/jquery.colorbox.js</name></action>
10
+ <action method="addItem"><type>skin_js</type><name>js/ajaxupload.js</name></action>
11
+ <action method="addItem"><type>skin_css</type><name>css/mobilenow.css</name></action>
12
+ <action method="addItem"><type>skin_css</type><name>css/colorbox.css</name></action>
13
+ <action method="addItem"><type>skin_css</type><name>css/ui-lightness/jquery-ui-1.10.3.custom.css</name></action>
14
+ <action method="addItem"><type>skin_css</type><name>css/jquery.minicolors.css</name></action>
15
+ </reference>
16
+ </default>
17
+ <adminhtml_system_config_edit>
18
+ <reference name="content">
19
+ <block type="mobilenow/adminhtml_mobilenowbackend" name="mobilenowbackend" template="mobilenow/mobilenowbackend.phtml"/>
20
+ </reference>
21
+ </adminhtml_system_config_edit>
22
+ <mobilenow_adminhtml_mobilenow_index>
23
+ <reference name="content">
24
+ <block type="mobilenow/adminhtml_mobilenow" name="mobilenow" />
25
+ </reference>
26
+ </mobilenow_adminhtml_mobilenow_index>
27
+ </layout>
app/design/adminhtml/default/default/layout/moneybookers.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category design
17
+ * @package default_default
18
+ * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <layout>
23
+ <adminhtml_system_config_edit>
24
+ <reference name="content">
25
+ <block type="moneybookers/jsinit" name="moneybookers_jsinit" template="moneybookers/jsinit.phtml"></block>
26
+ </reference>
27
+ </adminhtml_system_config_edit>
28
+ </layout>
app/design/adminhtml/default/default/layout/newsletter.xml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_newsletter_template_edit>
31
+ <update handle="editor"/>
32
+ <reference name="content">
33
+ <block type="adminhtml/newsletter_template_edit" name="template_edit" template="newsletter/template/edit.phtml" />
34
+ </reference>
35
+ </adminhtml_newsletter_template_edit>
36
+
37
+ <adminhtml_newsletter_queue_edit>
38
+ <update handle="editor"/>
39
+ <reference name="content">
40
+ <block type="adminhtml/newsletter_queue_edit" name="queue_edit" template="newsletter/queue/edit.phtml" />
41
+ </reference>
42
+ </adminhtml_newsletter_queue_edit>
43
+
44
+ <adminhtml_newsletter_queue_preview>
45
+ <reference name="root">
46
+ <action method="setTemplate"><template>newsletter/preview/iframeswitcher.phtml</template></action>
47
+ <block type="adminhtml/newsletter_queue_preview_form" name="preview_form" />
48
+ <block type="adminhtml/store_switcher" name="store_switcher" template="newsletter/preview/store.phtml" />
49
+ </reference>
50
+ </adminhtml_newsletter_queue_preview>
51
+
52
+ <adminhtml_newsletter_template_preview>
53
+ <reference name="root">
54
+ <action method="setTemplate"><template>newsletter/preview/iframeswitcher.phtml</template></action>
55
+ <block type="adminhtml/newsletter_template_preview_form" name="preview_form" />
56
+ <block type="adminhtml/store_switcher" name="store_switcher" template="newsletter/preview/store.phtml" />
57
+ </reference>
58
+ </adminhtml_newsletter_template_preview>
59
+
60
+ <newsletter_queue_preview>
61
+ <block type="adminhtml/newsletter_queue_preview" name="preview_template" />
62
+ </newsletter_queue_preview>
63
+
64
+ <newsletter_template_preview>
65
+ <block type="adminhtml/newsletter_template_preview" name="preview_template" />
66
+ </newsletter_template_preview>
67
+ </layout>
app/design/adminhtml/default/default/layout/oauth.xml ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <!-- Consumers -->
30
+ <adminhtml_oauth_consumer_index>
31
+ <reference name="content">
32
+ <block type="oauth/adminhtml_oauth_consumer" name="oauth_consumer"/>
33
+ </reference>
34
+ </adminhtml_oauth_consumer_index>
35
+
36
+ <adminhtml_oauth_consumer_grid>
37
+ <remove name="root"/>
38
+ <block type="oauth/adminhtml_oauth_consumer_grid" name="oauth_consumer.grid" output="toHtml"/>
39
+ </adminhtml_oauth_consumer_grid>
40
+
41
+ <adminhtml_oauth_consumer_new>
42
+ <reference name="content">
43
+ <block type="oauth/adminhtml_oauth_consumer_edit" name="oauth_consumer.edit">
44
+ <block type="oauth/adminhtml_oauth_consumer_edit_form" name="form"/>
45
+ </block>
46
+ </reference>
47
+ </adminhtml_oauth_consumer_new>
48
+
49
+ <adminhtml_oauth_consumer_edit>
50
+ <reference name="content">
51
+ <block type="oauth/adminhtml_oauth_consumer_edit" name="oauth_consumer.edit">
52
+ <block type="oauth/adminhtml_oauth_consumer_edit_form" name="form"/>
53
+ </block>
54
+ </reference>
55
+ </adminhtml_oauth_consumer_edit>
56
+ <!-- EOF Consumers -->
57
+
58
+ <!-- My Applications -->
59
+ <adminhtml_oauth_admin_token_index>
60
+ <reference name="content">
61
+ <block type="oauth/adminhtml_oauth_admin_token" name="oauth_admin_token"/>
62
+ </reference>
63
+ </adminhtml_oauth_admin_token_index>
64
+
65
+ <adminhtml_oauth_admin_token_grid>
66
+ <remove name="root"/>
67
+ <block type="oauth/adminhtml_oauth_admin_token_grid" name="oauth_admin_token.grid" output="toHtml"/>
68
+ </adminhtml_oauth_admin_token_grid>
69
+ <!-- EOF My Applications -->
70
+
71
+
72
+
73
+ <oauth_root_handle>
74
+ <reference name="root">
75
+ <action method="setTemplate">
76
+ <template>empty.phtml</template>
77
+ </action>
78
+ </reference>
79
+ <reference name="head">
80
+ <action method="removeItem"><type>js</type><name>scriptaculous/controls.js</name></action>
81
+ <action method="removeItem"><type>js</type><name>prototype/window.js</name></action>
82
+ <action method="removeItem"><type>js</type><name>scriptaculous/builder.js</name></action>
83
+ <action method="removeItem"><type>js</type><name>scriptaculous/dragdrop.js</name></action>
84
+ <action method="removeItem"><type>js</type><name>scriptaculous/controls.js</name></action>
85
+ <action method="removeItem"><type>js</type><name>scriptaculous/slider.js</name></action>
86
+ <action method="removeItem"><type>js</type><name>lib/ccard.js</name></action>
87
+ <action method="removeItem"><type>js</type><name>varien/js.js</name></action>
88
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/hash.js</name></action>
89
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/events.js</name></action>
90
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/loader.js</name></action>
91
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/grid.js</name></action>
92
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/tabs.js</name></action>
93
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/accordion.js</name></action>
94
+ <!-- <action method="removeItem"><type>js</type><name>mage/adminhtml/tools.js</name></action>-->
95
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/uploader.js</name></action>
96
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/product.js</name></action>
97
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/rules.js</name></action>
98
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/wysiwyg/tiny_mce/setup.js</name></action>
99
+ <action method="removeItem"><type>js</type><name>lib/ds-sleight.js</name></action>
100
+ <action method="removeItem"><type>js</type><name>varien/iehover-fix.js</name></action>
101
+
102
+ <action method="removeItem"><type>css</type><name>print.css</name></action>
103
+ <action method="removeItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name></action>
104
+ <action method="removeItem"><type>js_css</type><name>extjs/resources/css/ext-all.css</name></action>
105
+ <action method="removeItem"><type>js_css</type><name>extjs/resources/css/ytheme-magento.css</name></action>
106
+ <action method="removeItem"><type>skin_css</type><name>menu.css</name></action>
107
+
108
+ <action method="removeItem"><type>js</type><name>calendar/calendar.js</name></action>
109
+ <action method="removeItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
110
+ <action method="removeItem"><type>js</type><name>extjs/fix-defer-before.js</name></action>
111
+ <action method="removeItem"><type>js</type><name>extjs/ext-tree.js</name></action>
112
+ <action method="removeItem"><type>js</type><name>extjs/fix-defer.js</name></action>
113
+ <action method="removeItem"><type>js</type><name>extjs/ext-tree-checkbox.js</name></action>
114
+ </reference>
115
+ </oauth_root_handle>
116
+
117
+ <oauth_root_handle_simple>
118
+ <remove name="js_cookie" />
119
+ <block type="adminhtml/page" name="root" output="toHtml" template="empty.phtml">
120
+ <block type="adminhtml/page_head" name="head" as="head" template="oauth/authorize/head-simple.phtml">
121
+ <action method="addCss"><name>oauth-simple.css</name></action>
122
+ </block>
123
+ <block type="core/text_list" name="content"/>
124
+ </block>
125
+ </oauth_root_handle_simple>
126
+
127
+ <!-- Authorize -->
128
+ <!--Handle for simple pages-->
129
+ <adminhtml_oauth_authorize_index translate="label">
130
+ <update handle="oauth_root_handle"/>
131
+ <label>OAuth authorization for admin</label>
132
+ <reference name="content">
133
+ <block type="oauth/adminhtml_oauth_authorize" name="oauth.authorize.form" template="oauth/authorize/form/login.phtml"/>
134
+ <block type="oauth/adminhtml_oauth_authorize_button" name="oauth.authorize.button" template="oauth/authorize/button.phtml" />
135
+ </reference>
136
+ </adminhtml_oauth_authorize_index>
137
+
138
+ <adminhtml_oauth_authorize_simple translate="label">
139
+ <update handle="oauth_root_handle_simple"/>
140
+ <label>OAuth authorization simple for admin</label>
141
+ <reference name="content">
142
+ <block type="oauth/adminhtml_oauth_authorize" name="oauth.authorize.form" template="oauth/authorize/form/login-simple.phtml"/>
143
+ <block type="oauth/adminhtml_oauth_authorize_button" name="oauth.authorize.button" template="oauth/authorize/button-simple.phtml" />
144
+ </reference>
145
+ </adminhtml_oauth_authorize_simple>
146
+ <!-- EOF Authorize -->
147
+
148
+ <!-- Confirm Authorization -->
149
+ <adminhtml_oauth_authorize_confirm translate="label">
150
+ <update handle="oauth_root_handle"/>
151
+ <label>Confirm token authorization for admin</label>
152
+ <reference name="content">
153
+ <block type="core/template" name="oauth.authorize.confirm" template="oauth/authorize/confirm.phtml" />
154
+ </reference>
155
+ </adminhtml_oauth_authorize_confirm>
156
+
157
+ <adminhtml_oauth_authorize_confirmsimple translate="label">
158
+ <update handle="oauth_root_handle_simple"/>
159
+ <label>Confirm token authorization Pop Up for admin</label>
160
+ <reference name="content">
161
+ <block type="core/template" name="oauth.authorize.confirm" template="oauth/authorize/confirm-simple.phtml" />
162
+ </reference>
163
+ </adminhtml_oauth_authorize_confirmsimple>
164
+ <!-- EOF Confirm Authorization -->
165
+
166
+ <!-- Reject Authorization -->
167
+ <adminhtml_oauth_authorize_reject translate="label">
168
+ <update handle="oauth_root_handle"/>
169
+ <label>Reject token authorization for admin</label>
170
+ <reference name="content">
171
+ <block type="core/template" name="oauth.authorize.reject" template="oauth/authorize/reject.phtml" />
172
+ </reference>
173
+ </adminhtml_oauth_authorize_reject>
174
+
175
+ <adminhtml_oauth_authorize_rejectsimple translate="label">
176
+ <update handle="oauth_root_handle_simple"/>
177
+ <label>Reject token authorization Pop Up for admin</label>
178
+ <reference name="content">
179
+ <block type="core/template" name="oauth.authorize.reject" template="oauth/authorize/reject-simple.phtml" />
180
+ </reference>
181
+ </adminhtml_oauth_authorize_rejectsimple>
182
+ <!-- EOF Reject Authorization -->
183
+
184
+ <adminhtml_oauth_authorizedtokens_index>
185
+ <reference name="content">
186
+ <block type="oauth/adminhtml_oauth_authorizedTokens" name="oauth_authorizedTokens"/>
187
+ </reference>
188
+ </adminhtml_oauth_authorizedtokens_index>
189
+
190
+ <adminhtml_oauth_authorizedtokens_grid>
191
+ <remove name="root"/>
192
+ <block type="oauth/adminhtml_oauth_authorizedTokens_grid" name="oauth_authorizedTokens.grid" output="toHtml"/>
193
+ </adminhtml_oauth_authorizedtokens_grid>
194
+ </layout>
app/design/adminhtml/default/default/layout/pagecache.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_cache_index>
31
+ <reference name="cache.additional">
32
+ <block type="pagecache/adminhtml_cache_additional" name="page.cache.additional" template = "pagecache/cache/additional.phtml" />
33
+ </reference>
34
+ </adminhtml_cache_index>
35
+ </layout>
app/design/adminhtml/default/default/layout/promo.xml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <!-- Catalog Price Rule -->
31
+ <adminhtml_promo_catalog_index>
32
+ <reference name="content">
33
+ <block type="adminhtml/promo_catalog" name="promo_catalog"/>
34
+ </reference>
35
+ </adminhtml_promo_catalog_index>
36
+ <adminhtml_promo_catalog_edit>
37
+ <reference name="head">
38
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
39
+ <action method="setCanLoadRulesJs"><flag>1</flag></action>
40
+ </reference>
41
+ <reference name="left">
42
+ <block type="adminhtml/promo_catalog_edit_tabs" name="promo_catalog_edit_tabs">
43
+ <block type="adminhtml/promo_catalog_edit_tab_main" name="promo_catalog_edit_tab_main"/>
44
+ <block type="adminhtml/promo_catalog_edit_tab_conditions" name="promo_catalog_edit_tab_conditions"/>
45
+ <block type="adminhtml/promo_catalog_edit_tab_actions" name="promo_catalog_edit_tab_actions"/>
46
+ <action method="addTab"><name>main_section</name><block>promo_catalog_edit_tab_main</block></action>
47
+ <action method="addTab"><name>conditions_section</name><block>promo_catalog_edit_tab_conditions</block></action>
48
+ <action method="addTab"><name>actions_section</name><block>promo_catalog_edit_tab_actions</block></action>
49
+ </block>
50
+ </reference>
51
+ <reference name="content">
52
+ <block type="adminhtml/promo_catalog_edit" name="promo_catalog_edit"/>
53
+ </reference>
54
+ <reference name="js">
55
+ <block type="adminhtml/promo_catalog_edit_js" template="promo/js.phtml" />
56
+ </reference>
57
+ </adminhtml_promo_catalog_edit>
58
+
59
+ <!-- Shopping Cart Price Rule -->
60
+ <adminhtml_promo_quote_index>
61
+ <reference name="content">
62
+ <block type="adminhtml/promo_quote" name="promo_quote"></block>
63
+ </reference>
64
+ </adminhtml_promo_quote_index>
65
+ <adminhtml_promo_quote_edit>
66
+ <reference name="head">
67
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
68
+ <action method="setCanLoadRulesJs"><flag>1</flag></action>
69
+ </reference>
70
+ <reference name="left">
71
+ <block type="adminhtml/promo_quote_edit_tabs" name="promo_quote_edit_tabs">
72
+ <block type="adminhtml/promo_quote_edit_tab_main" name="promo_quote_edit_tab_main" />
73
+ <block type="adminhtml/promo_quote_edit_tab_conditions" name="promo_quote_edit_tab_conditions"/>
74
+ <block type="adminhtml/promo_quote_edit_tab_actions" name="promo_quote_edit_tab_actions"/>
75
+ <block type="adminhtml/promo_quote_edit_tab_labels" name="promo_quote_edit_tab_labels"/>
76
+ <block type="adminhtml/promo_quote_edit_tab_coupons" name="promo_quote_edit_tab_coupons">
77
+ <block type="adminhtml/promo_quote_edit_tab_coupons_form" name="promo_quote_edit_tab_coupons_form"/>
78
+ <block type="adminhtml/promo_quote_edit_tab_coupons_grid" name="promo_quote_edit_tab_coupons_grid"/>
79
+ </block>
80
+ <action method="addTab"><name>main_section</name><block>promo_quote_edit_tab_main</block></action>
81
+ <action method="addTab"><name>conditions_section</name><block>promo_quote_edit_tab_conditions</block></action>
82
+ <action method="addTab"><name>actions_section</name><block>promo_quote_edit_tab_actions</block></action>
83
+ <action method="addTab"><name>labels_section</name><block>promo_quote_edit_tab_labels</block></action>
84
+ <action method="addTab"><name>coupons_section</name><block>promo_quote_edit_tab_coupons</block></action>
85
+ </block>
86
+ <block type="adminhtml/template" template="promo/salesrulejs.phtml" name="promo_quote_edit_jsinit"/>
87
+ </reference>
88
+ <reference name="content">
89
+ <block type="adminhtml/promo_quote_edit" name="promo_quote_edit"></block>
90
+ </reference>
91
+ </adminhtml_promo_quote_edit>
92
+ <adminhtml_promo_quote_grid>
93
+ <remove name="root" />
94
+ <block type="adminhtml/promo_quote_edit_tab_product" name="promo_quote_grid" output="toHtml" />
95
+ </adminhtml_promo_quote_grid>
96
+ <adminhtml_promo_quote_couponsgrid>
97
+ <block type="core/text_list" name="root" output="toHtml">
98
+ <block type="adminhtml/promo_quote_edit_tab_coupons_grid" name="promo_quote_edit_tab_coupons_grid" />
99
+ </block>
100
+ </adminhtml_promo_quote_couponsgrid>
101
+ </layout>
app/design/adminhtml/default/default/layout/report.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_report_statistics_index>
31
+ <reference name="content">
32
+ <block type="adminhtml/report_refresh_statistics" template="report/refresh/statistics.phtml" name="sales.report.refreshstatistics" />
33
+ </reference>
34
+ </adminhtml_report_statistics_index>
35
+ <adminhtml_report_product_viewed>
36
+ <reference name="messages">
37
+ <action method="addNotice" translate="message">
38
+ <message>This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed.</message>
39
+ </action>
40
+ </reference>
41
+ <reference name="content">
42
+ <block type="adminhtml/report_product_viewed" template="report/grid/container.phtml" name="product.report.grid.container">
43
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
44
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
45
+ </block>
46
+ <block type="adminhtml/report_filter_form" name="grid.filter.form">
47
+ <action method="setFieldVisibility">
48
+ <field>report_type</field>
49
+ <visibility>0</visibility>
50
+ </action>
51
+ </block>
52
+ </block>
53
+ </reference>
54
+ </adminhtml_report_product_viewed>
55
+ </layout>
app/design/adminhtml/default/default/layout/rss.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <!--
32
+
33
+ -->
34
+ <adminhtml_rss_catalog_review>
35
+ <block type="rss/catalog_review" output="toHtml" name="rss.catalog.review" />
36
+ </adminhtml_rss_catalog_review>
37
+
38
+ <adminhtml_rss_catalog_notifystock>
39
+ <block type="rss/catalog_notifyStock" output="toHtml" name="rss.catalog.notifystock" />
40
+ </adminhtml_rss_catalog_notifystock>
41
+
42
+ <adminhtml_rss_order_new>
43
+ <block type="rss/order_new" output="toHtml" name="rss.order.new"/>
44
+ </adminhtml_rss_order_new>
45
+ </layout>
app/design/adminhtml/default/default/layout/sales.xml ADDED
@@ -0,0 +1,1080 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_sales_order_grid>
31
+ <update handle="formkey"/>
32
+ <block type="adminhtml/sales_order_grid" name="sales_order.grid" output="toHtml"></block>
33
+ </adminhtml_sales_order_grid>
34
+
35
+ <adminhtml_sales_order_index>
36
+ <reference name="content">
37
+ <block type="adminhtml/sales_order" name="sales_order.grid.container"></block>
38
+ </reference>
39
+ </adminhtml_sales_order_index>
40
+
41
+ <adminhtml_sales_order_transactions>
42
+ <block type="adminhtml/sales_transactions_grid" name="sales_transactions.grid" output="toHtml"></block>
43
+ </adminhtml_sales_order_transactions>
44
+
45
+ <adminhtml_sales_billing_agreement_index>
46
+ <reference name="content">
47
+ <block type="sales/adminhtml_billing_agreement" name="sales.billing.agreement.grid.container"></block>
48
+ </reference>
49
+ </adminhtml_sales_billing_agreement_index>
50
+
51
+ <adminhtml_sales_billing_agreement_grid>
52
+ <block type="sales/adminhtml_billing_agreement_grid" name="sales.billing.agreement.grid" output="toHtml"></block>
53
+ </adminhtml_sales_billing_agreement_grid>
54
+
55
+ <adminhtml_sales_billing_agreement_view>
56
+ <reference name="content">
57
+ <block type="sales/adminhtml_billing_agreement_view" name="sales.billing.agreement.view"></block>
58
+ </reference>
59
+ <reference name="left">
60
+ <block type="sales/adminhtml_billing_agreement_view_tabs" name="sales.billing.agreement.tabs">
61
+ <action method="addTab"><name>billing_agreement_info</name><block>sales/adminhtml_billing_agreement_view_tab_info</block></action>
62
+ <action method="addTab"><name>billing_agreement_orders</name><block>sales/adminhtml_billing_agreement_view_tab_orders</block></action>
63
+ </block>
64
+ </reference>
65
+ </adminhtml_sales_billing_agreement_view>
66
+
67
+ <adminhtml_sales_billing_agreement_ordersgrid>
68
+ <block type="sales/adminhtml_billing_agreement_view_tab_orders" name="related.orders.grid" output="toHtml"></block>
69
+ </adminhtml_sales_billing_agreement_ordersgrid>
70
+
71
+ <adminhtml_sales_billing_agreement_customergrid>
72
+ <block type="sales/adminhtml_customer_edit_tab_agreement" name="customer.billing.agreement.grid" output="toHtml"></block>
73
+ </adminhtml_sales_billing_agreement_customergrid>
74
+
75
+ <adminhtml_sales_order_view>
76
+ <reference name="head">
77
+ <action method="addJs"><file>mage/adminhtml/giftmessage.js</file></action>
78
+ <action method="addJs"><file>mage/adminhtml/giftoptions/tooltip.js</file></action>
79
+ </reference>
80
+ <reference name="content">
81
+ <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
82
+ </reference>
83
+ <reference name="left">
84
+ <block type="adminhtml/sales_order_view_tabs" name="sales_order_tabs">
85
+ <block type="adminhtml/sales_order_view_tab_info" name="order_tab_info" template="sales/order/view/tab/info.phtml">
86
+ <block type="adminhtml/sales_order_view_messages" name="order_messages"></block>
87
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
88
+ <block type="adminhtml/sales_order_view_items" name="order_items" template="sales/order/view/items.phtml">
89
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_order_view_items_renderer_default</block><template>sales/order/view/items/renderer/default.phtml</template></action>
90
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
91
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
92
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
93
+ <block type="core/text_list" name="order_item_extra_info" />
94
+ </block>
95
+ <block type="adminhtml/sales_order_payment" name="order_payment"/>
96
+ <block type="adminhtml/sales_order_view_history" name="order_history" template="sales/order/view/history.phtml"></block>
97
+ <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
98
+ <block type="adminhtml/sales_order_view_giftmessage" name="order_giftmessage" template="sales/order/view/giftmessage.phtml"></block>
99
+ </block>
100
+ <block type="adminhtml/sales_order_totals" name="order_totals" template="sales/order/totals.phtml">
101
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
102
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
103
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
104
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
105
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
106
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
107
+ </block>
108
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
109
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
110
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
111
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
112
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
113
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
114
+ <action method="setSourceField"><value>giftcert_amount</value></action>
115
+ <action method="setLabel"><value>Gift Certificate</value></action>
116
+ </block>
117
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
118
+ <action method="setSourceField"><value>adjustment_positive</value></action>
119
+ <action method="setLabel"><value>Adjustment Refund</value></action>
120
+ </block>
121
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
122
+ <action method="setSourceField"><value>adjustment_negative</value></action>
123
+ <action method="setLabel"><value>Adjustment Fee</value></action>
124
+ </block>
125
+ </block>-->
126
+ </block>
127
+ </block>
128
+ <action method="addTab"><name>order_info</name><block>order_tab_info</block></action>
129
+ <action method="addTab"><name>order_invoices</name><block>adminhtml/sales_order_view_tab_invoices</block></action>
130
+ <action method="addTab"><name>order_creditmemos</name><block>adminhtml/sales_order_view_tab_creditmemos</block></action>
131
+ <action method="addTab"><name>order_shipments</name><block>adminhtml/sales_order_view_tab_shipments</block></action>
132
+ <action method="addTab"><name>order_history</name><block>adminhtml/sales_order_view_tab_history</block></action>
133
+ <action method="addTab"><name>order_transactions</name><block>adminhtml/sales_order_view_tab_transactions</block></action>
134
+ </block>
135
+ </reference>
136
+ </adminhtml_sales_order_view>
137
+
138
+ <adminhtml_sales_order_addcomment>
139
+ <block type="adminhtml/sales_order_view_history" name="order_history" template="sales/order/view/history.phtml" output="toHtml"/>
140
+ </adminhtml_sales_order_addcomment>
141
+
142
+ <adminhtml_sales_order_invoice_new>
143
+ <reference name="content">
144
+ <block type="adminhtml/sales_order_invoice_create" name="sales_invoice_create">
145
+ <block type="adminhtml/sales_order_invoice_create_form" name="form" template="sales/order/invoice/create/form.phtml">
146
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
147
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
148
+ <block type="adminhtml/sales_order_invoice_create_items" name="order_items" template="sales/order/invoice/create/items.phtml">
149
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/invoice/create/items/renderer/default.phtml</template></action>
150
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
151
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
152
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
153
+ <block type="core/text_list" name="order_item_extra_info"></block>
154
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
155
+
156
+ <block type="adminhtml/sales_order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
157
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
158
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
159
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
160
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
161
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
162
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
163
+ </block>
164
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
165
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
166
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
167
+ <action method="setSourceField"><value>tax_amount</value></action>
168
+ <action method="setLabel"><value>Tax</value></action>
169
+ </block>
170
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
171
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
172
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
173
+ <action method="setSourceField"><value>giftcert_amount</value></action>
174
+ <action method="setLabel"><value>Gift Certificate</value></action>
175
+ </block>
176
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
177
+ <action method="setSourceField"><value>adjustment_positive</value></action>
178
+ <action method="setLabel"><value>Adjustment Refund</value></action>
179
+ </block>
180
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
181
+ <action method="setSourceField"><value>adjustment_negative</value></action>
182
+ <action method="setLabel"><value>Adjustment Fee</value></action>
183
+ </block>
184
+ </block>-->
185
+ </block>
186
+ </block>
187
+ </block>
188
+ </block>
189
+ </reference>
190
+ </adminhtml_sales_order_invoice_new>
191
+
192
+ <adminhtml_sales_order_invoice_updateqty>
193
+ <block type="adminhtml/sales_order_invoice_create_items" name="order_items" template="sales/order/invoice/create/items.phtml">
194
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/invoice/create/items/renderer/default.phtml</template></action>
195
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
196
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
197
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
198
+ <block type="core/text_list" name="order_item_extra_info"></block>
199
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
200
+ <block type="adminhtml/sales_order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
201
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
202
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
203
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
204
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
205
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
206
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
207
+ </block>
208
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
209
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
210
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
211
+ <action method="setSourceField"><value>tax_amount</value></action>
212
+ <action method="setLabel"><value>Tax</value></action>
213
+ </block>
214
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
215
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
216
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
217
+ <action method="setSourceField"><value>giftcert_amount</value></action>
218
+ <action method="setLabel"><value>Gift Certificate</value></action>
219
+ </block>
220
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
221
+ <action method="setSourceField"><value>adjustment_positive</value></action>
222
+ <action method="setLabel"><value>Adjustment Refund</value></action>
223
+ </block>
224
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
225
+ <action method="setSourceField"><value>adjustment_negative</value></action>
226
+ <action method="setLabel"><value>Adjustment Fee</value></action>
227
+ </block>
228
+ </block>-->
229
+ </block>
230
+ </block>
231
+ </adminhtml_sales_order_invoice_updateqty>
232
+
233
+ <adminhtml_sales_order_invoice_addcomment>
234
+ <block type="adminhtml/sales_order_invoice_view_comments" name="invoice_comments">
235
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml"></block>
236
+ </block>
237
+ </adminhtml_sales_order_invoice_addcomment>
238
+
239
+ <adminhtml_sales_order_invoice_view>
240
+ <reference name="content">
241
+ <block type="adminhtml/sales_order_invoice_view" name="sales_invoice_view">
242
+ <block type="adminhtml/sales_order_invoice_view_form" name="form" template="sales/order/invoice/view/form.phtml">
243
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
244
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
245
+
246
+ <block type="adminhtml/sales_order_invoice_view_items" name="invoice_items" template="sales/order/invoice/view/items.phtml">
247
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/invoice/view/items/renderer/default.phtml</template></action>
248
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
249
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
250
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
251
+ <block type="core/text_list" name="order_item_extra_info"></block>
252
+ </block>
253
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml">
254
+ <action method="setParentType"><type>invoice</type></action>
255
+ </block>
256
+ <block type="adminhtml/sales_order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
257
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
258
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
259
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
260
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
261
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
262
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
263
+ </block>
264
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
265
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
266
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
267
+ <action method="setSourceField"><value>tax_amount</value></action>
268
+ <action method="setLabel"><value>Tax</value></action>
269
+ </block>
270
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
271
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
272
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
273
+ <action method="setSourceField"><value>giftcert_amount</value></action>
274
+ <action method="setLabel"><value>Gift Certificate</value></action>
275
+ </block>
276
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
277
+ <action method="setSourceField"><value>adjustment_positive</value></action>
278
+ <action method="setLabel"><value>Adjustment Refund</value></action>
279
+ </block>
280
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
281
+ <action method="setSourceField"><value>adjustment_negative</value></action>
282
+ <action method="setLabel"><value>Adjustment Fee</value></action>
283
+ </block>
284
+ </block>-->
285
+ </block>
286
+ </block>
287
+ </block>
288
+ </reference>
289
+ </adminhtml_sales_order_invoice_view>
290
+
291
+ <adminhtml_sales_order_shipment_new>
292
+ <reference name="head">
293
+ <action method="addJs"><file>mage/adminhtml/sales/packaging.js</file></action>
294
+ </reference>
295
+ <reference name="content">
296
+ <block type="adminhtml/sales_order_shipment_create" name="sales_shipment_create">
297
+ <block type="adminhtml/sales_order_shipment_create_form" name="form" template="sales/order/shipment/create/form.phtml">
298
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
299
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
300
+ <block type="adminhtml/sales_order_shipment_create_tracking" name="shipment_tracking" template="sales/order/shipment/create/tracking.phtml"></block>
301
+ <block type="adminhtml/sales_order_shipment_create_items" name="order_items" template="sales/order/shipment/create/items.phtml">
302
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/shipment/create/items/renderer/default.phtml</template></action>
303
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
304
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
305
+ <block type="core/text_list" name="order_item_extra_info"></block>
306
+ </block>
307
+ <block type="adminhtml/sales_order_shipment_packaging" name="shipment_packaging" template="sales/order/shipment/packaging/popup.phtml" />
308
+ </block>
309
+ </block>
310
+ </reference>
311
+ </adminhtml_sales_order_shipment_new>
312
+
313
+ <adminhtml_sales_order_shipment_addtrack>
314
+ <block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" template="sales/order/shipment/view/tracking.phtml"></block>
315
+ </adminhtml_sales_order_shipment_addtrack>
316
+
317
+ <adminhtml_sales_order_shipment_removetrack>
318
+ <block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" template="sales/order/shipment/view/tracking.phtml"></block>
319
+ </adminhtml_sales_order_shipment_removetrack>
320
+
321
+ <adminhtml_sales_order_shipment_addcomment>
322
+ <block type="adminhtml/sales_order_shipment_view_comments" name="shipment_comments">
323
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml"></block>
324
+ </block>
325
+ </adminhtml_sales_order_shipment_addcomment>
326
+
327
+ <adminhtml_sales_order_shipment_view>
328
+ <reference name="head">
329
+ <action method="addJs"><file>mage/adminhtml/sales/packaging.js</file></action>
330
+ </reference>
331
+ <reference name="content">
332
+ <block type="adminhtml/sales_order_shipment_view" name="sales_shipment_view">
333
+ <block type="adminhtml/sales_order_shipment_view_form" name="form" template="sales/order/shipment/view/form.phtml">
334
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
335
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
336
+ <block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" template="sales/order/shipment/view/tracking.phtml"></block>
337
+ <block type="adminhtml/sales_order_shipment_view_items" name="shipment_items" template="sales/order/shipment/view/items.phtml">
338
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/shipment/view/items/renderer/default.phtml</template></action>
339
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
340
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
341
+ <block type="core/text_list" name="order_item_extra_info"></block>
342
+ </block>
343
+ <block type="adminhtml/sales_order_invoice_create_tracking" name="invoice_tracking" template="sales/order/shipment/create/tracking.phtml"></block>
344
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml">
345
+ <action method="setParentType"><type>shipment</type></action>
346
+ </block>
347
+ <block type="adminhtml/sales_order_shipment_packaging" name="shipment_packaging" template="sales/order/shipment/packaging/popup.phtml" />
348
+ <block type="adminhtml/sales_order_shipment_packaging" name="shipment_packed" template="sales/order/shipment/packaging/packed.phtml"/>
349
+ </block>
350
+ </block>
351
+ </reference>
352
+ </adminhtml_sales_order_shipment_view>
353
+
354
+ <adminhtml_sales_order_creditmemo_new>
355
+ <reference name="content">
356
+ <block type="adminhtml/sales_order_creditmemo_create" name="sales_creditmemo_create">
357
+ <block type="adminhtml/sales_order_creditmemo_create_form" name="form" template="sales/order/creditmemo/create/form.phtml">
358
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
359
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
360
+ <block type="adminhtml/sales_order_creditmemo_create_items" name="order_items" template="sales/order/creditmemo/create/items.phtml">
361
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/creditmemo/create/items/renderer/default.phtml</template></action>
362
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
363
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
364
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
365
+ <block type="core/text_list" name="order_item_extra_info"></block>
366
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
367
+
368
+ <block type="adminhtml/sales_order_creditmemo_totals" name="creditmemo_totals" template="sales/order/totals.phtml">
369
+ <block type="adminhtml/sales_order_creditmemo_create_adjustments" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
370
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
371
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
372
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml">
373
+ <action method="setGrandTotalTitle"><title>Total Refund</title></action>
374
+ </block>
375
+ </block>
376
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
377
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
378
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
379
+ <action method="setSourceField"><value>tax_amount</value></action>
380
+ <action method="setLabel"><value>Tax</value></action>
381
+ </block>
382
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/item.phtml">
383
+ <action method="setSourceField"><value>discount_amount</value></action>
384
+ <action method="setLabel"><value>Discount</value></action>
385
+ </block>
386
+ <block type="adminhtml/sales_order_totals_item" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
387
+ </block>-->
388
+ </block>
389
+ <block type="core/text_list" name="submit_before" />
390
+ <block type="core/text_list" name="submit_after" />
391
+ </block>
392
+ </block>
393
+ </block>
394
+ </reference>
395
+ </adminhtml_sales_order_creditmemo_new>
396
+
397
+ <adminhtml_sales_order_creditmemo_updateqty>
398
+ <block type="adminhtml/sales_order_creditmemo_create_items" name="order_items" template="sales/order/creditmemo/create/items.phtml">
399
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/creditmemo/create/items/renderer/default.phtml</template></action>
400
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
401
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
402
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
403
+ <block type="core/text_list" name="order_item_extra_info"></block>
404
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
405
+
406
+ <block type="adminhtml/sales_order_creditmemo_totals" name="creditmemo_totals" template="sales/order/totals.phtml">
407
+ <block type="adminhtml/sales_order_creditmemo_create_adjustments" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
408
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
409
+ <!--<block type="adminhtml/sales_order_totals" name="order_totals" template="sales/order/totals.phtml">
410
+ <block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
411
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml">
412
+ <action method="setGrandTotalTitle"><title>Total Refund</title></action>
413
+ </block>
414
+ </block>
415
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
416
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
417
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
418
+ <action method="setSourceField"><value>tax_amount</value></action>
419
+ <action method="setLabel"><value>Tax</value></action>
420
+ </block>
421
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/item.phtml">
422
+ <action method="setSourceField"><value>discount_amount</value></action>
423
+ <action method="setLabel"><value>Discount</value></action>
424
+ </block>
425
+ <block type="adminhtml/sales_order_totals_item" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
426
+ </block>-->
427
+ </block>
428
+
429
+ <block type="core/text_list" name="submit_before" />
430
+ <block type="core/text_list" name="submit_after" />
431
+ </block>
432
+ </adminhtml_sales_order_creditmemo_updateqty>
433
+
434
+ <adminhtml_sales_order_creditmemo_addcomment>
435
+ <block type="adminhtml/sales_order_creditmemo_view_comments" name="creditmemo_comments">
436
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml"></block>
437
+ </block>
438
+ </adminhtml_sales_order_creditmemo_addcomment>
439
+
440
+ <adminhtml_sales_order_creditmemo_view>
441
+ <reference name="content">
442
+ <block type="adminhtml/sales_order_creditmemo_view" name="sales_creditmemo_view">
443
+ <block type="adminhtml/sales_order_creditmemo_view_form" name="form" template="sales/order/creditmemo/view/form.phtml">
444
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
445
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
446
+ <block type="adminhtml/sales_order_creditmemo_view_items" name="creditmemo_items" template="sales/order/creditmemo/view/items.phtml">
447
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/creditmemo/view/items/renderer/default.phtml</template></action>
448
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
449
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
450
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
451
+ <block type="core/text_list" name="order_item_extra_info"></block>
452
+ </block>
453
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml">
454
+ <action method="setParentType"><type>creditmemo</type></action>
455
+ </block>
456
+
457
+ <block type="adminhtml/sales_order_creditmemo_totals" name="creditmemo_totals" template="sales/order/totals.phtml">
458
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
459
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
460
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
461
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
462
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
463
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
464
+ </block>
465
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
466
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
467
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
468
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
469
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
470
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
471
+ <action method="setSourceField"><value>giftcert_amount</value></action>
472
+ <action method="setLabel"><value>Gift Certificate</value></action>
473
+ </block>
474
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
475
+ <action method="setSourceField"><value>adjustment_positive</value></action>
476
+ <action method="setLabel"><value>Adjustment Refund</value></action>
477
+ </block>
478
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
479
+ <action method="setSourceField"><value>adjustment_negative</value></action>
480
+ <action method="setLabel"><value>Adjustment Fee</value></action>
481
+ </block>
482
+ </block>-->
483
+ </block>
484
+ </block>
485
+ </block>
486
+ </reference>
487
+ </adminhtml_sales_order_creditmemo_view>
488
+
489
+ <adminhtml_sales_transactions_index>
490
+ <reference name="content">
491
+ <block type="adminhtml/sales_transactions" name="sales_transactions.grid.container"></block>
492
+ </reference>
493
+ </adminhtml_sales_transactions_index>
494
+ <adminhtml_sales_transactions_grid>
495
+ <block type="adminhtml/sales_transactions_grid" name="sales_transactions.grid" output="toHtml"></block>
496
+ </adminhtml_sales_transactions_grid>
497
+ <adminhtml_sales_transactions_view>
498
+ <reference name="content">
499
+ <block type="adminhtml/sales_transactions_detail" name="sales_transactions.detail" template="sales/transactions/detail.phtml">
500
+ <block type="adminhtml/sales_transactions_detail_grid" name="sales_transactions.detail.grid" as="detail_grid"/>
501
+ <block type="adminhtml/sales_transactions_child_grid" name="sales_transactions.child.grid" as="child_grid"/>
502
+ </block>
503
+ </reference>
504
+ </adminhtml_sales_transactions_view>
505
+
506
+ <adminhtml_sales_order_create_index>
507
+ <reference name="left">
508
+ <action method="setIsCollapsed"><value>true</value></action>
509
+ </reference>
510
+ <reference name="head">
511
+ <action method="addJs"><file>mage/adminhtml/sales.js</file></action>
512
+ <action method="addJs"><file>mage/adminhtml/giftmessage.js</file></action>
513
+ <action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
514
+ <action method="addJs"><file>varien/configurable.js</file></action>
515
+ <action method="addJs"><file>mage/adminhtml/giftoptions/tooltip.js</file></action>
516
+ <block type="adminhtml/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
517
+ </reference>
518
+ <reference name="js">
519
+ <block type="adminhtml/template" template="sales/order/create/js.phtml" name="create" />
520
+ </reference>
521
+ <reference name="root">
522
+ <block type="adminhtml/sales_order_create" name="content">
523
+ <block type="adminhtml/sales_order_create_form" template="sales/order/create/form.phtml" name="form">
524
+ <block type="adminhtml/sales_order_create_messages" name="message" />
525
+ <block type="adminhtml/sales_order_create_customer" template="sales/order/create/abstract.phtml" name="customer">
526
+ <block type="adminhtml/sales_order_create_customer_grid" name="grid" />
527
+ </block>
528
+ <block type="adminhtml/sales_order_create_store" template="sales/order/create/abstract.phtml" name="store">
529
+ <block type="adminhtml/sales_order_create_store_select" template="sales/order/create/store/select.phtml" name="select" />
530
+ </block>
531
+ <block type="adminhtml/sales_order_create_data" template="sales/order/create/data.phtml" name="data">
532
+ <block type="adminhtml/sales_order_create_sidebar" template="sales/order/create/sidebar.phtml" name="sidebar">
533
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="cart" />
534
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="wishlist" />
535
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="reorder" />
536
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="viewed" />
537
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="compared" />
538
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="pcompared" />
539
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="pviewed" />
540
+ </block>
541
+ <block type="adminhtml/sales_order_create_form_account" template="sales/order/create/form/account.phtml" name="form_account" />
542
+ <block type="adminhtml/sales_order_create_shipping_address" template="sales/order/create/form/address.phtml" name="shipping_address" />
543
+ <block type="adminhtml/sales_order_create_billing_address" template="sales/order/create/form/address.phtml" name="billing_address" />
544
+ <block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
545
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="sales/order/create/shipping/method/form.phtml" name="form" />
546
+ </block>
547
+ <block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
548
+ <block type="adminhtml/sales_order_create_billing_method_form" template="sales/order/create/billing/method/form.phtml" name="form" />
549
+ </block>
550
+ <block type="adminhtml/sales_order_create_newsletter" template="sales/order/create/abstract.phtml" name="newsletter">
551
+ <block type="adminhtml/sales_order_create_newsletter_form" template="sales/order/create/newsletter/form.phtml" name="form" />
552
+ </block>
553
+ <block type="adminhtml/sales_order_create_search" template="sales/order/create/abstract.phtml" name="search">
554
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
555
+ </block>
556
+ <block type="adminhtml/sales_order_create_items" template="sales/order/create/items.phtml" name="items">
557
+ <block type="adminhtml/sales_order_create_items_grid" template="sales/order/create/items/grid.phtml" name="items_grid">
558
+ <block type="adminhtml/sales_order_create_coupons" template="sales/order/create/coupons/form.phtml" name="coupons">
559
+ <block type="adminhtml/sales_order_create_coupons_form" template="sales/order/create/coupons/form.phtml" name="form" />
560
+ </block>
561
+ </block>
562
+ </block>
563
+ <block type="adminhtml/sales_order_create_comment" template="sales/order/create/comment.phtml" name="comment" />
564
+ <block type="adminhtml/sales_order_create_totals" template="sales/order/create/totals.phtml" name="totals" />
565
+ <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
566
+ <block type="adminhtml/sales_order_create_giftmessage" template="sales/order/create/giftmessage.phtml" name="giftmessage" />
567
+ </block>
568
+ <block type="core/text_list" name="order_item_extra_info"></block>
569
+ </block>
570
+ </block>
571
+ </block>
572
+ </reference>
573
+ </adminhtml_sales_order_create_index>
574
+
575
+ <adminhtml_sales_order_edit_index>
576
+ <update handle="adminhtml_sales_order_create_index" />
577
+ </adminhtml_sales_order_edit_index>
578
+
579
+ <adminhtml_sales_order_create_load_block_json>
580
+ <reference name="root">
581
+ <block type="adminhtml/sales_order_create_load" name="content" />
582
+ </reference>
583
+ </adminhtml_sales_order_create_load_block_json>
584
+
585
+ <adminhtml_sales_order_create_load_block_plain>
586
+ <reference name="root">
587
+ <block type="core/text_list" name="content" />
588
+ </reference>
589
+ </adminhtml_sales_order_create_load_block_plain>
590
+
591
+ <adminhtml_sales_order_create_load_block_data>
592
+ <reference name="content">
593
+ <block type="adminhtml/sales_order_create_data" template="sales/order/create/data.phtml" name="data">
594
+ <block type="adminhtml/sales_order_create_sidebar" template="sales/order/create/sidebar.phtml" name="sidebar">
595
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="cart" />
596
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="wishlist" />
597
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="reorder" />
598
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="viewed" />
599
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="compared" />
600
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="pcompared" />
601
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="pviewed" />
602
+ </block>
603
+ <block type="adminhtml/sales_order_create_form_account" template="sales/order/create/form/account.phtml" name="form_account" />
604
+ <block type="adminhtml/sales_order_create_shipping_address" template="sales/order/create/form/address.phtml" name="shipping_address" />
605
+ <block type="adminhtml/sales_order_create_billing_address" template="sales/order/create/form/address.phtml" name="billing_address" />
606
+ <block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
607
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="sales/order/create/shipping/method/form.phtml" name="form" />
608
+ </block>
609
+ <block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
610
+ <block type="adminhtml/sales_order_create_billing_method_form" template="sales/order/create/billing/method/form.phtml" name="form" />
611
+ </block>
612
+ <block type="adminhtml/sales_order_create_newsletter" template="sales/order/create/abstract.phtml" name="newsletter">
613
+ <block type="adminhtml/sales_order_create_newsletter_form" template="sales/order/create/newsletter/form.phtml" name="form" />
614
+ </block>
615
+ <block type="adminhtml/sales_order_create_search" template="sales/order/create/abstract.phtml" name="search">
616
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
617
+ </block>
618
+ <block type="adminhtml/sales_order_create_items" template="sales/order/create/items.phtml" name="items">
619
+ <block type="adminhtml/sales_order_create_items_grid" template="sales/order/create/items/grid.phtml" name="items_grid">
620
+ <block type="adminhtml/sales_order_create_coupons" template="sales/order/create/coupons/form.phtml" name="coupons">
621
+ <block type="adminhtml/sales_order_create_coupons_form" template="sales/order/create/coupons/form.phtml" name="form" />
622
+ </block>
623
+ </block>
624
+ </block>
625
+ <block type="adminhtml/sales_order_create_comment" template="sales/order/create/comment.phtml" name="comment" />
626
+ <block type="adminhtml/sales_order_create_totals" template="sales/order/create/totals.phtml" name="totals" />
627
+ <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
628
+ <block type="adminhtml/sales_order_create_giftmessage" template="sales/order/create/giftmessage.phtml" name="giftmessage" />
629
+ </block>
630
+ <block type="core/text_list" name="order_item_extra_info"></block>
631
+ </block>
632
+ </reference>
633
+ </adminhtml_sales_order_create_load_block_data>
634
+
635
+ <adminhtml_sales_order_create_load_block_header>
636
+ <reference name="content">
637
+ <block type="adminhtml/sales_order_create_header" name="header" />
638
+ </reference>
639
+ </adminhtml_sales_order_create_load_block_header>
640
+
641
+
642
+ <adminhtml_sales_order_create_load_block_sidebar>
643
+ <reference name="content">
644
+ <block type="adminhtml/sales_order_create_sidebar" template="sales/order/create/sidebar.phtml" name="sidebar">
645
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="cart" />
646
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="wishlist" />
647
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="reorder" />
648
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="viewed" />
649
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="compared" />
650
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="pcompared" />
651
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="pviewed" />
652
+ </block>
653
+ </reference>
654
+ </adminhtml_sales_order_create_load_block_sidebar>
655
+
656
+ <adminhtml_sales_order_create_load_block_form_account>
657
+ <reference name="content">
658
+ <block type="adminhtml/sales_order_create_form_account" template="sales/order/create/form/account.phtml" name="form_account" />
659
+ </reference>
660
+ </adminhtml_sales_order_create_load_block_form_account>
661
+
662
+ <adminhtml_sales_order_create_load_block_shipping_address>
663
+ <reference name="content">
664
+ <block type="adminhtml/sales_order_create_shipping_address" template="sales/order/create/form/address.phtml" name="shipping_address" />
665
+ </reference>
666
+ </adminhtml_sales_order_create_load_block_shipping_address>
667
+
668
+ <adminhtml_sales_order_create_load_block_billing_address>
669
+ <reference name="content">
670
+ <block type="adminhtml/sales_order_create_billing_address" template="sales/order/create/form/address.phtml" name="billing_address" />
671
+ </reference>
672
+ </adminhtml_sales_order_create_load_block_billing_address>
673
+
674
+ <adminhtml_sales_order_create_load_block_shipping_method>
675
+ <reference name="content">
676
+ <block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
677
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="sales/order/create/shipping/method/form.phtml" name="form" />
678
+ </block>
679
+ </reference>
680
+ </adminhtml_sales_order_create_load_block_shipping_method>
681
+
682
+ <adminhtml_sales_order_create_load_block_billing_method>
683
+ <reference name="content">
684
+ <block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
685
+ <block type="adminhtml/sales_order_create_billing_method_form" template="sales/order/create/billing/method/form.phtml" name="form" />
686
+ </block>
687
+ </reference>
688
+ </adminhtml_sales_order_create_load_block_billing_method>
689
+
690
+ <adminhtml_sales_order_create_load_block_newsletter>
691
+ <reference name="content">
692
+ <block type="adminhtml/sales_order_create_newsletter" template="sales/order/create/abstract.phtml" name="newsletter">
693
+ <block type="adminhtml/sales_order_create_newsletter_form" template="sales/order/create/newsletter/form.phtml" name="form" />
694
+ </block>
695
+ </reference>
696
+ </adminhtml_sales_order_create_load_block_newsletter>
697
+
698
+ <adminhtml_sales_order_create_load_block_search>
699
+ <reference name="content">
700
+ <block type="adminhtml/sales_order_create_search" template="sales/order/create/abstract.phtml" name="search">
701
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
702
+ </block>
703
+ </reference>
704
+ </adminhtml_sales_order_create_load_block_search>
705
+
706
+ <adminhtml_sales_order_create_load_block_search_grid>
707
+ <reference name="content">
708
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
709
+ </reference>
710
+ </adminhtml_sales_order_create_load_block_search_grid>
711
+
712
+ <adminhtml_sales_order_create_load_block_items>
713
+ <reference name="content">
714
+ <block type="adminhtml/sales_order_create_items" template="sales/order/create/items.phtml" name="items">
715
+ <block type="adminhtml/sales_order_create_items_grid" template="sales/order/create/items/grid.phtml" name="items_grid">
716
+ <block type="adminhtml/sales_order_create_coupons" template="sales/order/create/coupons/form.phtml" name="coupons">
717
+ <block type="adminhtml/sales_order_create_coupons_form" template="sales/order/create/coupons/form.phtml" name="form" />
718
+ </block>
719
+ </block>
720
+ </block>
721
+ <block type="core/text_list" name="order_item_extra_info"></block>
722
+ </reference>
723
+ </adminhtml_sales_order_create_load_block_items>
724
+
725
+ <adminhtml_sales_order_create_load_block_comment>
726
+ <reference name="content">
727
+ <block type="adminhtml/sales_order_create_comment" template="sales/order/create/comment.phtml" name="comment" />
728
+ </reference>
729
+ </adminhtml_sales_order_create_load_block_comment>
730
+
731
+ <adminhtml_sales_order_create_load_block_totals>
732
+ <reference name="content">
733
+ <block type="adminhtml/sales_order_create_totals" template="sales/order/create/totals.phtml" name="totals" />
734
+ </reference>
735
+ </adminhtml_sales_order_create_load_block_totals>
736
+
737
+ <adminhtml_sales_order_create_load_block_giftmessage>
738
+ <reference name="content">
739
+ <block type="adminhtml/sales_order_create_giftmessage" template="sales/order/create/giftmessage.phtml" name="giftmessage" />
740
+ </reference>
741
+ </adminhtml_sales_order_create_load_block_giftmessage>
742
+
743
+ <adminhtml_sales_order_create_load_block_message>
744
+ <reference name="content">
745
+ <block type="adminhtml/sales_order_create_messages" name="message" />
746
+ </reference>
747
+ </adminhtml_sales_order_create_load_block_message>
748
+
749
+ <adminhtml_sales_order_create_load_block_customer_grid>
750
+ <reference name="content">
751
+ <block type="adminhtml/sales_order_create_customer_grid" name="grid" />
752
+ </reference>
753
+ </adminhtml_sales_order_create_load_block_customer_grid>
754
+
755
+ <adminhtml_sales_order_create_load_block_sidebar_cart>
756
+ <reference name="content">
757
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="sidebar_cart" />
758
+ </reference>
759
+ </adminhtml_sales_order_create_load_block_sidebar_cart>
760
+
761
+ <adminhtml_sales_order_create_load_block_sidebar_wishlist>
762
+ <reference name="content">
763
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="sidebar_wishlist" />
764
+ </reference>
765
+ </adminhtml_sales_order_create_load_block_sidebar_wishlist>
766
+
767
+ <adminhtml_sales_order_create_load_block_sidebar_reorder>
768
+ <reference name="content">
769
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="sidebar_reorder" />
770
+ </reference>
771
+ </adminhtml_sales_order_create_load_block_sidebar_reorder>
772
+
773
+ <adminhtml_sales_order_create_load_block_sidebar_viewed>
774
+ <reference name="content">
775
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="sidebar_viewed" />
776
+ </reference>
777
+ </adminhtml_sales_order_create_load_block_sidebar_viewed>
778
+
779
+ <adminhtml_sales_order_create_load_block_sidebar_compared>
780
+ <reference name="content">
781
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="sidebar_compared" />
782
+ </reference>
783
+ </adminhtml_sales_order_create_load_block_sidebar_compared>
784
+
785
+ <adminhtml_sales_order_create_load_block_sidebar_pviewed>
786
+ <reference name="content">
787
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="sidebar_pviewed" />
788
+ </reference>
789
+ </adminhtml_sales_order_create_load_block_sidebar_pviewed>
790
+
791
+ <adminhtml_sales_order_create_load_block_sidebar_pcompared>
792
+ <reference name="content">
793
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="sidebar_pcompared" />
794
+ </reference>
795
+ </adminhtml_sales_order_create_load_block_sidebar_pcompared>
796
+
797
+ <report_sales>
798
+ <reference name="messages">
799
+ <action method="addNotice" translate="message">
800
+ <message>This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed.</message>
801
+ </action>
802
+ </reference>
803
+ </report_sales>
804
+
805
+ <adminhtml_report_sales_sales>
806
+ <update handle="report_sales"/>
807
+ <reference name="content">
808
+ <block type="adminhtml/report_sales_sales" template="report/grid/container.phtml" name="sales.report.grid.container">
809
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
810
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
811
+ </block>
812
+ <block type="sales/adminhtml_report_filter_form_order" name="grid.filter.form">
813
+ <action method="addReportTypeOption" translate="value">
814
+ <key>created_at_order</key>
815
+ <value>Order Created Date</value>
816
+ </action>
817
+ <action method="addReportTypeOption" translate="value">
818
+ <key>updated_at_order</key>
819
+ <value>Order Updated Date</value>
820
+ </action>
821
+ <action method="setFieldOption" translate="value">
822
+ <field>report_type</field>
823
+ <option>note</option>
824
+ <value>Order Updated Date report is real-time, does not need statistics refreshing.</value>
825
+ </action>
826
+ </block>
827
+ </block>
828
+ </reference>
829
+ </adminhtml_report_sales_sales>
830
+
831
+ <adminhtml_report_sales_tax>
832
+ <update handle="report_sales"/>
833
+ <reference name="content">
834
+ <block type="adminhtml/report_sales_tax" template="report/grid/container.phtml" name="sales.report.grid.container">
835
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
836
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
837
+ </block>
838
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
839
+ <action method="addReportTypeOption" translate="value">
840
+ <key>created_at_order</key>
841
+ <value>Order Created Date</value>
842
+ </action>
843
+ <action method="addReportTypeOption" translate="value">
844
+ <key>updated_at_order</key>
845
+ <value>Order Updated Date</value>
846
+ </action>
847
+ <action method="setFieldOption" translate="value">
848
+ <field>report_type</field>
849
+ <option>note</option>
850
+ <value>Order Updated Date report is real-time, does not need statistics refreshing.</value>
851
+ </action>
852
+ </block>
853
+ </block>
854
+ </reference>
855
+ </adminhtml_report_sales_tax>
856
+
857
+ <adminhtml_report_sales_shipping>
858
+ <update handle="report_sales"/>
859
+ <reference name="content">
860
+ <block type="adminhtml/report_sales_shipping" template="report/grid/container.phtml" name="sales.report.grid.container">
861
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
862
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
863
+ </block>
864
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
865
+ <action method="addReportTypeOption" translate="value">
866
+ <key>created_at_order</key>
867
+ <value>Order Created Date</value>
868
+ </action>
869
+ <action method="addReportTypeOption" translate="value">
870
+ <key>created_at_shipment</key>
871
+ <value>First Invoice Created Date</value>
872
+ </action>
873
+ </block>
874
+ </block>
875
+ </reference>
876
+ </adminhtml_report_sales_shipping>
877
+
878
+ <adminhtml_report_sales_invoiced>
879
+ <update handle="report_sales"/>
880
+ <reference name="content">
881
+ <block type="adminhtml/report_sales_invoiced" template="report/grid/container.phtml" name="sales.report.grid.container">
882
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
883
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
884
+ </block>
885
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
886
+ <action method="addReportTypeOption" translate="value">
887
+ <key>created_at_order</key>
888
+ <value>Order Created Date</value>
889
+ </action>
890
+ <action method="addReportTypeOption" translate="value">
891
+ <key>created_at_invoice</key>
892
+ <value>Last Invoice Created Date</value>
893
+ </action>
894
+ </block>
895
+ </block>
896
+ </reference>
897
+ </adminhtml_report_sales_invoiced>
898
+
899
+ <adminhtml_report_sales_refunded>
900
+ <update handle="report_sales"/>
901
+ <reference name="content">
902
+ <block type="adminhtml/report_sales_refunded" template="report/grid/container.phtml" name="sales.report.grid.container">
903
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
904
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
905
+ </block>
906
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
907
+ <action method="addReportTypeOption" translate="value">
908
+ <key>created_at_order</key>
909
+ <value>Order Created Date</value>
910
+ </action>
911
+ <action method="addReportTypeOption" translate="value">
912
+ <key>created_at_refunded</key>
913
+ <value>Last Credit Memo Created Date</value>
914
+ </action>
915
+ </block>
916
+ </block>
917
+ </reference>
918
+ </adminhtml_report_sales_refunded>
919
+
920
+ <adminhtml_report_sales_coupons>
921
+ <update handle="report_sales"/>
922
+ <reference name="content">
923
+ <block type="adminhtml/report_sales_coupons" template="report/grid/container.phtml" name="sales.report.grid.container">
924
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
925
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
926
+ </block>
927
+ <block type="sales/adminhtml_report_filter_form_coupon" name="grid.filter.form">
928
+ <action method="addReportTypeOption" translate="value">
929
+ <key>created_at_order</key>
930
+ <value>Order Created Date</value>
931
+ </action>
932
+ <action method="addReportTypeOption" translate="value">
933
+ <key>updated_at_order</key>
934
+ <value>Order Updated Date</value>
935
+ </action>
936
+ <action method="setFieldOption" translate="value">
937
+ <field>report_type</field>
938
+ <option>note</option>
939
+ <value>Order Updated Date report is real-time, does not need statistics refreshing.</value>
940
+ </action>
941
+ </block>
942
+ </block>
943
+ </reference>
944
+ </adminhtml_report_sales_coupons>
945
+
946
+ <adminhtml_report_sales_bestsellers>
947
+ <update handle="report_sales"/>
948
+ <reference name="content">
949
+ <block type="adminhtml/report_sales_bestsellers" template="report/grid/container.phtml" name="sales.report.grid.container">
950
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
951
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
952
+ </block>
953
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
954
+ <action method="setFieldVisibility">
955
+ <field>report_type</field>
956
+ <visibility>0</visibility>
957
+ </action>
958
+ <action method="setFieldVisibility">
959
+ <field>show_order_statuses</field>
960
+ <visibility>0</visibility>
961
+ </action>
962
+ <action method="setFieldVisibility">
963
+ <field>order_statuses</field>
964
+ <visibility>0</visibility>
965
+ </action>
966
+ </block>
967
+ </block>
968
+ </reference>
969
+ </adminhtml_report_sales_bestsellers>
970
+
971
+ <adminhtml_sales_recurring_profile_index>
972
+ <reference name="content">
973
+ <block type="sales/adminhtml_recurring_profile" name="sales.recurring.profile.grid.container"/>
974
+ </reference>
975
+ </adminhtml_sales_recurring_profile_index>
976
+
977
+ <adminhtml_sales_recurring_profile_grid>
978
+ <remove name="root"/>
979
+ <block type="sales/adminhtml_recurring_profile_grid" name="sales.recurring.profile.grid" output="toHtml"/>
980
+ </adminhtml_sales_recurring_profile_grid>
981
+
982
+ <adminhtml_sales_recurring_profile_customergrid>
983
+ <block type="sales/adminhtml_customer_edit_tab_recurring_profile" name="customer.recurring.profile.grid" output="toHtml"></block>
984
+ </adminhtml_sales_recurring_profile_customergrid>
985
+
986
+ <adminhtml_sales_recurring_profile_view>
987
+ <reference name="content">
988
+ <block type="sales/adminhtml_recurring_profile_view" name="sales.recurring.profile.view" template="widget/view/container.phtml">
989
+ <action method="setDestElementId"><value>sales_recurring_profile_view</value></action>
990
+ </block>
991
+ </reference>
992
+ <reference name="left">
993
+ <block type="adminhtml/widget_tabs" name="sales.recurring.profile.view.tabs">
994
+ <action method="setDestElementId"><value>sales_recurring_profile_view</value></action>
995
+ <action method="setTitle" translate="value"><value>Recurring Profile View</value></action>
996
+ <action method="setId"><value>sales_recurring_profile_view_tabs</value></action>
997
+ <block type="sales/adminhtml_recurring_profile_view_tab_info" as="info_tab" name="sales.recurring.profile.tab.info" template="sales/recurring/profile/view.phtml">
998
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.general" as="general" template="sales/recurring/profile/view/info.phtml">
999
+ <action method="prepareReferenceInfo"/>
1000
+ <action method="addToParentGroup"><value>info_blocks_row_1</value></action>
1001
+ <action method="setViewColumn"><value>1</value></action>
1002
+ <action method="setViewLabel" translate="value"><value>Reference</value></action>
1003
+ </block>
1004
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.item" as="item" template="sales/recurring/profile/view/info.phtml">
1005
+ <action method="prepareItemInfo"/>
1006
+ <action method="addToParentGroup"><value>info_blocks_row_1</value></action>
1007
+ <action method="setViewColumn"><value>2</value></action>
1008
+ <action method="setViewLabel" translate="value"><value>Purchased Item</value></action>
1009
+ </block>
1010
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.schedule" as="profile" template="sales/recurring/profile/view/info.phtml">
1011
+ <action method="prepareScheduleInfo"/>
1012
+ <action method="addToParentGroup"><value>info_blocks_row_2</value></action>
1013
+ <action method="setViewColumn"><value>1</value></action>
1014
+ <action method="setViewLabel" translate="value"><value>Profile Schedule</value></action>
1015
+ </block>
1016
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.fees" as="fees" template="sales/recurring/profile/view/info.phtml">
1017
+ <action method="prepareFeesInfo"/>
1018
+ <action method="addToParentGroup"><value>info_blocks_row_2</value></action>
1019
+ <action method="setViewColumn"><value>2</value></action>
1020
+ <action method="setViewLabel" translate="value"><value>Profile Payments</value></action>
1021
+ </block>
1022
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.billing" as="billing_address" template="sales/recurring/profile/view/info.phtml">
1023
+ <action method="prepareAddressInfo"/>
1024
+ <action method="addToParentGroup"><value>info_blocks_row_3</value></action>
1025
+ <action method="setViewColumn"><value>1</value></action>
1026
+ <action method="setViewLabel" translate="value"><value>Billing Address</value></action>
1027
+ </block>
1028
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.shipping" as="shipping_address" template="sales/recurring/profile/view/info.phtml">
1029
+ <action method="setAddressType"><value>shipping</value></action>
1030
+ <action method="prepareAddressInfo"/>
1031
+ <action method="addToParentGroup"><value>info_blocks_row_3</value></action>
1032
+ <action method="setViewColumn"><value>2</value></action>
1033
+ <action method="setViewLabel" translate="value"><value>Shipping Address</value></action>
1034
+ </block>
1035
+ </block>
1036
+ <block type="sales/adminhtml_recurring_profile_view_tab_orders" as="orders_tab" name="sales.recurring.profile.tab.orders"/>
1037
+ <action method="addTab"><name>recurring_profile_info</name><block>info_tab</block></action>
1038
+ <action method="addTab"><name>recurring_profile_orders</name><block>orders_tab</block></action>
1039
+ </block>
1040
+ </reference>
1041
+ </adminhtml_sales_recurring_profile_view>
1042
+
1043
+ <adminhtml_sales_recurring_profile_orders>
1044
+ <remove name="root"/>
1045
+ <block type="sales/adminhtml_recurring_profile_view_tab_orders" name="sales.recurring.profile.tab.orders" output="toHtml"/>
1046
+ </adminhtml_sales_recurring_profile_orders>
1047
+
1048
+ <adminhtml_customer_edit>
1049
+ <reference name="customer_edit_tabs">
1050
+ <action method="addTab"><name>customer_edit_tab_agreements</name><block>sales/adminhtml_customer_edit_tab_agreement</block></action>
1051
+ <action method="addTab"><name>customer_edit_tab_recurring_profile</name><block>sales/adminhtml_customer_edit_tab_recurring_profile</block></action>
1052
+ </reference>
1053
+ </adminhtml_customer_edit>
1054
+
1055
+ <adminhtml_sales_order_status_index>
1056
+ <reference name="content">
1057
+ <block type="adminhtml/sales_order_status" name="sales_order_status.grid.container"></block>
1058
+ </reference>
1059
+ </adminhtml_sales_order_status_index>
1060
+ <adminhtml_sales_order_status_new>
1061
+ <reference name="content">
1062
+ <block type="adminhtml/sales_order_status_new" name="sales_order_status.new.container"></block>
1063
+ </reference>
1064
+ </adminhtml_sales_order_status_new>
1065
+ <adminhtml_sales_order_status_edit>
1066
+ <reference name="content">
1067
+ <block type="adminhtml/sales_order_status_edit" name="sales_order_status.edit.container"></block>
1068
+ </reference>
1069
+ </adminhtml_sales_order_status_edit>
1070
+ <adminhtml_sales_order_status_assign>
1071
+ <reference name="content">
1072
+ <block type="adminhtml/sales_order_status_assign" name="sales_order_status.assign.container"></block>
1073
+ </reference>
1074
+ </adminhtml_sales_order_status_assign>
1075
+ <adminhtml_sales_order_address>
1076
+ <reference name="content">
1077
+ <block type="adminhtml/sales_order_address" name="sales_order_address.form.container"></block>
1078
+ </reference>
1079
+ </adminhtml_sales_order_address>
1080
+ </layout>
app/design/adminhtml/default/default/layout/search.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_catalog_search_edit>
31
+ <reference name="content">
32
+ <block type="adminhtml/catalog_search_edit" name="catalog_search_edit" />
33
+ </reference>
34
+ </adminhtml_catalog_search_edit>
35
+ </layout>
app/design/adminhtml/default/default/layout/tag.xml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <adminhtml_tag_edit>
30
+ <reference name="content">
31
+ <block type="adminhtml/tag_edit" name="tag_edit" template="tag/edit/container.phtml"></block>
32
+ </reference>
33
+ </adminhtml_tag_edit>
34
+ <adminhtml_tag_assigned>
35
+ <remove name="root" />
36
+ <block type="adminhtml/tag_assigned_grid" name="tag_assigned_grid" output="toHtml" />
37
+ <block type="adminhtml/widget_grid_serializer" name="tag_grid_serializer" output="toHtml">
38
+ <reference name="tag_grid_serializer">
39
+ <action method="initSerializerBlock">
40
+ <grid_block_name>tag_assigned_grid</grid_block_name>
41
+ <data_callback>getRelatedProducts</data_callback>
42
+ <hidden_input_name>tag_assigned_products</hidden_input_name>
43
+ <reload_param_name>assigned_products</reload_param_name>
44
+ </action>
45
+ </reference>
46
+ </block>
47
+ </adminhtml_tag_assigned>
48
+ <adminhtml_tag_assignedgridonly>
49
+ <remove name="root" />
50
+ <block type="adminhtml/tag_assigned_grid" name="assigned_grid" output="toHtml" />
51
+ </adminhtml_tag_assignedgridonly>
52
+
53
+ <adminhtml_tag_index>
54
+ <reference name="content">
55
+ <block type="adminhtml/tag_tag" name="adminhtml.tag.tag"/>
56
+ </reference>
57
+ </adminhtml_tag_index>
58
+
59
+ <adminhtml_tag_pending>
60
+ <reference name="content">
61
+ <block type="adminhtml/tag_pending" name="adminhtml.tag.pending"/>
62
+ </reference>
63
+ </adminhtml_tag_pending>
64
+
65
+ <adminhtml_tag_ajaxgrid>
66
+ <block type="core/text_list" name="root" output="toHtml">
67
+ <block type="adminhtml/tag_tag_grid" name="adminhtml.tag.tag.grid"/>
68
+ </block>
69
+ </adminhtml_tag_ajaxgrid>
70
+
71
+ <adminhtml_tag_ajaxpendinggrid>
72
+ <block type="core/text_list" name="root" output="toHtml">
73
+ <block type="adminhtml/tag_grid_pending" name="adminhtml.tag.grid.pending"/>
74
+ </block>
75
+ </adminhtml_tag_ajaxpendinggrid>
76
+
77
+ <adminhtml_tag_product>
78
+ <block type="core/text_list" name="root" output="toHtml">
79
+ <block type="adminhtml/tag_product_grid" name="adminhtml.tag.product.grid"/>
80
+ </block>
81
+ </adminhtml_tag_product>
82
+
83
+ <adminhtml_tag_customer>
84
+ <block type="core/text_list" name="root" output="toHtml">
85
+ <block type="adminhtml/tag_customer_grid" name="adminhtml.tag.customer.grid"/>
86
+ </block>
87
+ </adminhtml_tag_customer>
88
+ </layout>
app/design/adminhtml/default/default/layout/widget.xml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_widget_index>
31
+ <block name="wysiwyg_widget" type="widget/adminhtml_widget" output="toHtml" />
32
+ </adminhtml_widget_index>
33
+
34
+ <adminhtml_widget_loadoptions>
35
+ <block name="wysiwyg_widget.options" type="widget/adminhtml_widget_options" output="toHtml" />
36
+ </adminhtml_widget_loadoptions>
37
+
38
+ <adminhtml_widget_instance_index>
39
+ <reference name="content">
40
+ <block type="widget/adminhtml_widget_instance" name="widget_instance" />
41
+ </reference>
42
+ </adminhtml_widget_instance_index>
43
+
44
+ <adminhtml_widget_instance_edit>
45
+ <reference name="head">
46
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
47
+ <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
48
+ <action method="addItem"><type>js</type><name>prototype/window.js</name></action>
49
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
50
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
51
+ </reference>
52
+ <reference name="content">
53
+ <block type="widget/adminhtml_widget_instance_edit" name="widget_instance_edit" />
54
+ </reference>
55
+ <reference name="left">
56
+ <block type="widget/adminhtml_widget_instance_edit_tabs" name="widget_instance_edit_tabs">
57
+ <block type="widget/adminhtml_widget_instance_edit_tab_settings" name="widget_instance_edit_tab_settings" />
58
+ <block type="widget/adminhtml_widget_instance_edit_tab_main" name="widget_instance_edit_tab_main" />
59
+ <block type="widget/adminhtml_widget_instance_edit_tab_properties" name="widget_instance_edit_tab_properties" />
60
+ <action method="addTab"><name>settings_section</name><block>widget_instance_edit_tab_settings</block></action>
61
+ <action method="addTab"><name>main_section</name><block>widget_instance_edit_tab_main</block></action>
62
+ <action method="addTab"><name>properties_section</name><block>widget_instance_edit_tab_properties</block></action>
63
+ </block>
64
+ </reference>
65
+ <reference name="js">
66
+ <block type="adminhtml/template" template="widget/instance/js.phtml" name="widget_instance_js"></block>
67
+ </reference>
68
+ </adminhtml_widget_instance_edit>
69
+ </layout>
app/design/adminhtml/default/default/layout/xmlconnect.xml ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <default>
31
+ <reference name="head">
32
+ <action method="addCss"><name>xmlconnect/boxes.css</name></action>
33
+ </reference>
34
+ </default>
35
+
36
+ <adminhtml_mobile_index>
37
+ <reference name="content">
38
+ <block type="xmlconnect/adminhtml_mobile" name="applications"/>
39
+ </reference>
40
+ </adminhtml_mobile_index>
41
+
42
+ <adminhtml_mobile_history>
43
+ <reference name="content">
44
+ <block type="xmlconnect/adminhtml_history" name="history"/>
45
+ </reference>
46
+ </adminhtml_mobile_history>
47
+
48
+ <adminhtml_mobile_queue>
49
+ <reference name="content">
50
+ <block type="xmlconnect/adminhtml_queue" name="queue"/>
51
+ </reference>
52
+ </adminhtml_mobile_queue>
53
+
54
+ <adminhtml_mobile_template>
55
+ <reference name="content">
56
+ <block type="xmlconnect/adminhtml_template" name="template"/>
57
+ </reference>
58
+ </adminhtml_mobile_template>
59
+
60
+ <adminhtml_mobile_editqueue>
61
+ <reference name="content">
62
+ <block type="xmlconnect/adminhtml_queue_edit" name="queue_edit"/>
63
+ </reference>
64
+ </adminhtml_mobile_editqueue>
65
+
66
+ <adminhtml_mobile_queuemessage>
67
+ <reference name="content">
68
+ <block type="xmlconnect/adminhtml_queue_edit" name="queue_edit"/>
69
+ </reference>
70
+ </adminhtml_mobile_queuemessage>
71
+
72
+ <adminhtml_mobile_edittemplate>
73
+ <reference name="head">
74
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
75
+ <action method="addJs"><script>mage/adminhtml/variables.js</script></action>
76
+ <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
77
+ <action method="addJs"><script>lib/flex.js</script></action>
78
+ <action method="addJs"><script>lib/FABridge.js</script></action>
79
+ <action method="addJs"><script>mage/adminhtml/flexuploader.js</script></action>
80
+ <action method="addJs"><script>mage/adminhtml/browser.js</script></action>
81
+ <action method="addJs"><script>prototype/window.js</script></action>
82
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
83
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
84
+ </reference>
85
+ <reference name="content">
86
+ <block type="xmlconnect/adminhtml_template_edit" name="template_edit"/>
87
+ </reference>
88
+ </adminhtml_mobile_edittemplate>
89
+
90
+ <adminhtml_mobile_new>
91
+ <reference name="left">
92
+ <block type="xmlconnect/adminhtml_mobile_edit_tabs" name="mobile_edit_tabs" />
93
+ </reference>
94
+ <reference name="content">
95
+ <block type="xmlconnect/adminhtml_mobile_edit" name="mobile_edit_content"/>
96
+ </reference>
97
+ </adminhtml_mobile_new>
98
+
99
+ <adminhtml_mobile_edit>
100
+ <reference name="left">
101
+ <block type="xmlconnect/adminhtml_mobile_edit_tabs" name="mobile_edit_tabs">
102
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_general" name="mobile_edit_tab_general"/>
103
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design" name="mobile_edit_tab_design">
104
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_accordion" name="mobile_edit_tab_design_accordion" as="design_accordion">
105
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_accordion_images" name="accordion_images" />
106
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_accordion_themes" name="accordion_themes" />
107
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_accordion_tabs" name="accordion_tabs" />
108
+
109
+ <action method="addAccordionItem"><name>images</name><block>accordion_images</block></action>
110
+ <action method="addAccordionItem"><name>themes</name><block>accordion_themes</block></action>
111
+ <action method="addAccordionItem"><name>tabs</name><block>accordion_tabs</block></action>
112
+
113
+ </block>
114
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_preview" name="mobile_edit_tab_design_preview" as="app_preview" />
115
+ </block>
116
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_content" name="mobile_edit_tab_content"/>
117
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_payment" name="mobile_edit_tab_payment"/>
118
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_flurryanalytics" name="mobile_edit_tab_flurryanalytics"/>
119
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_submission_history" name="mobile_edit_tab_submission_history_grid"/>
120
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_cache" name="mobile_edit_tab_cache"/>
121
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_social" name="mobile_edit_tab_social" />
122
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_notification" name="mobile_edit_tab_notification">
123
+ <block type="core/template" name="mobile_edit_tab_notification_helper" as="app_notification_helper" template="xmlconnect/mobile/notification_helper.phtml" />
124
+ </block>
125
+
126
+ <action method="addTab"><id>general_section</id><block>mobile_edit_tab_general</block></action>
127
+ <action method="addTab"><id>design_section</id><block>mobile_edit_tab_design</block></action>
128
+ <action method="addTab"><id>content_section</id><block>mobile_edit_tab_content</block></action>
129
+ <action method="addTab"><id>payment_methods</id><block>mobile_edit_tab_payment</block></action>
130
+ <action method="addTab"><id>flurryanalytics_section</id><block>mobile_edit_tab_flurryanalytics</block></action>
131
+ <action method="addTab"><id>history_grid</id><block>mobile_edit_tab_submission_history_grid</block></action>
132
+ <action method="addTab"><id>cache_section</id><block>mobile_edit_tab_cache</block></action>
133
+ <action method="addTab"><id>social_section</id><block>mobile_edit_tab_social</block></action>
134
+ <action method="addTab"><id>notification_section</id><block>mobile_edit_tab_notification</block></action>
135
+ </block>
136
+ </reference>
137
+ <reference name="content">
138
+ <block type="xmlconnect/adminhtml_mobile_edit" name="mobile_edit_content"/>
139
+ </reference>
140
+ <reference name="head">
141
+ <action method="addCss"><name>xmlconnect/dropdown.css</name></action>
142
+ <action method="addCss"><name>xmlconnect/styles.css</name></action>
143
+ </reference>
144
+ </adminhtml_mobile_edit>
145
+
146
+ <adminhtml_mobile_submissionhistorygrid>
147
+ <remove name="root"/>
148
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_submission_history" name="submission_history_grid" output="toHtml"/>
149
+ </adminhtml_mobile_submissionhistorygrid>
150
+
151
+ <adminhtml_mobile_submission>
152
+ <reference name="left">
153
+ <block type="xmlconnect/adminhtml_mobile_submission_tabs" name="mobile_submission_tabs">
154
+ <block type="xmlconnect/adminhtml_mobile_submission_tab_container" name="mobile_submission_tab_container">
155
+ <block type="xmlconnect/adminhtml_mobile_submission_tab_container_submission" name="mobile_submission_tab_container_submission" as="edit_form"/>
156
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_preview" name="mobile_edit_tab_design_preview" as="app_preview" />
157
+ </block>
158
+ <action method="addTab"><id>submission_section</id><block>mobile_submission_tab_container</block></action>
159
+ </block>
160
+ </reference>
161
+ <reference name="content">
162
+ <block type="xmlconnect/adminhtml_mobile_submission" name="mobile_submission_content"/>
163
+ </reference>
164
+ <reference name="head">
165
+ <action method="addCss"><name>xmlconnect/styles.css</name></action>
166
+ </reference>
167
+ </adminhtml_mobile_submission>
168
+
169
+ <adminhtml_mobile_grid>
170
+ <block type="xmlconnect/adminhtml_mobile_grid" name="mobile_grid" output="toHtml"/>
171
+ </adminhtml_mobile_grid>
172
+
173
+ <adminhtml_mobile_history_grid>
174
+ <block type="xmlconnect/adminhtml_history_grid" name="history_grid" output="toHtml"/>
175
+ </adminhtml_mobile_history_grid>
176
+
177
+ <adminhtml_mobile_template_preview>
178
+ <block type="core/template" name="root" output="toHtml" template="xmlconnect/template/preview.phtml">
179
+ <block type="xmlconnect/adminhtml_template_preview" name="content" as="content"></block>
180
+ </block>
181
+ </adminhtml_mobile_template_preview>
182
+
183
+ <adminhtml_mobile_previewhome>
184
+ <block type="core/text_list" name="root" output="toHtml">
185
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_home_content">
186
+ <action method="setTemplate"><templateType>home</templateType></action>
187
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
188
+ <action method="setActiveTab"><tab>home</tab></action>
189
+ </block>
190
+ </block>
191
+ </block>
192
+ </adminhtml_mobile_previewhome>
193
+
194
+ <adminhtml_mobile_previewhomehor>
195
+ <block type="core/text_list" name="root" output="toHtml">
196
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_home_hor_content">
197
+ <action method="setTemplate"><templateType>home_hor</templateType></action>
198
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
199
+ <action method="setActiveTab"><tab>home</tab></action>
200
+ </block>
201
+ </block>
202
+ </block>
203
+ </adminhtml_mobile_previewhomehor>
204
+
205
+ <adminhtml_mobile_previewcataloghor>
206
+ <block type="core/text_list" name="root" output="toHtml">
207
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_catalog_hor_content">
208
+ <action method="setTemplate"><templateType>catalog_hor</templateType></action>
209
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
210
+ <action method="setActiveTab"><tab>shop</tab></action>
211
+ </block>
212
+ </block>
213
+ </block>
214
+ </adminhtml_mobile_previewcataloghor>
215
+
216
+ <adminhtml_mobile_previewcatalog>
217
+ <block type="core/text_list" name="root" output="toHtml">
218
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_catalog_content">
219
+ <action method="setTemplate"><templateType>catalog</templateType></action>
220
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
221
+ <action method="setActiveTab"><tab>shop</tab></action>
222
+ </block>
223
+ </block>
224
+ </block>
225
+ </adminhtml_mobile_previewcatalog>
226
+
227
+ <adminhtml_mobile_previewproductinfo>
228
+ <block type="core/text_list" name="root" output="toHtml">
229
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_productinfo_content">
230
+ <action method="setTemplate"><templateType>productinfo</templateType></action>
231
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
232
+ <action method="setActiveTab"><tab>shop</tab></action>
233
+ </block>
234
+ </block>
235
+ </block>
236
+ </adminhtml_mobile_previewproductinfo>
237
+ </layout>
app/design/adminhtml/default/default/locale/en_US/translate.csv ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Credit Card Type","Credit Card Type"
2
+ "Add New User","Add New User"
3
+ "Items that you don","Items that you don"
4
+ "State/Province","State/Province"
5
+ "Magento Commerce - Administrative Panel","Magento Commerce - Administrative Panel"
6
+ "3 stars","3 stars"
7
+ "Credit Memo Date","Credit Memo Date"
8
+ "Double click on a group to rename it","Double click on a group to rename it"
9
+ "Rating Not Available","Rating Not Available"
10
+ "Gift Certificate","Gift Certificate"
11
+ "Assigned Answers","Assigned Answers"
12
+ "Fax","Fax"
13
+ "Magento Admin","Magento Admin"
14
+ "Newsletter Message Preview","Newsletter Message Preview"
15
+ "4 stars","4 stars"
16
+ "Company","Company"
17
+ "Invoice Date","Invoice Date"
18
+ "Qty Returned","Qty Returned"
19
+ "Add New Customer Group","Add New Customer Group"
20
+ "Visitors","Visitors"
21
+ "Shipping Method","Shipping Method"
22
+ "Subtotal","Subtotal"
23
+ "5 stars","5 stars"
24
+ "Choose Store","Choose Store"
25
+ "Import Tax Rates","Import Tax Rates"
26
+ "Roles","Roles"
27
+ "If you do not specify an option value for a store then the default value will be used.","If you do not specify an option value for a store then the default value will be used."
28
+ "Shipping","Shipping"
29
+ "Select from existing customer addresses:","Select from existing customer addresses:"
30
+ "Products","Products"
31
+ "Edit User ","Edit User "
32
+ "Item Status","Item Status"
33
+ "Set as default billing address","Set as default billing address"
34
+ "Position","Position"
35
+ "Items Ordered","Items Ordered"
36
+ "Fixed","Fixed"
37
+ "%s","%s"
38
+ "Same as Billing Address","Same as Billing Address"
39
+ "Product In Stores","Product In Stores"
40
+ "Working...","Working..."
41
+ "Apply coupon code","Apply coupon code"
42
+ "per page","per page"
43
+ "Tax","Tax"
44
+ "Telephone","Telephone"
45
+ "Wishlist","Wishlist"
46
+ "Magento","Magento"
47
+ "Expiration Date","Expiration Date"
48
+ "Add New Class","Add New Class"
49
+ "Super product attributes configuration","Super product attributes configuration"
50
+ "Previus page","Previus page"
51
+ "Something went wrong...","Something went wrong..."
52
+ "Lifetime Sales","Lifetime Sales"
53
+ "SKU","SKU"
54
+ "Log Out","Log Out"
55
+ "Failed","Failed"
56
+ "Billing Address","Billing Address"
57
+ "Log into Magento Admin Page","Log into Magento Admin Page"
58
+ "Invoice Status","Invoice Status"
59
+ "CC Type","CC Type"
60
+ "Percentage","Percentage"
61
+ "Are you sure?","Are you sure?"
62
+ "Email","Email"
63
+ "Customer Group:","Customer Group:"
64
+ "Option","Option"
65
+ "Primary Billing Address","Primary Billing Address"
66
+ "Create Backup","Create Backup"
67
+ "Manage Options (values for your attribute)","Manage Options (values for your attribute)"
68
+ "Total Due","Total Due"
69
+ "Copyright 2007","Copyright 2007"
70
+ "Newsletter Subscribers","Newsletter Subscribers"
71
+ "CC Number","CC Number"
72
+ "Add New Tax Rate","Add New Tax Rate"
73
+ "Product Name","Product Name"
74
+ "Country","Country"
75
+ "Purchase order number","Purchase order number"
76
+ "Date and Time","Date and Time"
77
+ "Categories","Categories"
78
+ "Qty Cancelled","Qty Cancelled"
79
+ "Card Verification Number","Card Verification Number"
80
+ "Order Date","Order Date"
81
+ "This tab contains invalid data. Please correct before saving.","This tab contains invalid data. Please correct before saving."
82
+ "Customer Balance","Customer Balance"
83
+ "Update Qty","Update Qty"
84
+ "Customer Groups","Customer Groups"
85
+ "Export to","Export to"
86
+ "configuration","configuration"
87
+ "Sorry, no quotes are available for this order at this time.","Sorry, no quotes are available for this order at this time."
88
+ "Options","Options"
89
+ "Attribute Name","Attribute Name"
90
+ "Total <strong>%d</strong> records found","Total <strong>%d</strong> records found"
91
+ "Comment","Comment"
92
+ "Set as default shipping address","Set as default shipping address"
93
+ "Last Name","Last Name"
94
+ "of","of"
95
+ "Newsletter Problem Reports","Newsletter Problem Reports"
96
+ "Sales Statistics","Sales Statistics"
97
+ "Qty To Return","Qty To Return"
98
+ "New Customer Address","New Customer Address"
99
+ "Roles Resources","Roles Resources"
100
+ "Zip/Post Code","Zip/Post Code"
101
+ "Order Status","Order Status"
102
+ "Store","Store"
103
+ "Product Categories","Product Categories"
104
+ "Online Customers","Online Customers"
105
+ "Next page","Next page"
106
+ "Items Shipped","Items Shipped"
107
+ "Unassigned Attributes","Unassigned Attributes"
108
+ "Not Charged Yet","Not Charged Yet"
109
+ "This group contains system attributes.\nPlease, move system attributes to another group and try again.","This group contains system attributes.\nPlease, move system attributes to another group and try again."
110
+ "copy data from","copy data from"
111
+ "Add","Add"
112
+ "Total Payed","Total Payed"
113
+ "Shopping Cart","Shopping Cart"
114
+ "Order History","Order History"
115
+ "Empty","Empty"
116
+ "Unable to complete request. Please, try again later.","Unable to complete request. Please, try again later."
117
+ "Customers","Customers"
118
+ "Customer does not have any addresses","Customer does not have any addresses"
119
+ "Add New Role","Add New Role"
120
+ "Street Address","Street Address"
121
+ "Are You Sure?","Are You Sure?"
122
+ "Shipping Address","Shipping Address"
123
+ "Paid","Paid"
124
+ "Page","Page"
125
+ "Discount","Discount"
126
+ "Set root category for this store in","Set root category for this store in"
127
+ "Groups","Groups"
128
+ "View","View"
129
+ "Qty Ordered","Qty Ordered"
130
+ "Global Record Search","Global Record Search"
131
+ "Card Number","Card Number"
132
+ "PO Number","PO Number"
133
+ "Grand Total","Grand Total"
134
+ "Please select one or more attributes.","Please select one or more attributes."
135
+ "Dashboard","Dashboard"
136
+ "Are you sure you want to do this?","Are you sure you want to do this?"
137
+ "Please add one or more options","Please add one or more options"
138
+ "Role Users","Role Users"
139
+ "Add New Tax Rule","Add New Tax Rule"
140
+ "Subscribe to newsletter","Subscribe to newsletter"
141
+ "Dashboard Control","Dashboard Control"
142
+ "Default Shipping","Default Shipping"
143
+ "Qty","Qty"
144
+ "Add to Queue","Add to Queue"
145
+ "Average Sale","Average Sale"
146
+ "Cancel","Cancel"
147
+ "All stores","All stores"
148
+ "Personal Information","Personal Information"
149
+ "City","City"
150
+ "Export Tax Rates","Export Tax Rates"
151
+ "1 star","1 star"
152
+ "Current Configuration Scope","Current Configuration Scope"
153
+ "Add New Template","Add New Template"
154
+ "Move to:","Move to:"
155
+ "First Name","First Name"
156
+ "Change Order Status","Change Order Status"
157
+ "Are you sure you want to delete this address?","Are you sure you want to delete this address?"
158
+ "Are you sure you want to do it?","Are you sure you want to do it?"
159
+ "Add to Order","Add to Order"
160
+ "Product ID","Product ID"
161
+ "Payment Method","Payment Method"
162
+ "What is this?","What is this?"
163
+ "Users","Users"
164
+ "Customer Addresses","Customer Addresses"
165
+ "Qty Backordered","Qty Backordered"
166
+ "You can not remove system attribute from this set.","You can not remove system attribute from this set."
167
+ "Price","Price"
168
+ "Who","Who"
169
+ "Rating Not Alvailable","Rating Not Alvailable"
170
+ "Order Comment","Order Comment"
171
+ "Edit Role","Edit Role"
172
+ "Tax Rates Import / Export","Tax Rates Import / Export"
173
+ "Magento Logo","Magento Logo"
174
+ "A name is required","A name is required"
175
+ "Assigned options","Assigned options"
176
+ "Please Enter New Group Name","Please Enter New Group Name"
177
+ "Name","Name"
178
+ "Email Preview","Email Preview"
179
+ "Newsletter Queue","Newsletter Queue"
180
+ "Remove","Remove"
181
+ "Last Log In:","Last Log In:"
182
+ "Logged in as <strong>%s</strong>","Logged in as <strong>%s</strong>"
183
+ "Name on Card","Name on Card"
184
+ "All Stores","All Stores"
185
+ "Send comment to customer","Send comment to customer"
186
+ "Account Created on:","Account Created on:"
187
+ "Backups Control","Backups Control"
188
+ "Add New Address","Add New Address"
189
+ "Account Created in:","Account Created in:"
190
+ "Default Billing","Default Billing"
191
+ "Manage Titles (Size, Color, etc.)","Manage Titles (Size, Color, etc.)"
192
+ "Please confirm site switching. All data not saved will be lost.","Please confirm site switching. All data not saved will be lost."
193
+ "Please select from each ratings above","Please select from each ratings above"
194
+ "Qty Shipped","Qty Shipped"
195
+ "Are you sure you want to cancel add this address?","Are you sure you want to cancel add this address?"
196
+ "The information in this tab has been changed.","The information in this tab has been changed."
197
+ "2 stars","2 stars"
198
+ "Apply","Apply"
199
+ "Total","Total"
200
+ "User roles","User roles"
201
+ "Wishlist Report","Wishlist Report"
app/design/adminhtml/default/default/template/access_denied.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Denied
30
+ */
31
+ ?>
32
+ <h1 class="page-heading"><?php echo $this->helper('adminhtml')->__('Access denied') ?></h1>
33
+ <?php if (!$this->hasAvailaleResources()): ?>
34
+ <p>
35
+ <?php echo $this->helper('adminhtml')->__('Please try to logout and sign in again.') ?><br/>
36
+ <?php echo $this->helper('adminhtml')->__('If this message persists, please contact the store owner.') ?>
37
+ </p>
38
+ <?php else: ?>
39
+ <p><?php echo $this->helper('adminhtml')->__('Access denied.') ?></p>
40
+ <?php endif?>
app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ <!--
29
+ <?php $myBlock = $this->getLayout()->getBlock('roleUsersGrid'); ?>
30
+ <?php if( is_object($myBlock) && $myBlock->getJsObjectName() ): ?>
31
+ var checkBoxes = $H({});
32
+ var warning = false;
33
+ var inRoleUsers = $H(<?php echo $myBlock->_getUsers(true) ?>);
34
+ if (inRoleUsers.size() > 0) warning = true;
35
+ $('in_role_user').value = inRoleUsers.toQueryString();
36
+
37
+ function registerUserRole(grid, element, checked){
38
+ if(checked){
39
+ inRoleUsers.set(element.value, 0);
40
+ } else {
41
+ inRoleUsers.unset(element.value);
42
+ }
43
+ $('in_role_user').value = inRoleUsers.toQueryString();
44
+ grid.reloadParams = {'in_role_user[]':inRoleUsers.keys()};
45
+ }
46
+
47
+ function roleUsersRowClick(grid, event){
48
+ var trElement = Event.findElement(event, 'tr');
49
+ var isInput = Event.element(event).tagName == 'INPUT';
50
+ if(trElement){
51
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
52
+ if(checkbox[0]){
53
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
54
+ if (warning && checkBoxes.size() > 0) {
55
+ if ( !confirm("<?php echo $this->__('Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?') ?>") ) {
56
+ checkbox[0].checked = false;
57
+ checkBoxes.each(function(elem) {
58
+ if (elem.value.status == 1) {
59
+ elem.value.object.checked = true;
60
+ }
61
+ });
62
+ return false;
63
+ }
64
+ warning = false;
65
+ }
66
+ <?php echo $myBlock->getJsObjectName() ?>.setCheckboxChecked(checkbox[0], checked);
67
+ }
68
+ }
69
+ }
70
+
71
+ function roleUsersRowInit(grid, row){
72
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
73
+ if (checkbox) {
74
+ checkBoxes.set(checkbox.value, {'status' : ((checkbox.checked) ? 1 : 0), 'object' : checkbox});
75
+ }
76
+ }
77
+
78
+ function myhandler(obj)
79
+ {
80
+ if (checkBoxes.size() > 0) {
81
+ if ( !confirm("<?php echo $this->__('Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?') ?>") ) {
82
+ obj.checked = false;
83
+ checkBoxes.each(function(elem) {
84
+ if (elem.value.status == 1) {
85
+ elem.value.object.checked = true;
86
+ }
87
+ });
88
+ return false;
89
+ }
90
+ warning = false;
91
+ }
92
+ checkBoxes.each(function(elem) {
93
+ <?php echo $myBlock->getJsObjectName() ?>.setCheckboxChecked(elem.value.object, obj.checked);
94
+ });
95
+ }
96
+
97
+ <?php echo $myBlock->getJsObjectName() ?>.rowClickCallback = roleUsersRowClick;
98
+ <?php echo $myBlock->getJsObjectName() ?>.initRowCallback = roleUsersRowInit;
99
+ <?php echo $myBlock->getJsObjectName() ?>.checkboxCheckCallback = registerUserRole;
100
+ <?php echo $myBlock->getJsObjectName() ?>.checkCheckboxes = myhandler;
101
+ <?php echo $myBlock->getJsObjectName() ?>.rows.each(function(row){roleUsersRowInit(<?php echo $myBlock->getJsObjectName() ?>, row)});
102
+ $('in_role_user_old').value = $('in_role_user').value;
103
+ <?php endif; ?>
104
+ //-->
105
+ </script>
app/design/adminhtml/default/default/template/api/roleinfo.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ /** @var $this Mage_Adminhtml_Block_Api_Tab_Roleinfo */
27
+
28
+ ?>
29
+ <div class="content-header">
30
+ <table cellspacing="0">
31
+ <tr>
32
+ <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo ($this->getRoleId() > 0 ) ? ($this->__('Edit Role') . " '{$this->escapeHtml($this->getRoleInfo()->getRoleName())}'") : $this->__('Add New Role') ?></h3></td>
33
+ <td class="form-buttons">
34
+ <?php echo $this->getBackButtonHtml() ?>
35
+ <?php echo $this->getResetButtonHtml() ?>
36
+ <?php echo $this->getDeleteButtonHtml() ?>
37
+ <?php echo $this->getSaveButtonHtml() ?>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
42
+ <form action="<?php echo $this->getUrl('*/*/saverole') ?>" method="post" id="role_edit_form">
43
+ <?php echo $this->getBlockHtml('formkey')?>
44
+ </form>
45
+ <script type="text/javascript">
46
+ var roleForm = new varienForm('role_edit_form');
47
+ </script>
app/design/adminhtml/default/default/template/api/roles.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo $this->__('Roles') ?></h3></td>
31
+ <td class="form-buttons">
32
+ <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New Role') ?></span></span></span></button>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </div>
37
+ <?php echo $this->getGridHtml() ?>
app/design/adminhtml/default/default/template/api/rolesedit.phtml ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Roles Resources') ?></h4>
30
+ </div>
31
+ <input type="hidden" name="resource" id="role_resources" value="">
32
+ <fieldset id="role_resources">
33
+
34
+ <span class="field-row">
35
+ <label for="all"><?php echo $this->__('Resource Access') ?></label>
36
+ <select id="all" name="all" onchange="$('resources_container').toggle()" class="select">
37
+ <option value="0" <?php echo ($this->getEverythingAllowed()?'':'selected="selected"'); ?>><?php echo $this->__('Custom') ?></option>
38
+ <option value="1" <?php echo ($this->getEverythingAllowed()?'selected="selected"':''); ?>><?php echo $this->__('All') ?></option>
39
+ </select>
40
+ </span>
41
+
42
+ <span class="field-row" id="resources_container">
43
+ <label><?php echo $this->__('Resources') ?></label>
44
+ <div class="f-left">
45
+ <div class="tree x-tree" id="resource-tree"></div>
46
+ </div>
47
+ </span>
48
+
49
+ </fieldset>
50
+ </div>
51
+ <!-- Draw Resources Tree -->
52
+ <script type="text/javascript">
53
+ <?php if($this->getEverythingAllowed()): ?>
54
+ $('resources_container').hide();
55
+ <?php endif; ?>
56
+ Ext.EventManager.onDocumentReady(function() {
57
+ var tree = new Ext.tree.TreePanel('resource-tree', {
58
+ animate:false,
59
+ loader: false,
60
+ enableDD:false,
61
+ containerScroll: true,
62
+ rootUIProvider: Ext.tree.CheckboxNodeUI,
63
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
64
+ rootVisible: false
65
+ });
66
+
67
+ tree.on('check', checkHandler, tree);
68
+
69
+ // set the root node
70
+ var root = new Ext.tree.TreeNode({
71
+ text: 'root',
72
+ draggable:false,
73
+ checked:'false',
74
+ id:'__root__',
75
+ uiProvider: Ext.tree.CheckboxNodeUI
76
+ });
77
+
78
+ tree.setRootNode(root);
79
+ bildResourcesTree(root, <?php echo $this->getResTreeJson() ?>);
80
+ tree.addListener('click', resourceClick.createDelegate(this));
81
+
82
+ // render the tree
83
+ tree.render();
84
+ // root.expand();
85
+ tree.expandAll();
86
+
87
+ $('role_resources').value = tree.getChecked().join(',');
88
+ });
89
+
90
+ function resourceClick(node, e){
91
+ node.getUI().check(!node.getUI().checked());
92
+ varienElementMethods.setHasChanges(Event.element(e), e);
93
+ };
94
+
95
+ function bildResourcesTree(parent, config){
96
+ if (!config) return null;
97
+
98
+ if (parent && config && config.length){
99
+ for (var i = 0; i < config.length; i++){
100
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
101
+ var node = new Ext.tree.TreeNode(config[i]);
102
+ parent.appendChild(node);
103
+ if(config[i].children){
104
+ bildResourcesTree(node, config[i].children);
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ function checkHandler(node)
111
+ {
112
+ if ( node.attributes.checked && node.parentNode ) {
113
+ var n = node.parentNode;
114
+ this.removeListener('check', checkHandler);
115
+ do {
116
+ if (!n || n.attributes.id == 'admin' || n.attributes.id == '__root__') {
117
+ break;
118
+ } else {
119
+ n.ui.check(true);
120
+ }
121
+ } while (n = n.parentNode );
122
+ this.on('check', checkHandler);
123
+ }
124
+ if ( !node.isLeaf() && node.hasChildNodes() ) {
125
+ this.removeListener('check', checkHandler);
126
+ processChildren(node, node.attributes.checked);
127
+ this.on('check', checkHandler);
128
+ }
129
+ $('role_resources').value = this.getChecked().join(',');
130
+ }
131
+
132
+ function processChildren(node, state)
133
+ {
134
+ if ( !node.hasChildNodes() ) return false;
135
+ for(var i = 0; i < node.childNodes.length; i++ ) {
136
+ node.childNodes[i].ui.check(state);
137
+ if ( node.childNodes[i].hasChildNodes() ) {
138
+ processChildren(node.childNodes[i], state);
139
+ }
140
+ }
141
+ return true;
142
+ }
143
+ </script>
app/design/adminhtml/default/default/template/api/rolesusers.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Role Users') ?></h4>
28
+ <?php echo $this->_getGridHtml() ?>
app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ <!--
29
+ <?php $myBlock = $this->getLayout()->getBlock('user.roles.grid'); ?>
30
+ <?php if( is_object($myBlock) && $myBlock->getJsObjectName()): ?>
31
+ var radioBoxes = $H({});
32
+ var warning = false;
33
+ var userRoles = $H(<?php echo $myBlock->_getSelectedRoles(true) ?>);
34
+ if (userRoles.size() > 0) warning = true;
35
+ $('user_user_roles').value = userRoles.toQueryString();
36
+
37
+ function registerUserRole(grid, element, checked){
38
+ if(checked){
39
+ userRoles.each(function(o){userRoles.remove(o[0]);});
40
+ userRoles[element.value] = 0;
41
+ } else {
42
+ userRoles.remove(element.value);
43
+ }
44
+ $('user_user_roles').value = userRoles.toQueryString();
45
+ grid.reloadParams = {'user_roles[]':userRoles.keys()};
46
+ }
47
+
48
+ function roleRowClick(grid, event){
49
+ var trElement = Event.findElement(event, 'tr');
50
+ var isInput = Event.element(event).tagName == 'INPUT';
51
+ if(trElement){
52
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
53
+ if(checkbox[0] && !checkbox[0].checked){
54
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
55
+ if (checked && warning && radioBoxes.size() > 0) {
56
+ if ( !confirm("<?php echo $this->__('Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?') ?>") ) {
57
+ checkbox[0].checked = false;
58
+ for(i in radioBoxes) {
59
+ if( radioBoxes[i].status == 1) {
60
+ radioBoxes[i].object.checked = true;
61
+ }
62
+ }
63
+ return false;
64
+ }
65
+ warning = false;
66
+ }
67
+ <?php echo $myBlock->getJsObjectName() ?>.setCheckboxChecked(checkbox[0], checked);
68
+ }
69
+ }
70
+ }
71
+
72
+ function rolesRowInit(grid, row){
73
+ var checkbox = $(row).getElementsByClassName('radio')[0];
74
+ if (checkbox) {
75
+ radioBoxes[checkbox.value] = {'status' : ((checkbox.checked) ? 1 : 0), 'object' : checkbox};
76
+ }
77
+ }
78
+
79
+ <?php echo $myBlock->getJsObjectName() ?>.rowClickCallback = roleRowClick;
80
+ <?php echo $myBlock->getJsObjectName() ?>.initRowCallback = rolesRowInit;
81
+ <?php echo $myBlock->getJsObjectName() ?>.checkboxCheckCallback = registerUserRole;
82
+ <?php echo $myBlock->getJsObjectName() ?>.rows.each(function(row){rolesRowInit(<?php echo $myBlock->getJsObjectName() ?>, row)});
83
+ <?php endif; ?>
84
+ //-->
85
+ </script>
app/design/adminhtml/default/default/template/api/userinfo.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;">
31
+ <h3>
32
+ <?php if($this->getUser()->getUserId()): ?>
33
+ <?php $_userName = $this->getUser()->getFirstname() . ' ' . $this->getUser()->getLastname() ?>
34
+ <?php echo $this->__("Edit User '%s'", $_userName) ?>
35
+ <?php else: ?>
36
+ <?php echo $this->__('Add New User') ?>
37
+ <?php endif; ?>
38
+ </h3>
39
+ </td>
40
+ <td class="form-buttons">
41
+ <?php echo $this->getBackButtonHtml() ?>
42
+ <?php echo $this->getResetButtonHtml() ?>
43
+ <?php echo $this->getDeleteButtonHtml() ?>
44
+ <?php echo $this->getSaveButtonHtml() ?>
45
+ </table>
46
+ </div>
47
+ <form action="<?php echo $this->getUrl('*/*/saveuser') ?>" method="post" id="user_edit_form">
48
+ <?php echo $this->getBlockHtml('formkey')?>
49
+ </form>
50
+ <script type="text/javascript">
51
+ var userForm = new varienForm('user_edit_form');
52
+ </script>
app/design/adminhtml/default/default/template/api/usernroles.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div id="roles">
28
+ <li class="add"><a href="<?php echo $this->getUrl('*/*/edituser') ?>"><?php echo $this->__('Add New User') ?></a></li>
29
+ <li class="add"><a href="<?php echo $this->getUrl('*/*/editroles') ?>"><?php echo $this->__('Add New Role') ?></a></li>
30
+ </div>
31
+ <div class="clear"></div>
app/design/adminhtml/default/default/template/api/userroles.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('User Roles') ?></h4>
30
+ </div>
31
+ <fieldset id="user_roles">
32
+ <?php foreach ($roles as $role): ?>
33
+ <?php
34
+ $checked = false;
35
+ foreach( $user_roles->getItems() as $user_role )
36
+ {
37
+ if( $user_role->getParentId() == $role->getRoleId() ) {
38
+ $checked = true;
39
+ }
40
+ }
41
+ ?>
42
+ <input type="checkbox" value="<?php echo $role->getRoleId(); ?>" <?php echo ($checked ? "checked" : ""); ?> name="roles[]" id="_<?php echo $role->getRoleId(); ?>" /> <label for="_<?php echo $role->getRoleId(); ?>" class="normal"><?php echo $role->getRoleName(); ?></label><br />
43
+ <?php endforeach; ?>
44
+ </fieldset>
45
+ </div>
app/design/adminhtml/default/default/template/api/users.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3><?php echo $this->__('Users') ?></h3></td>
31
+ <td class="a-right">
32
+ <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New User') ?></span></span></span></button>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </div>
37
+ <div>
38
+ <?php echo $this->getGridHtml() ?>
39
+ </div>
40
+
app/design/adminhtml/default/default/template/api2/attribute/buttons.phtml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ /** @var $this Mage_Api2_Block_Adminhtml_Attribute_Buttons */
27
+
28
+ ?>
29
+ <div class="content-header">
30
+ <table cellspacing="0">
31
+ <tr>
32
+ <td style="width:50%;">
33
+ <h3 class="icon-head head-permissions-role">
34
+ <?php echo $this->getCaption() ?>
35
+ </h3>
36
+ </td>
37
+ <td class="form-buttons">
38
+ <?php echo $this->getBackButtonHtml() ?>
39
+ <?php echo $this->getResetButtonHtml() ?>
40
+ <?php echo $this->getDeleteButtonHtml() ?>
41
+ <?php echo $this->getSaveButtonHtml() ?>
42
+ </td>
43
+ </tr>
44
+ </table>
45
+ </div>
46
+ <form action="<?php echo $this->getUrl('*/*/save') ?>" method="post" id="role_edit_form">
47
+ <?php echo $this->getBlockHtml('formkey')?>
48
+ </form>
49
+ <script type="text/javascript">
50
+ //<![CDATA[
51
+ var roleForm = new varienForm('role_edit_form');
52
+ //]]>
53
+ </script>
app/design/adminhtml/default/default/template/api2/attribute/resource.phtml ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php
29
+ /**
30
+ * @see Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource
31
+ */
32
+ ?>
33
+
34
+ <?php echo $this->getChildHtml(); ?>
35
+
36
+ <div class="entry-edit">
37
+ <div class="entry-edit-head">
38
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('User Type Resources') ?></h4>
39
+ </div>
40
+ <input type="hidden" name="resource" id="role_resources" value="" />
41
+ <fieldset id="role_resources">
42
+
43
+ <span class="field-row">
44
+ <label for="all"><?php echo $this->__('Resource Access') ?></label>
45
+ <select id="all" name="all" onchange="$('resources_container').toggle()" class="select">
46
+ <option value="0" <?php echo ($this->getEverythingAllowed()?'':'selected'); ?>><?php echo $this->__('Custom') ?></option>
47
+ <option value="1" <?php echo ($this->getEverythingAllowed()?'selected':''); ?>><?php echo $this->__('All') ?></option>
48
+ </select>
49
+ </span>
50
+
51
+ <span class="field-row" id="resources_container">
52
+ <label><?php echo $this->__('Resources') ?></label>
53
+ <div class="f-left">
54
+ <div class="tree x-tree" id="resource-tree"></div>
55
+ </div>
56
+ <?php if ($this->hasEntityOnlyAttributes()): ?>
57
+ <div class="clear"></div>
58
+ <span>* This attribute data will be returned for a single resource only.</span>
59
+ <?php endif; ?>
60
+ </span>
61
+
62
+ </fieldset>
63
+ </div>
64
+ <!-- Draw Resources Tree -->
65
+ <script type="text/javascript">
66
+ //<![CDATA[
67
+ <?php if($this->getEverythingAllowed()): ?>
68
+ $('resources_container').hide();
69
+ <?php endif; ?>
70
+ Ext.EventManager.onDocumentReady(function() {
71
+ var tree = new Ext.tree.TreePanel('resource-tree', {
72
+ animate:false,
73
+ loader: false,
74
+ enableDD:false,
75
+ containerScroll: true,
76
+ rootUIProvider: Ext.tree.CheckboxNodeUI,
77
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
78
+ rootVisible: false
79
+ });
80
+
81
+ tree.on('check', checkHandler, tree);
82
+
83
+ // set the root node
84
+ var root = new Ext.tree.TreeNode({
85
+ text: 'root',
86
+ draggable:false,
87
+ checked:'false',
88
+ id:'__root__',
89
+ uiProvider: Ext.tree.CheckboxNodeUI
90
+ });
91
+
92
+ tree.setRootNode(root);
93
+ bildResourcesTree(root, <?php echo $this->getResTreeJson() ?>);
94
+ tree.addListener('click', resourceClick.createDelegate(this));
95
+
96
+ // render the tree
97
+ tree.render();
98
+ // root.expand();
99
+ tree.expandAll();
100
+
101
+ $('role_resources').value = tree.getChecked().join(',');
102
+ });
103
+
104
+ function resourceClick(node, e){
105
+ node.getUI().check(!node.getUI().checked());
106
+ varienElementMethods.setHasChanges(Event.element(e), e);
107
+ };
108
+
109
+ function bildResourcesTree(parent, config){
110
+ if (!config) return null;
111
+
112
+ if (parent && config && config.length){
113
+ for (var i = 0; i < config.length; i++){
114
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
115
+ var node = new Ext.tree.TreeNode(config[i]);
116
+ parent.appendChild(node);
117
+ if(config[i].children){
118
+ bildResourcesTree(node, config[i].children);
119
+ }
120
+ }
121
+ }
122
+ }
123
+
124
+ function checkHandler(node)
125
+ {
126
+ if ( node.attributes.checked && node.parentNode ) {
127
+ var n = node.parentNode;
128
+ this.removeListener('check', checkHandler);
129
+ do {
130
+ if (!n || n.attributes.id == 'admin' || n.attributes.id == '__root__') {
131
+ break;
132
+ } else {
133
+ n.ui.check(true);
134
+ }
135
+ } while (n = n.parentNode );
136
+ this.on('check', checkHandler);
137
+ }
138
+ if ( !node.isLeaf() && node.hasChildNodes() ) {
139
+ this.removeListener('check', checkHandler);
140
+ processChildren(node, node.attributes.checked);
141
+ this.on('check', checkHandler);
142
+ }
143
+ $('role_resources').value = this.getChecked().join(',');
144
+ }
145
+
146
+ function processChildren(node, state)
147
+ {
148
+ if ( !node.hasChildNodes() ) return false;
149
+ for(var i = 0; i < node.childNodes.length; i++ ) {
150
+ node.childNodes[i].ui.check(state);
151
+ if ( node.childNodes[i].hasChildNodes() ) {
152
+ processChildren(node.childNodes[i], state);
153
+ }
154
+ }
155
+ return true;
156
+ }
157
+ //]]>
158
+ </script>
app/design/adminhtml/default/default/template/api2/permissions/user/edit/tab/roles/js.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ var activeRestRole = getActiveRestRole();
31
+
32
+ /* Retrieve current active rest role */
33
+ function getActiveRestRole() {
34
+ var role;
35
+ api2_roles_sectionJsObject.rows.each(function(row) {
36
+ var radiobox = $(row).getElementsByClassName('radio')[0];
37
+ if ('undefined' != typeof radiobox && radiobox.checked) {
38
+ role = radiobox;
39
+ }
40
+ });
41
+ return role;
42
+ }
43
+
44
+ /* Callback function for rest role row click */
45
+ function restRolesRowClick(grid, event) {
46
+ var newRestRole = getActiveRestRole();
47
+ if (newRestRole.value !== activeRestRole.value) {
48
+ if (!confirm("Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?") ) {
49
+ newRestRole.checked = !newRestRole.checked;
50
+ activeRestRole.checked = true;
51
+ } else {
52
+ activeRestRole = newRestRole;
53
+ }
54
+ }
55
+ }
56
+
57
+ api2_roles_sectionJsObject.rowClickCallback = restRolesRowClick;
58
+ //]]>
59
+ </script>
app/design/adminhtml/default/default/template/api2/role/buttons.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Adminhtml_Block_Api_Tab_Roleinfo */ ?>
28
+ <div class="content-header">
29
+ <table cellspacing="0">
30
+ <tr>
31
+ <td style="width:50%;">
32
+ <h3 class="icon-head head-permissions-role">
33
+ <?php echo $this->getCaption() ?>
34
+ </h3>
35
+ </td>
36
+ <td class="form-buttons">
37
+ <?php echo $this->getBackButtonHtml() ?>
38
+ <?php echo $this->getResetButtonHtml() ?>
39
+ <?php echo $this->getDeleteButtonHtml() ?>
40
+ <?php echo $this->getSaveButtonHtml() ?>
41
+ </td>
42
+ </tr>
43
+ </table>
44
+ </div>
45
+ <form action="<?php echo $this->getUrl('*/*/save') ?>" method="post" id="role_edit_form">
46
+ <?php echo $this->getBlockHtml('formkey')?>
47
+ </form>
48
+ <script type="text/javascript">
49
+ //<![CDATA[
50
+ var roleForm = new varienForm('role_edit_form');
51
+ //]]>
52
+ </script>
app/design/adminhtml/default/default/template/api2/role/users_grid_js.phtml ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ ?>
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ <?php
31
+ /** @var $myBlock Mage_Api2_Block_Adminhtml_Roles_Tab_Users */
32
+ $myBlock = $this->getLayout()->getBlock('adminhtml.role.edit.tab.users');
33
+ $name = $myBlock->getJsObjectName();
34
+ ?>
35
+ <?php if (is_object($myBlock) && $name && !$myBlock->isHidden()): ?>
36
+ var checkBoxes = $H(<?php echo $myBlock->getUsers(true) ?>);
37
+ var warning = false;
38
+ if (checkBoxes.size() > 0) {
39
+ warning = true;
40
+ }
41
+ $('in_role_users').value = checkBoxes.toQueryString();
42
+
43
+ function registerUserRole(grid, element, checked)
44
+ {
45
+ if (checked) {
46
+ checkBoxes.set(element.value, 0);
47
+ } else {
48
+ checkBoxes.unset(element.value);
49
+ }
50
+ $('in_role_users').value = checkBoxes.toQueryString();
51
+ grid.reloadParams = {'in_role_users[]':checkBoxes.keys()};
52
+ }
53
+
54
+ function roleUsersRowClick(grid, event)
55
+ {
56
+ var trElement = Event.findElement(event, 'tr');
57
+ var isInput = Event.element(event).tagName == 'INPUT';
58
+ if (trElement) {
59
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
60
+ if(checkbox[0]){
61
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
62
+ if (checked) {
63
+ checkbox[0].checked = true;
64
+ if ( confirm("<?php echo $this->__('Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?') ?>") ) {
65
+ checkBoxes.set(checkbox[0].value, checked);
66
+ varienElementMethods.setHasChanges(checkbox[0]);
67
+ } else {
68
+ checkbox[0].checked = false;
69
+ }
70
+ warning = false;
71
+ } else {
72
+ checkBoxes.unset(checkbox[0].value);
73
+ }
74
+
75
+ $('in_role_users').value = checkBoxes.toQueryString();
76
+ grid.reloadParams = {'in_role_user[]':checkBoxes.keys()};
77
+ }
78
+ }
79
+ }
80
+
81
+ function roleUsersRowInit(grid, row)
82
+ {
83
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
84
+ if (checkbox) {
85
+ if (checkbox.checked) {
86
+ checkBoxes.set(checkbox.value, checkbox.checked);
87
+ } else {
88
+ checkBoxes.unset(checkbox.value);
89
+ }
90
+
91
+ $('in_role_users').value = checkBoxes.toQueryString();
92
+ grid.reloadParams = {'in_role_user[]':checkBoxes.keys()};
93
+ }
94
+ }
95
+
96
+ function myhandler(o)
97
+ {
98
+ if (checkBoxes.size() > 0) {
99
+ if (!confirm("<?php echo $this->__('Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?') ?>") ) {
100
+ o.checked = !o.checked;
101
+ } else {
102
+ checkBoxes.each(function(el){
103
+ el.checked = o.checked;
104
+ });
105
+ return false;
106
+ }
107
+ warning = false;
108
+ }
109
+
110
+ $('in_role_users').value = checkBoxes.toQueryString();
111
+ //grid.reloadParams = {'in_role_user[]':checkBoxes.keys()};
112
+ }
113
+
114
+ <?php echo $name ?>.rowClickCallback = roleUsersRowClick;
115
+ <?php echo $name ?>.initRowCallback = roleUsersRowInit;
116
+ <?php echo $name ?>.checkboxCheckCallback = registerUserRole;
117
+ <?php echo $name ?>.checkCheckboxes = myhandler;
118
+ <?php echo $name ?>.rows.each(function(row){roleUsersRowInit(<?php echo $name ?>, row)});
119
+ $('in_role_users_old').value = $('in_role_users').value;
120
+ <?php endif; ?>
121
+ //]]>
122
+ </script>
app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * @var $this Mage_Authorizenet_Block_Directpost_Iframe
29
+ */
30
+ ?>
31
+ <?php
32
+ $_params = $this->getParams();
33
+ /* @var $_helper Mage_Authorizenet_Helper_Data */
34
+ $_helper = $this->helper('authorizenet');
35
+ ?>
36
+ <html>
37
+ <head>
38
+ <script type="text/javascript">
39
+ //<![CDATA[
40
+ <?php if (isset($_params['redirect'])): ?>
41
+ window.location="<?php echo $this->escapeUrl($_params['redirect']) ?>";
42
+ <?php endif; ?>
43
+ <?php if (isset($_params['redirect_parent'])): ?>
44
+ window.top.location="<?php echo $this->escapeUrl($_params['redirect_parent']) ?>";
45
+ <?php endif; ?>
46
+ <?php if (isset($_params['error_msg'])): ?>
47
+ window.top.directPostModel.showError(<?php echo $this->helper('core')->jsonEncode($_params['error_msg']) ?>);
48
+ <?php if (isset($_params['x_invoice_num'])): ?>
49
+ window.top.directPostModel.successUrl="<?php echo $_helper->getSuccessOrderUrl($_params) ?>";
50
+ <?php endif; ?>
51
+ <?php endif; ?>
52
+ //]]>
53
+ </script>
54
+ </head>
55
+ <body></body>
56
+ </html>
app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * @see Mage_Authorizenet_Block_Directpost_Form
29
+ */
30
+ ?>
31
+ <?php
32
+ $_form = $this;
33
+ $_code = $_form->getMethodCode();
34
+ $_method = $_form->getMethod();
35
+ $_controller = $this->helper('authorizenet')->getControllerName();
36
+ $_orderUrl = $this->helper('authorizenet')->getPlaceOrderAdminUrl();
37
+ ?>
38
+ <!-- IFRAME for request to our server -->
39
+ <iframe id="order-directpost-iframe" allowtransparency="true" frameborder="0" name="iframeSubmitOrder" style="display:none;width:100%;background-color:transparent" src="<?php echo $this->getJsUrl() ?>blank.html"></iframe>
40
+ <!-- IFRAME for request to Authorize.net -->
41
+ <iframe id="directpost-iframe" allowtransparency="true" frameborder="0" name="iframeDirectPost" style="display:none;width:100%;background-color:transparent" src="<?php echo $this->getJsUrl() ?>blank.html"></iframe>
42
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
43
+ <li>
44
+ <div class="input-box">
45
+ <label for="<?php echo $_code ?>_cc_type"><?php echo Mage::helper('payment')->__('Credit Card Type') ?> <span class="required">*</span></label><br/>
46
+ <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
47
+ <?php $_ccType = $_form->getInfoData('cc_type') ?>
48
+ <option value=""></option>
49
+ <?php foreach ($_form->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
50
+ <option value="<?php echo $_typeCode ?>" <?php if($_typeCode==$_ccType): ?>selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
51
+ <?php endforeach ?>
52
+ </select>
53
+ </div>
54
+ </li>
55
+ <li>
56
+ <div class="input-box">
57
+ <label for="<?php echo $_code ?>_cc_number"><?php echo Mage::helper('payment')->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
58
+ <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo Mage::helper('payment')->__('Credit Card Number') ?>" class="input-text validate-cc-number" value="<?php echo $this->getInfoData('cc_number')?>" />
59
+ </div>
60
+ </li>
61
+ <li>
62
+ <div class="input-box">
63
+ <label for="<?php echo $_code ?>_expiration"><?php echo Mage::helper('payment')->__('Expiration Date') ?> <span class="required">*</span></label><br/>
64
+ <select id="<?php echo $_code ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="validate-cc-exp required-entry">
65
+ <?php $_ccExpMonth = $_form->getInfoData('cc_exp_month') ?>
66
+ <?php foreach ($_form->getCcMonths() as $k=>$v): ?>
67
+ <option value="<?php echo $k ?>" <?php if($k==$_ccExpMonth): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
68
+ <?php endforeach ?>
69
+ </select>
70
+ <?php $_ccExpYear = $_form->getInfoData('cc_exp_year') ?>
71
+ <select id="<?php echo $_code ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
72
+ <?php foreach ($_form->getCcYears() as $k=>$v): ?>
73
+ <option value="<?php echo $k ? $k : '' ?>" <?php if($k==$_ccExpYear): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
74
+ <?php endforeach ?>
75
+ </select>
76
+ </div>
77
+ </li>
78
+ <?php if($_form->hasVerification()): ?>
79
+ <li>
80
+ <div class="input-box">
81
+ <label for="<?php echo $_code ?>_cc_cid"><?php echo Mage::helper('payment')->__('Card Verification Number') ?> <span class="required">*</span></label><br/>
82
+ <input type="text" title="<?php echo Mage::helper('payment')->__('Card Verification Number') ?>" class="required-entry input-text validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value="<?php echo $this->getInfoData('cc_cid')?>" />
83
+ </div>
84
+ </li>
85
+ <?php endif; ?>
86
+ </ul>
87
+ <script type="text/javascript">
88
+ //<![CDATA[
89
+ /**
90
+ * Disable cart server validation in admin
91
+ */
92
+ AdminOrder.prototype.prepareParams = function(params) {
93
+ if (!params) {
94
+ params = {};
95
+ }
96
+ if (!params.customer_id) {
97
+ params.customer_id = this.customerId;
98
+ }
99
+ if (!params.store_id) {
100
+ params.store_id = this.storeId;
101
+ }
102
+ if (!params.currency_id) {
103
+ params.currency_id = this.currencyId;
104
+ }
105
+ if (!params.form_key) {
106
+ params.form_key = FORM_KEY;
107
+ }
108
+
109
+ if (this.paymentMethod != '<?php echo $_code ?>') {
110
+ var data = this.serializeData('order-billing_method');
111
+ if (data) {
112
+ data.each(function(value) {
113
+ params[value[0]] = value[1];
114
+ });
115
+ }
116
+ } else {
117
+ params['payment[method]'] = '<?php echo $_code ?>';
118
+ }
119
+ return params;
120
+ };
121
+ AdminOrder.prototype.getPaymentData = function(currentMethod) {
122
+ if (typeof (currentMethod) == 'undefined') {
123
+ if (this.paymentMethod) {
124
+ currentMethod = this.paymentMethod;
125
+ } else {
126
+ return false;
127
+ }
128
+ }
129
+ if (currentMethod == '<?php echo $_code ?>') {
130
+ return false;
131
+ }
132
+ var data = {};
133
+ var fields = $('payment_form_' + currentMethod).select('input', 'select');
134
+ for ( var i = 0; i < fields.length; i++) {
135
+ data[fields[i].name] = fields[i].getValue();
136
+ }
137
+ if ((typeof data['payment[cc_type]']) != 'undefined'
138
+ && (!data['payment[cc_type]'] || !data['payment[cc_number]'])) {
139
+ return false;
140
+ }
141
+ return data;
142
+ };
143
+ <?php if (!$this->isAjaxRequest()): ?>
144
+ document.observe('dom:loaded', function(){
145
+ <?php endif; ?>
146
+ directPostModel = new directPost(
147
+ '<?php echo $_code ?>',
148
+ 'directpost-iframe',
149
+ '<?php echo $_controller ?>',
150
+ '<?php echo $_orderUrl ?>',
151
+ '<?php echo $_method->getCgiUrl() ?>',
152
+ '<?php echo $this->getUrl('*/*/save', array('_secure' => $this->getRequest()->isSecure())) ?>');
153
+ <?php if (!$this->isAjaxRequest()): ?>
154
+ });
155
+ <?php endif; ?>
156
+ //]]>
157
+ </script>
app/design/adminhtml/default/default/template/backup/dialogs.phtml ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="backup-dialog" style="display: none;" id="rollback-warning">
2
+ <div class="entry-edit">
3
+ <div class="entry-edit-head">
4
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4>
5
+ </div>
6
+ <div class="content">
7
+ <div><?php echo $this->__('Any data created since the backup was made will be lost including admin users, customers and orders.')?></div>
8
+ <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div>
9
+ </div>
10
+ <div class="buttons-set">
11
+ <div class="f-right">
12
+ <button type="button" class="scalable " onclick="backup.requestPassword()"><span><?php echo $this->__('OK')?></span></button>
13
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
18
+
19
+ <div class="backup-dialog" style="display: none;" id="backup-warning">
20
+ <div class="entry-edit">
21
+ <div class="entry-edit-head">
22
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4>
23
+ </div>
24
+ <div class="content">
25
+ <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div>
26
+ <div><?php echo $this->__("The backup's creation process will take time.")?></div>
27
+ <div><?php echo $this->__('You will need to wait when the action ends.')?></div>
28
+ <div><?php echo $this->__('Do you really want to proceed?')?></div>
29
+ </div>
30
+ <div class="buttons-set">
31
+ <div class="f-right">
32
+ <button type="button" class="scalable " onclick="backup.requestBackupOptions()"><span><?php echo $this->__('OK')?></span></button>
33
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+
39
+ <div class="backup-dialog" style="display: none;" id="backup-options">
40
+ <div class="entry-edit">
41
+ <div class="entry-edit-head">
42
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Backup options') ?></h4>
43
+ </div>
44
+ <div class="content">
45
+ <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div>
46
+ <div><?php echo $this->__('Please specify backup creation options')?></div>
47
+ <form action="" method="post" id="backup-form" onsubmit="return backup.submitBackup();">
48
+ <table class="form-list question" cellspacing="0">
49
+ <tr>
50
+ <td style="padding-right: 8px;"><label for="backup_name" class="nobr"><?php echo $this->__('Backup Name')?></label></td>
51
+ <td>
52
+ <input type="text" name="backup_name" id="backup_name" class="validate-alphanum-with-spaces validate-length maximum-length-50" style="width: 343px" maxlength="50" />
53
+ <p class="note"><span><?php echo $this->__('Please use only letters (a-z or A-Z), numbers (0-9) or spaces in this field.'); ?></span></p>
54
+ </td>
55
+ </tr>
56
+ <tr>
57
+ <td>&nbsp;</td>
58
+ <td class="maintenance-checkbox-container">
59
+ <input type="checkbox" name="maintenance_mode" value="1" id="backup_maintenance_mode"/>
60
+ <label for="backup_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while backup creation')?></label>
61
+ </td>
62
+ </tr>
63
+ <tr id="exclude-media-checkbox-container" style="display: none;">
64
+ <td>&nbsp;</td>
65
+ <td>
66
+ <input type="checkbox" name="exclude_media" value="1" id="exclude_media"/>
67
+ <label for="exclude_media"><?php echo $this->__('Exclude media folder from backup')?></label>
68
+ </td>
69
+ </tr>
70
+ </table>
71
+ </form>
72
+ </div>
73
+ <div class="buttons-set">
74
+ <div class="f-right">
75
+ <button type="button" class="scalable " onclick="backup.submitBackup()"><span><?php echo $this->__('OK')?></span></button>
76
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+
82
+ <div class="backup-dialog" style="display: none;" id="rollback-request-password">
83
+ <div class="entry-edit">
84
+ <div class="entry-edit-head">
85
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Please enter password') ?></h4>
86
+ </div>
87
+ <div class="content">
88
+ <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div>
89
+ <div><?php echo $this->__('Please enter password to confirm rollback.')?></div>
90
+ <div><?php echo $this->__('This action cannot be undone.')?></div>
91
+ <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div>
92
+ <form action="" method="post" id="rollback-form" onsubmit="return backup.submitRollback();">
93
+ <div class="password-box-container">
94
+ <table class="form-list" cellspacing="0">
95
+ <tr>
96
+ <td style="padding-right: 8px;"><label for="password" class="nobr"><?php echo $this->__('User Password')?> <span class="required">*</span></label></td>
97
+ <td><input type="password" name="password" id="password" class="required-entry"></td>
98
+ </tr>
99
+ <tr>
100
+ <td>&nbsp;</td>
101
+ <td class="maintenance-checkbox-container">
102
+ <input type="checkbox" name="maintenance_mode" value="1" id="rollback_maintenance_mode"/>
103
+ <label for="rollback_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while rollback processing')?></label>
104
+ </td>
105
+ </tr>
106
+ <tr id="use-ftp-checkbox-row" style="display: none;">
107
+ <td>&nbsp;</td>
108
+ <td><input type="checkbox" name="use_ftp" value="1" id="use_ftp" onClick="backup.toggleFtpCredentialsForm();"/> <label for="use_ftp"><?php echo $this->__('Use FTP Connection')?></label></td>
109
+ </tr>
110
+ </table>
111
+ </div>
112
+ <div class="entry-edit" id="ftp-credentials-container" style="display: none;">
113
+ <div class="entry-edit-head">
114
+ <h4 class=""><?php echo $this->__('FTP credentials')?></h4>
115
+ </div>
116
+ <fieldset>
117
+ <table class="form-list" cellspacing="0">
118
+ <tr>
119
+ <td class="label"><label for="ftp_host"><?php echo $this->__('FTP Host')?> <span class="required">*</span></label></td>
120
+ <td class="value"><input type="text" name="ftp_host" id="ftp_host"></td>
121
+ </tr>
122
+ <tr>
123
+ <td class="label"><label for="ftp_user"><?php echo $this->__('FTP Login')?> <span class="required">*</span></label></td>
124
+ <td class="value"><input type="text" name="ftp_user" id="ftp_user"></td>
125
+ </tr>
126
+ <tr>
127
+ <td class="label"><label for="ftp_pass"><?php echo $this->__('FTP Password')?> <span class="required">*</span></label></td>
128
+ <td class="value"><input type="password" name="ftp_pass" id="ftp_pass"></td>
129
+ </tr>
130
+ <tr>
131
+ <td class="label"><label for="ftp_path"><?php echo $this->__('Magento root directory')?></label></td>
132
+ <td class="value"><input type="text" name="ftp_path" id="ftp_path"></td>
133
+ </tr>
134
+ </table>
135
+ </fieldset>
136
+ </div>
137
+ </form>
138
+ </div>
139
+ <div class="buttons-set">
140
+ <div class="f-right">
141
+ <button type="button" class="scalable " onclick="backup.submitRollback()"><span><?php echo $this->__('OK')?></span></button>
142
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+
148
+ <div id="popup-window-mask" style="display: none;"></div>
149
+
150
+ <?php
151
+ $helper = Mage::helper('backup');
152
+ $rollbackUrl = $this->getUrl('*/*/rollback');
153
+ $backupUrl = $this->getUrl('*/*/create');
154
+ ?>
155
+
156
+ <script type="text/javascript">
157
+ //<![CDATA[
158
+ document.observe('dom:loaded', function () {
159
+ backup = new AdminBackup();
160
+ backup.rollbackUrl = '<?php echo $helper->jsQuoteEscape($rollbackUrl);?>';
161
+ backup.backupUrl = '<?php echo $helper->jsQuoteEscape($backupUrl);?>';
162
+ });
163
+ //]]>
164
+ </script>
app/design/adminhtml/default/default/template/backup/left.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <h3><?php echo Mage::helper('backup')->__('Create Backup') ?></h3>
app/design/adminhtml/default/default/template/backup/list.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-backups-control"><?php echo Mage::helper('backup')->__('Backups') ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getCreateSnapshotButtonHtml(); ?>
33
+ <?php echo $this->getCreateMediaBackupButtonHtml(); ?>
34
+ <?php echo $this->getCreateButtonHtml(); ?>
35
+ </td>
36
+ </tr>
37
+ </table>
38
+ </div>
39
+ <?php echo $this->getGridHtml() ?>
40
+ <?php echo $this->getDialogsHtml() ?>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Bundle */ ?>
29
+ <?php $options = Mage::helper('core')->decorateArray($this->getOptions()); ?>
30
+ <?php if (count($options)): ?>
31
+ <div id="catalog_product_composite_configure_fields_bundle" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
32
+ <h4><?php echo Mage::helper('catalog')->__('Bundle Items') ?></h4>
33
+ <div class="product-options">
34
+ <dl>
35
+ <?php foreach ($options as $option) : ?>
36
+ <?php if ($option->getSelections()) : ?>
37
+ <?php echo $this->getOptionHtml($option); ?>
38
+ <?php endif; ?>
39
+ <?php endforeach; ?>
40
+ </dl>
41
+ </div>
42
+ </div>
43
+
44
+ <script>
45
+ var BundleControl = Class.create();
46
+ BundleControl.prototype = {
47
+ initialize: function (config) {
48
+ this.config = config;
49
+ },
50
+
51
+ changeSelection: function (selection) {
52
+ if (selection.multiple) {
53
+ return;
54
+ }
55
+ var parts = selection.id.split('-'), optionId = parts[2],
56
+ showQtyInput = selection.value && selection.value != 'none',
57
+ options = this.config.options[optionId],
58
+ selectionOptions = options && options.selections && options.selections[selection.value] || {};
59
+
60
+ selectionOptions.can_change_qty = Number(selectionOptions.can_change_qty) && showQtyInput;
61
+ this.updateQtyInput(optionId, selectionOptions);
62
+ },
63
+
64
+ updateQtyInput: function(optionId, selectionOptions) {
65
+ var elem = $('bundle-option-' + optionId + '-qty-input'),
66
+ default_qty = Number(selectionOptions.default_qty);
67
+ if (!elem) {
68
+ return;
69
+ }
70
+ if (selectionOptions.can_change_qty) {
71
+ elem.removeClassName('qty-disabled');
72
+ elem.disabled = false;
73
+ if (elem.value == '0') {
74
+ elem.value = default_qty || 1;
75
+ }
76
+ } else {
77
+ elem.addClassName('qty-disabled');
78
+ elem.disabled = true;
79
+ elem.value = default_qty || 0;
80
+ }
81
+ },
82
+
83
+ updateForDefaults: function () {
84
+ for (var optionId in this.config.options) {
85
+ var selection = $('bundle-option-' + optionId);
86
+ if (selection) {
87
+ this.changeSelection(selection);
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ProductConfigure.bundleControl = new BundleControl(<?php echo $this->getJsonConfig() ?>);
93
+ </script>
94
+
95
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/checkbox.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Checkbox */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
32
+ <dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt>
33
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
34
+ <div class="input-box">
35
+ <?php if (count($_selections) == 1 && $_option->getRequired()): ?>
36
+ <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
37
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"'/>
38
+ <?php else:?>
39
+ <ul class="options-list">
40
+ <?php foreach($_selections as $_selection): ?>
41
+ <li><input class="change-container-classname checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" type="checkbox" name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>"/>
42
+ <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection) ?></label></span>
43
+ <?php if($_option->getRequired()): ?>
44
+ <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
45
+ <?php endif; ?>
46
+ </li>
47
+ <?php endforeach; ?>
48
+ </ul>
49
+ <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
50
+ <?php endif; ?>
51
+ </div>
52
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/multi.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Multi */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
32
+ <dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt>
33
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
34
+ <div class="input-box">
35
+ <?php if (count($_selections) == 1 && $_option->getRequired()): ?>
36
+ <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
37
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/>
38
+ <?php else: ?>
39
+ <select multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>][]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select multiselect change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)">
40
+ <?php if(!$_option->getRequired()): ?>
41
+ <option value=""><?php echo $this->__('None') ?></option>
42
+ <?php endif; ?>
43
+ <?php foreach ($_selections as $_selection): ?>
44
+ <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection, false) ?></option>
45
+ <?php endforeach; ?>
46
+ </select>
47
+ <?php endif; ?>
48
+ </div>
49
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/radio.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Radio */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_default = $_option->getDefaultSelection(); ?>
32
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
33
+ <?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
34
+
35
+ <dt>
36
+ <span class="qty-holder">
37
+ <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?>&nbsp;</label><input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
38
+ </span>
39
+ <label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
40
+ </dt>
41
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
42
+ <div class="input-box">
43
+ <?php if ($this->_showSingle()): ?>
44
+ <?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
45
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>" />
46
+ <?php else:?>
47
+ <ul class="options-list">
48
+ <?php if (!$_option->getRequired()): ?>
49
+ <li><input type="radio" class="radio" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php echo ($_default && $_default->isSalable())?'':' checked="checked" ' ?> value="" onclick="ProductConfigure.bundleControl.changeSelection(this)"/>
50
+ <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>"><?php echo $this->__('None') ?></label></span>
51
+ </li>
52
+ <?php endif; ?>
53
+ <?php foreach ($_selections as $_selection): ?>
54
+ <li><input type="radio" class="radio<?php echo $_option->getRequired()?' validate-one-required-by-name':'' ?> change-container-classname" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?>value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"/>
55
+ <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionTitlePrice($_selection) ?></label></span>
56
+ <?php if ($_option->getRequired()): ?>
57
+ <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
58
+ <?php endif; ?>
59
+ </li>
60
+ <?php endforeach; ?>
61
+ </ul>
62
+ <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
63
+ <?php endif; ?>
64
+ </div>
65
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/select.phtml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Select */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_default = $_option->getDefaultSelection(); ?>
32
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
33
+ <?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
34
+
35
+ <dt>
36
+ <span class="qty-holder">
37
+ <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?>&nbsp;</label><input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
38
+ </span>
39
+ <label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
40
+ </dt>
41
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
42
+ <div class="input-box">
43
+ <?php if ($this->_showSingle()): ?>
44
+ <?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
45
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/>
46
+ <?php else:?>
47
+ <select id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)">
48
+ <option value=""><?php echo $this->__('Choose a selection...') ?></option>
49
+ <?php foreach ($_selections as $_selection): ?>
50
+ <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option>
51
+ <?php endforeach; ?>
52
+ </select>
53
+ <?php endif; ?>
54
+ </div>
55
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle.phtml ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ if(typeof Bundle=='undefined') {
29
+ Bundle = {};
30
+ }
31
+ </script>
32
+
33
+ <div class="entry-edit">
34
+ <div class="entry-edit-head">
35
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('bundle')->__('Shipment') ?></h4>
36
+ </div>
37
+ <fieldset>
38
+ <table cellspacing="0" class="form-list">
39
+ <tr>
40
+ <td class="label"><label for="shipment_type"><?php echo Mage::helper('bundle')->__('Ship Bundle Items') ?></label></td>
41
+ <td class="value"><select <?php if ($this->isReadonly()): ?>disabled="disabled" <?php endif;?>id="shipment_type" name="<?php echo $this->getFieldSuffix() ?>[shipment_type]" class="select">
42
+ <option value="1"><?php echo Mage::helper('bundle')->__('Separately') ?></option>
43
+ <option value="0"<?php if ($this->getProduct()->getShipmentType() == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('bundle')->__('Together') ?></option>
44
+ </select>
45
+ </td>
46
+ </tr>
47
+ </table>
48
+ </fieldset>
49
+ </div>
50
+
51
+ <div class="entry-edit custom-options bundle" id="product_bundle_container">
52
+ <div class="entry-edit-head">
53
+ <h4><?php echo $this->__('Bundle Items') ?></h4>
54
+ <div class="right"><?php echo $this->getAddButtonHtml() ?></div>
55
+ </div>
56
+
57
+ <div id="product_options_container" class="box">
58
+ <div id="product_bundle_container_top"></div>
59
+ <?php echo $this->getOptionsBoxHtml() ?>
60
+ </div>
61
+ </div>
62
+
63
+ <script type="text/javascript">
64
+ // re-bind form elements onchange
65
+ varienWindowOnload(true);
66
+ <?php if ($this->isReadonly()):?>
67
+ $('product_bundle_container').select('input', 'select', 'textarea', 'button').each(function(input){
68
+ input.disabled = true;
69
+ if (input.tagName.toLowerCase() == 'button') {
70
+ input.addClassName('disabled');
71
+ }
72
+ });
73
+ <?php endif; ?>
74
+ </script>
75
+
76
+ <div><input type="hidden" name="affect_bundle_product_selections" value="1" /></div>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="option-box"> ' +
29
+ '<div class="option-title"> ' +
30
+ '<label for="<?php echo $this->getFieldName() ?>[{{index}}][title]"><?php echo Mage::helper('bundle')->__('Default Title') ?> <span class="required">*</span></label>' +
31
+ <?php if ($this->isDefaultStore()): ?>
32
+ '<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
33
+ <?php else: ?>
34
+ '<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
35
+ <?php endif; ?>
36
+ '<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
37
+ '</div>' +
38
+ '<table class="option-header" cellpadding="0" cellspacing="0">' +
39
+ '<thead>' +
40
+ '<tr>' +
41
+ <?php if (!$this->isDefaultStore()): ?>
42
+ '<th class="opt-title"><?php echo Mage::helper('bundle')->__('Store View Title') ?> <span class="required">*</span></th>' +
43
+ <?php endif; ?>
44
+ '<th class="opt-type"><?php echo Mage::helper('bundle')->__('Input Type') ?></th>' +
45
+ '<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Is Required')) ?></th>' +
46
+ '<th class="opt-order"><?php echo Mage::helper('bundle')->__('Position') ?></th>' +
47
+ '<th>&nbsp;</th>' +
48
+ '</tr>' +
49
+ '</thead>' +
50
+ '<tbody>' +
51
+ '<tr>' +
52
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{index}}][option_id]" value="{{option_id}}">' +
53
+ '<input type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][delete]" value="" class="delete">' +
54
+ <?php if (!$this->isDefaultStore()): ?>
55
+ '<td><input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title_store" value="{{title}}"></td>' +
56
+ <?php endif; ?>
57
+ '<td><?php echo $this->getTypeSelectHtml() ?></td>' +
58
+ '<td><?php echo $this->getRequireSelectHtml() ?></td>' +
59
+ '<td><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][position]" value="{{position}}"></td>' +
60
+ '<td>&nbsp;<?php echo $this->jsQuoteEscape($this->getAddSelectionButtonHtml()) ?></td>' +
61
+ '</tr>' +
62
+ '</tbody>' +
63
+ '</table>' +
64
+ '<div id="<?php echo $this->getFieldId() ?>_search_{{index}}">' +
65
+ '</div>' +
66
+ '</div>';
67
+ </script>
68
+
69
+ <?php echo $this->getSelectionHtml() ?>
70
+
71
+ <script type="text/javascript">
72
+
73
+ function changeInputType(oldObject, oType) {
74
+ var newObject = document.createElement('input');
75
+ newObject.type = oType;
76
+ if(oldObject.size) newObject.size = oldObject.size;
77
+ if(oldObject.value) newObject.value = oldObject.value;
78
+ if(oldObject.name) newObject.name = oldObject.name;
79
+ if(oldObject.id) newObject.id = oldObject.id;
80
+ if(oldObject.onclick) newObject.onclick = oldObject.onclick;
81
+ if(oldObject.className) newObject.className = oldObject.className;
82
+ oldObject.parentNode.replaceChild(newObject,oldObject);
83
+ return newObject;
84
+ }
85
+
86
+ Bundle.Option = Class.create();
87
+ Bundle.Option.prototype = {
88
+ idLabel : '<?php echo $this->getFieldId() ?>',
89
+ top : '',
90
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
91
+ templateText : '',
92
+ itemsCount : 0,
93
+ initialize : function(template) {
94
+ this.templateText = template;
95
+ this.top = $('product_bundle_container_top');
96
+ },
97
+
98
+ add : function(data) {
99
+ if(!data){
100
+ data = {};
101
+ this.top = $('product_bundle_container_top');
102
+ } else {
103
+ data.title = data.title.replace('"', "&quot;");
104
+ }
105
+
106
+ data.index = this.itemsCount++;
107
+
108
+ this.template = new Template(this.templateText, this.templateSyntax);
109
+
110
+ Element.insert(this.top, {'after':this.template.evaluate(data)});
111
+
112
+ this.top = $(this.idLabel + '_' + data.index);
113
+
114
+ //set selected type
115
+ if (data.type) {
116
+ $A($(this.idLabel + '_'+data.index+'_type').options).each(function(option){
117
+ if (option.value==data.type) option.selected = true;
118
+ });
119
+ }
120
+
121
+ //set selected is_require
122
+ if (data.required) {
123
+ $A($(this.idLabel + '_'+data.index+'_required').options).each(function(option){
124
+ if (option.value==data.required) option.selected = true;
125
+ });
126
+ }
127
+ // rebind change notifications
128
+ varienWindowOnload(true);
129
+
130
+ return data.index;
131
+ },
132
+
133
+ remove : function(event){
134
+ var element = $(Event.findElement(event, 'div')).parentNode;
135
+ if(element){
136
+ Element.select(element, '.delete').each(function(elem){elem.value='1'});
137
+ Element.select(element, ['input', 'select']).each(function(elem){elem.hide(); elem.className = '';});
138
+ Element.hide(element);
139
+ }
140
+ },
141
+
142
+ changeType : function(event) {
143
+ var element = Event.element(event);
144
+ parts = element.id.split('_');
145
+ i = parts[2];
146
+ if (element.value == 'multi' || element.value == 'checkbox') {
147
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' tr.selection input.default'));
148
+ inputs.each(
149
+ function(elem){
150
+ //elem.type = "checkbox";
151
+ changeInputType(elem, 'checkbox');
152
+ }
153
+ );
154
+ /**
155
+ * Hide not needed elements (user defined qty select box)
156
+ */
157
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' .qty-box'));
158
+ inputs.each(
159
+ function(elem){
160
+ elem.hide();
161
+ }
162
+ );
163
+
164
+ } else {
165
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' tr.selection input.default'));
166
+ have = false;
167
+ for (j=0; j< inputs.length; j++) {
168
+ //inputs[j].type = "radio";
169
+ changeInputType(inputs[j], 'radio');
170
+ if (inputs[j].checked && have) {
171
+ inputs[j].checked = false;
172
+ } else {
173
+ have = true;
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Show user defined select box
179
+ */
180
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' .qty-box'));
181
+ inputs.each(
182
+ function(elem){
183
+ elem.show();
184
+ }
185
+ );
186
+ }
187
+ },
188
+
189
+ priceTypeFixed : function() {
190
+ inputs = $A($$('.price-type-box'));
191
+ inputs.each(
192
+ function(elem){
193
+ elem.show();
194
+ }
195
+ );
196
+ },
197
+
198
+ priceTypeDynamic : function() {
199
+ inputs = $A($$('.price-type-box'));
200
+ inputs.each(
201
+ function(elem){
202
+ elem.hide();
203
+ }
204
+ );
205
+ }
206
+ }
207
+
208
+ var optionIndex = 0;
209
+ bOption = new Bundle.Option(optionTemplate);
210
+ //adding data to templates
211
+ <?php foreach ($this->getOptions() as $_option): ?>
212
+ optionIndex = bOption.add(<?php echo $_option->toJson() ?>);
213
+ <?php if ($_option->getSelections()):?>
214
+ <?php foreach ($_option->getSelections() as $_selection): ?>
215
+ <?php $_selection->setName($this->escapeHtml($_selection->getName())); ?>
216
+ bSelection.addRow(optionIndex, <?php echo $_selection->toJson() ?>);
217
+ <?php endforeach; ?>
218
+ <?php endif; ?>
219
+ <?php endforeach; ?>
220
+ /**
221
+ * Adding event on price type select box of product to hide or show prices for selections
222
+ */
223
+ function togglePriceType() {
224
+ if ($('price_type').value == '1') {
225
+ bOption.priceTypeFixed();
226
+ } else {
227
+ bOption.priceTypeDynamic();
228
+ }
229
+ }
230
+
231
+ togglePriceType();
232
+
233
+ Event.observe('price_type', 'change', togglePriceType);
234
+
235
+ </script>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/search.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <div style="float: right;"><?php echo $this->getButtonsHtml() ?></div>
30
+ <h4 class="fieldset-legend <?php echo ($this->getHeaderCssClass()) ? $this->getHeaderCssClass().' icon-head' : '' ?>"><?php echo $this->getHeaderText() ?></h4>
31
+ </div>
32
+ <fieldset>
33
+ <?php echo $this->getChildHtml() ?>
34
+ </fieldset>
35
+ </div>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/selection.phtml ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+
30
+ var bundleTemplateBox = '<table class="border" cellpadding="0" cellspacing="0">' +
31
+ ' <thead>' +
32
+ ' <tr class="headings">' +
33
+ ' <th><?php echo Mage::helper('catalog')->__('Name') ?></th>' +
34
+ <?php if ($this->getCanReadPrice() !== false) : ?>
35
+ ' <th class="type-price price-type-box"><?php echo Mage::helper('catalog')->__('Price') ?></th>' +
36
+ ' <th class="type-type price-type-box"><?php echo Mage::helper('bundle')->__('Price Type') ?></th>' +
37
+ <?php endif; ?>
38
+ ' <th class="type-price"><?php echo Mage::helper('bundle')->__('Default Qty') ?></th>' +
39
+ ' <th class="type-uqty qty-box"><?php echo$this->jsQuoteEscape(Mage::helper('bundle')->__('User Defined Qty')) ?></th>' +
40
+ ' <th class="type-order"><?php echo Mage::helper('bundle')->__('Position') ?></th>' +
41
+ ' <th style="width:1px"><?php echo Mage::helper('bundle')->__('Default') ?></th>' +
42
+ ' <th class="last">&nbsp;</th>' +
43
+ ' </tr>' +
44
+ ' </thead> ' +
45
+ ' <tbody>' +
46
+ ' </tbody>' +
47
+ '</table>';
48
+
49
+ var bundleTemplateRow ='<td>' +
50
+ ' <input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][selection_id]" value="{{selection_id}}">' +
51
+ ' <input type="hidden" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][option_id]" value="{{option_id}}">' +
52
+ ' <input type="hidden" class="product" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][product_id]" value="{{product_id}}">' +
53
+ ' <input type="hidden" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][delete]" value="" class="delete">' +
54
+ ' {{name}}<br />' +
55
+ ' <div class="nobr">' +
56
+ ' <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> {{sku}}' +
57
+ ' </div>' +
58
+ '</td>' +
59
+ <?php if ($this->getCanReadPrice() !== false) : ?>
60
+ '<td class="price-type-box"><input id="<?php echo $this->getFieldId() ?>_{{index}}_price_value" class="input-text required-entry validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][selection_price_value]" value="{{selection_price_value}}"<?php if($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' +
61
+ '<td class="price-type-box"><?php echo $this->getPriceTypeSelectHtml() ?><div><?php echo $this->getCheckboxScopeHtml() ?></div></td>' +
62
+ <?php else : ?>
63
+ '<input type="hidden" id="<?php echo $this->getFieldId(); ?>_{{index}}_price_value" name="<?php echo $this->getFieldName(); ?>[{{parentIndex}}][{{index}}][selection_price_value]" value="0" />' +
64
+ '<input type="hidden" id="<?php echo $this->getFieldId(); ?>_{{index}}_price_type" name="<?php echo $this->getFieldName(); ?>[{{parentIndex}}][{{index}}][selection_price_type]" value="0" />' +
65
+ <?php if ($this->isUsedWebsitePrice()): ?>
66
+ '<input type="hidden" id="<?php echo $this->getFieldId(); ?>_{{index}}_price_scope" name="<?php echo $this->getFieldName(); ?>[{{parentIndex}}][{{index}}][default_price_scope]" value="1" />' +
67
+ <?php endif; ?>
68
+ <?php endif; ?>
69
+ '<td><input class="input-text required-entry validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][selection_qty]" value="{{selection_qty}}"></td>' +
70
+ '<td class="qty-box"><?php echo $this->getQtyTypeSelectHtml() ?></td>' +
71
+ '<td><input class="input-text required-entry validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][position]" value="{{position}}"></td>' +
72
+ '<td class="a-center"><input onclick="bSelection.checkGroup(event)" type="{{option_type}}" class="default" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][is_default]" value="1" {{checked}}></td>' +
73
+ '<td class="last"><span title="Delete Row"><?php echo $this->getSelectionDeleteButtonHtml() ?></span></td>';
74
+
75
+ Bundle.Selection = Class.create();
76
+ Bundle.Selection.prototype = {
77
+ idLabel : '<?php echo $this->getFieldId() ?>',
78
+ scopePrice : <?php echo (int)$this->isUsedWebsitePrice() ?>,
79
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
80
+ templateBox : '',
81
+ templateRow : '',
82
+ itemsCount : 0,
83
+ row : null,
84
+ gridSelection : new Hash(),
85
+
86
+ initialize : function() {
87
+ this.templateBox = '<div class="grid tier form-list" id="' + this.idLabel + '_box_{{parentIndex}}">' + bundleTemplateBox + '</div>';
88
+
89
+ this.templateRow = '<tr class="selection" id="' + this.idLabel + '_row_{{index}}">' + bundleTemplateRow + '</tr>';
90
+ },
91
+
92
+ showSearch : function(event) {
93
+ var element = Event.findElement(event, 'div');
94
+ var parts = element.id.split('_');
95
+
96
+ var products = new Array();
97
+
98
+ var inputs = $A($$('#' + element.id + ' tr.selection input.product'));
99
+ for (i=0; i<inputs.length; i++) {
100
+ products.push(inputs[i].value);
101
+ }
102
+
103
+ this.gridSelection.set(parts[2], $H({}));
104
+
105
+ new Ajax.Updater(bOption.idLabel + '_search_' + parts[2], '<?php echo $this->getSelectionSearchUrl() ?>', {
106
+ method: 'post',
107
+ parameters : {'index' : parts[2], 'products[]' : products, 'form_key': FORM_KEY},
108
+ evalScripts : true
109
+ });
110
+
111
+ if (Event.element(event).tagName.toLowerCase() != 'button') {
112
+ var button = Event.element(event).up('button');
113
+ } else {
114
+ var button = Event.element(event);
115
+ }
116
+ button.hide();
117
+ },
118
+
119
+ addRow : function (parentIndex, data) {
120
+ var box = null;
121
+ if (!(box = $(this.idLabel + '_box_' + parentIndex))) {
122
+ this.addBox(parentIndex);
123
+ box = $(this.idLabel + '_box_' + parentIndex);
124
+ } else {
125
+ box.show();
126
+ }
127
+
128
+ var option_type = $(bOption.idLabel + '_' + parentIndex + '_type');
129
+
130
+ if(!data){
131
+ var data = {};
132
+ }
133
+
134
+ if (data.can_read_price != undefined && !data.can_read_price) {
135
+ data.selection_price_value = '';
136
+ } else {
137
+ data.selection_price_value = Number(data.selection_price_value).toFixed(2);
138
+ }
139
+
140
+ data.index = this.itemsCount++;
141
+ data.parentIndex = parentIndex;
142
+
143
+ if (option_type.value == 'multi' || option_type.value == 'checkbox') {
144
+ data.option_type = 'checkbox';
145
+ } else {
146
+ data.option_type = 'radio';
147
+ }
148
+
149
+ if (data.is_default == 1) {
150
+ data.checked = 'checked="checked"';
151
+ }
152
+
153
+ this.template = new Template(this.templateRow, this.templateSyntax);
154
+ var tbody = $$('#' + this.idLabel + '_box_' + parentIndex + ' tbody');
155
+
156
+ Element.insert(tbody[0], {'bottom':this.template.evaluate(data)});
157
+
158
+ if (data.selection_price_type) {
159
+ $A($(this.idLabel + '_'+data.index+'_price_type').options).each(function(option){
160
+ if (option.value==data.selection_price_type) option.selected = true;
161
+ });
162
+ }
163
+
164
+ if (data.selection_price_type) {
165
+ $A($(this.idLabel + '_'+data.index+'_can_change_qty').options).each(function(option){
166
+ if (option.value==data.selection_can_change_qty) option.selected = true;
167
+ });
168
+ }
169
+
170
+ var checkbox = $(this.idLabel + '_'+data.index+'_price_scope');
171
+ if (checkbox && this.scopePrice) {
172
+ if (data.price_scope === undefined) {
173
+ checkbox.up().hide();
174
+ } else if(!data.price_scope) {
175
+ checkbox.checked = true;
176
+ this.addScope(null, checkbox);
177
+ }
178
+ }
179
+
180
+ this.bindScopeCheckbox();
181
+
182
+ if (option_type.value == 'multi' || option_type.value == 'checkbox') {
183
+ /**
184
+ * Hide not needed elements (user defined qty select box)
185
+ */
186
+ inputs = $A($$('#' + this.idLabel + '_box_' + data.parentIndex + ' .qty-box'));
187
+ inputs.each(
188
+ function(elem){
189
+ elem.hide();
190
+ }
191
+ );
192
+ }
193
+
194
+ if (!$('price_type') || $('price_type').value != '1') {
195
+ /**
196
+ * Hide not needed elements (price type select and price input)
197
+ */
198
+ inputs = $A($$('#' + this.idLabel + '_box_' + data.parentIndex + ' .price-type-box'));
199
+ inputs.each(
200
+ function(elem){
201
+ elem.hide();
202
+ }
203
+ );
204
+ }
205
+ },
206
+
207
+ bindScopeCheckbox : function(){
208
+ var checkboxes = $$('.bundle-option-price-scope-checkbox');
209
+ for (var i=0;i<checkboxes.length;i++) {
210
+ if (!$(checkboxes[i]).binded) {
211
+ $(checkboxes[i]).binded = true;
212
+ Event.observe(checkboxes[i], 'click', this.addScope.bind(this));
213
+ }
214
+ }
215
+ },
216
+
217
+ addScope : function(event, element){
218
+ if (element == undefined) {
219
+ element = $(Event.element(event));
220
+ }
221
+ var priceValue = $(element.id.sub('scope', 'value'));
222
+ var priceType = $(element.id.sub('scope', 'type'));
223
+
224
+ if (element.checked) {
225
+ priceValue.disable();
226
+ priceType.disable();
227
+ } else {
228
+ priceValue.enable();
229
+ priceType.enable();
230
+ }
231
+ },
232
+
233
+ addBox : function (parentIndex) {
234
+ var div = $(bOption.idLabel + '_' + parentIndex)
235
+ this.template = new Template(this.templateBox, this.templateSyntax);
236
+ var data = {'parentIndex' : parentIndex};
237
+ Element.insert(div, {'bottom':this.template.evaluate(data)});
238
+ },
239
+
240
+ remove : function(event) {
241
+ var element = Event.findElement(event, 'tr');
242
+ var container = Event.findElement(event, 'div');
243
+
244
+ if (element) {
245
+ Element.select(element, '.delete').each(function(elem){elem.value='1'});
246
+ Element.select(element, ['input', 'select']).each(function(elem){elem.hide()});
247
+ Element.removeClassName(element, 'selection');
248
+ Element.hide(element);
249
+
250
+ if (container) {
251
+ if ($$('#' + container.id + ' tr.selection')) {
252
+ if (!$$('#' + container.id + ' tr.selection').length) {
253
+ container.hide();
254
+ }
255
+ }
256
+ }
257
+ }
258
+ },
259
+
260
+ checkGroup : function(event) {
261
+ var element = Event.element(event);
262
+ if (element.type == 'radio') {
263
+ var box = element.up('div');
264
+
265
+ var inputs = $$('div#' + box.id + ' input.default');
266
+ if (inputs) {
267
+ for (i=0; i< inputs.length; i++) {
268
+ if (inputs[i].name != element.name) {
269
+ inputs[i].checked = false;
270
+ }
271
+ }
272
+ }
273
+ }
274
+ },
275
+
276
+ productGridAddSelected : function(event) {
277
+ var element = Event.findElement(event, 'button');
278
+ var parts = element.id.split('_');
279
+
280
+ $(bOption.idLabel + '_search_' + parts[2]).innerHTML = '';
281
+ $(bOption.idLabel + '_' + parts[2] + '_add_button').show();
282
+
283
+ this.gridSelection.get(parts[2]).each(
284
+ function(pair) {
285
+ var qty = pair.value.get('qty');
286
+ var data = {
287
+ 'name' : pair.value.get('name'),
288
+ 'selection_price_value' : 0,
289
+ 'selection_qty' : (qty == '' ? 1 : qty),
290
+ 'sku' : pair.value.get('sku'),
291
+ 'position' : 0,
292
+ 'product_id' : pair.key,
293
+ 'option_id' : $(bOption.idLabel + '_id_' + parts[2]).value
294
+ };
295
+ bSelection.addRow(parts[2], data);
296
+ }
297
+ );
298
+ },
299
+
300
+ productGridRowInit : function(grid, row){
301
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
302
+ var inputs = $(row).getElementsByClassName('input-text');
303
+ for (var i = 0; i < inputs.length; i++) {
304
+ inputs[i].checkbox = checkbox;
305
+ Event.observe(inputs[i], 'keyup', this.productGridRowInputChange.bind(this));
306
+ Event.observe(inputs[i], 'change', this.productGridRowInputChange.bind(this));
307
+ }
308
+ },
309
+
310
+ productGridCheckboxCheck : function(grid, element, checked) {
311
+ var id = element.up('table').id.split('_')[4];
312
+ if (element.value > 0) {
313
+ if (element.checked) {
314
+ var tr = element.parentNode.parentNode;
315
+ if (!this.gridSelection.get(id)) {
316
+ this.gridSelection.set(id, new Hash());
317
+ }
318
+ this.gridSelection.get(id).set(element.value, $H({}));
319
+ this.gridSelection.get(id).get(element.value).set('name', tr.select('td.name')[0].innerHTML);
320
+ this.gridSelection.get(id).get(element.value).set('qty', tr.select('input.qty')[0].value);
321
+ this.gridSelection.get(id).get(element.value).set('sku', tr.select('td.sku')[0].innerHTML);
322
+ } else {
323
+ this.gridSelection.get(id).unset(element.value);
324
+ }
325
+ }
326
+ },
327
+
328
+ productGridRowClick : function(grid, event) {
329
+ var trElement = Event.findElement(event, 'tr');
330
+ var isInput = Event.element(event).tagName == 'INPUT';
331
+ if (trElement) {
332
+ var checkbox = Element.select(trElement, 'input');
333
+ if (checkbox[0]) {
334
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
335
+ grid.setCheckboxChecked(checkbox[0], checked);
336
+ }
337
+ }
338
+ },
339
+
340
+ productGridRowInputChange : function(event) {
341
+ var element = Event.element(event);
342
+ if (!element.checkbox.checked) {
343
+ return;
344
+ }
345
+ var id = element.up('table').id.split('_')[4];
346
+ this.gridSelection.get(id).get(element.checkbox.value).set('qty', element.value);
347
+ }
348
+ }
349
+
350
+ bSelection = new Bundle.Selection();
351
+ //]]>
352
+ </script>
app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml ADDED
@@ -0,0 +1,411 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
49
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td>&nbsp;</td>
59
+ <td>&nbsp;</td>
60
+ <td class="last">&nbsp;</td>
61
+ </tr>
62
+ <?php $_prevOptionId = $attributes['option_id'] ?>
63
+ <?php endif; ?>
64
+ <?php endif; ?>
65
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
66
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
67
+ <td><h5 class="title"><?php echo $this->htmlEscape($_item->getName()) ?></h5>
68
+ <div>
69
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
70
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($_item->getSku()))); ?>
71
+ </div>
72
+ </td>
73
+ <?php else: ?>
74
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
75
+ <?php endif; ?>
76
+ <td class="a-right">
77
+ <?php if ($this->canShowPriceInfo($_item)): ?>
78
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
79
+ <span class="price-excl-tax">
80
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
81
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
82
+ <?php endif; ?>
83
+
84
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
85
+ <?php
86
+ echo $this->displayPrices(
87
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
88
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
89
+ );
90
+ ?>
91
+ <?php else: ?>
92
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
93
+ <?php endif; ?>
94
+
95
+
96
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
97
+ <br />
98
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
99
+ <small>
100
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
101
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
102
+ <?php endforeach; ?>
103
+ </small>
104
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
105
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
106
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
107
+ <?php endforeach; ?>
108
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
109
+ <small>
110
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
111
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
112
+ <?php endforeach; ?>
113
+ </small>
114
+ <?php endif; ?>
115
+
116
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
117
+ <br />
118
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
119
+ <?php
120
+ echo $this->displayPrices(
121
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
122
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
123
+ );
124
+ ?>
125
+ </span>
126
+ <?php endif; ?>
127
+ <?php endif; ?>
128
+ </span>
129
+ <br />
130
+ <?php endif; ?>
131
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
132
+ <span class="price-incl-tax">
133
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
134
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
135
+ <?php endif; ?>
136
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
137
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
138
+
139
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
140
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?>
141
+ <?php else: ?>
142
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
143
+ <?php endif; ?>
144
+
145
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
146
+ <br />
147
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
148
+ <small>
149
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
150
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
151
+ <?php endforeach; ?>
152
+ </small>
153
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
154
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
155
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
156
+ <?php endforeach; ?>
157
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
158
+ <small>
159
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
160
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
161
+ <?php endforeach; ?>
162
+ </small>
163
+ <?php endif; ?>
164
+
165
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
166
+ <br />
167
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
168
+ <?php endif; ?>
169
+ <?php endif; ?>
170
+ </span>
171
+ <?php endif; ?>
172
+ <?php else: ?>
173
+ &nbsp;
174
+ <?php endif; ?>
175
+ </td>
176
+ <td>
177
+ <?php if ($this->canShowPriceInfo($_item)): ?>
178
+ <table cellspacing="0" class="qty-table">
179
+ <tr>
180
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
181
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
182
+ </tr>
183
+ <?php if ((float) $_item->getOrderItem()->getQtyInvoiced()): ?>
184
+ <tr>
185
+ <td><?php echo Mage::helper('sales')->__('Invoiced') ?></td>
186
+ <td><strong><?php echo $_item->getOrderItem()->getQtyInvoiced()*1 ?></strong></td>
187
+ </tr>
188
+ <?php endif; ?>
189
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped() && $this->isShipmentSeparately($_item)): ?>
190
+ <tr>
191
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
192
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
193
+ </tr>
194
+ <?php endif; ?>
195
+ <?php if ((float) $_item->getOrderItem()->getQtyRefunded()): ?>
196
+ <tr>
197
+ <td><?php echo Mage::helper('sales')->__('Refunded') ?></td>
198
+ <td><strong><?php echo $_item->getOrderItem()->getQtyRefunded()*1 ?></strong></td>
199
+ </tr>
200
+ <?php endif; ?>
201
+ <?php if ((float) $_item->getOrderItem()->getQtyCanceled()): ?>
202
+ <tr>
203
+ <td><?php echo Mage::helper('sales')->__('Canceled') ?></td>
204
+ <td><strong><?php echo $_item->getOrderItem()->getQtyCanceled()*1 ?></strong></td>
205
+ </tr>
206
+ <?php endif; ?>
207
+ </table>
208
+ <?php elseif ($this->isShipmentSeparately($_item)): ?>
209
+ <table cellspacing="0" class="qty-table">
210
+ <tr>
211
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
212
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
213
+ </tr>
214
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped()): ?>
215
+ <tr>
216
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
217
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
218
+ </tr>
219
+ <?php endif; ?>
220
+ </table>
221
+ <?php else: ?>
222
+ &nbsp;
223
+ <?php endif; ?>
224
+ </td>
225
+ <?php if ($this->canParentReturnToStock($_item)) : ?>
226
+ <td class="a-center">
227
+ <?php if ($this->canShowPriceInfo($_item)): ?>
228
+ <?php if ($this->canReturnItemToStock($_item)) : ?>
229
+ <input type="checkbox" name="creditmemo[items][<?php echo $_item->getOrderItemId() ?>][back_to_stock]" value="1"<?php if ($_item->getBackToStock()):?> checked="checked"<?php endif;?> />
230
+ <?php endif; ?>
231
+ <?php else: ?>
232
+ &nbsp;
233
+ <?php endif; ?>
234
+ </td>
235
+ <?php endif; ?>
236
+ <td class="a-center">
237
+ <?php if ($this->canShowPriceInfo($_item)): ?>
238
+ <?php if ($this->canEditQty()) : ?>
239
+ <input type="text" class="input-text qty-input" name="creditmemo[items][<?php echo $_item->getOrderItemId() ?>][qty]" value="<?php echo $_item->getQty()*1 ?>" />
240
+ <?php else: ?>
241
+ <?php echo $_item->getQty()*1 ?>
242
+ <?php endif; ?>
243
+ <?php else: ?>
244
+ &nbsp;
245
+ <?php endif; ?>
246
+ </td>
247
+ <td class="a-right">
248
+ <?php if ($this->canShowPriceInfo($_item)): ?>
249
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
250
+ <span class="price-excl-tax">
251
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
252
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
253
+ <?php endif; ?>
254
+
255
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
256
+ <?php
257
+ echo $this->displayPrices(
258
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
259
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
260
+ );
261
+ ?>
262
+ <?php else: ?>
263
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
264
+ <?php endif; ?>
265
+
266
+
267
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
268
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
269
+ <small>
270
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
271
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
272
+ <?php endforeach; ?>
273
+ </small>
274
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
275
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
276
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
277
+ <?php endforeach; ?>
278
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
279
+ <small>
280
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
281
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
282
+ <?php endforeach; ?>
283
+ </small>
284
+ <?php endif; ?>
285
+
286
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
287
+ <br />
288
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
289
+ <?php
290
+ echo $this->displayPrices(
291
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
292
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
293
+ );
294
+ ?>
295
+ </span>
296
+ <?php endif; ?>
297
+ <?php endif; ?>
298
+ </span>
299
+ <br />
300
+ <?php endif; ?>
301
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
302
+ <span class="price-incl-tax">
303
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
304
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
305
+ <?php endif; ?>
306
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
307
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
308
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
309
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
310
+ <?php else: ?>
311
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
312
+ <?php endif; ?>
313
+
314
+
315
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
316
+
317
+ <br />
318
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
319
+ <small>
320
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
321
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
322
+ <?php endforeach; ?>
323
+ </small>
324
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
325
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
326
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
327
+ <?php endforeach; ?>
328
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
329
+ <small>
330
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
331
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
332
+ <?php endforeach; ?>
333
+ </small>
334
+ <?php endif; ?>
335
+
336
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
337
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
338
+ <?php endif; ?>
339
+ <?php endif; ?>
340
+ </span>
341
+ <?php endif; ?>
342
+ </span>
343
+ <?php else: ?>
344
+ &nbsp;
345
+ <?php endif; ?>
346
+ </td>
347
+ <td class="a-right">
348
+ <?php if ($this->canShowPriceInfo($_item)): ?>
349
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
350
+ <?php else: ?>
351
+ &nbsp;
352
+ <?php endif; ?>
353
+ </td>
354
+ <td class="a-right">
355
+ <?php if ($this->canShowPriceInfo($_item)): ?>
356
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
357
+ <?php else: ?>
358
+ &nbsp;
359
+ <?php endif; ?>
360
+ </td>
361
+ <td class="a-right last">
362
+ <?php if ($this->canShowPriceInfo($_item)): ?>
363
+ <?php echo $this->displayPrices(
364
+ $_item->getBaseRowTotal()+$_item->getBaseTaxAmount()-$_item->getBaseDiscountAmount()+$_item->getBaseWeeeTaxAppliedRowAmount(),
365
+ $_item->getRowTotal()+$_item->getTaxAmount()-$_item->getDiscountAmount()+$_item->getWeeeTaxAppliedRowAmount()
366
+ ) ?>
367
+ <?php else: ?>
368
+ &nbsp;
369
+ <?php endif; ?>
370
+ </td>
371
+ </tr>
372
+ <?php endforeach; ?>
373
+ <?php if($_showlastRow): ?>
374
+ <tr class="border">
375
+ <td>
376
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
377
+ <dl class="item-options">
378
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
379
+ <dt><?php echo $option['label'] ?></dt>
380
+ <dd>
381
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
382
+ <?php echo $option['value'];?>
383
+ <?php else: ?>
384
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
385
+ <?php if ($_remainder):?>
386
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
387
+ <script type="text/javascript">
388
+ $('<?php echo $_id ?>').hide();
389
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
390
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
391
+ </script>
392
+ <?php endif;?>
393
+ <?php endif;?>
394
+ </dd>
395
+ <?php endforeach; ?>
396
+ </dl>
397
+ <?php else: ?>
398
+ &nbsp;
399
+ <?php endif; ?>
400
+ <?php echo $this->htmlEscape($_item->getDescription()) ?>
401
+ </td>
402
+ <td>&nbsp;</td>
403
+ <td>&nbsp;</td>
404
+ <td>&nbsp;</td>
405
+ <td>&nbsp;</td>
406
+ <td>&nbsp;</td>
407
+ <td>&nbsp;</td>
408
+ <td>&nbsp;</td>
409
+ <td class="last">&nbsp;</td>
410
+ </tr>
411
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
49
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td class="last">&nbsp;</td>
59
+ </tr>
60
+ <?php $_prevOptionId = $attributes['option_id'] ?>
61
+ <?php endif; ?>
62
+ <?php endif; ?>
63
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
64
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
65
+ <td><h5 class="title"><?php echo $this->htmlEscape($_item->getName()) ?></h5>
66
+ <div>
67
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
68
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($_item->getSku()))); ?>
69
+ </div>
70
+ </td>
71
+ <?php else: ?>
72
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
73
+ <?php endif; ?>
74
+ <td class="a-right">
75
+ <?php if ($this->canShowPriceInfo($_item)): ?>
76
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
77
+ <span class="price-excl-tax">
78
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
79
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
80
+ <?php endif; ?>
81
+
82
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
83
+ <?php
84
+ echo $this->displayPrices(
85
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
86
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
87
+ );
88
+ ?>
89
+ <?php else: ?>
90
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
91
+ <?php endif; ?>
92
+
93
+
94
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
95
+ <br />
96
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
97
+ <small>
98
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
99
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
100
+ <?php endforeach; ?>
101
+ </small>
102
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
103
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
104
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
105
+ <?php endforeach; ?>
106
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
107
+ <small>
108
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
109
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
110
+ <?php endforeach; ?>
111
+ </small>
112
+ <?php endif; ?>
113
+
114
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
115
+ <br />
116
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
117
+ <?php
118
+ echo $this->displayPrices(
119
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
120
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
121
+ );
122
+ ?>
123
+ </span>
124
+ <?php endif; ?>
125
+ <?php endif; ?>
126
+ </span>
127
+ <br />
128
+ <?php endif; ?>
129
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
130
+ <span class="price-incl-tax">
131
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
132
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
133
+ <?php endif; ?>
134
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
135
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
136
+
137
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
138
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?>
139
+ <?php else: ?>
140
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
141
+ <?php endif; ?>
142
+
143
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
144
+ <br />
145
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
146
+ <small>
147
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
148
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
149
+ <?php endforeach; ?>
150
+ </small>
151
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
152
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
153
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
154
+ <?php endforeach; ?>
155
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
156
+ <small>
157
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
158
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
159
+ <?php endforeach; ?>
160
+ </small>
161
+ <?php endif; ?>
162
+
163
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
164
+ <br />
165
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
166
+ <?php endif; ?>
167
+ <?php endif; ?>
168
+ </span>
169
+ <?php endif; ?>
170
+ <?php else: ?>
171
+ &nbsp;
172
+ <?php endif; ?>
173
+ </td>
174
+ <td class="a-center">
175
+ <?php if ($this->canShowPriceInfo($_item)): ?>
176
+ <?php echo $_item->getQty()*1 ?>
177
+ <?php else: ?>
178
+ &nbsp;
179
+ <?php endif; ?>
180
+ </td>
181
+ <td class="a-right">
182
+ <?php if ($this->canShowPriceInfo($_item)): ?>
183
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
184
+ <span class="price-excl-tax">
185
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
186
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
187
+ <?php endif; ?>
188
+
189
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
190
+ <?php
191
+ echo $this->displayPrices(
192
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
193
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
194
+ );
195
+ ?>
196
+ <?php else: ?>
197
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
198
+ <?php endif; ?>
199
+
200
+
201
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
202
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
203
+ <small>
204
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
205
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
206
+ <?php endforeach; ?>
207
+ </small>
208
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
209
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
210
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
211
+ <?php endforeach; ?>
212
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
213
+ <small>
214
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
215
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
216
+ <?php endforeach; ?>
217
+ </small>
218
+ <?php endif; ?>
219
+
220
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
221
+ <br />
222
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
223
+ <?php
224
+ echo $this->displayPrices(
225
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
226
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
227
+ );
228
+ ?>
229
+ </span>
230
+ <?php endif; ?>
231
+ <?php endif; ?>
232
+ </span>
233
+ <br />
234
+ <?php endif; ?>
235
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
236
+ <span class="price-incl-tax">
237
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
238
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
239
+ <?php endif; ?>
240
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
241
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
242
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
243
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
244
+ <?php else: ?>
245
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
246
+ <?php endif; ?>
247
+
248
+
249
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
250
+
251
+ <br />
252
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
253
+ <small>
254
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
255
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
256
+ <?php endforeach; ?>
257
+ </small>
258
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
259
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
260
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
261
+ <?php endforeach; ?>
262
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
263
+ <small>
264
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
265
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
266
+ <?php endforeach; ?>
267
+ </small>
268
+ <?php endif; ?>
269
+
270
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
271
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
272
+ <?php endif; ?>
273
+ <?php endif; ?>
274
+ </span>
275
+ <?php endif; ?>
276
+ </span>
277
+ <?php else: ?>
278
+ &nbsp;
279
+ <?php endif; ?>
280
+ </td>
281
+ <td class="a-right">
282
+ <?php if ($this->canShowPriceInfo($_item)): ?>
283
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
284
+ <?php else: ?>
285
+ &nbsp;
286
+ <?php endif; ?>
287
+ </td>
288
+ <td class="a-right">
289
+ <?php if ($this->canShowPriceInfo($_item)): ?>
290
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
291
+ <?php else: ?>
292
+ &nbsp;
293
+ <?php endif; ?>
294
+ </td>
295
+ <td class="a-right last">
296
+ <?php if ($this->canShowPriceInfo($_item)): ?>
297
+ <?php echo $this->displayPrices(
298
+ $_item->getBaseRowTotal()-$_item->getBaseDiscountAmount()+$_item->getBaseTaxAmount()+$_item->getBaseWeeeTaxAppliedRowAmount(),
299
+ $_item->getRowTotal()-$_item->getDiscountAmount()+$_item->getTaxAmount()+$_item->getWeeeTaxAppliedRowAmount()
300
+ ) ?>
301
+ <?php else: ?>
302
+ &nbsp;
303
+ <?php endif; ?>
304
+ </td>
305
+ </tr>
306
+ <?php endforeach; ?>
307
+ <?php if($_showlastRow): ?>
308
+ <tr class="border">
309
+ <td>
310
+ <?php if ($this->getOrderOptions()): ?>
311
+ <dl class="item-options">
312
+ <?php foreach ($this->getOrderOptions() as $option): ?>
313
+ <dt><?php echo $option['label'] ?></dt>
314
+ <dd>
315
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
316
+ <?php echo $option['value'];?>
317
+ <?php else: ?>
318
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
319
+ <?php if ($_remainder):?>
320
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
321
+ <script type="text/javascript">
322
+ $('<?php echo $_id ?>').hide();
323
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
324
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
325
+ </script>
326
+ <?php endif;?>
327
+ <?php endif;?>
328
+ </dd>
329
+ <?php endforeach; ?>
330
+ </dl>
331
+ <?php endif; ?>
332
+ <?php echo $this->htmlEscape($this->getItem()->getDescription()) ?>
333
+ </td>
334
+ <td>&nbsp;</td>
335
+ <td>&nbsp;</td>
336
+ <td>&nbsp;</td>
337
+ <td>&nbsp;</td>
338
+ <td>&nbsp;</td>
339
+ <td class="last">&nbsp;</td>
340
+ </tr>
341
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
49
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td>&nbsp;</td>
59
+ <td class="last">&nbsp;</td>
60
+ </tr>
61
+ <?php $_prevOptionId = $attributes['option_id'] ?>
62
+ <?php endif; ?>
63
+ <?php endif; ?>
64
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
65
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
66
+ <td><h5 class="title"><?php echo $this->htmlEscape($_item->getName()) ?></h5>
67
+ <div>
68
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
69
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($_item->getSku()))); ?>
70
+ </div>
71
+ </td>
72
+ <?php else: ?>
73
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
74
+ <?php endif; ?>
75
+ <td class="a-right">
76
+ <?php if ($this->canShowPriceInfo($_item)): ?>
77
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
78
+ <span class="price-excl-tax">
79
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
80
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
81
+ <?php endif; ?>
82
+
83
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
84
+ <?php
85
+ echo $this->displayPrices(
86
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
87
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
88
+ );
89
+ ?>
90
+ <?php else: ?>
91
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
92
+ <?php endif; ?>
93
+
94
+
95
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
96
+ <br />
97
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
98
+ <small>
99
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
100
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
101
+ <?php endforeach; ?>
102
+ </small>
103
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
104
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
105
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
106
+ <?php endforeach; ?>
107
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
108
+ <small>
109
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
110
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
111
+ <?php endforeach; ?>
112
+ </small>
113
+ <?php endif; ?>
114
+
115
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
116
+ <br />
117
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
118
+ <?php
119
+ echo $this->displayPrices(
120
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
121
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
122
+ );
123
+ ?>
124
+ </span>
125
+ <?php endif; ?>
126
+ <?php endif; ?>
127
+ </span>
128
+ <br />
129
+ <?php endif; ?>
130
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
131
+ <span class="price-incl-tax">
132
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
133
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
134
+ <?php endif; ?>
135
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
136
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
137
+
138
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
139
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?>
140
+ <?php else: ?>
141
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
142
+ <?php endif; ?>
143
+
144
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
145
+ <br />
146
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
147
+ <small>
148
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
149
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
150
+ <?php endforeach; ?>
151
+ </small>
152
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
153
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
154
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
155
+ <?php endforeach; ?>
156
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
157
+ <small>
158
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
159
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
160
+ <?php endforeach; ?>
161
+ </small>
162
+ <?php endif; ?>
163
+
164
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
165
+ <br />
166
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
167
+ <?php endif; ?>
168
+ <?php endif; ?>
169
+ </span>
170
+ <?php endif; ?>
171
+ <?php else: ?>
172
+ &nbsp;
173
+ <?php endif; ?>
174
+ </td>
175
+ <td>
176
+ <?php if ($this->canShowPriceInfo($_item)): ?>
177
+ <table cellspacing="0" class="qty-table">
178
+ <tr>
179
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
180
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
181
+ </tr>
182
+ <?php if ((float) $_item->getOrderItem()->getQtyInvoiced()): ?>
183
+ <tr>
184
+ <td><?php echo Mage::helper('sales')->__('Invoiced') ?></td>
185
+ <td><strong><?php echo $_item->getOrderItem()->getQtyInvoiced()*1 ?></strong></td>
186
+ </tr>
187
+ <?php endif; ?>
188
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped() && $this->isShipmentSeparately($_item)): ?>
189
+ <tr>
190
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
191
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
192
+ </tr>
193
+ <?php endif; ?>
194
+ <?php if ((float) $_item->getOrderItem()->getQtyRefunded()): ?>
195
+ <tr>
196
+ <td><?php echo Mage::helper('sales')->__('Refunded') ?></td>
197
+ <td><strong><?php echo $_item->getOrderItem()->getQtyRefunded()*1 ?></strong></td>
198
+ </tr>
199
+ <?php endif; ?>
200
+ <?php if ((float) $_item->getOrderItem()->getQtyCanceled()): ?>
201
+ <tr>
202
+ <td><?php echo Mage::helper('sales')->__('Canceled') ?></td>
203
+ <td><strong><?php echo $_item->getOrderItem()->getQtyCanceled()*1 ?></strong></td>
204
+ </tr>
205
+ <?php endif; ?>
206
+ </table>
207
+ <?php elseif ($this->isShipmentSeparately($_item)): ?>
208
+ <table cellspacing="0" class="qty-table">
209
+ <tr>
210
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
211
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
212
+ </tr>
213
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped()): ?>
214
+ <tr>
215
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
216
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
217
+ </tr>
218
+ <?php endif; ?>
219
+ </table>
220
+ <?php else: ?>
221
+ &nbsp;
222
+ <?php endif; ?>
223
+ </td>
224
+ <td class="a-center">
225
+ <?php if ($this->canShowPriceInfo($_item)): ?>
226
+ <?php if ($this->canEditQty()) : ?>
227
+ <input type="text" class="input-text qty-input" name="invoice[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>" />
228
+ <?php else : ?>
229
+ <?php echo $_item->getQty()*1 ?>
230
+ <?php endif; ?>
231
+ <?php else: ?>
232
+ &nbsp;
233
+ <?php endif; ?>
234
+ </td>
235
+ <td class="a-right">
236
+ <?php if ($this->canShowPriceInfo($_item)): ?>
237
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
238
+ <span class="price-excl-tax">
239
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
240
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
241
+ <?php endif; ?>
242
+
243
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
244
+ <?php
245
+ echo $this->displayPrices(
246
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
247
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
248
+ );
249
+ ?>
250
+ <?php else: ?>
251
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
252
+ <?php endif; ?>
253
+
254
+
255
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
256
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
257
+ <small>
258
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
259
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
260
+ <?php endforeach; ?>
261
+ </small>
262
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
263
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
264
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
265
+ <?php endforeach; ?>
266
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
267
+ <small>
268
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
269
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
270
+ <?php endforeach; ?>
271
+ </small>
272
+ <?php endif; ?>
273
+
274
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
275
+ <br />
276
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
277
+ <?php
278
+ echo $this->displayPrices(
279
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
280
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
281
+ );
282
+ ?>
283
+ </span>
284
+ <?php endif; ?>
285
+ <?php endif; ?>
286
+ </span>
287
+ <br />
288
+ <?php endif; ?>
289
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
290
+ <span class="price-incl-tax">
291
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
292
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
293
+ <?php endif; ?>
294
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
295
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
296
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
297
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
298
+ <?php else: ?>
299
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
300
+ <?php endif; ?>
301
+
302
+
303
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
304
+
305
+ <br />
306
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
307
+ <small>
308
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
309
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
310
+ <?php endforeach; ?>
311
+ </small>
312
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
313
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
314
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
315
+ <?php endforeach; ?>
316
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
317
+ <small>
318
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
319
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
320
+ <?php endforeach; ?>
321
+ </small>
322
+ <?php endif; ?>
323
+
324
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
325
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
326
+ <?php endif; ?>
327
+ <?php endif; ?>
328
+ </span>
329
+ <?php endif; ?>
330
+ </span>
331
+ <?php else: ?>
332
+ &nbsp;
333
+ <?php endif; ?>
334
+ </td>
335
+ <td class="a-right">
336
+ <?php if ($this->canShowPriceInfo($_item)): ?>
337
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
338
+ <?php else: ?>
339
+ &nbsp;
340
+ <?php endif; ?>
341
+ </td>
342
+ <td class="a-right">
343
+ <?php if ($this->canShowPriceInfo($_item)): ?>
344
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
345
+ <?php else: ?>
346
+ &nbsp;
347
+ <?php endif; ?>
348
+ </td>
349
+ <td class="a-right last">
350
+ <?php if ($this->canShowPriceInfo($_item)): ?>
351
+ <?php echo $this->displayPrices(
352
+ $_item->getBaseRowTotal()+$_item->getBaseTaxAmount()-$_item->getBaseDiscountAmount()+$_item->getBaseWeeeTaxAppliedRowAmount(),
353
+ $_item->getRowTotal()+$_item->getTaxAmount()-$_item->getDiscountAmount()+$_item->getWeeeTaxAppliedRowAmount()
354
+ ) ?>
355
+ <?php else: ?>
356
+ &nbsp;
357
+ <?php endif; ?>
358
+ </td>
359
+ </tr>
360
+ <?php endforeach; ?>
361
+ <?php if($_showlastRow): ?>
362
+ <tr class="border">
363
+ <td>
364
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
365
+ <dl class="item-options">
366
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
367
+ <dt><?php echo $option['label'] ?></dt>
368
+ <dd>
369
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
370
+ <?php echo $option['value'];?>
371
+ <?php else: ?>
372
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
373
+ <?php if ($_remainder):?>
374
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
375
+ <script type="text/javascript">
376
+ $('<?php echo $_id ?>').hide();
377
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
378
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
379
+ </script>
380
+ <?php endif;?>
381
+ <?php endif;?>
382
+ </dd>
383
+ <?php endforeach; ?>
384
+ </dl>
385
+ <?php else: ?>
386
+ &nbsp;
387
+ <?php endif; ?>
388
+ <?php echo $this->htmlEscape($_item->getDescription()) ?>
389
+ </td>
390
+ <td>&nbsp;</td>
391
+ <td>&nbsp;</td>
392
+ <td>&nbsp;</td>
393
+ <td>&nbsp;</td>
394
+ <td>&nbsp;</td>
395
+ <td>&nbsp;</td>
396
+ <td class="last">&nbsp;</td>
397
+ </tr>
398
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
49
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td class="last">&nbsp;</td>
59
+ </tr>
60
+ <?php $_prevOptionId = $attributes['option_id'] ?>
61
+ <?php endif; ?>
62
+ <?php endif; ?>
63
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
64
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
65
+ <td><h5 class="title"><?php echo $this->htmlEscape($_item->getName()) ?></h5>
66
+ <div>
67
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
68
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($_item->getSku()))); ?>
69
+ </div>
70
+ <?php else: ?>
71
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
72
+ <?php endif; ?>
73
+ <td class="a-right">
74
+ <?php if ($this->canShowPriceInfo($_item)): ?>
75
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
76
+ <span class="price-excl-tax">
77
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
78
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
79
+ <?php endif; ?>
80
+
81
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
82
+ <?php
83
+ echo $this->displayPrices(
84
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
85
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
86
+ );
87
+ ?>
88
+ <?php else: ?>
89
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
90
+ <?php endif; ?>
91
+
92
+
93
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
94
+ <br />
95
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
96
+ <small>
97
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
98
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
99
+ <?php endforeach; ?>
100
+ </small>
101
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
102
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
103
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
104
+ <?php endforeach; ?>
105
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
106
+ <small>
107
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
108
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
109
+ <?php endforeach; ?>
110
+ </small>
111
+ <?php endif; ?>
112
+
113
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
114
+ <br />
115
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
116
+ <?php
117
+ echo $this->displayPrices(
118
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
119
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
120
+ );
121
+ ?>
122
+ </span>
123
+ <?php endif; ?>
124
+ <?php endif; ?>
125
+ </span>
126
+ <br />
127
+ <?php endif; ?>
128
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
129
+ <span class="price-incl-tax">
130
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
131
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
132
+ <?php endif; ?>
133
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
134
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
135
+
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
137
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?>
138
+ <?php else: ?>
139
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
140
+ <?php endif; ?>
141
+
142
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
143
+ <br />
144
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
145
+ <small>
146
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
147
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
148
+ <?php endforeach; ?>
149
+ </small>
150
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
151
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
152
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
153
+ <?php endforeach; ?>
154
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
155
+ <small>
156
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
157
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
158
+ <?php endforeach; ?>
159
+ </small>
160
+ <?php endif; ?>
161
+
162
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
163
+ <br />
164
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
165
+ <?php endif; ?>
166
+ <?php endif; ?>
167
+ </span>
168
+ <?php endif; ?>
169
+ <?php else: ?>
170
+ &nbsp;
171
+ <?php endif; ?>
172
+ </td>
173
+ <td class="a-center">
174
+ <?php if ($this->canShowPriceInfo($_item)): ?>
175
+ <?php echo $_item->getQty()*1 ?>
176
+ <?php else: ?>
177
+ &nbsp;
178
+ <?php endif; ?>
179
+ </td>
180
+ <td class="a-right">
181
+ <?php if ($this->canShowPriceInfo($_item)): ?>
182
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
183
+ <span class="price-excl-tax">
184
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
185
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
186
+ <?php endif; ?>
187
+
188
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
189
+ <?php
190
+ echo $this->displayPrices(
191
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
192
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
193
+ );
194
+ ?>
195
+ <?php else: ?>
196
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
197
+ <?php endif; ?>
198
+
199
+
200
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
201
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
202
+ <small>
203
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
204
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
205
+ <?php endforeach; ?>
206
+ </small>
207
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
208
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
209
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
210
+ <?php endforeach; ?>
211
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
212
+ <small>
213
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
214
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
215
+ <?php endforeach; ?>
216
+ </small>
217
+ <?php endif; ?>
218
+
219
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
220
+ <br />
221
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
222
+ <?php
223
+ echo $this->displayPrices(
224
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
225
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
226
+ );
227
+ ?>
228
+ </span>
229
+ <?php endif; ?>
230
+ <?php endif; ?>
231
+ </span>
232
+ <br />
233
+ <?php endif; ?>
234
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
235
+ <span class="price-incl-tax">
236
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
237
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
238
+ <?php endif; ?>
239
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
240
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
241
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
242
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
243
+ <?php else: ?>
244
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
245
+ <?php endif; ?>
246
+
247
+
248
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
249
+
250
+ <br />
251
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
252
+ <small>
253
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
254
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
255
+ <?php endforeach; ?>
256
+ </small>
257
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
258
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
259
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
260
+ <?php endforeach; ?>
261
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
262
+ <small>
263
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
264
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
265
+ <?php endforeach; ?>
266
+ </small>
267
+ <?php endif; ?>
268
+
269
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
270
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
271
+ <?php endif; ?>
272
+ <?php endif; ?>
273
+ </span>
274
+ <?php endif; ?>
275
+ </span>
276
+ <?php else: ?>
277
+ &nbsp;
278
+ <?php endif; ?>
279
+ </td>
280
+ <td class="a-right">
281
+ <?php if ($this->canShowPriceInfo($_item)): ?>
282
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
283
+ <?php else: ?>
284
+ &nbsp;
285
+ <?php endif; ?>
286
+ </td>
287
+ <td class="a-right">
288
+ <?php if ($this->canShowPriceInfo($_item)): ?>
289
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
290
+ <?php else: ?>
291
+ &nbsp;
292
+ <?php endif; ?>
293
+ </td>
294
+ <td class="a-right last">
295
+ <?php if ($this->canShowPriceInfo($_item)): ?>
296
+ <?php echo $this->displayPrices(
297
+ $_item->getBaseRowTotal()+$_item->getBaseTaxAmount()-$_item->getBaseDiscountAmount()+$_item->getBaseWeeeTaxAppliedRowAmount(),
298
+ $_item->getRowTotal()+$_item->getTaxAmount()-$_item->getDiscountAmount()+$_item->getWeeeTaxAppliedRowAmount()
299
+ ) ?>
300
+ <?php else: ?>
301
+ &nbsp;
302
+ <?php endif; ?>
303
+ </td>
304
+ </tr>
305
+ <?php endforeach; ?>
306
+ <?php if($_showlastRow): ?>
307
+ <tr class="border">
308
+ <td>
309
+ <?php if ($this->getOrderOptions()): ?>
310
+ <dl class="item-options">
311
+ <?php foreach ($this->getOrderOptions() as $option): ?>
312
+ <dt><?php echo $option['label'] ?></dt>
313
+ <dd>
314
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
315
+ <?php echo $option['value'];?>
316
+ <?php else: ?>
317
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
318
+ <?php if ($_remainder):?>
319
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
320
+ <script type="text/javascript">
321
+ $('<?php echo $_id ?>').hide();
322
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
323
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
324
+ </script>
325
+ <?php endif;?>
326
+ <?php endif;?>
327
+ </dd>
328
+ <?php endforeach; ?>
329
+ </dl>
330
+ <?php endif; ?>
331
+ <?php echo $this->htmlEscape($this->getItem()->getDescription()) ?>
332
+ </td>
333
+ <td>&nbsp;</td>
334
+ <td>&nbsp;</td>
335
+ <td>&nbsp;</td>
336
+ <td>&nbsp;</td>
337
+ <td>&nbsp;</td>
338
+ <td class="last">&nbsp;</td>
339
+ </tr>
340
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = array_merge(array($_item), $_item->getChildrenItems()); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription() || $this->canDisplayGiftmessage()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
49
+ <?php if ($_item->getParentItem()): ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td>&nbsp;</td>
59
+ <td>&nbsp;</td>
60
+ <td>&nbsp;</td>
61
+ <td class="last">&nbsp;</td>
62
+ </tr>
63
+ <?php $_prevOptionId = $attributes['option_id'] ?>
64
+ <?php endif; ?>
65
+ <?php endif; ?>
66
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
67
+ <?php if (!$_item->getParentItem()): ?>
68
+ <td>
69
+ <h5 class="title">
70
+ <span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?></span>
71
+ </h5>
72
+ <div>
73
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
74
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($_item->getSku()))); ?>
75
+ </div>
76
+ </td>
77
+ <?php else: ?>
78
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
79
+ <?php endif; ?>
80
+ <td class="a-center">
81
+ <?php if ($this->canShowPriceInfo($_item)): ?>
82
+ <?php echo $_item->getStatus() ?>
83
+ <?php else: ?>
84
+ &nbsp;
85
+ <?php endif; ?>
86
+ </td>
87
+ <td class="a-right">
88
+ <?php if ($this->canShowPriceInfo($_item)): ?>
89
+ <?php echo $this->displayPriceAttribute('original_price') ?>
90
+ <?php else: ?>
91
+ &nbsp;
92
+ <?php endif; ?>
93
+ </td>
94
+ <td class="a-right">
95
+ <?php if ($this->canShowPriceInfo($_item)): ?>
96
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
97
+ <span class="price-excl-tax">
98
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
99
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
100
+ <?php endif; ?>
101
+
102
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
103
+ <?php
104
+ echo $this->displayPrices(
105
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
106
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
107
+ );
108
+ ?>
109
+ <?php else: ?>
110
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
111
+ <?php endif; ?>
112
+
113
+
114
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
115
+ <br />
116
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
117
+ <small>
118
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
119
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
120
+ <?php endforeach; ?>
121
+ </small>
122
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
123
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
124
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
125
+ <?php endforeach; ?>
126
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
127
+ <small>
128
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
129
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
130
+ <?php endforeach; ?>
131
+ </small>
132
+ <?php endif; ?>
133
+
134
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
135
+ <br />
136
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
137
+ <?php
138
+ echo $this->displayPrices(
139
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
140
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
141
+ );
142
+ ?>
143
+ </span>
144
+ <?php endif; ?>
145
+ <?php endif; ?>
146
+ </span>
147
+ <br />
148
+ <?php endif; ?>
149
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
150
+ <span class="price-incl-tax">
151
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
152
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
153
+ <?php endif; ?>
154
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
155
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
156
+
157
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
158
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?>
159
+ <?php else: ?>
160
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
161
+ <?php endif; ?>
162
+
163
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
164
+ <br />
165
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
166
+ <small>
167
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
168
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
169
+ <?php endforeach; ?>
170
+ </small>
171
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
172
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
173
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
174
+ <?php endforeach; ?>
175
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
176
+ <small>
177
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
178
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
179
+ <?php endforeach; ?>
180
+ </small>
181
+ <?php endif; ?>
182
+
183
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
184
+ <br />
185
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
186
+ <?php endif; ?>
187
+ <?php endif; ?>
188
+ </span>
189
+ <?php endif; ?>
190
+ <?php else: ?>
191
+ &nbsp;
192
+ <?php endif; ?>
193
+ </td>
194
+ <td>
195
+ <?php if ($this->canShowPriceInfo($_item)): ?>
196
+ <table cellspacing="0" class="qty-table">
197
+ <tr>
198
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
199
+ <td><strong><?php echo $_item->getQtyOrdered()*1 ?></strong></td>
200
+ </tr>
201
+ <?php if ((float) $_item->getQtyInvoiced()): ?>
202
+ <tr>
203
+ <td><?php echo Mage::helper('sales')->__('Invoiced') ?></td>
204
+ <td><strong><?php echo $_item->getQtyInvoiced()*1 ?></strong></td>
205
+ </tr>
206
+ <?php endif; ?>
207
+ <?php if ((float) $_item->getQtyShipped() && $this->isShipmentSeparately($_item)): ?>
208
+ <tr>
209
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
210
+ <td><strong><?php echo $_item->getQtyShipped()*1 ?></strong></td>
211
+ </tr>
212
+ <?php endif; ?>
213
+ <?php if ((float) $_item->getQtyRefunded()): ?>
214
+ <tr>
215
+ <td><?php echo Mage::helper('sales')->__('Refunded') ?></td>
216
+ <td><strong><?php echo $_item->getQtyRefunded()*1 ?></strong></td>
217
+ </tr>
218
+ <?php endif; ?>
219
+ <?php if ((float) $_item->getQtyCanceled()): ?>
220
+ <tr>
221
+ <td><?php echo Mage::helper('sales')->__('Canceled') ?></td>
222
+ <td><strong><?php echo $_item->getQtyCanceled()*1 ?></strong></td>
223
+ </tr>
224
+ <?php endif; ?>
225
+ </table>
226
+ <?php elseif ($this->isShipmentSeparately($_item)): ?>
227
+ <table cellspacing="0" class="qty-table">
228
+ <tr>
229
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
230
+ <td><strong><?php echo $_item->getQtyOrdered()*1 ?></strong></td>
231
+ </tr>
232
+ <?php if ((float) $_item->getQtyShipped()): ?>
233
+ <tr>
234
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
235
+ <td><strong><?php echo $_item->getQtyShipped()*1 ?></strong></td>
236
+ </tr>
237
+ <?php endif; ?>
238
+ </table>
239
+ <?php else: ?>
240
+ &nbsp;
241
+ <?php endif; ?>
242
+ </td>
243
+ <td class="a-right">
244
+ <?php if ($this->canShowPriceInfo($_item)): ?>
245
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
246
+ <span class="price-excl-tax">
247
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
248
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
249
+ <?php endif; ?>
250
+
251
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
252
+ <?php
253
+ echo $this->displayPrices(
254
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
255
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
256
+ );
257
+ ?>
258
+ <?php else: ?>
259
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
260
+ <?php endif; ?>
261
+
262
+
263
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
264
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
265
+ <small>
266
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
267
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
268
+ <?php endforeach; ?>
269
+ </small>
270
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
271
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
272
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
273
+ <?php endforeach; ?>
274
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
275
+ <small>
276
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
277
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
278
+ <?php endforeach; ?>
279
+ </small>
280
+ <?php endif; ?>
281
+
282
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
283
+ <br />
284
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
285
+ <?php
286
+ echo $this->displayPrices(
287
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
288
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
289
+ );
290
+ ?>
291
+ </span>
292
+ <?php endif; ?>
293
+ <?php endif; ?>
294
+ </span>
295
+ <br />
296
+ <?php endif; ?>
297
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
298
+ <span class="price-incl-tax">
299
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
300
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
301
+ <?php endif; ?>
302
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
303
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
304
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
305
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
306
+ <?php else: ?>
307
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
308
+ <?php endif; ?>
309
+
310
+
311
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
312
+
313
+ <br />
314
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
315
+ <small>
316
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
317
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
318
+ <?php endforeach; ?>
319
+ </small>
320
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
321
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
322
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
323
+ <?php endforeach; ?>
324
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
325
+ <small>
326
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
327
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
328
+ <?php endforeach; ?>
329
+ </small>
330
+ <?php endif; ?>
331
+
332
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
333
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
334
+ <?php endif; ?>
335
+ <?php endif; ?>
336
+ </span>
337
+ <?php endif; ?>
338
+ <?php else: ?>
339
+ &nbsp;
340
+ <?php endif; ?>
341
+ </td>
342
+ <td class="a-right">
343
+ <?php if ($this->canShowPriceInfo($_item)): ?>
344
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
345
+ <?php else: ?>
346
+ &nbsp;
347
+ <?php endif; ?>
348
+ </td>
349
+
350
+ <td class="a-right">
351
+ <?php if ($this->canShowPriceInfo($_item)): ?>
352
+ <?php echo $this->displayTaxPercent($_item) ?>
353
+ <?php else: ?>
354
+ &nbsp;
355
+ <?php endif; ?>
356
+ </td>
357
+ <td class="a-right">
358
+ <?php if ($this->canShowPriceInfo($_item)): ?>
359
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
360
+ <?php else: ?>
361
+ &nbsp;
362
+ <?php endif; ?>
363
+ </td>
364
+ <td class="a-right last">
365
+ <?php if ($this->canShowPriceInfo($_item)): ?>
366
+ <?php echo $this->displayPrices(
367
+ max(0, $_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount()),
368
+ max(0, $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getWeeeTaxAppliedRowAmount())
369
+ ); ?>
370
+ <?php else: ?>
371
+ &nbsp;
372
+ <?php endif; ?>
373
+ </td>
374
+ </tr>
375
+ <?php endforeach; ?>
376
+ <?php if($_showlastRow): ?>
377
+ <tr<?php if (!$this->canDisplayGiftmessage()) echo ' class="border"' ?>>
378
+ <td>
379
+ <?php if ($this->getOrderOptions()): ?>
380
+ <dl class="item-options">
381
+ <?php foreach ($this->getOrderOptions() as $option): ?>
382
+ <dt><?php echo $option['label'] ?>:</dt>
383
+ <dd>
384
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
385
+ <?php echo $option['value'];?>
386
+ <?php else: ?>
387
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
388
+ <?php if ($_remainder):?>
389
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
390
+ <script type="text/javascript">
391
+ $('<?php echo $_id ?>').hide();
392
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
393
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
394
+ </script>
395
+ <?php endif;?>
396
+ <?php endif;?>
397
+ </dd>
398
+ <?php endforeach; ?>
399
+ </dl>
400
+ <?php else: ?>
401
+ &nbsp;
402
+ <?php endif; ?>
403
+ <?php echo $this->htmlEscape($_item->getDescription()) ?>
404
+ </td>
405
+ <td>&nbsp;</td>
406
+ <td>&nbsp;</td>
407
+ <td>&nbsp;</td>
408
+ <td>&nbsp;</td>
409
+ <td>&nbsp;</td>
410
+ <td>&nbsp;</td>
411
+ <td>&nbsp;</td>
412
+ <td>&nbsp;</td>
413
+ <td class="last">&nbsp;</td>
414
+ </tr>
415
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
49
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td class="last">&nbsp;</td>
55
+ </tr>
56
+ <?php $_prevOptionId = $attributes['option_id'] ?>
57
+ <?php endif; ?>
58
+ <?php endif; ?>
59
+ <tr class="<?php echo (++$_index==$_count && !$_showlastRow)?'border':'' ?>">
60
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
61
+ <td><h5 class="title"><?php echo $this->htmlEscape($_item->getName()) ?></h5>
62
+ <div>
63
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
64
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($_item->getSku()))); ?>
65
+ </div>
66
+ </td>
67
+ <?php else: ?>
68
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
69
+ <?php endif; ?>
70
+ <td>
71
+ <?php if ($this->isShipmentSeparately($_item)): ?>
72
+ <?php echo $this->getColumnHtml($_item, 'qty') ?>
73
+ <?php else: ?>
74
+ &nbsp;
75
+ <?php endif; ?>
76
+ </td>
77
+ <td class="last">
78
+ <?php if ($this->isShipmentSeparately($_item)): ?>
79
+ <input type="text" class="input-text" name="shipment[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>" />
80
+ <?php else: ?>
81
+ &nbsp;
82
+ <?php endif; ?>
83
+ </td>
84
+ </tr>
85
+ <?php endforeach; ?>
86
+ <?php if($_showlastRow): ?>
87
+ <tr class="border">
88
+ <td>
89
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
90
+ <dl class="item-options">
91
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
92
+ <dt><?php echo $option['label'] ?></dt>
93
+ <dd>
94
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
95
+ <?php echo $option['value'];?>
96
+ <?php else: ?>
97
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
98
+ <?php if ($_remainder):?>
99
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
100
+ <script type="text/javascript">
101
+ $('<?php echo $_id ?>').hide();
102
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
103
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
104
+ </script>
105
+ <?php endif;?>
106
+ <?php endif;?>
107
+ </dd>
108
+ <?php endforeach; ?>
109
+ </dl>
110
+ <?php else: ?>
111
+ &nbsp;
112
+ <?php endif; ?>
113
+ <?php echo $this->htmlEscape($_item->getDescription()) ?>
114
+ </td>
115
+ <td>&nbsp;</td>
116
+ <td class="last">&nbsp;</td>
117
+ </tr>
118
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = array_merge(array($_item->getOrderItem()), $_item->getOrderItem()->getChildrenItems()) ?>
35
+ <?php $shipItems = $this->getChilds($_item) ?>
36
+ <?php $_count = count ($items) ?>
37
+ <?php $_index = 0 ?>
38
+
39
+ <?php $_prevOptionId = '' ?>
40
+
41
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
42
+ <?php $_showlastRow = true ?>
43
+ <?php else: ?>
44
+ <?php $_showlastRow = false ?>
45
+ <?php endif; ?>
46
+
47
+ <?php foreach ($items as $_item): ?>
48
+ <?php $this->setPriceDataObject($_item) ?>
49
+ <?php if ($_item->getParentItem()): ?>
50
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
51
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
52
+ <tr>
53
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
54
+ <td class="last">&nbsp;</td>
55
+ </tr>
56
+ <?php $_prevOptionId = $attributes['option_id'] ?>
57
+ <?php endif; ?>
58
+ <?php endif; ?>
59
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
60
+ <?php if (!$_item->getParentItem()): ?>
61
+ <td>
62
+ <h5 class="title"><?php echo $this->htmlEscape($_item->getName()) ?></h5>
63
+ <div>
64
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
65
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($_item->getSku()))); ?>
66
+ </div>
67
+ </td>
68
+ <?php else: ?>
69
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
70
+ <?php endif; ?>
71
+ <td class="a-center last">
72
+ <?php if (($this->isShipmentSeparately() && $_item->getParentItem()) || (!$this->isShipmentSeparately() && !$_item->getParentItem())): ?>
73
+ <?php if (isset($shipItems[$_item->getId()])): ?>
74
+ <?php echo $shipItems[$_item->getId()]->getQty()*1 ?>
75
+ <?php elseif ($_item->getIsVirtual()): ?>
76
+ <?php echo $this->__('N/A') ?>
77
+ <?php else: ?>
78
+ 0
79
+ <?php endif; ?>
80
+ <?php else: ?>
81
+ &nbsp;
82
+ <?php endif; ?>
83
+ </td>
84
+ </tr>
85
+ <?php endforeach; ?>
86
+ <?php if($_showlastRow): ?>
87
+ <tr class="border">
88
+ <td>
89
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
90
+ <dl class="item-options">
91
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
92
+ <dt><?php echo $option['label'] ?></dt>
93
+ <dd>
94
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
95
+ <?php echo $option['value'];?>
96
+ <?php else: ?>
97
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
98
+ <?php if ($_remainder):?>
99
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
100
+ <script type="text/javascript">
101
+ $('<?php echo $_id ?>').hide();
102
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
103
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
104
+ </script>
105
+ <?php endif;?>
106
+ <?php endif;?>
107
+ </dd>
108
+ <?php endforeach; ?>
109
+ </dl>
110
+ <?php endif; ?>
111
+ <?php echo $this->htmlEscape($_item->getDescription()) ?>
112
+ </td>
113
+ <td class="last">&nbsp;</td>
114
+ </tr>
115
+ <?php endif; ?>
app/design/adminhtml/default/default/template/captcha/zend.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $captcha = $this->getCaptchaModel() ?>
28
+ <?php /* @var $this Mage_Core_Block_Captcha_Zend */ ?>
29
+ <div class="clear"></div>
30
+ <div class="captcha">
31
+ <div class="captcha-input input-box input-left">
32
+ <label for="captcha"><?php echo $this->__('Please type the letters from the image:') ?></label><br />
33
+ <input type="text" name="<?php echo Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" id="captcha" class="required-entry input-text validation-failed"/>
34
+ </div>
35
+ <div class="captcha-image input-right">
36
+ <img id="captcha-reload" class="captcha-reload" src="<?php echo $this->getSkinUrl('images/reload.png') ?>" alt="<?php echo $this->__('Reload captcha') ?>"/>
37
+ <img id="<?php echo $this->getFormId() ?>" width="<?php echo $this->getImgWidth() ?>" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>" />
38
+ </div>
39
+ </div>
40
+ <?php if ($captcha->isCaseSensitive()) :?>
41
+ <div class="captcha-note">
42
+ <p><?php echo $this->__('<strong>Attention</strong>: Captcha is case sensitive.') ?></p>
43
+ </div>
44
+ <?php endif; ?>
45
+ <script type="text/javascript">
46
+ //<![CDATA[
47
+ document.observe('dom:loaded', function () {
48
+ var captcha = new Captcha('<?php echo $this->getRefreshUrl() ?>', '<?php echo $this->getFormId() ?>');
49
+
50
+ $('captcha-reload').observe('click', function () {
51
+ captcha.refresh(this);
52
+ });
53
+
54
+ });
55
+ //]]>
56
+ </script>
app/design/adminhtml/default/default/template/catalog/category/checkboxes/tree.phtml ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php $_divId = 'tree-div_' . time() ?>
29
+ <div id="<?php echo $_divId ?>" class="tree"></div>
30
+
31
+ <script type="text/javascript">
32
+ //<![CDATA[
33
+
34
+ // TODO: cleanup this script. It was copypasted from catalog/category/tree
35
+
36
+ var tree;
37
+
38
+ /**
39
+ * Fix ext compatibility with prototype 1.6
40
+ */
41
+ Ext.lib.Event.getTarget = function(e) {
42
+ var ee = e.browserEvent || e;
43
+ return ee.target ? Event.element(ee) : null;
44
+ };
45
+
46
+ Ext.tree.TreePanel.Enhanced = function(el, config)
47
+ {
48
+ Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);
49
+ };
50
+
51
+ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
52
+
53
+ loadTree : function(config, firstLoad)
54
+ {
55
+ var parameters = config['parameters'];
56
+ var data = config['data'];
57
+
58
+ if ((typeof parameters['root_visible']) != 'undefined') {
59
+ this.rootVisible = parameters['root_visible']*1;
60
+ }
61
+
62
+ var root = new Ext.tree.TreeNode(parameters);
63
+
64
+ this.nodeHash = {};
65
+ this.setRootNode(root);
66
+
67
+ if (firstLoad) {
68
+ this.addListener('click', this.categoryClick.createDelegate(this));
69
+ }
70
+
71
+ this.loader.buildCategoryTree(root, data);
72
+ this.el.dom.innerHTML = '';
73
+ // render the tree
74
+ this.render();
75
+ },
76
+
77
+ categoryClick : function(node, e)
78
+ {
79
+ node.getUI().check(!node.getUI().checked());
80
+ }
81
+ });
82
+
83
+ Ext.onReady(function()
84
+ {
85
+ var categoryLoader = new Ext.tree.TreeLoader({
86
+ dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'
87
+ });
88
+
89
+ categoryLoader.createNode = function(config) {
90
+ config.uiProvider = Ext.tree.CheckboxNodeUI;
91
+ var node;
92
+ var _node = Object.clone(config);
93
+ if (config.children && !config.children.length) {
94
+ delete(config.children);
95
+ node = new Ext.tree.AsyncTreeNode(config);
96
+ } else {
97
+ node = new Ext.tree.TreeNode(config);
98
+ }
99
+
100
+ return node;
101
+ };
102
+
103
+ categoryLoader.buildCategoryTree = function(parent, config)
104
+ {
105
+ if (!config) return null;
106
+
107
+ if (parent && config && config.length){
108
+ for (var i = 0; i < config.length; i++) {
109
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
110
+ var node;
111
+ var _node = Object.clone(config[i]);
112
+ if (_node.children && !_node.children.length) {
113
+ delete(_node.children);
114
+ node = new Ext.tree.AsyncTreeNode(_node);
115
+ } else {
116
+ node = new Ext.tree.TreeNode(config[i]);
117
+ }
118
+ parent.appendChild(node);
119
+ node.loader = node.getOwnerTree().loader;
120
+ if (_node.children) {
121
+ this.buildCategoryTree(node, _node.children);
122
+ }
123
+ }
124
+ }
125
+ };
126
+
127
+ categoryLoader.buildHash = function(node)
128
+ {
129
+ var hash = {};
130
+
131
+ hash = this.toArray(node.attributes);
132
+
133
+ if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {
134
+ hash['children'] = new Array;
135
+
136
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
137
+ if (!hash['children']) {
138
+ hash['children'] = new Array;
139
+ }
140
+ hash['children'].push(this.buildHash(node.childNodes[i]));
141
+ }
142
+ }
143
+
144
+ return hash;
145
+ };
146
+
147
+ categoryLoader.toArray = function(attributes) {
148
+ var data = {};
149
+ for (var key in attributes) {
150
+ var value = attributes[key];
151
+ data[key] = value;
152
+ }
153
+
154
+ return data;
155
+ };
156
+
157
+ categoryLoader.on("beforeload", function(treeLoader, node) {
158
+ treeLoader.baseParams.id = node.attributes.id;
159
+ });
160
+
161
+ categoryLoader.on("load", function(treeLoader, node, config) {
162
+ varienWindowOnload();
163
+ });
164
+
165
+ tree = new Ext.tree.TreePanel.Enhanced('<?php echo $_divId ?>', {
166
+ animate: false,
167
+ loader: categoryLoader,
168
+ enableDD: false,
169
+ containerScroll: true,
170
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
171
+ rootVisible: '<?php echo $this->getRoot()->getIsVisible() ?>',
172
+ useAjax: <?php echo $this->getUseAjax() ?>,
173
+ currentNodeId: <?php echo (int) $this->getCategoryId() ?>,
174
+ addNodeTo: false,
175
+ rootUIProvider: Ext.tree.CheckboxNodeUI
176
+ });
177
+
178
+ tree.on('check', function(node, checked) {
179
+ <?php echo $this->getJsFormObject() ?>.updateElement.value = this.getChecked().join(', ');
180
+ varienElementMethods.setHasChanges(node.getUI().checkbox);
181
+ }, tree);
182
+
183
+ // set the root node
184
+ var parameters = {
185
+ text: '<?php echo htmlentities($this->getRoot()->getName()) ?>',
186
+ draggable: false,
187
+ checked:'<?php echo $this->getRoot()->getChecked() ?>',
188
+ uiProvider: Ext.tree.CheckboxNodeUI,
189
+ allowDrop: <?php if ($this->getRoot()->getIsVisible()): ?>true<?php else : ?>false<?php endif; ?>,
190
+ id: <?php echo (int) $this->getRoot()->getId() ?>,
191
+ expanded: <?php echo (int) $this->getIsWasExpanded() ?>,
192
+ category_id: <?php echo (int) $this->getCategoryId() ?>
193
+ };
194
+
195
+ tree.loadTree({parameters:parameters, data:<?php echo $this->getTreeJson() ?>},true);
196
+
197
+ });
198
+ //]]>
199
+ </script>
app/design/adminhtml/default/default/template/catalog/category/edit.phtml ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Template for Mage_Adminhtml_Block_Catalog_Category_Cointainer
30
+ */
31
+ ?>
32
+
33
+ <div id="category-edit-container" class="category-content">
34
+ <?php echo $this->getChildHtml('form') ?>
35
+ </div>
36
+ <script type="text/javascript">
37
+ //<![CDATA[
38
+
39
+ function categoryReset(url,useAjax){
40
+ if(useAjax){
41
+ var params = {active_tab_id:false};
42
+ updateContent(url, params);
43
+ }else{
44
+ location.href = url;
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Delete some category
50
+ * This routine get categoryId explicitly, so even if currently selected tree node is out of sync
51
+ * with this form, we surely delete same category in the tree and at backend
52
+ */
53
+ function categoryDelete(url, useAjax, categoryId) {
54
+ if (confirm('<?php echo Mage::helper('catalog')->__('Are you sure you want to delete this category?') ?>')){
55
+ if (useAjax){
56
+ tree.nodeForDelete = categoryId;
57
+ updateContent(url, {}, true);
58
+ } else {
59
+ location.href = url;
60
+ }
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Update category content area
66
+ */
67
+ function updateContent(url, params, refreshTree) {
68
+ if (!params) {
69
+ params = {};
70
+ }
71
+ if (!params.form_key) {
72
+ params.form_key = FORM_KEY;
73
+ }
74
+
75
+ toolbarToggle.stop();
76
+
77
+ /*if(params.node_name)
78
+ {
79
+ var currentNode = tree.getNodeById(tree.currentNodeId);
80
+ currentNode.setText(params.node_name);
81
+ }*/
82
+
83
+ var categoryContainer = $('category-edit-container');
84
+ var messagesContainer = $('messages');
85
+ var thisObj = this;
86
+ new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
87
+ parameters: params,
88
+ evalScripts: true,
89
+ onComplete: function () {
90
+ /**
91
+ * This func depends on variables, that came in response, and were eval'ed in onSuccess() callback.
92
+ * Since prototype's Element.update() evals javascripts in 10 msec, we should exec our func after it.
93
+ */
94
+ setTimeout(function() {
95
+ try {
96
+ if (refreshTree) {
97
+ thisObj.refreshTreeArea();
98
+ }
99
+ toolbarToggle.start();
100
+ } catch (e) {
101
+ alert(e.message);
102
+ };
103
+ }, 25);
104
+ },
105
+ onSuccess: function(transport) {
106
+ try {
107
+ if (transport.responseText.isJSON()) {
108
+ var response = transport.responseText.evalJSON();
109
+ var needUpdate = true;
110
+ if (response.error) {
111
+ alert(response.message);
112
+ needUpdate = false;
113
+ }
114
+ if(response.ajaxExpired && response.ajaxRedirect) {
115
+ setLocation(response.ajaxRedirect);
116
+ needUpdate = false;
117
+ }
118
+ if (needUpdate){
119
+ if (response.content){
120
+ $(categoryContainer).update(response.content);
121
+ }
122
+ if (response.messages){
123
+ $(messagesContainer).update(response.messages);
124
+ }
125
+ }
126
+ } else {
127
+ $(categoryContainer).update(transport.responseText);
128
+ }
129
+ }
130
+ catch (e) {
131
+ $(categoryContainer).update(transport.responseText);
132
+ }
133
+ }
134
+ });
135
+ }
136
+
137
+ /**
138
+ * Refresh tree nodes after saving or deleting a category
139
+ */
140
+ function refreshTreeArea(transport)
141
+ {
142
+ if (tree && window.editingCategoryBreadcrumbs) {
143
+ // category deleted - delete its node
144
+ if (tree.nodeForDelete) {
145
+ var node = tree.getNodeById(tree.nodeForDelete);
146
+ tree.nodeForDelete = false;
147
+
148
+ if (node) { // Check maybe tree became somehow not synced with ajax and we're trying to delete unknown node
149
+ node.parentNode.removeChild(node);
150
+ tree.currentNodeId = false;
151
+ }
152
+ }
153
+ // category created - add its node
154
+ else if (tree.addNodeTo) {
155
+ var parent = tree.getNodeById(tree.addNodeTo);
156
+ tree.addNodeTo = false;
157
+
158
+ if (parent) { // Check maybe tree became somehow not synced with ajax and we're trying to add to unknown node
159
+ var node = new Ext.tree.AsyncTreeNode(editingCategoryBreadcrumbs[editingCategoryBreadcrumbs.length - 1]);
160
+ node.loaded = true;
161
+ tree.currentNodeId = node.id;
162
+ parent.appendChild(node);
163
+
164
+ if (parent.expanded) {
165
+ tree.selectCurrentNode();
166
+ } else {
167
+ var timer;
168
+ parent.expand();
169
+ var f = function(){
170
+ if(parent.expanded){ // done expanding
171
+ clearInterval(timer);
172
+ tree.selectCurrentNode();
173
+ }
174
+ };
175
+ timer = setInterval(f, 200);
176
+ }
177
+ }
178
+ }
179
+
180
+ // update all affected categories nodes names
181
+ for (var i = 0; i < editingCategoryBreadcrumbs.length; i++) {
182
+ var node = tree.getNodeById(editingCategoryBreadcrumbs[i].id);
183
+ if (node) {
184
+ node.setText(editingCategoryBreadcrumbs[i].text);
185
+ }
186
+ }
187
+ }
188
+ }
189
+
190
+ function displayLoadingMask()
191
+ {
192
+ var loaderArea = $$('#html-body .wrapper')[0]; // Blocks all page
193
+ Position.clone($(loaderArea), $('loading-mask'), {offsetLeft:-2});
194
+ toggleSelectsUnderBlock($('loading-mask'), false);
195
+ Element.show('loading-mask');
196
+ }
197
+ //]]>
198
+ </script>
app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <div class="content-header">
29
+ <h3 class="icon-head head-categories"><?php echo $this->htmlEscape($this->getHeader()) . ($this->getCategoryId() ? ' (' . Mage::helper('catalog')->__('ID: %s', $this->getCategoryId()) . ')' : '') ?></h3>
30
+ <p class="content-buttons form-buttons">
31
+ <?php echo $this->getResetButtonHtml() ?>
32
+ <?php if($this->getCategoryId()): ?>
33
+ <?php echo $this->getDeleteButtonHtml() ?>
34
+ <?php endif; ?>
35
+ <?php echo $this->getAdditionalButtonsHtml(); ?>
36
+ <?php echo $this->getSaveButtonHtml() ?>
37
+ </p>
38
+ </div>
39
+ <?php if($this->hasStoreRootCategory()): ?>
40
+ <?php echo $this->getTabsHtml() ?>
41
+ <?php else: ?>
42
+ <div class="messages warning-msg">
43
+ <?php echo Mage::helper('catalog')->__('Set root category for this store in the <a href="%s">configuration</a>', $this->getStoreConfigurationUrl()) ?>
44
+ </div>
45
+ <?php endif; ?>
46
+ <iframe name="iframeSave" style="display:none; width:100%;" src="<?php echo $this->getJsUrl() ?>blank.html"></iframe>
47
+ <form target="iframeSave" id="category_edit_form" action="<?php echo $this->getSaveUrl() ?>" method="post" enctype="multipart/form-data">
48
+ <div class="no-display">
49
+ <input type="hidden" name="isIframe" value="1" />
50
+ <input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
51
+ <input type="hidden" name="category_products" id="in_category_products" value="" />
52
+ <input type="hidden" name="active_tab_id" id="active_tab_id" value="" />
53
+ </div>
54
+ <div id="category_tab_content"></div>
55
+ </form>
56
+ <script type="text/javascript">
57
+ //<![CDATA[
58
+ categoryForm = new varienForm('category_edit_form');
59
+
60
+ categoryForm.submit= function (url) {
61
+ this.errorSections = $H({});
62
+ this.canShowError = true;
63
+ this.submitUrl = url;
64
+ if (this.validator && this.validator.validate()) {
65
+ if(this.validationUrl){
66
+ this._validate();
67
+ }
68
+ else{
69
+ if (this.isSubmitted) {
70
+ return false;
71
+ }
72
+ this.isSubmitted = true;
73
+ this._submit();
74
+ }
75
+ displayLoadingMask();
76
+ return true;
77
+ }
78
+ return false;
79
+ };
80
+
81
+ categoryForm.refreshPath = function () {
82
+
83
+ categoryId = this.getCategoryId();
84
+
85
+ if (!categoryId) {
86
+ return false;
87
+ }
88
+
89
+ var refreshPathSuccess = function(transport) {
90
+ if (transport.responseText.isJSON()) {
91
+ response = transport.responseText.evalJSON()
92
+ if (response.error) {
93
+ alert(response.message);
94
+ } else {
95
+ if (categoryForm.getCategoryId() == response['id']) {
96
+ categoryForm.setCategoryPath(response['path']);
97
+ }
98
+ }
99
+ }
100
+ };
101
+
102
+ new Ajax.Request(
103
+ '<?php echo $this->getRefreshPathUrl() ?>',
104
+ {
105
+ method: 'POST',
106
+ evalScripts: true,
107
+ onSuccess: refreshPathSuccess
108
+ }
109
+ );
110
+
111
+ };
112
+
113
+ categoryForm.getCategoryId = function () {
114
+ collection = $(this.formId).getInputs('hidden','general[id]');
115
+ if (collection.size() > 0) {
116
+ return collection.first().value;
117
+ }
118
+ return false;
119
+ };
120
+
121
+ categoryForm.setCategoryPath = function (path) {
122
+ collection = $(this.formId).getInputs('hidden','general[path]');
123
+ if (collection.size() > 0) {
124
+ return collection.first().value = path;
125
+ }
126
+ };
127
+
128
+ /**
129
+ * Create/edit some category
130
+ */
131
+ function categorySubmit(url, useAjax) {
132
+ var activeTab = $('active_tab_id');
133
+ if (activeTab) {
134
+ if (activeTab.tabsJsObject && activeTab.tabsJsObject.activeTab) {
135
+ activeTab.value = activeTab.tabsJsObject.activeTab.id;
136
+ }
137
+ }
138
+
139
+ var params = {};
140
+ var fields = $('category_edit_form').getElementsBySelector('input', 'select');
141
+ for(var i=0;i<fields.length;i++){
142
+ if (!fields[i].name) {
143
+ continue;
144
+ }
145
+ params[fields[i].name] = fields[i].getValue();
146
+ }
147
+
148
+ // Get info about what we're submitting - to properly update tree nodes
149
+ var categoryId = params['general[id]'] ? params['general[id]'] : 0;
150
+ var isCreating = categoryId == 0; // Separate variable is needed because '0' in javascript converts to TRUE
151
+ var path = params['general[path]'].split('/');
152
+ var parentId = path.pop();
153
+ if (parentId == categoryId) { // Maybe path includes category id itself
154
+ parentId = path.pop();
155
+ }
156
+
157
+ // Make operations with category tree
158
+ if (isCreating) {
159
+ /* Some specific tasks for creating category */
160
+ if (!tree.currentNodeId) {
161
+ // First submit of form - select some node to be current
162
+ tree.currentNodeId = parentId;
163
+ }
164
+ tree.addNodeTo = parentId;
165
+ } else {
166
+ /* Some specific tasks for editing category */
167
+ // Maybe change category enabled/disabled style
168
+ if (tree && tree.storeId==0) {
169
+ var currentNode = tree.getNodeById(categoryId);
170
+
171
+ if (currentNode) {
172
+ if (parseInt(params['general[is_active]'])) {
173
+ var oldClass = 'no-active-category';
174
+ var newClass = 'active-category';
175
+ } else {
176
+ var oldClass = 'active-category';
177
+ var newClass = 'no-active-category';
178
+ }
179
+
180
+ Element.removeClassName(currentNode.ui.wrap.firstChild, oldClass);
181
+ Element.addClassName(currentNode.ui.wrap.firstChild, newClass);
182
+ }
183
+ }
184
+ }
185
+
186
+ // Submit form
187
+ categoryForm.submit();
188
+ }
189
+
190
+ <?php if(($block = $this->getLayout()->getBlock('category.product.grid')) && ($_gridJsObject=$block->getJsObjectName())): ?>
191
+
192
+ var categoryProducts = $H(<?php echo $this->getProductsJson() ?>);
193
+ $('in_category_products').value = categoryProducts.toQueryString();
194
+
195
+ function registerCategoryProduct(grid, element, checked){
196
+ if(checked){
197
+ if(element.positionElement){
198
+ element.positionElement.disabled = false;
199
+ categoryProducts.set(element.value, element.positionElement.value);
200
+ }
201
+ }
202
+ else{
203
+ if(element.positionElement){
204
+ element.positionElement.disabled = true;
205
+ }
206
+ categoryProducts.unset(element.value);
207
+ }
208
+ $('in_category_products').value = categoryProducts.toQueryString();
209
+ grid.reloadParams = {'selected_products[]':categoryProducts.keys()};
210
+ }
211
+ function categoryProductRowClick(grid, event){
212
+ var trElement = Event.findElement(event, 'tr');
213
+ var isInput = Event.element(event).tagName == 'INPUT';
214
+ if(trElement){
215
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
216
+ if(checkbox[0]){
217
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
218
+ <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);
219
+ }
220
+ }
221
+ }
222
+ function positionChange(event){
223
+ var element = Event.element(event);
224
+ if(element && element.checkboxElement && element.checkboxElement.checked){
225
+ categoryProducts.set(element.checkboxElement.value, element.value);
226
+ $('in_category_products').value = categoryProducts.toQueryString();
227
+ }
228
+ }
229
+
230
+ var tabIndex = 1000;
231
+ function categoryProductRowInit(grid, row){
232
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
233
+ var position = $(row).getElementsByClassName('input-text')[0];
234
+ if(checkbox && position){
235
+ checkbox.positionElement = position;
236
+ position.checkboxElement = checkbox;
237
+ position.disabled = !checkbox.checked;
238
+ position.tabIndex = tabIndex++;
239
+ Event.observe(position,'keyup',positionChange);
240
+ }
241
+ }
242
+
243
+
244
+ <?php echo $_gridJsObject ?>.rowClickCallback = categoryProductRowClick;
245
+ <?php echo $_gridJsObject ?>.initRowCallback = categoryProductRowInit;
246
+ <?php echo $_gridJsObject ?>.checkboxCheckCallback = registerCategoryProduct;
247
+ <?php echo $_gridJsObject ?>.rows.each(function(row){categoryProductRowInit(<?php echo $_gridJsObject ?>, row)});
248
+
249
+ <?php endif; ?>
250
+ <?php if($this->isAjax() && ($block = $this->getLayout()->getBlock('tabs')) && ($_tabsJsObject=$block->getJsObjectName())): ?>
251
+ <?php echo $_tabsJsObject ?>.moveTabContentInDest();
252
+ if (<?php echo $_tabsJsObject ?>.activeTab) {
253
+ $('active_tab_id').value = <?php echo $_tabsJsObject ?>.activeTab.id;
254
+ }
255
+ $('active_tab_id').tabsJsObject = <?php echo $_tabsJsObject ?>;
256
+ <?php endif; ?>
257
+ //]]>
258
+ </script>
app/design/adminhtml/default/default/template/catalog/category/tree.phtml ADDED
@@ -0,0 +1,480 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="categories-side-col">
28
+ <div class="content-header">
29
+ <h3 class="icon-head head-categories"><?php echo Mage::helper('catalog')->__('Categories') ?></h3>
30
+ <?php if ($this->getRoot()): ?>
31
+ <?php echo $this->getAddRootButtonHtml() ?><br />
32
+ <?php echo $this->getAddSubButtonHtml() ?>
33
+ <?php endif; ?>
34
+ </div>
35
+ <?php echo $this->getStoreSwitcherHtml();?>
36
+ <div class="tree-actions">
37
+ <?php if($this->getRoot()): ?>
38
+ <?php //echo $this->getCollapseButtonHtml() ?>
39
+ <?php //echo $this->getExpandButtonHtml() ?>
40
+ <a href="#" onclick="tree.collapseTree(); return false;"><?php echo Mage::helper('catalog')->__('Collapse All'); ?></a> <span class="separator">|</span> <a href="#" onclick="tree.expandTree(); return false;"><?php echo Mage::helper('catalog')->__('Expand All'); ?></a>
41
+ <?php endif; ?>
42
+ </div>
43
+ <?php if ($this->getRoot()): ?>
44
+ <div class="tree-holder">
45
+ <div id="tree-div" style="width:100%; overflow:auto;"></div>
46
+ </div>
47
+ </div>
48
+ <script type="text/javascript">
49
+ //<![CDATA[
50
+ var tree;
51
+
52
+ /**
53
+ * Fix ext compatibility with prototype 1.6
54
+ */
55
+ Ext.lib.Event.getTarget = function(e) {
56
+ var ee = e.browserEvent || e;
57
+ return ee.target ? Event.element(ee) : null;
58
+ };
59
+
60
+ Ext.tree.TreePanel.Enhanced = function(el, config)
61
+ {
62
+ Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);
63
+ };
64
+
65
+ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
66
+
67
+ loadTree : function(config, firstLoad)
68
+ {
69
+ var parameters = config['parameters'];
70
+ var data = config['data'];
71
+
72
+ this.storeId = parameters['store_id'];
73
+
74
+ if ( this.storeId != 0 && $('add_root_category_button')) {
75
+ $('add_root_category_button').hide();
76
+ }
77
+
78
+ if ((typeof parameters['root_visible']) != 'undefined') {
79
+ this.rootVisible = parameters['root_visible']*1;
80
+ }
81
+
82
+ var root = new Ext.tree.TreeNode(parameters);
83
+
84
+ this.nodeHash = {};
85
+ this.setRootNode(root);
86
+
87
+ if (firstLoad) {
88
+ this.addListener('click', this.categoryClick);
89
+ this.addListener('beforenodedrop', categoryMove.createDelegate(this));
90
+ }
91
+
92
+ this.loader.buildCategoryTree(root, data);
93
+ this.el.dom.innerHTML = '';
94
+ // render the tree
95
+ this.render();
96
+ if (parameters['expanded']) {
97
+ this.expandAll();
98
+ } else {
99
+ root.expand();
100
+ }
101
+
102
+ var selectedNode = this.getNodeById(parameters['category_id']);
103
+ if (selectedNode) {
104
+ this.currentNodeId = parameters['category_id'];
105
+ }
106
+ this.selectCurrentNode();
107
+ },
108
+
109
+ request : function(url, params)
110
+ {
111
+ if (!params) {
112
+ if (category_info_tabsJsTabs.activeTab) {
113
+ var params = {active_tab_id:category_info_tabsJsTabs.activeTab.id};
114
+ }
115
+ else {
116
+ var params = {};
117
+ }
118
+ }
119
+ if (!params.form_key) {
120
+ params.form_key = FORM_KEY;
121
+ }
122
+ var result = new Ajax.Request(
123
+ url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ),
124
+ {
125
+ parameters: params,
126
+ method: 'post'
127
+ }
128
+ );
129
+
130
+ return result;
131
+ },
132
+
133
+ selectCurrentNode : function()
134
+ {
135
+ if (this.currentNodeId) {
136
+ var selectedNode = this.getNodeById(this.currentNodeId);
137
+ if ((typeof selectedNode.attributes.path)!='undefined') {
138
+ var path = selectedNode.attributes.path;
139
+ if (!this.storeId) {
140
+ path = '0/'+path;
141
+ }
142
+ this.selectPath(path);
143
+ } else {
144
+ this.getSelectionModel().select(selectedNode);
145
+ }
146
+ }
147
+ },
148
+
149
+ collapseTree : function()
150
+ {
151
+ this.collapseAll();
152
+
153
+ this.selectCurrentNode();
154
+
155
+ if (!this.collapsed) {
156
+ this.collapsed = true;
157
+ this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(false) ?>';
158
+ this.request(this.loader.dataUrl, false);
159
+ }
160
+ },
161
+
162
+ expandTree : function()
163
+ {
164
+ this.expandAll();
165
+ if (this.collapsed) {
166
+ this.collapsed = false;
167
+ this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(true) ?>';
168
+ this.request(this.loader.dataUrl, false);
169
+ }
170
+ },
171
+
172
+ categoryClick : function(node, e)
173
+ {
174
+ var baseUrl = '<?php echo $this->getEditUrl() ?>';
175
+ var urlExt = (this.storeId?'store/'+this.storeId+'/':'')+'id/'+node.id+'/';
176
+ var url = parseSidUrl(baseUrl, urlExt);
177
+
178
+ this.currentNodeId = node.id;
179
+ if (!this.useAjax) {
180
+ setLocation(url);
181
+ return;
182
+ }
183
+ if (category_info_tabsJsTabs.activeTab) {
184
+ var params = {active_tab_id:category_info_tabsJsTabs.activeTab.id};
185
+ }
186
+ updateContent(url, params);
187
+ }
188
+ });
189
+
190
+ function reRenderTree(event, switcher)
191
+ {
192
+ // re-render tree by store switcher
193
+ if (tree && event) {
194
+ var obj = event.target;
195
+ var newStoreId = obj.value * 1;
196
+ var storeParam = newStoreId ? 'store/'+newStoreId + '/' : '';
197
+
198
+ if (obj.switchParams) {
199
+ storeParam += obj.switchParams;
200
+ }
201
+ if (switcher.useConfirm) {
202
+ if (!confirm("<?php echo $this->__('Please confirm site switching. All data that hasn\'t been saved will be lost.') ?>")){
203
+ obj.value = '<?php echo (int) $this->getStoreId() ?>';
204
+ return false;
205
+ }
206
+ }
207
+
208
+ if ($('add_root_category_button')) {
209
+ if (newStoreId == 0) {
210
+ $('add_root_category_button').show();
211
+ }
212
+ else {
213
+ $('add_root_category_button').hide();
214
+ }
215
+ }
216
+
217
+ // retain current selected category id
218
+ storeParam = storeParam + 'id/' + tree.currentNodeId + '/';
219
+ var url = tree.switchTreeUrl + storeParam;
220
+
221
+ // load from cache
222
+ // load from ajax
223
+ new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
224
+ parameters : {store: newStoreId, form_key: FORM_KEY},
225
+ method : 'post',
226
+ onComplete : function(transport) {
227
+ var response = eval('(' + transport.responseText + ')');
228
+ if (!response['parameters']) {
229
+ return false;
230
+ }
231
+
232
+ _renderNewTree(response, storeParam);
233
+ }
234
+ });
235
+ }
236
+ // render default tree
237
+ else {
238
+ _renderNewTree();
239
+ }
240
+ }
241
+
242
+ function _renderNewTree(config, storeParam)
243
+ {
244
+ if (!config) {
245
+ var config = defaultLoadTreeParams;
246
+ }
247
+ if (tree) {
248
+ tree.purgeListeners();
249
+ tree.el.dom.innerHTML = '';
250
+ }
251
+ tree = new Ext.tree.TreePanel.Enhanced('tree-div', newTreeParams);
252
+ tree.loadTree(config, true);
253
+
254
+ // try to select current category
255
+ var selectedNode = tree.getNodeById(config.parameters.category_id);
256
+ if (selectedNode) {
257
+ tree.currentNodeId = config.parameters.category_id;
258
+ }
259
+ tree.selectCurrentNode();
260
+
261
+ // update content area
262
+ var url = tree.editUrl;
263
+ if (storeParam) {
264
+ url = url + storeParam;
265
+ }
266
+ <?php if ($this->isClearEdit()):?>
267
+ if (selectedNode) {
268
+ url = url + 'id/' + config.parameters.category_id;
269
+ }
270
+ <?php endif;?>
271
+ updateContent(url);
272
+ }
273
+
274
+ Ext.onReady(function()
275
+ {
276
+ categoryLoader = new Ext.tree.TreeLoader({
277
+ dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'
278
+ });
279
+
280
+ categoryLoader.createNode = function(config) {
281
+ var node;
282
+ var _node = Object.clone(config);
283
+ if (config.children && !config.children.length) {
284
+ delete(config.children);
285
+ node = new Ext.tree.AsyncTreeNode(config);
286
+ } else {
287
+ node = new Ext.tree.TreeNode(config);
288
+ }
289
+
290
+ return node;
291
+ };
292
+
293
+ categoryLoader.buildCategoryTree = function(parent, config)
294
+ {
295
+ if (!config) return null;
296
+
297
+ if (parent && config && config.length){
298
+ for (var i = 0; i < config.length; i++) {
299
+ var node;
300
+ var _node = Object.clone(config[i]);
301
+ if (_node.children && !_node.children.length) {
302
+ delete(_node.children);
303
+ node = new Ext.tree.AsyncTreeNode(_node);
304
+ } else {
305
+ node = new Ext.tree.TreeNode(config[i]);
306
+ }
307
+ parent.appendChild(node);
308
+ node.loader = node.getOwnerTree().loader;
309
+ if (_node.children) {
310
+ this.buildCategoryTree(node, _node.children);
311
+ }
312
+ }
313
+ }
314
+ };
315
+
316
+ categoryLoader.buildHash = function(node)
317
+ {
318
+ var hash = {};
319
+
320
+ hash = this.toArray(node.attributes);
321
+
322
+ if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {
323
+ hash['children'] = new Array;
324
+
325
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
326
+ if (!hash['children']) {
327
+ hash['children'] = new Array;
328
+ }
329
+ hash['children'].push(this.buildHash(node.childNodes[i]));
330
+ }
331
+ }
332
+
333
+ return hash;
334
+ };
335
+
336
+ categoryLoader.toArray = function(attributes) {
337
+ var data = {form_key: FORM_KEY};
338
+ for (var key in attributes) {
339
+ var value = attributes[key];
340
+ data[key] = value;
341
+ }
342
+
343
+ return data;
344
+ };
345
+
346
+ categoryLoader.on("beforeload", function(treeLoader, node) {
347
+ treeLoader.baseParams.id = node.attributes.id;
348
+ treeLoader.baseParams.store = node.attributes.store;
349
+ treeLoader.baseParams.form_key = FORM_KEY;
350
+ });
351
+
352
+ categoryLoader.on("load", function(treeLoader, node, config) {
353
+ varienWindowOnload();
354
+ });
355
+
356
+ if ((typeof varienStoreSwitcher)!='undefined') {
357
+ varienStoreSwitcher.storeSelectorClickCallback = reRenderTree;
358
+ }
359
+
360
+ newTreeParams = {
361
+ animate : false,
362
+ loader : categoryLoader,
363
+ enableDD : true,
364
+ containerScroll : true,
365
+ selModel : new Ext.tree.CheckNodeMultiSelectionModel(),
366
+ rootVisible : '<?php echo $this->getRoot()->getIsVisible() ?>',
367
+ useAjax : <?php echo $this->getUseAjax() ?>,
368
+ switchTreeUrl : '<?php echo $this->getSwitchTreeUrl() ?>',
369
+ editUrl : '<?php echo $this->getEditUrl() ?>',
370
+ currentNodeId : <?php echo (int) $this->getCategoryId() ?>
371
+ };
372
+
373
+ defaultLoadTreeParams = {
374
+ parameters : {
375
+ text : '<?php echo htmlentities($this->getRoot()->getName()) ?>',
376
+ draggable : false,
377
+ allowDrop : <?php if ($this->getRoot()->getIsVisible()): ?>true<?php else : ?>false<?php endif; ?>,
378
+ id : <?php echo (int) $this->getRoot()->getId() ?>,
379
+ expanded : <?php echo (int) $this->getIsWasExpanded() ?>,
380
+ store_id : <?php echo (int) $this->getStore()->getId() ?>,
381
+ category_id : <?php echo (int) $this->getCategoryId() ?>
382
+ },
383
+ data : <?php echo $this->getTreeJson() ?>
384
+ };
385
+
386
+ reRenderTree();
387
+ });
388
+
389
+ function addNew(url, isRoot)
390
+ {
391
+ if (isRoot) {
392
+ tree.currentNodeId = tree.root.id;
393
+ }
394
+
395
+ if (/store\/\d+/.test(url)) {
396
+ url = url.replace(/store\/\d+/, "store/" + tree.storeId);
397
+ }
398
+ else {
399
+ url+= "store/" + tree.storeId + "/";
400
+ }
401
+
402
+ url+= 'parent/'+tree.currentNodeId;
403
+ updateContent(url);
404
+ }
405
+
406
+ function categoryMove(obj)
407
+ {
408
+ var data = {id: obj.dropNode.id, form_key: FORM_KEY};
409
+
410
+ data.point = obj.point;
411
+ switch (obj.point) {
412
+ case 'above' :
413
+ data.pid = obj.target.parentNode.id;
414
+ data.paid = obj.dropNode.parentNode.id;
415
+ if (obj.target.previousSibling) {
416
+ data.aid = obj.target.previousSibling.id;
417
+ } else {
418
+ data.aid = 0;
419
+ }
420
+ break;
421
+ case 'below' :
422
+ data.pid = obj.target.parentNode.id;
423
+ data.aid = obj.target.id;
424
+ break;
425
+ case 'append' :
426
+ data.pid = obj.target.id;
427
+ data.paid = obj.dropNode.parentNode.id;
428
+ if (obj.target.lastChild) {
429
+ data.aid = obj.target.lastChild.id;
430
+ } else {
431
+ data.aid = 0;
432
+ }
433
+ break;
434
+ default :
435
+ obj.cancel = true;
436
+ return obj;
437
+ }
438
+
439
+ var success = function(o) {
440
+ try {
441
+ if(o.responseText){
442
+ if(o.responseText==='SUCCESS'){
443
+ categoryForm.refreshPath();
444
+ } else {
445
+ alert(o.responseText);
446
+ location.reload();
447
+ }
448
+ }
449
+ }
450
+ catch(e) {
451
+ }
452
+ };
453
+
454
+ var failure = function(o) {
455
+ try {
456
+ console.log(o.statusText);
457
+ } catch (e2) {
458
+ alert(o.statusText);
459
+ }
460
+ location.reload();
461
+ };
462
+
463
+ var pd = [];
464
+ for(var key in data) {
465
+ pd.push(encodeURIComponent(key), "=", encodeURIComponent(data[key]), "&");
466
+ }
467
+ pd.splice(pd.length-1,1);
468
+ new Ajax.Request(
469
+ '<?php echo $this->getMoveUrl() ?>',
470
+ {
471
+ method: 'POST',
472
+ parameters: pd.join(""),
473
+ onSuccess : success,
474
+ onFailure : failure
475
+ }
476
+ );
477
+ }
478
+ //]]>
479
+ </script>
480
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/category/widget/tree.phtml ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php $_divId = 'tree' . $this->getId() ?>
29
+ <div id="<?php echo $_divId ?>" class="tree"></div>
30
+
31
+ <script type="text/javascript">
32
+ //<![CDATA[
33
+
34
+ var tree<?php echo $this->getId() ?>;
35
+
36
+ var useMassaction = <?php echo $this->getUseMassaction()?1:0; ?>;
37
+
38
+ var isAnchorOnly = <?php echo $this->getIsAnchorOnly()?1:0; ?>;
39
+
40
+ Ext.tree.TreePanel.Enhanced = function(el, config)
41
+ {
42
+ Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);
43
+ };
44
+
45
+ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
46
+
47
+ loadTree : function(config, firstLoad)
48
+ {
49
+ var parameters = config['parameters'];
50
+ var data = config['data'];
51
+
52
+ if ((typeof parameters['root_visible']) != 'undefined') {
53
+ this.rootVisible = parameters['root_visible']*1;
54
+ }
55
+
56
+ var root = new Ext.tree.TreeNode(parameters);
57
+
58
+ this.nodeHash = {};
59
+ this.setRootNode(root);
60
+
61
+ if (firstLoad) {
62
+ <?php if ($this->getNodeClickListener()): ?>
63
+ this.addListener('click', <?php echo $this->getNodeClickListener() ?>.createDelegate(this));
64
+ <?php endif; ?>
65
+ }
66
+
67
+ this.loader.buildCategoryTree(root, data);
68
+ this.el.dom.innerHTML = '';
69
+ // render the tree
70
+ this.render();
71
+ }
72
+ });
73
+
74
+ Ext.onReady(function()
75
+ {
76
+ var emptyNodeAdded = <?php echo ($this->getWithEmptyNode() ? 'false' : 'true') ?>;
77
+
78
+ var categoryLoader = new Ext.tree.TreeLoader({
79
+ dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'
80
+ });
81
+
82
+ categoryLoader.buildCategoryTree = function(parent, config)
83
+ {
84
+ if (!config) return null;
85
+
86
+
87
+ if (parent && config && config.length){
88
+ for (var i = 0; i < config.length; i++) {
89
+ var node;
90
+ if (useMassaction && config[i].is_anchor == isAnchorOnly) {
91
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
92
+ }
93
+ var _node = Object.clone(config[i]);
94
+
95
+ // Add empty node to reset category filter
96
+ if(!emptyNodeAdded) {
97
+ var empty = Object.clone(_node);
98
+ empty.text = '<?php echo $this->__('None') ?>';
99
+ empty.children = [];
100
+ empty.id = 'none';
101
+ empty.path = '1/none';
102
+ empty.cls = 'leaf';
103
+ parent.appendChild(new Ext.tree.TreeNode(empty));
104
+ emptyNodeAdded = true;
105
+ }
106
+
107
+ if (_node.children && !_node.children.length) {
108
+ delete(_node.children);
109
+ node = new Ext.tree.AsyncTreeNode(_node);
110
+ } else {
111
+ node = new Ext.tree.TreeNode(config[i]);
112
+ }
113
+ parent.appendChild(node);
114
+ node.loader = node.getOwnerTree().loader;
115
+ node.loader = node.getOwnerTree().loader;
116
+ if (_node.children) {
117
+ this.buildCategoryTree(node, _node.children);
118
+ }
119
+ }
120
+ }
121
+ };
122
+
123
+ categoryLoader.createNode = function(config) {
124
+ var node;
125
+ if (useMassaction && config.is_anchor == isAnchorOnly) {
126
+ config.uiProvider = Ext.tree.CheckboxNodeUI;
127
+ }
128
+ var _node = Object.clone(config);
129
+ if (config.children && !config.children.length) {
130
+ delete(config.children);
131
+ node = new Ext.tree.AsyncTreeNode(config);
132
+ } else {
133
+ node = new Ext.tree.TreeNode(config);
134
+ }
135
+ return node;
136
+ };
137
+
138
+ categoryLoader.buildHash = function(node)
139
+ {
140
+ var hash = {};
141
+
142
+ hash = this.toArray(node.attributes);
143
+
144
+ if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {
145
+ hash['children'] = new Array;
146
+
147
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
148
+ if (!hash['children']) {
149
+ hash['children'] = new Array;
150
+ }
151
+ hash['children'].push(this.buildHash(node.childNodes[i]));
152
+ }
153
+ }
154
+
155
+ return hash;
156
+ };
157
+
158
+ categoryLoader.toArray = function(attributes) {
159
+ var data = {};
160
+ for (var key in attributes) {
161
+ var value = attributes[key];
162
+ data[key] = value;
163
+ }
164
+
165
+ return data;
166
+ };
167
+
168
+ categoryLoader.on("beforeload", function(treeLoader, node) {
169
+ treeLoader.baseParams.id = node.attributes.id;
170
+ });
171
+
172
+ tree<?php echo $this->getId() ?> = new Ext.tree.TreePanel.Enhanced('<?php echo $_divId ?>', {
173
+ animate: false,
174
+ loader: categoryLoader,
175
+ enableDD: false,
176
+ containerScroll: true,
177
+ rootVisible: '<?php echo $this->getRoot()->getIsVisible() ?>',
178
+ useAjax: true,
179
+ currentNodeId: <?php echo (int) $this->getCategoryId() ?>,
180
+ addNodeTo: false
181
+ });
182
+
183
+ if (useMassaction) {
184
+ tree<?php echo $this->getId() ?>.on('check', function(node) {
185
+ $('<?php echo $_divId; ?>').fire('node:changed', {node:node});
186
+ }, tree<?php echo $this->getId() ?>);
187
+ }
188
+
189
+ // set the root node
190
+ var parameters = {
191
+ text: 'Psw',
192
+ draggable: false,
193
+ id: <?php echo (int) $this->getRoot()->getId() ?>,
194
+ expanded: <?php echo (int) $this->getIsWasExpanded() ?>,
195
+ category_id: <?php echo (int) $this->getCategoryId() ?>
196
+ };
197
+
198
+ tree<?php echo $this->getId() ?>.loadTree({parameters:parameters, data:<?php echo $this->getTreeJson() ?>},true);
199
+
200
+ });
201
+ //]]>
202
+ </script>
app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element
30
+ */
31
+ ?>
32
+ <?php $_element = $this->getElement() ?>
33
+ <?php $this->checkFieldDisable() ?>
34
+
35
+ <?php if ($_element->getType()=='hidden'): ?>
36
+ <tr>
37
+ <td class="hidden" colspan="100"><?php echo trim($_element->getElementHtml()) ?></td>
38
+ </tr>
39
+ <?php else: ?>
40
+ <tr>
41
+ <td class="label"><?php echo trim($this->getElementLabelHtml()) ?></td>
42
+ <td class="value">
43
+ <?php echo trim($this->getElementHtml()) ?>
44
+ <?php if ($_element->getNote()) : ?>
45
+ <p class="note"><?php echo $_element->getNote() ?></p>
46
+ <?php endif; ?>
47
+ </td>
48
+ <td class="scope-label"><span class="nobr"><?php echo $this->getScopeLabel() ?></span></td>
49
+ <?php if ($this->canDisplayUseDefault()): ?>
50
+ <td class="value use-default">
51
+ <input <?php if($_element->getReadonly()):?> disabled="disabled"<?php endif; ?> type="checkbox" name="use_default[]" id="<?php echo $_element->getHtmlId() ?>_default"<?php if ($this->usedDefault()): ?> checked="checked"<?php endif; ?> onclick="toggleValueElements(this, this.parentNode.parentNode)" value="<?php echo $this->getAttributeCode() ?>"/>
52
+ <label for="<?php echo $_element->getHtmlId() ?>_default" class="normal"><?php echo $this->__('Use Default Value') ?></label>
53
+ </td>
54
+ <?php endif; ?>
55
+ </tr>
56
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/product.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Catalog_Product
30
+ */
31
+ ?>
32
+ <div class="content-header">
33
+ <table cellspacing="0">
34
+ <tr>
35
+ <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('catalog')->__('Manage Products') ?></h3></td>
36
+ <td class="a-right">
37
+ <?php echo $this->getButtonsHtml() ?>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
42
+ <?php if( !$this->isSingleStoreMode() ): ?>
43
+ <?php echo $this->getChildHtml('store_switcher');?>
44
+ <?php endif;?>
45
+ <div>
46
+ <?php echo $this->getGridHtml() ?>
47
+ </div>
app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ function saveAndContinueEdit(){
30
+ disableElements('save');
31
+ var activeTab = product_attribute_tabsJsTabs.activeTab.id;
32
+ if (editForm.submit($('edit_form').action+'back/edit/tab/' + activeTab) == false) {
33
+ enableElements('save');
34
+ }
35
+ varienGlobalEvents.attachEventHandler('formValidateAjaxComplete', function (){
36
+ enableElements('save');
37
+ });
38
+ }
39
+
40
+ function saveAttribute(){
41
+ disableElements('save');
42
+ if (editForm.submit() == false){
43
+ enableElements('save');
44
+ }
45
+ varienGlobalEvents.attachEventHandler('formValidateAjaxComplete', function (){
46
+ enableElements('save');
47
+ });
48
+ }
49
+
50
+ function toggleApplyVisibility(select) {
51
+ if ($(select).value == 1) {
52
+ $(select).next('select').removeClassName('no-display');
53
+ $(select).next('select').removeClassName('ignore-validate');
54
+
55
+ } else {
56
+ $(select).next('select').addClassName('no-display');
57
+ $(select).next('select').addClassName('ignore-validate');
58
+ var options = $(select).next('select').options;
59
+ for( var i=0; i < options.length; i++) {
60
+ options[i].selected = false;
61
+ }
62
+ }
63
+ }
64
+
65
+ function checkOptionsPanelVisibility(){
66
+ if($('matage-options-panel')){
67
+ var panel = $('matage-options-panel');
68
+ if($('frontend_input') && ($('frontend_input').value=='select' || $('frontend_input').value=='multiselect')){
69
+ panel.show();
70
+ }
71
+ else {
72
+ panel.hide();
73
+ }
74
+ }
75
+ }
76
+
77
+ function bindAttributeInputType()
78
+ {
79
+ checkOptionsPanelVisibility();
80
+ switchDefaultValueField();
81
+ checkIsConfigurableVisibility();
82
+ if($('frontend_input') && ($('frontend_input').value=='select' || $('frontend_input').value=='multiselect' || $('frontend_input').value=='price')){
83
+ if($('is_filterable') && !$('is_filterable').getAttribute('readonly')){
84
+ $('is_filterable').disabled = false;
85
+ }
86
+ if($('is_filterable_in_search') && !$('is_filterable_in_search').getAttribute('readonly')){
87
+ $('is_filterable_in_search').disabled = false;
88
+ }
89
+ if($('backend_type') && $('backend_type').options){
90
+ for(var i=0;i<$('backend_type').options.length;i++){
91
+ if($('backend_type').options[i].value=='int') $('backend_type').selectedIndex = i;
92
+ }
93
+ }
94
+ }
95
+ else {
96
+ if($('is_filterable')){
97
+ $('is_filterable').selectedIndex=0;
98
+ $('is_filterable').disabled = true;
99
+ }
100
+ if($('is_filterable_in_search')){
101
+ $('is_filterable_in_search').disabled = true;
102
+ }
103
+ }
104
+
105
+ if ($('frontend_input') && ($('frontend_input').value=='multiselect'
106
+ || $('frontend_input').value=='gallery'
107
+ || $('frontend_input').value=='textarea')) {
108
+ if ($('used_for_sort_by')) {
109
+ $('used_for_sort_by').disabled = true;
110
+ }
111
+ }
112
+ else {
113
+ if ($('used_for_sort_by') && !$('used_for_sort_by').getAttribute('readonly')) {
114
+ $('used_for_sort_by').disabled = false;
115
+ }
116
+ }
117
+
118
+ setRowVisibility('is_wysiwyg_enabled', false);
119
+ setRowVisibility('is_html_allowed_on_front', false);
120
+
121
+ switch ($('frontend_input').value) {
122
+ case 'textarea':
123
+ setRowVisibility('is_wysiwyg_enabled', true);
124
+ if($('is_wysiwyg_enabled').value == '0'){
125
+ setRowVisibility('is_html_allowed_on_front', true);
126
+ $('is_html_allowed_on_front').disabled = false;
127
+ }
128
+ $('frontend_class').value = '';
129
+ $('frontend_class').disabled = true;
130
+ break;
131
+ case 'text':
132
+ setRowVisibility('is_html_allowed_on_front', true);
133
+ $('is_html_allowed_on_front').disabled = false;
134
+
135
+ if (!$('frontend_class').getAttribute('readonly')) {
136
+ $('frontend_class').disabled = false;
137
+ }
138
+ break;
139
+ case 'select':
140
+ case 'multiselect':
141
+ setRowVisibility('is_html_allowed_on_front', true);
142
+ $('is_html_allowed_on_front').disabled = false;
143
+ break;
144
+ default:
145
+ $('frontend_class').value = '';
146
+ $('frontend_class').disabled = true;
147
+ }
148
+
149
+ switchIsFilterable();
150
+ }
151
+
152
+ function switchIsFilterable()
153
+ {
154
+ if ($('is_filterable')) {
155
+ if ($('is_filterable').selectedIndex == 0) {
156
+ $('position').disabled = true;
157
+ } else {
158
+ if (!$('position').getAttribute('readonly')){
159
+ $('position').disabled = false;
160
+ }
161
+ }
162
+ }
163
+ }
164
+
165
+ function disableApplyToValue(value)
166
+ {
167
+ var applyToSelect = $('apply_to');
168
+ for (i=0;i<applyToSelect.options.length;i++) {
169
+ if (value == applyToSelect.options[i].value) {
170
+ applyToSelect.options[i].disabled = true;
171
+ applyToSelect.options[i].selected = false;
172
+ }
173
+ }
174
+ }
175
+
176
+ function switchDefaultValueField()
177
+ {
178
+ if (!$('frontend_input')) {
179
+ return;
180
+ }
181
+
182
+ var currentValue = $('frontend_input').value;
183
+
184
+ var defaultValueTextVisibility = false;
185
+ var defaultValueTextareaVisibility = false;
186
+ var defaultValueDateVisibility = false;
187
+ var defaultValueYesnoVisibility = false;
188
+ var scopeVisibility = true;
189
+
190
+ switch (currentValue) {
191
+ case 'select':
192
+ optionDefaultInputType = 'radio';
193
+ break;
194
+
195
+ case 'multiselect':
196
+ optionDefaultInputType = 'checkbox';
197
+ break;
198
+
199
+ case 'date':
200
+ defaultValueDateVisibility = true;
201
+ break;
202
+
203
+ case 'boolean':
204
+ defaultValueYesnoVisibility = true;
205
+ break;
206
+
207
+ case 'textarea':
208
+ defaultValueTextareaVisibility = true;
209
+ break;
210
+
211
+ case 'media_image':
212
+ defaultValueTextVisibility = false;
213
+ break;
214
+ case 'price':
215
+ scopeVisibility = false;
216
+ default:
217
+ defaultValueTextVisibility = true;
218
+ break;
219
+ }
220
+
221
+ var applyToSelect = $('apply_to');
222
+ switch (currentValue) {
223
+ <?php foreach (Mage::helper('catalog')->getAttributeDisabledTypes() as $type=>$disabled): ?>
224
+ case '<?php echo $type; ?>':
225
+ <?php foreach ($disabled as $one): ?>
226
+ disableApplyToValue('<?php echo $one; ?>');
227
+ <?php endforeach; ?>
228
+ break;
229
+ <?php endforeach; ?>
230
+ default:
231
+ for (i=0;i<applyToSelect.options.length;i++) {
232
+ applyToSelect.options[i].disabled = false;
233
+ }
234
+ break;
235
+ }
236
+
237
+ switch (currentValue) {
238
+ case 'media_image':
239
+ $('front_fieldset').previous().hide();
240
+ $('front_fieldset').hide();
241
+
242
+ setRowVisibility('is_required', false);
243
+ setRowVisibility('is_unique', false);
244
+ setRowVisibility('frontend_class', false);
245
+ break;
246
+
247
+ <?php foreach (Mage::helper('catalog')->getAttributeHiddenFields() as $type=>$fields): ?>
248
+ case '<?php echo $type; ?>':
249
+ <?php foreach ($fields as $one): ?>
250
+ <?php if ($one == '_front_fieldset'): ?>
251
+ $('front_fieldset').previous().hide();
252
+ $('front_fieldset').hide();
253
+ <?php elseif ($one == '_default_value'): ?>
254
+ defaultValueTextVisibility =
255
+ defaultValueTextareaVisibility =
256
+ defaultValueDateVisibility =
257
+ defaultValueYesnoVisibility = false;
258
+ <?php elseif ($one == '_scope'): ?>
259
+ scopeVisibility = false;
260
+ <?php else: ?>
261
+ setRowVisibility('<?php echo $one; ?>', false);
262
+ <?php endif; ?>
263
+ <?php endforeach; ?>
264
+ break;
265
+ <?php endforeach; ?>
266
+
267
+ default:
268
+ $('front_fieldset').previous().show();
269
+ $('front_fieldset').show();
270
+ setRowVisibility('is_required', true);
271
+ setRowVisibility('is_unique', true);
272
+ setRowVisibility('frontend_class', true);
273
+ setRowVisibility('is_configurable', true);
274
+ break;
275
+ }
276
+
277
+ setRowVisibility('default_value_text', defaultValueTextVisibility);
278
+ setRowVisibility('default_value_textarea', defaultValueTextareaVisibility);
279
+ setRowVisibility('default_value_date', defaultValueDateVisibility);
280
+ setRowVisibility('default_value_yesno', defaultValueYesnoVisibility);
281
+ setRowVisibility('is_global', scopeVisibility);
282
+
283
+ var elems = document.getElementsByName('default[]');
284
+ for (var i = 0; i < elems.length; i++) {
285
+ elems[i].type = optionDefaultInputType;
286
+ }
287
+ }
288
+
289
+ function setRowVisibility(id, isVisible)
290
+ {
291
+ if ($(id)) {
292
+ var td = $(id).parentNode;
293
+ var tr = $(td.parentNode);
294
+
295
+ if (isVisible) {
296
+ tr.show();
297
+ } else {
298
+ tr.blur();
299
+ tr.hide();
300
+ }
301
+ }
302
+ }
303
+
304
+ function checkIsConfigurableVisibility()
305
+ {
306
+ if (!$('is_configurable') || !$('is_global') || !$('frontend_input')) return;
307
+ if ($F('is_global')==1 && $F('frontend_input')=='select') {
308
+ setRowVisibility('is_configurable', true);
309
+ } else {
310
+ setRowVisibility('is_configurable', false);
311
+ }
312
+ }
313
+
314
+ function updateRequriedOptions()
315
+ {
316
+ if ($F('frontend_input')=='select' && $F('is_required')==1) {
317
+ $('option-count-check').addClassName('required-options-count');
318
+ } else {
319
+ $('option-count-check').removeClassName('required-options-count');
320
+ }
321
+ }
322
+
323
+ if($('frontend_input')){
324
+ Event.observe($('frontend_input'), 'change', updateRequriedOptions);
325
+ Event.observe($('frontend_input'), 'change', bindAttributeInputType);
326
+ Event.observe($('is_global'), 'change', checkIsConfigurableVisibility);
327
+ }
328
+
329
+ if ($('is_filterable')) {
330
+ Event.observe($('is_filterable'), 'change', switchIsFilterable);
331
+ }
332
+
333
+ if ($('is_required')) {
334
+ Event.observe($('is_required'), 'change', updateRequriedOptions);
335
+ }
336
+ bindAttributeInputType();
337
+ //]]>
338
+ </script>
app/design/adminhtml/default/default/template/catalog/product/attribute/new/created.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ var added = false;
29
+ function addAttribute(closeAfter) {
30
+ if(window.opener!=null && !added) {
31
+ window.opener.Product.AttributesBridge.addAttributeRow(<?php echo $this->getAttributesBlockJson() ?>);
32
+ added = true;
33
+ }
34
+
35
+ if(closeAfter)
36
+ {
37
+ closeWindow();
38
+ }
39
+ }
40
+
41
+ function closeWindow()
42
+ {
43
+ if (window.opener) {
44
+ window.opener.focus();
45
+ }
46
+ window.close();
47
+ }
48
+
49
+ addAttribute(false);
50
+ setTimeout(closeWindow, 3000);
51
+ </script>
52
+ <div class="a-center">
53
+ <?php echo $this->getCloseButtonHtml() ?>
54
+ </div>
app/design/adminhtml/default/default/template/catalog/product/attribute/options.phtml ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Attribute options control
30
+ *
31
+ * @see Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
32
+ */
33
+ ?>
34
+ <div>
35
+ <ul class="messages">
36
+ <li class="notice-msg">
37
+ <ul>
38
+ <li><?php echo Mage::helper('catalog')->__('If you do not specify an option value for a specific store view then the default (Admin) value will be used.') ?></li>
39
+ </ul>
40
+ </li>
41
+ </ul>
42
+ </div>
43
+
44
+ <div class="entity-edit">
45
+ <div class="entry-edit-head">
46
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Manage Titles (Size, Color, etc.)') ?></h4>
47
+ </div>
48
+ <div class="box">
49
+ <div class="hor-scroll">
50
+ <table class="dynamic-grid" cellspacing="0" id="attribute-labels-table">
51
+ <tr>
52
+ <?php foreach ($this->getStores() as $_store): ?>
53
+ <th><?php echo $_store->getName() ?></th>
54
+ <?php endforeach; ?>
55
+ </tr>
56
+ <tr>
57
+ <?php $_labels = $this->getLabelValues() ?>
58
+ <?php foreach ($this->getStores() as $_store): ?>
59
+ <td>
60
+ <input class="input-text<?php if($_store->getId()==0): ?> required-option<?php endif; ?>" type="text" name="frontend_label[<?php echo $_store->getId() ?>]" value="<?php echo $this->htmlEscape($_labels[$_store->getId()]) ?>"<?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/>
61
+ </td>
62
+ <?php endforeach; ?>
63
+ </tr>
64
+ </table>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ <br/>
69
+ <div class="entity-edit" id="matage-options-panel">
70
+ <div class="entry-edit-head">
71
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Manage Options (values of your attribute)') ?></h4>
72
+ </div>
73
+ <div class="box">
74
+ <div class="hor-scroll">
75
+ <table class="dynamic-grid" cellspacing="0" cellpadding="0">
76
+ <tr id="attribute-options-table">
77
+ <?php foreach ($this->getStores() as $_store): ?>
78
+ <th><?php echo $_store->getName() ?></th>
79
+ <?php endforeach; ?>
80
+ <th><?php echo Mage::helper('catalog')->__('Position') ?></th>
81
+ <th class="nobr a-center"><?php echo Mage::helper('catalog')->__('Is Default') ?></th>
82
+ <th>
83
+ <?php if (!$this->getReadOnly()):?>
84
+ <?php echo $this->getAddNewButtonHtml() ?>
85
+ <?php endif;?>
86
+ </th>
87
+ </tr>
88
+ <tr class="no-display template" id="row-template">
89
+ <?php foreach ($this->getStores() as $_store): ?>
90
+ <td><input name="option[value][{{id}}][<?php echo $_store->getId() ?>]" value="{{store<?php echo $_store->getId() ?>}}" class="input-text<?php if($_store->getId()==0): ?> required-option<?php endif; ?>" type="text" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/></td>
91
+ <?php endforeach; ?>
92
+ <td class="a-center"><input class="input-text" type="text" name="option[order][{{id}}]" value="{{sort_order}}" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/></td>
93
+ <td><input class="input-radio" type="radio" name="default[]" value="{{id}}" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/></td>
94
+ <td class="a-left">
95
+ <input type="hidden" class="delete-flag" name="option[delete][{{id}}]" value="" />
96
+ <?php if (!$this->getReadOnly()):?>
97
+ <?php echo $this->getDeleteButtonHtml() ?>
98
+ <?php endif;?>
99
+ </td>
100
+ </tr>
101
+ </table>
102
+ </div>
103
+ <input type="hidden" id="option-count-check" value="" />
104
+ </div>
105
+ </div>
106
+ <script type="text/javascript">
107
+ //<![CDATA[
108
+ var optionDefaultInputType = 'radio';
109
+
110
+ // IE removes quotes from element.innerHTML whenever it thinks they're not needed, which breaks html.
111
+ var templateText =
112
+ '<tr class="option-row">'+
113
+ <?php foreach ($this->getStores() as $_store): ?>
114
+ '<td><input name="option[value][{{id}}][<?php echo $_store->getId() ?>]" value="{{store<?php echo $_store->getId() ?>}}" class="input-text<?php if($_store->getId()==0): ?> required-option<?php endif; ?>" type="text" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/><\/td>'+
115
+ <?php endforeach; ?>
116
+ '<td><input class="input-text" type="text" name="option[order][{{id}}]" value="{{sort_order}}" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/><\/td>'+
117
+ '<td class="a-center"><input class="input-radio" type="{{intype}}" name="default[]" value="{{id}}" {{checked}} <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/><\/td>'+
118
+ '<td class="a-left" id="delete_button_container_{{id}}">'+
119
+ '<input type="hidden" class="delete-flag" name="option[delete][{{id}}]" value="" />'+
120
+ <?php if (!$this->getReadOnly()):?>
121
+ '<?php echo $this->getDeleteButtonHtml() ?>'+
122
+ <?php endif;?>
123
+ '<\/td>'+
124
+ '<\/tr>';
125
+
126
+ var attributeOption = {
127
+ table : $('attribute-options-table'),
128
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
129
+ templateText : templateText,
130
+ itemCount : 0,
131
+ totalItems : 0,
132
+ isReadOnly: <?php echo (int)$this->getReadOnly(); ?>,
133
+ add : function(data) {
134
+ this.template = new Template(this.templateText, this.templateSyntax);
135
+ var isNewOption = false;
136
+ if(!data.id){
137
+ data = {};
138
+ data.id = 'option_'+this.itemCount;
139
+ isNewOption = true;
140
+ }
141
+ if (!data.intype)
142
+ data.intype = optionDefaultInputType;
143
+ Element.insert(this.table, {after: this.template.evaluate(data)});
144
+ if (isNewOption && !this.isReadOnly) {
145
+ this.enableNewOptionDeleteButton(data.id);
146
+ }
147
+ this.bindRemoveButtons();
148
+ this.itemCount++;
149
+ this.totalItems++;
150
+ this.updateItemsCountField();
151
+ },
152
+ remove : function(event){
153
+ var element = $(Event.findElement(event, 'tr')); // !!! Button already
154
+ // have table parent in safari
155
+ // Safari workaround
156
+ element.ancestors().each(function(parentItem){
157
+ if (parentItem.hasClassName('option-row')) {
158
+ element = parentItem;
159
+ throw $break;
160
+ } else if (parentItem.hasClassName('box')) {
161
+ throw $break;
162
+ }
163
+ });
164
+
165
+
166
+ if(element){
167
+ var elementFlags = element.getElementsByClassName('delete-flag');
168
+ if(elementFlags[0]){
169
+ elementFlags[0].value=1;
170
+ }
171
+
172
+ element.addClassName('no-display');
173
+ element.addClassName('template');
174
+ element.hide();
175
+ this.totalItems--;
176
+ this.updateItemsCountField();
177
+ }
178
+ },
179
+ updateItemsCountField: function() {
180
+ if (this.totalItems > 0) {
181
+ $('option-count-check').value = '1';
182
+ } else {
183
+ $('option-count-check').value = '';
184
+ }
185
+ },
186
+ enableNewOptionDeleteButton: function(id) {
187
+ $$('#delete_button_container_' + id + ' button').each(function(button) {
188
+ button.enable();
189
+ button.removeClassName('disabled');
190
+ });
191
+ },
192
+ bindRemoveButtons : function(){
193
+ var buttons = $$('.delete-option');
194
+ for(var i=0;i<buttons.length;i++){
195
+ if(!$(buttons[i]).binded){
196
+ $(buttons[i]).binded = true;
197
+ Event.observe(buttons[i], 'click', this.remove.bind(this));
198
+ }
199
+ }
200
+ }
201
+
202
+ }
203
+ if($('row-template')){
204
+ $('row-template').remove();
205
+ }
206
+ attributeOption.bindRemoveButtons();
207
+
208
+ if($('add_new_option_button')){
209
+ Event.observe('add_new_option_button', 'click', attributeOption.add.bind(attributeOption));
210
+ }
211
+ Validation.addAllThese([
212
+ ['required-option', '<?php echo Mage::helper('catalog')->__('Failed') ?>', function(v) {
213
+ return !Validation.get('IsEmpty').test(v);
214
+ }]]);
215
+ Validation.addAllThese([
216
+ ['required-options-count', '<?php echo Mage::helper('catalog')->__('Options is required') ?>', function(v) {
217
+ return !Validation.get('IsEmpty').test(v);
218
+ }]]);
219
+ <?php foreach ($this->getOptionValues() as $_value): ?>
220
+ attributeOption.add(<?php echo $_value->toJson() ?>);
221
+ <?php endforeach; ?>
222
+ //]]>
223
+ </script>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-product-attribute-sets"><?php echo $this->htmlEscape($this->_getHeader()) ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getBackButtonHtml() ?>
33
+ <?php echo $this->getResetButtonHtml() ?>
34
+ <?php echo $this->getDeleteButtonHtml() ?>
35
+ <?php echo $this->getSaveButtonHtml() ?>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+ </div>
40
+ <table cellspacing="0" width="100%">
41
+ <tr>
42
+ <td width="360" style="border-right:1px solid #ddd; padding:0 23px 23px 0;" class="edit-attribute-set">
43
+ <?php echo $this->getSetFormHtml() ?>
44
+ </td>
45
+ <td width="320" style="border-right:1px solid #ddd; padding:0 23px 23px 23px;">
46
+ <div class="content-header skip-header">
47
+ <table cellspacing="0">
48
+ <tbody>
49
+ <tr>
50
+ <td><h3><?php echo Mage::helper('catalog')->__('Groups') ?></h3></td>
51
+ </tr>
52
+ </tbody>
53
+ </table>
54
+ </div>
55
+
56
+ <?php if (!$this->getIsReadOnly()): ?>
57
+ <p><?php echo $this->getAddGroupButton() ?>&nbsp;<?php echo $this->getDeleteGroupButton() ?></p>
58
+ <p class="note-block"><?php echo Mage::helper('catalog')->__('Double click on a group to rename it') ?></p>
59
+ <?php endif; ?>
60
+
61
+ <?php echo $this->getSetsFilterHtml() ?>
62
+ <?php echo $this->getGroupTreeHtml() ?>
63
+ </td>
64
+ <td style="padding:0 0 23px 23px;">
65
+ <div class="content-header skip-header">
66
+ <table cellspacing="0">
67
+ <tbody>
68
+ <tr>
69
+ <td><h3><?php echo Mage::helper('catalog')->__('Unassigned Attributes') ?></h3></td>
70
+ </tr>
71
+ </tbody>
72
+ </table>
73
+ </div>
74
+ <div id="tree-div2" style="height:400px; margin-top:5px;overflow:auto"></div>
75
+ <script type="text/javascript">
76
+ //<![CDATA[
77
+ var allowDragAndDrop = <?php echo ($this->getIsReadOnly() ? 'false' : 'true'); ?>;
78
+ var canEditGroups = <?php echo ($this->getIsReadOnly() ? 'false' : 'true'); ?>;
79
+
80
+ var TreePanels = function() {
81
+ // shorthand
82
+ var Tree = Ext.tree;
83
+
84
+ return {
85
+ init : function(){
86
+ // yui-ext tree
87
+
88
+ var tree = new Ext.tree.TreePanel('tree-div1', {
89
+ animate:false,
90
+ loader: false,
91
+ enableDD:allowDragAndDrop,
92
+ containerScroll: true,
93
+ rootVisible: false
94
+ });
95
+
96
+ // set the root node
97
+ this.root = new Ext.tree.TreeNode({
98
+ text: 'ROOT',
99
+ allowDrug:false,
100
+ allowDrop:true,
101
+ id:'1'
102
+ });
103
+
104
+ tree.setRootNode(this.root);
105
+ buildCategoryTree(this.root, <?php echo $this->getGroupTreeJson() ?>);
106
+ // render the tree
107
+ tree.render();
108
+ this.root.expand(false, false);
109
+ tree.expandAll();
110
+
111
+ this.ge = new Ext.tree.TreeEditor(tree, {
112
+ allowBlank:false,
113
+ blankText:'<?php echo Mage::helper('catalog')->__('A name is required') ?>',
114
+ selectOnFocus:true,
115
+ cls:'folder'
116
+ });
117
+
118
+ this.root.addListener('beforeinsert', editSet.leftBeforeInsert);
119
+ this.root.addListener('beforeappend', editSet.leftBeforeInsert);
120
+
121
+ //this.ge.addListener('beforerender', editSet.editGroup);
122
+ this.ge.addListener('beforeshow', editSet.editGroup);
123
+ this.ge.addListener('beforecomplete', editSet.beforeRenameGroup);
124
+ //this.ge.addListener('startedit', editSet.editGroup);
125
+
126
+ //-------------------------------------------------------------
127
+
128
+ var tree2 = new Ext.tree.TreePanel('tree-div2', {
129
+ animate:false,
130
+ loader: false,
131
+ enableDD:allowDragAndDrop,
132
+ containerScroll: true,
133
+ rootVisible: false,
134
+ lines:false
135
+ });
136
+
137
+ // set the root node
138
+ this.root2 = new Ext.tree.TreeNode({
139
+ text: 'ROOT',
140
+ draggable:false,
141
+ id:'free'
142
+ });
143
+ tree2.setRootNode(this.root2);
144
+ buildCategoryTree(this.root2, <?php echo $this->getAttributeTreeJson() ?>);
145
+
146
+ this.root2.addListener('beforeinsert', editSet.rightBeforeInsert);
147
+ this.root2.addListener('beforeappend', editSet.rightBeforeAppend);
148
+
149
+ this.root2.addListener('append', editSet.rightAppend);
150
+ this.root2.addListener('remove', editSet.rightRemove);
151
+ // render the tree
152
+ tree2.render();
153
+ this.root2.expand(false, false);
154
+ tree2.expandAll();
155
+ },
156
+
157
+ rebuildTrees : function(){
158
+ editSet.req.attributes = new Array();
159
+ rootNode = TreePanels.root;
160
+ var gIterator = 0;
161
+ for( i in rootNode.childNodes ) {
162
+ if(rootNode.childNodes[i].id) {
163
+ var group = rootNode.childNodes[i];
164
+ editSet.req.groups[gIterator] = new Array(group.id, group.attributes.text.strip(), (gIterator+1));
165
+ var iterator = 0
166
+ for( j in group.childNodes ) {
167
+ iterator ++;
168
+ if( group.childNodes[j].id > 0 ) {
169
+ editSet.req.attributes[group.childNodes[j].id] = new Array(group.childNodes[j].id, group.id, iterator, group.childNodes[j].attributes.entity_id);
170
+ }
171
+ }
172
+ iterator = 0;
173
+ }
174
+ gIterator ++;
175
+ }
176
+
177
+ editSet.req.not_attributes = new Array();
178
+ rootNode = TreePanels.root2;
179
+
180
+ var iterator = 0;
181
+ for( i in rootNode.childNodes ) {
182
+ if(rootNode.childNodes[i].id) {
183
+ if( rootNode.childNodes[i].id > 0 ) {
184
+ editSet.req.not_attributes[iterator] = rootNode.childNodes[i].attributes.entity_id;
185
+ }
186
+ iterator ++;
187
+ }
188
+ }
189
+ }
190
+ };
191
+ }();
192
+
193
+ function buildCategoryTree(parent, config){
194
+ if (!config) return null;
195
+ if (parent && config && config.length){
196
+ for (var i = 0; i < config.length; i++) {
197
+ var node = new Ext.tree.TreeNode(config[i]);
198
+ parent.appendChild(node);
199
+ node.addListener('click', editSet.register);
200
+ node.addListener('beforemove', editSet.groupBeforeMove);
201
+ node.addListener('beforeinsert', editSet.groupBeforeInsert);
202
+ node.addListener('beforeappend', editSet.groupBeforeInsert);
203
+ if( config[i].children ) {
204
+ for( j in config[i].children ) {
205
+ if(config[i].children[j].id) {
206
+ newNode = new Ext.tree.TreeNode(config[i].children[j]);
207
+ node.appendChild(newNode);
208
+ newNode.addListener('click', editSet.unregister);
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
214
+ }
215
+
216
+ var editSet = function() {
217
+ return {
218
+ register : function(node) {
219
+ editSet.currentNode = node;
220
+ },
221
+
222
+ unregister : function() {
223
+ editSet.currentNode = false;
224
+ },
225
+
226
+ submit : function() {
227
+ if( TreePanels.root.firstChild == TreePanels.root.lastChild ) {
228
+ return;
229
+ }
230
+
231
+ if( editSet.SystemNodesExists(editSet.currentNode) ) {
232
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This group contains system attributes. Please move system attributes to another group and try again.')) ?>');
233
+ return;
234
+ }
235
+
236
+ if (editSet.ConfigurableNodeExists(editSet.currentNode)) {
237
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This group contains attributes, used in configurable products. Please move these attributes to another group and try again.')) ?>');
238
+ return;
239
+ }
240
+
241
+ if( editSet.currentNode && editSet.currentNode.attributes.cls == 'folder' ) {
242
+ TreePanels.root.removeChild(editSet.currentNode);
243
+ for( i in editSet.currentNode.childNodes ) {
244
+ if( editSet.currentNode.childNodes[i].id ) {
245
+ child = editSet.currentNode.childNodes[i];
246
+ newNode = new Ext.tree.TreeNode(child.attributes);
247
+
248
+ if( child.attributes.is_user_defined == 1 ) {
249
+ TreePanels.root2.appendChild(newNode);
250
+ }
251
+ }
252
+ }
253
+ editSet.req.removeGroups[editSet.currentNode.id] = editSet.currentNode.id;
254
+ editSet.currentNode = false;
255
+ }
256
+ },
257
+
258
+ SystemNodesExists : function(currentNode) {
259
+ for( i in currentNode.childNodes ) {
260
+ if( currentNode.childNodes[i].id ) {
261
+ child = editSet.currentNode.childNodes[i];
262
+ if( child.attributes.is_user_defined != 1 ) {
263
+ return true;
264
+ }
265
+ }
266
+ }
267
+ },
268
+
269
+ ConfigurableNodeExists : function(currentNode) {
270
+ for (var i in currentNode.childNodes ) {
271
+ if (currentNode.childNodes[i].id) {
272
+ child = editSet.currentNode.childNodes[i];
273
+ if (child.attributes.is_configurable) {
274
+ return true;
275
+ }
276
+ }
277
+ }
278
+ return false;
279
+ },
280
+
281
+ rightAppend : function(node) {
282
+ return;
283
+ },
284
+
285
+ addGroup : function() {
286
+ var group_name = prompt("<?php echo Mage::helper('catalog')->__('Please enter a new group name') ?>","");
287
+ group_name = group_name.strip();
288
+ if( group_name == '' ) {
289
+ this.addGroup();
290
+ } else if( group_name != false && group_name != null && group_name != '' ) {
291
+
292
+ if (!editSet.validateGroupName(group_name, 0)) {
293
+ return;
294
+ }
295
+
296
+ var newNode = new Ext.tree.TreeNode({
297
+ text : group_name.escapeHTML(),
298
+ cls : 'folder',
299
+ allowDrop : true,
300
+ allowDrag : true
301
+ });
302
+ TreePanels.root.appendChild(newNode);
303
+ newNode.addListener('beforemove', editSet.groupBeforeMove);
304
+ newNode.addListener('beforeinsert', editSet.groupBeforeInsert);
305
+ newNode.addListener('beforeappend', editSet.groupBeforeInsert);
306
+ newNode.addListener('click', editSet.register);
307
+ }
308
+ },
309
+
310
+ editGroup : function(obj) {
311
+ if( obj.editNode.attributes.cls != 'folder' || !canEditGroups) {
312
+ TreePanels.ge.cancelEdit();
313
+ return false;
314
+ }
315
+ },
316
+
317
+ beforeRenameGroup : function(obj, after, before) {
318
+ return editSet.validateGroupName(after, obj.editNode.id);
319
+ },
320
+
321
+ validateGroupName : function(name, exceptNodeId) {
322
+ name = name.strip();
323
+ if (name === '') {
324
+ return false;
325
+ }
326
+ for (var i=0; i < TreePanels.root.childNodes.length; i++) {
327
+ if (TreePanels.root.childNodes[i].text.toLowerCase() == name.toLowerCase() && TreePanels.root.childNodes[i].id != exceptNodeId) {
328
+ errorText = "<?php echo Mage::helper('catalog')->__('Attribute group with the \"/name/\" name already exists') ?>";
329
+ alert(errorText.replace("/name/",name));
330
+ return false;
331
+ }
332
+ }
333
+ return true;
334
+ },
335
+
336
+ save : function() {
337
+ $('messages').update();
338
+ TreePanels.rebuildTrees();
339
+ var _validator = new Validation('set_prop_form', {onSubmit:false});
340
+ if( !_validator.validate() ) {
341
+ return;
342
+ }
343
+ editSet.req.attribute_set_name = $('attribute_set_name').value;
344
+ if (!editSet.req.form_key) {
345
+ editSet.req.form_key = FORM_KEY;
346
+ }
347
+ var req = {data : Ext.util.JSON.encode(editSet.req)};
348
+ var con = new Ext.lib.Ajax.request('POST', '<?php echo $this->getMoveUrl() ?>', {success:editSet.success,failure:editSet.failure}, req);
349
+ },
350
+
351
+ success : function(o) {
352
+ var response = Ext.util.JSON.decode(o.responseText);
353
+ if( response.error ) {
354
+ $('messages').update(response.message);
355
+ } else if( response.ajaxExpired && response.ajaxRedirect ){
356
+ setLocation(response.ajaxRedirect);
357
+ } else if( response.url ){
358
+ setLocation(response.url);
359
+ } else if( response.message ) {
360
+ $('messages').update(response.message);
361
+ }
362
+ },
363
+
364
+ failure : function(o) {
365
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Unable to complete this request.')) ?>');
366
+ },
367
+
368
+ groupBeforeMove : function(tree, nodeThis, oldParent, newParent) {
369
+ if( newParent.attributes.cls == 'folder' && nodeThis.attributes.cls == 'folder' ) {
370
+ return false;
371
+ }
372
+
373
+ if( newParent == TreePanels.root && nodeThis.attributes.cls != 'folder' ) {
374
+ return false;
375
+ }
376
+ },
377
+
378
+ rightBeforeAppend : function(tree, nodeThis, node, newParent) {
379
+ if (node.attributes.is_user_defined == 0) {
380
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('You cannot remove system attribute from this set.')) ?>');
381
+ return false;
382
+ }
383
+ else if (node.attributes.is_configurable == 1) {
384
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>');
385
+ return false;
386
+ }
387
+ else {
388
+ return true;
389
+ }
390
+ },
391
+
392
+ rightBeforeInsert : function(tree, nodeThis, node, newParent) {
393
+ var empty = TreePanels.root2.findChild('id', 'empty');
394
+ if( empty ) {
395
+ return false;
396
+ }
397
+
398
+ if (node.attributes.is_user_defined == 0) {
399
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('You cannot remove system attribute from this set.')) ?>');
400
+ return false;
401
+ }
402
+ else if (node.attributes.is_configurable == 1) {
403
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>');
404
+ return false;
405
+ }
406
+ else {
407
+ return true;
408
+ }
409
+ },
410
+
411
+ groupBeforeInsert : function(tree, nodeThis, node, newParent) {
412
+ if( node.allowChildren ) {
413
+ return false;
414
+ }
415
+ },
416
+
417
+ rightAppend : function(tree, nodeThis, node) {
418
+ var empty = TreePanels.root2.findChild('id', 'empty');
419
+ if( empty && node.id != 'empty' ) {
420
+ TreePanels.root2.removeChild(empty);
421
+ }
422
+ },
423
+
424
+ rightRemove : function(tree, nodeThis, node) {
425
+ if( nodeThis.firstChild == null && node.id != 'empty' ) {
426
+ var newNode = new Ext.tree.TreeNode({
427
+ text : '<?php echo Mage::helper('catalog')->__('Empty') ?>',
428
+ id : 'empty',
429
+ cls : 'folder',
430
+ is_user_defined : 1,
431
+ allowDrop : false,
432
+ allowDrag : false
433
+ });
434
+ TreePanels.root2.appendChild(newNode);
435
+ }
436
+ },
437
+
438
+ leftBeforeInsert : function(tree, nodeThis, node, newParent) {
439
+ if( node.allowChildren == false ) {
440
+ return false;
441
+ }
442
+ }
443
+ }
444
+ }();
445
+
446
+ function initVars() {
447
+ editSet.req = {};
448
+ editSet.req.attributes = false;
449
+ editSet.req.groups = new Array();
450
+ editSet.req.not_attributes = false;
451
+ editSet.req.attribute_set_name = false;
452
+ editSet.req.removeGroups = new Array();
453
+ }
454
+
455
+ initVars();
456
+ Ext.EventManager.onDocumentReady(TreePanels.init, TreePanels, true);
457
+ //]]>
458
+ </script>
459
+ </td>
460
+ </tr>
461
+ </table>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div id="tree-div1" style="width:320px;height:400px;margin-top:5px;overflow:auto"></div>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-product-attribute-sets"><?php echo $this->_getHeader() ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getBackButtonHtml() ?>
33
+ <?php echo $this->getSaveButtonHtml() ?>
34
+ </td>
35
+ </tr>
36
+ </table>
37
+ </div>
38
+ <?php echo $this->getFormHtml() ?>
39
+ <script type="text/javascript">
40
+ var addSet = new varienForm('<?php echo $this->getFormId() ?>');
41
+ </script>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-product-attribute-sets"><?php echo $this->_getHeader() ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getNewButtonHtml() ?>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </div>
app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div id="popup-window-mask" style="display:none;"></div>
28
+ <div id="product_composite_configure" class="product-configure-popup" style="display:none;">
29
+ <iframe name="product_composite_configure_iframe" id="product_composite_configure_iframe" src="#" style="width:0; height:0; border:0px solid #fff; position:absolute; top:-1000px; left:-1000px" onload="window.productConfigure && productConfigure.onLoadIFrame()"></iframe>
30
+ <form action="" method="post" id="product_composite_configure_form" enctype="multipart/form-data" onsubmit="productConfigure.onConfirmBtn(); return false;" target="product_composite_configure_iframe">
31
+ <div class="entry-edit">
32
+ <div class="entry-edit-head">
33
+ <h4 class="icon-head fieldset-legend"><?php echo Mage::helper('catalog')->__('Configure Product') ?></h4>
34
+ </div>
35
+ <div id="product_composite_configure_messages" style="display: none;" >
36
+ <ul class="messages"><li class="error-msg"></li></ul>
37
+ </div>
38
+ <div id="product_composite_configure_form_fields" class="content"></div>
39
+ <div id="product_composite_configure_form_additional" style="display:none;"></div>
40
+ <div id="product_composite_configure_form_confirmed" style="display:none;"></div>
41
+ <div class="buttons-set a-right">
42
+ <button type="button" class="scalable" onclick="productConfigure.onCancelBtn()" id="product_composite_configure_form_cancel"><span><span><span><?php echo Mage::helper('catalog')->__('Cancel') ?></span></span></span></button>
43
+ <button type="submit" class="scalable"><span><span><span><?php echo Mage::helper('catalog')->__('OK') ?></span></span></span></button>
44
+ </div>
45
+ </div>
46
+ <input type="hidden" name="as_js_varname" value="iFrameResponse" />
47
+ <input type="hidden" name="form_key" value="<?php echo $this->getFormKey() ?>" />
48
+ </form>
49
+ <div id="product_composite_configure_confirmed" style="display:none;"></div>
50
+
51
+ <script type="text/javascript">
52
+ var productCompositeConfigureForm = new varienForm('product_composite_configure_form');
53
+ </script>
54
+ </div>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Configurable */ ?>
29
+ <?php $_product = $this->getProduct(); ?>
30
+ <?php $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes()); ?>
31
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
32
+ <?php if (($_product->isSaleable() || $_skipSaleableCheck) && count($_attributes)):?>
33
+ <div id="catalog_product_composite_configure_fields_configurable" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
34
+ <h4><?php echo Mage::helper('catalog')->__('Associated Products') ?></h4>
35
+ <div class="product-options">
36
+ <dl>
37
+ <?php foreach($_attributes as $_attribute): ?>
38
+ <dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
39
+ <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>
40
+ <div class="input-box">
41
+ <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
42
+ <option><?php echo Mage::helper('catalog')->__('Choose an Option...') ?></option>
43
+ </select>
44
+ </div>
45
+ </dd>
46
+ <?php endforeach; ?>
47
+ </dl>
48
+ </div>
49
+ </div>
50
+ <script type="text/javascript">
51
+ var config = <?php echo $this->getJsonConfig() ?>;
52
+ if (window.productConfigure) {
53
+ config.containerId = window.productConfigure.blockFormFields.id;
54
+ if (window.productConfigure.restorePhase) {
55
+ config.inputsInitialized = true;
56
+ }
57
+ }
58
+ ProductConfigure.spConfig = new Product.Config(config);
59
+ </script>
60
+ <?php endif;?>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Grouped */ ?>
29
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
30
+ <div id="catalog_product_composite_configure_fields_grouped" class="grid <?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
31
+ <h4><?php echo Mage::helper('catalog')->__('Associated Products') ?></h4>
32
+ <div class="product-options">
33
+ <?php $_product = $this->getProduct(); ?>
34
+ <?php $this->setPreconfiguredValue(); ?>
35
+ <?php $_associatedProducts = $this->getAssociatedProducts(); ?>
36
+ <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
37
+ <?php if ((!$_product->isAvailable() && !$_skipSaleableCheck) || !$_hasAssociatedProducts): ?>
38
+ <p class="availability out-of-stock"><?php echo Mage::helper('catalog')->__('Availability:') ?> <span><?php echo Mage::helper('catalog')->__('Out of stock') ?></span></p>
39
+ <?php endif; ?>
40
+ <table class="data-table grouped-items-table" id="super-product-table">
41
+ <col />
42
+ <col />
43
+ <col />
44
+ <col />
45
+ <col width="1" />
46
+ <thead>
47
+ <tr "class="headings">
48
+ <th><?php echo Mage::helper('catalog')->__('ID') ?></th>
49
+ <th><?php echo Mage::helper('catalog')->__('SKU') ?></th>
50
+ <th><?php echo Mage::helper('catalog')->__('Product Name') ?></th>
51
+ <?php if ($this->getCanShowProductPrice($_product)): ?>
52
+ <th class="a-right"><?php echo Mage::helper('catalog')->__('Price') ?></th>
53
+ <?php endif; ?>
54
+ <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>
55
+ <th class="a-center"><?php echo Mage::helper('catalog')->__('Qty') ?></th>
56
+ <?php endif; ?>
57
+ </tr>
58
+ </thead>
59
+ <tbody>
60
+ <?php if ($_hasAssociatedProducts): ?>
61
+ <?php $i = 0 ?>
62
+ <?php foreach ($_associatedProducts as $_item): ?>
63
+ <?php $_finalPriceInclTax = $this->helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?>
64
+ <tr class="<?php echo (++$i % 2) ? 'even' : 'odd' ?>">
65
+ <td><?php echo $_item->getId() ?></td>
66
+ <td><?php echo $this->escapeHtml($_item->getSku()) ?></td>
67
+ <td><?php echo $this->escapeHtml($_item->getName()) ?></td>
68
+ <?php if ($this->getCanShowProductPrice($_product)): ?>
69
+ <td class="a-right">
70
+ <?php if ($this->getCanShowProductPrice($_item)): ?>
71
+ <?php echo $this->getPriceHtml($_item, true) ?>
72
+ <?php endif; ?>
73
+ </td>
74
+ <?php endif; ?>
75
+ <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>
76
+ <td class="a-center">
77
+ <?php if ($_item->isSaleable() || $_skipSaleableCheck) : ?>
78
+ <input type="text" name="super_group[<?php echo $_item->getId() ?>]" id="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty()*1 ?>" title="<?php echo Mage::helper('catalog')->__('Qty') ?>" class="input-text qty" />
79
+ <input type="hidden" value="1" price="<?php echo $this->getCurrencyPrice($_item->getPrice()) ?>" qtyId="super_group[<?php echo $_item->getId() ?>]" />
80
+ <?php else: ?>
81
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
82
+ <?php endif; ?>
83
+ </td>
84
+ <?php endif; ?>
85
+ </tr>
86
+ <?php endforeach; ?>
87
+ <?php else: ?>
88
+ <tr>
89
+ <td colspan="<?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>4<?php else : ?>3<?php endif; ?>"><?php echo Mage::helper('catalog')->__('No options of this product are available.') ?></td>
90
+ </tr>
91
+ <?php endif; ?>
92
+ </tbody>
93
+ </table>
94
+ </div>
95
+ </div>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Options */ ?>
29
+ <?php $options = Mage::helper('core')->decorateArray($this->getOptions()); ?>
30
+ <?php if (count($options)): ?>
31
+
32
+ <?php echo $this->getChildHtml('options_js') ?>
33
+
34
+ <div id="product_composite_configure_fields_options" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
35
+ <h4><?php echo Mage::helper('catalog')->__('Custom Options') ?></h4>
36
+ <div class="product-options">
37
+ <dl>
38
+ <?php foreach($options as $option): ?>
39
+ <?php echo $this->getOptionHtml($option); ?>
40
+ <?php endforeach;?>
41
+ </dl>
42
+ </div>
43
+ </div>
44
+
45
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ validateOptionsCallback = function (elmId, result){
31
+ var container = $(elmId).up('ul.options-list');
32
+ if (!container) {
33
+ return;
34
+ }
35
+ if (result == 'failed') {
36
+ container.removeClassName('validation-passed');
37
+ container.addClassName('validation-failed');
38
+ } else {
39
+ container.removeClassName('validation-failed');
40
+ container.addClassName('validation-passed');
41
+ }
42
+ }
43
+
44
+ productConfigure.opConfig = {};
45
+
46
+ var DateOption = Class.create({
47
+
48
+ getDaysInMonth: function(month, year)
49
+ {
50
+ var curDate = new Date();
51
+ if (!month) {
52
+ month = curDate.getMonth();
53
+ }
54
+ if (2 == month && !year) { // leap year assumption for unknown year
55
+ return 29;
56
+ }
57
+ if (!year) {
58
+ year = curDate.getFullYear();
59
+ }
60
+ return 32 - new Date(year, month - 1, 32).getDate();
61
+ },
62
+
63
+ reloadMonth: function(event)
64
+ {
65
+ var selectEl = event.findElement();
66
+ var idParts = selectEl.id.split("_");
67
+ if (idParts.length != 3) {
68
+ return false;
69
+ }
70
+ var optionIdPrefix = idParts[0] + "_" + idParts[1];
71
+ var month = parseInt($(optionIdPrefix + "_month").value);
72
+ var year = parseInt($(optionIdPrefix + "_year").value);
73
+ var dayEl = $(optionIdPrefix + "_day");
74
+
75
+ var days = this.getDaysInMonth(month, year);
76
+
77
+ //remove days
78
+ for (var i = dayEl.options.length - 1; i >= 0; i--) {
79
+ if (dayEl.options[i].value > days) {
80
+ dayEl.remove(dayEl.options[i].index);
81
+ }
82
+ }
83
+
84
+ // add days
85
+ var lastDay = parseInt(dayEl.options[dayEl.options.length-1].value);
86
+ for (i = lastDay + 1; i <= days; i++) {
87
+ this.addOption(dayEl, i, i);
88
+ }
89
+ },
90
+
91
+ addOption: function(select, text, value)
92
+ {
93
+ var option = document.createElement('OPTION');
94
+ option.value = value;
95
+ option.text = text;
96
+
97
+ if (select.options.add) {
98
+ select.options.add(option);
99
+ } else {
100
+ select.appendChild(option);
101
+ }
102
+ }
103
+ });
104
+ productConfigure.opConfig.dateOption = new DateOption();
105
+ //]]>
106
+ </script>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Date */ ?>
28
+ <?php $_option = $this->getOption(); ?>
29
+ <?php $_optionId = $_option->getId(); ?>
30
+ <dt class="label"><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
31
+ <?php echo $this->getFormatedPrice() ?></dt>
32
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
33
+
34
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE_TIME
35
+ || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE): ?>
36
+
37
+ <?php echo $this->getDateHtml() ?>
38
+
39
+ <?php if (!$this->useCalendar()): ?>
40
+ <script type="text/javascript">
41
+ //<![CDATA[
42
+ var dateOption = productConfigure.opConfig.dateOption;
43
+ Event.observe('options_<?php echo $_optionId ?>_month', 'change', dateOption.reloadMonth.bind(dateOption));
44
+ Event.observe('options_<?php echo $_optionId ?>_year', 'change', dateOption.reloadMonth.bind(dateOption));
45
+ //]]>
46
+ </script>
47
+ <?php endif; ?>
48
+
49
+ <?php endif; ?>
50
+
51
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE_TIME
52
+ || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_TIME): ?>
53
+ <span class="time-picker"><?php echo $this->getTimeHtml() ?></span>
54
+ <?php endif; ?>
55
+
56
+ <input type="hidden" name="validate_datetime_<?php echo $_optionId ?>" class="validate-datetime-<?php echo $_optionId ?>" value="" />
57
+ <script type="text/javascript">
58
+ //<![CDATA[
59
+ <?php if ($_option->getIsRequire()): ?>
60
+ Validation.addAllThese(
61
+ [
62
+ ['validate-datetime-<?php echo $_optionId ?>', '<?php echo $this->jsQuoteEscape( Mage::helper('catalog')->__('This is a required option') )?>', function(v) {
63
+ var dateTimeParts = $$('.datetime-picker[id^="options_<?php echo $_optionId ?>"]');
64
+ for (var i=0; i < dateTimeParts.length; i++) {
65
+ if (dateTimeParts[i].value == "") return false;
66
+ }
67
+ return true;
68
+ }]
69
+ ]
70
+ );
71
+ <?php else: ?>
72
+ Validation.add(
73
+ 'validate-datetime-<?php echo $_optionId ?>',
74
+ '<?php echo $this->jsQuoteEscape( Mage::helper('catalog')->__('Field is not complete') )?>',
75
+ function(v) {
76
+ var dateTimeParts = $$('.datetime-picker[id^="options_<?php echo $_optionId ?>"]');
77
+ var hasWithValue = false, hasWithNoValue = false;
78
+ var pattern = /day_part$/i;
79
+ for (var i=0; i < dateTimeParts.length; i++) {
80
+ if (! pattern.test(dateTimeParts[i].id)) {
81
+ if (dateTimeParts[i].value === "") {
82
+ hasWithValue = true;
83
+ } else {
84
+ hasWithNoValue = true;
85
+ }
86
+ }
87
+ }
88
+ return hasWithValue ^ hasWithNoValue;
89
+ }
90
+ );
91
+ <?php endif; ?>
92
+ //]]>
93
+ </script>
94
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Options */ ?>
28
+ <?php $option = $this->getOption(); ?>
29
+ <dt>
30
+ <label><?php echo $this->escapeHtml($option->getTitle()) ?></label>
31
+ </dt>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_option = $this->getOption(); ?>
28
+ <?php $_fileInfo = $this->getFileInfo(); ?>
29
+ <?php $_fileExists = $_fileInfo->hasData() ? true : false; ?>
30
+ <?php $_fileName = 'options_' . $_option->getId() . '_file'; ?>
31
+ <?php $_fieldNameAction = $_fileName . '_action'; ?>
32
+ <?php $_fieldValueAction = $_fileExists ? 'save_old' : 'save_new'; ?>
33
+ <?php $_fileNamed = $_fileName . '_name'; ?>
34
+ <?php $_rand = rand(); ?>
35
+
36
+ <script type="text/javascript">
37
+ //<![CDATA[
38
+ opFile<?php echo $_rand; ?> = {
39
+ initializeFile: function(inputBox) {
40
+ this.inputFile = inputBox.select('input[name="<?php echo $_fileName; ?>"]')[0];
41
+ this.inputFileAction = inputBox.select('input[name="<?php echo $_fieldNameAction; ?>"]')[0];
42
+ this.fileNameBox = inputBox.up('dd').select('.<?php echo $_fileNamed ?>')[0];
43
+ },
44
+
45
+ toggleFileChange: function(inputBox) {
46
+ this.initializeFile(inputBox);
47
+ inputBox.toggle();
48
+ this.fileChangeFlag = this.fileChangeFlag ? false : true;
49
+ if (!this.fileDeleteFlag) {
50
+ if (this.fileChangeFlag) {
51
+ this.inputFileAction.value = 'save_new';
52
+ this.inputFile.disabled = false;
53
+ } else {
54
+ this.inputFileAction.value = 'save_old';
55
+ this.inputFile.disabled = true;
56
+ }
57
+ }
58
+ },
59
+
60
+ toggleFileDelete: function(fileDeleteFlag, inputBox) {
61
+ this.initializeFile(inputBox);
62
+ this.fileDeleteFlag = fileDeleteFlag.checked ? true : false;
63
+ if (this.fileDeleteFlag) {
64
+ this.inputFileAction.value = '';
65
+ this.inputFile.disabled = true;
66
+ this.fileNameBox.setStyle({'text-decoration': 'line-through'});
67
+ } else {
68
+ this.inputFileAction.value = this.fileChangeFlag ? 'save_new' : 'save_old';
69
+ this.inputFile.disabled = (this.fileChangeFlag == 'save_old');
70
+ this.fileNameBox.setStyle({'text-decoration': 'none'});
71
+ }
72
+ }
73
+ };
74
+ //]]>
75
+ </script>
76
+
77
+ <dt><label <?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->htmlEscape($_option->getTitle()) ?></label>
78
+ <?php echo $this->getFormatedPrice() ?></dt>
79
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
80
+ <?php if ($_fileExists): ?>
81
+ <span class="<?php echo $_fileNamed ?>"><?php echo $_fileInfo->getTitle(); ?></span>
82
+ <a href="javascript:void(0)" class="label" onclick="opFile<?php echo $_rand; ?>.toggleFileChange($(this).next('.input-box'))">
83
+ <?php echo Mage::helper('catalog')->__('Change') ?>
84
+ </a>&nbsp;
85
+ <?php if (!$_option->getIsRequire()): ?>
86
+ <input type="checkbox" onclick="opFile<?php echo $_rand; ?>.toggleFileDelete($(this), $(this).next('.input-box'))" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>"/>
87
+ <span class="label"><?php echo Mage::helper('catalog')->__('Delete') ?></span>
88
+ <?php endif; ?>
89
+ <?php endif; ?>
90
+ <div class="input-box" <?php echo $_fileExists ? 'style="display:none"' : '' ?>>
91
+ <input type="file" name="<?php echo $_fileName; ?>" class="product-custom-option<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?>" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>" <?php echo $_fileExists ? 'disabled="disabled"' : '' ?>/>
92
+ <input type="hidden" name="<?php echo $_fieldNameAction; ?>" value="<?php echo $_fieldValueAction; ?>" />
93
+ <?php if ($_option->getFileExtension()): ?>
94
+ <p class="no-margin"><?php echo Mage::helper('catalog')->__('Allowed file extensions to upload')?>: <strong><?php echo $_option->getFileExtension() ?></strong></p>
95
+ <?php endif; ?>
96
+ <?php if ($_option->getImageSizeX() > 0): ?>
97
+ <p class="no-margin"><?php echo Mage::helper('catalog')->__('Maximum image width')?>: <strong><?php echo $_option->getImageSizeX() ?> <?php echo Mage::helper('catalog')->__('px.')?></strong></p>
98
+ <?php endif; ?>
99
+ <?php if ($_option->getImageSizeY() > 0): ?>
100
+ <p class="no-margin"><?php echo Mage::helper('catalog')->__('Maximum image height')?>: <strong><?php echo $_option->getImageSizeY() ?> <?php echo Mage::helper('catalog')->__('px.')?></strong></p>
101
+ <?php endif; ?>
102
+ </div>
103
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Select */ ?>
28
+ <?php $_option = $this->getOption(); ?>
29
+ <dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt>
30
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
31
+ <div class="input-box">
32
+ <?php echo $this->getValuesHtml() ?>
33
+ <?php if ($_option->getIsRequire()): ?>
34
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_RADIO || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX): ?>
35
+ <span id="options-<?php echo $_option->getId() ?>-container"></span>
36
+ <?php endif; ?>
37
+ <?php endif;?>
38
+ </div>
39
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Text */ ?>
28
+ <?php $_option = $this->getOption(); ?>
29
+ <dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
30
+ <?php echo $this->getFormatedPrice() ?></dt>
31
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
32
+ <div class="input-box">
33
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_FIELD): ?>
34
+ <input type="text" id="options_<?php echo $_option->getId() ?>_text" class="input-text<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-' . $_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" value="<?php echo $this->escapeHtml($this->getDefaultValue()) ?>" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>" />
35
+ <?php elseif ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_AREA): ?>
36
+ <textarea id="options_<?php echo $_option->getId() ?>_text" class="<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-' . $_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" rows="5" cols="25" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>"><?php echo $this->escapeHtml($this->getDefaultValue()) ?></textarea>
37
+ <?php endif; ?>
38
+ <?php if ($_option->getMaxCharacters()): ?>
39
+ <p class="note"><?php echo Mage::helper('catalog')->__('Maximum number of characters:')?> <strong><?php echo $_option->getMaxCharacters() ?></strong></p>
40
+ <?php endif; ?>
41
+ </div>
42
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Qty */ ?>
29
+
30
+ <div id="product_composite_configure_fields_qty" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
31
+ <div class="product-options">
32
+ <dl>
33
+ <dt><label><?php echo Mage::helper('catalog')->__('Quantity') ?></label> <input id="product_composite_configure_input_qty" class="input-text" type="text" name="qty" value="<?php echo $this->getQtyValue() * 1 ?>"></dt>
34
+ </dl>
35
+ </div>
36
+ </div>
app/design/adminhtml/default/default/template/catalog/product/created.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ var added = false;
29
+ function addProduct(closeAfter) {
30
+ if(window.opener!=null && !added) {
31
+ <?php if($this->isEdit()): ?>
32
+ window.opener.superProduct.updateProduct(<?php echo $this->getProductId() ?>, <?php echo $this->getAttributesJson(); ?>);
33
+ <?php else: ?>
34
+ window.opener.superProduct.addNewProduct(<?php echo $this->getProductId() ?>, <?php echo $this->getAttributesJson(); ?>);
35
+ window.opener.superProduct.showNoticeMessage();
36
+ <?php endif; ?>
37
+ added = true;
38
+ }
39
+
40
+ if(closeAfter)
41
+ {
42
+ closeWindow();
43
+ }
44
+ }
45
+
46
+ function closeWindow()
47
+ {
48
+ if (window.opener) {
49
+ window.opener.focus();
50
+ }
51
+ window.close();
52
+ }
53
+
54
+ addProduct(false);
55
+ setTimeout(closeWindow, 3000);
56
+ </script>
57
+ <div class="a-center">
58
+ <?php echo $this->getCloseButtonHtml() ?>
59
+ </div>
app/design/adminhtml/default/default/template/catalog/product/edit.phtml ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Template for Mage_Adminhtml_Block_Catalog_Product_Edit
30
+ */
31
+ ?>
32
+
33
+
34
+
35
+ <div class="content-header">
36
+ <h3 class="icon-head head-products"><?php echo $this->getHeader() ?></h3>
37
+ <p class="content-buttons form-buttons"><?php echo $this->getBackButtonHtml() ?>
38
+ <?php echo $this->getCancelButtonHtml() ?>
39
+ <?php if($this->getProductId()): ?>
40
+ <?php echo $this->getDeleteButtonHtml() ?>
41
+ <?php if($this->getProductSetId() && $this->getIsConfigured()): ?>
42
+ <?php echo $this->getDuplicateButtonHtml() ?>
43
+ <?php endif; ?>
44
+ <?php endif; ?>
45
+ <?php if($this->getProductSetId() && $this->getIsConfigured()): ?>
46
+ <?php echo $this->getSaveButtonHtml() ?>
47
+ <?php echo $this->getSaveAndEditButtonHtml() ?>
48
+ <?php endif; ?>
49
+ </p>
50
+ </div>
51
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="product_edit_form" enctype="multipart/form-data">
52
+ <?php echo $this->getBlockHtml('formkey')?>
53
+ <div style="display:none"></div>
54
+ </form>
55
+ <script type="text/javascript">
56
+ //<![CDATA[
57
+ var productTemplateSyntax = /(^|.|\r|\n)({{(\w+)}})/;
58
+ var productForm = new varienForm('product_edit_form', '<?php echo $this->getValidationUrl() ?>');
59
+ productForm._processValidationResult = function(transport) {
60
+ var response = transport.responseText.evalJSON();
61
+ if (response.error){
62
+ if (response.attribute && $(response.attribute)) {
63
+ $(response.attribute).setHasError(true, productForm);
64
+ Validation.ajaxError($(response.attribute), response.message);
65
+ if (!Prototype.Browser.IE){
66
+ $(response.attribute).focus();
67
+ }
68
+ }
69
+ else if ($('messages')) {
70
+ $('messages').innerHTML = '<ul class="messages"><li class="error-msg"><ul><li>' + response.message + '</li></ul></li></ul>';
71
+ }
72
+ }
73
+ else{
74
+ productForm._submit();
75
+ }
76
+ };
77
+ function saveAndContinueEdit(urlTemplate) {
78
+ var template = new Template(urlTemplate, productTemplateSyntax);
79
+ var url = template.evaluate({tab_id:product_info_tabsJsTabs.activeTab.id});
80
+ productForm.submit(url);
81
+ }
82
+ function setSettings(urlTemplate, setElement, typeElement) {
83
+ var template = new Template(urlTemplate, productTemplateSyntax);
84
+ setLocation(template.evaluate({attribute_set:$F(setElement),type:$F(typeElement)}));
85
+ }
86
+
87
+ function setSuperSettings(urlTemplate, attributesClass, validateField) {
88
+ var attributesFields = $$('.' + attributesClass);
89
+ var attributes = Form.serializeElements(attributesFields, true).attribute;
90
+ if(typeof attributes == 'string') {
91
+ attributes = [attributes];
92
+ }
93
+
94
+ if(!attributes) {
95
+ $(validateField).value = 'no-attributes';
96
+ } else {
97
+ $(validateField).value = 'has-attributes';
98
+ }
99
+
100
+ if (productForm.validator.validate()) {
101
+ var template = new Template(urlTemplate, productTemplateSyntax);
102
+ var url = template.evaluate({
103
+ attributes: encode_base64(attributes.join(',')).replace(new RegExp('/','g'),'%2F').replace(new RegExp('=','g'),'%3D')
104
+ });
105
+ setLocation(url);
106
+ }
107
+ }
108
+
109
+ function checkMaxLength(Object, MaxLen)
110
+ {
111
+ if (Object.value.length > MaxLen-1) {
112
+ Object.value = Object.value.substr(0, MaxLen);
113
+ }
114
+ return 1;
115
+ }
116
+
117
+ Event.observe(window, 'load', function() {
118
+ var objName = '<?php echo $this->getSelectedTabId() ?>';
119
+ if (objName) {
120
+ obj = $(objName);
121
+ //IE fix (bubbling event model)
122
+ product_info_tabsJsTabs.setSkipDisplayFirstTab();
123
+ product_info_tabsJsTabs.showTabContent(obj);
124
+ }
125
+ Product.AttributesBridge.setTabsObject(product_info_tabsJsTabs);
126
+ });
127
+
128
+ Validation.addAllThese([
129
+ ['validate-super-product-attributes', '<?php echo Mage::helper('catalog')->__('Please select one or more attributes.') ?>', function(v) {
130
+ return (v != "no-attributes");
131
+ }]]);
132
+ //]]>
133
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td><h3><?php echo Mage::helper('catalog')->__('Update attributes') ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getBackButtonHtml() ?>
33
+ <?php echo $this->getCancelButtonHtml() ?>
34
+ <?php echo $this->getSaveButtonHtml() ?>
35
+ </td>
36
+ </tr>
37
+ </table>
38
+ </div>
39
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="attributes_edit_form" enctype="multipart/form-data">
40
+ <?php echo $this->getBlockHtml('formkey')?>
41
+ </form>
42
+ <script type="text/javascript">
43
+ var attributesForm = new varienForm('attributes_edit_form', '<?php echo $this->getValidationUrl() ?>');
44
+ attributesForm._processValidationResult = function(transport) {
45
+ var response = transport.responseText.evalJSON();
46
+
47
+ if (response.error){
48
+ if (response.attribute && $(response.attribute)) {
49
+ $(response.attribute).setHasError(true, attributesForm);
50
+ Validation.ajaxError($(response.attribute), response.message);
51
+ if (!Prototype.Browser.IE){
52
+ $(response.attribute).focus();
53
+ }
54
+ } else if ($('messages')) {
55
+ $('messages').innerHTML = '<ul class="messages"><li class="error-msg"><ul><li>' + response.message + '</li></ul></li></ul>';
56
+ }
57
+ } else {
58
+ attributesForm._submit();
59
+ }
60
+ };
61
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ function toggleValueElementsWithCheckbox(checkbox) {
30
+ var td = $(checkbox.parentNode);
31
+ var checkboxes = td.getElementsBySelector('input[type="checkbox"]');
32
+ var inputs = td.getElementsBySelector('input[type!="checkbox"]', 'select', 'textarea');
33
+ if (checkboxes.size()>1) {
34
+ inputs.each(function(input){
35
+ input.disabled = (!checkbox.checked || checkboxes[0].checked);
36
+ checkboxes[0].disabled = !checkbox.checked;
37
+ });
38
+ } else {
39
+ inputs.each(function(input){
40
+ input.disabled = !checkbox.checked;
41
+ });
42
+ }
43
+ }
44
+ //]]>
45
+ </script>
46
+
47
+ <div class="entry-edit">
48
+ <div class="entry-edit-head">
49
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Inventory') ?></h4>
50
+ </div>
51
+ <fieldset>
52
+ <legend><?php echo Mage::helper('catalog')->__('Inventory') ?></legend>
53
+ <table cellspacing="0" class="form-list" id="table_cataloginventory">
54
+ <tr>
55
+ <td class="label"><label for="inventory_manage_stock"><?php echo Mage::helper('catalog')->__('Manage Stock') ?></label></td>
56
+ <td class="value"><select id="inventory_manage_stock" name="<?php echo $this->getFieldSuffix() ?>[manage_stock]" class="select" disabled="disabled">
57
+ <option value="1"><?php echo Mage::helper('catalog')->__('Yes') ?></option>
58
+ <option value="0"<?php if ($this->getConfigFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('No') ?></option>
59
+ </select>
60
+ <input name="<?php echo $this->getFieldSuffix() ?>[use_config_manage_stock]" type="checkbox" id="inventory_use_config_manage_stock" onclick="toggleValueElements(this, this.parentNode, $('inventory_manage_stock_checkbox'));" value="1" checked="checked" disabled="disabled" />
61
+ <label for="inventory_use_config_manage_stock" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
62
+ <input type="checkbox" id="inventory_manage_stock_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
63
+ <label for="inventory_manage_stock_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
64
+ </td>
65
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
66
+ </tr>
67
+ <tr>
68
+ <td class="label"><label for="inventory_qty"><?php echo Mage::helper('catalog')->__('Qty') ?><span class="required">*</span></label></td>
69
+ <td class="value">
70
+ <input type="text" class="input-text required-entry validate-number" id="inventory_qty" name="<?php echo $this->getFieldSuffix() ?>[qty]" value="<?php echo $this->getDefaultConfigValue('qty')*1 ?>" disabled="disabled" />
71
+ <input type="checkbox" id="inventory_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
72
+ <label for="inventory_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
73
+ </td>
74
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
75
+ </tr>
76
+ <tr>
77
+ <td class="label"><label for="inventory_min_qty"><?php echo Mage::helper('catalog')->__('Minimum Qty for Item\'s Status to be Out of Stock') ?></label></td>
78
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_min_qty" name="<?php echo $this->getFieldSuffix() ?>[min_qty]" value="<?php echo $this->getDefaultConfigValue('min_qty')*1 ?>" disabled="disabled" />
79
+ <input type="checkbox" id="inventory_use_config_min_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_min_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_min_qty_checkbox'));" checked="checked" disabled="disabled" />
80
+ <label for="inventory_use_config_min_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
81
+ <input type="checkbox" id="inventory_min_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
82
+ <label for="inventory_min_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
83
+ </td>
84
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
85
+ </tr>
86
+ <tr>
87
+ <td class="label"><label for="inventory_min_sale_qty"><?php echo Mage::helper('catalog')->__('Minimum Qty Allowed in Shopping Cart') ?></label></td>
88
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[min_sale_qty]" value="<?php echo $this->getDefaultConfigValue('min_sale_qty')*1 ?>" disabled="disabled" />
89
+ <input type="checkbox" id="inventory_use_config_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_min_sale_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_min_sale_qty_checkbox'));" checked="checked" disabled="disabled" />
90
+ <label for="inventory_use_config_min_sale_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
91
+ <input type="checkbox" id="inventory_min_sale_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
92
+ <label for="inventory_min_sale_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
93
+ </td>
94
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
95
+ </tr>
96
+ <tr>
97
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Maximum Qty Allowed in Shopping Cart') ?></label></td>
98
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_max_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[max_sale_qty]" value="<?php echo $this->getDefaultConfigValue('max_sale_qty')*1 ?>" disabled="disabled" />
99
+ <input type="checkbox" id="inventory_use_config_max_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_max_sale_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_max_sale_checkbox'));" checked="checked" disabled="disabled" />
100
+ <label for="inventory_use_config_max_sale_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
101
+ <input type="checkbox" id="inventory_max_sale_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
102
+ <label for="inventory_max_sale_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
103
+ </td>
104
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
105
+ </tr>
106
+ <tr>
107
+ <td class="label"><label for="inventory_is_qty_decimal"><?php echo Mage::helper('catalog')->__('Qty Uses Decimals') ?></label></td>
108
+ <td class="value"><select id="inventory_is_qty_decimal" name="<?php echo $this->getFieldSuffix() ?>[is_qty_decimal]" class="select" disabled="disabled">
109
+ <option value="0"><?php echo Mage::helper('catalog')->__('No') ?></option>
110
+ <option value="1"<?php if ($this->getDefaultConfigValue('is_qty_decimal')==1): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('Yes') ?></option>
111
+ </select>
112
+ <input type="checkbox" id="inventory_is_qty_decimal_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
113
+ <label for="inventory_is_qty_decimal_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
114
+ </td>
115
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
116
+ </tr>
117
+ <tr>
118
+ <td class="label"><label for="inventory_backorders"><?php echo Mage::helper('catalog')->__('Backorders') ?></label></td>
119
+ <td class="value"><select id="inventory_backorders" name="<?php echo $this->getFieldSuffix() ?>[backorders]" class="select" disabled="disabled">
120
+ <?php foreach ($this->getBackordersOption() as $option): ?>
121
+ <?php $_selected = ($option['value'] == $this->getDefaultConfigValue('backorders')) ? ' selected="selected"' : '' ?>
122
+ <option value="<?php echo $option['value'] ?>"<?php echo $_selected ?>><?php echo $option['label'] ?></option>
123
+ <?php endforeach; ?>
124
+ </select>
125
+ <input type="checkbox" id="inventory_use_config_backorders" name="<?php echo $this->getFieldSuffix() ?>[use_config_backorders]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_backorders_checkbox'));" checked="checked" disabled="disabled" />
126
+ <label for="inventory_use_config_backorders" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
127
+ <input type="checkbox" id="inventory_backorders_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
128
+ <label for="inventory_backorders_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
129
+ </td>
130
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
131
+ </tr>
132
+ <tr>
133
+ <td class="label"><label for="inventory_notify_stock_qty"><?php echo Mage::helper('catalog')->__('Notify for Quantity Below') ?></label></td>
134
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_notify_stock_qty" name="<?php echo $this->getFieldSuffix() ?>[notify_stock_qty]" value="<?php echo $this->getDefaultConfigValue('notify_stock_qty')*1 ?>" disabled="disabled" />
135
+ <input type="checkbox" id="inventory_use_config_notify_stock_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_notify_stock_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_notify_stock_qty_checkbox'));" checked="checked" disabled="disabled" />
136
+ <label for="inventory_use_config_notify_stock_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
137
+ <input type="checkbox" id="inventory_notify_stock_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
138
+ <label for="inventory_notify_stock_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
139
+ </td>
140
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
141
+ </tr>
142
+
143
+ <tr>
144
+ <td class="label"><label for="inventory_enable_qty_increments"><?php echo Mage::helper('catalog')->__('Enable Qty Increments') ?></label></td>
145
+ <td class="value"><select id="inventory_enable_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[enable_qty_increments]" class="select" disabled="disabled">
146
+ <option value="1"><?php echo Mage::helper('catalog')->__('Yes') ?></option>
147
+ <option value="0"<?php if ($this->getDefaultConfigValue('enable_qty_increments') == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('No') ?></option>
148
+ </select>
149
+ <input type="checkbox" id="inventory_use_config_enable_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[use_config_enable_qty_increments]" value="1" onclick="toggleValueElements(this, this.parentNode, [$('inventory_enable_qty_increments_checkbox')]);" checked="checked" disabled="disabled" />
150
+ <label for="inventory_use_config_enable_qty_increments" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
151
+ <input type="checkbox" id="inventory_enable_qty_increments_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
152
+ <label for="inventory_enable_qty_increments_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
153
+ </td>
154
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
155
+ </tr>
156
+ <tr>
157
+ <td class="label"><label for="inventory_qty_increments"><?php echo Mage::helper('catalog')->__('Qty Increments') ?></label></td>
158
+ <td class="value">
159
+ <input type="text" class="input-text validate-number" id="inventory_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[qty_increments]" value="<?php echo $this->getDefaultConfigValue('qty_increments')*1 ?>" disabled="disabled" />
160
+ <input type="checkbox" id="inventory_use_config_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[use_config_qty_increments]" value="1" onclick="toggleValueElements(this, this.parentNode, [$('inventory_qty_increments_checkbox')]);" checked="checked" disabled="disabled" />
161
+ <label for="inventory_use_config_qty_increments" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
162
+ <input type="checkbox" id="inventory_qty_increments_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
163
+ <label for="inventory_qty_increments_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
164
+ </td>
165
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
166
+ </tr>
167
+
168
+ <tr>
169
+ <td class="label"><label for="inventory_stock_availability"><?php echo Mage::helper('catalog')->__('Stock Availability') ?></label></td>
170
+ <td class="value"><select id="inventory_stock_availability" name="<?php echo $this->getFieldSuffix() ?>[is_in_stock]" class="select" disabled="disabled">
171
+ <option value="1"><?php echo Mage::helper('catalog')->__('In Stock') ?></option>
172
+ <option value="0"<?php if ($this->getDefaultConfigValue('is_in_stock')==0): ?> selected<?php endif; ?>><?php echo Mage::helper('catalog')->__('Out of Stock') ?></option>
173
+ </select>
174
+ <input type="checkbox" id="inventory_stock_availability_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
175
+ <label for="inventory_stock_availability_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
176
+ </td>
177
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
178
+ </tr>
179
+ </table>
180
+ </fieldset>
181
+ </div>
app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Add Product To Websites') ?></h4>
30
+ </div>
31
+ <fieldset id="grop_fields">
32
+ <?php foreach ($this->getWebsiteCollection() as $_website): ?>
33
+ <div>
34
+ <div class="website-name">
35
+ <input name="add_website_ids[]" value="<?php echo $_website->getId() ?>" <?php if($this->getWebsitesReadonly()): ?>disabled="disabled"<?php endif;?> class="checkbox website-checkbox" id="add_product_website_<?php echo $_website->getId() ?>" type="checkbox" />
36
+ <big><strong><label for="add_product_website_<?php echo $_website->getId() ?>"><?php echo $this->escapeHtml($_website->getName()) ?></label></strong></big>
37
+ </div>
38
+ <div class="webiste-groups" id="add_product_website_<?php echo $_website->getId() ?>_data">
39
+ <?php foreach ($this->getGroupCollection($_website) as $_group): ?>
40
+ <h4><?php echo $this->escapeHtml($_group->getName()) ?></h4>
41
+ <div class="group-stores">
42
+ <table>
43
+ <?php foreach ($this->getStoreCollection($_group) as $_store): ?>
44
+ <tr>
45
+ <td><?php echo $this->escapeHtml($_store->getName()) ?></td>
46
+ <td>&nbsp;</td>
47
+ </tr>
48
+ <?php endforeach; ?>
49
+ </table>
50
+ </div>
51
+ <?php endforeach; ?>
52
+ </div>
53
+ </div>
54
+ <?php endforeach; ?>
55
+ </fieldset>
56
+ </div>
57
+
58
+ <div class="entry-edit">
59
+ <div class="entry-edit-head">
60
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Remove Product From Websites') ?></h4>
61
+ </div>
62
+ <fieldset id="grop_fields">
63
+ <ul class="messages">
64
+ <li class="notice-msg">
65
+ <ul>
66
+ <li><?php echo Mage::helper('catalog')->__("Items that you do not want to show in the catalog or search results should have status 'Disabled' in the desired store.") ?></li>
67
+ </ul>
68
+ </li>
69
+ </ul>
70
+ <?php foreach ($this->getWebsiteCollection() as $_website): ?>
71
+ <div>
72
+ <div class="website-name">
73
+ <input name="remove_website_ids[]" value="<?php echo $_website->getId() ?>" <?php if($this->getWebsitesReadonly()): ?>disabled="disabled"<?php endif;?> class="checkbox website-checkbox" id="remove_product_website_<?php echo $_website->getId() ?>" type="checkbox"/>
74
+ <big><strong><label for="remove_product_website_<?php echo $_website->getId() ?>"><?php echo $this->escapeHtml($_website->getName()) ?></label></strong></big>
75
+ </div>
76
+ <div class="webiste-groups" id="remove_product_website_<?php echo $_website->getId() ?>_data">
77
+ <?php foreach ($this->getGroupCollection($_website) as $_group): ?>
78
+ <h4><?php echo $this->escapeHtml($_group->getName()) ?></h4>
79
+ <div class="group-stores">
80
+ <table>
81
+ <?php foreach ($this->getStoreCollection($_group) as $_store): ?>
82
+ <tr>
83
+ <td><?php echo $this->escapeHtml($_store->getName()) ?></td>
84
+ <td>&nbsp;</td>
85
+ </tr>
86
+ <?php endforeach; ?>
87
+ </table>
88
+ </div>
89
+ <?php endforeach; ?>
90
+ </div>
91
+ </div>
92
+ <?php endforeach; ?>
93
+ </fieldset>
94
+ </div>
95
+ <script type="text/javascript">
96
+ //<![CDATA[
97
+ var productWebsiteCheckboxes = $$('.website-checkbox');
98
+
99
+ for(var i=0;i<productWebsiteCheckboxes.length;i++){
100
+ Event.observe(productWebsiteCheckboxes[i], 'click', toggleStoreFromChoosers);
101
+ }
102
+
103
+ function toggleStoreFromChoosers(event){
104
+ var element = Event.element(event);
105
+ var selects = $(element.id+'_data').getElementsBySelector('select');
106
+ var selectBlocks = $(element.id+'_data').getElementsByClassName('website-'+element.value+'-select');
107
+ for (var i=0; i<selects.length; i++) {
108
+ selects[i].disabled=!element.checked;
109
+ }
110
+ for (var i=0; i<selectBlocks.length; i++) {
111
+ if (element.checked) {
112
+ selectBlocks[i].show();
113
+ }
114
+ else {
115
+ selectBlocks[i].hide();
116
+ }
117
+ }
118
+ }
119
+ //]]>
120
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Product Categories') ?></h4>
30
+ </div>
31
+ <fieldset id="grop_fields">
32
+ <input type="hidden" name="category_ids" id="product_categories" value="<?php echo $this->getIdsString() ?>">
33
+ <div id="product-categories" class="tree"></div>
34
+ </fieldset>
35
+ </div>
36
+ <?php if($this->getRootNode() && $this->getRootNode()->hasChildren()): ?>
37
+ <script type="text/javascript">
38
+ Ext.EventManager.onDocumentReady(function() {
39
+ var categoryLoader = new Ext.tree.TreeLoader({
40
+ dataUrl: '<?php echo $this->getLoadTreeUrl()?>'
41
+ });
42
+
43
+ categoryLoader.createNode = function(config) {
44
+ config.uiProvider = Ext.tree.CheckboxNodeUI;
45
+ var node;
46
+ if (config.children && !config.children.length) {
47
+ delete(config.children);
48
+ node = new Ext.tree.AsyncTreeNode(config);
49
+
50
+ } else {
51
+ node = new Ext.tree.TreeNode(config);
52
+ }
53
+ return node;
54
+ };
55
+
56
+ categoryLoader.on("beforeload", function(treeLoader, node) {
57
+ treeLoader.baseParams.category = node.attributes.id;
58
+ });
59
+
60
+ categoryLoader.on("load", function(treeLoader, node, config) {
61
+ varienWindowOnload();
62
+ });
63
+
64
+ var tree = new Ext.tree.TreePanel('product-categories', {
65
+ animate:true,
66
+ loader: categoryLoader,
67
+ enableDD:false,
68
+ containerScroll: true,
69
+ rootUIProvider: Ext.tree.CheckboxNodeUI,
70
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
71
+ rootVisible: '<?php echo $this->getRootNode()->getIsVisible() ?>'
72
+ });
73
+
74
+ tree.on('check', function(node) {
75
+ if(node.attributes.checked) {
76
+ categoryAdd(node.id);
77
+ } else {
78
+ categoryRemove(node.id);
79
+ }
80
+ varienElementMethods.setHasChanges(node.getUI().checkbox);
81
+ }, tree);
82
+
83
+ // set the root node
84
+ var root = new Ext.tree.TreeNode({
85
+ text: '<?php echo $this->jsQuoteEscape($this->getRootNode()->getName()) ?>',
86
+ draggable:false,
87
+ checked:'<?php echo $this->getRootNode()->getChecked() ?>',
88
+ id:'<?php echo $this->getRootNode()->getId() ?>',
89
+ disabled: <?php echo ($this->getRootNode()->getDisabled() ? 'true' : 'false') ?>,
90
+ uiProvider: Ext.tree.CheckboxNodeUI
91
+ });
92
+
93
+ tree.setRootNode(root);
94
+ bildCategoryTree(root, <?php echo $this->getTreeJson() ?>);
95
+ tree.addListener('click', categoryClick.createDelegate(this));
96
+
97
+ // render the tree
98
+ tree.render();
99
+ root.expand();
100
+ //tree.expandAll();
101
+ });
102
+
103
+ function bildCategoryTree(parent, config){
104
+ if (!config) return null;
105
+
106
+ if (parent && config && config.length){
107
+ for (var i = 0; i < config.length; i++){
108
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
109
+ var node;
110
+ var _node = Object.clone(config[i]);
111
+ if (_node.children && !_node.children.length) {
112
+ delete(_node.children);
113
+ node = new Ext.tree.AsyncTreeNode(_node);
114
+
115
+ } else {
116
+ node = new Ext.tree.TreeNode(config[i]);
117
+ }
118
+ parent.appendChild(node);
119
+ node.loader = node.getOwnerTree().loader;
120
+ if(config[i].children){
121
+ bildCategoryTree(node, config[i].children);
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ function categoryClick(node, e){
128
+ if (node.disabled) {
129
+ return;
130
+ }
131
+ node.getUI().check(!node.getUI().checked());
132
+ varienElementMethods.setHasChanges(Event.element(e), e);
133
+ };
134
+ function categoryAdd(id) {
135
+ var ids = $('product_categories').value.split(',');
136
+ ids.push(id);
137
+ $('product_categories').value = ids.join(',');
138
+ }
139
+ function categoryRemove(id) {
140
+ var ids = $('product_categories').value.split(',');
141
+ // bug #7654 fixed
142
+ while (-1 != ids.indexOf(id)) {
143
+ ids.splice(ids.indexOf(id), 1);
144
+ }
145
+ $('product_categories').value = ids.join(',');
146
+ }
147
+ </script>
148
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="entry-edit custom-options product-custom-options">
28
+ <div id="dynamic-price-warrning" style="display:none">
29
+ <ul class="messages">
30
+ <li class="error-msg">
31
+ <ul>
32
+ <li><?php echo $this->__('Bundle with dynamic pricing cannot include custom defined options. Options will not be saved.') ?></li>
33
+ </ul>
34
+ </li>
35
+ </ul>
36
+ </div>
37
+ <div class="entry-edit-head">
38
+ <h4><?php echo Mage::helper('catalog')->__('Custom Options') ?></h4>
39
+ <div class="right"><?php echo $this->getAddButtonHtml() ?></div>
40
+ </div>
41
+
42
+ <div id="product_options_container" class="box">
43
+ <div id="product_options_container_top"></div>
44
+ <?php echo $this->getOptionsBoxHtml() ?>
45
+ </div>
46
+ </div>
47
+
48
+ <script type="text/javascript">
49
+ // re-bind form elements onchange
50
+ varienWindowOnload(true);
51
+ //show error message
52
+ if ($('price_type')) {
53
+ if ($('price_type').value == '0' && $('dynamic-price-warrning')) {
54
+ $('dynamic-price-warrning').show();
55
+ }
56
+ }
57
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->getTemplatesHtml() ?>
28
+
29
+ <script type="text/javascript">
30
+ //<![CDATA[
31
+ var firstStepTemplate = '<div class="option-box" id="option_{{id}}">'+
32
+ '<table id="<?php echo $this->getFieldId() ?>_{{id}}" class="option-header" cellpadding="0" cellspacing="0">'+
33
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_is_delete" name="<?php echo $this->getFieldName() ?>[{{id}}][is_delete]" value="" />'+
34
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_previous_type" name="<?php echo $this->getFieldName() ?>[{{id}}][previous_type]" value="{{type}}" />'+
35
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_previous_group" name="<?php echo $this->getFieldName() ?>[{{id}}][previous_group]" value="" />'+
36
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_id" name="<?php echo $this->getFieldName() ?>[{{id}}][id]" value="{{id}}" />'+
37
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_option_id" name="<?php echo $this->getFieldName() ?>[{{id}}][option_id]" value="{{option_id}}" />'+
38
+ '<thead>'+
39
+ '<tr>'+
40
+ '<th class="opt-title"><?php echo Mage::helper('catalog')->__('Title') ?> <span class="required">*</span></th>'+
41
+ '<th class="opt-type"><?php echo Mage::helper('catalog')->__('Input Type') ?> <span class="required">*</span></th>'+
42
+ '<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Is Required')) ?></th>'+
43
+ '<th class="opt-order"><?php echo Mage::helper('catalog')->__('Sort Order') ?></th>'+
44
+ '<th class="a-right"><?php echo $this->jsQuoteEscape($this->getDeleteButtonHtml()) ?></th>'+
45
+ '</tr>'+
46
+ '</thead>'+
47
+ '<tr>'+
48
+ '<td><input type="text" class="required-entry input-text" id="<?php echo $this->getFieldId() ?>_{{id}}_title" name="<?php echo $this->getFieldName() ?>[{{id}}][title]" value="{{title}}">{{checkboxScopeTitle}}</td>'+
49
+ '<td><?php echo $this->getTypeSelectHtml() ?></td>'+
50
+ '<td class="opt-req"><?php echo $this->getRequireSelectHtml() ?></td>'+
51
+ '<td><input type="text" class="validate-zero-or-greater input-text" name="<?php echo $this->getFieldName() ?>[{{id}}][sort_order]" value="{{sort_order}}"></td>'+
52
+ '<td>&nbsp;</td>'+
53
+ '</tr></table></div>';
54
+
55
+ var productOption = {
56
+ div : $('product_options_container_top'),
57
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
58
+ templateText : firstStepTemplate,
59
+ itemCount : 1,
60
+ add : function(data) {
61
+ this.template = new Template(this.templateText, this.templateSyntax);
62
+
63
+ if(!data.id){
64
+ data = {};
65
+ data.id = this.itemCount;
66
+ data.type = '';
67
+ data.option_id = 0;
68
+ } else {
69
+ this.itemCount = data.item_count;
70
+ }
71
+
72
+ Element.insert(this.div, {'after':this.template.evaluate(data)});
73
+
74
+ //set selected type
75
+ if (data.type) {
76
+ $A($('<?php echo $this->getFieldId() ?>_'+data.id+'_type').options).each(function(option){
77
+ if (option.value==data.type) option.selected = true;
78
+ });
79
+ }
80
+
81
+ //set selected is_require
82
+ if (data.is_require) {
83
+ $A($('<?php echo $this->getFieldId() ?>_'+data.id+'_is_require').options).each(function(option){
84
+ if (option.value==data.is_require) option.selected = true;
85
+ });
86
+ }
87
+
88
+ if (data.checkboxScopeTitle) {
89
+ //set disabled
90
+ if ($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_title') && data.scopeTitleDisabled) {
91
+ $('<?php echo $this->getFieldId() ?>_'+data.option_id+'_title').disable();
92
+ }
93
+ }
94
+
95
+ this.itemCount++;
96
+ this.bindRemoveButtons();
97
+ productOptionType.bindSelectInputType();
98
+ },
99
+ remove : function(event){
100
+ var element = $(Event.findElement(event, 'div'));
101
+ if(element){
102
+ $('product_'+element.readAttribute('id')+'_'+'is_delete').value = '1';
103
+ element.addClassName('no-display');
104
+ element.addClassName('ignore-validate');
105
+ element.hide();
106
+ }
107
+ },
108
+ bindRemoveButtons : function(){
109
+ var buttons = $$('div.product-custom-options .delete-product-option');
110
+ for(var i=0;i<buttons.length;i++){
111
+ if(!$(buttons[i]).binded){
112
+ $(buttons[i]).binded = true;
113
+ Event.observe(buttons[i], 'click', this.remove.bind(this));
114
+ }
115
+ }
116
+ var inputs = $$('div.product-custom-options button', 'div.product-custom-options input', 'div.product-custom-options select', 'div.product-custom-options textarea');
117
+ <?php if ($this->isReadonly()):?>
118
+ for (var i=0, l = inputs.length; i < l; i ++) {
119
+ inputs[i].disabled = true;
120
+ if (inputs[i].tagName.toLowerCase()=='button') {
121
+ inputs[i].addClassName('disabled');
122
+ }
123
+ }
124
+ <?php else: ?>
125
+ inputs.each(function(el) { Event.observe(el, 'change', el.setHasChanges.bind(el)); } )
126
+ <?php endif;?>
127
+ }
128
+ }
129
+
130
+
131
+ var productOptionType = {
132
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
133
+ loadStepTwo : function(event){
134
+ var element = $(Event.findElement(event, 'select'));
135
+
136
+ var group = '';
137
+ var previousGroupElm = $(element.readAttribute('id').sub('_type', '_previous_group'));
138
+
139
+ switch(element.getValue()){
140
+ case 'field':
141
+ case 'area':
142
+ template = OptionTemplateText;
143
+ group = 'text';
144
+ break;
145
+ case 'file':
146
+ template = OptionTemplateFile;
147
+ group = 'file';
148
+ break;
149
+ case 'drop_down':
150
+ case 'radio':
151
+ case 'checkbox':
152
+ case 'multiple':
153
+ template = OptionTemplateSelect;
154
+ group = 'select';
155
+ break;
156
+ case 'date':
157
+ case 'date_time':
158
+ case 'time':
159
+ template = OptionTemplateDate;
160
+ group = 'date';
161
+ break;
162
+ default:
163
+ template = '';
164
+ group = 'unknown';
165
+ break;
166
+ }
167
+
168
+ if (previousGroupElm.getValue() != group) {
169
+ if ($(element.readAttribute('id')+'_'+previousGroupElm.getValue())) {
170
+ formElm = $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).descendants();
171
+ formElm.each(function(elm){
172
+ if (elm.tagName == 'input' || elm.tagName == 'select') {
173
+ elm.name = '__delete__'+elm.readAttribute('name');
174
+ }
175
+ });
176
+
177
+ $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).addClassName('no-display');
178
+ $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).addClassName('ignore-validate');
179
+ $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).hide();
180
+ }
181
+
182
+ previousGroupElm.value = group;
183
+
184
+ if ($(element.readAttribute('id')+'_'+group)) {
185
+ formElm = $(element.readAttribute('id')+'_'+group).descendants();
186
+ formElm.each(function(elm){
187
+ if (elm.match('input') || elm.match('select')) {
188
+ elm.name = elm.readAttribute('name').sub('__delete__', '');
189
+ }
190
+ });
191
+ $(element.readAttribute('id')+'_'+group).removeClassName('no-display');
192
+ $(element.readAttribute('id')+'_'+group).removeClassName('ignore-validate');
193
+ $(element.readAttribute('id')+'_'+group).show();
194
+
195
+ } else {
196
+ template = '<div id="'+element.readAttribute('id')+'_'+group+'" class="grid tier form-list">'+template+'</div><div id="'+element.readAttribute('id')+'_'+group+'_advice"></div';
197
+ this.secondTemplate = new Template(template, this.templateSyntax);
198
+
199
+ data = {};
200
+ if (!data.option_id) {
201
+ data = {};
202
+ data.option_id = $(element.readAttribute('id').sub('_type', '_id')).getValue();
203
+ }
204
+
205
+ Element.insert(element.readAttribute('id').sub('_type', ''), {'after':this.secondTemplate.evaluate(data)});
206
+
207
+ switch(element.getValue()){
208
+ case 'drop_down':
209
+ case 'radio':
210
+ case 'checkbox':
211
+ case 'multiple':
212
+ selectOptionType.bindAddButton();
213
+ break;
214
+ }
215
+ }
216
+ }
217
+ },
218
+ addDataToValues : function(data){
219
+
220
+ switch(data.type){
221
+ case 'field':
222
+ case 'area':
223
+ template = OptionTemplateText;
224
+ group = 'text';
225
+ break;
226
+ case 'file':
227
+ template = OptionTemplateFile;
228
+ group = 'file';
229
+ break;
230
+ case 'drop_down':
231
+ case 'radio':
232
+ case 'checkbox':
233
+ case 'multiple':
234
+ template = OptionTemplateSelect;
235
+ group = 'select';
236
+ break;
237
+ case 'date':
238
+ case 'date_time':
239
+ case 'time':
240
+ template = OptionTemplateDate;
241
+ group = 'date';
242
+ break;
243
+ }
244
+
245
+ $('<?php echo $this->getFieldId() ?>_'+data.id+'_previous_group').value = group;
246
+
247
+ template = '<div id="<?php echo $this->getFieldId() ?>_{{id}}_type_'+group+'" class="grid tier form-list">'+template+'</div><div id="<?php echo $this->getFieldId() ?>_{{id}}_type_'+group+'_advice"></div>';
248
+
249
+ this.secondTemplate = new Template(template, this.templateSyntax);
250
+
251
+ Element.insert($('<?php echo $this->getFieldId() ?>_'+data.option_id), {'after':this.secondTemplate.evaluate(data)});
252
+
253
+ if (data.checkboxScopePrice) {
254
+ //set disabled
255
+ if ($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price') && data.scopePriceDisabled) {
256
+ $('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price').disable();
257
+ $('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price_type').disable();
258
+ }
259
+ }
260
+
261
+ switch(data.type){
262
+ case 'drop_down':
263
+ case 'radio':
264
+ case 'checkbox':
265
+ case 'multiple':
266
+ data.optionValues.each(function(value) {
267
+ selectOptionType.add(value);
268
+ });
269
+ selectOptionType.bindAddButton();
270
+ break;
271
+ }
272
+
273
+ if (data.price_type) {
274
+ $A($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price_type').options).each(function(option){
275
+ if (option.value==data.price_type) option.selected = true;
276
+ });
277
+ }
278
+
279
+ },
280
+ bindSelectInputType : function(){
281
+ var types = $$('.select-product-option-type');
282
+ for(var i=0;i<types.length;i++){
283
+ if(!$(types[i]).binded){
284
+ $(types[i]).binded = true;
285
+ Event.observe(types[i], 'change', function(event){
286
+ productOptionType.loadStepTwo(event);
287
+ });
288
+ }
289
+ }
290
+ }
291
+ }
292
+
293
+ var productOptionScope = {
294
+ addScope : function(event){
295
+ var element = $(Event.element(event));
296
+ fieldToDisable = $(element.readAttribute('id').sub('_use_default', ''));
297
+
298
+ if (fieldToDisable.disabled) {
299
+ if (fieldToDisable.hasClassName('product-option-price')) {//need change to cheking value of element
300
+ $(fieldToDisable.readAttribute('id')+'_type').enable();
301
+ }
302
+ fieldToDisable.enable();
303
+ } else {
304
+ if (fieldToDisable.hasClassName('product-option-price')) {//need change to cheking value of element
305
+ $(fieldToDisable.readAttribute('id')+'_type').disable();
306
+ }
307
+ fieldToDisable.disable();
308
+ }
309
+ },
310
+ bindScopeCheckbox : function(){
311
+ var checkboxes = $$('.product-option-scope-checkbox');
312
+ for (var i=0;i<checkboxes.length;i++) {
313
+ if (!$(checkboxes[i]).binded) {
314
+ $(checkboxes[i]).binded = true;
315
+ Event.observe(checkboxes[i], 'click', this.addScope.bind(this));
316
+ }
317
+ }
318
+ }
319
+ }
320
+
321
+ if($('option_panel')){
322
+ $('option_panel').remove();
323
+ }
324
+
325
+ productOption.bindRemoveButtons();
326
+
327
+ if($('<?php echo $this->getAddButtonId() ?>')){
328
+ Event.observe('<?php echo $this->getAddButtonId() ?>', 'click', productOption.add.bind(productOption));
329
+ }
330
+
331
+ //validation for selected input type
332
+ Validation.addAllThese([
333
+ ['required-option-select', <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Select type of option')) ?>, function(v, elm) {
334
+ if (elm.getValue() == '') {
335
+ return false;
336
+ }
337
+ return true;
338
+ }]]);
339
+
340
+ //adding data to templates
341
+ <?php foreach ($this->getOptionValues() as $_value): ?>
342
+ productOption.add(<?php echo $_value->toJson() ?>);
343
+ productOptionType.addDataToValues(<?php echo $_value->toJson() ?>);
344
+ <?php endforeach; ?>
345
+
346
+ //bind scope checkboxes
347
+ productOptionScope.bindScopeCheckbox();
348
+ //]]>
349
+ </script>
350
+
351
+ <div><?php if (!$this->isReadonly()):?><input type="hidden" name="affect_product_custom_options" value="1" /><?php endif;?></div>
app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+
29
+ OptionTemplateDate = '<table class="border" cellpadding="0" cellspacing="0">'+
30
+ '<tr class="headings">'+
31
+ <?php if ($this->getCanReadPrice() !== false) : ?>
32
+ '<th class="type-price"><?php echo Mage::helper('catalog')->__('Price') ?></th>' +
33
+ '<th class="type-type"><?php echo Mage::helper('catalog')->__('Price Type') ?></th>' +
34
+ <?php endif; ?>
35
+ '<th class="last"><?php echo Mage::helper('catalog')->__('SKU') ?></th>'+
36
+ '</tr>'+
37
+ '<tr>'+
38
+ <?php if ($this->getCanReadPrice() !== false) : ?>
39
+ '<td><input type="text" class="input-text validate-number product-option-price" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' +
40
+ '<td><?php echo $this->getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}</td>' +
41
+ <?php else : ?>
42
+ '<input type="hidden" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]">' +
43
+ '<input type="hidden" name="product[options][{{option_id}}][price_type]" id="product_option_{{option_id}}_price_type">' +
44
+ <?php endif; ?>
45
+ '<td class="last"><input type="text" class="input-text type-sku" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>'+
46
+ '</tr>'+
47
+ '</table>';
48
+
49
+ if ($('option_panel_type_date')) {
50
+ $('option_panel_type_date').remove();
51
+ }
52
+
53
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+
29
+ OptionTemplateFile = '<table class="border" cellpadding="0" cellspacing="0">'+
30
+ '<tr class="headings">'+
31
+ <?php if ($this->getCanReadPrice() !== false) : ?>
32
+ '<th class="type-price">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Price')); ?> + '</th>' +
33
+ '<th class="type-type">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Price Type')); ?> + '</th>' +
34
+ <?php endif; ?>
35
+ '<th class="type-sku">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('SKU')); ?> + '</th>' +
36
+ '<th class="type-title">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Allowed File Extensions')); ?> + '</th>'+
37
+ '<th class="last">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Maximum Image Size')); ?> + '</th>' +
38
+ '</tr>' +
39
+ '<tr>' +
40
+ <?php if ($this->getCanReadPrice() !== false) : ?>
41
+ '<td><input class="input-text validate-zero-or-greater" type="text" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' +
42
+ '<td>' + <?php echo $this->helper('core')->jsonEncode($this->getPriceTypeSelectHtml()) ?> + '</td>' +
43
+ <?php else : ?>
44
+ '<input type="hidden" name="product[options][{{option_id}}][price]">' +
45
+ '<input type="hidden" name="product[options][{{option_id}}][price_type]" id="product_option_{{option_id}}_price_type">' +
46
+ <?php endif; ?>
47
+ '<td><input type="text" class="input-text" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>' +
48
+ '<td><input class="input-text" type="text" name="product[options][{{option_id}}][file_extension]" value="{{file_extension}}"></td>' +
49
+ '<td class="type-last last" nowrap><input class="input-text" type="text" name="product[options][{{option_id}}][image_size_x]" value="{{image_size_x}}">' +
50
+ <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('x')) ?> +
51
+ '<input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}">' +
52
+ <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('px.')) ?> +
53
+ '<br/>' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('leave blank if its not an image')) ?> + '</td>' +
54
+ '</tr>'+
55
+ '</table>';
56
+
57
+ if ($('option_panel_type_file')) {
58
+ $('option_panel_type_file').remove();
59
+ }
60
+
61
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ OptionTemplateSelect = '<table class="border" cellpadding="0" cellspacing="0">'+
31
+ '<input type="hidden" class="required-option-select-type-rows" name="validation_{{option_id}}_result" value="" >'+
32
+ '<thead>'+
33
+ '<tr class="headings">'+
34
+ '<th class="type-title"><?php echo Mage::helper('catalog')->__('Title') ?> <span class="required">*</span></th>'+
35
+ <?php if ($this->getCanReadPrice() !== false) : ?>
36
+ '<th class="type-price"><?php echo Mage::helper('catalog')->__('Price') ?></th>' +
37
+ '<th class="type-type"><?php echo Mage::helper('catalog')->__('Price Type') ?></th>' +
38
+ <?php endif; ?>
39
+ '<th class="type-sku"><?php echo Mage::helper('catalog')->__('SKU') ?></th>'+
40
+ '<th class="type-order"><?php echo Mage::helper('catalog')->__('Sort Order') ?></th>'+
41
+ '<th class="type-butt last">&nbsp;</th>'+
42
+ '</tr>'+
43
+ '</thead>'+
44
+ '<tbody id="select_option_type_row_{{option_id}}">'+
45
+ '</tbody>'+
46
+ '<tfoot>'+
47
+ '<tr>'+
48
+ '<td colspan="100" class="a-right"><?php echo $this->getAddButtonHtml() ?></td>'+
49
+ '</tr>'+
50
+ '</tfoot>'+
51
+ '</table>';
52
+
53
+ OptionTemplateSelectRow = '<tr id="product_option_{{id}}_select_{{select_id}}">'+
54
+ '<td>'+
55
+ '<input type="hidden" name="product[options][{{id}}][values][{{select_id}}][option_type_id]" value="{{option_type_id}}">'+
56
+ '<input type="hidden" id="product_option_{{id}}_select_{{select_id}}_is_delete" name="product[options][{{id}}][values][{{select_id}}][is_delete]" value="">'+
57
+ '<input type="text" class="required-entry input-text select-type-title" id="product_option_{{id}}_select_{{select_id}}_title" name="product[options][{{id}}][values][{{select_id}}][title]" value="{{title}}">{{checkboxScopeTitle}}</td>'+
58
+ <?php if ($this->getCanReadPrice() !== false) : ?>
59
+ '<td><input type="text" class="input-text validate-number product-option-price" id="product_option_{{id}}_select_{{select_id}}_price" name="product[options][{{id}}][values][{{select_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' +
60
+ '<td><?php echo $this->getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}</td>' +
61
+ <?php else : ?>
62
+ '<input type="hidden" id="product_option_{{id}}_select_{{select_id}}_price" name="product[options][{{id}}][values][{{select_id}}][price]">' +
63
+ '<input type="hidden" name="product[options][{{id}}][values][{{select_id}}][price_type]" id="product_option_{{id}}_select_{{select_id}}_price_type">' +
64
+ <?php endif; ?>
65
+ '<td><input type="text" class="input-text" name="product[options][{{id}}][values][{{select_id}}][sku]" value="{{sku}}"></td>'+
66
+ '<td><input type="text" class="validate-zero-or-greater input-text" name="product[options][{{id}}][values][{{select_id}}][sort_order]" value="{{sort_order}}"></td>'+
67
+ '<td class="last"><span title="Delete row"><?php echo $this->getDeleteButtonHtml() ?></span></td>'+
68
+ '</tr>';
69
+
70
+ selectOptionType = {
71
+ div : 'select_option_type_row',
72
+ itemCount : 0,
73
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
74
+ templateText : OptionTemplateSelectRow,
75
+ add : function(data) {
76
+
77
+ this.template = new Template(this.templateText, this.templateSyntax);
78
+
79
+ if (data.target || data.srcElement) {//data is Event (work in IE and Firefox)
80
+ element = $(Event.findElement(data, 'button'));
81
+ optionId = element.readAttribute('id').sub('add_select_row_button_', '');
82
+ data = {};
83
+ data.option_type_id = '-1';
84
+ data.select_id = this.itemCount;
85
+ } else {
86
+ optionId = data.option_id;
87
+ data.select_id = data.option_type_id;
88
+ this.itemCount = data.item_count;
89
+ }
90
+
91
+ data.id = optionId;
92
+
93
+ Element.insert($(this.div+'_'+data.id), {'bottom':this.template.evaluate(data)});
94
+
95
+ if (data.checkboxScopeTitle) {
96
+ //set disabled
97
+ if ($('product_option_'+data.id+'_select_'+data.select_id+'_title') && data.scopeTitleDisabled) {
98
+ $('product_option_'+data.id+'_select_'+data.select_id+'_title').disable();
99
+ }
100
+ }
101
+ if (data.checkboxScopePrice) {
102
+ //set disabled
103
+ if ($('product_option_'+data.id+'_select_'+data.select_id+'_price') && data.scopePriceDisabled) {
104
+ $('product_option_'+data.id+'_select_'+data.select_id+'_price').disable();
105
+ $('product_option_'+data.id+'_select_'+data.select_id+'_price_type').disable();
106
+ }
107
+ }
108
+
109
+ if (data.price_type) {
110
+ $A($('product_option_'+data.id+'_select_'+data.select_id+'_price_type').options).each(function(option){
111
+ if (option.value==data.price_type) option.selected = true;
112
+ });
113
+ }
114
+
115
+ this.itemCount++;
116
+ this.bindRemoveButtons();
117
+ },
118
+ remove : function(event){
119
+ var element = $(Event.findElement(event, 'tr'));
120
+
121
+ if(element){
122
+ $(element.readAttribute('id')+'_is_delete').value = '1';
123
+ element.addClassName('no-display');
124
+ element.addClassName('ignore-validate');
125
+ element.hide();
126
+ }
127
+ },
128
+ bindRemoveButtons : function(){
129
+ var buttons = $$('.delete-select-row');
130
+ for(var i=0;i<buttons.length;i++){
131
+ if(!$(buttons[i]).binded){
132
+ $(buttons[i]).binded = true;
133
+ Event.observe(buttons[i], 'click', this.remove.bind(this));
134
+ }
135
+ }
136
+ },
137
+ bindAddButton : function()
138
+ {
139
+ var buttons = $$('.add-select-row');
140
+ for(var i=0;i<buttons.length;i++){
141
+ if(!$(buttons[i]).binded){
142
+ $(buttons[i]).binded = true;
143
+ Event.observe(buttons[i], 'click', this.add.bind(this));
144
+ }
145
+ }
146
+ }
147
+ }
148
+
149
+ if ($('option_panel_type_select')) {
150
+ $('option_panel_type_select').remove();
151
+ }
152
+
153
+ selectOptionType.bindRemoveButtons();
154
+
155
+ Validation.addAllThese([
156
+ ['required-option-select-type-rows', <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Please add rows to option.')); ?>, function(v, elm) {
157
+ var optionContainerElm = elm.up('div.grid');
158
+ var selectTypesFlag = false;
159
+ selectTypeElements = $$('#'+optionContainerElm.id+' .select-type-title');
160
+ selectTypeElements.each(function(elm){
161
+ if (elm.id && elm.up('tr').visible()) {
162
+ selectTypesFlag = true;
163
+ }
164
+ });
165
+ elm.advaiceContainer = optionContainerElm.id+'_advice';
166
+ return selectTypesFlag;
167
+ }]]);
168
+
169
+ if($('add_select_row_button')){
170
+ Event.observe('add_select_row_button', 'click', selectOptionType.add.bind(selectOptionType));
171
+ }
172
+ //]]>
173
+ </script>