Permalink
Browse files

Update as of 5/23/2012

* Published performance tests (`dev/tests/performance`)
* Implemented support of ImageMagick library for processing images
* Distinguished "Page Fragments" and "Pages" in layout handles declaration
* Reduced performance drop caused by introducing containers
* Implemented Magento_Data_Structure library which is used to handle structure of layout elements
* Fixed some issues:
  * Fixed error on saving newsletter template
  * Fixed some checkout issues:
    * order is not placed if 3D Secure is used
    * transaction is not created if PayPal Standard is used
    * "Purchase Order Number" field is not displayed
    * failed checkout on concurrent user requests
  * Fixed incorrect shipment creation: shipping and tracking information was not saved
  * Fixed broken category page when "Use Flat Catalog Product" is enabled
  * Fixed incorrect applying of discount to a sub-product, if more two rules are being applied
  * Fixed broken "Edit" product link in Wishlist and Shopping Cart
  * Fixed broken installation when "pub/media" is not writable
  * Fixed resetting Design Theme configuration option when User-Agent Exception is added
  * Fixed error while running unit tests, when Zend Framework is installed with PEAR
  * Fixed incorrect processing of "before" and "after" layout instructions in case, when the instruction refers to a node, which is not processed yet
  * Fixed broken import/export functionality
  * Fixed broken Web Services pages in Admin Panel
  * Fixed broken creation of URL rewrite
  * Fixed error in Weee module caused broken view pages of configurable products with recurring profile or downloadable/bundle product
  * Fixed error on submitting XML Connect application
  * Fixed broken design when database is used as media storage
* Other small changes
  • Loading branch information...
1 parent f8dac8f commit b8f3ea4c7423af10fcee07ca0c6ca95d45bf7b9f @magento-team magento-team committed May 25, 2012
Showing with 9,603 additions and 3,377 deletions.
  1. +30 −0 CHANGELOG.markdown
  2. +3 −3 app/Mage.php
  3. +1 −1 app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml
  4. +7 −4 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php
  5. +1 −1 app/code/core/Mage/Adminhtml/Block/System/Config/Form.php
  6. +1 −0 app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php
  7. +16 −7 app/code/core/Mage/Adminhtml/Block/Urlrewrite.php
  8. +1 −1 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php
  9. +3 −1 app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php
  10. +57 −0 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Adapter.php
  11. +42 −0 app/code/core/Mage/Adminhtml/Model/System/Config/Source/Image/Adapter.php
  12. +2 −1 app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php
  13. +3 −2 app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php
  14. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
  15. +1 −2 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml
  16. +1 −1 app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php
  17. +1 −1 app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php
  18. +1 −1 app/code/core/Mage/Api2/Block/Adminhtml/Roles.php
  19. +1 −1 app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php
  20. +1 −1 app/code/core/Mage/Api2/Model/Acl/Global/Role.php
  21. +1 −1 app/code/core/Mage/Api2/Model/Acl/Global/Rule.php
  22. +1 −1 app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php
  23. +2 −9 app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php
  24. +6 −6 app/code/core/Mage/Authorizenet/view/frontend/layout.xml
  25. +3 −3 app/code/core/Mage/Bundle/view/frontend/layout.xml
  26. +11 −1 app/code/core/Mage/Catalog/Block/Product/View.php
  27. +445 −444 app/code/core/Mage/Catalog/Helper/Image.php
  28. +2 −1 app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php
  29. +3 −1 app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php
  30. +10 −13 app/code/core/Mage/Catalog/Model/Product/Image.php
  31. +14 −15 app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php
  32. +4 −4 app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php
  33. +17 −30 app/code/core/Mage/Catalog/view/frontend/layout.xml
  34. +4 −4 app/code/core/Mage/Catalog/view/frontend/product/view.phtml
  35. +16 −2 app/code/core/Mage/CatalogRule/Model/Rule.php
  36. +4 −4 app/code/core/Mage/CatalogSearch/view/frontend/layout.xml
  37. +10 −6 app/code/core/Mage/Centinel/view/frontend/layout.xml
  38. +0 −6 app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php
  39. +1 −0 app/code/core/Mage/Checkout/controllers/CartController.php
  40. +1 −1 app/code/core/Mage/Checkout/controllers/OnepageController.php
  41. +21 −15 app/code/core/Mage/Checkout/view/frontend/layout.xml
  42. +2 −1 app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
  43. +24 −29 app/code/core/Mage/Core/Block/Abstract.php
  44. +0 −96 app/code/core/Mage/Core/Block/Template/Facade.php
  45. +4 −4 app/code/core/Mage/Core/Controller/Varien/Action.php
  46. +16 −0 app/code/core/Mage/Core/Helper/Data.php
  47. +0 −5 app/code/core/Mage/Core/Model/Abstract.php
  48. +11 −1 app/code/core/Mage/Core/Model/Design/Package.php
  49. +1 −1 app/code/core/Mage/Core/Model/Email/Template/Filter.php
  50. +355 −146 app/code/core/Mage/Core/Model/Layout.php
  51. +0 −731 app/code/core/Mage/Core/Model/Layout/Structure.php
  52. +116 −82 app/code/core/Mage/Core/Model/Layout/Update.php
  53. +11 −3 app/code/core/Mage/Core/etc/config.xml
  54. +20 −0 app/code/core/Mage/Core/etc/system.xml
  55. +1 −1 app/code/core/Mage/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php
  56. +32 −0 app/code/core/Mage/DesignEditor/Block/Container.php
  57. +30 −13 app/code/core/Mage/DesignEditor/Block/Toolbar/Breadcrumbs.php
  58. +35 −30 app/code/core/Mage/DesignEditor/Block/Toolbar/{PageType.php → HandlesHierarchy.php}
  59. +13 −13 app/code/core/Mage/DesignEditor/Model/Observer.php
  60. +9 −9 app/code/core/Mage/DesignEditor/controllers/EditorController.php
  61. +27 −0 app/code/core/Mage/DesignEditor/view/frontend/container.phtml
  62. +12 −8 app/code/core/Mage/DesignEditor/view/frontend/css/styles.css
  63. +5 −2 app/code/core/Mage/DesignEditor/view/frontend/layout.xml
  64. +8 −8 app/code/core/Mage/DesignEditor/view/frontend/toolbar/{page_types.phtml → handles_hierarchy.phtml}
  65. +1 −1 app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml
  66. +1 −1 app/code/core/Mage/Downloadable/view/frontend/layout.xml
  67. +9 −3 app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php
  68. +1 −1 app/code/core/Mage/GoogleCheckout/view/frontend/layout.xml
  69. +5 −3 app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php
  70. +50 −16 app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php
  71. +1 −1 app/code/core/Mage/ImportExport/view/adminhtml/layout.xml
  72. +30 −0 app/code/core/Mage/Install/Model/Installer.php
  73. +197 −236 app/code/core/Mage/Install/Model/Installer/Console.php
  74. +35 −0 app/code/core/Mage/Install/controllers/WizardController.php
  75. +5 −0 app/code/core/Mage/Install/etc/install.xml
  76. +13 −0 app/code/core/Mage/Newsletter/Model/Template.php
  77. +1 −1 app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Admin/Token.php
  78. +1 −1 app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens.php
  79. +1 −1 app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer.php
  80. +1 −1 app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php
  81. +2 −2 app/code/core/Mage/Ogone/view/frontend/layout.xml
  82. +0 −5 app/code/core/Mage/Page/view/frontend/layout.xml
  83. 0 app/code/core/Mage/Page/view/frontend/{page_part.phtml → page_fragment.phtml}
  84. +1 −1 app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php
  85. +1 −1 app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php
  86. +41 −23 app/code/core/Mage/Paypal/view/frontend/layout.xml
  87. +9 −6 app/code/core/Mage/PaypalUk/view/frontend/layout.xml
  88. +3 −3 app/code/core/Mage/Sales/Model/Abstract.php
  89. +17 −0 app/code/core/Mage/Sales/Model/Order/Shipment/Track.php
  90. +10 −4 app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php
  91. +1 −15 app/code/core/Mage/Shipping/view/frontend/layout.xml
  92. +9 −9 app/code/core/Mage/Weee/Model/Config/Source/Display.php
  93. +9 −8 app/code/core/Mage/Weee/Model/Observer.php
  94. +1 −1 app/code/core/Mage/Weee/etc/config.xml
  95. +6 −2 app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php
  96. +3 −2 ...ode/core/Mage/{Shipping/view/frontend/tracking/ajax.phtml → Widget/view/adminhtml/css/styles.css}
  97. +1 −0 app/code/core/Mage/Widget/view/adminhtml/layout.xml
  98. +1 −0 app/code/core/Mage/Wishlist/controllers/IndexController.php
  99. +1 −1 app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php
  100. +4 −2 app/code/core/Mage/XmlConnect/Helper/Image.php
  101. +36 −10 app/code/core/Mage/XmlConnect/Model/Application.php
  102. +1 −1 app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php
  103. +35 −35 app/code/core/Mage/XmlConnect/view/frontend/layout.xml
  104. +3 −3 app/design/frontend/default/iphone/Mage_Bundle/layout.xml
  105. +18 −30 app/design/frontend/default/iphone/Mage_Catalog/layout.xml
  106. +4 −4 app/design/frontend/default/iphone/Mage_Catalog/product/view.phtml
  107. +18 −18 app/design/frontend/default/iphone/Mage_Checkout/layout.xml
  108. +0 −5 app/design/frontend/default/iphone/Mage_Page/layout.xml
  109. +18 −31 app/design/frontend/default/modern/Mage_Catalog/layout.xml
  110. +4 −4 app/design/frontend/default/modern/Mage_Catalog/product/view.phtml
  111. +3 −3 app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml
  112. +19 −19 app/design/frontend/default/modern/Mage_Checkout/layout.xml
  113. +0 −5 app/design/frontend/default/modern/Mage_Page/layout.xml
  114. +1 −1 app/design/frontend/default/modern/Mage_Review/layout.xml
  115. +56 −118 dev/shell/install.php
  116. +1 −1 dev/tests/integration/framework/tests/unit/phpunit.xml.dist
  117. +1 −1 dev/tests/integration/phpunit.xml.dist
  118. +1 −1 ...ests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/AddTest.php
  119. +1 −7 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/ConfigTest.php
  120. +60 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/System/Config/FormStub.php
  121. +63 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/System/Config/FormTest.php
  122. +58 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/System/Config/_files/test_section_config.xml
  123. +1 −1 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Tax/Class/EditTest.php
  124. +2 −3 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Tax/ClassTest.php
  125. +39 −0 dev/tests/integration/testsuite/Mage/Adminhtml/controllers/UrlrewriteControllerTest.php
  126. +5 −1 dev/tests/integration/testsuite/Mage/Bundle/controllers/ProductControllerTest.php
  127. +2 −3 dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php
  128. +92 −0 dev/tests/integration/testsuite/Mage/CatalogRule/Model/RuleTest.php
  129. +76 −0 dev/tests/integration/testsuite/Mage/Checkout/_files/product.php
  130. +97 −0 dev/tests/integration/testsuite/Mage/Checkout/_files/product_with_custom_option.php
  131. +61 −0 dev/tests/integration/testsuite/Mage/Checkout/controllers/CartControllerTest.php
  132. +9 −29 dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php
  133. +1 −1 dev/tests/integration/testsuite/Mage/Core/Block/FlushTest.php
  134. +1 −1 dev/tests/integration/testsuite/Mage/Core/Block/Text/ListTest.php
  135. +2 −2 dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php
  136. +9 −0 dev/tests/integration/testsuite/Mage/Core/Model/Design/PackagePublicationTest.php
  137. +50 −0 dev/tests/integration/testsuite/Mage/Core/Model/File/StorageTest.php
  138. +39 −51 dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php
  139. +9 −0 dev/tests/integration/testsuite/Mage/Core/Model/Layout/_files/{_page_types.xml → _handles.xml}
  140. +29 −0 ...tion/testsuite/Mage/Core/Model/Layout/_files/{_page_types_hierarchy.php → _handles_hierarchy.php}
  141. +154 −36 dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php
  142. +84 −0 dev/tests/integration/testsuite/Mage/Core/Model/_files/sort_special_cases.xml
  143. +1 −1 dev/tests/integration/testsuite/Mage/Core/Model/_files/valid_layout_updates.xml
  144. +1 −1 dev/tests/integration/testsuite/Mage/Customer/Block/Account/LinkTest.php
  145. +1 −1 dev/tests/integration/testsuite/Mage/DesignEditor/Block/Toolbar/BreadcrumbsTest.php
  146. +19 −19 ...tegration/testsuite/Mage/DesignEditor/Block/Toolbar/{PageTypeTest.php → HandlesHierarchyTest.php}
  147. +3 −3 ...sts/integration/testsuite/Mage/DesignEditor/Block/Toolbar/_files/_breadcrumbs_simple_product.html
  148. +3 −3 ...ests/integration/testsuite/Mage/DesignEditor/Block/Toolbar/_files/_breadcrumbs_simple_product.php
  149. +21 −10 ...ite/Mage/DesignEditor/Block/Toolbar/_files/{_page_types_hierarchy.html → _handles_hierarchy.html}
  150. +0 −1 dev/tests/integration/testsuite/Mage/DesignEditor/Block/ToolbarTest.php
  151. +2 −4 dev/tests/integration/testsuite/Mage/DesignEditor/Model/ObserverTest.php
  152. +1 −1 dev/tests/integration/testsuite/Mage/DesignEditor/_files/observer_test.xml
  153. +11 −11 dev/tests/integration/testsuite/Mage/DesignEditor/controllers/EditorControllerTest.php
  154. +1 −0 ...n/testsuite/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinksTest.php
  155. +96 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/Export/Entity/ProductTest.php
  156. +252 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/CustomerTest.php
  157. +78 −0 dev/tests/integration/testsuite/Mage/ImportExport/_files/customers.php
  158. +40 −0 dev/tests/integration/testsuite/Mage/ImportExport/_files/product.php
  159. +86 −0 dev/tests/integration/testsuite/Mage/ImportExport/controllers/Adminhtml/ExportControllerTest.php
  160. +100 −0 dev/tests/integration/testsuite/Mage/Install/controllers/WizardControllerTest.php
  161. +27 −0 dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php
  162. +0 −5 dev/tests/integration/testsuite/Mage/Paypal/Model/IpnTest.php
  163. +1 −1 dev/tests/integration/testsuite/Mage/Paypal/_files/order_express.php
  164. +1 −1 dev/tests/integration/testsuite/Mage/Paypal/_files/order_standard.php
  165. +1 −1 dev/tests/integration/testsuite/Mage/Paypal/_files/recurring_profile.php
  166. +1 −1 dev/tests/integration/testsuite/Mage/Paypal/controllers/PayflowControllerTest.php
  167. +1 −1 dev/tests/integration/testsuite/Mage/Paypal/controllers/StandardControllerTest.php
  168. +41 −0 dev/tests/integration/testsuite/Mage/Sales/Model/AbstractTest.php
  169. +50 −0 dev/tests/integration/testsuite/Mage/Sales/Model/Order/Payment/TransactionTest.php
  170. +3 −2 dev/tests/integration/testsuite/Mage/Sales/_files/order.php
  171. +41 −0 dev/tests/integration/testsuite/Mage/Sales/_files/transactions.php
  172. +1 −0 dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php
  173. +84 −0 dev/tests/integration/testsuite/Mage/Weee/Model/ObserverTest.php
  174. +53 −0 dev/tests/integration/testsuite/Mage/Weee/_files/product_with_fpt.php
  175. +3 −0 ...e/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/_page_types_with_containers.xml
  176. +1 −0 .../testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/page_types_select.html
  177. +102 −0 dev/tests/integration/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php
  178. +542 −0 dev/tests/integration/testsuite/Varien/Image/Adapter/InterfaceTest.php
  179. BIN dev/tests/integration/testsuite/Varien/Image/_files/image_adapters_test.png
  180. BIN dev/tests/integration/testsuite/Varien/Image/_files/watermark.png
  181. +88 −17 dev/tests/integration/testsuite/integrity/LayoutTest.php
  182. +1 −0 dev/tests/performance/.gitignore
  183. +59 −0 dev/tests/performance/config.php.dist
  184. +165 −0 dev/tests/performance/run_scenarios.php
  185. +103 −0 dev/tests/performance/testsuite/_samples/_template.jmx
  186. +232 −0 dev/tests/performance/testsuite/_samples/add_to_cart.jmx
  187. +235 −0 dev/tests/performance/testsuite/_samples/advanced_search.jmx
  188. +141 −0 dev/tests/performance/testsuite/_samples/category_view.jmx
  189. +132 −0 dev/tests/performance/testsuite/_samples/quick_search.jmx
  190. +948 −0 dev/tests/performance/testsuite/checkout.jmx
  191. +77 −0 dev/tests/performance/testsuite/fixtures/catalog_product.php
  192. +106 −0 dev/tests/performance/testsuite/home_page.jmx
  193. +115 −0 dev/tests/performance/testsuite/product_view.jmx
  194. +3 −1 dev/tests/static/testsuite/Integrity/LayoutTest.php
  195. +1 −0 dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php
  196. +7 −1 dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php
  197. +1 −3 dev/tests/static/testsuite/Utility/Files.php
  198. +57 −0 dev/tests/unit/framework/Magento/Test/TestCase/ZendDbAdapterAbstract.php
  199. +5 −0 dev/tests/unit/framework/bootstrap.php
  200. +1 −1 dev/tests/unit/phpunit.xml.dist
  201. +68 −0 dev/tests/unit/testsuite/Mage/Adminhtml/Block/System/Config/Form/Field/Array/AbstractTest.php
  202. +80 −0 dev/tests/unit/testsuite/Mage/Adminhtml/Block/UrlrewriteTest.php
  203. +0 −483 dev/tests/unit/testsuite/Mage/Core/Model/Layout/StructureTest.php
  204. +121 −0 dev/tests/unit/testsuite/Mage/ImportExport/Model/Export/Entity/ProductTest.php
  205. +40 −0 dev/tests/unit/testsuite/Mage/Install/Model/Installer/ConsoleTest.php
  206. +12 −21 ...re/Model/Layout/StructureTest.php → unit/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php}
  207. +135 −0 dev/tests/unit/testsuite/Mage/XmlConnect/Model/ApplicationTest.php
  208. +488 −0 dev/tests/unit/testsuite/Magento/Data/StructureTest.php
  209. +1 −30 dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php
  210. +605 −0 lib/Magento/Data/Structure.php
  211. +46 −34 lib/Varien/Db/Adapter/Pdo/Mysql.php
  212. +5 −5 lib/Varien/Http/Adapter/Curl.php
  213. +4 −4 lib/Varien/Image.php
  214. +5 −5 lib/Varien/Image/Adapter.php
  215. +220 −20 lib/Varien/Image/Adapter/Abstract.php
  216. +128 −129 lib/Varien/Image/Adapter/Gd2.php
  217. +381 −0 lib/Varien/Image/Adapter/ImageMagick.php
View
30 CHANGELOG.markdown
@@ -1,3 +1,33 @@
+Update as of 5/23/2012
+======================
+* Published performance tests (`dev/tests/performance`)
+* Implemented support of ImageMagick library for processing images
+* Distinguished "Page Fragments" and "Pages" in layout handles declaration
+* Reduced performance drop caused by introducing containers
+* Implemented Magento_Data_Structure library which is used to handle structure of layout elements
+* Fixed some issues:
+ * Fixed error on saving newsletter template
+ * Fixed some checkout issues:
+ * order is not placed if 3D Secure is used
+ * transaction is not created if PayPal Standard is used
+ * "Purchase Order Number" field is not displayed
+ * failed checkout on concurrent user requests
+ * Fixed incorrect shipment creation: shipping and tracking information was not saved
+ * Fixed broken category page when "Use Flat Catalog Product" is enabled
+ * Fixed incorrect applying of discount to a sub-product, if more two rules are being applied
+ * Fixed broken "Edit" product link in Wishlist and Shopping Cart
+ * Fixed broken installation when "pub/media" is not writable
+ * Fixed resetting Design Theme configuration option when User-Agent Exception is added
+ * Fixed error while running unit tests, when Zend Framework is installed with PEAR
+ * Fixed incorrect processing of "before" and "after" layout instructions in case, when the instruction refers to a node, which is not processed yet
+ * Fixed broken import/export functionality
+ * Fixed broken Web Services pages in Admin Panel
+ * Fixed broken creation of URL rewrite
+ * Fixed error in Weee module caused broken view pages of configurable products with recurring profile or downloadable/bundle product
+ * Fixed error on submitting XML Connect application
+ * Fixed broken design when database is used as media storage
+* Other small changes
+
Update as of 5/09/2012
======================
* Implemented configuration option that enables the page types hierarchy usage during the page generation
View
6 app/Mage.php
@@ -415,7 +415,7 @@ public static function dispatchEvent($name, array $data = array())
{
Magento_Profiler::start('EVENT:' . $name);
$result = self::app()->dispatchEvent($name, $data);
- Magento_Profiler::stop('DISPATCH EVENT:'.$name);
+ Magento_Profiler::stop('EVENT:'.$name);
return $result;
}
@@ -688,8 +688,8 @@ public static function run($code = '', $type = 'store', $options = array())
*/
protected static function _setIsInstalled($options = array())
{
- if (isset($options['is_installed']) && $options['is_installed']) {
- self::$_isInstalled = true;
+ if (isset($options['is_installed'])) {
+ self::$_isInstalled = (bool) $options['is_installed'];
}
}
View
2 app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml
@@ -27,7 +27,7 @@
-->
<layout version="0.1.0">
- <moneybookers_processing_payment translate="label" type="page" parent="checkout_onepage_paymentmethod">
+ <moneybookers_processing_payment translate="label" type="page" parent="default">
<label>Moneybookers Payment</label>
<reference name="root">
<action method="setTemplate"><template>1column.phtml</template></action>
View
11 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php
@@ -57,6 +57,9 @@ protected function _prepareLayout()
->setSortOrder()
->load();
+ $tabAttributesBlock = $this->getLayout()->createBlock(
+ $this->getAttributeTabBlock(), 'adminhtml.catalog.product.edit.tab.attributes'
+ );
foreach ($groupCollection as $group) {
$attributes = $product->getAttributes($group->getId(), true);
// do not add groups without attributes
@@ -73,10 +76,10 @@ protected function _prepareLayout()
$this->addTab('group_'.$group->getId(), array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__($group->getAttributeGroupName()),
- 'content' => $this->_translateHtml($this->getLayout()->createBlock($this->getAttributeTabBlock(),
- 'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)
- ->setGroupAttributes($attributes)
- ->toHtml()),
+ 'content' => $this->_translateHtml($tabAttributesBlock->setGroup($group)
+ ->setGroupAttributes($attributes)
+ ->toHtml()
+ ),
));
}
View
2 app/code/core/Mage/Adminhtml/Block/System/Config/Form.php
@@ -292,7 +292,7 @@ public function initFields($fieldset, $group, $section, $fieldPrefix='', $labelP
$id = $section->getName() . '_' . $group->getName() . '_' . $fieldPrefix . $e->getName();
- if (isset($this->_configData[$path])) {
+ if (array_key_exists($path, $this->_configData)) {
$data = $this->_configData[$path];
$inherit = false;
} else {
View
1 app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php
@@ -148,6 +148,7 @@ public function getArrayRows()
$rowColumnValues = array();
foreach ($row as $key => $value) {
$row[$key] = $this->escapeHtml($value);
+ $rowColumnValues[$this->_getCellInputElementId($rowId, $key)] = $row[$key];
}
$row['_id'] = $rowId;
$row['column_values'] = $rowColumnValues;
View
23 app/code/core/Mage/Adminhtml/Block/Urlrewrite.php
@@ -27,8 +27,11 @@
/**
* Block for Urlrewrites grid container
*
- * @category Mage
- * @package Mage_Adminhtml
+ * @method Mage_Adminhtml_Block_Urlrewrite setSelectorBlock(Mage_Adminhtml_Block_Urlrewrite_Selector $value)
+ * @method null|Mage_Adminhtml_Block_Urlrewrite_Selector getSelectorBlock()
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Adminhtml_Block_Urlrewrite extends Mage_Adminhtml_Block_Widget_Grid_Container
@@ -59,12 +62,18 @@ public function __construct()
*/
public function getCreateUrl()
{
- if (Mage::getBlockSingleton('Mage_Adminhtml_Block_Urlrewrite_Selector')) {
- $modes = array_keys(Mage::getBlockSingleton('Mage_Adminhtml_Block_Urlrewrite_Selector')->getModes());
- $url = $this->getUrl('*/*/edit') . array_shift($modes);
- } else {
- $url = $this->getUrl('*/*/edit');
+ $url = $this->getUrl('*/*/edit');
+
+ $selectorBlock = $this->getSelectorBlock();
+ if ($selectorBlock === null) {
+ $selectorBlock = Mage::getBlockSingleton('Mage_Adminhtml_Block_Urlrewrite_Selector');
}
+
+ if ($selectorBlock) {
+ $modes = array_keys($selectorBlock->getModes());
+ $url .= reset($modes);
+ }
+
return $url;
}
}
View
2 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php
@@ -156,7 +156,7 @@ protected function _setFormChild()
{
$helper = Mage::helper('Mage_Adminhtml_Helper_Data');
- $this->setChild('form', Mage::getBlockSingleton('Mage_Adminhtml_Block_Urlrewrite_Edit_Form'));
+ $this->setChild('form', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Edit_Form'));
if ($this->getUrlrewriteId()) {
$this->_addButton('reset', array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Reset'),
View
4 app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php
@@ -78,7 +78,9 @@ public function __construct()
protected function _prepareLayout()
{
- if ($this->_blockGroup && $this->_controller && $this->_mode) {
+ if ($this->_blockGroup && $this->_controller && $this->_mode
+ && !$this->_layout->getChildName($this->_nameInLayout, 'form')
+ ) {
$this->setChild(
'form',
$this->getLayout()->createBlock($this->_blockGroup
View
57 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Adapter.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+
+/**
+ * System config image field backend model for Zend PDF generator
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Model_System_Config_Backend_Image_Adapter extends Mage_Core_Model_Config_Data
+{
+ /**
+ * Checks if choosen image adapter available
+ *
+ * @throws Mage_Core_Exception if some of adapter dipendencies was not loaded
+ * @return Mage_Adminhtml_Model_System_Config_Backend_File
+ */
+ protected function _beforeSave()
+ {
+ $value = $this->getValue();
+
+ $adapter = Varien_Image_Adapter::factory($value);
+ try {
+ $adapter->checkDependencies();
+ } catch (Exception $e) {
+ $message = Mage::helper('Mage_Core_Helper_Data')->__('Unable to use choosen image adapter because of some dependies are missed');
+ throw new Mage_Core_Exception($message);
+ }
+
+ return $this;
+ }
+}
View
42 app/code/core/Mage/Adminhtml/Model/System/Config/Source/Image/Adapter.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+
+class Mage_Adminhtml_Model_System_Config_Source_Image_Adapter
+{
+ /**
+ * Return hash of image adapter codes and labels
+ *
+ * @return array
+ */
+ public function toOptionArray()
+ {
+ return array(
+ Varien_Image_Adapter::ADAPTER_IM => Mage::helper('Mage_Adminhtml_Helper_Data')->__('ImageMagick'),
+ Varien_Image_Adapter::ADAPTER_GD2 => Mage::helper('Mage_Adminhtml_Helper_Data')->__('PHP Gd 2'),
+ );
+ }
+}
View
3 app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php
@@ -186,7 +186,8 @@ public function thumbnailAction()
$file = Mage::helper('Mage_Cms_Helper_Wysiwyg_Images')->idDecode($file);
$thumb = $this->getStorage()->resizeOnTheFly($file);
if ($thumb !== false) {
- $image = Varien_Image_Adapter::factory('GD2');
+ $adapter = Mage::helper('Mage_Core_Helper_Data')->getImageAdapterType();
+ $image = Varien_Image_Adapter::factory($adapter);
$image->open($thumb);
$image->display();
} else {
View
5 app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php
@@ -43,12 +43,13 @@ public function directiveAction()
$directive = $this->getRequest()->getParam('___directive');
$directive = Mage::helper('Mage_Core_Helper_Data')->urlDecode($directive);
$url = Mage::getModel('Mage_Core_Model_Email_Template_Filter')->filter($directive);
+ $adapter = Mage::helper('Mage_Core_Helper_Data')->getImageAdapterType();
try {
- $image = Varien_Image_Adapter::factory('GD2');
+ $image = Varien_Image_Adapter::factory($adapter);
$image->open($url);
$image->display();
} catch (Exception $e) {
- $image = Varien_Image_Adapter::factory('GD2');
+ $image = Varien_Image_Adapter::factory($adapter);
$image->open(Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->getSkinImagePlaceholderUrl());
$image->display();
/*
View
4 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
@@ -230,7 +230,7 @@ Layout handle for grouped products
</adminhtml_catalog_product_supergroup>
<adminhtml_catalog_product_supergroupgridonly>
- <container name="root" label="Root">
+ <container name="root" label="Root" output="1">
<block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group" name="catalog.product.edit.tab.super.group" />
</container>
</adminhtml_catalog_product_supergroupgridonly>
@@ -241,7 +241,7 @@ Layout handle for configurable products
<adminhtml_catalog_product_configurable_new>
<remove name="product_tabs"/>
<reference name="left">
- <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable" name="configurable_product_tabs"></block>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable" name="configurable_product_tabs"/>
</reference>
</adminhtml_catalog_product_configurable_new>
View
3 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml
@@ -29,8 +29,7 @@
<div class="entry-edit"><div class="entry-edit-head"><h4><?php echo $this->helper('Mage_Sales_Helper_Data')->__('Customer\'s Current Activities') ?></h4></div></div>
<div class="create-order-sidebar-container">
<?php echo $this->getChildHtml('top_button'); ?>
-<?php foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $_child): ?>
- <?php $_alias = $_child->getBlockAlias(); ?>
+<?php foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $_alias => $_child): ?>
<?php if ($_alias != 'top_button' && $_alias != 'bottom_button'): ?>
<div id="order-sidebar_<?php echo $_alias ?>">
<?php if($this->canDisplay($_child)): ?>
View
2 app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php
@@ -40,7 +40,7 @@ public function __construct()
{
parent::__construct();
- $this->_blockGroup = 'api2';
+ $this->_blockGroup = 'Mage_Api2';
$this->_controller = 'adminhtml_attribute';
$this->_headerText = $this->__('REST Attributes');
$this->_removeButton('add');
View
2 app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php
@@ -39,7 +39,7 @@ class Mage_Api2_Block_Adminhtml_Attribute_Edit extends Mage_Adminhtml_Block_Widg
public function __construct()
{
$this->_objectId = 'id';
- $this->_blockGroup = 'api2';
+ $this->_blockGroup = 'Mage_Api2';
$this->_controller = 'adminhtml_attribute';
parent::__construct();
View
2 app/code/core/Mage/Api2/Block/Adminhtml/Roles.php
@@ -40,7 +40,7 @@ public function __construct()
{
parent::__construct();
- $this->_blockGroup = 'api2';
+ $this->_blockGroup = 'Mage_Api2';
$this->_controller = 'adminhtml_roles';
$this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('REST Roles');
View
2 app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php
@@ -41,7 +41,7 @@ class Mage_Api2_Block_Adminhtml_Roles_Buttons extends Mage_Adminhtml_Block_Templ
public function __construct()
{
parent::__construct();
- $this->setTemplate('api2/role/buttons.phtml');
+ $this->setTemplate('role/buttons.phtml');
}
/**
View
2 app/code/core/Mage/Api2/Model/Acl/Global/Role.php
@@ -72,7 +72,7 @@ class Mage_Api2_Model_Acl_Global_Role extends Mage_Core_Model_Abstract
*/
protected function _construct()
{
- $this->_init('Mage_Api2_Model_Acl_Global_Role');
+ $this->_init('Mage_Api2_Model_Resource_Acl_Global_Role');
}
/**
View
2 app/code/core/Mage/Api2/Model/Acl/Global/Rule.php
@@ -60,6 +60,6 @@ class Mage_Api2_Model_Acl_Global_Rule extends Mage_Core_Model_Abstract
*/
protected function _construct()
{
- $this->_init('Mage_Api2_Model_Acl_Global_Rule');
+ $this->_init('Mage_Api2_Model_Resource_Acl_Global_Rule');
}
}
View
2 app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php
@@ -42,7 +42,7 @@ class Mage_Authorizenet_Block_Directpost_Iframe extends Mage_Core_Block_Template
*/
protected function _prepareLayout()
{
- $params = Mage::registry(Mage_Authorizenet_Directpost_PaymentController::REGISTRY_FORM_PARAMS_KEY);
+ $params = Mage::registry('authorizenet_directpost_form_params');
if (is_null($params)) {
$params = array();
}
View
11 app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php
@@ -34,13 +34,6 @@
class Mage_Authorizenet_Directpost_PaymentController extends Mage_Core_Controller_Front_Action
{
/**
- * Register key name for form params
- *
- * @const string
- */
- const REGISTRY_FORM_PARAMS_KEY = 'authorizenet_directpost_form_params';
-
- /**
* @return Mage_Checkout_Model_Session
*/
protected function _getCheckout()
@@ -101,7 +94,7 @@ public function responseAction()
$params['redirect'] = Mage::helper('Mage_Authorizenet_Helper_Data')->getRedirectIframeUrl($result);
}
- Mage::register(self::REGISTRY_FORM_PARAMS_KEY, $params);
+ Mage::register('authorizenet_directpost_form_params', $params);
$this->addPageLayoutHandles();
$this->loadLayout(false)->renderLayout();
}
@@ -125,7 +118,7 @@ public function redirectAction()
$cancelOrder = empty($redirectParams['x_invoice_num']);
$this->_returnCustomerQuote($cancelOrder, $redirectParams['error_msg']);
}
- Mage::register(self::REGISTRY_FORM_PARAMS_KEY, array_merge($params, $redirectParams));
+ Mage::register('authorizenet_directpost_form_params', array_merge($params, $redirectParams));
$this->addPageLayoutHandles();
$this->loadLayout(false)->renderLayout();
}
View
12 app/code/core/Mage/Authorizenet/view/frontend/layout.xml
@@ -41,17 +41,17 @@
</reference>
</checkout_onepage_review>
- <authorizenet_directpost_payment_redirect translate="label" type="page" parent="ajax_index">
+ <authorizenet_directpost_payment_redirect translate="label" type="fragment" owner="checkout_onepage_index">
<label>AuthorizeNet Directpost Redirect</label>
- <reference name="root">
+ <block type="Mage_Page_Block_Html" label="Root" name="root" output="1" template="page_fragment.phtml">
<block type="Mage_Authorizenet_Block_Directpost_Iframe" name="iframe" template="directpost/iframe.phtml"/>
- </reference>
+ </block>
</authorizenet_directpost_payment_redirect>
- <authorizenet_directpost_payment_response translate="label" type="page" parent="ajax_index">
+ <authorizenet_directpost_payment_response translate="label" type="fragment" owner="checkout_onepage_index">
<label>AuthorizeNet Directpost Response</label>
- <reference name="root">
+ <block type="Mage_Page_Block_Html" label="Root" name="root" output="1" template="page_fragment.phtml">
<block type="Mage_Authorizenet_Block_Directpost_Iframe" name="iframe" template="directpost/iframe.phtml"/>
- </reference>
+ </block>
</authorizenet_directpost_payment_response>
</layout>
View
6 app/code/core/Mage/Bundle/view/frontend/layout.xml
@@ -157,7 +157,7 @@ Onepage Checkout Review Page
</reference>
</paypal_express_review>
<paypal_express_review_details>
- <reference name="root">
+ <reference name="paypal.express.review.details">
<action method="addItemRender"><type>bundle</type><block>Mage_Bundle_Block_Checkout_Cart_Item_Renderer</block><template>Mage_Checkout::onepage/review/item.phtml</template></action>
</reference>
</paypal_express_review_details>
@@ -200,7 +200,7 @@ Additional block for bundle product type
</block>
</reference>
<reference name="product.info.options.wrapper">
- <block type="Mage_Bundle_Block_Catalog_Product_View_Type_Bundle" name="product.info.bundle.options" as="type_bundle_options" template="catalog/product/view/type/bundle/options.phtml">
+ <block type="Mage_Bundle_Block_Catalog_Product_View_Type_Bundle" name="product.info.bundle.options" as="type_bundle_options" template="catalog/product/view/type/bundle/options.phtml" before="-">
<action method="addRenderer"><type>select</type><block>Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select</block></action>
<action method="addRenderer"><type>multi</type><block>Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi</block></action>
<action method="addRenderer"><type>radio</type><block>Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio</block></action>
@@ -209,7 +209,7 @@ Additional block for bundle product type
</reference>
<reference name="product.info.options.wrapper.bottom">
<remove name="product.tierprices" />
- <block type="Mage_Bundle_Block_Catalog_Product_View" name="bundle.tierprices" as="tierprices" before="-" template="catalog/product/view/tierprices.phtml"/>
+ <block type="Mage_Bundle_Block_Catalog_Product_View" name="bundle.tierprices" as="tierprices" before="-" template="Mage_Catalog::product/view/tierprices.phtml"/>
<block type="Mage_CatalogInventory_Block_Qtyincrements" name="product.info.qtyincrements" before="-" template="qtyincrements.phtml"/>
</reference>
<reference name="product.clone_prices">
View
12 app/code/core/Mage/Catalog/Block/Product/View.php
@@ -254,4 +254,14 @@ public function getProductDefaultQty($product = null)
return $qty;
}
-}
+
+ /**
+ * Get container name, where product options should be displayed
+ *
+ * @return string
+ */
+ public function getOptionsContainer()
+ {
+ return $this->getProduct()->getOptionsContainer() == 'container1' ? 'container1' : 'container2';
+ }
+}
View
889 app/code/core/Mage/Catalog/Helper/Image.php
@@ -1,5 +1,5 @@
-<?php
-/**
+<?php
+/**
* Magento
*
* NOTICE OF LICENSE
@@ -17,117 +17,117 @@
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Mage
- * @package Mage_Catalog
+ *
+ * @category Mage
+ * @package Mage_Catalog
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-/**
- * Catalog image helper
- *
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract
-{
+ */
+
+/**
+ * Catalog image helper
+ *
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract
+{
/**
* Current model
*
* @var Mage_Catalog_Model_Product_Image
*/
- protected $_model;
+ protected $_model;
/**
* Scheduled for resize image
*
* @var bool
*/
- protected $_scheduleResize = false;
+ protected $_scheduleResize = false;
/**
* Scheduled for rotate image
*
* @var bool
*/
- protected $_scheduleRotate = false;
+ protected $_scheduleRotate = false;
/**
* Angle
*
* @var int
*/
- protected $_angle;
-
+ protected $_angle;
+
/**
* Watermark file name
*
* @var string
*/
- protected $_watermark;
+ protected $_watermark;
/**
* Watermark Position
*
* @var string
*/
- protected $_watermarkPosition;
+ protected $_watermarkPosition;
/**
* Watermark Size
*
* @var string
*/
- protected $_watermarkSize;
+ protected $_watermarkSize;
/**
* Watermark Image opacity
*
* @var int
*/
- protected $_watermarkImageOpacity;
-
+ protected $_watermarkImageOpacity;
+
/**
* Current Product
*
* @var Mage_Catalog_Model_Product
*/
- protected $_product;
+ protected $_product;
/**
* Image File
*
* @var string
*/
- protected $_imageFile;
+ protected $_imageFile;
/**
* Image Placeholder
*
* @var string
*/
- protected $_placeholder;
-
- /**
+ protected $_placeholder;
+
+ /**
* Reset all previous data
*
* @return Mage_Catalog_Helper_Image
- */
- protected function _reset()
- {
- $this->_model = null;
- $this->_scheduleResize = false;
- $this->_scheduleRotate = false;
- $this->_angle = null;
- $this->_watermark = null;
- $this->_watermarkPosition = null;
- $this->_watermarkSize = null;
- $this->_watermarkImageOpacity = null;
- $this->_product = null;
- $this->_imageFile = null;
- return $this;
- }
-
+ */
+ protected function _reset()
+ {
+ $this->_model = null;
+ $this->_scheduleResize = false;
+ $this->_scheduleRotate = false;
+ $this->_angle = null;
+ $this->_watermark = null;
+ $this->_watermarkPosition = null;
+ $this->_watermarkSize = null;
+ $this->_watermarkImageOpacity = null;
+ $this->_product = null;
+ $this->_imageFile = null;
+ return $this;
+ }
+
/**
* Initialize Helper to work with Image
*
@@ -136,13 +136,13 @@ protected function _reset()
* @param mixed $imageFile
* @return Mage_Catalog_Helper_Image
*/
- public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null)
- {
- $this->_reset();
- $this->_setModel(Mage::getModel('Mage_Catalog_Model_Product_Image'));
- $this->_getModel()->setDestinationSubdir($attributeName);
- $this->setProduct($product);
-
+ public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null)
+ {
+ $this->_reset();
+ $this->_setModel(Mage::getModel('Mage_Catalog_Model_Product_Image'));
+ $this->_getModel()->setDestinationSubdir($attributeName);
+ $this->setProduct($product);
+
$this->setWatermark(
Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image")
);
@@ -155,477 +155,478 @@ public function init(Mage_Catalog_Model_Product $product, $attributeName, $image
$this->setWatermarkSize(
Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size")
);
-
- if ($imageFile) {
- $this->setImageFile($imageFile);
+
+ if ($imageFile) {
+ $this->setImageFile($imageFile);
} else {
- // add for work original size
+ // add for work original size
$this->_getModel()->setBaseFile($this->getProduct()->getData($this->_getModel()->getDestinationSubdir()));
- }
- return $this;
- }
-
- /**
- * Schedule resize of the image
- * $width *or* $height can be null - in this case, lacking dimension will be calculated.
- *
- * @see Mage_Catalog_Model_Product_Image
- * @param int $width
- * @param int $height
- * @return Mage_Catalog_Helper_Image
- */
- public function resize($width, $height = null)
- {
- $this->_getModel()->setWidth($width)->setHeight($height);
- $this->_scheduleResize = true;
- return $this;
- }
-
- /**
- * Set image quality, values in percentage from 0 to 100
- *
- * @param int $quality
- * @return Mage_Catalog_Helper_Image
- */
- public function setQuality($quality)
- {
- $this->_getModel()->setQuality($quality);
- return $this;
- }
-
- /**
- * Guarantee, that image picture width/height will not be distorted.
- * Applicable before calling resize()
- * It is true by default.
- *
- * @see Mage_Catalog_Model_Product_Image
- * @param bool $flag
- * @return Mage_Catalog_Helper_Image
- */
- public function keepAspectRatio($flag)
- {
- $this->_getModel()->setKeepAspectRatio($flag);
- return $this;
- }
-
- /**
- * Guarantee, that image will have dimensions, set in $width/$height
- * Applicable before calling resize()
- * Not applicable, if keepAspectRatio(false)
- *
- * $position - TODO, not used for now - picture position inside the frame.
- *
- * @see Mage_Catalog_Model_Product_Image
- * @param bool $flag
- * @param array $position
- * @return Mage_Catalog_Helper_Image
- */
- public function keepFrame($flag, $position = array('center', 'middle'))
- {
- $this->_getModel()->setKeepFrame($flag);
- return $this;
- }
-
- /**
- * Guarantee, that image will not lose transparency if any.
- * Applicable before calling resize()
- * It is true by default.
- *
- * $alphaOpacity - TODO, not used for now
- *
- * @see Mage_Catalog_Model_Product_Image
- * @param bool $flag
- * @param int $alphaOpacity
- * @return Mage_Catalog_Helper_Image
- */
- public function keepTransparency($flag, $alphaOpacity = null)
- {
- $this->_getModel()->setKeepTransparency($flag);
- return $this;
- }
-
- /**
- * Guarantee, that image picture will not be bigger, than it was.
- * Applicable before calling resize()
- * It is false by default
- *
- * @param bool $flag
- * @return Mage_Catalog_Helper_Image
- */
- public function constrainOnly($flag)
- {
- $this->_getModel()->setConstrainOnly($flag);
- return $this;
- }
-
- /**
- * Set color to fill image frame with.
- * Applicable before calling resize()
- * The keepTransparency(true) overrides this (if image has transparent color)
- * It is white by default.
- *
- * @see Mage_Catalog_Model_Product_Image
- * @param array $colorRGB
- * @return Mage_Catalog_Helper_Image
- */
- public function backgroundColor($colorRGB)
- {
- // assume that 3 params were given instead of array
- if (!is_array($colorRGB)) {
- $colorRGB = func_get_args();
- }
- $this->_getModel()->setBackgroundColor($colorRGB);
- return $this;
- }
-
+ }
+ return $this;
+ }
+
+ /**
+ * Schedule resize of the image
+ * $width *or* $height can be null - in this case, lacking dimension will be calculated.
+ *
+ * @see Mage_Catalog_Model_Product_Image
+ * @param int $width
+ * @param int $height
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function resize($width, $height = null)
+ {
+ $this->_getModel()->setWidth($width)->setHeight($height);
+ $this->_scheduleResize = true;
+ return $this;
+ }
+
+ /**
+ * Set image quality, values in percentage from 0 to 100
+ *
+ * @param int $quality
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function setQuality($quality)
+ {
+ $this->_getModel()->setQuality($quality);
+ return $this;
+ }
+
+ /**
+ * Guarantee, that image picture width/height will not be distorted.
+ * Applicable before calling resize()
+ * It is true by default.
+ *
+ * @see Mage_Catalog_Model_Product_Image
+ * @param bool $flag
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function keepAspectRatio($flag)
+ {
+ $this->_getModel()->setKeepAspectRatio($flag);
+ return $this;
+ }
+
+ /**
+ * Guarantee, that image will have dimensions, set in $width/$height
+ * Applicable before calling resize()
+ * Not applicable, if keepAspectRatio(false)
+ *
+ * $position - TODO, not used for now - picture position inside the frame.
+ *
+ * @see Mage_Catalog_Model_Product_Image
+ * @param bool $flag
+ * @param array $position
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function keepFrame($flag, $position = array('center', 'middle'))
+ {
+ $this->_getModel()->setKeepFrame($flag);
+ return $this;
+ }
+
+ /**
+ * Guarantee, that image will not lose transparency if any.
+ * Applicable before calling resize()
+ * It is true by default.
+ *
+ * $alphaOpacity - TODO, not used for now
+ *
+ * @see Mage_Catalog_Model_Product_Image
+ * @param bool $flag
+ * @param int $alphaOpacity
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function keepTransparency($flag, $alphaOpacity = null)
+ {
+ $this->_getModel()->setKeepTransparency($flag);
+ return $this;
+ }
+
+ /**
+ * Guarantee, that image picture will not be bigger, than it was.
+ * Applicable before calling resize()
+ * It is false by default
+ *
+ * @param bool $flag
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function constrainOnly($flag)
+ {
+ $this->_getModel()->setConstrainOnly($flag);
+ return $this;
+ }
+
+ /**
+ * Set color to fill image frame with.
+ * Applicable before calling resize()
+ * The keepTransparency(true) overrides this (if image has transparent color)
+ * It is white by default.
+ *
+ * @see Mage_Catalog_Model_Product_Image
+ * @param array $colorRGB
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function backgroundColor($colorRGB)
+ {
+ // assume that 3 params were given instead of array
+ if (!is_array($colorRGB)) {
+ $colorRGB = func_get_args();
+ }
+ $this->_getModel()->setBackgroundColor($colorRGB);
+ return $this;
+ }
+
/**
* Rotate image into specified angle
*
* @param int $angle
* @return Mage_Catalog_Helper_Image
*/
- public function rotate($angle)
- {
- $this->setAngle($angle);
- $this->_getModel()->setAngle($angle);
- $this->_scheduleRotate = true;
- return $this;
- }
-
- /**
- * Add watermark to image
- * size param in format 100x200
- *
- * @param string $fileName
- * @param string $position
- * @param string $size
- * @param int $imageOpacity
- * @return Mage_Catalog_Helper_Image
- */
- public function watermark($fileName, $position, $size=null, $imageOpacity=null)
- {
- $this->setWatermark($fileName)
- ->setWatermarkPosition($position)
- ->setWatermarkSize($size)
- ->setWatermarkImageOpacity($imageOpacity);
- return $this;
- }
-
+ public function rotate($angle)
+ {
+ $this->setAngle($angle);
+ $this->_getModel()->setAngle($angle);
+ $this->_scheduleRotate = true;
+ return $this;
+ }
+
+ /**
+ * Add watermark to image
+ * size param in format 100x200
+ *
+ * @param string $fileName
+ * @param string $position
+ * @param string $size
+ * @param int $imageOpacity
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function watermark($fileName, $position, $size=null, $imageOpacity=null)
+ {
+ $this->setWatermark($fileName)
+ ->setWatermarkPosition($position)
+ ->setWatermarkSize($size)
+ ->setWatermarkImageOpacity($imageOpacity);
+ return $this;
+ }
+
/**
* Set placeholder
*
* @param string $fileName
* @return void
*/
- public function placeholder($fileName)
- {
- $this->_placeholder = $fileName;
- }
-
+ public function placeholder($fileName)
+ {
+ $this->_placeholder = $fileName;
+ }
+
/**
* Get Placeholder
*
* @return string
*/
- public function getPlaceholder()
- {
- if (!$this->_placeholder) {
- $attr = $this->_getModel()->getDestinationSubdir();
- $this->_placeholder = 'Mage_Catalog::images/product/placeholder/' . $attr . '.jpg';
- }
- return $this->_placeholder;
- }
-
+ public function getPlaceholder()
+ {
+ if (!$this->_placeholder) {
+ $attr = $this->_getModel()->getDestinationSubdir();
+ $this->_placeholder = 'Mage_Catalog::images/product/placeholder/' . $attr . '.jpg';
+ }
+ return $this->_placeholder;
+ }
+
/**
* Return Image URL
*
* @return string
*/
- public function __toString()
- {
- try {
+ public function __toString()
+ {
+ try {
$model = $this->_getModel();
if ($this->getImageFile()) {
$model->setBaseFile($this->getImageFile());
- } else {
+ } else {
$model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
- }
-
+ }
+
if ($model->isCached()) {
return $model->getUrl();
- } else {
+ } else {
if ($this->_scheduleRotate) {
$model->rotate($this->getAngle());
- }
-
- if ($this->_scheduleResize) {
+ }
+
+ if ($this->_scheduleResize) {
$model->resize();
- }
-
+ }
+
if ($this->getWatermark()) {
$model->setWatermark($this->getWatermark());
- }
-
+ }
+
$url = $model->saveFile()->getUrl();
- }
+ }
} catch (Exception $e) {
- $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
- }
- return $url;
- }
-
- /**
+ $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
+ }
+ return $url;
+ }
+
+ /**
* Set current Image model
- *
+ *
* @param Mage_Catalog_Model_Product_Image $model
- * @return Mage_Catalog_Helper_Image
- */
- protected function _setModel($model)
- {
- $this->_model = $model;
- return $this;
- }
-
- /**
+ * @return Mage_Catalog_Helper_Image
+ */
+ protected function _setModel($model)
+ {
+ $this->_model = $model;
+ return $this;
+ }
+
+ /**
* Get current Image model
- *
- * @return Mage_Catalog_Model_Product_Image
- */
- protected function _getModel()
- {
- return $this->_model;
- }
-
+ *
+ * @return Mage_Catalog_Model_Product_Image
+ */
+ protected function _getModel()
+ {
+ return $this->_model;
+ }
+
/**
* Set Rotation Angle
*
* @param int $angle
* @return Mage_Catalog_Helper_Image
*/
- protected function setAngle($angle)
- {
- $this->_angle = $angle;
- return $this;
- }
-
+ protected function setAngle($angle)
+ {
+ $this->_angle = $angle;
+ return $this;
+ }
+
/**
* Get Rotation Angle
*
* @return int
*/
- protected function getAngle()
- {
- return $this->_angle;
- }
-
- /**
- * Set watermark file name
- *
- * @param string $watermark
- * @return Mage_Catalog_Helper_Image
- */
- protected function setWatermark($watermark)
- {
- $this->_watermark = $watermark;
- $this->_getModel()->setWatermarkFile($watermark);
- return $this;
- }
-
- /**
- * Get watermark file name
- *
- * @return string
- */
- protected function getWatermark()
- {
- return $this->_watermark;
- }
-
- /**
- * Set watermark position
- *
- * @param string $position
- * @return Mage_Catalog_Helper_Image
- */
- protected function setWatermarkPosition($position)
- {
- $this->_watermarkPosition = $position;
- $this->_getModel()->setWatermarkPosition($position);
- return $this;
- }
-
- /**
- * Get watermark position
- *
- * @return string
- */
- protected function getWatermarkPosition()
- {
- return $this->_watermarkPosition;
- }
-
- /**
- * Set watermark size
- * param size in format 100x200
- *
- * @param string $size
- * @return Mage_Catalog_Helper_Image
- */
- public function setWatermarkSize($size)
- {
- $this->_watermarkSize = $size;
- $this->_getModel()->setWatermarkSize($this->parseSize($size));
- return $this;
- }
-
- /**
- * Get watermark size
- *
- * @return string
- */
- protected function getWatermarkSize()
- {
- return $this->_watermarkSize;
- }
-
- /**
- * Set watermark image opacity
- *
- * @param int $imageOpacity
- * @return Mage_Catalog_Helper_Image
- */
- public function setWatermarkImageOpacity($imageOpacity)
- {
- $this->_watermarkImageOpacity = $imageOpacity;
- $this->_getModel()->setWatermarkImageOpacity($imageOpacity);
- return $this;
- }
-
- /**
- * Get watermark image opacity
- *
- * @return int
- */
- protected function getWatermarkImageOpacity()
- {
+ protected function getAngle()
+ {
+ return $this->_angle;
+ }
+
+ /**
+ * Set watermark file name
+ *
+ * @param string $watermark
+ * @return Mage_Catalog_Helper_Image
+ */
+ protected function setWatermark($watermark)
+ {
+ $this->_watermark = $watermark;
+ $this->_getModel()->setWatermarkFile($watermark);
+ return $this;
+ }
+
+ /**
+ * Get watermark file name
+ *
+ * @return string
+ */
+ protected function getWatermark()
+ {
+ return $this->_watermark;
+ }
+
+ /**
+ * Set watermark position
+ *
+ * @param string $position
+ * @return Mage_Catalog_Helper_Image
+ */
+ protected function setWatermarkPosition($position)
+ {
+ $this->_watermarkPosition = $position;
+ $this->_getModel()->setWatermarkPosition($position);
+ return $this;
+ }
+
+ /**
+ * Get watermark position
+ *
+ * @return string
+ */
+ protected function getWatermarkPosition()
+ {
+ return $this->_watermarkPosition;
+ }
+
+ /**
+ * Set watermark size
+ * param size in format 100x200
+ *
+ * @param string $size
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function setWatermarkSize($size)
+ {
+ $this->_watermarkSize = $size;
+ $this->_getModel()->setWatermarkSize($this->parseSize($size));
+ return $this;
+ }
+
+ /**
+ * Get watermark size
+ *
+ * @return string
+ */
+ protected function getWatermarkSize()
+ {
+ return $this->_watermarkSize;
+ }
+
+ /**
+ * Set watermark image opacity
+ *
+ * @param int $imageOpacity
+ * @return Mage_Catalog_Helper_Image
+ */
+ public function setWatermarkImageOpacity($imageOpacity)
+ {
+ $this->_watermarkImageOpacity = $imageOpacity;
+ $this->_getModel()->setWatermarkImageOpacity($imageOpacity);
+ return $this;
+ }
+
+ /**
+ * Get watermark image opacity
+ *
+ * @return int
+ */
+ protected function getWatermarkImageOpacity()
+ {
if ($this->_watermarkImageOpacity) {
- return $this->_watermarkImageOpacity;
- }
-
- return $this->_getModel()->getWatermarkImageOpacity();
- }
-
+ return $this->_watermarkImageOpacity;
+ }
+
+ return $this->_getModel()->getWatermarkImageOpacity();
+ }
+
/**
* Set current Product
*
* @param Mage_Catalog_Model_Product $product
* @return Mage_Catalog_Helper_Image
*/
- protected function setProduct($product)
- {
- $this->_product = $product;
- return $this;
- }
-
+ protected function setProduct($product)
+ {
+ $this->_product = $product;
+ return $this;
+ }
+
/**
* Get current Product
*
* @return Mage_Catalog_Model_Product
*/
- protected function getProduct()
- {
- return $this->_product;
- }
-
+ protected function getProduct()
+ {
+ return $this->_product;
+ }
+
/**
* Set Image file
*
* @param string $file
* @return Mage_Catalog_Helper_Image
*/
- protected function setImageFile($file)
- {
- $this->_imageFile = $file;
- return $this;
- }
-
+ protected function setImageFile($file)
+ {
+ $this->_imageFile = $file;
+ return $this;
+ }
+
/**
* Get Image file
*
* @return string
*/
- protected function getImageFile()
- {
- return $this->_imageFile;
- }
-
- /**
+ protected function getImageFile()
+ {
+ return $this->_imageFile;
+ }
+
+ /**
* Retrieve size from string
- *
+ *
* @param string $string
* @return array|bool
- */
- protected function parseSize($string)
- {
- $size = explode('x', strtolower($string));
+ */
+ protected function parseSize($string)
+ {
+ $size = explode('x', strtolower($string));
if (sizeof($size) == 2) {
- return array(
- 'width' => ($size[0] > 0) ? $size[0] : null,
- 'heigth' => ($size[1] > 0) ? $size[1] : null,
- );
- }
- return false;
- }
-
- /**
- * Retrieve original image width
- *
- * @return int|null
- */
- public function getOriginalWidth()
- {
- return $this->_getModel()->getImageProcessor()->getOriginalWidth();
- }
-
- /**
- * Retrieve original image height
- *
- * @return int|null
- */
- public function getOriginalHeight()
- {
- return $this->_getModel()->getImageProcessor()->getOriginalHeight();
- }
-
- /**
- * Retrieve Original image size as array
- * 0 - width, 1 - height
- *
- * @return array
- */
- public function getOriginalSizeArray()
- {
- return array(
- $this->getOriginalWidth(),
- $this->getOriginalHeight()
- );
- }
-
- /**
- * Check - is this file an image
- *
- * @param string $filePath
- * @return bool
+ return array(
+ 'width' => ($size[0] > 0) ? $size[0] : null,
+ 'heigth' => ($size[1] > 0) ? $size[1] : null,
+ );
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve original image width
+ *
+ * @return int|null
+ */
+ public function getOriginalWidth()
+ {
+ return $this->_getModel()->getImageProcessor()->getOriginalWidth();
+ }
+
+ /**
+ * Retrieve original image height
+ *
+ * @return int|null
+ */
+ public function getOriginalHeight()
+ {
+ return $this->_getModel()->getImageProcessor()->getOriginalHeight();
+ }
+
+ /**
+ * Retrieve Original image size as array
+ * 0 - width, 1 - height
+ *
+ * @return array
+ */
+ public function getOriginalSizeArray()
+ {
+ return array(
+ $this->getOriginalWidth(),
+ $this->getOriginalHeight()
+ );
+ }
+
+ /**
+ * Check - is this file an image
+ *
+ * @param string $filePath
+ * @return bool
* @throws Mage_Core_Exception
- */
- public function validateUploadFile($filePath) {
- if (!getimagesize($filePath)) {
- Mage::throwException($this->__('Disallowed file type.'));
- }
+ */
+ public function validateUploadFile($filePath) {
+ if (!getimagesize($filePath)) {
+ Mage::throwException($this->__('Disallowed file type.'));
+ }
- $_processor = new Varien_Image($filePath);
+ $adapter = Mage::helper('Mage_Core_Helper_Data')->getImageAdapterType();
+ $_processor = new Varien_Image($filePath, $adapter);