Skip to content
Browse files

Update as of 3/26/2012

* Introduced concept of containers and "page types" in layout.
  * Containers replace `Mage_Core_Block_Text_List` and `Mage_Page_Block_Html_Wrapper`
  * Widgets now utilize page types and containers instead of "handles" and "block references"
* Implemented first draft of visual design editor with the following capabilities
  * highlighting and dragging blocks and containers, toggling highlighting on/off
  * switching to arbitrary theme and skin
  * navigating to arbitrary page types (product view, order success page, etc...), so that they would be editable with visual design editor
* Refactored various places across the system in order to accommodate transition to containers, page types and visual design editor, which includes
  * Output in any frontend controller action using layout only
  * Output in any frontend controller specifies one and only one layout handle, which equals to its full action name. There can be other handles that extend it and they are determined by layout loading parameters, provided by controller.
  * No program termination (exit) on logging in admin user
  * Session cookie lifetime is set to 0 for frontend and backend. Session will exist until browser window is open, however backend session lifetime limitation does not depend on cookie lifetime anymore.
* Fixes:
  * Failures of tests in developer mode
  * `app/etc/local.xml` affected integration tests
* Addressed pull requests and issues from Github
* Fetched updates from Magento 1 up to March 2 2012. Refer to [Magento 1 release notes](http://www.magentocommerce.com/download/release_notes) for details.
  • Loading branch information...
1 parent 9de2223 commit 6194a7a4487ddff065ed38d38a82976153a15628 @magento-team magento-team committed Mar 26, 2012
Showing with 6,412 additions and 4,655 deletions.
  1. +6 −0 .htaccess
  2. +58 −0 CHANGELOG.markdown
  3. +38 −8 app/Mage.php
  4. +12 −4 app/bootstrap.php
  5. +8 −4 app/code/community/Phoenix/Moneybookers/Block/Redirect.php
  6. +9 −6 app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php
  7. +9 −2 app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml
  8. +0 −97 app/code/core/Mage/Admin/Model/Observer.php
  9. +45 −45 app/code/core/Mage/Admin/Model/Session.php
  10. +1 −1 app/code/core/Mage/Admin/Model/User.php
  11. +1 −1 app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php
  12. +4 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php
  13. +3 −3 app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php
  14. +1 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php
  15. +3 −7 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php
  16. +4 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php
  17. +5 −5 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php
  18. +3 −3 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php
  19. +1 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php
  20. +1 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
  21. +1 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php
  22. +18 −13 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php
  23. +11 −0 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php
  24. +1 −0 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php
  25. +3 −3 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php
  26. +2 −4 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php
  27. +2 −4 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php
  28. +13 −6 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php
  29. +1 −1 app/code/core/Mage/Adminhtml/Block/Customer/Online.php
  30. +10 −5 app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php
  31. +7 −16 app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
  32. +1 −1 app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php
  33. +1 −1 app/code/core/Mage/Adminhtml/Block/Notification/Security.php
  34. +9 −9 app/code/core/Mage/Adminhtml/Block/Notification/Window.php
  35. +55 −11 app/code/core/Mage/Adminhtml/Block/Page/Menu.php
  36. +1 −1 app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php
  37. +1 −1 app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php
  38. +2 −1 app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php
  39. +2 −2 app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php
  40. +1 −1 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php
  41. +4 −2 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php
  42. +43 −46 app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php
  43. +12 −1 app/code/core/Mage/Adminhtml/Block/Rating/Grid.php
  44. +7 −1 app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php
  45. +1 −0 app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php
  46. +8 −0 app/code/core/Mage/Adminhtml/Block/Review/Main.php
  47. +1 −1 app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php
  48. +1 −1 app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php
  49. +12 −0 app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php
  50. +3 −6 app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php
  51. +14 −1 app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php
  52. +2 −0 app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php
  53. +1 −1 app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
  54. +1 −1 app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php
  55. +9 −0 app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php
  56. +2 −1 app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php
  57. +2 −2 app/code/core/Mage/Adminhtml/Block/System/Config/Form.php
  58. +1 −0 app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php
  59. +5 −3 app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php
  60. +7 −1 app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php
  61. +1 −1 app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php
  62. +4 −2 app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php
  63. +1 −1 app/code/core/Mage/Adminhtml/Block/Tax/Class.php
  64. +1 −1 app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php
  65. +5 −2 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php
  66. +1 −0 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php
  67. +3 −1 app/code/core/Mage/Adminhtml/Block/Widget/Button.php
  68. +2 −2 app/code/core/Mage/Adminhtml/Block/Widget/Container.php
  69. +2 −2 app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php
  70. +1 −1 app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
  71. +1 −10 app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php
  72. +1 −1 app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php
  73. +2 −2 app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php
  74. +37 −12 app/code/core/Mage/Adminhtml/Controller/Action.php
  75. +1 −1 app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php
  76. +128 −7 app/code/core/Mage/Adminhtml/Model/Observer.php
  77. +25 −4 app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
  78. +0 −11 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php
  79. +4 −4 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php
  80. +25 −0 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php
  81. +1 −1 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php
  82. +4 −4 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php
  83. +92 −0 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Logo.php
  84. +20 −1 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php
  85. +1 −1 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php
  86. +14 −1 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php
  87. +3 −2 app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php
  88. +5 −1 app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php
  89. +10 −1 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php
  90. +3 −1 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php
  91. +3 −0 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
  92. +2 −3 app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php
  93. +1 −6 app/code/core/Mage/Adminhtml/controllers/IndexController.php
  94. +1 −1 app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php
  95. +19 −9 app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php
  96. +40 −7 app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php
  97. +1 −1 app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php
  98. +14 −9 app/code/core/Mage/Adminhtml/controllers/RatingController.php
  99. +1 −1 app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php
  100. +13 −5 app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php
  101. +0 −9 app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php
  102. +1 −1 app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php
  103. +6 −6 app/code/core/Mage/Adminhtml/controllers/System/BackupController.php
  104. +1 −2 app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php
  105. +4 −2 app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php
  106. +1 −1 app/code/core/Mage/Adminhtml/controllers/System/VariableController.php
  107. +13 −1 app/code/core/Mage/Adminhtml/etc/adminhtml.xml
  108. +1 −5 app/code/core/Mage/Adminhtml/etc/config.xml
  109. +2 −2 app/code/core/Mage/Adminhtml/etc/{translater.xml → jstranslator.xml}
  110. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml
  111. +41 −41 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
  112. +13 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml
  113. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js
  114. +2 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml
  115. +7 −6 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml
  116. +28 −26 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml
  117. +43 −12 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml
  118. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/cms.xml
  119. +23 −23 app/code/core/Mage/Adminhtml/view/adminhtml/customer.xml
  120. +72 −1 app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml
  121. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml
  122. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml
  123. +4 −4 app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml
  124. +4 −4 app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml
  125. +24 −24 app/code/core/Mage/Adminhtml/view/adminhtml/main.xml
  126. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml
  127. +1 −12 app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml
  128. +5 −5 app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml
  129. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/promo.xml
  130. +1 −0 app/code/core/Mage/Adminhtml/view/adminhtml/promo/salesrulejs.phtml
  131. +26 −26 app/code/core/Mage/Adminhtml/view/adminhtml/sales.xml
  132. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml
  133. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml
  134. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml
  135. +11 −2 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml
  136. +17 −3 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js
  137. +8 −6 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml
  138. +3 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml
  139. +24 −20 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml
  140. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml
  141. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml
  142. +3 −2 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml
  143. +5 −7 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml
  144. +3 −3 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml
  145. +5 −9 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml
  146. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml
  147. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml
  148. +2 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml
  149. +3 −1 app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml
  150. +11 −11 app/code/core/Mage/Adminhtml/view/adminhtml/tag.xml
  151. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml
  152. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/variables.js
  153. +4 −3 app/code/core/Mage/Adminhtml/view/email/password_reset_confirmation.html
  154. +16 −8 app/code/core/Mage/Api/Controller/Action.php
  155. +10 −32 app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php
  156. +15 −14 app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php
  157. +15 −0 app/code/core/Mage/Authorizenet/view/frontend/layout.xml
  158. +5 −15 app/code/core/Mage/Backup/Helper/Data.php
  159. +30 −2 app/code/core/Mage/Backup/Model/Db.php
  160. +1 −1 app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php
  161. +1 −1 app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php
  162. +2 −2 app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php
  163. +8 −2 app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php
  164. +2 −2 app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
  165. +13 −0 app/code/core/Mage/Bundle/Model/Observer.php
  166. +10 −3 app/code/core/Mage/Bundle/Model/Product/Price.php
  167. +16 −3 app/code/core/Mage/Bundle/Model/Product/Type.php
  168. +6 −3 app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php
  169. +16 −13 app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php
  170. +11 −10 app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php
  171. +11 −8 app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php
  172. +8 −0 app/code/core/Mage/Bundle/etc/config.xml
  173. +2 −2 app/code/core/Mage/Bundle/view/adminhtml/layout.xml
  174. +2 −1 app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml
  175. +2 −1 app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml
  176. +2 −1 app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml
  177. +2 −1 app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml
  178. +1 −0 app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml
  179. +7 −25 app/code/core/Mage/Bundle/view/frontend/layout.xml
  180. +2 −1 app/code/core/Mage/Captcha/Model/Resource/Log.php
  181. +10 −10 app/code/core/Mage/Captcha/view/frontend/layout.xml
  182. +2 −2 app/code/core/Mage/Captcha/view/frontend/zend.phtml
  183. +18 −0 app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php
  184. +4 −4 app/code/core/Mage/Catalog/Block/Layer/View.php
  185. +1 −1 app/code/core/Mage/Catalog/Block/Product/List.php
  186. +2 −3 app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php
  187. +1 −1 app/code/core/Mage/Catalog/Block/Product/List/Related.php
  188. +1 −1 app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
  189. +1 −1 app/code/core/Mage/Catalog/Block/Product/List/Upsell.php
  190. +5 −0 app/code/core/Mage/Catalog/Block/Product/Price.php
  191. +3 −6 app/code/core/Mage/Catalog/Block/Product/View/Additional.php
  192. +3 −2 app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php
  193. +11 −0 app/code/core/Mage/Catalog/Helper/Data.php
  194. +452 −420 app/code/core/Mage/Catalog/Helper/Product.php
  195. +3 −6 app/code/core/Mage/Catalog/Helper/Product/View.php
  196. +908 −925 app/code/core/Mage/Catalog/Model/Category.php
  197. +1 −0 app/code/core/Mage/Catalog/Model/Indexer/Url.php
  198. +0 −1 app/code/core/Mage/Catalog/Model/Layer.php
  199. +0 −1 app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php
  200. +97 −16 app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php
  201. +295 −228 app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php
  202. +67 −0 app/code/core/Mage/Catalog/Model/Observer.php
  203. +12 −1 app/code/core/Mage/Catalog/Model/Product.php
  204. +11 −3 app/code/core/Mage/Catalog/Model/Product/Option.php
  205. +5 −0 app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php
  206. +5 −0 app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php
  207. +5 −0 app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php
  208. +10 −0 app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php
  209. +11 −7 app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php
  210. +13 −6 app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php
  211. +217 −72 app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php
  212. +12 −4 app/code/core/Mage/Catalog/Model/Resource/Product.php
  213. +271 −8 app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php
  214. +1 −1 app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php
  215. +42 −9 app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php
  216. +1 −4 app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php
  217. +8 −11 app/code/core/Mage/Catalog/Model/Resource/Url.php
  218. +7 −8 app/code/core/Mage/Catalog/controllers/CategoryController.php
  219. +95 −95 app/code/core/Mage/Catalog/controllers/ProductController.php
  220. +2 −6 app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php
  221. +54 −0 app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.12-1.6.0.0.13.php
  222. +1 −1 app/code/core/Mage/Catalog/etc/adminhtml.xml
  223. +10 −1 app/code/core/Mage/Catalog/etc/config.xml
  224. +7 −0 app/code/core/Mage/Catalog/etc/fieldset.xml
  225. +16 −7 app/code/core/Mage/Catalog/etc/system.xml
  226. +5 −5 app/code/core/Mage/Catalog/etc/widget.xml
  227. +34 −0 app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.11-1.6.0.0.12.php
  228. +2 −0 app/code/core/Mage/Catalog/view/frontend/layer/filter.phtml
  229. +5 −3 app/code/core/Mage/Catalog/view/frontend/layer/state.phtml
  230. +3 −3 app/code/core/Mage/Catalog/view/frontend/layer/view.phtml
  231. +48 −91 app/code/core/Mage/Catalog/view/frontend/layout.xml
  232. +8 −8 app/code/core/Mage/Catalog/view/frontend/msrp.xml
  233. +2 −2 app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml
  234. +46 −38 app/code/core/Mage/Catalog/view/frontend/product/price.phtml
  235. +5 −1 app/code/core/Mage/Catalog/view/frontend/product/view.phtml
  236. +1 −1 app/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml
  237. +1 −1 app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml
  238. +3 −3 app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml
  239. +1 −1 app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml
  240. +1 −1 app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml
  241. +1 −0 app/code/core/Mage/CatalogInventory/Helper/Data.php
  242. +6 −1 app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php
  243. +28 −1 app/code/core/Mage/CatalogInventory/Model/Observer.php
  244. +0 −11 app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php
  245. +4 −1 app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
  246. +1 −1 app/code/core/Mage/CatalogInventory/etc/config.xml
  247. +5 −1 app/code/core/Mage/CatalogInventory/etc/system.xml
  248. +45 −0 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php
  249. +9 −9 app/code/core/Mage/CatalogInventory/view/frontend/layout.xml
  250. +3 −5 app/code/core/Mage/CatalogRule/Helper/Data.php
  251. +42 −0 app/code/core/Mage/CatalogRule/Model/Flag.php
  252. +3 −1 app/code/core/Mage/CatalogRule/Model/Observer.php
  253. +77 −77 app/code/core/Mage/CatalogRule/Model/Resource/Rule.php
  254. +6 −6 app/code/core/Mage/CatalogRule/Model/Rule.php
  255. +1 −1 app/code/core/Mage/CatalogRule/etc/config.xml
  256. +51 −0 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.2-1.6.0.3.php
  257. +3 −3 app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php
  258. +1 −1 app/code/core/Mage/CatalogSearch/Block/Result.php
  259. +6 −0 app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php
  260. +25 −16 app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php
  261. +2 −3 app/code/core/Mage/CatalogSearch/controllers/AjaxController.php
  262. +10 −4 app/code/core/Mage/CatalogSearch/view/frontend/layout.xml
  263. +2 −2 app/code/core/Mage/Centinel/view/adminhtml/layout.xml
  264. +6 −4 app/code/core/Mage/Centinel/view/frontend/layout.xml
  265. +5 −4 app/code/core/Mage/Checkout/Block/Cart.php
  266. +49 −3 app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php
  267. +2 −2 app/code/core/Mage/Checkout/Block/Multishipping/Overview.php
  268. +1 −1 app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php
  269. +1 −1 app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php
  270. +2 −2 app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php
  271. +6 −4 app/code/core/Mage/Checkout/Helper/Data.php
  272. +33 −10 app/code/core/Mage/Checkout/Model/Cart.php
  273. +11 −8 app/code/core/Mage/Checkout/Model/Cart/Product/Api.php
  274. +2 −2 app/code/core/Mage/Checkout/Model/Type/Onepage.php
  275. +5 −3 app/code/core/Mage/Checkout/controllers/CartController.php
  276. +23 −21 app/code/core/Mage/Checkout/controllers/OnepageController.php
  277. +2 −2 app/code/core/Mage/Checkout/etc/{translater.xml → jstranslator.xml}
  278. +1 −1 app/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml
  279. +6 −6 app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml
  280. +4 −8 app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml
  281. +82 −95 app/code/core/Mage/Checkout/view/frontend/layout.xml
  282. +2 −1 app/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml
  283. +5 −4 app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml
  284. +1 −2 app/code/core/Mage/Checkout/view/frontend/onepage.phtml
  285. +9 −9 app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml
  286. +1 −1 app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml
  287. +9 −17 app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml
  288. +6 −4 app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml
  289. +5 −5 app/code/core/Mage/Checkout/view/frontend/opcheckout.js
  290. +1 −1 app/code/core/Mage/Checkout/view/frontend/total/tax.phtml
  291. +1 −4 app/code/core/Mage/Cms/Helper/Page.php
  292. +1 −0 app/code/core/Mage/Cms/Model/Resource/Block.php
  293. +270 −0 app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php
  294. +1 −1 app/code/core/Mage/Cms/etc/config.xml
  295. +10 −11 app/code/core/Mage/Cms/view/frontend/layout.xml
  296. +4 −4 app/code/core/Mage/Connect/view/adminhtml/layout.xml
  297. +1 −1 app/code/core/Mage/Contacts/view/frontend/layout.xml
  298. +1,002 −1,316 app/code/core/Mage/Core/Block/Abstract.php
  299. +3 −6 app/code/core/Mage/Core/Block/Flush.php
  300. +1 −1 app/code/core/Mage/Core/Block/Template.php
Sorry, we could not display the entire diff because too many files (1,033) changed.
View
6 .htaccess
@@ -129,6 +129,12 @@
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
+## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
+
+ RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
+ RewriteRule .* - [L,R=405]
+
+############################################
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/pub/(media|js)/
View
58 CHANGELOG.markdown
@@ -0,0 +1,58 @@
+Update as of 3/26/2012
+======================
+
+* Introduced concept of containers and "page types" in layout.
+ * Containers replace `Mage_Core_Block_Text_List` and `Mage_Page_Block_Html_Wrapper`
+ * Widgets now utilize page types and containers instead of "handles" and "block references"
+* Implemented first draft of visual design editor with the following capabilities
+ * highlighting and dragging blocks and containers, toggling highlighting on/off
+ * switching to arbitrary theme and skin
+ * navigating to arbitrary page types (product view, order success page, etc...), so that they would be editable with visual design editor
+* Refactored various places across the system in order to accommodate transition to containers, page types and visual design editor, which includes
+ * Output in any frontend controller action using layout only
+ * Output in any frontend controller specifies one and only one layout handle, which equals to its full action name. There can be other handles that extend it and they are determined by layout loading parameters, provided by controller.
+ * No program termination (exit) on logging in admin user
+ * Session cookie lifetime is set to 0 for frontend and backend. Session will exist until browser window is open, however backend session lifetime limitation does not depend on cookie lifetime anymore.
+* Fixes:
+ * Failures of tests in developer mode
+ * `app/etc/local.xml` affected integration tests
+* Addressed pull requests and issues from Github
+* Fetched updates from Magento 1 up to March 2 2012. Refer to [Magento 1 release notes](http://www.magentocommerce.com/download/release_notes) for details.
+
+Update as of 2/29/2012
+======================
+
+* Added jQuery to Magento 2. It has not been made a main library yet, however all new features are developed using jQuery.
+* Added support for new versions of testing tools - PHPUnit 3.6, PHPMD 1.3.0. Confirmed compatibility with latest PHPCS 1.3.2 and PHPCPD 1.3.5.
+* Improved legacy tests:
+ * Refactored Integrity_ClassesTest and Legacy_ClassesTest.
+ * Implemented a tool for migrating factory names from 1.x to 2.x. The tool scans PHP-code and replaces the most "popular" cases.
+ * Added tests for `//model` in config.xml files and `//*[@module]` in all xml files.
+ * Implemented a test that verifies the absence of relocated directories.
+ * Added a test against the obsolete Varien_Profiler.
+* Bug fixes:
+ * Fixed docblock for Mage_Core_Model_Design_Package.
+ * Fixed static code analysis failures related to case-sensitivity.
+ * Fixed several typos and minor mistakes.
+ * Fixed integration test's failures due to specifics of xpath library version.
+* Imported fresh features and bug fixes from Magento 1.x.
+
+Additional Tests and Fixes
+==========================
+
+* Various code integrity fixes in different places:
+ * Fixed obsolete references to classes
+ * Fixed broken references to template and static view files
+ * Fixed some minor occurrences of deprecated code
+ * Code style minor fixes
+* Various minor bugfixes
+* Implemented "developer mode" in integration tests
+* Added "rollback" scripts capability for data fixtures
+* Removed deprecated methods and attributes from product type class
+* Restructured code integrity tests:
+ * Moved out part of the tests from integration into static tests
+ * Introduced "Legacy" test suite in static tests. This test suite is not executed by default when running either phpunit directly or using the "batch tool"
+ * Simplified and reorganized the "Exemplar" and self-assessment tests for static code analysis
+* Covered previously made backwards-incompatible changes with legacy tests
+* Changed storage of class map from a PHP-file with array into a better-performing text file with serialized array.
+* Published dev/tests/static and dev/tests/unit
View
46 app/Mage.php
@@ -100,6 +100,22 @@
static private $_isInstalled;
/**
+ * Magento edition constants
+ */
+ const EDITION_COMMUNITY = 'Community';
+ const EDITION_ENTERPRISE = 'Enterprise';
+ const EDITION_PROFESSIONAL = 'Professional';
+ const EDITION_GO = 'Go';
+
+ /**
+ * Current Magento edition.
+ *
+ * @var string
+ * @static
+ */
+ static private $_currentEdition = self::EDITION_COMMUNITY;
+
+ /**
* Gets the current Magento version string
* @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
*
@@ -131,6 +147,17 @@ public static function getVersionInfo()
}
/**
+ * Get current Magento edition
+ *
+ * @static
+ * @return string
+ */
+ public static function getEdition()
+ {
+ return self::$_currentEdition;
+ }
+
+ /**
* Set all my static data to defaults
*
*/
@@ -555,8 +582,8 @@ public static function app($code = '', $type = 'store', $options = array())
self::$_app = new Mage_Core_Model_App();
self::setRoot();
self::$_events = new Varien_Event_Collection();
- self::setIsInstalled($options);
- self::setConfigModel($options);
+ self::_setIsInstalled($options);
+ self::_setConfigModel($options);
Magento_Profiler::start('self::app::init');
self::$_app->init($code, $type, $options);
@@ -578,8 +605,8 @@ public static function init($code = '', $type = 'store', $options = array(), $mo
try {
self::setRoot();
self::$_app = new Mage_Core_Model_App();
- self::setIsInstalled($options);
- self::setConfigModel($options);
+ self::_setIsInstalled($options);
+ self::_setConfigModel($options);
if (!empty($modules)) {
self::$_app->initSpecified($code, $type, $options, $modules);
@@ -610,6 +637,9 @@ public static function run($code = '', $type = 'store', $options = array())
try {
Magento_Profiler::start('mage');
self::setRoot();
+ if (isset($options['edition'])) {
+ self::$_currentEdition = $options['edition'];
+ }
self::$_app = new Mage_Core_Model_App();
if (isset($options['request'])) {
self::$_app->setRequest($options['request']);
@@ -618,8 +648,8 @@ public static function run($code = '', $type = 'store', $options = array())
self::$_app->setResponse($options['response']);
}
self::$_events = new Varien_Event_Collection();
- self::setIsInstalled($options);
- self::setConfigModel($options);
+ self::_setIsInstalled($options);
+ self::_setConfigModel($options);
self::$_app->run(array(
'scope_code' => $code,
'scope_type' => $type,
@@ -655,7 +685,7 @@ public static function run($code = '', $type = 'store', $options = array())
*
* @param array $options
*/
- public static function setIsInstalled($options = array())
+ protected static function _setIsInstalled($options = array())
{
if (isset($options['is_installed']) && $options['is_installed']) {
self::$_isInstalled = true;
@@ -667,7 +697,7 @@ public static function setIsInstalled($options = array())
*
* @param array $options
*/
- public static function setConfigModel($options = array())
+ protected static function _setConfigModel($options = array())
{
if (isset($options['config_model']) && Magento_Autoload::getInstance()->classExists($options['config_model'])) {
$alternativeConfigModelName = $options['config_model'];
View
16 app/bootstrap.php
@@ -89,7 +89,15 @@
Magento_Autoload::getInstance()->addFilesMap($classMapPath);
}
-#Magento_Profiler::enable();
-#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Html());
-#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Firebug());
-#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Csvfile(__DIR__ . '/var/log/profiler.csv'));
+if (isset($_SERVER['MAGE_PROFILER'])) {
+ switch ($_SERVER['MAGE_PROFILER']) {
+ case 'firebug':
+ Magento_Profiler::registerOutput(new Magento_Profiler_Output_Firebug());
+ break;
+ case 'csv':
+ Magento_Profiler::registerOutput(new Magento_Profiler_Output_Csvfile(__DIR__ . '/../var/log/profiler.csv'));
+ break;
+ default:
+ Magento_Profiler::registerOutput(new Magento_Profiler_Output_Html());
+ }
+}
View
12 app/code/community/Phoenix/Moneybookers/Block/Redirect.php
@@ -26,11 +26,15 @@
class Phoenix_Moneybookers_Block_Redirect extends Mage_Core_Block_Template
{
/**
- * Constructor. Set template.
+ * Preparing global layout
+ *
+ * You can redefine this method in child classes for changing layout
+ *
+ * @return Mage_Core_Block_Abstract
*/
- protected function _construct()
+ protected function _prepareLayout()
{
- parent::_construct();
- $this->setTemplate('redirect.phtml');
+ $this->setRedirectUrl(Mage::registry(Phoenix_Moneybookers_ProcessingController::REGISTRY_REDIRECT_URL_KEY));
+ return parent::_prepareLayout();
}
}
View
15 app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php
@@ -26,6 +26,13 @@
class Phoenix_Moneybookers_ProcessingController extends Mage_Core_Controller_Front_Action
{
/**
+ * Register key name for redirect url
+ *
+ * @const string
+ */
+ const REGISTRY_REDIRECT_URL_KEY = 'phoenix_moneybookers_redirect_url';
+
+ /**
* Get singleton of Checkout Session Model
*
* @return Mage_Checkout_Model_Session
@@ -141,12 +148,8 @@ public function statusAction()
*/
protected function _redirect($path, $arguments=array())
{
- $this->getResponse()->setBody(
- $this->getLayout()
- ->createBlock('Phoenix_Moneybookers_Block_Redirect')
- ->setRedirectUrl(Mage::getUrl($path, $arguments))
- ->toHtml()
- );
+ Mage::register(self::REGISTRY_REDIRECT_URL_KEY, Mage::getUrl($path, $arguments));
+ $this->loadLayout('moneybookers_processing_redirect')->renderLayout();
return $this;
}
}
View
11 app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml
@@ -27,7 +27,8 @@
-->
<layout version="0.1.0">
- <moneybookers_processing_payment>
+ <moneybookers_processing_payment translate="label" type="page" parent="checkout_onepage_paymentmethod">
+ <label>Moneybookers Payment</label>
<reference name="root">
<action method="setTemplate"><template>1column.phtml</template></action>
</reference>
@@ -36,12 +37,18 @@
</reference>
</moneybookers_processing_payment>
- <moneybookers_processing_placeform>
+ <moneybookers_processing_placeform translate="label" type="page" parent="moneybookers_processing_payment">
+ <label>Moneybookers Place Form</label>
<reference name="root">
<action method="setTemplate"><template>Phoenix_Moneybookers::blank.phtml</template></action>
</reference>
<reference name="content">
<block type="Phoenix_Moneybookers_Block_Placeform" name="moneybookers_placeform" template="placeform.phtml" />
</reference>
</moneybookers_processing_placeform>
+
+ <moneybookers_processing_redirect translate="label" type="page" parent="moneybookers_processing_payment">
+ <label>Moneybookers Redirect</label>
+ <block type="Phoenix_Moneybookers_Block_Redirect" output="1" name="moneybookers_placeform" template="redirect.phtml"/>
+ </moneybookers_processing_redirect>
</layout>
View
97 app/code/core/Mage/Admin/Model/Observer.php
@@ -1,97 +0,0 @@
-<?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_Admin
- * @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)
- */
-
-/**
- * Admin observer model
- *
- * @category Mage
- * @package Mage_Admin
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Admin_Model_Observer
-{
- const FLAG_NO_LOGIN = 'no-login';
- /**
- * Handler for controller_action_predispatch event
- *
- * @param Varien_Event_Observer $observer
- * @return boolean
- */
- public function actionPreDispatchAdmin($observer)
- {
- $session = Mage::getSingleton('Mage_Admin_Model_Session');
- /** @var $session Mage_Admin_Model_Session */
- $request = Mage::app()->getRequest();
- $user = $session->getUser();
-
- $requestedActionName = $request->getActionName();
- $openActions = array(
- 'forgotpassword',
- 'resetpassword',
- 'resetpasswordpost',
- 'logout',
- 'refresh' // captcha refresh
- );
- if (in_array($requestedActionName, $openActions)) {
- $request->setDispatched(true);
- } else {
- if($user) {
- $user->reload();
- }
- if (!$user || !$user->getId()) {
- if ($request->getPost('login')) {
- $postLogin = $request->getPost('login');
- $username = isset($postLogin['username']) ? $postLogin['username'] : '';
- $password = isset($postLogin['password']) ? $postLogin['password'] : '';
- $session->login($username, $password, $request);
- $request->setPost('login', null);
- }
- if (!$request->getParam('forwarded')) {
- if ($request->getParam('isIframe')) {
- $request->setParam('forwarded', true)
- ->setControllerName('index')
- ->setActionName('deniedIframe')
- ->setDispatched(false);
- } elseif($request->getParam('isAjax')) {
- $request->setParam('forwarded', true)
- ->setControllerName('index')
- ->setActionName('deniedJson')
- ->setDispatched(false);
- } else {
- $request->setParam('forwarded', true)
- ->setRouteName('adminhtml')
- ->setControllerName('index')
- ->setActionName('login')
- ->setDispatched(false);
- }
- return false;
- }
- }
- }
-
- $session->refreshAcl();
- }
-}
View
90 app/code/core/Mage/Admin/Model/Session.php
@@ -34,6 +34,7 @@
*/
class Mage_Admin_Model_Session extends Mage_Core_Model_Session_Abstract
{
+ const XML_PATH_SESSION_LIFETIME = 'admin/security/session_lifetime';
/**
* Whether it is the first page after successfull login
@@ -72,52 +73,56 @@ public function init($namespace, $sessionName = null)
}
/**
- * Try to login user in admin
+ * Try to login user in admin. Possible results:
+ * - Mage_Admin_Model_User - user logged in and appropriate model is loaded
+ * - false - user not logged in
*
* @param string $username
* @param string $password
- * @param Mage_Core_Controller_Request_Http $request
- * @return Mage_Admin_Model_User|null
+ * @return Mage_Admin_Model_User|bool
*/
- public function login($username, $password, $request = null)
+ public function login($username, $password)
{
if (empty($username) || empty($password)) {
- return;
+ return false;
}
try {
/** @var $user Mage_Admin_Model_User */
$user = Mage::getModel('Mage_Admin_Model_User');
$user->login($username, $password);
- if ($user->getId()) {
- $this->renewSession();
-
- if (Mage::getSingleton('Mage_Adminhtml_Model_Url')->useSecretKey()) {
- Mage::getSingleton('Mage_Adminhtml_Model_Url')->renewSecretUrls();
- }
- $this->setIsFirstPageAfterLogin(true);
- $this->setUser($user);
- $this->setAcl(Mage::getResourceModel('Mage_Admin_Model_Resource_Acl')->loadAcl());
-
- $requestUri = $this->_getRequestUri($request);
- if ($requestUri) {
- Mage::dispatchEvent('admin_session_user_login_success', array('user' => $user));
- header('Location: ' . $requestUri);
- exit;
- }
- } else {
+ if (!$user->getId()) {
Mage::throwException(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Invalid User Name or Password.'));
}
+
+ $this->renewSession();
+
+ if (Mage::getSingleton('Mage_Adminhtml_Model_Url')->useSecretKey()) {
+ Mage::getSingleton('Mage_Adminhtml_Model_Url')->renewSecretUrls();
+ }
+ $this->setIsFirstPageAfterLogin(true);
+ $this->setUser($user);
+ $this->setAcl(Mage::getResourceModel('Mage_Admin_Model_Resource_Acl')->loadAcl());
+ $this->setUpdatedAt(time());
+
+ Mage::dispatchEvent('admin_session_user_login_success', array('user' => $user));
+
+ return $user;
} catch (Mage_Core_Exception $e) {
Mage::dispatchEvent('admin_session_user_login_failed',
array('user_name' => $username, 'exception' => $e));
- if ($request && !$request->getParam('messageSent')) {
- Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage());
- $request->setParam('messageSent', true);
- }
+ return false;
}
+ }
- return $user;
+ /**
+ * Log out the user from the admin
+ */
+ public function logout()
+ {
+ $this->unsetAll();
+ $this->getCookie()->delete($this->getSessionName());
+ Mage::dispatchEvent('admin_session_user_logout');
}
/**
@@ -184,7 +189,19 @@ public function isAllowed($resource, $privilege = null)
*/
public function isLoggedIn()
{
- return $this->getUser() && $this->getUser()->getId();
+ $lifetime = Mage::getStoreConfig(self::XML_PATH_SESSION_LIFETIME);
+ $currentTime = time();
+
+ /* Validate admin session lifetime that should be more than 60 seconds */
+ if ($lifetime >= 60 && ($this->getUpdatedAt() < $currentTime - $lifetime)) {
+ return false;
+ }
+
+ if ($this->getUser() && $this->getUser()->getId()) {
+ $this->setUpdatedAt($currentTime);
+ return true;
+ }
+ return false;
}
/**
@@ -211,21 +228,4 @@ public function setIsFirstPageAfterLogin($value)
$this->_isFirstPageAfterLogin = (bool)$value;
return $this->setIsFirstVisit($this->_isFirstPageAfterLogin);
}
-
- /**
- * Custom REQUEST_URI logic
- *
- * @param Mage_Core_Controller_Request_Http $request
- * @return string|null
- */
- protected function _getRequestUri($request = null)
- {
- if (Mage::getSingleton('Mage_Adminhtml_Model_Url')->useSecretKey()) {
- return Mage::getSingleton('Mage_Adminhtml_Model_Url')->getUrl('*/*/*', array('_current' => true));
- } elseif ($request) {
- return $request->getRequestUri();
- } else {
- return null;
- }
- }
}
View
2 app/code/core/Mage/Admin/Model/User.php
@@ -61,7 +61,7 @@
class Mage_Admin_Model_User extends Mage_Core_Model_Abstract
{
/**
- * Configuration pathes for email templates and identities
+ * Configuration paths for email templates and identities
*/
const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'admin/emails/forgot_email_template';
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'admin/emails/forgot_email_identity';
View
2 app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php
@@ -54,7 +54,7 @@ protected function _getGridHtml()
protected function _getJsObjectName()
{
- return $this->getChild('userGrid')->getJsObjectName();
+ return $this->getChildBlock('userGrid')->getJsObjectName();
}
}
View
5 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php
@@ -46,6 +46,7 @@ public function getElementHtml()
$this->setData('disabled', 'disabled');
$disabled = true;
}
+ parent::addClass('validate-number validate-number-range number-range-0.01-1000000000');
$html = parent::getElementHtml();
$htmlId = 'use_config_' . $this->getHtmlId();
$html .= '<br/><input id="'.$htmlId.'" name="use_config[]" value="' . $this->getId() . '"';
@@ -57,7 +58,9 @@ public function getElementHtml()
$html .= ' <label for="'.$htmlId.'" class="normal">'
. Mage::helper('Mage_Adminhtml_Helper_Data')->__('Use Config Settings').'</label>';
- $html .= '<script type="text/javascript">toggleValueElements($(\''.$htmlId.'\'), $(\''.$htmlId.'\').parentNode);</script>';
+ $html .= '<script type="text/javascript">'
+ . 'toggleValueElements($(\''.$htmlId.'\'), $(\''.$htmlId.'\').parentNode);'
+ . '</script>';
return $html;
}
View
6 app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php
@@ -48,7 +48,7 @@ public function getAfterElementHtml()
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('WYSIWYG Editor'),
'type' => 'button',
'disabled' => $disabled,
- 'class' => ($disabled) ? 'disabled' : '',
+ 'class' => ($disabled) ? 'disabled btn-wysiwyg' : 'btn-wysiwyg',
'onclick' => 'catalogWysiwygEditor.open(\''
. Mage::helper('Mage_Adminhtml_Helper_Data')->getUrl('*/*/wysiwyg')
. '\', \'' . $this->getHtmlId().'\')'
@@ -65,10 +65,10 @@ public function getAfterElementHtml()
public function getIsWysiwygEnabled()
{
if (Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Cms')) {
- return (bool)(Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->isEnabled() && $this->getEntityAttribute()->getIsWysiwygEnabled());
+ return (bool)(Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->isEnabled()
+ && $this->getEntityAttribute()->getIsWysiwygEnabled());
}
return false;
}
}
-
View
2 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php
@@ -83,6 +83,6 @@ protected function getFormHtml()
protected function getFormId()
{
- return $this->getChild('setForm')->getForm()->getId();
+ return $this->getChildBlock('setForm')->getForm()->getId();
}
}
View
10 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php
@@ -41,16 +41,12 @@ class Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset extends Mage_Core_
*/
protected function _toHtml()
{
- $children = $this->getSortedChildren();
+ $children = $this->getLayout()->getChildBlocks($this->getNameInLayout());
$total = count($children);
$i = 0;
$this->setText('');
- foreach ($children as $name) {
- $block = $this->getLayout()->getBlock($name);
- if (!$block) {
- Mage::throwException(Mage::helper('Mage_Core_Helper_Data')->__('Invalid block: %s', $name));
- }
-
+ /** @var $block Mage_Core_Block_Abstract */
+ foreach ($children as $block) {
$i++;
$block->setIsLastFieldset($i == $total);
View
5 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php
@@ -95,8 +95,11 @@ 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" onclick="toogleFieldEditMode(this, \'' . $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>';
View
10 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php
@@ -145,7 +145,7 @@ public function getAddButtonId()
{
$buttonId = $this->getLayout()
->getBlock('admin.product.options')
- ->getChild('add_button')->getId();
+ ->getChildBlock('add_button')->getId();
return $buttonId;
}
@@ -189,19 +189,19 @@ public function getTemplatesHtml()
{
$canEditPrice = $this->getCanEditPrice();
$canReadPrice = $this->getCanReadPrice();
- $this->getChild('select_option_type')
+ $this->getChildBlock('select_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
- $this->getChild('file_option_type')
+ $this->getChildBlock('file_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
- $this->getChild('date_option_type')
+ $this->getChildBlock('date_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
- $this->getChild('text_option_type')
+ $this->getChildBlock('text_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
View
6 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php
@@ -39,14 +39,14 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract extend
protected function _prepareLayout()
{
$this->setChild('option_price_type',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Html_Select')
+ $this->getLayout()->addBlock('Mage_Adminhtml_Block_Html_Select', '', $this->getNameInLayout())
->setData(array(
'id' => 'product_option_{{option_id}}_price_type',
'class' => 'select product-option-price-type'
))
);
- $this->getChild('option_price_type')->setName('product[options][{{option_id}}][price_type]')
+ $this->getChildBlock('option_price_type')->setName('product[options][{{option_id}}][price_type]')
->setOptions(Mage::getSingleton('Mage_Adminhtml_Model_System_Config_Source_Product_Options_Price')
->toOptionArray());
@@ -61,7 +61,7 @@ protected function _prepareLayout()
public function getPriceTypeSelectHtml()
{
if ($this->getCanEditPrice() === false) {
- $this->getChild('option_price_type')->setExtraParams('disabled="disabled"');
+ $this->getChildBlock('option_price_type')->setExtraParams('disabled="disabled"');
}
return $this->getChildHtml('option_price_type');
}
View
2 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php
@@ -81,7 +81,7 @@ public function getDeleteButtonHtml()
public function getPriceTypeSelectHtml()
{
- $this->getChild('option_price_type')
+ $this->getChildBlock('option_price_type')
->setData('id', 'product_option_{{id}}_select_{{select_id}}_price_type')
->setName('product[options][{{id}}][values][{{select_id}}][price_type]');
View
2 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
@@ -226,7 +226,7 @@ public function getGridHtml()
*/
public function getGridJsObject()
{
- return $this->getChild('grid')->getJsObjectName();
+ return $this->getChildBlock('grid')->getJsObjectName();
}
/**
View
2 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php
@@ -69,7 +69,7 @@ protected function _prepareLayout()
*/
public function getUploader()
{
- return $this->getChild('uploader');
+ return $this->getChildBlock('uploader');
}
/**
View
31 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php
@@ -29,7 +29,9 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_Customer_Edit_Renderer_Region extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
+class Mage_Adminhtml_Block_Customer_Edit_Renderer_Region
+ extends Mage_Adminhtml_Block_Abstract
+ implements Varien_Data_Form_Element_Renderer_Interface
{
/**
* Output the region element and javasctipt that makes it dependent from country element
@@ -50,22 +52,25 @@ public function render(Varien_Data_Form_Element_Abstract $element)
$html = '<tr>';
$element->setClass('input-text');
- $html.= '<td class="label">'.$element->getLabelHtml().'</td><td class="value">';
- $html.= $element->getElementHtml();
+ $element->setRequired(true);
+ $html .= '<td class="label">' . $element->getLabelHtml() . '</td><td class="value">';
+ $html .= $element->getElementHtml();
$selectName = str_replace('region', 'region_id', $element->getName());
- $selectId = $element->getHtmlId().'_id';
- $html.= '<select id="'.$selectId.'" name="'.$selectName.'" class="select required-entry" style="display:none">';
- $html.= '<option value="">'.Mage::helper('Mage_Customer_Helper_Data')->__('Please select').'</option>';
- $html.= '</select>';
+ $selectId = $element->getHtmlId() . '_id';
+ $html .= '<select id="' . $selectId . '" name="' . $selectName
+ . '" class="select required-entry" style="display:none">';
+ $html .= '<option value="">' . Mage::helper('Mage_Customer_Helper_Data')->__('Please select') . '</option>';
+ $html .= '</select>';
- $html.= '<script type="text/javascript">'."\n";
- $html.= 'new regionUpdater("'
- . $country->getHtmlId() . '", "' . $element->getHtmlId() . '", "' . $selectId . '", '
- . $this->helper('Mage_Directory_Helper_Data')->getRegionJson().');'."\n";
- $html.= '</script>'."\n";
+ $html .= '<script type="text/javascript">' . "\n";
+ $html .= '$("' . $selectId . '").setAttribute("defaultValue", "' . $regionId.'");' . "\n";
+ $html .= 'new regionUpdater("' . $country->getHtmlId() . '", "' . $element->getHtmlId()
+ . '", "' . $selectId . '", ' . $this->helper('Mage_Directory_Helper_Data')->getRegionJson() . ');' . "\n";
+ $html .= '</script>' . "\n";
+
+ $html .= '</td></tr>' . "\n";
- $html.= '</td></tr>'."\n";
return $html;
}
}
View
11 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php
@@ -110,6 +110,17 @@ function(v, elem){
. '</script>'
);
}
+ $form->getElement('website_id')->setAfterElementHtml(
+ Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml()
+ );
+
+// if (Mage::app()->isSingleStoreMode()) {
+// $fieldset->removeField('website_id');
+// $fieldset->addField('website_id', 'hidden', array(
+// 'name' => 'website_id'
+// ));
+// $customer->setWebsiteId(Mage::app()->getStore(true)->getWebsiteId());
+// }
$customerStoreId = null;
if ($customer->getId()) {
View
1 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php
@@ -135,6 +135,7 @@ public function initForm()
$this->_setFieldset($attributes, $fieldset);
$regionElement = $form->getElement('region');
+ $regionElement->setRequired(true);
if ($regionElement) {
$regionElement->setRenderer(Mage::getModel('Mage_Adminhtml_Model_Customer_Renderer_Region'));
}
View
6 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php
@@ -78,7 +78,7 @@ public function getCustomerLog()
*/
public function getCreateDate()
{
- return Mage::helper('Mage_Core_Helper_Data')->formatDateRespectTimezone(
+ return Mage::helper('Mage_Core_Helper_Data')->formatDate(
$this->getCustomer()->getCreatedAtTimestamp(),
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM,
true
@@ -110,8 +110,8 @@ public function getLastLoginDate()
{
$date = $this->getCustomerLog()->getLoginAtTimestamp();
if ($date) {
- return Mage::helper('Mage_Core_Helper_Data')->formatDateRespectTimezone(
- Mage::app()->getLocale()->date($date),
+ return Mage::helper('Mage_Core_Helper_Data')->formatDate(
+ $date,
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM,
true
);
View
6 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php
@@ -70,10 +70,8 @@ protected function _prepareLayout()
}
// count wishlist items
- $wishlist = Mage::getModel('Mage_Wishlist_Model_Wishlist');
- $wishlistCount = $wishlist->loadByCustomer($customer)
- ->setSharedStoreIds($wishlist->getSharedStoreIds(false))
- ->getItemCollection()
+ $wishlistCount = Mage::getModel('Mage_Wishlist_Model_Wishlist')->getCollection()
+ ->addCustomerIdFilter($customer->getId())
->addStoreData()
->getSize();
// add wishlist ajax accordion
View
6 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php
@@ -55,10 +55,8 @@ public function __construct()
*/
protected function _prepareCollection()
{
- $wishlist = Mage::getModel('Mage_Wishlist_Model_Wishlist');
- $collection = $wishlist->loadByCustomer(Mage::registry('current_customer'))
- ->setSharedStoreIds($wishlist->getSharedStoreIds(false))
- ->getItemCollection()
+ $collection = Mage::getModel('Mage_Wishlist_Model_Item')->getCollection()
+ ->addCustomerIdFilter(Mage::registry('current_customer')->getId())
->addDaysInWishlist()
->addStoreData()
->setInStockFilter(true);
View
19 app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php
@@ -41,6 +41,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist extends Mage_Adminhtml_Blo
*/
protected $_defaultSort = 'added_at';
+
/**
* Parent template name
*
@@ -63,7 +64,7 @@ public function __construct()
$this->setId('wishlistGrid');
$this->setUseAjax(true);
$this->_parentTemplate = $this->getTemplate();
- $this->setTemplate('customer/tab/wishlist.phtml');
+ $this->setTemplate('Mage_Adminhtml::customer/tab/wishlist.phtml');
$this->setEmptyText(Mage::helper('Mage_Customer_Helper_Data')->__('No Items Found'));
$this->addProductConfigurationHelper('default', 'Mage_Catalog_Helper_Product_Configuration');
}
@@ -79,20 +80,26 @@ protected function _getCustomer()
}
/**
+ * Create customer wishlist item collection
+ *
+ * @return Mage_Wishlist_Model_Resource_Item_Collection
+ */
+ protected function _createCollection()
+ {
+ return Mage::getModel('Mage_Wishlist_Model_Item')->getCollection();
+ }
+
+ /**
* Prepare customer wishlist product collection
*
* @return Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist
*/
protected function _prepareCollection()
{
- $wishlist = Mage::getModel('Mage_Wishlist_Model_Wishlist');
- $collection = $wishlist->loadByCustomer($this->_getCustomer())
- ->setSharedStoreIds($wishlist->getSharedStoreIds(false))
- ->getItemCollection()
+ $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId())
->resetSortOrder()
->addDaysInWishlist()
->addStoreData();
-
$this->setCollection($collection);
return parent::_prepareCollection();
View
2 app/code/core/Mage/Adminhtml/Block/Customer/Online.php
@@ -57,7 +57,7 @@ protected function _prepareLayout()
public function getFilterFormHtml()
{
- return $this->getChild('filterForm')->toHtml();
+ return $this->getChildBlock('filterForm')->toHtml();
}
}
View
15 app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php
@@ -66,17 +66,22 @@ public function getValidateButton()
$validateUrl = Mage::getSingleton('Mage_Adminhtml_Model_Url')
->getUrl('*/customer_system_config_validatevat/validateAdvanced');
+ $groupSuggestionMessage = Mage::helper('Mage_Customer_Helper_Data')->__('The customer is currently assigned to Customer Group %s.')
+ . ' ' . Mage::helper('Mage_Customer_Helper_Data')->__('Would you like to change the Customer Group for this order?');
+
$vatValidateOptions = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array(
'vatElementId' => $vatElementId,
'countryElementId' => $countryElementId,
'groupIdHtmlId' => 'group_id',
'validateUrl' => $validateUrl,
'vatValidMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('The VAT ID is valid. The current Customer Group will be used.'),
- 'vatValidAndGroupChangeMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('Based on the VAT ID, the customer would belong to the Customer Group %s.') . "\n"
- . Mage::helper('Mage_Customer_Helper_Data')->__('The customer is currently assigned to Customer Group %s.') . ' '
- . Mage::helper('Mage_Customer_Helper_Data')->__('Would you like to change the Customer Group for this order?'),
- 'vatInvalidMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('The VAT ID entered (%s) is not a valid VAT ID.'),
- 'vatValidationFailedMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('There was an error validating the VAT ID. Please try again later.'),
+ 'vatValidAndGroupChangeMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('Based on the VAT ID, the customer would belong to the Customer Group %s.')
+ . "\n" . $groupSuggestionMessage,
+ 'vatInvalidMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('The VAT ID entered (%s) is not a valid VAT ID. The customer would belong to Customer Group %s.')
+ . "\n" . $groupSuggestionMessage,
+ 'vatValidationFailedMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('There was an error validating the VAT ID. The customer would belong to Customer Group %s.')
+ . "\n" . $groupSuggestionMessage,
+ 'vatErrorMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('There was an error validating the VAT ID.')
));
$optionsVarName = $this->getJsVariablePrefix() . 'VatParameters';
View
23 app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
@@ -212,10 +212,6 @@ public function getChartUrl($directUrl = true)
while($dateStart->compare($dateEnd) < 0){
switch ($this->getDataHelper()->getParam('period')) {
- case '24h':
- $d = $dateStart->toString('yyyy-MM-dd HH:00');
- $dateStart->addHour(1);
- break;
case '7d':
case '1m':
$d = $dateStart->toString('yyyy-MM-dd');
@@ -226,6 +222,9 @@ public function getChartUrl($directUrl = true)
$d = $dateStart->toString('yyyy-MM');
$dateStart->addMonth(1);
break;
+ default:
+ $d = $dateStart->toString('yyyy-MM-dd HH:00');
+ $dateStart->addHour(1);
}
foreach ($this->getAllSeries() as $index=>$serie) {
if (in_array($d, $this->_axisLabels['x'])) {
@@ -280,22 +279,15 @@ public function getChartUrl($directUrl = true)
}
// process each string in the array, and find the max length
+ $localmaxvalue = array(0);
+ $localminvalue = array(0);
foreach ($this->getAllSeries() as $index => $serie) {
- $localmaxlength[$index] = sizeof($serie);
$localmaxvalue[$index] = max($serie);
$localminvalue[$index] = min($serie);
}
- if (is_numeric($this->_max)) {
- $maxvalue = $this->_max;
- } else {
- $maxvalue = max($localmaxvalue);
- }
- if (is_numeric($this->_min)) {
- $minvalue = $this->_min;
- } else {
- $minvalue = min($localminvalue);
- }
+ $maxvalue = max($localmaxvalue);
+ $minvalue = min($localminvalue);
// default values
$yrange = 0;
@@ -304,7 +296,6 @@ public function getChartUrl($directUrl = true)
$maxy = 0;
$yorigin = 0;
- $maxlength = max($localmaxlength);
if ($minvalue >= 0 && $maxvalue >= 0) {
$miny = 0;
if ($maxvalue > 10) {
View
2 app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php
@@ -85,7 +85,7 @@ public function getQueueCollection()
public function getShowQueueAdd()
{
- return $this->getChild('grid')->getShowQueueAdd();
+ return $this->getChildBlock('grid')->getShowQueueAdd();
}
/**
View
2 app/code/core/Mage/Adminhtml/Block/Notification/Security.php
@@ -54,7 +54,7 @@ private function _canShowNotification()
if ($this->_isFileAccessible()) {
return true;
}
- $adminSessionLifetime = (int)Mage::getStoreConfig('admin/security/session_cookie_lifetime');
+ $adminSessionLifetime = (int)Mage::getStoreConfig('admin/security/session_lifetime');
Mage::app()->saveCache(true, self::VERIFICATION_RESULT_CACHE_KEY, array(), $adminSessionLifetime);
return false;
}
View
18 app/code/core/Mage/Adminhtml/Block/Notification/Window.php
@@ -53,17 +53,17 @@ protected function _construct()
{
parent::_construct();
- $this->setHeaderText(addslashes($this->__('Incoming Message')));
- $this->setCloseText(addslashes($this->__('close')));
- $this->setReadDetailsText(addslashes($this->__('Read details')));
- $this->setNoticeText(addslashes($this->__('NOTICE')));
- $this->setMinorText(addslashes($this->__('MINOR')));
- $this->setMajorText(addslashes($this->__('MAJOR')));
- $this->setCriticalText(addslashes($this->__('CRITICAL')));
+ $this->setHeaderText($this->escapeHtml($this->__('Incoming Message')));
+ $this->setCloseText($this->escapeHtml($this->__('close')));
+ $this->setReadDetailsText($this->escapeHtml($this->__('Read details')));
+ $this->setNoticeText($this->escapeHtml($this->__('NOTICE')));
+ $this->setMinorText($this->escapeHtml($this->__('MINOR')));
+ $this->setMajorText($this->escapeHtml($this->__('MAJOR')));
+ $this->setCriticalText($this->escapeHtml($this->__('CRITICAL')));
- $this->setNoticeMessageText(addslashes($this->getLastNotice()->getTitle()));
- $this->setNoticeMessageUrl(addslashes($this->getLastNotice()->getUrl()));
+ $this->setNoticeMessageText($this->escapeHtml($this->getLastNotice()->getTitle()));
+ $this->setNoticeMessageUrl($this->escapeUrl($this->getLastNotice()->getUrl()));
switch ($this->getLastNotice()->getSeverity()) {
default:
View
66 app/code/core/Mage/Adminhtml/Block/Page/Menu.php
@@ -89,16 +89,6 @@ public function getCacheKeyInfo()
}
/**
- * Retrieve Adminhtml Menu array
- *
- * @return array
- */
- public function getMenuArray()
- {
- return $this->_buildMenuArray();
- }
-
- /**
* Retrieve Title value for menu node
*
* @param Varien_Simplexml_Element $child
@@ -259,7 +249,7 @@ protected function _checkAcl($resource)
*/
protected function _afterToHtml($html)
{
- $html = preg_replace_callback('#'.Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME.'/\$([^\/].*)/([^\$].*)\$#', array($this, '_callbackSecretKey'), $html);
+ $html = preg_replace_callback('#'.Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME.'/\$([^\/].*)/([^\$].*)\$#U', array($this, '_callbackSecretKey'), $html);
return $html;
}
@@ -275,4 +265,58 @@ protected function _callbackSecretKey($match)
return Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME . '/'
. $this->_url->getSecretKey($match[1], $match[2]);
}
+
+ /**
+ * Render HTML menu recursively starting from the specified level
+ *
+ * @param array $menu
+ * @param int $level
+ * @return string
+ */
+ protected function _renderMenuLevel(array $menu, $level = 0)
+ {
+ $result = '<ul' . (!$level ? ' id="nav"' : '') . '>';
+ foreach ($menu as $item) {
+ $hasChildren = !empty($item['children']);
+ $cssClasses = array('level' . $level);
+ if (!$level && !empty($item['active'])) {
+ $cssClasses[] = 'active';
+ }
+ if ($hasChildren) {
+ $cssClasses[] = 'parent';
+ }
+ if (!empty($level) && !empty($item['last'])) {
+ $cssClasses[] = 'last';
+ }
+ $result .= '<li'
+ . ($hasChildren ? ' onmouseover="Element.addClassName(this,\'over\')"' : '')
+ . ($hasChildren ? ' onmouseout="Element.removeClassName(this,\'over\')"' : '')
+ . ' class="' . implode(' ', $cssClasses) . '">'
+ . '<a'
+ . ' href="' . $item['url'] . '"'
+ . (!empty($item['title']) ? ' title="' . $item['title'] . '"' : '')
+ . (!empty($item['click']) ? ' onclick="' . $item['click'] . '"' : '')
+ . ($level === 0 && !empty($item['active']) ? ' class="active"' : '')
+ . '>'
+ . '<span>' . Mage::helper('Mage_Adminhtml_Helper_Data')->escapeHtml($item['label']) . '</span>'
+ . '</a>'
+ ;
+ if ($hasChildren) {
+ $result .= $this->_renderMenuLevel($item['children'], $level + 1);
+ }
+ $result .= '</li>';
+ }
+ $result .= '</ul>';
+ return $result;
+ }
+
+ /**
+ * Render HTML menu
+ *
+ * @return string
+ */
+ public function renderMenu()
+ {
+ return $this->_renderMenuLevel($this->_buildMenuArray());
+ }
}
View
2 app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php
@@ -50,6 +50,6 @@ public function getAddNewUrl()
*/
public function getGridHtml()
{
- return $this->getChild('grid')->toHtml();
+ return $this->getChildBlock('grid')->toHtml();
}
}
View
2 app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php
@@ -54,7 +54,7 @@ protected function _getGridHtml()
protected function _getJsObjectName()
{
- return $this->getChild('userGrid')->getJsObjectName();
+ return $this->getChildBlock('userGrid')->getJsObjectName();
}
}
View
3 app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php
@@ -135,7 +135,8 @@ protected function _prepareForm()
'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'),
'title' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'),
'required' => true,
- 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteValuesForForm()
+ 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteValuesForForm(),
+ 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml()
));
}
View
4 app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php
@@ -108,8 +108,8 @@ protected function _prepareColumns()
'index' => 'is_active',
'type' => 'options',
'options' => array(
- 1 => 'Active',
-