Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2.0.0.0-dev42

* Application initialization improvements:
  * Removed application initialization responsibility from `Mage` class
  * Introduces entry points, which are responsible for different types of requests processing: HTTP, media, cron, indexing, console installing, etc.
  * New configuration classes are introduced and each of them is responsible for specific section of configuration
  * Class rewrites functionality removed from `Mage_Core_Model_Config` model. DI configuration should be used for rewriting classes
* Added ability to configure object manager with array in addition to object and scalar values
* VDE improvements:
  * Theme CSS files viewing and uploading/downloading of custom CSS file
  * Updated styling of VDE Tools panel
* Refactored various components to an analogous jQuery widget:
  * Refactored components:
    * Category navigation
    * Products management and gallery
    * Send to friend
    * Sales components, including orders and returns
    * Retrieve shipping rates and add/remove coupon in shopping cart
    * Customer address and address book
    * Customer wishlist
    * "Contact Us" form
    * CAPTCHA
    * Weee
  * New tabs widget is used instead of `Varien.Tabs`
  * Refactored `Varien.dateRangeDate` and `Varien.FileElement`
  * Replaced `$.mage.constants` with jQuery UI `$.ui.keyCode` for keyboard key codes
* Refactored configurable attribute, category parent and attribute set selectors to use suggest widget
* Bug fixes:
  * Improvements and bug fixes in new backend theme
  * Image, categories attributes and virtual/downloadable fields are displayed on Update Attributes page, where they shouldn't be present
  * Undefined config property in `reloadOptionLabels()` function in `configurable.js` (Chrome)
  * Impossible to edit existing customer/product tax class
  * Incorrect format of customer's "Date of Birth"
  * Theme preview images are absent in VDE
  * Search by backslash doesn't work for Categories field on product creation page
  * Impossible to assign a category to a product, if category name contains HTML tag
  * Incorrect URL generated for logo image
  • Loading branch information...
commit b9005af278ec5602f90c671a0bebe92372ab3de5 1 parent 310ebe8
@magento-team magento-team authored
Showing with 13,685 additions and 5,542 deletions.
  1. +38 −0 CHANGELOG.markdown
  2. +138 −156 app/Mage.php
  3. +0 −5 app/bootstrap.php
  4. +2 −2 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php
  5. +1 −3 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php
  6. +2 −1  app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
  7. +1 −3 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php
  8. +3 −6 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php
  9. +0 −25 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
  10. +38 −19 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php
  11. +16 −21 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
  12. +31 −21 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/NewCategory.php
  13. +6 −21 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
  14. +1 −1  app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php
  15. +1 −1  app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
  16. +49 −69 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php
  17. +47 −33 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Category.php
  18. +9 −4 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php
  19. +3 −3 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php
  20. +3 −3 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php
  21. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php
  22. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php
  23. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php
  24. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php
  25. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php
  26. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php
  27. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php
  28. +2 −1  app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php
  29. +1 −1  app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php
  30. +3 −3 app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php
  31. +4 −4 app/code/core/Mage/Adminhtml/Controller/Action.php
  32. +1 −1  app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
  33. +1 −1  app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php
  34. +11 −4 app/code/core/Mage/Adminhtml/Helper/Media/Js.php
  35. +2 −2 app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php
  36. +1 −1  app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php
  37. +12 −2 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
  38. +2 −3 app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
  39. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml
  40. +24 −65 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
  41. +103 −120 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/base-image-uploader.js
  42. +1 −17 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category-selector.css
  43. +3 −3 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category-selector.js
  44. +7 −6 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/configurable-product.css
  45. +10 −4 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml
  46. +13 −24 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product-variation.js
  47. +1 −0  app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js
  48. +0 −68 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/change_attribute_set_widget.phtml
  49. +17 −7 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml
  50. +36 −5 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/attribute_set.phtml
  51. +1 −1  app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/category/new/form.phtml
  52. +0 −202 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/category/new/js.phtml
  53. +157 −70 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml
  54. +176 −87 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/attribute-template.phtml
  55. +106 −70 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml
  56. +213 −121 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/matrix.phtml
  57. +88 −131 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml
  58. +3 −3 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml
  59. +1 −1  app/code/core/Mage/Adminhtml/view/adminhtml/catalog/type-switcher.js
  60. +105 −95 app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml
  61. +37 −35 app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml
  62. +57 −58 app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml
  63. +1 −1  app/code/core/Mage/Adminhtml/view/adminhtml/main.xml
  64. +20 −19 app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml
  65. +1 −4 app/code/core/Mage/Adminhtml/view/adminhtml/page/js/components.phtml
  66. +19 −19 app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml
  67. +3 −1 app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml
  68. +74 −74 app/code/core/Mage/Adminhtml/view/adminhtml/rating.xml
  69. +15 −27 app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml
  70. +7 −6 app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml
  71. +1 −1  app/code/core/Mage/Api/Model/Config.php
  72. +4 −2 app/code/core/Mage/Api/Model/Wsdl/Config.php
  73. +5 −10 app/code/core/Mage/Backend/Block/System/Config/Form.php
  74. +0 −1  app/code/core/Mage/Backend/Block/Template.php
  75. +4 −2 app/code/core/Mage/Backend/Block/Widget.php
  76. +0 −1  app/code/core/Mage/Backend/Block/Widget/Form.php
  77. +4 −4 app/code/core/Mage/Backend/Controller/ActionAbstract.php
  78. +5 −3 app/code/core/Mage/Backend/Controller/Router/Default.php
  79. +3 −3 app/code/core/Mage/Backend/Controller/System/ConfigAbstract.php
  80. +4 −2 app/code/core/Mage/Backend/Helper/Data.php
  81. +21 −5 app/code/core/Mage/Backend/Model/Acl/Config.php
  82. +29 −2 app/code/core/Mage/Backend/Model/Config/Backend/Admin/Custom.php
  83. +30 −2 app/code/core/Mage/Backend/Model/Config/Backend/Admin/Usecustom.php
  84. +14 −9 app/code/core/Mage/Backend/Model/Config/Structure/Reader.php
  85. +6 −6 app/code/core/Mage/Backend/Model/Menu/Config.php
  86. +4 −4 app/code/core/Mage/Backend/controllers/Adminhtml/System/Config/SaveController.php
  87. +1 −0  app/code/core/Mage/Backend/etc/config.xml
  88. +1 −1  app/code/core/Mage/Backend/view/adminhtml/admin/login.phtml
  89. +1 −1  app/code/core/Mage/Backend/view/adminhtml/widget/grid/column_set.phtml
  90. +2 −0  app/code/core/Mage/Backend/view/adminhtml/widget/grid/container.phtml
  91. +3 −1 app/code/core/Mage/Backup/Helper/Data.php
  92. +1 −4 app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
  93. +5 −2 app/code/core/Mage/Bundle/view/adminhtml/js/bundle-product.js
  94. +1 −3 app/code/core/Mage/Bundle/view/frontend/bundle.js
  95. +5 −3 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml
  96. +4 −4 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml
  97. +0 −3  app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml
  98. +0 −3  app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml
  99. +6 −6 app/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml
  100. +8 −8 app/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml
  101. +8 −8 app/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml
  102. +2 −2 app/code/core/Mage/Captcha/Block/Captcha/{Zend.php → Default.php}
  103. +5 −1 app/code/core/Mage/Captcha/Helper/Data.php
  104. +3 −3 app/code/core/Mage/Captcha/Model/{Zend.php → Default.php}
  105. +2 −2 app/code/core/Mage/Captcha/etc/config.xml
  106. +1 −1  app/code/core/Mage/Captcha/view/adminhtml/{zend.phtml → default.phtml}
  107. +26 −11 app/code/core/Mage/Captcha/view/frontend/captcha.js
  108. +8 −8 app/code/core/Mage/Captcha/view/frontend/{zend.phtml → default.phtml}
  109. +31 −31 app/code/core/Mage/Captcha/view/frontend/onepage.js
  110. +12 −7 app/code/core/Mage/Catalog/Block/Product/Configurable/AttributeSelector.php
  111. +62 −0 app/code/core/Mage/Catalog/Block/Product/TemplateSelector.php
  112. +3 −2 app/code/core/Mage/Catalog/Helper/Output.php
  113. +6 −2 app/code/core/Mage/Catalog/Helper/Product/Url.php
  114. +9 −9 app/code/core/Mage/Catalog/Helper/Product/View.php
  115. +2 −2 app/code/core/Mage/Catalog/Model/Category.php
  116. +5 −5 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php
  117. +80 −17 app/code/core/Mage/Catalog/Model/Product/Type.php
  118. +1 −1  app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php
  119. +1 −1  app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php
  120. +1 −1  app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php
  121. +1 −1  app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php
  122. +1 −1  app/code/core/Mage/Catalog/Model/Resource/Product/Status.php
  123. +1 −1  app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php
  124. +15 −6 app/code/core/Mage/Catalog/Model/Resource/Setup.php
  125. +3 −2 app/code/core/Mage/Catalog/view/adminhtml/js/grouped-product.js
  126. +129 −0 app/code/core/Mage/Catalog/view/adminhtml/js/new-category-dialog.js
  127. +328 −0 app/code/core/Mage/Catalog/view/adminhtml/js/product-gallery.js
  128. +1 −1  app/code/core/Mage/Catalog/view/adminhtml/product/configurable/affected-attribute-set-selector/js.phtml
  129. +28 −38 app/code/core/Mage/Catalog/view/adminhtml/product/configurable/attribute-selector/js.phtml
  130. +10 −0 app/code/core/Mage/Catalog/view/adminhtml/product/product.css
  131. +55 −0 app/code/core/Mage/Catalog/view/frontend/js/gallery.js
  132. +5 −13 app/code/core/Mage/Catalog/view/frontend/js/msrp.js
  133. +76 −0 app/code/core/Mage/Catalog/view/frontend/js/related-products.js
  134. +74 −0 app/code/core/Mage/Catalog/view/frontend/js/tier-price.js
  135. +4 −0 app/code/core/Mage/Catalog/view/frontend/msrp.xml
  136. +7 −5 app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml
  137. +8 −12 app/code/core/Mage/Catalog/view/frontend/product/gallery.phtml
  138. +5 −36 app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml
  139. +1 −2  app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml
  140. +16 −28 app/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml
  141. +3 −9 app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml
  142. +3 −3 app/code/core/Mage/CatalogRule/Model/Resource/Rule.php
  143. +19 −20 app/code/core/Mage/CatalogSearch/view/frontend/form-mini.js
  144. +9 −9 app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml
  145. +0 −68 app/code/core/Mage/Checkout/view/frontend/js/checkout-topcart.js
  146. +52 −10 app/code/core/Mage/Checkout/view/frontend/js/region-updater.js
  147. +8 −8 app/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml
  148. +22 −9 app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml
  149. +8 −8 app/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml
  150. +23 −8 app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml
  151. +12 −6 app/code/core/Mage/Checkout/view/frontend/opcheckout.js
  152. +3 −1 app/code/core/Mage/Cms/Controller/Router.php
  153. +2 −2 app/code/core/Mage/Cms/Model/Resource/Block.php
  154. +1 −1  app/code/core/Mage/Cms/Model/Resource/Block/Collection.php
  155. +4 −4 app/code/core/Mage/Cms/Model/Resource/Page.php
  156. +1 −1  app/code/core/Mage/Cms/Model/Resource/Page/Collection.php
  157. +8 −2 app/code/core/Mage/Connect/Helper/Data.php
  158. +12 −7 app/code/core/Mage/Contacts/view/frontend/form.phtml
  159. +2 −2 app/code/core/Mage/Core/Block/Abstract.php
  160. +48 −14 app/code/core/Mage/Core/Block/Messages.php
  161. +2 −2 app/code/core/Mage/Core/Block/Template.php
  162. +1 −1  app/code/core/Mage/Core/Controller/Front/Action.php
  163. +0 −1  app/code/core/Mage/Core/Controller/Response/Http.php
  164. +4 −4 app/code/core/Mage/Core/Controller/Varien/Action.php
  165. +1 −0  app/code/core/Mage/Core/Controller/Varien/Front.php
  166. +10 −0 app/code/core/Mage/Core/Controller/Varien/Router/Base.php
  167. +17 −2 app/code/core/Mage/Core/Helper/Abstract.php
  168. +4 −1 app/code/core/Mage/Core/Helper/Cookie.php
  169. +23 −6 app/code/core/Mage/Core/Helper/Data.php
  170. +20 −1 app/code/core/Mage/Core/Helper/Js.php
  171. +398 −0 app/code/core/Mage/Core/Helper/Theme.php
  172. +0 −24 app/code/core/Mage/Core/Helper/Translate.php
  173. +11 −5 app/code/core/Mage/Core/Helper/Url.php
  174. +54 −52 app/code/core/Mage/Core/Model/Abstract.php
  175. +259 −1,128 app/code/core/Mage/Core/Model/App.php
  176. +52 −5 app/code/core/Mage/Core/Model/App/Area.php
  177. +57 −0 app/code/core/Mage/Core/Model/App/Handler.php
  178. +581 −0 app/code/core/Mage/Core/Model/App/Proxy.php
  179. +109 −0 app/code/core/Mage/Core/Model/App/State.php
  180. +305 −0 app/code/core/Mage/Core/Model/AppInterface.php
  181. +42 −61 app/code/core/Mage/Core/Model/Cache.php
  182. +236 −0 app/code/core/Mage/Core/Model/Cache/Proxy.php
  183. +157 −0 app/code/core/Mage/Core/Model/CacheInterface.php
  184. +311 −1,425 app/code/core/Mage/Core/Model/Config.php
  185. +29 −3 app/code/core/Mage/Core/Model/Config/Base.php
  186. +51 −0 app/code/core/Mage/Core/Model/Config/BaseFactory.php
  187. +261 −0 app/code/core/Mage/Core/Model/Config/Cache.php
  188. +29 −0 app/code/core/Mage/Core/Model/Config/Cache/Exception.php
  189. +166 −0 app/code/core/Mage/Core/Model/Config/Container.php
  190. +50 −0 app/code/core/Mage/Core/Model/Config/ContainerFactory.php
  191. +1 −1  app/code/core/Mage/Core/Model/Config/Data.php
  192. +1 −1  app/code/core/Mage/Core/Model/Config/Element.php
  193. +3 −2 app/code/core/Mage/Core/Model/Config/Fieldset.php
  194. +74 −0 app/code/core/Mage/Core/Model/Config/Invalidator.php
  195. +46 −0 app/code/core/Mage/Core/Model/Config/Invalidator/Proxy.php
  196. +30 −0 app/code/core/Mage/Core/Model/Config/InvalidatorInterface.php
  197. +83 −0 app/code/core/Mage/Core/Model/Config/Loader.php
  198. +94 −0 app/code/core/Mage/Core/Model/Config/Loader/Db.php
  199. +118 −0 app/code/core/Mage/Core/Model/Config/Loader/Local.php
  200. +71 −0 app/code/core/Mage/Core/Model/Config/Loader/Locales.php
  201. +69 −0 app/code/core/Mage/Core/Model/Config/Loader/Locales/Proxy.php
  202. +245 −0 app/code/core/Mage/Core/Model/Config/Loader/Modules.php
  203. +209 −0 app/code/core/Mage/Core/Model/Config/Loader/Modules/File.php
  204. +68 −0 app/code/core/Mage/Core/Model/Config/Loader/Modules/Proxy.php
  205. +88 −0 app/code/core/Mage/Core/Model/Config/Loader/Primary.php
  206. +68 −0 app/code/core/Mage/Core/Model/Config/Loader/Proxy.php
  207. +34 −0 app/code/core/Mage/Core/Model/Config/LoaderInterface.php
  208. +92 −0 app/code/core/Mage/Core/Model/Config/Locales.php
  209. +110 −0 app/code/core/Mage/Core/Model/Config/Modules.php
  210. +102 −0 app/code/core/Mage/Core/Model/Config/Modules/Reader.php
  211. +3 −7 app/code/core/Mage/Core/Model/Config/{Module.php → Modules/Sorted.php}
  212. +33 −0 app/code/core/Mage/Core/Model/Config/ModulesInterface.php
  213. +91 −0 app/code/core/Mage/Core/Model/Config/Primary.php
  214. +125 −0 app/code/core/Mage/Core/Model/Config/Resource.php
  215. +70 −0 app/code/core/Mage/Core/Model/Config/Sections.php
  216. +79 −0 app/code/core/Mage/Core/Model/Config/Storage.php
  217. +28 −0 app/code/core/Mage/Core/Model/Config/Storage/Locales.php
  218. +28 −0 app/code/core/Mage/Core/Model/Config/Storage/Modules.php
  219. +67 −0 app/code/core/Mage/Core/Model/Config/Storage/Writer/Db.php
  220. +46 −0 app/code/core/Mage/Core/Model/Config/Storage/WriterInterface.php
  221. +86 −0 app/code/core/Mage/Core/Model/Config/StorageAbstract.php
  222. +39 −0 app/code/core/Mage/Core/Model/Config/StorageInterface.php
  223. +58 −0 app/code/core/Mage/Core/Model/ConfigInterface.php
  224. +2 −2 app/code/core/Mage/Core/Model/Cookie.php
  225. +158 −0 app/code/core/Mage/Core/Model/Db/Updater.php
  226. +47 −0 app/code/core/Mage/Core/Model/Db/UpdaterInterface.php
  227. +13 −76 app/code/core/Mage/Core/Model/Design/Package.php
  228. +225 −0 app/code/core/Mage/Core/Model/Design/Package/Proxy.php
  229. +228 −0 app/code/core/Mage/Core/Model/Design/PackageInterface.php
  230. +19 −1 app/code/core/Mage/Core/Model/Dir.php
  231. +42 −0 app/code/core/Mage/Core/Model/EntryPoint/Cron.php
  232. +42 −0 app/code/core/Mage/Core/Model/EntryPoint/Http.php
  233. +51 −0 app/code/core/Mage/Core/Model/EntryPoint/Media.php
  234. +67 −0 app/code/core/Mage/Core/Model/EntryPointAbstract.php
  235. +96 −0 app/code/core/Mage/Core/Model/Event/Config.php
  236. +131 −5 app/code/core/Mage/Core/Model/Event/Manager.php
  237. +2 −2 app/code/core/Mage/Core/Model/File/Storage.php
  238. +2 −4 app/code/core/Mage/Core/Model/Layout.php
  239. +1 −3 app/code/core/Mage/Core/Model/Layout/Element.php
  240. +1 −1  app/code/core/Mage/Core/Model/Layout/Merge.php
  241. +58 −0 app/code/core/Mage/Core/Model/Layout/Merge/Factory.php
  242. +90 −0 app/code/core/Mage/Core/Model/Locale/Hierarchy/Loader.php
  243. +16 −3 app/code/core/Mage/Core/Model/Logger.php
  244. +50 −0 app/code/core/Mage/Core/Model/ObjectManager.php
  245. +152 −0 app/code/core/Mage/Core/Model/ObjectManager/Config.php
  246. +54 −0 app/code/core/Mage/Core/Model/ObjectManager/ConfigAbstract.php
  247. +65 −0 app/code/core/Mage/Core/Model/ObserverFactory.php
  248. +50 −17 app/code/core/Mage/Core/Model/Resource.php
  249. +2 −2 app/code/core/Mage/Core/Model/Resource/Config.php
  250. +11 −11 app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php
  251. +46 −103 app/code/core/Mage/Core/Model/Resource/Setup.php
  252. +16 −7 app/code/core/Mage/Core/Model/Resource/Setup/Migration.php
  253. +58 −0 app/code/core/Mage/Core/Model/Resource/SetupFactory.php
  254. +63 −0 app/code/core/Mage/Core/Model/Resource/SetupInterface.php
  255. +1 −1  app/code/core/Mage/Core/Model/Resource/Store.php
  256. +1 −0  app/code/core/Mage/Core/Model/Resource/Theme/Collection.php
  257. +3 −3 app/code/core/Mage/Core/Model/Resource/Translate/String.php
  258. +2 −2 app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php
  259. +2 −2 app/code/core/Mage/Core/Model/Resource/Variable.php
  260. +15 −6 app/code/core/Mage/Core/Model/Store.php
  261. +1 −0  app/code/core/Mage/Core/Model/Store/Group.php
  262. +140 −0 app/code/core/Mage/Core/Model/Store/ListInterface.php
  263. +737 −0 app/code/core/Mage/Core/Model/Store/Storage/Db.php
  264. +254 −0 app/code/core/Mage/Core/Model/Store/Storage/Default.php
  265. +140 −0 app/code/core/Mage/Core/Model/Store/StorageFactory.php
  266. +30 −0 app/code/core/Mage/Core/Model/Store/StorageInterface.php
  267. +52 −0 app/code/core/Mage/Core/Model/StoreFactory.php
  268. +315 −0 app/code/core/Mage/Core/Model/StoreManager.php
  269. +49 −0 app/code/core/Mage/Core/Model/StoreManagerInterface.php
  270. +22 −8 app/code/core/Mage/Core/Model/Theme.php
  271. +1 −1  app/code/core/Mage/Core/Model/Theme/Customization/Files/Js.php
  272. +3 −3 app/code/core/Mage/Core/Model/Theme/Image.php
  273. +16 −6 app/code/core/Mage/Core/Model/Theme/Service.php
  274. +6 −19 app/code/core/Mage/Core/Model/Translate.php
  275. +1 −1  app/code/core/Mage/Core/Model/Url.php
  276. +3 −9 app/code/core/Mage/Core/Model/Validator/Factory.php
  277. +4 −2 app/code/core/Mage/Core/Model/Website.php
  278. +6 −4 app/code/core/Mage/Core/etc/config.xml
  279. +28 −0 app/code/core/Mage/Customer/Block/Widget/Dob.php
  280. +11 −6 app/code/core/Mage/Customer/Helper/Address.php
  281. +68 −0 app/code/core/Mage/Customer/view/frontend/address.js
  282. +12 −10 app/code/core/Mage/Customer/view/frontend/address.phtml
  283. +12 −12 app/code/core/Mage/Customer/view/frontend/address/book.phtml
  284. +3 −3 app/code/core/Mage/Customer/view/frontend/logout.phtml
  285. +50 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Form/Element/File.php
  286. +46 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools.php
  287. +32 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Block.php
  288. +45 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Code.php
  289. +50 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Css.php
  290. +66 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Css/Group.php
  291. +120 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php
  292. +189 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php
  293. +33 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Design.php
  294. +33 −0 app/code/core/Mage/DesignEditor/Block/Adminhtml/Editor/Tools/Settings.php
  295. +1 −1  app/code/core/Mage/DesignEditor/Block/Adminhtml/Theme/Selector/StoreView.php
  296. +4 −3 app/code/core/Mage/DesignEditor/Controller/Varien/Router/Standard.php
  297. +3 −1 app/code/core/Mage/DesignEditor/Helper/Data.php
  298. +2 −2 app/code/core/Mage/DesignEditor/Model/Change/Factory.php
  299. +230 −0 app/code/core/Mage/DesignEditor/controllers/Adminhtml/System/Design/Editor/ToolsController.php
  300. +194 −147 app/code/core/Mage/DesignEditor/controllers/Adminhtml/System/Design/EditorController.php
Sorry, we could not display the entire diff because too many files (710) changed.
View
38 CHANGELOG.markdown
@@ -1,3 +1,41 @@
+2.0.0.0-dev42
+=============
+* Application initialization improvements:
+ * Removed application initialization responsibility from `Mage` class
+ * Introduces entry points, which are responsible for different types of requests processing: HTTP, media, cron, indexing, console installing, etc.
+ * New configuration classes are introduced and each of them is responsible for specific section of configuration
+ * Class rewrites functionality removed from `Mage_Core_Model_Config` model. DI configuration should be used for rewriting classes
+* Added ability to configure object manager with array in addition to object and scalar values
+* VDE improvements:
+ * Theme CSS files viewing and uploading/downloading of custom CSS file
+ * Updated styling of VDE Tools panel
+* Refactored various components to an analogous jQuery widget:
+ * Refactored components:
+ * Category navigation
+ * Products management and gallery
+ * Send to friend
+ * Sales components, including orders and returns
+ * Retrieve shipping rates and add/remove coupon in shopping cart
+ * Customer address and address book
+ * Customer wishlist
+ * "Contact Us" form
+ * CAPTCHA
+ * Weee
+ * New tabs widget is used instead of `Varien.Tabs`
+ * Refactored `Varien.dateRangeDate` and `Varien.FileElement`
+ * Replaced `$.mage.constants` with jQuery UI `$.ui.keyCode` for keyboard key codes
+* Refactored configurable attribute, category parent and attribute set selectors to use suggest widget
+* Bug fixes:
+ * Improvements and bug fixes in new backend theme
+ * Image, categories attributes and virtual/downloadable fields are displayed on Update Attributes page, where they shouldn't be present
+ * Undefined config property in `reloadOptionLabels()` function in `configurable.js` (Chrome)
+ * Impossible to edit existing customer/product tax class
+ * Incorrect format of customer's "Date of Birth"
+ * Theme preview images are absent in VDE
+ * Search by backslash doesn't work for Categories field on product creation page
+ * Impossible to assign a category to a product, if category name contains HTML tag
+ * Incorrect URL generated for logo image
+
2.0.0.0-dev41
=============
* All-new look & feel of backend UI -- "Magento 2 backend" theme
View
294 app/Mage.php
@@ -29,17 +29,62 @@
*/
final class Mage
{
- /**#@+
- * Application initialization options to inject custom request/response objects
- */
- const INIT_OPTION_REQUEST = 'request';
- const INIT_OPTION_RESPONSE = 'response';
- /**#@-*/
+ const DEFAULT_ERROR_HANDLER = 'mageCoreErrorHandler';
/**
* Application initialization option to specify custom product edition label
*/
- const INIT_OPTION_EDITION = 'edition';
+ const PARAM_EDITION = 'edition';
+
+ /**
+ * Application run code
+ */
+ const PARAM_RUN_CODE = 'MAGE_RUN_CODE';
+
+ /**
+ * Application run type (store|website)
+ */
+ const PARAM_RUN_TYPE = 'MAGE_RUN_TYPE';
+
+ /**
+ * Base directory
+ */
+ const PARAM_BASEDIR = 'base_dir';
+
+ /**
+ * Custom application dirs
+ */
+ const PARAM_APP_DIRS = 'app_dirs';
+
+ /**
+ * Custom application uris
+ */
+ const PARAM_APP_URIS = 'app_uris';
+
+ /**
+ * Allowed modules
+ */
+ const PARAM_ALLOWED_MODULES = 'allowed_modules';
+
+ /**
+ * Caching params
+ */
+ const PARAM_CACHE_OPTIONS = 'cache_options';
+
+ /**
+ * Disallow cache
+ */
+ const PARAM_BAN_CACHE = 'global_ban_use_cache';
+
+ /**
+ * Custom local configuration file name
+ */
+ const PARAM_CUSTOM_LOCAL_FILE = 'custom_local_xml';
+
+ /**
+ * Custom local configuration
+ */
+ const PARAM_CUSTOM_LOCAL_CONFIG = 'custom_local_config';
/**
* Product edition labels
@@ -78,13 +123,6 @@
static private $_config;
/**
- * Event Collection Object
- *
- * @var Varien_Event_Collection
- */
- static private $_events;
-
- /**
* Object manager interface
*
* @var Magento_ObjectManager
@@ -149,6 +187,13 @@
static private $_isSerializable = true;
/**
+ * Update mode flag
+ *
+ * @var bool
+ */
+ static private $_updateMode = false;
+
+ /**
* Gets the current Magento version string
* @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
*
@@ -175,7 +220,7 @@ public static function getVersionInfo()
'revision' => '0',
'patch' => '0',
'stability' => 'dev',
- 'number' => '41',
+ 'number' => '42',
);
}
@@ -191,6 +236,16 @@ public static function getEdition()
}
/**
+ * Set edition
+ *
+ * @param string $edition
+ */
+ public static function setEdition($edition)
+ {
+ self::$_currentEdition = $edition;
+ }
+
+ /**
* Set all my static data to defaults
*
*/
@@ -201,7 +256,6 @@ public static function reset()
self::$_appRoot = null;
self::$_app = null;
self::$_config = null;
- self::$_events = null;
self::$_objects = null;
self::$_isDownloader = false;
self::$_isDeveloperMode = false;
@@ -230,6 +284,8 @@ public static function resetRegistry()
* @param mixed $value
* @param bool $graceful
* @throws Mage_Core_Exception
+ *
+ * @deprecated use Mage_Core_Model_Registry::register
*/
public static function register($key, $value, $graceful = false)
{
@@ -246,6 +302,8 @@ public static function register($key, $value, $graceful = false)
* Unregister a variable from register by key
*
* @param string $key
+ *
+ * @deprecated use Mage_Core_Model_Registry::unregister
*/
public static function unregister($key)
{
@@ -262,6 +320,8 @@ public static function unregister($key)
*
* @param string $key
* @return mixed
+ *
+ * @deprecated use Mage_Core_Model_Registry::registry
*/
public static function registry($key)
{
@@ -290,16 +350,6 @@ public static function getRoot()
}
/**
- * Retrieve Events Collection
- *
- * @return Varien_Event_Collection $collection
- */
- public static function getEvents()
- {
- return self::$_events;
- }
-
- /**
* Varien Objects Cache
*
* @param string $key optional, if specified will load this key
@@ -339,7 +389,7 @@ public static function getBaseDir($type = Mage_Core_Model_Dir::ROOT)
*/
public static function getModuleDir($type, $moduleName)
{
- return self::getConfig()->getModuleDir($type, $moduleName);
+ return self::getObjectManager()->get('Mage_Core_Model_Config_Modules_Reader')->getModuleDir($type, $moduleName);
}
/**
@@ -419,36 +469,10 @@ public static function getDesign()
*/
public static function getConfig()
{
- if (self::$_app) {
- // Usual workflow - act as a proxy, retrieve config from the application
- return self::$_app->getConfig();
- } else {
- // Temp workaround for unit tests only, so there is no urgent need to check and refactor them all
- if (!self::$_config) {
- self::$_config = self::getObjectManager()->get('Mage_Core_Model_Config');
- }
- return self::$_config;
- }
- }
-
- /**
- * Add observer to even object
- *
- * @param string $eventName
- * @param callback $callback
- * @param array $data
- * @param string $observerName
- * @param string $observerClass
- * @return Varien_Event_Collection
- */
- public static function addObserver($eventName, $callback, $data = array(), $observerName = '', $observerClass = '')
- {
- if ($observerClass == '') {
- $observerClass = 'Varien_Event_Observer';
+ if (!self::$_config) {
+ self::$_config = self::getObjectManager()->get('Mage_Core_Model_Config');
}
- $observer = self::getObjectManager()->create($observerClass);
- $observer->setName($observerName)->addData($data)->setEventName($eventName)->setCallback($callback);
- return self::getEvents()->addObserver($observer);
+ return self::$_config;
}
/**
@@ -459,14 +483,14 @@ public static function addObserver($eventName, $callback, $data = array(), $obse
*
* @param string $name
* @param array $data
- * @return Mage_Core_Model_App
+ *
+ * @deprecated use Mage_Core_Model_Event_Manager::dispatch
*/
public static function dispatchEvent($name, array $data = array())
{
- Magento_Profiler::start('EVENT:' . $name, array('group' => 'EVENT', 'name' => $name));
- $result = self::app()->dispatchEvent($name, $data);
- Magento_Profiler::stop('EVENT:'.$name);
- return $result;
+ /** @var $eventManager Mage_Core_Model_Event_Manager */
+ $eventManager = self::$_objectManager->get('Mage_Core_Model_Event_Manager');
+ $eventManager->dispatch($name, $data);
}
/**
@@ -502,31 +526,27 @@ public static function getSingleton($modelClass = '', array $arguments=array())
}
/**
- * Initialize object manager with definitions file
+ * Retrieve object manager
*
* @static
- * @param string $definitionsFile
- * @param Magento_ObjectManager $objectManager
+ * @return Magento_ObjectManager
*/
- public static function initializeObjectManager(
- $definitionsFile = null,
- Magento_ObjectManager $objectManager = null
- ) {
- self::$_objectManager = $objectManager ?: new Magento_ObjectManager_Zend($definitionsFile);
+ public static function getObjectManager()
+ {
+ return self::$_objectManager;
}
/**
- * Retrieve object manager
- *
- * @static
- * @return Magento_ObjectManager
+ * Set application object manager
+ * @param Magento_ObjectManager $objectManager
*/
- public static function getObjectManager()
+ public static function setObjectManager(Magento_ObjectManager $objectManager)
{
if (!self::$_objectManager) {
- self::initializeObjectManager();
+ self::$_objectManager = $objectManager;
+ } else {
+ throw new LogicException('Only one object manager can be used in application');
}
- return self::$_objectManager;
}
/**
@@ -587,8 +607,7 @@ public static function helper($name)
$registryKey = '_helper/' . $name;
if (!self::registry($registryKey)) {
- $helperClass = self::getConfig()->getHelperClassName($name);
- self::register($registryKey, self::getObjectManager()->get($helperClass));
+ self::register($registryKey, self::getObjectManager()->get($name));
}
return self::registry($registryKey);
}
@@ -601,7 +620,9 @@ public static function helper($name)
*/
public static function getResourceHelper($moduleName)
{
- $connectionModel = self::getConfig()->getResourceConnectionModel('core');
+ $connectionModel = self::getObjectManager()
+ ->get('Mage_Core_Model_Config_Resource')
+ ->getResourceConnectionModel('core');
$helperClassName = $moduleName . '_Model_Resource_Helper_' . ucfirst($connectionModel);
$connection = strtolower($moduleName);
@@ -641,99 +662,27 @@ public static function throwException($message, $messageStorage = null)
}
/**
- * Get initialized application object.
+ * Get application object.
*
- * @param array $params
* @return Mage_Core_Model_App
*/
- public static function app(array $params = array())
+ public static function app()
{
if (null === self::$_app) {
self::$_app = self::getObjectManager()->get('Mage_Core_Model_App');
- self::$_events = new Varien_Event_Collection();
-
- Magento_Profiler::start('self::app::init');
- self::$_app->init($params);
- Magento_Profiler::stop('self::app::init');
}
return self::$_app;
}
/**
- * @static
- * @param array $params
- * @param string|array $modules
- */
- public static function init(array $params, $modules = array())
- {
- try {
- /** @var $app Mage_Core_Model_App */
- $app = self::getObjectManager()->create('Mage_Core_Model_App');
- self::$_app = $app;
- if (!empty($modules)) {
- self::$_app->initSpecified($params, $modules);
- } else {
- self::$_app->init($params);
- }
- } catch (Mage_Core_Model_Session_Exception $e) {
- header('Location: ' . self::getBaseUrl());
- die;
- } catch (Mage_Core_Model_Store_Exception $e) {
- require_once(self::getBaseDir(Mage_Core_Model_Dir::PUB) . DS . 'errors' . DS . '404.php');
- die;
- } catch (Exception $e) {
- self::printException($e);
- die;
- }
- }
-
- /**
- * Front end main entry point
- *
- * @param array $params
- */
- public static function run(array $params)
- {
- try {
- Magento_Profiler::start('mage');
- if (isset($params[self::INIT_OPTION_EDITION])) {
- self::$_currentEdition = $params[self::INIT_OPTION_EDITION];
- }
- /** @var $app Mage_Core_Model_App */
- $app = self::getObjectManager()->create('Mage_Core_Model_App');
- self::$_app = $app;
- if (isset($params[self::INIT_OPTION_REQUEST])) {
- self::$_app->setRequest($params[self::INIT_OPTION_REQUEST]);
- }
- if (isset($params[self::INIT_OPTION_RESPONSE])) {
- self::$_app->setResponse($params[self::INIT_OPTION_RESPONSE]);
- }
- self::$_events = new Varien_Event_Collection();
- self::$_app->run($params);
- Magento_Profiler::stop('mage');
- } catch (Mage_Core_Model_Session_Exception $e) {
- header('Location: ' . self::getBaseUrl());
- } catch (Mage_Core_Model_Store_Exception $e) {
- require_once(self::getBaseDir() . '/pub/errors/404.php');
- } catch (Exception $e) {
- self::printException($e);
- }
- }
-
- /**
- * Shortcut for the application "is installed" getter
+ * Check if application is installed
*
* @return bool
- * @throws Magento_Exception
- *
- * @todo Remove in favour of Mage_Core_Model_App::isInstalled() as soon as dependencies on application are injected
+ * @deprecated use Mage_Core_Model_App_State::isInstalled()
*/
public static function isInstalled()
{
- if (!self::$_app) {
- throw new Magento_Exception('Application instance has not been initialized yet.');
- }
- return self::$_app->isInstalled();
+ return (bool) self::$_objectManager->get('Mage_Core_Model_Config_Primary')->getInstallDate();
}
/**
@@ -779,6 +728,8 @@ public static function logException(Exception $e)
*
* @param bool $mode
* @return bool
+ *
+ * @deprecated use Mage_Core_Model_App_State::setIsDeveloperMode()
*/
public static function setIsDeveloperMode($mode)
{
@@ -790,6 +741,7 @@ public static function setIsDeveloperMode($mode)
* Retrieve enabled developer mode
*
* @return bool
+ * @deprecated use Mage_Core_Model_App_State::isDeveloperMode()
*/
public static function getIsDeveloperMode()
{
@@ -898,6 +850,8 @@ public static function getScriptSystemUrl($folder, $exitIfNot = false)
* Set is downloader flag
*
* @param bool $flag
+ *
+ * @deprecated use Mage_Core_Model_App_State::setIsDownloader()
*/
public static function setIsDownloader($flag = true)
{
@@ -909,6 +863,8 @@ public static function setIsDownloader($flag = true)
*
* @static
* @param bool $value
+ *
+ * @deprecated use Mage_Core_Model_App_State::setIsSerializable()
*/
public static function setIsSerializable($value = true)
{
@@ -920,9 +876,35 @@ public static function setIsSerializable($value = true)
*
* @static
* @return bool
+ *
+ * @deprecated use Mage_Core_Model_App_State::getIsSerializable()
*/
public static function getIsSerializable()
{
return self::$_isSerializable;
}
+
+ /**
+ * Set update mode flag
+ *
+ * @param bool $value
+ *
+ * @deprecated use Mage_Core_Model_App_State::setUpdateMode()
+ */
+ public static function setUpdateMode($value)
+ {
+ self::$_updateMode = $value;
+
+ }
+
+ /**
+ * Get update mode flag
+ * @return bool
+ *
+ * @deprecated use Mage_Core_Model_App_State::setUpdateMode()
+ */
+ public static function getUpdateMode()
+ {
+ return self::$_updateMode;
+ }
}
View
5 app/bootstrap.php
@@ -109,8 +109,3 @@
Magento_Profiler::applyConfig($profilerConfig);
}
}
-
-$definitionsFile = BP . DS . 'var/di/definitions.php';
-if (file_exists($definitionsFile)) {
- Mage::initializeObjectManager($definitionsFile);
-}
View
4 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php
@@ -174,8 +174,8 @@ protected function _prepareForm() {
protected function _getAdditionalElementTypes()
{
return array(
- 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Category_Helper_Image'),
- 'textarea' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg')
+ 'image' => 'Mage_Adminhtml_Block_Catalog_Category_Helper_Image',
+ 'textarea' => 'Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg'
);
}
}
View
4 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php
@@ -109,9 +109,7 @@ public function _prepareLayout()
protected function _getAdditionalElementTypes()
{
- return array(
- 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Category_Helper_Image')
- );
+ return array('image' => 'Mage_Adminhtml_Block_Catalog_Category_Helper_Image');
}
protected function _getParentCategoryOptions($node=null, &$options=array())
View
3  app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
@@ -119,7 +119,8 @@ public function getSuggestedCategoriesJson($namePart)
$collection = Mage::getModel('Mage_Catalog_Model_Category')->getCollection();
$matchingNamesCollection = clone $collection;
- $matchingNamesCollection->addAttributeToFilter('name', array('like' => "%{$namePart}%"))
+ $escapedNamePart = Mage::getResourceHelper('Mage_Core')->addLikeEscape($namePart, array('position' => 'any'));
+ $matchingNamesCollection->addAttributeToFilter('name', array('like' => $escapedNamePart))
->addAttributeToFilter('entity_id', array('neq' => Mage_Catalog_Model_Category::TREE_ROOT_ID))
->addAttributeToSelect('path')
->setPageSize((string)Mage::getConfig()->getNode(self::XML_PATH_SUGGESTED_CATEGORIES_LIMIT))
View
4 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php
@@ -257,8 +257,6 @@ protected function _prepareForm()
*/
protected function _getAdditionalElementTypes()
{
- return array(
- 'apply' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Apply'),
- );
+ return array('apply' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Apply');
}
}
View
9 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php
@@ -70,12 +70,9 @@ protected function _prepareForm()
protected function _getAdditionalElementTypes()
{
$result = array(
- 'price' => Mage::getConfig()
- ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'),
- 'image' => Mage::getConfig()
- ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'),
- 'boolean' => Mage::getConfig()
- ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean')
+ 'price' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price',
+ 'image' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image',
+ 'boolean' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean',
);
$response = new Varien_Object();
View
25 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
@@ -75,18 +75,6 @@ protected function _prepareLayout()
}
if (!$this->getProduct()->isReadonly()) {
- if (!$this->getProduct()->isConfigurable() || !$this->getIsConfigured()) {
- $this->addChild(
- 'change_attribute_set_button',
- 'Mage_Backend_Block_Widget_Button',
- array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Change Attribute Set'),
- 'onclick' => "jQuery('#attribute-set-info').dialog('open');",
- 'id' => 'change-attribute-set-button'
- )
- );
- }
-
$this->addChild('reset_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Reset'),
'onclick' => 'setLocation(\'' . $this->getUrl('*/*/*', array('_current' => true)) . '\')'
@@ -131,16 +119,6 @@ public function getSaveButtonHtml()
return $this->getChildHtml('save_button');
}
- /**
- * Get Change AttributeSet Button html
- *
- * @return string
- */
- public function getChangeAttributeSetButtonHtml()
- {
- return $this->getChildHtml('change_attribute_set_button');
- }
-
public function getSaveAndEditButtonHtml()
{
return $this->getChildHtml('save_and_edit_button');
@@ -222,9 +200,6 @@ public function getHeader()
} else {
$header = Mage::helper('Mage_Catalog_Helper_Data')->__('New Product');
}
- if ($setName = $this->getAttributeSetName()) {
- $header.= ' (' . $setName . ')';
- }
return $header;
}
View
57 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php
@@ -45,13 +45,21 @@ protected function _construct()
protected function _prepareForm()
{
$this->setFormExcludedFieldList(array(
- 'tier_price', 'gallery', 'media_gallery', 'recurring_profile', 'group_price',
- 'quantity_and_stock_status'
+ 'category_ids',
+ 'gallery',
+ 'group_price',
+ 'image',
+ 'media_gallery',
+ 'quantity_and_stock_status',
+ 'recurring_profile',
+ 'tier_price',
));
Mage::dispatchEvent('adminhtml_catalog_product_form_prepare_excluded_field_list', array('object'=>$this));
$form = new Varien_Data_Form();
- $fieldset = $form->addFieldset('fields', array('legend'=>Mage::helper('Mage_Catalog_Helper_Data')->__('Attributes')));
+ $fieldset = $form->addFieldset('fields', array(
+ 'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__('Attributes'),
+ ));
$attributes = $this->getAttributes();
/**
* Initialize product object as form property
@@ -70,7 +78,8 @@ protected function _prepareForm()
*/
public function getAttributes()
{
- return $this->helper('Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute')->getAttributes()->getItems();
+ return $this->helper('Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute')
+ ->getAttributes()->getItems();
}
/**
@@ -81,15 +90,15 @@ public function getAttributes()
protected function _getAdditionalElementTypes()
{
return array(
- 'price' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'),
- 'weight' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight'),
- 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'),
- 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean')
+ 'price' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price',
+ 'weight' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight',
+ 'image' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image',
+ 'boolean' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean',
);
}
/**
- * Custom additional elemnt html
+ * Custom additional element html
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
@@ -97,18 +106,28 @@ protected function _getAdditionalElementTypes()
protected function _getAdditionalElementHtml($element)
{
// Add name attribute to checkboxes that correspond to multiselect elements
- $nameAttributeHtml = ($element->getExtType() === 'multiple') ? 'name="' . $element->getId() . '_checkbox"'
- : '';
- return '<span class="attribute-change-checkbox"><input type="checkbox" id="' . $element->getId()
- . '-checkbox" ' . $nameAttributeHtml . ' onclick="toogleFieldEditMode(this, \'' . $element->getId()
- . '\')" /><label for="' . $element->getId() . '-checkbox">' . Mage::helper('Mage_Catalog_Helper_Data')->__('Change')
- . '</label></span>
- <script type="text/javascript">initDisableFields(\''.$element->getId().'\')</script>';
+ $nameAttributeHtml = $element->getExtType() === 'multiple' ? 'name="' . $element->getId() . '_checkbox"' : '';
+ $elementId = $element->getId();
+ $checkboxLabel = Mage::helper('Mage_Catalog_Helper_Data')->__('Change');
+ $html = <<<HTML
+<span class="attribute-change-checkbox">
+ <label>
+ <input type="checkbox" $nameAttributeHtml onclick="toogleFieldEditMode(this, '{$elementId}')" />
+ {$checkboxLabel}
+ </label>
+</span>
+<script>initDisableFields("{$elementId}")</script>
+HTML;
+ if ($elementId === 'weight') {
+ $html .= <<<HTML
+<script>jQuery(function($) {
+ $('#weight_and_type_switcher, label[for=weight_and_type_switcher]').hide();
+});</script>
+HTML;
+ }
+ return $html;
}
- /**
- * ######################## TAB settings #################################
- */
public function getTabLabel()
{
return Mage::helper('Mage_Catalog_Helper_Data')->__('Attributes');
View
37 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
@@ -33,27 +33,22 @@
*/
class Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet extends Mage_Backend_Block_Widget_Form
{
- protected function _prepareForm()
- {
- $form = new Varien_Data_Form();
- $fieldset = $form->addFieldset('settings', array());
-
- $entityType = Mage::registry('product')->getResource()->getEntityType();
- $fieldset->addField('attribute_set_id', 'select', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute Set'),
- 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute Set'),
- 'name' => 'set',
- 'value' => Mage::registry('product')->getAttributeSetId(),
- 'values'=> Mage::getResourceModel('Mage_Eav_Model_Resource_Entity_Attribute_Set_Collection')
- ->setEntityTypeFilter($entityType->getId())
- ->load()
- ->toOptionArray()
- ));
- $fieldset->addField('type_id', 'hidden', array(
- 'name' => 'type_id',
- 'value' => Mage::registry('product')->getTypeId(),
- ));
- $this->setForm($form);
+ /**
+ * Get options for suggest widget
+ *
+ * @return array
+ */
+ public function getSelectorOptions()
+ {
+ return array(
+ 'source' => $this->getUrl('*/catalog_product/suggestProductTemplates'),
+ 'className' => 'category-select',
+ 'template' => '#product-template-selector-template',
+ 'showRecent' => true,
+ 'storageKey' => 'product-template-key',
+ 'minLength' => 0,
+ 'ajaxData' => array('current_template_id' => Mage::registry('product')->getAttributeSetId()),
+ );
}
}
View
52 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/NewCategory.php
@@ -50,36 +50,46 @@ protected function _prepareForm()
'required' => true,
));
- $fieldset->addField('new_category_parent', 'text', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
- 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
- 'autocomplete' => 'off',
- 'required' => true,
- 'class' => 'validate-parent-category',
+ $fieldset->addField('new_category_parent', 'select', array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
+ 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
+ 'required' => true,
+ 'options' => array(),
+ 'class' => 'validate-parent-category',
));
- $fieldset->addField('new_category_parent_id', 'hidden', array());
-
$this->setForm($form);
}
/**
- * Category save action URL
- *
- * @return string
- */
- public function getSaveCategoryUrl()
- {
- return $this->getUrl('*/catalog_category/save');
- }
-
- /**
- * Category suggestion action URL
+ * Attach new category dialog widget initialization
*
* @return string
*/
- public function getSuggestCategoryUrl()
+ public function getAfterElementHtml()
{
- return $this->getUrl('*/catalog_category/suggestCategories');
+ /** @var $coreHelper Mage_Core_Helper_Data */
+ $coreHelper = Mage::helper('Mage_Core_Helper_Data');
+ $widgetUrl = $coreHelper->jsonEncode($this->getViewFileUrl('Mage_Catalog::js/new-category-dialog.js'));
+ $widgetOptions = $coreHelper->jsonEncode(array(
+ 'suggestOptions' => array(
+ 'source' => $this->getUrl('*/catalog_category/suggestCategories'),
+ 'valueField' => '#new_category_parent',
+ 'template' => '#category_ids-template',
+ 'control' => 'jstree',
+ 'multiselect' => true,
+ 'className' => 'category-select',
+ ),
+ 'saveCategoryUrl' => $this->getUrl('*/catalog_category/save'),
+ ));
+ return <<<HTML
+<script>
+ head.js($widgetUrl, function () {
+ jQuery(function($) { // waiting for page to load to have '#category_ids-template' available
+ $('#new-category').mage('newCategoryDialog', $widgetOptions);
+ });
+ });
+</script>
+HTML;
}
}
View
27 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
@@ -115,10 +115,6 @@ protected function _prepareForm()
$fieldset->setHeaderBar($headerBar->toHtml());
}
- if ($form->getElement('meta_description')) {
- $form->getElement('meta_description')->setOnkeyup('checkMaxLength(this, 255);');
- }
-
$values = $product->getData();
// Set default attribute values for new product or on attribute set change
@@ -155,23 +151,12 @@ protected function _prepareForm()
protected function _getAdditionalElementTypes()
{
$result = array(
- 'price' => Mage::getConfig()->getBlockClassName(
- 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'
- ),
- 'weight' => Mage::getConfig()->getBlockClassName(
- 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight'
- ),
- 'gallery' => Mage::getConfig()->getBlockClassName(
- 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery'
- ),
- 'image' => Mage::getConfig()->getBlockClassName(
- 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'
- ),
- 'boolean' => Mage::getConfig()->getBlockClassName(
- 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean'),
- 'textarea' => Mage::getConfig()->getBlockClassName(
- 'Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg'
- )
+ 'price' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price',
+ 'weight' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight',
+ 'gallery' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery',
+ 'image' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image',
+ 'boolean' => 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean',
+ 'textarea' => 'Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg',
);
$response = new Varien_Object();
View
2  app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php
@@ -73,7 +73,7 @@ protected function _prepareForm()
'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__('Select Configurable Attributes')
));
- $fieldset->addField('attribute-selector', 'text', array(
+ $fieldset->addField('configurable-attribute-selector', 'text', array(
'label' => 'Select Attribute',
'title' => 'Select Attribute',
));
View
2  app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
@@ -71,7 +71,7 @@ protected function _prepareCollection()
}
if ($store->getId()) {
//$collection->setStoreId($store->getId());
- $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
+ $adminStore = Mage_Core_Model_AppInterface::ADMIN_STORE_ID;
$collection->addStoreFilter($store);
$collection->joinAttribute(
'name',
View
118 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php
@@ -34,20 +34,6 @@
class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_BaseImage extends Varien_Data_Form_Element_Abstract
{
/**
- * Maximum file size to upload in bytes.
- *
- * @var int
- */
- protected $_maxFileSize;
-
- /**
- * Media Uploader instance
- *
- * @var Mage_Adminhtml_Block_Media_Uploader
- */
- protected $_mediaUploader;
-
- /**
* Model Url instance
*
* @var Mage_Backend_Model_Url
@@ -65,6 +51,11 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_BaseImage extends Varien_
protected $_catalogHelperData;
/**
+ * @var Magento_File_Size
+ */
+ protected $_fileConfig;
+
+ /**
* Constructor
*
* @param array $attributes
@@ -73,28 +64,34 @@ public function __construct(array $attributes = array())
{
parent::__construct($attributes);
- $this->_mediaUploader = isset($attributes['mediaUploader']) ? $attributes['mediaUploader']
- : Mage::getSingleton('Mage_Adminhtml_Block_Media_Uploader');
$this->_url = isset($attributes['url']) ? $attributes['url']
: Mage::getModel('Mage_Backend_Model_Url');
$this->_coreHelper = isset($attributes['coreHelper']) ? $attributes['coreHelper']
: Mage::helper('Mage_Core_Helper_Data');
$this->_catalogHelperData = isset($attributes['catalogHelperData']) ? $attributes['catalogHelperData']
: Mage::helper('Mage_Catalog_Helper_Data');
-
+ $this->_fileConfig = isset($attributes['fileConfig']) ? $attributes['fileConfig'] :
+ Mage::getSingleton('Magento_File_Size');
$this->_maxFileSize = $this->_getFileMaxSize();
}
- public function getDefaultHtml()
+ /**
+ * Get label
+ *
+ * @return string
+ */
+ public function getLabel()
{
- $html = $this->getData('default_html');
- if (is_null($html)) {
- $html = ($this->getNoSpan() === true) ? '' : '<span class="field-row">' . "\n";
- $html .= $this->getLabelHtml();
- $html .= $this->getElementHtml();
- $html .= ($this->getNoSpan() === true) ? '' : '</span>' . "\n";
- }
- return $html;
+ return $this->helper('Mage_Catalog_Helper_Data')->__('Images');
+ }
+
+ /**
+ * Translate message
+ *
+ * @param string $message
+ */
+ private function __($message) {
+ return $this->helper('Mage_Catalog_Helper_Data')->__($message);
}
/**
@@ -107,52 +104,35 @@ public function getElementHtml()
$htmlId = $this->_coreHelper->escapeHtml($this->getHtmlId());
$uploadUrl = $this->_coreHelper->escapeHtml($this->_getUploadUrl());
/** @var $product Mage_Catalog_Model_Product */
- $product = $this->getForm()->getDataObject();
- $gallery = $product->getMediaGalleryImages();
- $html = '<input id="' . $htmlId .'-upload" type="file" name="image" '
- . 'data-url="' . $uploadUrl . '" style="display:none" />'
- . '<input id="' . $htmlId . '" type="hidden" name="'. $this->getName() .'" />'
- . '<div id="' . $htmlId . '-container" class="images" data-main="' . $this->getEscapedValue() . '" '
- . 'data-images="' . $this->_coreHelper->escapeHtml(
- $this->_coreHelper->jsonEncode($gallery ? $gallery->toArray() : array())
- ) . '">'
- . '<div class="image image-placeholder" id="' . $htmlId . '-upload-placeholder"><p class="image-placeholder-text">' . $this->helper('Mage_Catalog_Helper_Data')->__('Click here or drag and drop to add images') . '</p></div>'
- . '<script id="' . $htmlId . '-template" type="text/x-jquery-tmpl">'
- . '<div class="image" data-image-label="' . $this->helper('Mage_Catalog_Helper_Data')->__('Main') . '">'
- . '<img class="base-image-uploader" src="${url}" data-position="${position}" alt="${label}" />'
- . '<div class="actions">'
- . '<button class="action-delete" title="' . $this->helper('Mage_Catalog_Helper_Data')->__('Delete image') . '">'
- . '<span>' . $this->helper('Mage_Catalog_Helper_Data')->__('Delete image') . '</span>'
- . '</button>'
- . '<button class="action-make-main" title="' . $this->helper('Mage_Catalog_Helper_Data')->__('Make Main') . '">'
- . '<span>' . $this->helper('Mage_Catalog_Helper_Data')->__('Make Main') . '</span>'
- . '</button>'
- . '<div class="draggable-handle"></div>'
- . '</div>'
- . '</div>'
- . '</script>'
- . '</div>';
- $html .= $this->_getJs();
-
+ $html = <<<HTML
+<div id="{$htmlId}-container" class="images"
+ data-mage-init="{baseImage:{}}"
+ data-max-file-size="{$this->_getFileMaxSize()}"
+ >
+ <div class="image image-placeholder">
+ <input type="file" name="image" data-url="{$uploadUrl}" />
+ <p class="image-placeholder-text">{$this->__('Click here or drag and drop to add images')}</p>
+ </div>
+ <script id="{$htmlId}-template" class="image-template" type="text/x-jquery-tmpl">
+ <div class="image" data-image-label="{$this->__('Main')}">
+ <img class="base-image-uploader" src="\${url}" data-position="\${position}" alt="\${label}" />
+ <div class="actions">
+ <button class="action-delete" data-role="delete-button" title="{$this->__('Delete image')}">
+ <span>{$this->__('Delete image')}</span>
+ </button>
+ <button class="action-make-main" data-role="make-main-button" title="{$this->__('Make Main')}">
+ <span>{$this->__('Make Main')}</span>
+ </button>
+ <div class="draggable-handle"></div>
+ </div>
+ </div>
+ </script>
+</div>
+HTML;
return $html;
}
/**
- * Get js for image uploader
- *
- * @return string
- */
- protected function _getJs()
- {
- return "<script>/* <![CDATA[ */"
- . "jQuery(function(){"
- . "BaseImageUploader({$this->_coreHelper->jsonEncode($this->getHtmlId())}, "
- . "{$this->_coreHelper->jsonEncode($this->_maxFileSize)});"
- . " });"
- . "/*]]>*/</script>";
- }
-
- /**
* Get url to upload files
*
* @return string
@@ -169,7 +149,7 @@ protected function _getUploadUrl()
*/
protected function _getFileMaxSize()
{
- return $this->_mediaUploader->getDataMaxSizeInBytes();
+ return $this->_fileConfig->getMaxFileSize();
}
/**
View
80 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Category.php
@@ -68,11 +68,11 @@ protected function _getCategoriesCollection()
}
/**
- * Get html of element
+ * Attach category suggest widget initialization
*
* @return string
*/
- public function getElementHtml()
+ public function getAfterElementHtml()
{
/** @var $coreHelper Mage_Core_Helper_Data */
$coreHelper = Mage::helper('Mage_Core_Helper_Data');
@@ -87,35 +87,50 @@ public function getElementHtml()
)
)));
- return parent::getElementHtml() . "\n"
- . '<input id="' . $this->getHtmlId() . '-suggest" />' . "\n"
- . '<script id="' . $this->getHtmlId() . '-template" type="text/x-jquery-tmpl">'
- . '{{if $data.allShown()}}'
- . '{{if typeof nested === "undefined"}}'
- . '<div style="display:none;" data-mage-init="' . $treeOptions . '">{{/if}}'
- . '<ul>{{each items}}'
- . '<li><a href="#" {{html optionData($value)}}>${$value.label}</a>'
- . '{{if $value.children && $value.children.length}}'
- . '{{html renderTreeLevel($value.children)}}'
- . '{{/if}}'
- . '</li>{{/each}}</ul>'
- . '{{if typeof nested === "undefined"}}</div>{{/if}}'
- . '{{else}}'
- . '<ul data-mage-init="{&quot;menu&quot;:[]}">'
- . '{{each items}}'
- . '<li {{html optionData($value)}}><a href="#"><span class="category-label">${$value.label}<span>'
- . '<span class="category-path">${$value.path}<span></a></li>'
- . '{{/each}}</ul>'
- . '{{/if}}'
- . '</script>' . "\n"
- . '<script>//<![CDATA[' . "\n"
- . 'jQuery(' . $coreHelper->jsonEncode('#' . $this->getHtmlId() . '-suggest') . ').treeSuggest('
- . $coreHelper->jsonEncode($this->_getSelectorOptions()) . ');' . "\n"
- . '//]]></script>'
- . '<button title="' . $coreHelper->__('New Category') . '" type="button"'
- . ' onclick="jQuery(\'#new-category\').dialog(\'open\')">'
- . '<span><span><span>' . $coreHelper->__('New Category') . '</span></span></span>'
- . '</button>';
+ $htmlId = $this->getHtmlId();
+ $suggestPlaceholder = Mage::helper('Mage_Catalog_Helper_Data')->__('start typing to search category');
+ $selectorOptions = $coreHelper->jsonEncode($this->_getSelectorOptions());
+ $newCategoryCaption = Mage::helper('Mage_Catalog_Helper_Data')->__('New Category');
+
+ return <<<HTML
+ <input id="{$htmlId}-suggest" placeholder="$suggestPlaceholder" />
+ <script id="{$htmlId}-template" type="text/x-jquery-tmpl">
+ {{if \$data.allShown()}}
+ {{if typeof nested === "undefined"}}
+ <div style="display:none" data-mage-init="{$treeOptions}">
+ {{/if}}
+ <ul>
+ {{each items}}
+ <li><a href="#" {{html optionData(\$value)}}>\${\$value.label}</a>
+ {{if \$value.children && \$value.children.length}}
+ {{html renderTreeLevel(\$value.children)}}
+ {{/if}}
+ </li>
+ {{/each}}
+ </ul>
+ {{if typeof nested === "undefined"}}
+ </div>
+ {{/if}}
+ {{else}}
+ <ul data-mage-init="{menu:[]}">
+ {{each items}}
+ <li {{html optionData(\$value)}}>
+ <a href="#">
+ <span class="category-label">\${\$value.label}</span>
+ <span class="category-path">\${\$value.path}</span>
+ </a>
+ </li>
+ {{/each}}
+ </ul>
+ {{/if}}
+ </script>
+ <script>
+ jQuery('#{$htmlId}-suggest').treeSuggest({$selectorOptions});
+ </script>
+ <button title="{$newCategoryCaption}" type="button" onclick="jQuery('#new-category').dialog('open')">
+ <span><span><span>{$newCategoryCaption}</span></span></span>
+ </button>
+HTML;
}
/**
@@ -126,8 +141,7 @@ public function getElementHtml()
protected function _getSelectorOptions()
{
return array(
- 'source' => Mage::helper('Mage_Backend_Helper_Data')
- ->getUrl('adminhtml/catalog_category/suggestCategories'),
+ 'source' => Mage::helper('Mage_Backend_Helper_Data')->getUrl('*/catalog_category/suggestCategories'),
'valueField' => '#' . $this->getHtmlId(),
'template' => '#' . $this->getHtmlId() . '-template',
'control' => 'jstree',
View
13 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php
@@ -31,6 +31,8 @@
* @category Mage
* @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
+ *
+ * @method Varien_Data_Form_Element_Abstract getElement()
*/
class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content extends Mage_Adminhtml_Block_Widget
{
@@ -59,6 +61,7 @@ protected function _prepareLayout()
return parent::_prepareLayout();
}
+
/**
* Retrive uploader block
*
@@ -122,7 +125,7 @@ public function getImagesValuesJson()
}
/**
- * Enter description here...
+ * Get image types data
*
* @return array
*/
@@ -132,9 +135,11 @@ public function getImageTypes()
foreach ($this->getMediaAttributes() as $attribute) {
/* @var $attribute Mage_Eav_Model_Entity_Attribute */
$imageTypes[$attribute->getAttributeCode()] = array(
- 'label' => $attribute->getFrontend()->getLabel() . ' '
- . Mage::helper('Mage_Catalog_Helper_Data')->__($this->getElement()->getScopeLabel($attribute)),
- 'field' => $this->getElement()->getAttributeFieldName($attribute)
+ 'code' => $attribute->getAttributeCode(),
+ 'value' => $this->getElement()->getDataObject()->getData($attribute->getAttributeCode()),
+ 'label' => $attribute->getFrontend()->getLabel(),
+ 'scope' => Mage::helper('Mage_Catalog_Helper_Data')->__($this->getElement()->getScopeLabel($attribute)),
+ 'name' => $this->getElement()->getAttributeFieldName($attribute)
);
}
return $imageTypes;
View
6 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php
@@ -126,9 +126,9 @@ public function initForm()
protected function _getAdditionalElementTypes()
{
return array(
- 'file' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Customer_Form_Element_File'),
- 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Customer_Form_Element_Image'),
- 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Customer_Form_Element_Boolean'),
+ 'file' => 'Mage_Adminhtml_Block_Customer_Form_Element_File',
+ 'image' => 'Mage_Adminhtml_Block_Customer_Form_Element_Image',
+ 'boolean' => 'Mage_Adminhtml_Block_Customer_Form_Element_Boolean',
);
}
View
6 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php
@@ -211,9 +211,9 @@ public function getTemplatePrefix()
protected function _getAdditionalElementTypes()
{
return array(
- 'file' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Customer_Form_Element_File'),
- 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Customer_Form_Element_Image'),
- 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Customer_Form_Element_Boolean'),
+ 'file' => 'Mage_Adminhtml_Block_Customer_Form_Element_File',
+ 'image' => 'Mage_Adminhtml_Block_Customer_Form_Element_Image',
+ 'boolean' => 'Mage_Adminhtml_Block_Customer_Form_Element_Boolean',
);
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php
@@ -45,7 +45,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+ 'class' => 'primary'
));
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php
@@ -45,7 +45,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+ 'class' => 'primary'
));
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php
@@ -45,7 +45,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+ 'class' => 'primary'
));
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php
@@ -45,7 +45,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+ 'class' => 'primary'
));
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php
@@ -45,7 +45,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+ 'class' => 'primary'
));
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php
@@ -45,7 +45,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+ 'class' => 'primary'
));
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php
@@ -46,7 +46,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+ 'class' => 'primary'
));
}
View
3  app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php
@@ -46,7 +46,8 @@ protected function _construct()
$this->_removeButton('add');
$this->addButton('filter_form_submit', array(
'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'),
- 'onclick' => 'filterFormSubmit()'
+ 'onclick' => 'filterFormSubmit()',
+