From b7189ddc138b27aa57aca7c25f2bda81ef707a5e Mon Sep 17 00:00:00 2001 From: mage2-team <mage2-team@magento.com> Date: Fri, 15 Nov 2013 09:09:45 -0800 Subject: [PATCH] 2.0.0.0-dev52 * Better Navigation menu rendering due to improved Caching of Categories * Added Magento\Filesystem\Directory and Magento\Filesystem\File to the library * Various improvements: * Added a static test to check for incorrect dependencies in the library * Moved Magento\Core\Model\Theme to the Magento\View component * Moved Magento\Core\Model\Design to the Magento\View component * Consistent declaration of page-types * The Framework part of the Cache functionality moved out from modules * Themes update: * Updated templates and layout updates in the Captcha, Customer, Newsletter, Persistent, ProductAlert, Wishlist modules; old files moved to the "magento-backup" theme * Refactored and removed duplicate Persistent module templates * Plushe theme made responsive * Fixed bugs: * Fixed inability to print order, invoice, or creditmemo in the frontend * Fixed fatal error caused by the Mage_Backend_Block_System_Config_FormTest integration test * Fixed the broken link when the MAP feature is enabled and actual product price is set to be displayed in the shopping cart * Moved the following methods from Core Helpers to the appropriate libraries: * Moved the Data Helper date format related functions to \Magento\Core\Model\Locale * Moved the Data Helper array decoration related functions to Magento\Stdlib\ArrayUtils * Moved the Data Helper functions that copy data from one object to another to \Magento\Object\Copy --- CHANGELOG.md | 23 + .../Model/System/Message/CacheOutdated.php | 6 +- .../Adminhtml/Block/Media/Uploader.php | 6 +- app/code/Magento/Adminhtml/etc/di.xml | 2 +- app/code/Magento/Adminhtml/i18n/de_DE.csv | 10 - app/code/Magento/Adminhtml/i18n/en_US.csv | 10 - app/code/Magento/Adminhtml/i18n/es_ES.csv | 10 - app/code/Magento/Adminhtml/i18n/fr_FR.csv | 10 - app/code/Magento/Adminhtml/i18n/nl_NL.csv | 10 - app/code/Magento/Adminhtml/i18n/pt_BR.csv | 10 - .../Authorizenet/etc/frontend/page_types.xml | 29 + ...thorizenet_directpost_payment_redirect.xml | 2 +- ...thorizenet_directpost_payment_response.xml | 2 +- .../Block/Cache/Grid/Column/Statuses.php | 6 +- app/code/Magento/Backend/Block/Context.php | 12 +- .../Searches/Renderer/Searchquery.php | 16 +- .../Backend/Block/Template/Context.php | 21 +- .../Backend/Controller/Adminhtml/Cache.php | 18 +- .../Magento/Backend/Controller/Context.php | 4 +- .../Magento/Backend/Helper/Dashboard/Data.php | 6 - .../Backend/Helper/Dashboard/Order.php | 6 - .../Model/Cache/Resource/Grid/Collection.php | 6 +- .../Backend/Model/Config/Backend/Baseurl.php | 2 +- .../Model/Config/Backend/Image/Adapter.php | 6 +- .../Model/Config/Backend/Translate.php | 6 +- .../Model/Config/Source/Image/Adapter.php | 26 +- .../Model/Config/Structure/Element/Field.php | 6 +- .../Magento/Backend/Model/Email/Template.php | 8 +- app/code/Magento/Backend/Model/Locale.php | 3 + .../Magento/Backend/Model/Menu/Config.php | 6 +- .../Magento/Backend/etc/adminhtml/system.xml | 2 +- app/code/Magento/Backend/etc/di.xml | 2 +- app/code/Magento/Backup/Helper/Data.php | 12 +- .../Catalog/Product/View/Type/Bundle.php | 18 +- .../composite/fieldset/options/bundle.phtml | 2 +- .../product/view/type/bundle/options.phtml | 4 +- .../catalog_product_view_type_bundle.xml | 2 +- .../checkout_cart_configure_type_bundle.xml | 2 +- .../Magento/Captcha/view/frontend/captcha.js | 2 +- .../Captcha/view/frontend/default.phtml | 53 +- .../layout/checkout_onepage_index.xml | 90 +- .../frontend/layout/contacts_index_index.xml | 2 +- .../layout/customer_account_create.xml | 28 +- .../customer_account_forgotpassword.xml | 28 +- .../layout/customer_account_login.xml | 28 +- .../Block/Adminhtml/Helper/Form/Wysiwyg.php | 6 +- .../Product/Composite/Fieldset/Grouped.php | 20 +- .../Product/Helper/Form/BaseImage.php | 6 +- .../Catalog/Block/Product/AbstractProduct.php | 20 + .../Block/Product/Compare/AbstractCompare.php | 21 +- .../Block/Product/Compare/ListCompare.php | 38 +- .../Catalog/Block/Product/ListProduct.php | 25 +- .../Catalog/Block/Product/NewProduct.php | 31 +- .../Block/Product/ProductList/Promotion.php | 35 +- .../Block/Product/ProductList/Random.php | 35 +- .../Block/Product/ProductList/Related.php | 30 +- .../Block/Product/ProductList/Upsell.php | 29 +- .../Magento/Catalog/Block/Product/Send.php | 21 +- .../Magento/Catalog/Block/Product/View.php | 15 +- .../Block/Product/View/AbstractView.php | 57 +- .../Catalog/Block/Product/View/Options.php | 23 +- .../Block/Product/View/Type/Configurable.php | 28 +- .../Controller/Adminhtml/Product/Gallery.php | 3 +- app/code/Magento/Catalog/Helper/Image.php | 6 +- app/code/Magento/Catalog/Helper/Product.php | 6 +- app/code/Magento/Catalog/Model/Config.php | 6 +- .../Attribute/Source/Countryofmanufacture.php | 6 +- .../Magento/Catalog/Model/Product/Image.php | 18 +- .../Magento/Catalog/Model/Template/Filter.php | 6 +- app/code/Magento/Catalog/etc/adminhtml/di.xml | 2 +- app/code/Magento/Catalog/etc/frontend/di.xml | 5 + .../Catalog/etc/frontend/page_types.xml | 31 + .../composite/fieldset/configurable.phtml | 2 +- .../product/composite/fieldset/options.phtml | 2 +- .../frontend/layout/catalog_category_view.xml | 2 +- .../catalog_category_view_type_default.xml | 2 +- ...ory_view_type_default_without_children.xml | 2 +- .../catalog_category_view_type_layered.xml | 2 +- ...ory_view_type_layered_without_children.xml | 2 +- .../layout/catalog_product_compare_index.xml | 2 +- .../layout/catalog_product_gallery.xml | 2 +- .../frontend/layout/catalog_product_view.xml | 2 +- ...catalog_product_view_type_configurable.xml | 2 +- .../catalog_product_view_type_grouped.xml | 2 +- .../catalog_product_view_type_simple.xml | 2 +- .../catalog_product_view_type_virtual.xml | 2 +- .../view/frontend/product/price_msrp.phtml | 10 +- .../frontend/product/price_msrp_noform.phtml | 10 +- .../view/frontend/product/view/options.phtml | 2 +- .../frontend/product/view/tierprices.phtml | 4 +- .../view/type/options/configurable.phtml | 3 +- app/code/Magento/CatalogRule/Model/Rule.php | 6 +- .../Model/Rule/Action/Collection.php | 4 +- .../CatalogSearch/etc/frontend/page_types.xml | 32 + .../layout/catalogsearch_advanced_index.xml | 2 +- .../layout/catalogsearch_advanced_result.xml | 2 +- .../layout/catalogsearch_ajax_suggest.xml | 2 +- .../layout/catalogsearch_result_index.xml | 2 +- .../layout/catalogsearch_term_popular.xml | 2 +- .../Magento/Checkout/Block/Cart/Crosssell.php | 15 +- app/code/Magento/Checkout/Block/Cart/Link.php | 6 +- app/code/Magento/Checkout/Block/Link.php | 6 +- .../Block/Onepage/AbstractOnepage.php | 6 +- .../Checkout/Block/Onepage/Billing.php | 4 +- .../Magento/Checkout/Block/Onepage/Login.php | 4 +- .../Checkout/Block/Onepage/Shipping.php | 4 +- .../Onepage/Shipping/Method/Available.php | 4 +- .../Magento/Checkout/Model/Type/Onepage.php | 24 +- app/code/Magento/Checkout/etc/fieldset.xml | 4 +- .../Checkout/etc/frontend/page_types.xml | 50 + .../layout/checkout_cart_configure.xml | 2 +- ...ckout_cart_configure_type_configurable.xml | 2 +- .../checkout_cart_configure_type_simple.xml | 2 +- .../frontend/layout/checkout_cart_index.xml | 2 +- .../layout/checkout_multishipping.xml | 2 +- ...kout_multishipping_address_editaddress.xml | 2 +- ...kout_multishipping_address_editbilling.xml | 2 +- ...out_multishipping_address_editshipping.xml | 2 +- ...ckout_multishipping_address_newbilling.xml | 2 +- ...kout_multishipping_address_newshipping.xml | 2 +- .../checkout_multishipping_address_select.xml | 2 +- ...ut_multishipping_address_selectbilling.xml | 2 +- .../checkout_multishipping_addresses.xml | 2 +- .../layout/checkout_multishipping_billing.xml | 2 +- ...heckout_multishipping_customer_address.xml | 2 +- .../layout/checkout_multishipping_login.xml | 2 +- .../checkout_multishipping_overview.xml | 2 +- .../checkout_multishipping_register.xml | 2 +- .../checkout_multishipping_shipping.xml | 2 +- .../layout/checkout_multishipping_success.xml | 2 +- .../layout/checkout_onepage_failure.xml | 2 +- .../layout/checkout_onepage_index.xml | 2 +- .../layout/checkout_onepage_paymentmethod.xml | 2 +- .../layout/checkout_onepage_review.xml | 2 +- .../checkout_onepage_shippingmethod.xml | 2 +- .../layout/checkout_onepage_success.xml | 2 +- .../Wysiwyg/Images/Content/Uploader.php | 4 +- .../Cms/Controller/Adminhtml/Wysiwyg.php | 3 +- .../Controller/Adminhtml/Wysiwyg/Images.php | 3 +- app/code/Magento/Cms/Model/Wysiwyg/Config.php | 6 +- .../Cms/Model/Wysiwyg/Images/Storage.php | 12 +- .../Magento/Cms/etc/frontend/page_types.xml | 33 + .../layout/cms_index_defaultindex.xml | 2 +- .../layout/cms_index_defaultnoroute.xml | 2 +- .../view/frontend/layout/cms_index_index.xml | 2 +- .../frontend/layout/cms_index_nocookies.xml | 2 +- .../frontend/layout/cms_index_noroute.xml | 2 +- .../view/frontend/layout/cms_page_view.xml | 2 +- app/code/Magento/Connect/Helper/Data.php | 6 - .../etc/frontend/page_types.xml} | 6 +- .../Magento/Contacts/view/frontend/form.phtml | 2 +- .../frontend/layout/contacts_index_index.xml | 2 +- app/code/Magento/Core/Block/AbstractBlock.php | 18 +- app/code/Magento/Core/Block/Context.php | 32 +- app/code/Magento/Core/Block/Template.php | 2 +- .../Magento/Core/Block/Template/Context.php | 26 +- .../Magento/Core/Controller/Varien/Action.php | 10 +- .../Core/Controller/Varien/Action/Context.php | 22 +- .../Magento/Core/Helper/AbstractHelper.php | 6 +- app/code/Magento/Core/Helper/Context.php | 32 +- app/code/Magento/Core/Helper/Data.php | 265 +- app/code/Magento/Core/Helper/Js.php | 6 +- app/code/Magento/Core/Helper/Theme.php | 8 +- app/code/Magento/Core/Model/Acl/Cache.php | 6 +- app/code/Magento/Core/Model/App.php | 4 +- app/code/Magento/Core/Model/Config/Cache.php | 6 +- .../Magento/Core/Model/Config/Initial.php | 4 +- app/code/Magento/Core/Model/Date.php | 27 +- .../Magento/Core/Model/Email/Template.php | 12 +- .../Core/Model/Email/Template/Filter.php | 6 +- .../Core/Model/Image/Adapter/Config.php | 59 + .../Core/Model/Image/AdapterFactory.php | 140 - app/code/Magento/Core/Model/Layout.php | 14 +- app/code/Magento/Core/Model/Layout/Merge.php | 23 +- .../Core/Model/Layout/PageType/Config.php | 80 + .../Layout/PageType/Config/Converter.php | 52 + .../Model/Layout/PageType/Config/Reader.php | 38 + .../Layout/PageType/Config/SchemaLocator.php | 64 + app/code/Magento/Core/Model/Locale.php | 96 + .../Magento/Core/Model/LocaleInterface.php | 31 + .../Core/Model/Module/Output/Config.php | 64 + app/code/Magento/Core/Model/Observer.php | 8 +- .../Core/Model/Page/Asset/MergeService.php | 4 +- .../Model/Page/Asset/MergeStrategy/Direct.php | 14 +- .../Core/Model/Page/Asset/Minified.php | 6 +- .../Core/Model/Page/Asset/PublicFile.php | 6 +- .../Core/Model/Page/Asset/ViewFile.php | 6 +- .../Magento/Core/Model/Resource/Cache.php | 2 +- .../Core/Model/Resource/Theme/Collection.php | 13 +- .../Model/Resource/Theme/File/Collection.php | 1 + app/code/Magento/Core/Model/Store.php | 6 +- .../TemplateEngine/Decorator/DebugHints.php | 6 +- app/code/Magento/Core/Model/Theme.php | 67 +- .../Magento/Core/Model/Theme/Collection.php | 12 +- .../Magento/Core/Model/Theme/CopyService.php | 12 +- .../Core/Model/Theme/Customization/Config.php | 66 + .../Core/Model/Theme/Domain/Physical.php | 8 +- .../Core/Model/Theme/Domain/Staging.php | 2 +- .../Core/Model/Theme/Domain/Virtual.php | 12 +- app/code/Magento/Core/Model/Theme/File.php | 23 +- .../Magento/Core/Model/Theme/FileProvider.php | 55 + .../Magento/Core/Model/Theme/Image/Path.php | 41 +- .../Magento/Core/Model/Theme/Observer.php | 10 +- .../Magento/Core/Model/Theme/Registration.php | 22 +- .../Core/Model/Theme/ThemeProvider.php | 83 + app/code/Magento/Core/Model/Translate.php | 14 +- .../Magento/Core/Model/Variable/Config.php | 6 +- app/code/Magento/Core/Model/View/Design.php | 10 +- .../Factory.php => View/Url/Config.php} | 28 +- .../data-upgrade-1.6.0.10-1.6.0.11.php | 4 +- app/code/Magento/Core/etc/cache.xml | 10 +- app/code/Magento/Core/etc/config.xml | 118 +- app/code/Magento/Core/etc/di.xml | 90 +- app/code/Magento/Core/etc/layouts.xsd | 8 + app/code/Magento/Core/etc/page_types.xsd | 56 + .../Magento/CurrencySymbol/Helper/Data.php | 6 - .../Model/System/Currencysymbol.php | 12 +- .../Magento/Customer/Block/Address/Edit.php | 4 +- .../Block/Adminhtml/Edit/Tab/View.php | 6 +- .../Block/Adminhtml/Form/Element/File.php | 6 +- .../Magento/Customer/Block/Form/Register.php | 4 +- app/code/Magento/Customer/Helper/Address.php | 6 +- .../Model/Resource/Customer/Collection.php | 6 +- app/code/Magento/Customer/etc/fieldset.xml | 2 +- .../Customer/etc/frontend/page_types.xml | 37 + .../frontend/account/dashboard/address.phtml | 43 +- .../frontend/account/dashboard/hello.phtml | 9 +- .../frontend/account/dashboard/info.phtml | 54 +- .../view/frontend/account/link/back.phtml | 5 +- .../view/frontend/account/navigation.phtml | 17 +- .../Customer/view/frontend/address/book.phtml | 99 +- .../view/frontend}/address/button.phtml | 32 +- .../Customer/view/frontend/address/edit.phtml | 221 +- .../view/frontend/form/confirmation.phtml | 39 +- .../Customer/view/frontend/form/edit.phtml | 124 +- .../view/frontend/form/forgotpassword.phtml | 41 +- .../Customer/view/frontend/form/login.phtml | 74 +- .../view/frontend/form/newsletter.phtml | 32 +- .../view/frontend/form/register.phtml | 361 +- .../form/resetforgottenpassword.phtml | 46 +- .../view/frontend/layout/customer_account.xml | 11 +- .../layout/customer_account_confirmation.xml | 10 +- .../layout/customer_account_create.xml | 3 +- .../customer_account_createpassword.xml | 2 +- .../frontend/layout/customer_account_edit.xml | 10 +- .../customer_account_forgotpassword.xml | 6 +- .../layout/customer_account_index.xml | 21 +- .../layout/customer_account_login.xml | 10 +- .../layout/customer_account_logoutsuccess.xml | 7 +- .../frontend/layout/customer_address_form.xml | 4 +- .../layout/customer_address_index.xml | 7 +- .../Customer/view/frontend/logout.phtml | 6 +- .../Customer/view/frontend}/newcustomer.phtml | 55 +- .../Customer/view/frontend/widget/dob.phtml | 56 +- .../view/frontend/widget/gender.phtml | 21 +- .../Customer/view/frontend/widget/name.phtml | 156 +- .../view/frontend/widget/taxvat.phtml | 9 +- .../Adminhtml/Editor/Toolbar/Buttons/Save.php | 6 +- .../Adminhtml/Editor/Tools/Code/Custom.php | 2 +- .../Block/Adminhtml/Editor/Tools/Code/Js.php | 2 +- .../Adminhtml/System/Design/Editor.php | 16 +- .../Adminhtml/System/Design/Editor/Tools.php | 8 +- .../Model/Editor/Tools/Controls/Factory.php | 6 +- .../Magento/DesignEditor/Model/Observer.php | 2 +- app/code/Magento/DesignEditor/Model/State.php | 6 +- .../DesignEditor/Model/Theme/Context.php | 4 +- .../Customization/File/QuickStyleCss.php | 6 +- app/code/Magento/Directory/Block/Data.php | 6 +- app/code/Magento/Directory/Helper/Data.php | 6 +- .../Block/Catalog/Product/Links.php | 21 +- .../Block/Catalog/Product/Samples.php | 26 - .../Magento/Downloadable/Model/Observer.php | 16 +- .../Magento/Downloadable/etc/fieldset.xml | 2 +- .../etc/frontend/page_types.xml} | 10 +- ...catalog_product_view_type_downloadable.xml | 2 +- ...ckout_cart_configure_type_downloadable.xml | 2 +- .../layout/downloadable_customer_products.xml | 2 +- app/code/Magento/Eav/Model/Cache/Type.php | 4 +- app/code/Magento/Eav/Model/Config.php | 4 +- .../Magento/GiftMessage/Helper/Message.php | 6 - .../etc/frontend/page_types.xml | 28 + .../googlecheckout_redirect_redirect.xml | 2 +- app/code/Magento/ImportExport/Helper/Data.php | 6 - .../Magento/ImportExport/Model/Import.php | 8 +- .../ImportExport/Model/Import/Uploader.php | 6 +- .../Magento/Install/Controller/Action.php | 8 +- app/code/Magento/Install/Controller/Index.php | 2 +- .../Magento/Install/Controller/Wizard.php | 3 +- app/code/Magento/Install/Model/Installer.php | 12 +- .../Block/Adminhtml/Integration/Edit.php | 156 +- .../Adminhtml/Integration/Edit/Tab/Info.php | 358 +- .../Block/Adminhtml/Integration/Edit/Tabs.php | 52 +- .../Controller/Token.php | 33 +- .../Integration/Helper/Oauth/Consumer.php | 144 + .../Magento/Integration/Helper/Oauth/Data.php | 125 + .../Magento/Integration/Model/Integration.php | 190 +- .../Model/Integration/Source/Status.php | 66 +- .../Model/Oauth}/Consumer.php | 109 +- .../Model/Oauth}/Consumer/Factory.php | 7 +- .../Oauth}/Consumer/Validator/KeyLength.php | 11 +- .../Model/Oauth}/Nonce.php | 41 +- .../Model/Oauth}/Nonce/Factory.php | 6 +- .../Model/Oauth/Nonce/Generator.php | 118 + .../Model/Oauth}/Token.php | 160 +- .../Model/Oauth}/Token/Factory.php | 6 +- .../Model/Oauth/Token/Provider.php | 297 ++ .../Model/Resource/Integration.php | 54 +- .../Model/Resource/Oauth}/Consumer.php | 17 +- .../Resource/Oauth}/Consumer/Collection.php | 4 +- .../Model/Resource/Oauth}/Nonce.php | 9 +- .../Resource/Oauth}/Nonce/Collection.php | 4 +- .../Model/Resource/Oauth}/Token.php | 19 +- .../Resource/Oauth}/Token/Collection.php | 28 +- .../etc/adminhtml/system.xml | 2 +- .../{Oauth => Integration}/etc/config.xml | 2 - app/code/Magento/Integration/etc/di.xml | 13 + .../etc/frontend/routes.xml | 4 +- app/code/Magento/Integration/etc/module.xml | 1 + .../{Oauth => Integration}/i18n/de_DE.csv | 0 .../{Oauth => Integration}/i18n/en_US.csv | 0 .../{Oauth => Integration}/i18n/es_ES.csv | 0 .../{Oauth => Integration}/i18n/fr_FR.csv | 0 .../{Oauth => Integration}/i18n/nl_NL.csv | 0 .../{Oauth => Integration}/i18n/pt_BR.csv | 0 .../{Oauth => Integration}/i18n/zh_CN.csv | 0 .../sql/integration_setup/install-1.0.0.0.php | 179 +- .../Newsletter/etc/frontend/page_types.xml | 28 + .../view/frontend/layout/default.xml | 4 +- .../layout/newsletter_manage_index.xml | 6 +- .../Newsletter/view/frontend/subscribe.phtml | 72 +- .../Oauth/Block/Adminhtml/Oauth/Consumer.php | 49 - .../Block/Adminhtml/Oauth/Consumer/Edit.php | 103 - .../Adminhtml/Oauth/Consumer/Edit/Form.php | 121 - .../Block/Adminhtml/Oauth/Consumer/Grid.php | 146 - .../Block/Authorize/AbstractAuthorize.php | 113 - .../Oauth/Block/Customer/Token/ListToken.php | 196 - .../Controller/Adminhtml/Oauth/Consumer.php | 353 -- app/code/Magento/Oauth/Service/OauthV1.php | 626 --- app/code/Magento/Oauth/etc/schema/OauthV1.xsd | 687 ---- .../Oauth/sql/oauth_setup/install-1.0.0.0.php | 198 - .../oauth_setup/upgrade-1.0.0.0-1.0.0.1.php | 88 - .../Magento/Ogone/etc/frontend/page_types.xml | 29 + .../frontend/layout/ogone_api_paypage.xml | 2 +- .../frontend/layout/ogone_api_placeform.xml | 2 +- app/code/Magento/Page/Block/Html/Head.php | 4 +- app/code/Magento/Page/Block/Html/Head/Css.php | 2 +- .../Magento/Page/Block/Html/Head/Script.php | 2 +- app/code/Magento/Page/Block/Html/Topmenu.php | 10 - .../Magento/Page/view/frontend/1column.phtml | 2 +- .../Page/view/frontend/2columns-left.phtml | 2 +- .../Page/view/frontend/2columns-right.phtml | 2 +- .../Magento/Page/view/frontend/3columns.phtml | 2 +- .../Magento/Page/view/frontend/empty.phtml | 2 +- .../Page/view/frontend/js/splitbutton.js | 74 + .../Magento/Page/view/frontend/js/truncate.js | 2 +- .../Page/view/frontend/layout/default.xml | 4 +- .../Page/view/frontend/layout/page_empty.xml | 2 +- .../view/frontend/layout/page_one_column.xml | 2 +- .../frontend/layout/page_three_columns.xml | 2 +- .../frontend/layout/page_two_columns_left.xml | 2 +- .../layout/page_two_columns_right.xml | 2 +- .../Page/view/frontend/layout/print.xml | 2 +- .../Magento/Page/view/frontend/page.phtml | 2 +- .../Magento/Page/view/frontend/popup.phtml | 2 +- .../Adminhtml/Settlement/Details/Form.php | 5 +- .../Magento/Paypal/Model/Express/Checkout.php | 28 +- .../Paypal/etc/frontend/page_types.xml | 35 + .../frontend/layout/paypal_express_review.xml | 2 +- .../layout/paypal_hostedpro_cancel.xml | 2 +- .../layout/paypal_payflow_cancelpayment.xml | 2 +- .../frontend/layout/paypal_payflow_form.xml | 2 +- .../layout/paypal_payflow_returnurl.xml | 2 +- .../paypal_payflowadvanced_cancelpayment.xml | 2 +- .../layout/paypal_payflowadvanced_form.xml | 2 +- .../paypal_payflowadvanced_returnurl.xml | 2 +- .../PaypalUk/etc/frontend/page_types.xml | 28 + .../layout/paypaluk_express_review.xml | 2 +- .../Persistent/Block/Form/Remember.php | 21 + app/code/Magento/Persistent/Helper/Data.php | 9 +- .../Magento/Persistent/Helper/Session.php | 6 - app/code/Magento/Persistent/etc/module.xml | 1 - .../layout/checkout_onepage_index.xml | 21 +- .../layout/customer_account_create.xml | 11 +- .../layout/customer_account_login.xml | 11 +- .../view/frontend/remember-me-popup.js | 19 +- .../view/frontend/remember_me.phtml | 17 +- .../view/frontend/remember_me_tooltip.phtml | 18 +- .../view/frontend/email/price.phtml | 15 +- .../view/frontend/email/stock.phtml | 15 +- .../frontend/layout/catalog_product_view.xml | 4 +- .../view/frontend/product/view.phtml | 9 +- .../Reports/Block/Product/AbstractProduct.php | 17 +- .../Model/Resource/Customer/Collection.php | 4 +- .../Magento/Review/Block/Customer/View.php | 26 +- .../Magento/Review/Block/Product/View.php | 19 +- app/code/Magento/Review/Block/View.php | 21 +- .../Review/etc/frontend/page_types.xml | 31 + .../layout/customer_account_index.xml | 4 +- .../frontend/layout/review_customer_index.xml | 2 +- .../frontend/layout/review_customer_view.xml | 2 +- .../frontend/layout/review_product_list.xml | 2 +- .../frontend/layout/review_product_view.xml | 2 +- app/code/Magento/Rss/Block/Wishlist.php | 20 +- .../Rss/Model/System/Config/Backend/Links.php | 6 +- .../Magento/Rss/etc/frontend/page_types.xml | 28 + .../view/frontend/layout/rss_index_index.xml | 2 +- .../Rule/Model/Action/AbstractAction.php | 6 +- .../Magento/Rule/Model/Action/Collection.php | 4 +- .../Model/Condition/AbstractCondition.php | 2 +- .../Magento/Rule/Model/Condition/Context.php | 8 +- .../Billing/Agreement/View/Tab/Info.php | 4 +- .../Adminhtml/Order/View/Tab/History.php | 4 +- .../Sales/Block/Billing/Agreement/View.php | 6 +- .../Sales/Block/Billing/Agreements.php | 2 +- .../Sales/Block/Recurring/Profile/Grid.php | 10 +- app/code/Magento/Sales/Helper/Guest.php | 6 - app/code/Magento/Sales/Helper/Reorder.php | 6 - .../Magento/Sales/Model/AdminOrder/Create.php | 24 +- .../Magento/Sales/Model/Config/Ordered.php | 6 +- .../Magento/Sales/Model/Convert/Order.php | 40 +- .../Magento/Sales/Model/Convert/Quote.php | 29 +- .../Backend/RecurringProfile/FormRenderer.php | 6 +- app/code/Magento/Sales/Model/Order.php | 11 +- .../Sales/Model/Order/Pdf/AbstractPdf.php | 14 +- .../Sales/Model/Order/Pdf/Creditmemo.php | 14 +- .../Magento/Sales/Model/Order/Pdf/Invoice.php | 14 +- .../Sales/Model/Order/Pdf/Shipment.php | 14 +- .../Model/Order/Pdf/Shipment/Packaging.php | 32 +- .../Sales/Model/Order/Total/Config/Base.php | 4 +- app/code/Magento/Sales/Model/Quote.php | 20 +- .../Magento/Sales/Model/Quote/Address.php | 30 +- .../Model/Quote/Address/Total/Collector.php | 4 +- app/code/Magento/Sales/etc/fieldset.xml | 2 +- .../Magento/Sales/etc/frontend/page_types.xml | 51 + .../view/adminhtml/order/comments/view.phtml | 4 +- .../view/adminhtml/order/view/history.phtml | 4 +- .../layout/customer_account_index.xml | 4 +- .../layout/sales_billing_agreement_index.xml | 2 +- .../layout/sales_billing_agreement_view.xml | 2 +- .../sales_email_order_creditmemo_items.xml | 2 +- .../sales_email_order_invoice_items.xml | 2 +- .../layout/sales_email_order_items.xml | 2 +- .../sales_email_order_shipment_items.xml | 2 +- .../layout/sales_guest_creditmemo.xml | 2 +- .../view/frontend/layout/sales_guest_form.xml | 2 +- .../frontend/layout/sales_guest_invoice.xml | 2 +- ...t_printorder.xml => sales_guest_print.xml} | 2 +- ...mo.xml => sales_guest_printcreditmemo.xml} | 2 +- ...voice.xml => sales_guest_printinvoice.xml} | 2 +- .../layout/sales_guest_printshipment.xml | 2 +- .../frontend/layout/sales_guest_reorder.xml | 2 +- .../frontend/layout/sales_guest_shipment.xml | 2 +- .../view/frontend/layout/sales_guest_view.xml | 2 +- .../layout/sales_order_creditmemo.xml | 2 +- .../frontend/layout/sales_order_history.xml | 2 +- .../frontend/layout/sales_order_invoice.xml | 2 +- .../frontend/layout/sales_order_print.xml | 2 +- ...mo.xml => sales_order_printcreditmemo.xml} | 2 +- ...voice.xml => sales_order_printinvoice.xml} | 2 +- .../layout/sales_order_printshipment.xml | 2 +- .../frontend/layout/sales_order_reorder.xml | 2 +- .../frontend/layout/sales_order_shipment.xml | 2 +- .../view/frontend/layout/sales_order_view.xml | 2 +- .../layout/sales_recurring_profile_index.xml | 2 +- .../layout/sales_recurring_profile_orders.xml | 2 +- .../layout/sales_recurring_profile_view.xml | 2 +- .../sales_recurring_profile_view__tabs.xml | 2 +- .../Model/Rule/Action/Collection.php | 4 +- app/code/Magento/SalesRule/etc/fieldset.xml | 4 +- .../Sendfriend/etc/frontend/page_types.xml | 28 + .../layout/sendfriend_product_send.xml | 2 +- .../Shipping/etc/frontend/page_types.xml | 28 + .../layout/shipping_tracking_popup.xml | 2 +- app/code/Magento/Tax/etc/fieldset.xml | 4 +- .../Design/Theme/Edit/Form/Element/Image.php | 14 +- .../System/Design/Theme/Edit/Tab/General.php | 6 +- .../System/Design/Theme/Edit/Tab/Js.php | 2 +- .../Adminhtml/System/Design/Theme.php | 32 +- app/code/Magento/Theme/Helper/Storage.php | 6 +- app/code/Magento/Theme/Model/Config.php | 12 +- .../Theme/Model/Config/Customization.php | 23 +- .../Theme/Customization/File/CustomCss.php | 6 +- .../Magento/Theme/Model/Theme/SingleFile.php | 8 +- .../Magento/Theme/Model/Wysiwyg/Storage.php | 6 +- app/code/Magento/Theme/etc/di.xml | 4 +- .../Carrier/Dhl/Label/Pdf/PageBuilder.php | 4 +- .../data-upgrade-1.6.1.4-1.6.1.5.php | 37 + app/code/Magento/User/etc/module.xml | 3 +- app/code/Magento/Webapi/Controller/Rest.php | 21 +- app/code/Magento/Webapi/Controller/Soap.php | 14 +- app/code/Magento/Webapi/Model/Acl/Cache.php | 4 +- .../Magento/Webapi/Model/Acl/User/Factory.php | 2 +- app/code/Magento/Webapi/Model/Cache/Type.php | 4 +- app/code/Magento/Webapi/Model/Config.php | 2 +- app/code/Magento/Webapi/etc/di.xml | 5 +- app/code/Magento/Webapi/etc/module.xml | 4 +- app/code/Magento/Weee/etc/fieldset.xml | 4 +- .../Instance/Edit/Chooser/Container.php | 1 + .../Edit/Chooser/DesignAbstraction.php | 148 + .../Widget/Instance/Edit/Chooser/Layout.php | 59 +- .../Widget/Instance/Edit/Tab/Main/Layout.php | 24 + .../Magento/Widget/Model/Template/Filter.php | 4 +- app/code/Magento/Widget/Model/Widget.php | 16 +- .../Magento/Widget/Model/Widget/Config.php | 6 +- .../Magento/Widget/Model/Widget/Instance.php | 12 +- .../view/adminhtml/instance/edit/layout.phtml | 31 + .../Magento/Wishlist/Block/AbstractBlock.php | 16 +- .../Wishlist/Block/Customer/Wishlist.php | 5 +- .../Block/Customer/Wishlist/Item/Options.php | 7 +- .../Magento/Wishlist/Block/Share/Wishlist.php | 21 +- .../etc/frontend/page_types.xml} | 15 +- .../Wishlist/view/frontend/button/share.phtml | 5 +- .../view/frontend/button/tocart.phtml | 5 +- .../view/frontend/button/update.phtml | 5 +- .../Wishlist/view/frontend/email/items.phtml | 70 +- .../Wishlist/view/frontend/email/rss.phtml | 1 - .../view/frontend/item/column/cart.phtml | 52 +- .../view/frontend/item/column/image.phtml | 6 +- .../view/frontend/item/column/info.phtml | 21 +- .../view/frontend/item/column/remove.phtml | 8 +- .../view/frontend/item/configure/addto.phtml | 25 +- .../Wishlist/view/frontend/item/list.phtml | 42 +- .../layout/wishlist_index_configure.xml | 13 +- .../wishlist_index_configure_type_bundle.xml | 42 +- ...list_index_configure_type_configurable.xml | 14 +- .../wishlist_index_configure_type_grouped.xml | 12 +- .../wishlist_index_configure_type_simple.xml | 4 +- .../frontend/layout/wishlist_index_index.xml | 33 +- .../frontend/layout/wishlist_index_share.xml | 4 +- .../frontend/layout/wishlist_shared_index.xml | 2 +- .../Wishlist/view/frontend/options_list.phtml | 33 +- .../render/item/price_msrp_item.phtml | 80 +- .../frontend/render/item/price_msrp_rss.phtml | 2 +- .../Wishlist/view/frontend/shared.phtml | 89 +- .../Wishlist/view/frontend/sharing.phtml | 70 +- .../Wishlist/view/frontend/sidebar.phtml | 75 +- .../Magento/Wishlist/view/frontend/view.phtml | 107 +- .../Magento_Captcha/captcha.js | 109 +- .../Magento_Captcha/default.phtml | 57 + .../override/base/checkout_onepage_index.xml | 75 + .../override/base/contacts_index_index.xml} | 48 +- .../override/base/customer_account_create.xml | 50 +- .../base/customer_account_forgotpassword.xml | 50 +- .../override/base/customer_account_login.xml | 42 + .../Magento_Captcha/onepage.js | 44 +- .../Magento_Captcha}/reload.png | Bin .../Magento_Customer}/account/dashboard.phtml | 58 +- .../account/dashboard/address.phtml | 50 + .../account/dashboard/hello.phtml} | 30 +- .../account/dashboard/info.phtml | 64 + .../account/dashboard/newsletter.phtml | 30 +- .../Magento_Customer/account/link/back.phtml | 25 +- .../Magento_Customer/account/navigation.phtml | 42 +- .../Magento_Customer/address.js | 73 + .../Magento_Customer}/address.phtml | 160 +- .../Magento_Customer/address/book.phtml | 105 + .../Magento_Customer/address/edit.phtml} | 299 +- .../Magento_Customer}/balance.phtml | 30 +- .../Magento_Customer}/form/address.phtml | 276 +- .../form/changepassword.phtml | 174 +- .../Magento_Customer/form/confirmation.phtml | 88 +- .../Magento_Customer/form/edit.phtml | 131 + .../form/forgotpassword.phtml | 62 + .../Magento_Customer/form/login.phtml | 99 + .../Magento_Customer}/form/mini.login.phtml | 48 +- .../Magento_Customer/form/newsletter.phtml | 61 +- .../Magento_Customer/form/register.phtml | 222 + .../form/resetforgottenpassword.phtml | 93 +- .../Magento_Customer/js/checkout-balance.js | 52 + .../layout/override/base/customer_account.xml | 60 + .../base/customer_account_confirmation.xml | 38 + .../override/base/customer_account_create.xml | 9 +- .../base/customer_account_createpassword.xml | 43 + .../override/base/customer_account_edit.xml | 10 +- .../base/customer_account_forgotpassword.xml | 6 +- .../override/base/customer_account_index.xml | 42 + .../override/base/customer_account_login.xml | 44 +- .../base/customer_account_logoutsuccess.xml} | 37 +- .../override/base/customer_address_form.xml | 31 + .../override/base/customer_address_index.xml} | 5 +- .../layout/override/base/default.xml | 35 + .../Magento_Customer/logout.phtml} | 34 +- .../Magento_Customer/set-password.js | 58 + .../Magento_Customer/widget/dob.phtml | 82 + .../Magento_Customer/widget/gender.phtml | 41 +- .../Magento_Customer/widget/name.phtml | 181 +- .../Magento_Customer/widget/taxvat.phtml | 29 +- .../layout/override/base/customer_account.xml | 36 + .../layout/override/base/default.xml | 28 +- .../override/base/newsletter_manage_index.xml | 8 +- .../Magento_Newsletter/newsletter.js | 47 + .../Magento_Newsletter/subscribe.phtml | 64 + .../layout/override/paypal_express_review.xml | 2 +- .../override/paypal_hostedpro_cancel.xml | 2 +- .../override/paypal_payflow_cancelpayment.xml | 2 +- .../layout/override/paypal_payflow_form.xml | 2 +- .../override/paypal_payflow_returnurl.xml | 2 +- .../paypal_payflowadvanced_cancelpayment.xml | 2 +- .../override/paypal_payflowadvanced_form.xml | 2 +- .../paypal_payflowadvanced_returnurl.xml | 2 +- .../override/paypaluk_express_review.xml | 2 +- .../checkout/onepage/billing.phtml | 0 .../checkout/onepage/login.phtml | 0 .../customer/form/login.phtml | 0 .../customer/form/register.phtml | 0 .../override}/checkout_onepage_index.xml | 21 +- .../override}/customer_account_create.xml | 11 +- .../override}/customer_account_login.xml | 11 +- .../Magento_Persistent/remember-me-popup.js | 106 + .../Magento_Persistent/remember_me.phtml | 14 +- .../remember_me_tooltip.phtml | 1 + .../Magento_Persistent}/splitbutton.js | 0 .../Magento_ProductAlert/email/price.phtml | 50 + .../Magento_ProductAlert/email/stock.phtml | 50 + .../layout/override/catalog_product_view.xml | 49 + .../Magento_ProductAlert/product/view.phtml | 30 + .../layout/override/review_product_view.xml | 2 +- .../sales_billing_agreement_index.xml | 2 +- .../override/sales_billing_agreement_view.xml | 2 +- .../sales_email_order_creditmemo_items.xml | 2 +- .../sales_email_order_invoice_items.xml | 2 +- .../override/sales_email_order_items.xml | 2 +- .../sales_email_order_shipment_items.xml | 2 +- .../override/sales_guest_creditmemo.xml | 2 +- .../layout/override/sales_guest_form.xml | 2 +- .../layout/override/sales_guest_invoice.xml | 2 +- ...t_printorder.xml => sales_guest_print.xml} | 2 +- ...mo.xml => sales_guest_printcreditmemo.xml} | 2 +- ...voice.xml => sales_guest_printinvoice.xml} | 2 +- .../override/sales_guest_printshipment.xml | 2 +- .../layout/override/sales_guest_reorder.xml | 2 +- .../layout/override/sales_guest_shipment.xml | 2 +- .../layout/override/sales_guest_view.xml | 2 +- .../override/sales_order_creditmemo.xml | 2 +- .../layout/override/sales_order_history.xml | 2 +- .../layout/override/sales_order_invoice.xml | 2 +- ...mo.xml => sales_order_printcreditmemo.xml} | 2 +- ...voice.xml => sales_order_printinvoice.xml} | 2 +- .../override/sales_order_printshipment.xml | 2 +- .../layout/override/sales_order_reorder.xml | 2 +- .../layout/override/sales_order_shipment.xml | 2 +- .../layout/override/sales_order_view.xml | 2 +- .../sales_recurring_profile_index.xml | 2 +- .../sales_recurring_profile_orders.xml | 2 +- .../override/sales_recurring_profile_view.xml | 2 +- .../sales_recurring_profile_view__tabs.xml | 2 +- .../Magento_Wishlist/button/share.phtml | 27 +- .../Magento_Wishlist/button/tocart.phtml | 27 +- .../Magento_Wishlist/button/update.phtml | 27 +- .../Magento_Wishlist/email/items.phtml | 56 + .../Magento_Wishlist/email/rss.phtml | 31 + .../Magento_Wishlist/item/column/cart.phtml | 84 +- .../Magento_Wishlist/item/column/image.phtml | 34 +- .../Magento_Wishlist/item/column/info.phtml | 49 +- .../Magento_Wishlist/item/column/remove.phtml | 25 +- .../item/configure/addto.phtml | 44 +- .../Magento_Wishlist/item/list.phtml | 78 +- .../Magento_Wishlist/js/add-to-wishlist.js | 50 + .../Magento_Wishlist/js/search.js | 57 + .../layout/override/base/customer_account.xml | 35 + .../layout/override/base/default.xml} | 33 +- .../base/wishlist_index_configure.xml | 13 +- .../wishlist_index_configure_type_bundle.xml | 44 +- ...list_index_configure_type_configurable.xml | 14 +- .../wishlist_index_configure_type_grouped.xml | 32 +- .../wishlist_index_configure_type_simple.xml | 22 +- .../override/base/wishlist_index_index.xml | 34 +- .../override/base/wishlist_index_share.xml} | 31 +- .../override/base/wishlist_shared_index.xml | 2 +- .../Magento_Wishlist/options_list.phtml | 51 + .../Magento_Wishlist/render/item/price.phtml} | 47 +- .../render/item/price_msrp_item.phtml | 88 + .../render/item/price_msrp_rss.phtml | 38 + .../Magento_Wishlist/shared.phtml | 85 + .../Magento_Wishlist/sharing.phtml | 75 + .../Magento_Wishlist/sidebar.phtml | 61 + .../Magento_Wishlist/view.phtml | 85 + .../Magento_Wishlist/wishlist.js | 208 + .../product/view/type/bundle/options.phtml | 2 +- .../base/catalog_product_view_type_bundle.xml | 2 +- .../Magento_Captcha/default.phtml | 59 - .../override/base/checkout_onepage_index.xml | 60 - .../override/base/catalog_category_view.xml | 2 +- .../catalog_category_view_type_default.xml | 2 +- .../catalog_category_view_type_layered.xml | 2 +- .../base/catalog_product_compare_index.xml | 2 +- .../override/base/catalog_product_view.xml | 2 +- ...catalog_product_view_type_configurable.xml | 2 +- .../catalog_product_view_type_grouped.xml | 2 +- .../base/catalog_product_view_type_simple.xml | 2 +- .../catalog_product_view_type_virtual.xml | 2 +- .../product/view/options.phtml | 2 +- .../product/view/tierprices.phtml | 6 +- .../view/type/options/configurable.phtml | 2 +- .../base/catalogsearch_result_index.xml | 2 +- .../Magento_Checkout/js/opcheckout.js | 5 +- .../override/base/checkout_cart_index.xml | 2 +- ...heckout_multishipping_customer_address.xml | 2 +- .../base/checkout_onepage_failure.xml | 2 +- .../override/base/checkout_onepage_index.xml | 2 +- .../base/checkout_onepage_success.xml | 2 +- .../account/dashboard/address.phtml | 51 - .../account/dashboard/info.phtml | 58 - .../Magento_Customer/address/book.phtml | 110 - .../Magento_Customer/address/edit.phtml | 164 - .../form/changepassword.phtml | 68 - .../Magento_Customer/form/edit.phtml | 129 - .../form/forgotpassword.phtml | 57 - .../Magento_Customer/form/login.phtml | 82 - .../Magento_Customer/form/register.phtml | 234 -- .../layout/customer_account.xml | 2 - .../override/base/customer_account_index.xml | 40 - .../Magento_Customer/widget/dob.phtml | 84 - ...catalog_product_view_type_downloadable.xml | 2 +- .../Magento_Newsletter/subscribe.phtml | 62 - .../Magento_Page/layout/default.xml | 5 + .../override/base/sendfriend_product_send.xml | 2 +- .../Magento_Wishlist/shared.phtml | 79 - .../Magento_Wishlist/sharing.phtml | 67 - .../Magento_Wishlist/sidebar.phtml | 71 - .../Magento_Wishlist/view.phtml | 81 - .../frontend/magento_plushe/css/styles.css | 3658 +++++++++++++++-- .../images/express-checkout-retina.png | Bin 0 -> 19622 bytes .../magento_plushe/js/navigation-menu.js | 110 +- .../frontend/magento_plushe/js/responsive.js | 67 + .../frontend/magento_plushe/js/theme.js | 16 +- .../magento_plushe/less/lib/navigation.less | 306 +- .../less/responsive/responsive.less | 2345 +++++++++++ .../frontend/magento_plushe/less/styles.less | 391 +- .../magento_plushe/less/styles/magento.less | 2 +- .../frontend/magento_plushe/less/vars.less | 6 + app/etc/di.xml | 62 +- .../Magento/TestFramework/Application.php | 10 +- .../Magento/Test/ObjectManagerTest.php | 2 +- .../Adminhtml/Controller/CacheTest.php | 42 +- .../_files/cache/all_types_disabled.php | 8 +- .../_files/cache/all_types_enabled.php | 8 +- .../_files/cache/all_types_invalidated.php | 4 +- .../_files/cache/application_cache.php | 4 +- .../_files/cache/empty_storage.php | 4 +- .../_files/cache/non_application_cache.php | 4 +- .../Model => App}/Cache/Frontend/PoolTest.php | 10 +- .../Backend/Block/System/Config/FormTest.php | 148 +- .../Config/Backend/Image/AdapterTest.php | 2 +- .../Cms/Model/Wysiwyg/Images/StorageTest.php | 4 +- .../Magento/Core/Block/AbstractBlockTest.php | 14 +- .../Magento/Core/Helper/DataTest.php | 123 +- .../Core/Model/Email/Template/FilterTest.php | 5 +- .../Magento/Core/Model/Email/TemplateTest.php | 13 +- .../Core/Model/Image/Adapter/ConfigTest.php | 35 + .../Core/Model/Page/Asset/MergedTest.php | 8 +- .../Core/Model/Resource/Layout/UpdateTest.php | 8 +- .../Model/Resource/Theme/CollectionTest.php | 32 +- .../Magento/Core/Model/StoreTest.php | 2 +- .../Core/Model/Theme/CollectionTest.php | 4 +- .../Core/Model/Theme/Domain/VirtualTest.php | 11 +- .../Core/Model/Theme/RegistrationTest.php | 11 +- .../Magento/Core/Model/ThemeTest.php | 4 +- .../Magento/Core/Model/TranslateTest.php | 8 +- .../Magento/Core/Model/View/DesignTest.php | 12 +- .../Magento_Catalog/catalog_category_view.xml | 2 +- .../catalog_category_view_type_default.xml | 2 +- .../Magento_Catalog/catalog_product_view.xml | 2 +- .../catalog_product_view_type_simple.xml | 2 +- .../testsuite/Magento/Core/Utility/Layout.php | 4 +- .../Magento/Core/_files/config_cache.php | 4 +- .../Core/_files/design_change_rollback.php | 4 +- .../Magento/Core/_files/layout_cache.php | 4 +- .../Magento/Core/_files/layout_update.php | 2 +- .../Customer/Controller/AccountTest.php | 2 +- .../Model/Config/QuickStylesTest.php | 4 +- .../DesignEditor/Model/ObserverTest.php | 8 +- .../Magento/Filesystem/Directory/ReadTest.php | 234 ++ .../Filesystem/Directory/WriteTest.php | 392 ++ .../Magento/Filesystem/File/ReadTest.php | 244 ++ .../Magento/Filesystem/File/WriteTest.php | 227 + .../Magento/Image/Adapter/InterfaceTest.php | 22 +- .../Model/Import/Entity/ProductTest.php | 2 +- .../Magento/Install/Model/ConfigTest.php | 8 +- .../Magento/Install/Model/InstallerTest.php | 8 +- .../Magento/Newsletter/Model/QueueTest.php | 13 +- .../Copy}/Config/ReaderTest.php | 12 +- .../_files/Magento/Test/etc/fieldset.xml | 2 +- .../Config/_files/Magento/Test/etc/module.xml | 0 .../Copy}/Config/_files/expectedArray.php | 0 .../Config/_files/partialFieldsetFirst.xml | 2 +- .../Config/_files/partialFieldsetSecond.xml | 2 +- .../testsuite/Magento/Object/CopyTest.php | 85 + .../Magento/Page/Model/Config/ReaderTest.php | 4 +- .../Magento/Page/Model/ConfigTest.php | 4 +- .../Payment/Model/Config/ReaderTest.php | 4 +- .../Magento/Payment/Model/ConfigTest.php | 4 +- .../Magento/Test/Integrity/LayoutTest.php | 3 +- .../Integrity/Magento/Payment/MethodsTest.php | 4 +- .../Magento/Widget/SkinFilesTest.php | 2 +- .../Magento/Widget/TemplateFilesTest.php | 4 +- .../Test/Integrity/Modular/CacheFilesTest.php | 13 +- .../Modular/FieldsetConfigFilesTest.php | 4 +- .../Modular/SystemConfigFilesTest.php | 6 +- .../Integrity/Modular/TemplateFilesTest.php | 2 +- .../Test/Integrity/Modular/ViewFilesTest.php | 4 +- .../Modular/_files/skip_blocks_ce.php | 2 - .../Integrity/Theme/TemplateFilesTest.php | 2 +- .../Test/Integrity/Theme/ViewFilesTest.php | 8 +- .../Test/Integrity/ViewFileReferenceTest.php | 4 +- .../Design/Theme/Edit/Tab/GeneralTest.php | 2 +- .../Design}/Theme/ValidatorTest.php | 10 +- .../{Core/Model => }/View/FileSystemTest.php | 10 +- .../{Core/Model => }/View/PublicationTest.php | 51 +- .../Block/Adminhtml/AbstractFormTest.php | 4 +- .../Adminhtml/Role/Edit/Tab/MainTest.php | 6 +- .../Adminhtml/Role/Edit/Tab/ResourceTest.php | 4 +- .../Adminhtml/User/Edit/Tab/MainTest.php | 4 +- .../Edit/Chooser/DesignAbstractionTest.php | 85 + .../Instance/Edit/Chooser/LayoutTest.php | 49 +- .../_files/design-abstraction_select.html | 27 +- .../layout/catalogsearch_ajax_suggest.xml | 2 +- .../child_page_with_inherited_containers.xml | 2 +- ...age_with_inherited_imported_containers.xml | 2 +- .../layout/child_page_with_own_containers.xml | 2 +- .../layout/child_page_without_containers.xml | 2 +- .../_files/layout/customer_account.xml | 26 + .../Edit/Chooser/_files/layout/page_empty.xml | 26 + .../root_page_with_imported_containers.xml | 2 +- .../layout/root_page_with_own_containers.xml | 2 +- .../layout/root_page_without_containers.xml | 2 +- .../root_page_without_own_containers.xml | 2 +- .../Chooser/_files/page_types_select.html | 16 +- .../Magento/Wishlist/Block/AbstractTest.php | 1 + .../Dependency/_files/tables_ce.php | 11 +- .../Integrity/Library/Injectable.php | 72 + .../PhpParser/DependenciesCollector.php | 41 + .../Integrity/Library/PhpParser/Parser.php | 41 + .../Library/PhpParser/ParserFactory.php | 107 + .../Library/PhpParser/StaticCalls.php | 120 + .../Integrity/Library/PhpParser/Throws.php | 95 + .../Integrity/Library/PhpParser/Tokens.php | 140 + .../Integrity/Library/PhpParser/Uses.php | 155 + .../Magento/TestFramework/Utility/Files.php | 52 +- .../TestFramework/Utility/Validator.php | 55 + .../Test/Integrity/Library/InjectableTest.php | 152 + .../Library/PhpParser/ParserFactoryTest.php | 71 + .../Library/PhpParser/StaticCallsTest.php | 120 + .../Library/PhpParser/ThrowsTest.php | 113 + .../Library/PhpParser/TokensTest.php | 166 + .../Integrity/Library/PhpParser/UsesTest.php | 205 + .../Test/Integrity/Layout/FilesTest.php | 26 +- .../Test/Integrity/Layout/HandlesTest.php | 21 +- .../Test/Integrity/Library/DependencyTest.php | 147 + .../Integrity/Library/_files/blacklist.txt | 52 + .../Model/Fieldset/FieldsetConfigTest.php | 10 +- .../Core/Model/Fieldset/_files/fieldset.xml | 2 +- .../Model/Fieldset/_files/fieldset_file.xml | 2 +- .../Test/Integrity/PageType/FilesTest.php} | 41 +- .../Test/Legacy/_files/obsolete_classes.php | 23 + .../Test/Legacy/_files/obsolete_constants.php | 40 + .../Test/Legacy/_files/obsolete_methods.php | 27 +- .../Legacy/_files/obsolete_properties.php | 4 + .../Php/_files/phpcpd/blacklist/common.txt | 2 +- .../Magento/Test/Php/_files/phpmd/ruleset.xml | 1 - .../Test/Php/_files/whitelist/common.txt | 3 +- .../Magento/Test/Block/Adminhtml.php | 6 +- .../System/Message/CacheOutdatedTest.php | 2 +- .../Adminhtml/Controller/CacheTest.php | 6 +- .../Cache/Frontend/FactoryTest.php | 12 +- .../FactoryTest/CacheDecoratorDummy.php | 2 +- .../Model => App}/Cache/Frontend/PoolTest.php | 30 +- .../{Core/Model => App}/Cache/StateTest.php | 16 +- .../Cache/Type/AccessProxyTest.php | 6 +- .../Cache/Type/FrontendPoolTest.php | 26 +- .../Model => App}/Cache/Type/GenericTest.php | 18 +- .../Magento/{Core/Model => App}/CacheTest.php | 10 +- .../App/ObjectManager/ConfigLoaderTest.php | 4 +- .../Adminhtml/System/Config/SaveTest.php | 2 +- .../Config/Structure/Element/FieldTest.php | 2 +- .../Magento/Backend/Model/Menu/ConfigTest.php | 2 +- .../Model => }/Cache/Config/ConverterTest.php | 6 +- .../Cache/Config/_files/cache_config.php | 4 +- .../Cache/Config/_files/cache_config.xml | 4 +- .../{Core/Model => }/Cache/ConfigTest.php | 10 +- .../Magento/Checkout/Block/Cart/LinkTest.php | 2 +- .../Magento/Checkout/Block/LinkTest.php | 2 +- .../Cms/Model/Wysiwyg/Images/StorageTest.php | 4 +- .../Magento/Core/Block/TemplateTest.php | 4 +- .../Magento/Core/Helper/ThemeTest.php | 12 +- .../Magento/Core/Model/Config/CacheTest.php | 2 +- .../Magento/Core/Model/Config/InitialTest.php | 2 +- .../Core/Model/Image/AdapterFactoryTest.php | 139 - .../Magento/Core/Model/Layout/MergeTest.php | 19 +- .../layout/catalog_category_default.xml | 2 +- .../layout/catalog_category_layered.xml | 2 +- .../_files/layout/catalog_product_view.xml | 2 +- ...catalog_product_view_type_configurable.xml | 2 +- .../catalog_product_view_type_grouped.xml | 2 +- .../catalog_product_view_type_simple.xml | 2 +- .../_files/layout/checkout_onepage_index.xml | 2 +- .../Layout/_files/layout/customer_account.xml | 26 + .../Model/Layout/_files/layout/default.xml | 2 +- .../Model/Layout/_files/layout/page_empty.xml | 26 + .../Core/Model/Layout/_files/layout/print.xml | 2 +- .../_files/layout/sales_guest_print.xml | 2 +- .../_files/layout/sales_order_print.xml | 2 +- .../Core/Model/Layout/_files/merged.xml | 24 +- .../Magento/Core/Model/LocaleTest.php | 135 + .../Magento/Core/Model/ObserverTest.php | 14 +- .../Model/Page/Asset/MergeServiceTest.php | 12 +- .../Page/Asset/MergeStrategy/DirectTest.php | 10 +- .../Core/Model/Page/Asset/MinifiedTest.php | 4 +- .../Core/Model/Page/Asset/PublicFileTest.php | 4 +- .../Core/Model/Page/Asset/ViewFileTest.php | 4 +- .../Decorator/DebugHintsTest.php | 2 +- .../Core/Model/Theme/CopyServiceTest.php | 135 +- .../Core/Model/Theme/Domain/FactoryTest.php | 12 +- .../Core/Model/Theme/Domain/PhysicalTest.php | 10 +- .../Core/Model/Theme/Domain/StagingTest.php | 9 +- .../Core/Model/Theme/Domain/VirtualTest.php | 41 +- .../Core/Model/Theme/Image/PathTest.php | 12 +- .../Core/Model/Theme/Image/UploaderTest.php | 29 +- .../Core/Model/Theme/ThemeProviderTest.php | 70 + .../Core/Model/Theme/ValidationTest.php | 12 +- .../Magento/Core/Model/ThemeTest.php | 30 +- .../Core/Model/View/Url/ConfigTest.php | 78 + .../Editor/Toolbar/Buttons/SaveTest.php | 17 +- .../Editor/Tools/Code/CustomTest.php | 6 +- .../Adminhtml/Editor/Tools/Code/JsTest.php | 4 +- .../Adminhtml/System/Design/EditorTest.php | 2 +- .../Magento/DesignEditor/Model/StateTest.php | 17 +- .../DesignEditor/Model/Theme/ContextTest.php | 6 +- .../Magento/Directory/Helper/DataTest.php | 2 +- .../Downloadable/Model/ObserverTest.php | 3 +- .../Eav/Model/Entity/Attribute/ConfigTest.php | 2 +- .../Magento/Image/AdapterFactoryTest.php | 163 + .../Integration/Helper/Oauth/ConsumerTest.php | 203 + .../Integration/Helper/Oauth/DataTest.php | 111 + .../Integration/Helper/Oauth/OauthTest.php | 70 + .../Helper/Oauth/RequestTest.php} | 43 +- .../Magento/Integration/Oauth/OauthTest.php | 840 ++++ .../ManagerTest.php} | 28 +- .../Magento/Oauth/Helper/ServiceTest.php | 136 - .../Magento/Oauth/Service/OauthV1Test.php | 758 ---- .../Copy}/Config/ConverterTest.php | 8 +- .../Copy}/Config/_files/fieldset.xml | 4 +- .../Copy}/Config/_files/fieldset_config.php | 0 .../Fieldset => Object/Copy}/ConfigTest.php | 12 +- .../Mapper/_files/mapped_simple_di_config.php | 2 +- .../Config/Mapper/_files/simple_di_config.xml | 2 +- .../Block/Recurring/Profile/GridTest.php | 14 +- .../Profile/Related/Orders/GridTest.php | 16 +- .../Magento/Sales/Model/Config/DataTest.php | 2 +- .../RecurringProfile/FormRendererTest.php | 2 +- .../Sales/Model/Order/Pdf/AbstractTest.php | 8 +- .../Sales/Model/Order/Pdf/InvoiceTest.php | 2 - .../Magento/Stdlib/ArrayUtilsTest.php | 36 + .../Di/Code/Scanner/PluginScannerTest.php | 2 +- .../Scanner/XmlInterceptorScannerTest.php | 2 +- .../app/code/Magento/SomeModule/etc/di.xml | 6 +- .../Test/Tools/Di/_files/app/etc/config.xml | 2 +- .../Tools/Di/_files/app/etc/di/config.xml | 2 +- .../View/Generator/ThemeDeploymentTest.php | 21 +- .../Adminhtml/System/Design/ThemeTest.php | 4 +- .../Magento/Theme/Helper/StorageTest.php | 6 +- .../Theme/Model/Config/CustomizationTest.php | 73 +- .../Magento/Theme/Model/ConfigTest.php | 14 +- .../Theme/Model/Wysiwyg/StorageTest.php | 9 +- .../View/DeployedFilesManagerTest.php | 15 +- .../Theme/Customization/AbstractFileTest.php | 63 +- .../Design}/Theme/Customization/PathTest.php | 20 +- .../Design}/Theme/CustomizationTest.php | 147 +- .../Design/Theme/FlyweightFactoryTest.php | 115 + .../Model => View/Design}/Theme/ImageTest.php | 44 +- .../{Core/Model => }/View/FileSystemTest.php | 16 +- .../Source/Decorator/ModuleOutputTest.php | 2 +- .../Layout/File/Source/Override/ThemeTest.php | 2 +- .../Url/CssResolverTest.php} | 10 +- .../Helper => View/Url}/_files/result.css | 0 .../Helper => View/Url}/_files/source.css | 0 .../Magento/{Core/Model => }/View/UrlTest.php | 45 +- .../Magento/Webapi/Controller/RestTest.php | 8 +- .../Magento/Webapi/Controller/SoapTest.php | 19 +- .../Widget/Model/Widget/InstanceTest.php | 6 +- .../Migration/Acl/log/AclXPathToAclId.log | 2 +- .../factory_table_names/replace_ce.php | 5 - .../Tools/View/Generator/ThemeDeployment.php | 28 +- .../Tools/View/Generator/ThemeLight.php | 2 +- dev/tools/Magento/Tools/View/generator.php | 4 +- .../Core/Model => lib/Magento/App}/Cache.php | 12 +- .../Magento/App}/Cache/Frontend/Factory.php | 2 +- .../Magento/App}/Cache/Frontend/Pool.php | 8 +- .../Magento/App}/Cache/InstanceFactory.php | 2 +- .../Model => lib/Magento/App}/Cache/Proxy.php | 4 +- .../Model => lib/Magento/App}/Cache/State.php | 24 +- .../App/Cache/State/OptionsInterface.php | 41 + .../Magento/App}/Cache/StateInterface.php | 2 +- .../Magento/App}/Cache/Type/AccessProxy.php | 8 +- .../Magento/App}/Cache/Type/Block.php | 6 +- .../Magento/App}/Cache/Type/Collection.php | 6 +- .../Magento/App}/Cache/Type/Config.php | 6 +- .../Magento/App}/Cache/Type/FrontendPool.php | 14 +- .../Magento/App}/Cache/Type/Layout.php | 6 +- .../Magento/App}/Cache/Type/Translate.php | 6 +- .../Magento/App}/Cache/TypeList.php | 22 +- .../Magento/App}/Cache/TypeListInterface.php | 2 +- .../Model => lib/Magento}/Cache/Config.php | 19 +- .../Magento}/Cache/Config/Converter.php | 2 +- .../Magento}/Cache/Config/Data.php | 6 +- .../Magento}/Cache/Config/Reader.php | 10 +- .../Magento}/Cache/Config/SchemaLocator.php | 13 +- lib/Magento/Cache/ConfigInterface.php | 44 + .../Core => lib/Magento/Cache}/etc/cache.xsd | 0 .../Magento/File/UploaderFactory.php | 26 +- lib/Magento/Filesystem/Directory/Read.php | 200 + .../Filesystem/Directory/ReadInterface.php | 92 + lib/Magento/Filesystem/Directory/Write.php | 294 ++ .../Filesystem/Directory/WriteInterface.php | 115 + lib/Magento/Filesystem/File/Read.php | 155 + lib/Magento/Filesystem/File/ReadFactory.php | 52 + lib/Magento/Filesystem/File/ReadInterface.php | 76 + lib/Magento/Filesystem/File/Write.php | 143 + lib/Magento/Filesystem/File/WriteFactory.php | 53 + .../Filesystem/File/WriteInterface.php | 70 + .../HTTP/Adapter/FileTransferFactory.php | 4 +- lib/Magento/Image.php | 15 +- lib/Magento/Image/Adapter/AbstractAdapter.php | 2 +- .../Image/Adapter/AdapterInterface.php | 123 + lib/Magento/Image/Adapter/ConfigInterface.php | 37 + lib/Magento/Image/AdapterFactory.php | 87 + lib/Magento/Image/Factory.php | 65 + .../Magento/Module/Manager.php | 25 +- lib/Magento/Module/Output/ConfigInterface.php | 44 + lib/Magento/Oauth/ConsumerInterface.php | 78 + {app/code => lib}/Magento/Oauth/Exception.php | 0 .../Magento/Oauth/Helper/Oauth.php | 81 +- .../Magento/Oauth/Helper/Request.php | 134 +- lib/Magento/Oauth/NonceGeneratorInterface.php | 64 + lib/Magento/Oauth/Oauth.php | 302 ++ .../Magento/Oauth/OauthInterface.php | 136 +- lib/Magento/Oauth/TokenProviderInterface.php | 123 + lib/Magento/Object/Copy.php | 139 + .../Magento/Object/Copy}/Config.php | 10 +- .../Magento/Object/Copy}/Config/Converter.php | 8 +- .../Magento/Object/Copy}/Config/Data.php | 2 +- .../Magento/Object/Copy}/Config/Reader.php | 6 +- .../Object/Copy}/Config/SchemaLocator.php | 16 +- .../Magento/Object}/etc/fieldset.xsd | 0 .../Magento/Object}/etc/fieldset_file.xsd | 2 +- lib/Magento/Stdlib/ArrayUtils.php | 78 + lib/Magento/View/BlockPool.php | 4 +- .../Model => lib/Magento}/View/Config.php | 26 +- lib/Magento/View/ConfigInterface.php | 5 + lib/Magento/View/Context.php | 14 +- lib/Magento/View/DataSourcePool.php | 6 +- .../Magento}/View/DeployedFilesManager.php | 17 +- .../Design/FileResolution/StrategyPool.php | 2 +- .../View/Design}/Theme/Customization.php | 84 +- .../Theme/Customization/AbstractFile.php | 40 +- .../Theme/Customization/ConfigInterface.php | 38 + .../Design}/Theme/Customization/File/Css.php | 4 +- .../Design}/Theme/Customization/File/Js.php | 4 +- .../Customization/FileAssetInterface.php | 2 +- .../Theme/Customization/FileInterface.php | 20 +- .../Customization/FileServiceFactory.php | 34 +- .../View/Design}/Theme/Customization/Path.php | 14 +- .../Design}/Theme/CustomizationInterface.php | 8 +- .../View/Design}/Theme/Domain/Factory.php | 16 +- .../Design/Theme/File/CollectionInterface.php | 57 + .../View/Design}/Theme/FileFactory.php | 4 +- .../View/Design}/Theme/FileInterface.php | 8 +- .../Design/Theme/FileProviderInterface.php | 34 + .../View/Design}/Theme/FlyweightFactory.php | 57 +- .../Magento/View/Design}/Theme/Image.php | 28 +- .../View/Design/Theme/Image/PathInterface.php | 64 + .../View/Design}/Theme/Image/Uploader.php | 20 +- .../View/Design/Theme/ImageFactory.php | 69 + .../Design/Theme/ThemeProviderInterface.php | 50 + .../Magento/View/Design}/Theme/Validator.php | 20 +- lib/Magento/View/Design/ThemeInterface.php | 15 + lib/Magento/View/DesignInterface.php | 2 +- lib/Magento/View/Element/BlockFactory.php | 60 + .../Model => lib/Magento}/View/FileSystem.php | 10 +- .../File/Source/Decorator/ModuleOutput.php | 8 +- .../Layout/File/Source/Override/Theme.php | 2 +- .../View/Layout/ProcessorInterface.php | 6 +- lib/Magento/View/LayoutInterface.php | 2 +- .../View/PublicFilesManagerInterface.php | 4 +- .../Model => lib/Magento}/View/Publisher.php | 42 +- .../Model => lib/Magento}/View/Service.php | 18 +- lib/Magento/View/TemplateEngine/Php.php | 8 +- lib/Magento/View/TemplateEngineInterface.php | 4 +- .../Core/Model => lib/Magento}/View/Url.php | 70 +- lib/Magento/View/Url/ConfigInterface.php | 39 + .../Magento/View/Url/CssResolver.php | 8 +- 1091 files changed, 26976 insertions(+), 13081 deletions(-) create mode 100644 app/code/Magento/Authorizenet/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Catalog/etc/frontend/page_types.xml create mode 100644 app/code/Magento/CatalogSearch/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Checkout/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Cms/etc/frontend/page_types.xml rename app/code/Magento/{Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_grid.xml => Contacts/etc/frontend/page_types.xml} (83%) create mode 100644 app/code/Magento/Core/Model/Image/Adapter/Config.php delete mode 100644 app/code/Magento/Core/Model/Image/AdapterFactory.php create mode 100644 app/code/Magento/Core/Model/Layout/PageType/Config.php create mode 100644 app/code/Magento/Core/Model/Layout/PageType/Config/Converter.php create mode 100644 app/code/Magento/Core/Model/Layout/PageType/Config/Reader.php create mode 100644 app/code/Magento/Core/Model/Layout/PageType/Config/SchemaLocator.php create mode 100644 app/code/Magento/Core/Model/Module/Output/Config.php create mode 100644 app/code/Magento/Core/Model/Theme/Customization/Config.php create mode 100644 app/code/Magento/Core/Model/Theme/FileProvider.php create mode 100644 app/code/Magento/Core/Model/Theme/ThemeProvider.php rename app/code/Magento/Core/Model/{Image/Factory.php => View/Url/Config.php} (61%) create mode 100644 app/code/Magento/Core/etc/page_types.xsd create mode 100644 app/code/Magento/Customer/etc/frontend/page_types.xml rename app/{design/frontend/magento_plushe/Magento_Customer => code/Magento/Customer/view/frontend}/address/button.phtml (91%) rename app/{design/frontend/magento_plushe/Magento_Customer => code/Magento/Customer/view/frontend}/newcustomer.phtml (98%) rename app/code/Magento/{Oauth/etc/adminhtml/routes.xml => Downloadable/etc/frontend/page_types.xml} (83%) create mode 100644 app/code/Magento/GoogleCheckout/etc/frontend/page_types.xml rename app/code/Magento/{Oauth => Integration}/Controller/Token.php (67%) create mode 100644 app/code/Magento/Integration/Helper/Oauth/Consumer.php create mode 100644 app/code/Magento/Integration/Helper/Oauth/Data.php rename app/code/Magento/{Oauth/Model => Integration/Model/Oauth}/Consumer.php (57%) rename app/code/Magento/{Oauth/Model => Integration/Model/Oauth}/Consumer/Factory.php (87%) rename app/code/Magento/{Oauth/Model => Integration/Model/Oauth}/Consumer/Validator/KeyLength.php (91%) rename app/code/Magento/{Oauth/Model => Integration/Model/Oauth}/Nonce.php (71%) rename app/code/Magento/{Oauth/Model => Integration/Model/Oauth}/Nonce/Factory.php (73%) create mode 100644 app/code/Magento/Integration/Model/Oauth/Nonce/Generator.php rename app/code/Magento/{Oauth/Model => Integration/Model/Oauth}/Token.php (60%) rename app/code/Magento/{Oauth/Model => Integration/Model/Oauth}/Token/Factory.php (73%) create mode 100644 app/code/Magento/Integration/Model/Oauth/Token/Provider.php rename app/code/Magento/{Oauth/Model/Resource => Integration/Model/Resource/Oauth}/Consumer.php (85%) rename app/code/Magento/{Oauth/Model/Resource => Integration/Model/Resource/Oauth}/Consumer/Collection.php (88%) rename app/code/Magento/{Oauth/Model/Resource => Integration/Model/Resource/Oauth}/Nonce.php (92%) rename app/code/Magento/{Oauth/Model/Resource => Integration/Model/Resource/Oauth}/Nonce/Collection.php (88%) rename app/code/Magento/{Oauth/Model/Resource => Integration/Model/Resource/Oauth}/Token.php (86%) rename app/code/Magento/{Oauth/Model/Resource => Integration/Model/Resource/Oauth}/Token/Collection.php (78%) rename app/code/Magento/{Oauth => Integration}/etc/adminhtml/system.xml (98%) rename app/code/Magento/{Oauth => Integration}/etc/config.xml (96%) rename app/code/Magento/{Oauth => Integration}/etc/frontend/routes.xml (94%) rename app/code/Magento/{Oauth => Integration}/i18n/de_DE.csv (100%) rename app/code/Magento/{Oauth => Integration}/i18n/en_US.csv (100%) rename app/code/Magento/{Oauth => Integration}/i18n/es_ES.csv (100%) rename app/code/Magento/{Oauth => Integration}/i18n/fr_FR.csv (100%) rename app/code/Magento/{Oauth => Integration}/i18n/nl_NL.csv (100%) rename app/code/Magento/{Oauth => Integration}/i18n/pt_BR.csv (100%) rename app/code/Magento/{Oauth => Integration}/i18n/zh_CN.csv (100%) create mode 100644 app/code/Magento/Newsletter/etc/frontend/page_types.xml delete mode 100644 app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer.php delete mode 100644 app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php delete mode 100644 app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit/Form.php delete mode 100644 app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php delete mode 100644 app/code/Magento/Oauth/Block/Authorize/AbstractAuthorize.php delete mode 100644 app/code/Magento/Oauth/Block/Customer/Token/ListToken.php delete mode 100644 app/code/Magento/Oauth/Controller/Adminhtml/Oauth/Consumer.php delete mode 100644 app/code/Magento/Oauth/Service/OauthV1.php delete mode 100644 app/code/Magento/Oauth/etc/schema/OauthV1.xsd delete mode 100644 app/code/Magento/Oauth/sql/oauth_setup/install-1.0.0.0.php delete mode 100644 app/code/Magento/Oauth/sql/oauth_setup/upgrade-1.0.0.0-1.0.0.1.php create mode 100644 app/code/Magento/Ogone/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Page/view/frontend/js/splitbutton.js create mode 100644 app/code/Magento/Paypal/etc/frontend/page_types.xml create mode 100644 app/code/Magento/PaypalUk/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Review/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Rss/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Sales/etc/frontend/page_types.xml rename app/code/Magento/Sales/view/frontend/layout/{sales_guest_printorder.xml => sales_guest_print.xml} (95%) rename app/code/Magento/Sales/view/frontend/layout/{sales_guest_printordercreditmemo.xml => sales_guest_printcreditmemo.xml} (94%) rename app/code/Magento/Sales/view/frontend/layout/{sales_guest_printorderinvoice.xml => sales_guest_printinvoice.xml} (94%) rename app/code/Magento/Sales/view/frontend/layout/{sales_order_printordercreditmemo.xml => sales_order_printcreditmemo.xml} (94%) rename app/code/Magento/Sales/view/frontend/layout/{sales_order_printorderinvoice.xml => sales_order_printinvoice.xml} (95%) create mode 100644 app/code/Magento/Sendfriend/etc/frontend/page_types.xml create mode 100644 app/code/Magento/Shipping/etc/frontend/page_types.xml create mode 100644 app/code/Magento/User/data/user_setup/data-upgrade-1.6.1.4-1.6.1.5.php create mode 100644 app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php rename app/code/Magento/{Oauth/etc/adminhtml/menu.xml => Wishlist/etc/frontend/page_types.xml} (73%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Captcha/captcha.js (96%) create mode 100644 app/design/frontend/magento_backup/Magento_Captcha/default.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/checkout_onepage_index.xml rename app/design/frontend/{magento_plushe/Magento_Captcha/layout/override/base/customer_account_login.xml => magento_backup/Magento_Captcha/layout/override/base/contacts_index_index.xml} (93%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Captcha/layout/override/base/customer_account_create.xml (57%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Captcha/layout/override/base/customer_account_forgotpassword.xml (57%) create mode 100644 app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_login.xml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Captcha/onepage.js (78%) rename app/{code/Magento/Captcha/view/frontend => design/frontend/magento_backup/Magento_Captcha}/reload.png (100%) rename app/{code/Magento/Customer/view/frontend => design/frontend/magento_backup/Magento_Customer}/account/dashboard.phtml (98%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/account/dashboard/address.phtml rename app/{code/Magento/Oauth/etc/di.xml => design/frontend/magento_backup/Magento_Customer/account/dashboard/hello.phtml} (72%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/account/dashboard/info.phtml rename app/{code/Magento/Customer/view/frontend => design/frontend/magento_backup/Magento_Customer}/account/dashboard/newsletter.phtml (98%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/account/link/back.phtml (81%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/account/navigation.phtml (80%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/address.js rename app/{code/Magento/Customer/view/frontend => design/frontend/magento_backup/Magento_Customer}/address.phtml (98%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/address/book.phtml rename app/design/frontend/{magento_plushe/Magento_Customer/form/address.phtml => magento_backup/Magento_Customer/address/edit.phtml} (52%) rename app/{code/Magento/Customer/view/frontend => design/frontend/magento_backup/Magento_Customer}/balance.phtml (98%) rename app/{code/Magento/Customer/view/frontend => design/frontend/magento_backup/Magento_Customer}/form/address.phtml (98%) rename app/{code/Magento/Customer/view/frontend => design/frontend/magento_backup/Magento_Customer}/form/changepassword.phtml (98%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/form/confirmation.phtml (75%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/form/edit.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Customer/form/forgotpassword.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Customer/form/login.phtml rename app/{code/Magento/Customer/view/frontend => design/frontend/magento_backup/Magento_Customer}/form/mini.login.phtml (98%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/form/newsletter.phtml (54%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/form/register.phtml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/form/resetforgottenpassword.phtml (54%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/js/checkout-balance.js create mode 100644 app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account.xml create mode 100644 app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_confirmation.xml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/layout/override/base/customer_account_create.xml (69%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_createpassword.xml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/layout/override/base/customer_account_edit.xml (82%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/layout/override/base/customer_account_forgotpassword.xml (84%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_index.xml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/layout/override/base/customer_account_login.xml (70%) rename app/design/frontend/{magento_plushe/Magento_Customer/layout/override/base/customer_address_index.xml => magento_backup/Magento_Customer/layout/override/base/customer_account_logoutsuccess.xml} (70%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_form.xml rename app/{code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_index.xml => design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_index.xml} (83%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/layout/override/base/default.xml rename app/design/frontend/{magento_plushe/Magento_Customer/account/dashboard/hello.phtml => magento_backup/Magento_Customer/logout.phtml} (69%) create mode 100644 app/design/frontend/magento_backup/Magento_Customer/set-password.js create mode 100644 app/design/frontend/magento_backup/Magento_Customer/widget/dob.phtml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/widget/gender.phtml (51%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/widget/name.phtml (75%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Customer/widget/taxvat.phtml (56%) create mode 100644 app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/customer_account.xml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Newsletter/layout/override/base/default.xml (90%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Newsletter/layout/override/base/newsletter_manage_index.xml (79%) create mode 100644 app/design/frontend/magento_backup/Magento_Newsletter/newsletter.js create mode 100644 app/design/frontend/magento_backup/Magento_Newsletter/subscribe.phtml rename app/{code/Magento/Persistent/view/frontend => design/frontend/magento_backup/Magento_Persistent}/checkout/onepage/billing.phtml (100%) rename app/{code/Magento/Persistent/view/frontend => design/frontend/magento_backup/Magento_Persistent}/checkout/onepage/login.phtml (100%) rename app/{code/Magento/Persistent/view/frontend => design/frontend/magento_backup/Magento_Persistent}/customer/form/login.phtml (100%) rename app/{code/Magento/Persistent/view/frontend => design/frontend/magento_backup/Magento_Persistent}/customer/form/register.phtml (100%) rename app/design/frontend/{magento_plushe/Magento_Persistent/layout/override/base => magento_backup/Magento_Persistent/layout/override}/checkout_onepage_index.xml (52%) rename app/design/frontend/{magento_plushe/Magento_Persistent/layout/override/base => magento_backup/Magento_Persistent/layout/override}/customer_account_create.xml (65%) rename app/design/frontend/{magento_plushe/Magento_Persistent/layout/override/base => magento_backup/Magento_Persistent/layout/override}/customer_account_login.xml (66%) create mode 100644 app/design/frontend/magento_backup/Magento_Persistent/remember-me-popup.js rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Persistent/remember_me.phtml (68%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Persistent/remember_me_tooltip.phtml (98%) rename app/{code/Magento/Persistent/view/frontend => design/frontend/magento_backup/Magento_Persistent}/splitbutton.js (100%) create mode 100644 app/design/frontend/magento_backup/Magento_ProductAlert/email/price.phtml create mode 100644 app/design/frontend/magento_backup/Magento_ProductAlert/email/stock.phtml create mode 100644 app/design/frontend/magento_backup/Magento_ProductAlert/layout/override/catalog_product_view.xml create mode 100644 app/design/frontend/magento_backup/Magento_ProductAlert/product/view.phtml rename app/design/frontend/magento_backup/Magento_Sales/layout/override/{sales_guest_printorder.xml => sales_guest_print.xml} (95%) rename app/design/frontend/magento_backup/Magento_Sales/layout/override/{sales_guest_printordercreditmemo.xml => sales_guest_printcreditmemo.xml} (94%) rename app/design/frontend/magento_backup/Magento_Sales/layout/override/{sales_guest_printorderinvoice.xml => sales_guest_printinvoice.xml} (95%) rename app/design/frontend/magento_backup/Magento_Sales/layout/override/{sales_order_printordercreditmemo.xml => sales_order_printcreditmemo.xml} (95%) rename app/design/frontend/magento_backup/Magento_Sales/layout/override/{sales_order_printorderinvoice.xml => sales_order_printinvoice.xml} (95%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/button/share.phtml (82%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/button/tocart.phtml (88%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/button/update.phtml (87%) create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/email/items.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/email/rss.phtml rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/item/column/cart.phtml (78%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/item/column/image.phtml (77%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/item/column/info.phtml (66%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/item/column/remove.phtml (90%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/item/configure/addto.phtml (78%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/item/list.phtml (76%) create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/js/add-to-wishlist.js create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/js/search.js create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/customer_account.xml rename app/{code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_edit.xml => design/frontend/magento_backup/Magento_Wishlist/layout/override/base/default.xml} (74%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/layout/override/base/wishlist_index_configure.xml (77%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_bundle.xml (64%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_configurable.xml (71%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_grouped.xml (69%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_simple.xml (82%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/layout/override/base/wishlist_index_index.xml (70%) rename app/{code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_new.xml => design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_share.xml} (73%) rename app/design/frontend/{magento_plushe => magento_backup}/Magento_Wishlist/layout/override/base/wishlist_shared_index.xml (90%) create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/options_list.phtml rename app/{code/Magento/Oauth/etc/module.xml => design/frontend/magento_backup/Magento_Wishlist/render/item/price.phtml} (58%) mode change 100755 => 100644 create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_item.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_rss.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/shared.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/sharing.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/sidebar.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/view.phtml create mode 100644 app/design/frontend/magento_backup/Magento_Wishlist/wishlist.js delete mode 100644 app/design/frontend/magento_plushe/Magento_Captcha/default.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/checkout_onepage_index.xml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/address.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/info.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/address/book.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/address/edit.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/form/changepassword.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/form/edit.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/form/forgotpassword.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/form/login.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/form/register.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_index.xml delete mode 100644 app/design/frontend/magento_plushe/Magento_Customer/widget/dob.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Newsletter/subscribe.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Wishlist/shared.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Wishlist/sharing.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Wishlist/sidebar.phtml delete mode 100644 app/design/frontend/magento_plushe/Magento_Wishlist/view.phtml create mode 100644 app/design/frontend/magento_plushe/images/express-checkout-retina.png create mode 100644 app/design/frontend/magento_plushe/js/responsive.js create mode 100644 app/design/frontend/magento_plushe/less/responsive/responsive.less rename dev/tests/integration/testsuite/Magento/{Core/Model => App}/Cache/Frontend/PoolTest.php (84%) create mode 100644 dev/tests/integration/testsuite/Magento/Core/Model/Image/Adapter/ConfigTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Filesystem/File/ReadTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Filesystem/File/WriteTest.php rename dev/tests/integration/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/ReaderTest.php (93%) rename dev/tests/integration/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/_files/Magento/Test/etc/fieldset.xml (96%) rename dev/tests/integration/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/_files/Magento/Test/etc/module.xml (100%) rename dev/tests/integration/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/_files/expectedArray.php (100%) rename dev/tests/integration/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/_files/partialFieldsetFirst.xml (96%) rename dev/tests/integration/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/_files/partialFieldsetSecond.xml (96%) create mode 100644 dev/tests/integration/testsuite/Magento/Object/CopyTest.php rename dev/tests/integration/testsuite/Magento/{Core/Model => View/Design}/Theme/ValidatorTest.php (91%) rename dev/tests/integration/testsuite/Magento/{Core/Model => }/View/FileSystemTest.php (93%) rename dev/tests/integration/testsuite/Magento/{Core/Model => }/View/PublicationTest.php (95%) create mode 100644 dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php rename app/code/Magento/Oauth/etc/adminhtml/acl.xml => dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/design-abstraction_select.html (63%) create mode 100644 dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/customer_account.xml create mode 100644 dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/page_empty.xml create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/DependenciesCollector.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Parser.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/ParserFactory.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/StaticCalls.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Throws.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Tokens.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Uses.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/Utility/Validator.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/InjectableTest.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ParserFactoryTest.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/StaticCallsTest.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ThrowsTest.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/TokensTest.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php create mode 100644 dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php create mode 100644 dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt rename dev/tests/{integration/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php => static/testsuite/Magento/Test/Integrity/PageType/FilesTest.php} (52%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/Cache/Frontend/FactoryTest.php (92%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php (96%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/Cache/Frontend/PoolTest.php (78%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/Cache/StateTest.php (91%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/Cache/Type/AccessProxyTest.php (92%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/Cache/Type/FrontendPoolTest.php (77%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/Cache/Type/GenericTest.php (75%) rename dev/tests/unit/testsuite/Magento/{Core/Model => App}/CacheTest.php (94%) rename dev/tests/unit/testsuite/Magento/{Core/Model => }/Cache/Config/ConverterTest.php (90%) rename dev/tests/unit/testsuite/Magento/{Core/Model => }/Cache/Config/_files/cache_config.php (91%) rename dev/tests/unit/testsuite/Magento/{Core/Model => }/Cache/Config/_files/cache_config.xml (94%) rename dev/tests/unit/testsuite/Magento/{Core/Model => }/Cache/ConfigTest.php (80%) delete mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/LocaleTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/Theme/ThemeProviderTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Image/AdapterFactoryTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/OauthTest.php rename dev/tests/unit/testsuite/Magento/{Oauth/Helper/DataTest.php => Integration/Helper/Oauth/RequestTest.php} (69%) create mode 100644 dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php rename dev/tests/unit/testsuite/Magento/{Core/Model/ModuleManagerTest.php => Module/ManagerTest.php} (84%) delete mode 100644 dev/tests/unit/testsuite/Magento/Oauth/Helper/ServiceTest.php delete mode 100644 dev/tests/unit/testsuite/Magento/Oauth/Service/OauthV1Test.php rename dev/tests/unit/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/ConverterTest.php (84%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/_files/fieldset.xml (93%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/Config/_files/fieldset_config.php (100%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Fieldset => Object/Copy}/ConfigTest.php (86%) rename dev/tests/unit/testsuite/Magento/{Core/Model => }/View/DeployedFilesManagerTest.php (74%) rename dev/tests/unit/testsuite/Magento/{Core/Model => View/Design}/Theme/Customization/AbstractFileTest.php (81%) rename dev/tests/unit/testsuite/Magento/{Core/Model => View/Design}/Theme/Customization/PathTest.php (83%) rename dev/tests/unit/testsuite/Magento/{Core/Model => View/Design}/Theme/CustomizationTest.php (53%) create mode 100644 dev/tests/unit/testsuite/Magento/View/Design/Theme/FlyweightFactoryTest.php rename dev/tests/unit/testsuite/Magento/{Core/Model => View/Design}/Theme/ImageTest.php (84%) rename dev/tests/unit/testsuite/Magento/{Core/Model => }/View/FileSystemTest.php (90%) rename dev/tests/unit/testsuite/Magento/{Core/Helper/CssTest.php => View/Url/CssResolverTest.php} (96%) rename dev/tests/unit/testsuite/Magento/{Core/Helper => View/Url}/_files/result.css (100%) rename dev/tests/unit/testsuite/Magento/{Core/Helper => View/Url}/_files/source.css (100%) rename dev/tests/unit/testsuite/Magento/{Core/Model => }/View/UrlTest.php (76%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache.php (89%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Frontend/Factory.php (99%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Frontend/Pool.php (94%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/InstanceFactory.php (97%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Proxy.php (98%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/State.php (84%) create mode 100644 lib/Magento/App/Cache/State/OptionsInterface.php rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/StateInterface.php (97%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Type/AccessProxy.php (93%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Type/Block.php (87%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Type/Collection.php (87%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Type/Config.php (87%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Type/FrontendPool.php (84%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Type/Layout.php (87%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/Type/Translate.php (87%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/TypeList.php (88%) rename {app/code/Magento/Core/Model => lib/Magento/App}/Cache/TypeListInterface.php (97%) rename {app/code/Magento/Core/Model => lib/Magento}/Cache/Config.php (76%) rename {app/code/Magento/Core/Model => lib/Magento}/Cache/Config/Converter.php (98%) rename {app/code/Magento/Core/Model => lib/Magento}/Cache/Config/Data.php (90%) rename {app/code/Magento/Core/Model => lib/Magento}/Cache/Config/Reader.php (85%) rename {app/code/Magento/Core/Model => lib/Magento}/Cache/Config/SchemaLocator.php (81%) create mode 100644 lib/Magento/Cache/ConfigInterface.php rename {app/code/Magento/Core => lib/Magento/Cache}/etc/cache.xsd (100%) rename app/code/Magento/Core/Model/BlockFactory.php => lib/Magento/File/UploaderFactory.php (75%) create mode 100644 lib/Magento/Filesystem/Directory/Read.php create mode 100644 lib/Magento/Filesystem/Directory/ReadInterface.php create mode 100644 lib/Magento/Filesystem/Directory/Write.php create mode 100644 lib/Magento/Filesystem/Directory/WriteInterface.php create mode 100644 lib/Magento/Filesystem/File/Read.php create mode 100644 lib/Magento/Filesystem/File/ReadFactory.php create mode 100644 lib/Magento/Filesystem/File/ReadInterface.php create mode 100644 lib/Magento/Filesystem/File/Write.php create mode 100644 lib/Magento/Filesystem/File/WriteFactory.php create mode 100644 lib/Magento/Filesystem/File/WriteInterface.php rename app/code/Magento/ImportExport/Model/HttpAdapterFactory.php => lib/Magento/HTTP/Adapter/FileTransferFactory.php (94%) create mode 100644 lib/Magento/Image/Adapter/AdapterInterface.php create mode 100644 lib/Magento/Image/Adapter/ConfigInterface.php create mode 100644 lib/Magento/Image/AdapterFactory.php create mode 100644 lib/Magento/Image/Factory.php rename app/code/Magento/Core/Model/ModuleManager.php => lib/Magento/Module/Manager.php (79%) create mode 100644 lib/Magento/Module/Output/ConfigInterface.php create mode 100644 lib/Magento/Oauth/ConsumerInterface.php rename {app/code => lib}/Magento/Oauth/Exception.php (100%) rename app/code/Magento/Oauth/Helper/Service.php => lib/Magento/Oauth/Helper/Oauth.php (55%) rename app/code/Magento/Oauth/Helper/Data.php => lib/Magento/Oauth/Helper/Request.php (61%) create mode 100644 lib/Magento/Oauth/NonceGeneratorInterface.php create mode 100644 lib/Magento/Oauth/Oauth.php rename app/code/Magento/Oauth/Service/OauthV1Interface.php => lib/Magento/Oauth/OauthInterface.php (51%) create mode 100644 lib/Magento/Oauth/TokenProviderInterface.php create mode 100644 lib/Magento/Object/Copy.php rename {app/code/Magento/Core/Model/Fieldset => lib/Magento/Object/Copy}/Config.php (84%) rename {app/code/Magento/Core/Model/Fieldset => lib/Magento/Object/Copy}/Config/Converter.php (92%) rename {app/code/Magento/Core/Model/Fieldset => lib/Magento/Object/Copy}/Config/Data.php (95%) rename {app/code/Magento/Core/Model/Fieldset => lib/Magento/Object/Copy}/Config/Reader.php (92%) rename {app/code/Magento/Core/Model/Fieldset => lib/Magento/Object/Copy}/Config/SchemaLocator.php (78%) rename {app/code/Magento/Core => lib/Magento/Object}/etc/fieldset.xsd (100%) rename {app/code/Magento/Core => lib/Magento/Object}/etc/fieldset_file.xsd (99%) rename {app/code/Magento/Core/Model => lib/Magento}/View/Config.php (86%) rename {app/code/Magento/Core/Model => lib/Magento}/View/DeployedFilesManager.php (83%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization.php (57%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization/AbstractFile.php (76%) create mode 100644 lib/Magento/View/Design/Theme/Customization/ConfigInterface.php rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization/File/Css.php (91%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization/File/Js.php (91%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization/FileAssetInterface.php (95%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization/FileInterface.php (70%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization/FileServiceFactory.php (68%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Customization/Path.php (89%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/CustomizationInterface.php (90%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Domain/Factory.php (76%) create mode 100644 lib/Magento/View/Design/Theme/File/CollectionInterface.php rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/FileFactory.php (92%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/FileInterface.php (89%) create mode 100644 lib/Magento/View/Design/Theme/FileProviderInterface.php rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/FlyweightFactory.php (63%) rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Image.php (88%) create mode 100644 lib/Magento/View/Design/Theme/Image/PathInterface.php rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Image/Uploader.php (82%) create mode 100644 lib/Magento/View/Design/Theme/ImageFactory.php create mode 100644 lib/Magento/View/Design/Theme/ThemeProviderInterface.php rename {app/code/Magento/Core/Model => lib/Magento/View/Design}/Theme/Validator.php (92%) create mode 100644 lib/Magento/View/Element/BlockFactory.php rename {app/code/Magento/Core/Model => lib/Magento}/View/FileSystem.php (94%) rename {app/code/Magento/Core/Model => lib/Magento}/View/PublicFilesManagerInterface.php (93%) rename {app/code/Magento/Core/Model => lib/Magento}/View/Publisher.php (91%) rename {app/code/Magento/Core/Model => lib/Magento}/View/Service.php (91%) rename {app/code/Magento/Core/Model => lib/Magento}/View/Url.php (72%) create mode 100644 lib/Magento/View/Url/ConfigInterface.php rename app/code/Magento/Core/Helper/Css.php => lib/Magento/View/Url/CssResolver.php (96%) diff --git a/CHANGELOG.md b/CHANGELOG.md index b00766c9f50..d601a36f590 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +2.0.0.0-dev52 +============= +* Better Navigation menu rendering due to improved Caching of Categories +* Added Magento\Filesystem\Directory and Magento\Filesystem\File to the library +* Various improvements: + * Added a static test to check for incorrect dependencies in the library + * Moved Magento\Core\Model\Theme to the Magento\View component + * Moved Magento\Core\Model\Design to the Magento\View component + * Consistent declaration of page-types + * The Framework part of the Cache functionality moved out from modules +* Themes update: + * Updated templates and layout updates in the Captcha, Customer, Newsletter, Persistent, ProductAlert, Wishlist modules; old files moved to the "magento-backup" theme + * Refactored and removed duplicate Persistent module templates + * Plushe theme made responsive +* Fixed bugs: + * Fixed inability to print order, invoice, or creditmemo in the frontend + * Fixed fatal error caused by the Mage_Backend_Block_System_Config_FormTest integration test + * Fixed the broken link when the MAP feature is enabled and actual product price is set to be displayed in the shopping cart +* Moved the following methods from Core Helpers to the appropriate libraries: + * Moved the Data Helper date format related functions to \Magento\Core\Model\Locale + * Moved the Data Helper array decoration related functions to Magento\Stdlib\ArrayUtils + * Moved the Data Helper functions that copy data from one object to another to \Magento\Object\Copy + 2.0.0.0-dev51 ============= * Application areas rework: diff --git a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php index f262f7e6408..53e5ffec1e2 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php @@ -37,19 +37,19 @@ class CacheOutdated protected $_authorization; /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** * @param \Magento\AuthorizationInterface $authorization * @param \Magento\UrlInterface $urlBuilder - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList */ public function __construct( \Magento\AuthorizationInterface $authorization, \Magento\UrlInterface $urlBuilder, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + \Magento\App\Cache\TypeListInterface $cacheTypeList ) { $this->_authorization = $authorization; $this->_urlBuilder = $urlBuilder; diff --git a/app/code/Magento/Adminhtml/Block/Media/Uploader.php b/app/code/Magento/Adminhtml/Block/Media/Uploader.php index 4bb0f7e8326..e2b72f17e51 100644 --- a/app/code/Magento/Adminhtml/Block/Media/Uploader.php +++ b/app/code/Magento/Adminhtml/Block/Media/Uploader.php @@ -42,7 +42,7 @@ class Uploader extends \Magento\Adminhtml\Block\Widget protected $_template = 'Magento_Adminhtml::media/uploader.phtml'; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -54,14 +54,14 @@ class Uploader extends \Magento\Adminhtml\Block\Widget /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\File\Size $fileSize * @param array $data */ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\File\Size $fileSize, array $data = array() ) { diff --git a/app/code/Magento/Adminhtml/etc/di.xml b/app/code/Magento/Adminhtml/etc/di.xml index c3fa4d3d403..d4a999e0e2e 100644 --- a/app/code/Magento/Adminhtml/etc/di.xml +++ b/app/code/Magento/Adminhtml/etc/di.xml @@ -26,7 +26,7 @@ <config> <type name="Magento\Catalog\Controller\Adminhtml\Product\Attribute"> <param name="attributeLabelCache"> - <instance type="Magento\Core\Model\Cache\Type\Translate" /> + <instance type="Magento\App\Cache\Type\Translate" /> </param> </type> <type name="Magento\Backend\Helper\Dashboard\Data"> diff --git a/app/code/Magento/Adminhtml/i18n/de_DE.csv b/app/code/Magento/Adminhtml/i18n/de_DE.csv index 1b6f2901ab5..5e27124f3b6 100644 --- a/app/code/Magento/Adminhtml/i18n/de_DE.csv +++ b/app/code/Magento/Adminhtml/i18n/de_DE.csv @@ -91,7 +91,6 @@ "All Files","Alle Dateien" "All Reviews","Alle Beurteilungen" "All Store Views","Alle Ladenansichten" -"All Tags","Alle Tags" "All Websites","Alle Websites" "All countries","Alle Länder" "All fields","Alle Felder" @@ -143,7 +142,6 @@ "Area","Bereich" "As low as:","Unterster Wert:" "Assigned","Zugewiesen" -"Tags","Verknüpfte Tags" "Attribute Set Name:","Name der Attributmenge:" "Attributes","Attribute" "Automatic","Automatisch" @@ -558,7 +556,6 @@ "New Sitemap","Neue Sitemap" "New Store View","Neue Ladenansicht" "New System Template","Neue Systemvorlage" -"New Tag","Neues Tag" "New Template","Neue Vorlage" "New User","Neuer Benutzer" "New Variable","Neue Variable" @@ -633,7 +630,6 @@ "Payment method is not available.","Zahlungsform ist nicht verfügbar." "Payment method must be specified.","Angabe der Zahlungsmethode erforderlich." "Pending Reviews","Ausstehende Beurteilungen" -"Pending Tags","Ausstehende Tags" "Per Item","Je Element" "Per Order","Je Bestellung" "Percent","Prozent" @@ -678,7 +674,6 @@ "Please select one of the above options.","Wählen Sie bitte eine der obigen Optionen aus." "Please select one of the options.","Wählen Sie eine der Optionen aus." "Please select review(s).","Wählen Sie (eine) Beurteilung aus." -"Please select tag(s).","Wählen Sie bitte einen oder mehrere Tags aus." "Please specify backup creation options","Bitte die Optionen für die Ausführung des Backups bestimmen" "Please specify the admin custom URL.","Geben Sie bitte die Admin-URL des Kunden ein." "Please try to logout and sign in again.","Melden Sie sich ab und melden Sie sich dann erneut an." @@ -883,7 +878,6 @@ "System","System" "System Section","Systembereich" "System busy","System belegt" -"Tags","Tags" "Target Path","Zielpfad" "Tax","Steuern" "Tb","TB" @@ -961,8 +955,6 @@ "The shipment has been created.","Die Lieferung wurde erstellt." "The shipment has been sent.","Die Sendung ist ausgeliefert worden." "The shipping label has been created.","Das Versandlabel wurde erstellt." -"The tag has been deleted.","Das Tag wurde gelöscht." -"The tag has been saved.","Der Tag (dt. Etikett, Marke) ist gesichert worden." "The transaction details have been updated.","Die Transaktionsdetails sind aktualisiert worden." "The user has been deleted.","Der Benutzer wurde gelöscht." "The user has been saved.","Der Benutzer ist gespeichert worden." @@ -1022,7 +1014,6 @@ "URL Rewrite Management","URL-Rewrite-Verwaltung" "Unable to cancel the credit memo.","Gutschrift kann nicht storniert werden." "Unable to find a Email Template to delete.","Keine E-Mail-Vorlage zum Löschen gefunden." -"Unable to find a tag to delete.","Kein Tag zum Löschen gefunden." "Unable to find a user to delete.","Kein zu löschender Benutzer auffindbar." "Unable to initialize import model","Importmodell kann nicht initialisiert werden." "Unable to refresh lifetime statistics.","Lebenszeitstatistik kann nicht aktualisiert werden." @@ -1106,7 +1097,6 @@ "Wrong newsletter template.","Falsche Newsletter-Vorlage." "Wrong quote item.","Falsches Inhaltselement." "Wrong tab configuration.","Fehlerhafte Konfiguration der Registerkarte." -"Wrong tag was specified.","Falsches Tag angegeben." "Wrong transaction ID specified.","Falsche Transaktions-ID angegeben." "XML","XML" "XML data is invalid.","XML-Daten sind ungültig." diff --git a/app/code/Magento/Adminhtml/i18n/en_US.csv b/app/code/Magento/Adminhtml/i18n/en_US.csv index 506d9596eb7..1ed1af94ffb 100644 --- a/app/code/Magento/Adminhtml/i18n/en_US.csv +++ b/app/code/Magento/Adminhtml/i18n/en_US.csv @@ -91,7 +91,6 @@ "All Files","All Files" "All Reviews","All Reviews" "All Store Views","All Store Views" -"All Tags","All Tags" "All Websites","All Websites" "All countries","All countries" "All fields","All fields" @@ -143,7 +142,6 @@ "Area","Area" "As low as:","As low as:" "Assigned","Assigned" -"Tags","Tags" "Attribute Set Name:","Attribute Set Name:" "Attributes","Attributes" "Automatic (equalize price ranges)","Automatic (equalize price ranges)" @@ -568,7 +566,6 @@ "New Sitemap","New Sitemap" "New Store View","New Store View" "New System Template","New System Template" -"New Tag","New Tag" "New Template","New Template" "New User","New User" "New Variable","New Variable" @@ -644,7 +641,6 @@ "Payment method is not available.","Payment method is not available." "Payment method must be specified.","Payment method must be specified." "Pending Reviews","Pending Reviews" -"Pending Tags","Pending Tags" "Per Item","Per Item" "Per Order","Per Order" "Percent","Percent" @@ -689,7 +685,6 @@ "Please select one of the above options.","Please select one of the above options." "Please select one of the options.","Please select one of the options." "Please select review(s).","Please select review(s)." -"Please select tag(s).","Please select tag(s)." "Please specify backup creation options","Please specify backup creation options" "Please specify the admin custom URL.","Please specify the admin custom URL." "Please try to logout and sign in again.","Please try to logout and sign in again." @@ -900,7 +895,6 @@ "System","System" "System Section","System Section" "System busy","System busy" -"Tags","Tags" "Target Path","Target Path" "Tax","Tax" "Tb","Tb" @@ -978,8 +972,6 @@ "The shipment has been created.","The shipment has been created." "The shipment has been sent.","The shipment has been sent." "The shipping label has been created.","The shipping label has been created." -"The tag has been deleted.","The tag has been deleted." -"The tag has been saved.","The tag has been saved." "The transaction details have been updated.","The transaction details have been updated." "The user has been deleted.","The user has been deleted." "The user has been saved.","The user has been saved." @@ -1040,7 +1032,6 @@ "URL Rewrite Management","URL Rewrite Management" "Unable to cancel the credit memo.","Unable to cancel the credit memo." "Unable to find a Email Template to delete.","Unable to find a Email Template to delete." -"Unable to find a tag to delete.","Unable to find a tag to delete." "Unable to find a user to delete.","Unable to find a user to delete." "Unable to initialize import model","Unable to initialize import model" "Unable to refresh lifetime statistics.","Unable to refresh lifetime statistics." @@ -1124,7 +1115,6 @@ "Wrong newsletter template.","Wrong newsletter template." "Wrong quote item.","Wrong quote item." "Wrong tab configuration.","Wrong tab configuration." -"Wrong tag was specified.","Wrong tag was specified." "Wrong transaction ID specified.","Wrong transaction ID specified." "XML","XML" "XML data is invalid.","XML data is invalid." diff --git a/app/code/Magento/Adminhtml/i18n/es_ES.csv b/app/code/Magento/Adminhtml/i18n/es_ES.csv index 104276a3d60..39bf86f8596 100644 --- a/app/code/Magento/Adminhtml/i18n/es_ES.csv +++ b/app/code/Magento/Adminhtml/i18n/es_ES.csv @@ -91,7 +91,6 @@ "All Files","Todos los Archivos" "All Reviews","Todas las Revisiones" "All Store Views","Todas las vistas de tienda" -"All Tags","Todas la Etiquetas" "All Websites","Todos los Sitios Web" "All countries","Todos los paÃses" "All fields","Todos los campos" @@ -143,7 +142,6 @@ "Area","Ãrea" "As low as:","Tan bajo como:" "Assigned","Asignado" -"Tags","Etiquetas asociadas" "Attribute Set Name:","Nombre del conjunto de atributos:" "Attributes","Atributos" "Automatic","Automático" @@ -558,7 +556,6 @@ "New Sitemap","Nuevo mapa del sitio web" "New Store View","Nueva vista de tienda" "New System Template","Nueva plantilla del sistema" -"New Tag","Nueva Etiqueta" "New Template","Nueva Plantilla" "New User","Nuevo usuario" "New Variable","Nueva variable" @@ -633,7 +630,6 @@ "Payment method is not available.","No está disponible el método de pago." "Payment method must be specified.","Se debe especificar el método de pago." "Pending Reviews","Revisiones Pendientes" -"Pending Tags","Etiquetas Pendientes" "Per Item","Por artÃculo" "Per Order","Por Pedido" "Percent","Porcentaje" @@ -678,7 +674,6 @@ "Please select one of the above options.","Por favor, selecciona una de las opciones anteriores." "Please select one of the options.","Seleccione una de las opciones." "Please select review(s).","Seleccione reseñas." -"Please select tag(s).","Por favor, selecciona la(s) etiqueta(s):" "Please specify backup creation options","Por favor especifica las opciones de creación de la copia de seguridad" "Please specify the admin custom URL.","Por favor, especifica la dirección URL personalizada de administración." "Please try to logout and sign in again.","Intente cerrar sesión y volver a iniciarla." @@ -883,7 +878,6 @@ "System","Sistema" "System Section","Selección de Sistema" "System busy","El sistema está ocupado" -"Tags","Etiquetas" "Target Path","Ruta objetivo" "Tax","Impuestos" "Tb","Tb" @@ -961,8 +955,6 @@ "The shipment has been created.","Se creó el en" "The shipment has been sent.","Se ha enviado el pedido." "The shipping label has been created.","Se ha creado la etiqueta de envÃo." -"The tag has been deleted.","Se ha borrado la etiqueta." -"The tag has been saved.","Se ha guardado la etiqueta." "The transaction details have been updated.","Se han actualizado los detalles de la transacción." "The user has been deleted.","Se eliminó el usuario." "The user has been saved.","Se ha guardado el usuario." @@ -1022,7 +1014,6 @@ "URL Rewrite Management","Administración de la reescritura de la URL" "Unable to cancel the credit memo.","Deshabilitar cancelación de nota de crédito." "Unable to find a Email Template to delete.","Deshabilitar encontrar plantilla de email para eliminar." -"Unable to find a tag to delete.","Incapaz de encontrar el tag a eliminar" "Unable to find a user to delete.","No se puede encontrar un usuario para eliminar." "Unable to initialize import model","Incapaz de iniciar el modelo de importación" "Unable to refresh lifetime statistics.","Incapaz de volver a cargar estadÃsticas totales." @@ -1106,7 +1097,6 @@ "Wrong newsletter template.","Plantilla de boletÃn de noticias errónea." "Wrong quote item.","ArtÃculo mal expresado." "Wrong tab configuration.","Configuración de pestañas no válido." -"Wrong tag was specified.","Se ha especificado una etiqueta errónea." "Wrong transaction ID specified.","ID de transacción especificada errónea." "XML","XML" "XML data is invalid.","dato XML inválido" diff --git a/app/code/Magento/Adminhtml/i18n/fr_FR.csv b/app/code/Magento/Adminhtml/i18n/fr_FR.csv index 6872e3e5626..ec17ff90df4 100644 --- a/app/code/Magento/Adminhtml/i18n/fr_FR.csv +++ b/app/code/Magento/Adminhtml/i18n/fr_FR.csv @@ -91,7 +91,6 @@ "All Files","Tous les Fichiers" "All Reviews","Tous les avis" "All Store Views","Toutes les vues de la boutique" -"All Tags","Tous les tags" "All Websites","Tous les sites web" "All countries","Tous les pays" "All fields","Tous les champs" @@ -143,7 +142,6 @@ "Area","Zone" "As low as:","Aussi bas que :" "Assigned","Assigné" -"Tags","Tags associés" "Attribute Set Name:","Nom du jeu d'attributs:" "Attributes","Attributs" "Automatic","Automatique" @@ -558,7 +556,6 @@ "New Sitemap","Nouveau plan du site" "New Store View","Vue nouvelle boutique" "New System Template","Nouveau modèle de livraison" -"New Tag","Nouveau tag" "New Template","Nouveau modèle" "New User","Nouvel utilisateur" "New Variable","Nouvelle variable" @@ -633,7 +630,6 @@ "Payment method is not available.","La méthode de paiement n'est pas disponible." "Payment method must be specified.","Le mode de paiement doit être précisé." "Pending Reviews","Avis en attente" -"Pending Tags","Tags en attente" "Per Item","Par article" "Per Order","Par commande" "Percent","pour cent" @@ -678,7 +674,6 @@ "Please select one of the above options.","Veuillez sélectionner l'un des choix ci-dessus." "Please select one of the options.","Veuillez sélectionner l'une des options." "Please select review(s).","Veuillez sélectionner les avis." -"Please select tag(s).","Veuillez sélectionner une/des étiquette(s)." "Please specify backup creation options","Veuillez préciser les options de création de la sauvegarde" "Please specify the admin custom URL.","Veuillez préciser la nouvelle URL d'aminnistration." "Please try to logout and sign in again.","Veuillez essayer de vous déconnecter, puis de vous connecter à nouveau." @@ -883,7 +878,6 @@ "System","Système" "System Section","Section système" "System busy","Le système est occupé" -"Tags","Étiquettes" "Target Path","Chemin cible" "Tax","Taxe" "Tb","Tb" @@ -961,8 +955,6 @@ "The shipment has been created.","L'envoi a été créé." "The shipment has been sent.","La commande a été expédiée." "The shipping label has been created.","L'étiquette d'expédition a été créée." -"The tag has been deleted.","L'étiquette a été supprimée" -"The tag has been saved.","L'étiquette a été sauvegardée." "The transaction details have been updated.","Les détails de la transaction ont été mis a jour." "The user has been deleted.","L'utilisateur a été supprimé." "The user has been saved.","L'utilisateur a été sauvegardé." @@ -1022,7 +1014,6 @@ "URL Rewrite Management","Gestion de la réécriture URL" "Unable to cancel the credit memo.","Impossible d'annuler l'avoir." "Unable to find a Email Template to delete.","Impossible de trouver un modèle d'email à supprimer." -"Unable to find a tag to delete.","Impossible de trouver une étiquette à supprimer." "Unable to find a user to delete.","Impossible de trouver un utilisateur à effacer." "Unable to initialize import model","Impossible d'initialiser le modèle importé" "Unable to refresh lifetime statistics.","Impossible de réactualiser les statistiques de durée de vie" @@ -1106,7 +1097,6 @@ "Wrong newsletter template.","Mauvais modèle de lettre de diffusion" "Wrong quote item.","Mauvais objet" "Wrong tab configuration.","L'onglet de configuration est erroné." -"Wrong tag was specified.","Une mauvaise étiquette a été définie." "Wrong transaction ID specified.","Mauvais identifiant transaction défini." "XML","XML" "XML data is invalid.","Données XML invalides" diff --git a/app/code/Magento/Adminhtml/i18n/nl_NL.csv b/app/code/Magento/Adminhtml/i18n/nl_NL.csv index 44a0f6bba18..635f28d6f23 100644 --- a/app/code/Magento/Adminhtml/i18n/nl_NL.csv +++ b/app/code/Magento/Adminhtml/i18n/nl_NL.csv @@ -91,7 +91,6 @@ "All Files","Alle Bestanden" "All Reviews","Alle Recensies" "All Store Views","Alle Winkelbezichtigingen" -"All Tags","Alle Labels" "All Websites","Alle Websites" "All countries","Alle landen" "All fields","Alle velden" @@ -143,7 +142,6 @@ "Area","Gebied" "As low as:","Zo laag als:" "Assigned","Toegewezen" -"Tags","Gerelateerde tags" "Attribute Set Name:","Attribuut set naam:" "Attributes","Attributen" "Automatic","Automatisch" @@ -558,7 +556,6 @@ "New Sitemap","Nieuwe Sitemap" "New Store View","Nieuwe Winkel Bezichtiging" "New System Template","Nieuw Systeemtemplate" -"New Tag","Nieuwe Tag" "New Template","Nieuw Sjabloon" "New User","Nieuwe Gebruiker" "New Variable","Nieuw Variabele" @@ -633,7 +630,6 @@ "Payment method is not available.","Betalingsmethode is niet beschikbaar." "Payment method must be specified.","Betalingsmethode moet gekozen worden." "Pending Reviews","In afwachting van beoordelingen" -"Pending Tags","Nog niet actieve Tags" "Per Item","Per Stuk" "Per Order","Per Bestelling" "Percent","Procent" @@ -678,7 +674,6 @@ "Please select one of the above options.","Selecteer alstublieft een van de bovenstaande opties." "Please select one of the options.","Selecteer a.u.b. één van de opties." "Please select review(s).","Selecteer alstublieft recentie(s)." -"Please select tag(s).","Selecteer a.u.b. (een) tag(s)" "Please specify backup creation options","Specificeer aub de backup creatie opties" "Please specify the admin custom URL.","Specificeer a.u.b. de admin standaard URL." "Please try to logout and sign in again.","Probeer uit te loggen en log opnieuw in." @@ -883,7 +878,6 @@ "System","Systeem" "System Section","Systeem Sectie" "System busy","Systeem bezig" -"Tags","Labels" "Target Path","Doelpad" "Tax","Belasting" "Tb","Tb" @@ -961,8 +955,6 @@ "The shipment has been created.","De verzending is aangemaakt." "The shipment has been sent.","De bestelling is verzonden." "The shipping label has been created.","Het verzendingslabel is aangemaakt." -"The tag has been deleted.","Dit Label is verwijderd." -"The tag has been saved.","De tag is opgeslagen." "The transaction details have been updated.","De transactiegegevens zijn bijgewerkt." "The user has been deleted.","De gebruiker is verwijderd." "The user has been saved.","De gebruiker is opgeslagen." @@ -1022,7 +1014,6 @@ "URL Rewrite Management","URL Herschrijf Management" "Unable to cancel the credit memo.","Niet mogelijk om creditnota te annuleren." "Unable to find a Email Template to delete.","Kan geen Email-Template vinden om te verwijderen." -"Unable to find a tag to delete.","Kan geen tag vinden om te verwijderen." "Unable to find a user to delete.","Kan geen gebruiker vinden om te verwijderen." "Unable to initialize import model","Kan importmodel niet initialiseren" "Unable to refresh lifetime statistics.","Kan levensduur statistieken niet vernieuwen." @@ -1106,7 +1097,6 @@ "Wrong newsletter template.","Verkeerde nieuwsbrief sjabloon." "Wrong quote item.","Verkeerde quote item." "Wrong tab configuration.","Verkeerde tab configuratie." -"Wrong tag was specified.","Verkeerde tag gespecificeerd." "Wrong transaction ID specified.","Verkeerde transactie ID gespecificeerd." "XML","XML" "XML data is invalid.","XML data is ongeldig." diff --git a/app/code/Magento/Adminhtml/i18n/pt_BR.csv b/app/code/Magento/Adminhtml/i18n/pt_BR.csv index aab8b3160a8..35173c1d8e3 100644 --- a/app/code/Magento/Adminhtml/i18n/pt_BR.csv +++ b/app/code/Magento/Adminhtml/i18n/pt_BR.csv @@ -91,7 +91,6 @@ "All Files","Todos os Arquivos" "All Reviews","Todas as Revisões" "All Store Views","Todas as Visualizações da Loja" -"All Tags","Todas as Tags" "All Websites","Todos os sites" "All countries","Todos os paÃses" "All fields","Todos os campos" @@ -143,7 +142,6 @@ "Area","Ãrea" "As low as:","A partir de:" "Assigned","AtribuÃdo" -"Tags","Tags associadas" "Attribute Set Name:","Atribuir Nome de Conjunto:" "Attributes","Atributos" "Automatic","Automático" @@ -558,7 +556,6 @@ "New Sitemap","Novo Sitemap" "New Store View","Nova Visualização de Loja" "New System Template","Novo Modelo de Sistema" -"New Tag","Nova Etiqueta" "New Template","Novo Modelo" "New User","Novo Usuário" "New Variable","Nova Variável" @@ -633,7 +630,6 @@ "Payment method is not available.","Método de pagamento não está disponÃvel." "Payment method must be specified.","Método de pagamento deve ser especificado." "Pending Reviews","Comentários Pendentes" -"Pending Tags","Marcas Pendentes" "Per Item","Por Item" "Per Order","Por Ordem" "Percent","Percentagem" @@ -678,7 +674,6 @@ "Please select one of the above options.","Por favor selecione uma das opções acima." "Please select one of the options.","Por favor selecione uma das opções." "Please select review(s).","Por favor selecione comentário(s)." -"Please select tag(s).","Por favor selecione marca(s)." "Please specify backup creation options","Por favor especifique opções de criação de backup." "Please specify the admin custom URL.","Por favor especifique o URL de administração personalizada." "Please try to logout and sign in again.","Por favor tente sair e entrar novamente." @@ -883,7 +878,6 @@ "System","Sistema" "System Section","Seção de Sistema" "System busy","Sistema ocupado" -"Tags","Marcas" "Target Path","Caminho Alvo" "Tax","Taxas" "Tb","Tb" @@ -961,8 +955,6 @@ "The shipment has been created.","A remessa foi criada." "The shipment has been sent.","A remessa foi enviada." "The shipping label has been created.","A etiqueta de envio foi criada." -"The tag has been deleted.","A marca foi eliminada." -"The tag has been saved.","A marca foi salva." "The transaction details have been updated.","Os detalhes da transação foram atualizados." "The user has been deleted.","O usuário foi apagado." "The user has been saved.","O usuário foi salvo." @@ -1022,7 +1014,6 @@ "URL Rewrite Management","Gestão Reescrita de URL" "Unable to cancel the credit memo.","Não foi possÃvel cancelar a nota de crédito." "Unable to find a Email Template to delete.","Incapaz de encontrar um Modelo de Email para apagar." -"Unable to find a tag to delete.","Incapaz de encontrar uma marca para apagar." "Unable to find a user to delete.","ImpossÃvel encontrar usuário a ser apagado." "Unable to initialize import model","ImpossÃvel iniciar modelo de importação" "Unable to refresh lifetime statistics.","ImpossÃvel atualizar estatÃsticas do tempo de existência." @@ -1106,7 +1097,6 @@ "Wrong newsletter template.","Modelo de newsletter errado." "Wrong quote item.","Item de citação errado." "Wrong tab configuration.","Configuração errada de tabulação." -"Wrong tag was specified.","Tabulação errada foi especificada." "Wrong transaction ID specified.","ID errado de transação especificado." "XML","XML" "XML data is invalid.","Dados XML inválidos." diff --git a/app/code/Magento/Authorizenet/etc/frontend/page_types.xml b/app/code/Magento/Authorizenet/etc/frontend/page_types.xml new file mode 100644 index 00000000000..1a3da4ccef5 --- /dev/null +++ b/app/code/Magento/Authorizenet/etc/frontend/page_types.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="authorizenet_directpost_payment_redirect" label="AuthorizeNet Directpost Redirect"/> + <type id="authorizenet_directpost_payment_response" label="AuthorizeNet Directpost Response"/> +</page_types> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml index a6f7da16376..e2550beb272 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="AuthorizeNet Directpost Redirect" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" output="1" template="directpost/iframe.phtml"/> </layout> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml index 31ad3f320f7..e2550beb272 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="AuthorizeNet Directpost Response" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Authorizenet\Block\Directpost\Iframe" name="iframe" output="1" template="directpost/iframe.phtml"/> </layout> diff --git a/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php b/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php index 9ebf8a92659..23b3247368d 100644 --- a/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php +++ b/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php @@ -28,20 +28,20 @@ namespace Magento\Backend\Block\Cache\Grid\Column; class Statuses extends \Magento\Backend\Block\Widget\Grid\Column { /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param array $data */ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, + \Magento\App\Cache\TypeListInterface $cacheTypeList, array $data = array() ) { parent::__construct($coreData, $context, $data); diff --git a/app/code/Magento/Backend/Block/Context.php b/app/code/Magento/Backend/Block/Context.php index 5cefccfe479..244de9a48b9 100644 --- a/app/code/Magento/Backend/Block/Context.php +++ b/app/code/Magento/Backend/Block/Context.php @@ -47,14 +47,15 @@ class Context extends \Magento\Core\Block\Context * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\Core\Model\Factory\Helper $helperFactory - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Logger $logger * @param \Magento\Core\Model\App $app * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager + * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -71,20 +72,21 @@ class Context extends \Magento\Core\Block\Context \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\Core\Model\Factory\Helper $helperFactory, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, \Magento\AuthorizationInterface $authorization, \Magento\Logger $logger, \Magento\Core\Model\App $app, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, + \Magento\Core\Model\LocaleInterface $locale, array $data = array() ) { $this->_authorization = $authorization; parent::__construct($request, $layout, $eventManager, $urlBuilder, $translator, $cache, $design, $session, $storeConfig, $frontController, $helperFactory, $viewUrl, $viewConfig, $cacheState, $logger, $app, - $escaper, $filterManager, $data + $escaper, $filterManager, $locale, $data ); } diff --git a/app/code/Magento/Backend/Block/Dashboard/Searches/Renderer/Searchquery.php b/app/code/Magento/Backend/Block/Dashboard/Searches/Renderer/Searchquery.php index 153d2ca483b..910711f08d4 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Searches/Renderer/Searchquery.php +++ b/app/code/Magento/Backend/Block/Dashboard/Searches/Renderer/Searchquery.php @@ -34,32 +34,32 @@ class Searchquery extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\AbstractRenderer { /** - * Core string + * String helper * - * @var \Magento\Core\Helper\String + * @var \Magento\Stdlib\String */ - protected $_coreString = null; + protected $_stringHelper = null; /** - * @param \Magento\Core\Helper\String $coreString + * @param \Magento\Stdlib\String $stringHelper * @param \Magento\Backend\Block\Context $context * @param array $data */ public function __construct( - \Magento\Core\Helper\String $coreString, + \Magento\Stdlib\String $stringHelper, \Magento\Backend\Block\Context $context, array $data = array() ) { - $this->_coreString = $coreString; + $this->_stringHelper = $stringHelper; parent::__construct($context, $data); } public function render(\Magento\Object $row) { $value = $row->getData($this->getColumn()->getIndex()); - if ($this->_coreString->strlen($value) > 30) { + if ($this->_stringHelper->strlen($value) > 30) { $value = '<span title="'. $this->escapeHtml($value) .'">' - . $this->escapeHtml($this->_coreString->truncate($value, 30)) . '</span>'; + . $this->escapeHtml($this->_stringHelper->truncate($value, 30)) . '</span>'; } else { $value = $this->escapeHtml($value); } diff --git a/app/code/Magento/Backend/Block/Template/Context.php b/app/code/Magento/Backend/Block/Template/Context.php index 4f15d4831ee..0ef867226f9 100644 --- a/app/code/Magento/Backend/Block/Template/Context.php +++ b/app/code/Magento/Backend/Block/Template/Context.php @@ -35,11 +35,6 @@ class Context extends \Magento\Core\Block\Template\Context */ protected $_authorization; - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * @var \Magento\Core\Model\StoreManager */ @@ -63,13 +58,13 @@ class Context extends \Magento\Core\Block\Template\Context * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\Core\Model\Factory\Helper $helperFactory - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\App\Dir $dirs * @param \Magento\Logger $logger * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\View\TemplateEngineFactory $engineFactory * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Core\Model\App $app @@ -95,13 +90,13 @@ class Context extends \Magento\Core\Block\Template\Context \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\Core\Model\Factory\Helper $helperFactory, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, \Magento\App\Dir $dirs, \Magento\Logger $logger, \Magento\Filesystem $filesystem, - \Magento\Core\Model\View\FileSystem $viewFileSystem, + \Magento\View\FileSystem $viewFileSystem, \Magento\View\TemplateEngineFactory $engineFactory, \Magento\AuthorizationInterface $authorization, \Magento\Core\Model\App $app, @@ -135,12 +130,12 @@ class Context extends \Magento\Core\Block\Template\Context $app, $appState, $escaper, - $filterManager + $filterManager, + $locale ); $this->_storeManager = $storeManager; $this->_authorization = $authorization; $this->_backendSession = $backendSession; - $this->_locale = $locale; $this->mathRandom = $mathRandom; } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php index 05c8ae2024a..003fedf1b47 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php @@ -29,31 +29,31 @@ namespace Magento\Backend\Controller\Adminhtml; class Cache extends \Magento\Backend\Controller\Adminhtml\Action { /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ private $_cacheTypeList; /** - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ private $_cacheState; /** - * @var \Magento\Core\Model\Cache\Frontend\Pool + * @var \Magento\App\Cache\Frontend\Pool */ private $_cacheFrontendPool; /** * @param \Magento\Backend\Controller\Context $context - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList - * @param \Magento\Core\Model\Cache\StateInterface $cacheState - * @param \Magento\Core\Model\Cache\Frontend\Pool $cacheFrontendPool + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\Frontend\Pool $cacheFrontendPool */ public function __construct( \Magento\Backend\Controller\Context $context, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, - \Magento\Core\Model\Cache\StateInterface $cacheState, - \Magento\Core\Model\Cache\Frontend\Pool $cacheFrontendPool + \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\App\Cache\StateInterface $cacheState, + \Magento\App\Cache\Frontend\Pool $cacheFrontendPool ) { parent::__construct($context); $this->_cacheTypeList = $cacheTypeList; diff --git a/app/code/Magento/Backend/Controller/Context.php b/app/code/Magento/Backend/Controller/Context.php index c575120a469..2879f6c73fd 100644 --- a/app/code/Magento/Backend/Controller/Context.php +++ b/app/code/Magento/Backend/Controller/Context.php @@ -82,7 +82,6 @@ class Context extends \Magento\Core\Controller\Varien\Action\Context * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\HTTP\Authentication $authentication - * @param bool $isRenderInherited * @param \Magento\Backend\Model\Session $session * @param \Magento\Backend\Helper\Data $helper * @param \Magento\AuthorizationInterface $authorization @@ -103,7 +102,6 @@ class Context extends \Magento\Core\Controller\Varien\Action\Context \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, \Magento\HTTP\Authentication $authentication, - $isRenderInherited, \Magento\Backend\Model\Session $session, \Magento\Backend\Helper\Data $helper, \Magento\AuthorizationInterface $authorization, @@ -114,7 +112,7 @@ class Context extends \Magento\Core\Controller\Varien\Action\Context $canUseBaseUrl = false ) { parent::__construct($logger, $request, $response, $objectManager, $frontController, $layout, $eventManager, - $authentication, $isRenderInherited + $authentication ); $this->_canUseBaseUrl = $canUseBaseUrl; $this->_session = $session; diff --git a/app/code/Magento/Backend/Helper/Dashboard/Data.php b/app/code/Magento/Backend/Helper/Dashboard/Data.php index f8d1c270e45..b8f0a758abe 100644 --- a/app/code/Magento/Backend/Helper/Dashboard/Data.php +++ b/app/code/Magento/Backend/Helper/Dashboard/Data.php @@ -42,33 +42,27 @@ class Data extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param $installDate * @param bool $dbCompatibleMode */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, $installDate, $dbCompatibleMode = true ) { parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/Backend/Helper/Dashboard/Order.php b/app/code/Magento/Backend/Helper/Dashboard/Order.php index 391689ae5fc..d232dac346e 100644 --- a/app/code/Magento/Backend/Helper/Dashboard/Order.php +++ b/app/code/Magento/Backend/Helper/Dashboard/Order.php @@ -37,22 +37,18 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\Reports\Model\Resource\Order\Collection $orderCollection * @param bool $dbCompatibleMode */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\Reports\Model\Resource\Order\Collection $orderCollection, $dbCompatibleMode = true @@ -60,11 +56,9 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard $this->_orderCollection = $orderCollection; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php b/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php index 78a93d985f2..c378d6b8096 100644 --- a/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php +++ b/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php @@ -28,16 +28,16 @@ namespace Magento\Backend\Model\Cache\Resource\Grid; class Collection extends \Magento\Data\Collection { /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Core\Model\EntityFactory $entityFactory */ public function __construct( - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, + \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\Core\Model\EntityFactory $entityFactory ) { $this->_cacheTypeList = $cacheTypeList; diff --git a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php index c70bc383478..93d8f6ab429 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php @@ -167,7 +167,7 @@ class Baseurl extends \Magento\Core\Model\Config\Value $quoted = array_map('preg_quote', $values, array_fill(0, count($values), '/')); if (!preg_match('/^(' . implode('|', $quoted) . ')(.+\/)?$/', $value) && !$this->_isFullyQualifiedUrl($value)) { throw new \Magento\Core\Exception( - __('Specify a URL or path that starts with placeholder(s): %1.', implode(', ', $values))); + __('Specify a URL or path that starts with placeholder(s): %1, and ends with "/".', implode(', ', $values))); } } diff --git a/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php b/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php index 910eedbd188..1d341a1fed2 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php @@ -37,7 +37,7 @@ namespace Magento\Backend\Model\Config\Backend\Image; class Adapter extends \Magento\Core\Model\Config\Value { /** - * @var \Magento\Core\Model\Image\AdapterFactory + * @var \Magento\Image\AdapterFactory */ protected $_imageFactory; @@ -46,7 +46,7 @@ class Adapter extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config - * @param \Magento\Core\Model\Image\AdapterFactory $imageFactory + * @param \Magento\Image\AdapterFactory $imageFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -56,7 +56,7 @@ class Adapter extends \Magento\Core\Model\Config\Value \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, - \Magento\Core\Model\Image\AdapterFactory $imageFactory, + \Magento\Image\AdapterFactory $imageFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Backend/Translate.php b/app/code/Magento/Backend/Model/Config/Backend/Translate.php index 72aa9894c29..7baf77350a4 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Translate.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Translate.php @@ -32,7 +32,7 @@ namespace Magento\Backend\Model\Config\Backend; class Translate extends \Magento\Core\Model\Config\Value { /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -58,7 +58,7 @@ class Translate extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -69,7 +69,7 @@ class Translate extends \Magento\Core\Model\Config\Value \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, + \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php b/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php index 382172d1a1a..99a48e2c74d 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php +++ b/app/code/Magento/Backend/Model/Config/Source/Image/Adapter.php @@ -24,11 +24,23 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Backend\Model\Config\Source\Image; class Adapter implements \Magento\Core\Model\Option\ArrayInterface { + /** + * @var \Magento\Image\Adapter\ConfigInterface + */ + protected $config; + + /** + * @param \Magento\Image\Adapter\ConfigInterface $config + */ + public function __construct(\Magento\Image\Adapter\ConfigInterface $config) + { + $this->config = $config; + } + /** * Return hash of image adapter codes and labels * @@ -36,11 +48,11 @@ class Adapter implements \Magento\Core\Model\Option\ArrayInterface */ public function toOptionArray() { - return array( - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_IM => - __('ImageMagick'), - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_GD2 => - __('PHP GD2'), - ); + $result = array(); + foreach ($this->config->getAdapters() as $alias => $adapter) { + $result[$alias] = __($adapter['title']); + } + + return $result; } } diff --git a/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php b/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php index e90b230df4f..25664e99eeb 100644 --- a/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php +++ b/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php @@ -76,7 +76,7 @@ class Field /** * Block factory * - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; @@ -92,7 +92,7 @@ class Field * @param \Magento\Backend\Model\Config\BackendFactory $backendFactory * @param \Magento\Backend\Model\Config\SourceFactory $sourceFactory * @param \Magento\Backend\Model\Config\CommentFactory $commentFactory - * @param \Magento\Core\Model\BlockFactory $blockFactory + * @param \Magento\View\Element\BlockFactory $blockFactory * @param \Magento\Core\Model\DataService\Graph $dataServiceGraph, * @param \Magento\Backend\Model\Config\Structure\Element\Dependency\Mapper $dependencyMapper */ @@ -101,7 +101,7 @@ class Field \Magento\Backend\Model\Config\BackendFactory $backendFactory, \Magento\Backend\Model\Config\SourceFactory $sourceFactory, \Magento\Backend\Model\Config\CommentFactory $commentFactory, - \Magento\Core\Model\BlockFactory $blockFactory, + \Magento\View\Element\BlockFactory $blockFactory, \Magento\Core\Model\DataService\Graph $dataServiceGraph, \Magento\Backend\Model\Config\Structure\Element\Dependency\Mapper $dependencyMapper ) { diff --git a/app/code/Magento/Backend/Model/Email/Template.php b/app/code/Magento/Backend/Model/Email/Template.php index 43b284bf4ac..5b6ed97a007 100644 --- a/app/code/Magento/Backend/Model/Email/Template.php +++ b/app/code/Magento/Backend/Model/Email/Template.php @@ -51,8 +51,8 @@ class Template extends \Magento\Core\Model\Email\Template * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\View\Url $viewUrl - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\Url $viewUrl + * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Config $coreConfig @@ -70,8 +70,8 @@ class Template extends \Magento\Core\Model\Email\Template \Magento\Core\Model\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Filesystem $filesystem, - \Magento\Core\Model\View\Url $viewUrl, - \Magento\Core\Model\View\FileSystem $viewFileSystem, + \Magento\View\Url $viewUrl, + \Magento\View\FileSystem $viewFileSystem, \Magento\View\DesignInterface $design, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Config $coreConfig, diff --git a/app/code/Magento/Backend/Model/Locale.php b/app/code/Magento/Backend/Model/Locale.php index d7c4bebf953..daf6c5259eb 100644 --- a/app/code/Magento/Backend/Model/Locale.php +++ b/app/code/Magento/Backend/Model/Locale.php @@ -66,6 +66,7 @@ class Locale extends \Magento\Core\Model\Locale * @param \Magento\Core\Model\Locale\Config $config * @param \Magento\Core\Model\App $app * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Core\Model\Date $dateModel * @param string $locale * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -83,6 +84,7 @@ class Locale extends \Magento\Core\Model\Locale \Magento\Core\Model\Locale\Config $config, \Magento\Core\Model\App $app, \Magento\Stdlib\DateTime $dateTime, + \Magento\Core\Model\Date $dateModel, $locale = null ) { $this->_session = $session; @@ -98,6 +100,7 @@ class Locale extends \Magento\Core\Model\Locale $config, $app, $dateTime, + $dateModel, $locale ); } diff --git a/app/code/Magento/Backend/Model/Menu/Config.php b/app/code/Magento/Backend/Model/Menu/Config.php index 1effb7cfc2c..25230f881f9 100644 --- a/app/code/Magento/Backend/Model/Menu/Config.php +++ b/app/code/Magento/Backend/Model/Menu/Config.php @@ -31,7 +31,7 @@ class Config const CACHE_MENU_OBJECT = 'backend_menu_object'; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -81,7 +81,7 @@ class Config * @param \Magento\Backend\Model\Menu\AbstractDirector $menuDirector * @param \Magento\Backend\Model\MenuFactory $menuFactory * @param \Magento\Backend\Model\Menu\Config\Reader $configReader - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Logger $logger * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -92,7 +92,7 @@ class Config \Magento\Backend\Model\Menu\AbstractDirector $menuDirector, \Magento\Backend\Model\MenuFactory $menuFactory, \Magento\Backend\Model\Menu\Config\Reader $configReader, - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Event\ManagerInterface $eventManager, \Magento\Logger $logger, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Backend/etc/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index ad993575d84..a03ce759c04 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -251,7 +251,7 @@ </group> <group id="image" translate="label" type="text" sortOrder="120" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Image Processing Settings</label> - <field id="adapter" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"> + <field id="default_adapter" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Image Adapter</label> <source_model>Magento\Backend\Model\Config\Source\Image\Adapter</source_model> <backend_model>Magento\Backend\Model\Config\Backend\Image\Adapter</backend_model> diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index d29d52fcbcd..927fd0ad1fd 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -48,7 +48,7 @@ </type> <type name="Magento\Backend\Controller\Adminhtml\System\Config\Save"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Layout" /> + <instance type="Magento\App\Cache\Type\Layout" /> </param> </type> <type name="Magento\Backend\Model\Menu\Config"> diff --git a/app/code/Magento/Backup/Helper/Data.php b/app/code/Magento/Backup/Helper/Data.php index 7e85b1b14d0..9a4b3614acb 100644 --- a/app/code/Magento/Backup/Helper/Data.php +++ b/app/code/Magento/Backup/Helper/Data.php @@ -65,12 +65,12 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_authorization; /** - * @var \Magento\Core\Model\Cache\Config + * @var \Magento\Cache\ConfigInterface */ protected $_cacheConfig; /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -94,8 +94,8 @@ class Data extends \Magento\Core\Helper\AbstractHelper * @param \Magento\Core\Helper\Context $context * @param \Magento\Filesystem $filesystem * @param \Magento\AuthorizationInterface $authorization - * @param \Magento\Core\Model\Cache\Config $cacheConfig - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Cache\ConfigInterface $cacheConfig + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\App\Dir $dir * @param \Magento\Index\Model\Resource\Process\CollectionFactory $processFactory */ @@ -103,8 +103,8 @@ class Data extends \Magento\Core\Helper\AbstractHelper \Magento\Core\Helper\Context $context, \Magento\Filesystem $filesystem, \Magento\AuthorizationInterface $authorization, - \Magento\Core\Model\Cache\Config $cacheConfig, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, + \Magento\Cache\ConfigInterface $cacheConfig, + \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\App\Dir $dir, \Magento\Index\Model\Resource\Process\CollectionFactory $processFactory ) { diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php index 61b91a3a66a..15fbec6ea4d 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -72,6 +72,8 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Bundle\Model\Product\PriceFactory $productPrice @@ -87,6 +89,8 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Stdlib\ArrayUtils $arrayUtils, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Core\Model\LocaleInterface $locale, \Magento\Bundle\Model\Product\PriceFactory $productPrice, @@ -95,8 +99,18 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView $this->_catalogProduct = $catalogProduct; $this->_productPrice = $productPrice; $this->_locale = $locale; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, $context, - $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $arrayUtils, + $data + ); } public function getOptions() diff --git a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml index a493118796a..bd8db974b25 100644 --- a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml @@ -26,7 +26,7 @@ ?> <?php /* @var $this \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Bundle */ ?> -<?php $options = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getOptions()); ?> +<?php $options = $this->decorateArray($this->getOptions()); ?> <?php if (count($options)): ?> <div id="catalog_product_composite_configure_fields_bundle" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>"> <h4><?php echo __('Bundle Items') ?></h4> diff --git a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml index bfd6603ff7c..9fea3750b23 100644 --- a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml +++ b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml @@ -24,9 +24,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - +<?php /** @var $this Magento\Bundle\Block\Catalog\Product\View\Type\Bundle */ ?> <?php $_product = $this->getProduct(); ?> -<?php $_options = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getOptions()); ?> +<?php $_options = $this->decorateArray($this->getOptions()); ?> <?php if ($_product->isSaleable()):?> <?php if (count($_options)): ?> <script type="text/javascript"> diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml index 56a759b99e4..83752c4c834 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Bundle)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-bundle-js"> <arguments> diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml index 3f97cfe6220..7bd6a6e3cc4 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Bundle Cart Item" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="catalog_product_view_type_bundle"/> <referenceBlock name="product.info.addtocart.bundle"> <action method="setTemplate"> diff --git a/app/code/Magento/Captcha/view/frontend/captcha.js b/app/code/Magento/Captcha/view/frontend/captcha.js index f5915bbd1ae..0c42c40f4d7 100644 --- a/app/code/Magento/Captcha/view/frontend/captcha.js +++ b/app/code/Magento/Captcha/view/frontend/captcha.js @@ -50,7 +50,7 @@ $.ajax({ url: this.options.url, type: 'post', - async:false, + async: false, dataType: 'json', context: this, data: { diff --git a/app/code/Magento/Captcha/view/frontend/default.phtml b/app/code/Magento/Captcha/view/frontend/default.phtml index 408a08f51d2..86746491042 100644 --- a/app/code/Magento/Captcha/view/frontend/default.phtml +++ b/app/code/Magento/Captcha/view/frontend/default.phtml @@ -18,8 +18,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Captcha + * @category design * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -28,30 +27,32 @@ <?php /* @var $captcha \Magento\Captcha\Model\ModelInterface */ ?> <?php $captcha = $this->getCaptchaModel() ?> -<li role="<?php echo $this->getFormId()?>"> - <label for="captcha_<?php echo $this->getFormId() ?>" class="required"><em>*</em><?php echo __('Please enter the letters below')?></label> - <div class="input-box captcha"> +<div class="field captcha required" role="<?php echo $this->getFormId()?>"> + <label for="captcha_<?php echo $this->getFormId() ?>" class="label"><span><?php echo __('Please type the letters below')?></span></label> + <div class="control captcha"> <input name="<?php echo \Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php echo $this->getFormId() ?>" /> - </div> -</li> -<li data-captcha="<?php echo $this->getFormId()?>" id="captcha-container-<?php echo $this->getFormId()?>"> - <div class="captcha-image"> - <img class="captcha-reload" src="<?php echo $this->getViewFileUrl('Magento_Captcha::reload.png') ?>" alt="<?php echo __('Reload captcha') ?>"> - <img class="captcha-img" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>"/> - <?php if ($captcha->isCaseSensitive()) :?> - <div class="captcha-note"> - <?php echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?> + <div class="nested"> + <div class="field captcha no-label" data-captcha="<?php echo $this->getFormId()?>" id="captcha-container-<?php echo $this->getFormId()?>"> + <div class="control captcha-image"> + <button type="button" class="action reload captcha-reload" title="<?php echo __('Reload captcha') ?>"><span><?php echo __('Reload captcha') ?></span></button> + <img alt="<?php echo __('Please type the letters below')?>" class="captcha-img" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>"/> + <?php if ($captcha->isCaseSensitive()) :?> + <div class="captcha-note note"> + <?php echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?> + </div> + <?php endif; ?> + </div> + <script type="text/javascript">//<![CDATA[ + (function ($) { + head.js("<?php echo $this->getViewFileUrl('Magento_Captcha::captcha.js') ?>",function() { + $('#captcha-container-<?php echo $this->getFormId()?>').captcha({ + url: '<?php echo $this->getRefreshUrl()?>', + type: '<?php echo $this->getFormId() ?>' + }); + }); + })(jQuery); + //]]></script> + </div> </div> - <?php endif; ?> </div> - <script type="text/javascript">//<![CDATA[ - (function ($) { - head.js("<?php echo $this->getViewFileUrl('Magento_Captcha::captcha.js') ?>",function() { - $('#captcha-container-<?php echo $this->getFormId()?>').captcha({ - url: '<?php echo $this->getRefreshUrl()?>', - type: '<?php echo $this->getFormId() ?>' - }); - }); - })(jQuery); - //]]></script> -</li> +</div> diff --git a/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml index b29dba9838d..38d67235675 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml @@ -24,52 +24,48 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="checkout.onepage.login"> - <container name="login.form.additional.info" label="Form Additional Info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_login</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> + <referenceContainer name="form.login.additional.info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_login</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </referenceContainer> + <referenceContainer name="form.billing.additional.info"> + <referenceBlock name="head"> + <block class="Magento\Page\Block\Html\Head\Script" name="magento-captcha-onepage-js"> + <arguments> + <argument name="file" xsi:type="string">Magento_Captcha::onepage.js</argument> + </arguments> </block> - </container> - </referenceBlock> - <referenceBlock name="checkout.onepage.billing"> - <container name="form.additional.info" label="Form Additional Info"> - <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-captcha-onepage-js"> - <arguments> - <argument name="file" xsi:type="string">Magento_Captcha::onepage.js</argument> - </arguments> - </block> - </referenceBlock> - <block class="Magento\Captcha\Block\Captcha" name="captcha.guest.checkout"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">guest_checkout</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - <block class="Magento\Captcha\Block\Captcha" name="captcha.register.during.checkout"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">register_during_checkout</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </container> - </referenceBlock> + </referenceBlock> + <block class="Magento\Captcha\Block\Captcha" name="captcha.guest.checkout"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">guest_checkout</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + <block class="Magento\Captcha\Block\Captcha" name="captcha.register.during.checkout"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">register_during_checkout</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </referenceContainer> </layout> diff --git a/app/code/Magento/Captcha/view/frontend/layout/contacts_index_index.xml b/app/code/Magento/Captcha/view/frontend/layout/contacts_index_index.xml index 5fef291ca25..ec2a88a14ad 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/contacts_index_index.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/contacts_index_index.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="form.additional.info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha"> + <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> <action method="setFormId"> <argument name="formId" xsi:type="string">contact_us</argument> </action> diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml index bd7154a7fa4..8a497d5df2d 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml @@ -24,19 +24,17 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="customer_form_register"> - <container name="form.additional.info" label="Form Additional Info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_create</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </container> - </referenceBlock> + <referenceContainer name="form.additional.info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_create</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </referenceContainer> </layout> diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml index 5b5085ccabc..c61719c3ff9 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml @@ -24,19 +24,17 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="forgotPassword"> - <container name="form.additional.info" label="Form Additional Info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_forgotpassword</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </container> - </referenceBlock> + <referenceContainer name="form.additional.info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_forgotpassword</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </referenceContainer> </layout> diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml index 2c8271f2188..95dff1a4b3f 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml @@ -24,19 +24,17 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="customer_form_login"> - <container name="form.additional.info" label="Form Additional Info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_login</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </container> - </referenceBlock> + <referenceContainer name="form.additional.info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_login</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </referenceContainer> </layout> diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php index eeac9b35bfc..22481c85d91 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php @@ -45,7 +45,7 @@ class Wysiwyg extends \Magento\Data\Form\Element\Textarea /** * Catalog data * - * @var \Magento\Core\Model\ModuleManager + * @var \Magento\Module\Manager */ protected $_moduleManager = null; @@ -65,7 +65,7 @@ class Wysiwyg extends \Magento\Data\Form\Element\Textarea * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection - * @param \Magento\Core\Model\ModuleManager $moduleManager + * @param \Magento\Module\Manager $moduleManager * @param \Magento\Backend\Helper\Data $backendData * @param array $attributes */ @@ -75,7 +75,7 @@ class Wysiwyg extends \Magento\Data\Form\Element\Textarea \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, - \Magento\Core\Model\ModuleManager $moduleManager, + \Magento\Module\Manager $moduleManager, \Magento\Backend\Helper\Data $backendData, array $attributes = array() ) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php index 69df4e66967..57dd6fe48ba 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php @@ -40,8 +40,6 @@ class Grouped protected $_priceBlockDefaultTemplate = 'catalog/product/price.phtml'; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -49,6 +47,8 @@ class Grouped * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param \Magento\Tax\Model\Calculation $taxCalculation * @param array $data */ @@ -60,12 +60,24 @@ class Grouped \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Stdlib\ArrayUtils $arrayUtils, \Magento\Tax\Model\Calculation $taxCalculation, array $data = array() ) { $this->_taxCalculation = $taxCalculation; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, $context, - $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $arrayUtils, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php index 0f2efca739d..28dce9b62ca 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php @@ -58,7 +58,7 @@ class BaseImage extends \Magento\Data\Form\Element\AbstractElement protected $_fileConfig; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -66,7 +66,7 @@ class BaseImage extends \Magento\Data\Form\Element\AbstractElement * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection - * @param \Magento\Core\Model\View\UrlFactory $coreViewUrlFactory + * @param \Magento\View\UrlFactory $coreViewUrlFactory * @param \Magento\Backend\Model\UrlFactory $backendUrlFactory * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\File\Size $fileConfig @@ -76,7 +76,7 @@ class BaseImage extends \Magento\Data\Form\Element\AbstractElement \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, - \Magento\Core\Model\View\UrlFactory $coreViewUrlFactory, + \Magento\View\UrlFactory $coreViewUrlFactory, \Magento\Backend\Model\UrlFactory $backendUrlFactory, \Magento\Catalog\Helper\Data $catalogData, \Magento\File\Size $fileConfig, diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index 8cfff2a92cc..bf01e61be60 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -116,6 +116,11 @@ abstract class AbstractProduct extends \Magento\Core\Block\Template */ protected $_storeManager; + /** + * @var \Magento\Math\Random + */ + protected $mathRandom; + /** * Construct * @@ -126,6 +131,7 @@ abstract class AbstractProduct extends \Magento\Core\Block\Template * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param array $data */ public function __construct( @@ -136,6 +142,7 @@ abstract class AbstractProduct extends \Magento\Core\Block\Template \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, array $data = array() ) { $this->_storeManager = $storeManager; @@ -143,6 +150,7 @@ abstract class AbstractProduct extends \Magento\Core\Block\Template $this->_coreRegistry = $coreRegistry; $this->_taxData = $taxData; $this->_catalogData = $catalogData; + $this->mathRandom = $mathRandom; parent::__construct($coreData, $context, $data); } @@ -780,4 +788,16 @@ abstract class AbstractProduct extends \Magento\Core\Block\Template { return $this->getVar('product_base_image_icon_size', 'Magento_Catalog'); } + + /** + * Get random string + * + * @param int $length + * @param string|null $chars + * @return string + */ + public function getRandomString($length, $chars = null) + { + return $this->mathRandom->getRandomString($length, $chars); + } } diff --git a/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php b/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php index ed2f1ccaf89..5cf07ba9f17 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php @@ -44,32 +44,41 @@ abstract class AbstractCompare extends \Magento\Catalog\Block\Product\AbstractPr protected $_catalogProductCompare = null; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $coreRegistry, - \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, array $data = array() ) { $this->_catalogProductCompare = $catalogProductCompare; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php index 53ff6354420..fea4805604a 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php @@ -100,43 +100,53 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare protected $_itemCollectionFactory; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory - * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\Log\Model\Visitor $logVisitor - * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare + * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory + * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility + * @param \Magento\Log\Model\Visitor $logVisitor + * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, - \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, - \Magento\Log\Model\Visitor $logVisitor, - \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Registry $coreRegistry, - \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, + \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, + \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, + \Magento\Log\Model\Visitor $logVisitor, + \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_itemCollectionFactory = $itemCollectionFactory; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_logVisitor = $logVisitor; $this->_customerSession = $customerSession; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $catalogProductCompare, $taxData, - $catalogData, $coreData, $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $catalogProductCompare, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index e4438667f09..091d98690af 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -65,35 +65,44 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct protected $_categoryFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Catalog\Model\Layer $catalogLayer * @param array $data */ public function __construct( - \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Catalog\Model\Layer $catalogLayer, array $data = array() ) { $this->_categoryFactory = $categoryFactory; $this->_catalogLayer = $catalogLayer; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Block/Product/NewProduct.php b/app/code/Magento/Catalog/Block/Product/NewProduct.php index 2c969295854..88b192da14b 100644 --- a/app/code/Magento/Catalog/Block/Product/NewProduct.php +++ b/app/code/Magento/Catalog/Block/Product/NewProduct.php @@ -78,37 +78,48 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory + * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility + * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, - \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, + \Magento\Core\Model\LocaleInterface $locale, + \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, + \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_productCollectionFactory = $productCollectionFactory; $this->_locale = $locale; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_customerSession = $customerSession; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php index b03b0237c46..71097bd8b7c 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php @@ -42,39 +42,50 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct protected $_layerFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\LayerFactory $layerFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Catalog\Model\Layer $catalogLayer + * @param \Magento\Catalog\Model\LayerFactory $layerFactory + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param array $data */ public function __construct( - \Magento\Catalog\Model\LayerFactory $layerFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Catalog\Model\Layer $catalogLayer, + \Magento\Catalog\Model\LayerFactory $layerFactory, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, array $data = array() ) { $this->_layerFactory = $layerFactory; $this->_productCollectionFactory = $productCollectionFactory; - parent::__construct($categoryFactory, $storeManager, $catalogConfig, $catalogLayer, $coreRegistry, $taxData, - $catalogData, $coreData, $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $categoryFactory, + $catalogLayer, + $data + ); } protected function _getProductCollection() diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php index f4a43063069..51a99f2d973 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php @@ -48,39 +48,50 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct protected $_layerFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\LayerFactory $layerFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Catalog\Model\Layer $catalogLayer + * @param \Magento\Catalog\Model\LayerFactory $layerFactory + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param array $data */ public function __construct( - \Magento\Catalog\Model\LayerFactory $layerFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Catalog\Model\Layer $catalogLayer, + \Magento\Catalog\Model\LayerFactory $layerFactory, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, array $data = array() ) { $this->_layerFactory = $layerFactory; $this->_productCollectionFactory = $productCollectionFactory; - parent::__construct($categoryFactory, $storeManager, $catalogConfig, $catalogLayer, $coreRegistry, $taxData, - $catalogData, $coreData, $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $categoryFactory, + $catalogLayer, + $data + ); } protected function _getProductCollection() diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index 6435f8c000e..8d0ee404e5f 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -64,38 +64,48 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct protected $_checkoutCart; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Checkout\Model\Resource\Cart $checkoutCart - * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Checkout\Model\Resource\Cart $checkoutCart + * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility + * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Core\Model\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Checkout\Model\Resource\Cart $checkoutCart, - \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, - \Magento\Checkout\Model\Session $checkoutSession, \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Checkout\Model\Resource\Cart $checkoutCart, + \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, + \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutCart = $checkoutCart; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_checkoutSession = $checkoutSession; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } protected function _prepareData() diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index 29bf67281f8..f8a15b19145 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -70,38 +70,47 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct protected $_checkoutCart; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Checkout\Model\Resource\Cart $checkoutCart - * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Checkout\Model\Resource\Cart $checkoutCart + * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility + * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Checkout\Model\Resource\Cart $checkoutCart, - \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, - \Magento\Checkout\Model\Session $checkoutSession, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Checkout\Model\Resource\Cart $checkoutCart, + \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, + \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutCart = $checkoutCart; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_checkoutSession = $checkoutSession; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } protected function _prepareData() diff --git a/app/code/Magento/Catalog/Block/Product/Send.php b/app/code/Magento/Catalog/Block/Product/Send.php index f3716680d3d..c86c541b6b5 100644 --- a/app/code/Magento/Catalog/Block/Product/Send.php +++ b/app/code/Magento/Catalog/Block/Product/Send.php @@ -44,32 +44,41 @@ class Send extends \Magento\Catalog\Block\Product\AbstractProduct protected $_customerSession; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 1f3cbbde28f..8323b9cc02d 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -80,6 +80,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param array $data */ public function __construct( @@ -94,14 +95,24 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, array $data = array() ) { $this->_productFactory = $productFactory; $this->_locale = $locale; $this->_taxCalculation = $taxCalculation; $this->string = $string; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php index 8387ff6d556..7543e612f48 100644 --- a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php +++ b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php @@ -35,6 +35,49 @@ namespace Magento\Catalog\Block\Product\View; abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProduct { + /** + * @var \Magento\Stdlib\ArrayUtils + */ + protected $arrayUtils; + + /** + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Catalog\Model\Config $catalogConfig + * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Tax\Helper\Data $taxData + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Stdlib\ArrayUtils $arrayUtils + * @param array $data + */ + public function __construct( + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Catalog\Model\Config $catalogConfig, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Tax\Helper\Data $taxData, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Stdlib\ArrayUtils $arrayUtils, + array $data = array() + ) { + $this->arrayUtils = $arrayUtils; + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); + } + /** * Retrive product * @@ -46,7 +89,19 @@ abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProdu if (is_null($product->getTypeInstance()->getStoreFilter($product))) { $product->getTypeInstance()->setStoreFilter($this->_storeManager->getStore(), $product); } - return $product; } + + /** + * Decorate a plain array of arrays or objects + * + * @param mixed $array + * @param string $prefix + * @param bool $forceSetAll + * @return mixed + */ + public function decorateArray($array, $prefix = 'decorated_', $forceSetAll = false) + { + return $this->arrayUtils->decorateArray($array, $prefix, $forceSetAll); + } } diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index 619a64d8a9a..a31b562e3f3 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -66,6 +66,11 @@ class Options extends \Magento\Core\Block\Template */ protected $_catalogProduct; + /** + * @var \Magento\Stdlib\ArrayUtils + */ + protected $arrayUtils; + /** * Construct * @@ -75,6 +80,7 @@ class Options extends \Magento\Core\Block\Template * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Catalog\Model\Product\Option $option * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param array $data */ public function __construct( @@ -84,6 +90,7 @@ class Options extends \Magento\Core\Block\Template \Magento\Core\Block\Template\Context $context, \Magento\Catalog\Model\Product\Option $option, \Magento\Core\Model\Registry $registry, + \Magento\Stdlib\ArrayUtils $arrayUtils, array $data = array() ) { $this->_catalogProduct = $catalogProduct; @@ -91,6 +98,7 @@ class Options extends \Magento\Core\Block\Template $this->_registry = $registry; $this->_option = $option; $this->_taxData = $taxData; + $this->arrayUtils = $arrayUtils; } /** @@ -173,7 +181,6 @@ class Options extends \Magento\Core\Block\Template public function getJsonConfig() { $config = array(); - foreach ($this->getOptions() as $option) { /* @var $option \Magento\Catalog\Model\Product\Option */ $priceValue = 0; @@ -198,6 +205,7 @@ class Options extends \Magento\Core\Block\Template * Get option html block * * @param \Magento\Catalog\Model\Product\Option $option + * @return string */ public function getOptionHtml(\Magento\Catalog\Model\Product\Option $option) { @@ -209,4 +217,17 @@ class Options extends \Magento\Core\Block\Template return $this->getChildHtml($type, false); } + + /** + * Decorate a plain array of arrays or objects + * + * @param mixed $array + * @param string $prefix + * @param bool $forceSetAll + * @return mixed + */ + public function decorateArray($array, $prefix = 'decorated_', $forceSetAll = false) + { + return $this->arrayUtils->decorateArray($array, $prefix, $forceSetAll); + } } diff --git a/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php b/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php index 640ac71cad9..47ce73a86ce 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php @@ -65,35 +65,47 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView protected $_taxCalculation; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Tax\Model\Calculation $taxCalculation * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Stdlib\ArrayUtils $arrayUtils + * @param \Magento\Tax\Model\Calculation $taxCalculation + * @param \Magento\Catalog\Helper\Product $catalogProduct * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Tax\Model\Calculation $taxCalculation, \Magento\Core\Model\Registry $coreRegistry, - \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, + \Magento\Stdlib\ArrayUtils $arrayUtils, + \Magento\Tax\Model\Calculation $taxCalculation, + \Magento\Catalog\Helper\Product $catalogProduct, array $data = array() ) { $this->_taxCalculation = $taxCalculation; $this->_catalogProduct = $catalogProduct; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $arrayUtils, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php index 864e85c0d84..ea9b0fd8b92 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php @@ -40,7 +40,8 @@ class Gallery extends \Magento\Backend\Controller\Adminhtml\Action try { $uploader = $this->_objectManager->create('Magento\Core\Model\File\Uploader', array('fileId' => 'image')); $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); - $imageAdapter = $this->_objectManager->get('Magento\Core\Model\Image\AdapterFactory')->create(); + /** @var \Magento\Image\Adapter\AdapterInterface $imageAdapter */ + $imageAdapter = $this->_objectManager->get('Magento\Image\AdapterFactory')->create(); $uploader->addValidateCallback('catalog_product_image', $imageAdapter, 'validateUploadFile'); $uploader->setAllowRenameFiles(true); $uploader->setFilesDispersion(true); diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 761b13c7287..d11173db0b1 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -111,7 +111,7 @@ class Image extends \Magento\Core\Helper\AbstractHelper protected $_placeholder; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -134,13 +134,13 @@ class Image extends \Magento\Core\Helper\AbstractHelper * * @param \Magento\Catalog\Model\Product\ImageFactory $productImageFactory * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Store\Config $coreStoreConfig */ public function __construct( \Magento\Catalog\Model\Product\ImageFactory $productImageFactory, \Magento\Core\Helper\Context $context, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Core\Model\Store\Config $coreStoreConfig ) { $this->_productImageFactory = $productImageFactory; diff --git a/app/code/Magento/Catalog/Helper/Product.php b/app/code/Magento/Catalog/Helper/Product.php index 35799827b19..4c183bbff41 100644 --- a/app/code/Magento/Catalog/Helper/Product.php +++ b/app/code/Magento/Catalog/Helper/Product.php @@ -60,7 +60,7 @@ class Product extends \Magento\Core\Helper\Url protected $_priceBlock; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -135,7 +135,7 @@ class Product extends \Magento\Core\Helper\Url * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -151,7 +151,7 @@ class Product extends \Magento\Core\Helper\Url \Magento\Catalog\Model\Session $catalogSession, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Context $context, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Core\Model\Registry $coreRegistry, \Magento\Catalog\Model\Attribute\Config $attributeConfig, \Magento\Core\Model\Store\Config $coreStoreConfig, diff --git a/app/code/Magento/Catalog/Model/Config.php b/app/code/Magento/Catalog/Model/Config.php index 4077aca5d1a..b860ee22629 100644 --- a/app/code/Magento/Catalog/Model/Config.php +++ b/app/code/Magento/Catalog/Model/Config.php @@ -71,7 +71,7 @@ class Config extends \Magento\Eav\Model\Config /** * @param \Magento\Core\Model\App $app * @param \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\Validator\UniversalFactory $universalFactory * Eav config * @@ -119,7 +119,7 @@ class Config extends \Magento\Eav\Model\Config * * @param \Magento\Core\Model\App $app * @param \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Resource\ConfigFactory $configFactory @@ -134,7 +134,7 @@ class Config extends \Magento\Eav\Model\Config public function __construct( \Magento\Core\Model\App $app, \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Resource\ConfigFactory $configFactory, diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php index 96a8ff13077..521011731df 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php @@ -37,7 +37,7 @@ class Countryofmanufacture extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -60,12 +60,12 @@ class Countryofmanufacture * * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType */ public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Cache\Type\Config $configCacheType + \Magento\App\Cache\Type\Config $configCacheType ) { $this->_countryFactory = $countryFactory; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Product/Image.php b/app/code/Magento/Catalog/Model/Product/Image.php index c8d15e5eee4..046644f74ac 100644 --- a/app/code/Magento/Catalog/Model/Product/Image.php +++ b/app/code/Magento/Catalog/Model/Product/Image.php @@ -64,17 +64,17 @@ class Image extends \Magento\Core\Model\AbstractModel protected $_filesystem; /** - * @var \Magento\Core\Model\Image\Factory + * @var \Magento\Image\Factory */ protected $_imageFactory; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -123,9 +123,9 @@ class Image extends \Magento\Core\Model\AbstractModel * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\Image\Factory $imageFactory - * @param \Magento\Core\Model\View\Url $viewUrl - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\Image\Factory $imageFactory + * @param \Magento\View\Url $viewUrl + * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -141,9 +141,9 @@ class Image extends \Magento\Core\Model\AbstractModel \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Filesystem $filesystem, - \Magento\Core\Model\Image\Factory $imageFactory, - \Magento\Core\Model\View\Url $viewUrl, - \Magento\Core\Model\View\FileSystem $viewFileSystem, + \Magento\Image\Factory $imageFactory, + \Magento\View\Url $viewUrl, + \Magento\View\FileSystem $viewFileSystem, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Template/Filter.php b/app/code/Magento/Catalog/Model/Template/Filter.php index 02e9b137d21..c7f84b5d594 100644 --- a/app/code/Magento/Catalog/Model/Template/Filter.php +++ b/app/code/Magento/Catalog/Model/Template/Filter.php @@ -52,7 +52,7 @@ class Filter extends \Magento\Filter\Template protected $_useSessionInUrl = false; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -68,12 +68,12 @@ class Filter extends \Magento\Filter\Template * * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl */ public function __construct( \Magento\Stdlib\String $string, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\View\Url $viewUrl + \Magento\View\Url $viewUrl ) { $this->_storeManager = $storeManager; $this->_viewUrl = $viewUrl; diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index f78dcd79a14..9b2d2e4c1c2 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -26,7 +26,7 @@ <config> <type name="Magento\Catalog\Controller\Adminhtml\Product\Attribute"> <param name="attributeLabelCache"> - <instance type="Magento\Core\Model\Cache\Type\Translate" /> + <instance type="Magento\App\Cache\Type\Translate" /> </param> </type> <type name="Magento\Catalog\Model\Session"> diff --git a/app/code/Magento/Catalog/etc/frontend/di.xml b/app/code/Magento/Catalog/etc/frontend/di.xml index a97ffeec5ad..1bf37d9d6c7 100644 --- a/app/code/Magento/Catalog/etc/frontend/di.xml +++ b/app/code/Magento/Catalog/etc/frontend/di.xml @@ -29,6 +29,11 @@ <value>frontend</value> </param> </type> + <type name="Magento\Catalog\Model\Resource\Category\Collection"> + <param name="fetchStrategy"> + <instance type="Magento\Data\Collection\Db\FetchStrategy\Cache" /> + </param> + </type> <type name="Magento\Sales\Model\Convert\Quote"> <plugin name="copy_quote_files_to_order" type="Magento\Catalog\Model\Plugin\QuoteItemProductOption"/> </type> diff --git a/app/code/Magento/Catalog/etc/frontend/page_types.xml b/app/code/Magento/Catalog/etc/frontend/page_types.xml new file mode 100644 index 00000000000..a77d42557bb --- /dev/null +++ b/app/code/Magento/Catalog/etc/frontend/page_types.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="catalog_category_view" label="Catalog Category"/> + <type id="catalog_product_compare_index" label="Catalog Product Compare List"/> + <type id="catalog_product_gallery" label="Catalog Product Image Gallery Popup"/> + <type id="catalog_product_view" label="Catalog Product View (Any)"/> +</page_types> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml index b0ed1178c64..9e0d895c6de 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml @@ -27,7 +27,7 @@ <?php /* @var $this \Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Configurable */ ?> <?php $_product = $this->getProduct(); ?> -<?php $_attributes = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getAllowAttributes()); ?> +<?php $_attributes = $this->decorateArray($this->getAllowAttributes()); ?> <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?> <?php if (($_product->isSaleable() || $_skipSaleableCheck) && count($_attributes)):?> <fieldset id="catalog_product_composite_configure_fields_configurable" class="fieldset"> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/options.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/options.phtml index fd474b138e1..510fb90590b 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/options.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/composite/fieldset/options.phtml @@ -26,7 +26,7 @@ ?> <?php /* @var $this \Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Options */ ?> -<?php $options = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getOptions()); ?> +<?php $options = $this->decorateArray($this->getOptions()); ?> <?php if (count($options)): ?> <?php echo $this->getChildHtml('options_js') ?> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml index 0ec9847e783..0c0ab92140c 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Category" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Category\View" name="category.products" template="category/view.phtml"> <block class="Magento\Catalog\Block\Product\ListProduct" name="product_list" template="product/list.phtml"> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml index bb87f9a9785..b155ed90be5 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Non Anchor Catalog Category" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="left"> <block class="Magento\Catalog\Block\Navigation" name="catalog.leftnav" after="currency" template="navigation/left.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml index 111d382fc00..6c60196129d 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Non Anchor Catalog Category Without Subcategories" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered.xml index d5fa2348805..c33e2e17ba9 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Anchor Catalog Category" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="left"> <block class="Magento\Catalog\Block\Layer\View" name="catalog.leftnav" after="currency" template="layer/view.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered_without_children.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered_without_children.xml index 12dc103d248..6c60196129d 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered_without_children.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_layered_without_children.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Anchor Catalog Category Without Subcategories" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml index dc997ea0fc8..6bc83854653 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Compare List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">popup.phtml</argument> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml index d283fc501a3..d1a83000585 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Image Gallery Popup" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">popup.phtml</argument> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml index 1eb77704550..48129b08946 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Any)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_configurable.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_configurable.xml index ca9becdfdc7..2bad362d01d 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_configurable.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_configurable.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Configurable)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="product.info"> <block class="Magento\Catalog\Block\Product\View\Type\Configurable" name="product.info.configurable" as="product_type_data" template="product/view/type/default.phtml"> <container name="product.info.configurable.extra" as="product_type_data_extra" label="Product Extra Info"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_grouped.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_grouped.xml index c4479ef8e4a..af3c5a23e15 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_grouped.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_grouped.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Grouped)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="product.info"> <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped" as="product_type_data" template="product/view/type/grouped.phtml"> <container name="product.info.grouped.extra" as="product_type_data_extra" label="Product Extra Info"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml index 46cb9990cf5..27a22feac4f 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Simple)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="product.info"> <block class="Magento\Catalog\Block\Product\View\Type\Simple" name="product.info.simple" as="product_type_data" template="product/view/type/default.phtml"> <container name="product.info.simple.extra" as="product_type_data_extra" label="Product Extra Info"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml index 2f79465ff4d..635b713c307 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Virtual)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="product.info"> <block class="Magento\Catalog\Block\Product\View\Type\Virtual" name="product.info.virtual" as="product_type_data" template="product/view/type/default.phtml"> <container name="product.info.virtual.extra" as="product_type_data_extra" label="Product Extra Info"/> diff --git a/app/code/Magento/Catalog/view/frontend/product/price_msrp.phtml b/app/code/Magento/Catalog/view/frontend/product/price_msrp.phtml index f2aa00d6c1b..c68ec30f67b 100644 --- a/app/code/Magento/Catalog/view/frontend/product/price_msrp.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/price_msrp.phtml @@ -43,8 +43,8 @@ <?php $_msrpPrice = $this->helper('Magento\Core\Helper\Data')->currency($_product->getMsrp(),true,true) ?> <span class="old-price" id="product-price-<?php echo $_product->getId() ?><?php echo $this->getIdSuffix() ?>"><?php echo $_msrpPrice ?></span> <?php endif; ?> - <?php $helpLinkId = 'msrp-click-' . $_product->getId() . $this->helper('Magento\Core\Helper\Data')->getRandomString(20); ?> - <a href="#" id="<?php echo($helpLinkId);?>"><?php echo __('Click for price') ?></a> + <?php $popupId = 'msrp-click-' . $_product->getId() . $this->getRandomString(20); ?> + <a href="#" id="<?php echo($popupId);?>"><?php echo __('Click for price') ?></a> </div> <script type="text/javascript"> @@ -52,8 +52,8 @@ (function ($) { head.js("<?php echo $this->getViewFileUrl('Magento_Catalog::js/msrp.js') ?>", function () { <?php if ($this->helper('Magento\Catalog\Helper\Data')->isShowPriceOnGesture($_product)): ?> - $('#<?php echo($helpLinkId);?>').addToCart({ - popupId: "#<?php echo($helpLinkId);?>", + $('#<?php echo($popupId);?>').addToCart({ + popupId: "#<?php echo($popupId);?>", productName: '<?php echo $_product->getName() ?>', realPrice: '<?php echo $this->getRealPriceJs($_product) ?>', msrpPrice: '<?php echo $_msrpPrice ?>', @@ -64,7 +64,7 @@ }); <?php else: ?> $('#<?php echo($popupId);?>').addToCart({ - popupId: "#<?php echo($helpLinkId);?>", + popupId: "#<?php echo($popupId);?>", submitUrl: "<?php echo $_product->getProductUrl() ?>" }); <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/price_msrp_noform.phtml b/app/code/Magento/Catalog/view/frontend/product/price_msrp_noform.phtml index a1de168746e..35bc493c91e 100644 --- a/app/code/Magento/Catalog/view/frontend/product/price_msrp_noform.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/price_msrp_noform.phtml @@ -43,8 +43,8 @@ <?php $_msrpPrice = $this->helper('Magento\Core\Helper\Data')->currency($_product->getMsrp(),true,true) ?> <span class="old-price" id="product-price-<?php echo $_product->getId() ?><?php echo $this->getIdSuffix() ?>"><?php echo $_msrpPrice ?></span> <?php endif; ?> - <?php $helpLinkId = 'msrp-click-' . $_product->getId() . $this->helper('Magento\Core\Helper\Data')->getRandomString(20); ?> - <a href="#" id="<?php echo($helpLinkId);?>"><?php echo __('Click for price') ?></a> + <?php $popupId = 'msrp-click-' . $_product->getId() . $this->getRandomString(20); ?> + <a href="#" id="<?php echo($popupId);?>"><?php echo __('Click for price') ?></a> </div> <script type="text/javascript"> @@ -52,8 +52,8 @@ (function ($) { head.js("<?php echo $this->getViewFileUrl('Magento_Catalog::js/msrp.js') ?>", function () { <?php if ($this->helper('Magento\Catalog\Helper\Data')->isShowPriceOnGesture($_product)): ?> - $('#<?php echo($helpLinkId);?>').addToCart({ - popupId: "#<?php echo($helpLinkId);?>", + $('#<?php echo($popupId);?>').addToCart({ + popupId: "#<?php echo($popupId);?>", productName: '<?php echo $_product->getName() ?>', realPrice: '<?php echo $this->getRealPriceJs($_product) ?>', msrpPrice: '<?php echo $_msrpPrice ?>', @@ -64,7 +64,7 @@ }); <?php else: ?> $('#<?php echo($popupId);?>').addToCart({ - popupId: "#<?php echo($helpLinkId);?>", + popupId: "#<?php echo($popupId);?>", submitUrl: "<?php echo $_product->getProductUrl() ?>" }); <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/view/options.phtml b/app/code/Magento/Catalog/view/frontend/product/view/options.phtml index d8f6dd02982..29c8cb0469d 100644 --- a/app/code/Magento/Catalog/view/frontend/product/view/options.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/view/options.phtml @@ -26,7 +26,7 @@ /* @var $this \Magento\Catalog\Block\Product\View\Options */ ?> -<?php $_options = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getOptions()) ?> +<?php $_options = $this->decorateArray($this->getOptions()) ?> <?php if (count($_options)):?> <script type="text/javascript"> (function ($) { diff --git a/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml b/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml index cfde98c6cab..ef7dcb5db6d 100644 --- a/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml @@ -27,7 +27,7 @@ <?php /** - * @see \Magento\Catalog\Block\Product\View + * @var $this \Magento\Catalog\Block\Product\View */ $_product = $this->getProduct(); $_tierPrices = $this->getTierPrices(); @@ -191,7 +191,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, <?php endif; ?> <?php if ($_catalogHelper->isShowPriceOnGesture($_product)):?> - <?php $popupId = 'msrp-popup-' . $_product->getId() . $this->helper('Magento\Core\Helper\Data')->getRandomString(20); ?> + <?php $popupId = 'msrp-popup-' . $_product->getId() . $this->getRandomString(20); ?> <?php $addToCartUrl = $this->getProduct()->isSalable() ? $this->getAddToCartUrl($_product, array('qty' => $_price['price_qty'])) diff --git a/app/code/Magento/Catalog/view/frontend/product/view/type/options/configurable.phtml b/app/code/Magento/Catalog/view/frontend/product/view/type/options/configurable.phtml index dd0de9c0310..ee424b617e0 100644 --- a/app/code/Magento/Catalog/view/frontend/product/view/type/options/configurable.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/view/type/options/configurable.phtml @@ -26,8 +26,9 @@ ?> <?php +/** @var $this Magento\Catalog\Block\Product\View\Type\Configurable*/ $_product = $this->getProduct(); -$_attributes = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getAllowAttributes()); +$_attributes = $this->decorateArray($this->getAllowAttributes()); ?> <?php if ($_product->isSaleable() && count($_attributes)):?> <dl> diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index 38f1090f216..e944cf25824 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -111,7 +111,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel protected $_catalogRuleData; /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypesList; @@ -175,7 +175,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\CatalogRule\Helper\Data $catalogRuleData - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypesList + * @param \Magento\App\Cache\TypeListInterface $cacheTypesList * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Context $context @@ -198,7 +198,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel \Magento\Index\Model\Indexer $indexer, \Magento\Customer\Model\Session $customerSession, \Magento\CatalogRule\Helper\Data $catalogRuleData, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypesList, + \Magento\App\Cache\TypeListInterface $cacheTypesList, \Magento\Stdlib\DateTime $dateTime, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Context $context, diff --git a/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php b/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php index ad4bbde5a6f..c6928607953 100644 --- a/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php +++ b/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php @@ -30,13 +30,13 @@ namespace Magento\CatalogRule\Model\Rule\Action; class Collection extends \Magento\Rule\Model\Action\Collection { /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Rule\Model\ActionFactory $actionFactory * @param \Magento\View\LayoutInterface $layout * @param array $data */ public function __construct( - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Rule\Model\ActionFactory $actionFactory, \Magento\View\LayoutInterface $layout, array $data = array() diff --git a/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml b/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml new file mode 100644 index 00000000000..9afa67f5508 --- /dev/null +++ b/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="catalogsearch_advanced_index" label="Advanced Search Form"/> + <type id="catalogsearch_advanced_result" label="Advanced Search Result"/> + <type id="catalogsearch_ajax_suggest" label="Catalog Quick Search Form Suggestions"/> + <type id="catalogsearch_result_index" label="Quick Search Form"/> + <type id="catalogsearch_term_popular" label="Popular Search Terms"/> +</page_types> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml index 4b440e65a02..6027719a58d 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Advanced Search Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml index 4abd838ba8b..39879244cb2 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Advanced Search Result" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="page_two_columns_right"/> <referenceContainer name="content"> <block class="Magento\CatalogSearch\Block\Advanced\Result" name="catalogsearch_advanced_result" template="advanced/result.phtml"> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_ajax_suggest.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_ajax_suggest.xml index 0634b0ae444..728685daebd 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_ajax_suggest.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_ajax_suggest.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Quick Search Form Suggestions" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\CatalogSearch\Block\Autocomplete" name="autocomplete" output="1"/> </layout> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml index 1513bfb4690..4f59da57d67 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Quick Search Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">3columns.phtml</argument> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml index 0d3329a3131..4eb92eddb8b 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_term_popular.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Popular Search Terms" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Search Terms</argument> diff --git a/app/code/Magento/Checkout/Block/Cart/Crosssell.php b/app/code/Magento/Checkout/Block/Cart/Crosssell.php index 1044747da68..7d1e9736b88 100644 --- a/app/code/Magento/Checkout/Block/Cart/Crosssell.php +++ b/app/code/Magento/Checkout/Block/Cart/Crosssell.php @@ -72,6 +72,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Catalog\Model\Product\Visibility $productVisibility * @param \Magento\CatalogInventory\Model\Stock $stock @@ -88,6 +89,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Catalog\Model\Product\Visibility $productVisibility, \Magento\CatalogInventory\Model\Stock $stock, @@ -98,8 +100,17 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct $this->_productVisibility = $productVisibility; $this->_stock = $stock; $this->_productLinkFactory = $productLinkFactory; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, $context, - $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/Link.php b/app/code/Magento/Checkout/Block/Cart/Link.php index 7a3bc0dd937..597cdeddc2f 100644 --- a/app/code/Magento/Checkout/Block/Cart/Link.php +++ b/app/code/Magento/Checkout/Block/Cart/Link.php @@ -30,20 +30,20 @@ namespace Magento\Checkout\Block\Cart; class Link extends \Magento\Page\Block\Link { /** - * @var \Magento\Core\Model\ModuleManager + * @var \Magento\Module\Manager */ protected $_moduleManager; /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Core\Model\ModuleManager $moduleManager + * @param \Magento\Module\Manager $moduleManager * @param array $data */ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, - \Magento\Core\Model\ModuleManager $moduleManager, + \Magento\Module\Manager $moduleManager, array $data = array() ) { parent::__construct($coreData, $context, $data); diff --git a/app/code/Magento/Checkout/Block/Link.php b/app/code/Magento/Checkout/Block/Link.php index c6461a2106e..ec77a89541a 100644 --- a/app/code/Magento/Checkout/Block/Link.php +++ b/app/code/Magento/Checkout/Block/Link.php @@ -30,19 +30,19 @@ namespace Magento\Checkout\Block; class Link extends \Magento\Page\Block\Link { /** - * @var \Magento\Core\Model\ModuleManager + * @var \Magento\Module\Manager */ protected $_moduleManager; /** * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Core\Model\ModuleManager $moduleManager + * @param \Magento\Module\Manager $moduleManager * @param \Magento\Core\Helper\Data $coreData * @param array $data */ public function __construct( \Magento\Core\Block\Template\Context $context, - \Magento\Core\Model\ModuleManager $moduleManager, + \Magento\Module\Manager $moduleManager, \Magento\Core\Helper\Data $coreData, array $data = array() ) { diff --git a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php index 92f7121381f..d71b70adf7b 100644 --- a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php +++ b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php @@ -34,7 +34,7 @@ namespace Magento\Checkout\Block\Onepage; abstract class AbstractOnepage extends \Magento\Core\Block\Template { /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -70,7 +70,7 @@ abstract class AbstractOnepage extends \Magento\Core\Block\Template protected $_storeManager; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession @@ -81,7 +81,7 @@ abstract class AbstractOnepage extends \Magento\Core\Block\Template * @param array $data */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Billing.php b/app/code/Magento/Checkout/Block/Onepage/Billing.php index f38638bf227..d06a8dab640 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Billing.php +++ b/app/code/Magento/Checkout/Block/Onepage/Billing.php @@ -56,7 +56,7 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_addressFactory; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession @@ -68,7 +68,7 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Login.php b/app/code/Magento/Checkout/Block/Onepage/Login.php index 2ac3edc4634..7c9f0e46a8e 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Login.php +++ b/app/code/Magento/Checkout/Block/Onepage/Login.php @@ -44,7 +44,7 @@ class Login extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_checkoutData = null; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession @@ -56,7 +56,7 @@ class Login extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping.php b/app/code/Magento/Checkout/Block/Onepage/Shipping.php index 5618dcc162f..113a0ea8e7a 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping.php @@ -44,7 +44,7 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_addressFactory; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession @@ -56,7 +56,7 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php index 87813182b7f..d6886091e36 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -47,7 +47,7 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_taxData = null; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession @@ -59,7 +59,7 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index 0384042495e..4b5fd891d57 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -70,13 +70,6 @@ class Onepage */ protected $_logger; - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData = null; - /** * Customer data * @@ -126,11 +119,15 @@ class Onepage */ protected $_orderFactory; + /** + * @var \Magento\Object\Copy + */ + protected $_objectCopyService; + /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Checkout\Helper\Data $helper * @param \Magento\Customer\Helper\Data $customerData - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Logger $logger * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession @@ -141,12 +138,12 @@ class Onepage * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory + * @param \Magento\Object\Copy $objectCopyService */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Checkout\Helper\Data $helper, \Magento\Customer\Helper\Data $customerData, - \Magento\Core\Helper\Data $coreData, \Magento\Logger $logger, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, @@ -156,11 +153,11 @@ class Onepage \Magento\Customer\Model\FormFactory $customerFormFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory, - \Magento\Sales\Model\OrderFactory $orderFactory + \Magento\Sales\Model\OrderFactory $orderFactory, + \Magento\Object\Copy $objectCopyService ) { $this->_eventManager = $eventManager; $this->_customerData = $customerData; - $this->_coreData = $coreData; $this->_helper = $helper; $this->_customerEmailExistsMessage = __('There is already a registered customer using this email address. Please log in using this email address or enter a different email address to register your account.'); $this->_checkoutSession = $checkoutSession; @@ -173,6 +170,7 @@ class Onepage $this->_customerFactory = $customerFactory; $this->_serviceQuoteFactory = $serviceQuoteFactory; $this->_orderFactory = $orderFactory; + $this->_objectCopyService = $objectCopyService; } /** @@ -508,7 +506,7 @@ class Onepage $quote->getBillingAddress()->setEmail($customer->getEmail()); // copy customer data to quote - $this->_coreData->copyFieldsetToTarget('customer_account', 'to_quote', $customer, $quote); + $this->_objectCopyService->copyFieldsetToTarget('customer_account', 'to_quote', $customer, $quote); return true; } @@ -714,7 +712,7 @@ class Onepage $customerBilling->setIsDefaultShipping(true); } - $this->_coreData->copyFieldsetToTarget('checkout_onepage_quote', 'to_customer', $quote, $customer); + $this->_objectCopyService->copyFieldsetToTarget('checkout_onepage_quote', 'to_customer', $quote, $customer); $customer->setPassword($customer->decryptPassword($quote->getPasswordHash())); $customer->setPasswordHash($customer->hashPassword($customer->getPassword())); $quote->setCustomer($customer) diff --git a/app/code/Magento/Checkout/etc/fieldset.xml b/app/code/Magento/Checkout/etc/fieldset.xml index 51983d1d053..177430215ae 100644 --- a/app/code/Magento/Checkout/etc/fieldset.xml +++ b/app/code/Magento/Checkout/etc/fieldset.xml @@ -26,7 +26,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="customer_account"> <field name="prefix"> @@ -113,4 +113,4 @@ </field> </fieldset> </scope> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/Checkout/etc/frontend/page_types.xml b/app/code/Magento/Checkout/etc/frontend/page_types.xml new file mode 100644 index 00000000000..05048704ff8 --- /dev/null +++ b/app/code/Magento/Checkout/etc/frontend/page_types.xml @@ -0,0 +1,50 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="checkout_cart_configure" label="Configure Cart Item (Any)"/> + <type id="checkout_cart_index" label="Shopping Cart"/> + <type id="checkout_cart_multishipping" label="Catalog Quick Search Form Suggestions"/> + <type id="checkout_cart_multishipping_address_editaddress" label="Multishipping Checkout One Address Edit Form"/> + <type id="checkout_cart_multishipping_address_editbilling" label="Multishipping Checkout Billing Address Edit Form"/> + <type id="checkout_cart_multishipping_address_editshipping" label="Multishipping Checkout Shipping Address Edit Form"/> + <type id="checkout_cart_multishipping_address_newbilling" label="Multishipping Checkout Billing Address Creation"/> + <type id="checkout_cart_multishipping_address_newshipping" label="Multishipping Checkout Shipping Address Creation"/> + <type id="checkout_cart_multishipping_address_selectbilling" label="Multishipping Checkout Billing Address Selection"/> + <type id="checkout_cart_multishipping_addresses" label="Multishipping Checkout Address (Any) Form"/> + <type id="checkout_cart_multishipping_billing" label="Multishipping Checkout Billing Information Step"/> + <type id="checkout_cart_multishipping_customer_address" label="Multishipping Checkout Customer Address Edit Form"/> + <type id="checkout_cart_multishipping_login" label="Multishipping Checkout Login User Form"/> + <type id="checkout_cart_multishipping_overview" label="Multishipping Checkout Overview"/> + <type id="checkout_cart_multishipping_register" label="Multishipping Checkout Register User Form"/> + <type id="checkout_cart_multishipping_shipping" label="Multishipping Checkout Shipping Information Step"/> + <type id="checkout_cart_multishipping_success" label="Multishipping Checkout Success"/> + <type id="checkout_onepage_failure" label="One Page Checkout Failure"/> + <type id="checkout_onepage_index" label="One Page Checkout"/> + <type id="checkout_onepage_paymentmethod" label="One Page Checkout Choose Payment Method"/> + <type id="checkout_onepage_review" label="One Page Checkout Overview"/> + <type id="checkout_onepage_shippingmethod" label="One Page Checkout Choose Shipping Method"/> + <type id="checkout_onepage_success" label="One Page Checkout Success"/> +</page_types> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml index ab88c16ef53..edb922b5c54 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Cart Item (Any)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="catalog_product_view"/> <referenceBlock name="product.info"> <block class="Magento\Checkout\Block\Cart\Item\Configure" name="checkout.cart.item.configure.block"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_configurable.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_configurable.xml index 294fdeb8432..2f306b55b6e 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_configurable.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_configurable.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Cart Item (Configurable)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="catalog_product_view_type_configurable"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml index 24d2eb57566..7ff60b04ca0 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Cart Item (Simple)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="catalog_product_view_type_simple"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml index 11b2ce0248a..72685dcf904 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Shopping Cart" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml index 31b449b274f..6992a9165dc 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout" design_abstraction="custom"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editaddress.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editaddress.xml index 15998cc52ef..01155fca00b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editaddress.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editaddress.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout One Address Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <update handle="checkout_multishipping_customer_address"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editbilling.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editbilling.xml index 796fb88cd3c..01155fca00b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editbilling.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editbilling.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Billing Address Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <update handle="checkout_multishipping_customer_address"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editshipping.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editshipping.xml index 25d5a6c7b28..01155fca00b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editshipping.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_editshipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Shipping Address Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <update handle="checkout_multishipping_customer_address"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newbilling.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newbilling.xml index 0762e7332c2..01155fca00b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newbilling.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newbilling.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Billing Address Creation" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <update handle="checkout_multishipping_customer_address"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newshipping.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newshipping.xml index 064edc3dcfa..01155fca00b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newshipping.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_newshipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Shipping Address Creation" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <update handle="checkout_multishipping_customer_address"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_select.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_select.xml index 3aafd119cc2..8476c3644e2 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_select.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_select.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Shipping Address Selection" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Shipping Address Selection" design_abstraction="custom"> <update handle="checkout_multishipping"/> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Multishipping\Address\Select" name="checkout_address_select" template="multishipping/address/select.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_selectbilling.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_selectbilling.xml index 35b1c6f0075..edbe6ce92e8 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_selectbilling.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_address_selectbilling.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Billing Address Selection" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Multishipping\Address\Select" name="checkout_address_select" template="multishipping/address/select.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml index 6175c3397f4..cb8f206e735 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Address (Any) Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Multishipping\Addresses" name="checkout_addresses" template="multishipping/addresses.phtml"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_billing.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_billing.xml index c1d420f5d0c..727670fe7b5 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_billing.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_billing.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Billing Information Step" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Multishipping\Billing" name="checkout_billing" template="multishipping/billing.phtml"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_customer_address.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_customer_address.xml index dbb444e2c8f..8e46496c74a 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_customer_address.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_customer_address.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Customer Address Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Customer Address Edit Form" design_abstraction="custom"> <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Edit" name="customer_address_edit" template="address/edit.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_login.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_login.xml index eb4a8ecfe02..db128f00b8c 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_login.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_login.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Login User Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account_login"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml index 4849cdb8495..6fae4733fab 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Overview" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Multishipping\Overview" name="checkout_overview" template="multishipping/overview.phtml"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_register.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_register.xml index 648b74594f9..a3a49fd46d2 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_register.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_register.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Register User Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account_create"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml index 2d0133bafe9..09e49208bc0 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Shipping Information Step" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Multishipping\Shipping" name="checkout_shipping" template="multishipping/shipping.phtml"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_success.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_success.xml index 8e0419a5964..6e453eef56b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_success.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_success.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Success" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="checkout_multishipping"/> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Multishipping\Success" name="checkout_success" template="multishipping/success.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml index d77f3489ac4..fa508817825 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout Failure" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml index 59e213fa734..d50608564d2 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml index 8a9230c4df9..25a577d24d1 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout Choose Payment Method" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Checkout\Block\Onepage\Payment\Methods" name="payment_method" output="1" template="onepage/payment/methods.phtml"> <action method="setMethodFormTemplate"> <argument name="method" xsi:type="string">purchaseorder</argument> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml index 1db04c0ed12..d2f3c9f0fee 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout Overview" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Checkout\Block\Onepage\Review\Info" name="order_review" output="1" template="onepage/review/info.phtml"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="onepage/review/item.phtml"/> <block class="Magento\Checkout\Block\Cart\Item\Renderer\Grouped" as="grouped" template="onepage/review/item.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml index d00f291336f..01ea8488482 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout Choose Shipping Method" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Checkout\Block\Onepage\Shipping\Method\Available" name="shipping_method" output="1" template="onepage/shipping_method/available.phtml"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml index 11bccea76e1..ac8dc93f7f6 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout Success" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php index c2462939da2..259357e1c77 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php @@ -44,7 +44,7 @@ class Uploader extends \Magento\Adminhtml\Block\Media\Uploader * @param \Magento\Cms\Model\Wysiwyg\Images\Storage $imagesStorage * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\File\Size $fileSize * @param array $data */ @@ -52,7 +52,7 @@ class Uploader extends \Magento\Adminhtml\Block\Media\Uploader \Magento\Cms\Model\Wysiwyg\Images\Storage $imagesStorage, \Magento\Core\Helper\Data $coreData, \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\File\Size $fileSize, array $data = array() ) { diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg.php index 34f89faad01..578ee2c164f 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg.php @@ -45,7 +45,8 @@ class Wysiwyg extends \Magento\Backend\Controller\Adminhtml\Action $directive = $this->getRequest()->getParam('___directive'); $directive = $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode($directive); $url = $this->_objectManager->create('Magento\Core\Model\Email\Template\Filter')->filter($directive); - $image = $this->_objectManager->get('Magento\Core\Model\Image\AdapterFactory')->create(); + /** @var \Magento\Image\Adapter\AdapterInterface $image */ + $image = $this->_objectManager->get('Magento\Image\AdapterFactory')->create(); $response = $this->getResponse(); try { $image->open($url); diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php index 868c2dd6c2f..2c7ce7d3388 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php @@ -208,7 +208,8 @@ class Images extends \Magento\Backend\Controller\Adminhtml\Action $file = $this->_objectManager->get('Magento\Cms\Helper\Wysiwyg\Images')->idDecode($file); $thumb = $this->getStorage()->resizeOnTheFly($file); if ($thumb !== false) { - $image = $this->_objectManager->get('Magento\Core\Model\Image\AdapterFactory')->create(); + /** @var \Magento\Image\Adapter\AdapterInterface $image */ + $image = $this->_objectManager->get('Magento\Image\AdapterFactory')->create(); $image->open($thumb); $this->getResponse()->setHeader('Content-Type', $image->getMimeType())->setBody($image->getImage()); } else { diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Config.php b/app/code/Magento/Cms/Model/Wysiwyg/Config.php index 92c3eeb22b7..f4de19c5442 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Config.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Config.php @@ -49,7 +49,7 @@ class Config extends \Magento\Object protected $_authorization; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -99,7 +99,7 @@ class Config extends \Magento\Object * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Cms\Helper\Data $cmsData * @param \Magento\AuthorizationInterface $authorization - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Variable\Config $variableConfig * @param \Magento\Widget\Model\Widget\Config $widgetConfig * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig @@ -111,7 +111,7 @@ class Config extends \Magento\Object \Magento\Event\ManagerInterface $eventManager, \Magento\Cms\Helper\Data $cmsData, \Magento\AuthorizationInterface $authorization, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Core\Model\Variable\Config $variableConfig, \Magento\Widget\Model\Widget\Config $widgetConfig, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 4bb2ef57295..4297b91e4c0 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -57,12 +57,12 @@ class Storage extends \Magento\Object protected $_filesystem; /** - * @var \Magento\Core\Model\Image\AdapterFactory + * @var \Magento\Image\AdapterFactory */ protected $_imageFactory; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -155,8 +155,8 @@ class Storage extends \Magento\Object * @param \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\Image\AdapterFactory $imageFactory - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\Image\AdapterFactory $imageFactory + * @param \Magento\View\Url $viewUrl * @param \Magento\App\Dir $dir * @param \Magento\Cms\Model\Wysiwyg\Images\Storage\CollectionFactory $storageCollectionFactory * @param \Magento\Core\Model\File\Storage\FileFactory $storageFileFactory @@ -176,8 +176,8 @@ class Storage extends \Magento\Object \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Filesystem $filesystem, - \Magento\Core\Model\Image\AdapterFactory $imageFactory, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\Image\AdapterFactory $imageFactory, + \Magento\View\Url $viewUrl, \Magento\App\Dir $dir, \Magento\Cms\Model\Wysiwyg\Images\Storage\CollectionFactory $storageCollectionFactory, \Magento\Core\Model\File\Storage\FileFactory $storageFileFactory, diff --git a/app/code/Magento/Cms/etc/frontend/page_types.xml b/app/code/Magento/Cms/etc/frontend/page_types.xml new file mode 100644 index 00000000000..457cab1fd77 --- /dev/null +++ b/app/code/Magento/Cms/etc/frontend/page_types.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="cms_index_defaultindex" label="CMS Home Default Page"/> + <type id="cms_index_defaultnoroute" label="CMS No-Route Default Page"/> + <type id="cms_index_index" label="CMS Home Page"/> + <type id="cms_index_nocookies" label="CMS No-Cookies Page"/> + <type id="cms_index_noroute" label="CMS No-Route Page"/> + <type id="cms_page_view" label="CMS Pages (All)"/> +</page_types> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml index d31d02e0cf0..97933cab584 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="CMS Home Default Page" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml index ce767032b8b..60768622749 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="CMS No-Route Default Page" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml index 78fe6c29336..6c60196129d 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="CMS Home Page" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml index 1d9f85fc7a8..6c60196129d 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="CMS No-Cookies Page" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml index be6695ade5b..6c60196129d 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="CMS No-Route Page" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml index 0b7d0143e8b..c2f6546fbf2 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="CMS Pages (All)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Core\Block\Template" name="page_content_heading" template="Magento_Cms::content_heading.phtml"/> <container name="cms.wrapper" label="CMS Content Wrapper" htmlTag="div" htmlClass="std"> diff --git a/app/code/Magento/Connect/Helper/Data.php b/app/code/Magento/Connect/Helper/Data.php index 0f111de9692..1c82d5f68bf 100644 --- a/app/code/Magento/Connect/Helper/Data.php +++ b/app/code/Magento/Connect/Helper/Data.php @@ -49,11 +49,9 @@ class Data extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\Filesystem $filesystem * @param \Magento\Convert\Xml $xmlConverter @@ -62,11 +60,9 @@ class Data extends \Magento\Core\Helper\Data */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\Filesystem $filesystem, \Magento\Convert\Xml $xmlConverter, @@ -78,11 +74,9 @@ class Data extends \Magento\Core\Helper\Data $this->_xmlConverter = $xmlConverter; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_grid.xml b/app/code/Magento/Contacts/etc/frontend/page_types.xml similarity index 83% rename from app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_grid.xml rename to app/code/Magento/Contacts/etc/frontend/page_types.xml index 9b07da7c130..4b19c2f8fc6 100644 --- a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_grid.xml +++ b/app/code/Magento/Contacts/etc/frontend/page_types.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Grid" name="oauth_consumer.grid" output="1"/> -</layout> +<page_types> + <type id="contacts_index_index" label="Contact Us Form"/> +</page_types> diff --git a/app/code/Magento/Contacts/view/frontend/form.phtml b/app/code/Magento/Contacts/view/frontend/form.phtml index 660b62b74f4..a566e8327a6 100644 --- a/app/code/Magento/Contacts/view/frontend/form.phtml +++ b/app/code/Magento/Contacts/view/frontend/form.phtml @@ -49,8 +49,8 @@ <div class="control"> <textarea name="comment" id="comment" title="<?php echo __('Comment') ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"></textarea> </div> - <?php echo $this->getChildHtml('form.additional.info'); ?> </div> + <?php echo $this->getChildHtml('form.additional.info'); ?> </fieldset> <div class="actions"> <input type="hidden" name="hideit" id="hideit" value="" /> diff --git a/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml b/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml index a88f05e557d..6079d7243cc 100644 --- a/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml +++ b/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Contact Us Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Contact Us</argument> diff --git a/app/code/Magento/Core/Block/AbstractBlock.php b/app/code/Magento/Core/Block/AbstractBlock.php index bd9d74ed8fa..cf7e77b9350 100644 --- a/app/code/Magento/Core/Block/AbstractBlock.php +++ b/app/code/Magento/Core/Block/AbstractBlock.php @@ -59,7 +59,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Cache group Tag */ - const CACHE_GROUP = \Magento\Core\Model\Cache\Type\Block::TYPE_IDENTIFIER; + const CACHE_GROUP = \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER; /** * Block name in layout * @@ -126,7 +126,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface protected $_helperFactory; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -138,7 +138,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface protected $_viewConfig; /** - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ protected $_cacheState; @@ -162,6 +162,11 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface */ protected $filterManager; + /** + * @var \Magento\Core\Model\LocaleInterface + */ + protected $locale; + /** * @param \Magento\Core\Block\Context $context * @param array $data @@ -183,9 +188,10 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface $this->_viewConfig = $context->getViewConfig(); $this->_cacheState = $context->getCacheState(); $this->_logger = $context->getLogger(); - $this->_app = $context->getApp(); + $this->_app = $context->getApp(); $this->_escaper = $context->getEscaper(); $this->filterManager = $context->getFilterManager(); + $this->locale = $context->getLocale(); parent::__construct($data); $this->_construct(); } @@ -817,7 +823,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface public function formatDate( $date = null, $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, $showTime = false ) { - return $this->helper('Magento\Core\Helper\Data')->formatDate($date, $format, $showTime); + return $this->locale->formatDate($date, $format, $showTime); } /** @@ -831,7 +837,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface public function formatTime( $time = null, $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, $showDate = false ) { - return $this->helper('Magento\Core\Helper\Data')->formatTime($time, $format, $showDate); + return $this->locale->formatTime($time, $format, $showDate); } /** diff --git a/app/code/Magento/Core/Block/Context.php b/app/code/Magento/Core/Block/Context.php index 5302aff7c4a..3784bf13b72 100644 --- a/app/code/Magento/Core/Block/Context.php +++ b/app/code/Magento/Core/Block/Context.php @@ -84,7 +84,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_helperFactory; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -96,7 +96,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_viewConfig; /** - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ protected $_cacheState; @@ -120,6 +120,11 @@ class Context implements \Magento\ObjectManager\ContextInterface */ protected $_filterManager; + /** + * @var \Magento\Core\Model\LocaleInterface + */ + protected $_locale; + /** * @param \Magento\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout @@ -132,13 +137,14 @@ class Context implements \Magento\ObjectManager\ContextInterface * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\Core\Model\Factory\Helper $helperFactory - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\Logger $logger * @param \Magento\Core\Model\App $app * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager + * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data */ public function __construct( @@ -153,13 +159,14 @@ class Context implements \Magento\ObjectManager\ContextInterface \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\Core\Model\Factory\Helper $helperFactory, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, \Magento\Logger $logger, \Magento\Core\Model\App $app, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, + \Magento\Core\Model\LocaleInterface $locale, array $data = array() ) { $this->_request = $request; @@ -180,6 +187,7 @@ class Context implements \Magento\ObjectManager\ContextInterface $this->_app = $app; $this->_escaper = $escaper; $this->_filterManager = $filterManager; + $this->_locale = $locale; } /** @@ -271,7 +279,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\Core\Model\View\Url + * @return \Magento\View\Url */ public function getViewUrl() { @@ -287,7 +295,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\Core\Model\Cache\StateInterface + * @return \Magento\App\Cache\StateInterface */ public function getCacheState() { @@ -325,4 +333,12 @@ class Context implements \Magento\ObjectManager\ContextInterface { return $this->_filterManager; } + + /** + * @return \Magento\Core\Model\LocaleInterface + */ + public function getLocale() + { + return $this->_locale; + } } diff --git a/app/code/Magento/Core/Block/Template.php b/app/code/Magento/Core/Block/Template.php index 96ae28dd034..16894e9908f 100644 --- a/app/code/Magento/Core/Block/Template.php +++ b/app/code/Magento/Core/Block/Template.php @@ -68,7 +68,7 @@ class Template extends \Magento\Core\Block\AbstractBlock protected $_filesystem; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; diff --git a/app/code/Magento/Core/Block/Template/Context.php b/app/code/Magento/Core/Block/Template/Context.php index 5c8565fe2de..4df26e90250 100644 --- a/app/code/Magento/Core/Block/Template/Context.php +++ b/app/code/Magento/Core/Block/Template/Context.php @@ -33,7 +33,7 @@ class Context extends \Magento\Core\Block\Context protected $_filesystem; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -59,18 +59,20 @@ class Context extends \Magento\Core\Block\Context * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\Core\Model\Factory\Helper $helperFactory - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\App\Dir $dirs * @param \Magento\Logger $logger * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\View\TemplateEngineFactory $engineFactory * @param \Magento\Core\Model\App $app * @param \Magento\App\State $appState * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager + * @param \Magento\Core\Model\LocaleInterface $locale + * @param array $data */ public function __construct( \Magento\App\RequestInterface $request, @@ -84,18 +86,20 @@ class Context extends \Magento\Core\Block\Context \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\Core\Model\Factory\Helper $helperFactory, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, \Magento\App\Dir $dirs, \Magento\Logger $logger, \Magento\Filesystem $filesystem, - \Magento\Core\Model\View\FileSystem $viewFileSystem, + \Magento\View\FileSystem $viewFileSystem, \Magento\View\TemplateEngineFactory $engineFactory, \Magento\Core\Model\App $app, \Magento\App\State $appState, \Magento\Escaper $escaper, - \Magento\Filter\FilterManager $filterManager + \Magento\Filter\FilterManager $filterManager, + \Magento\Core\Model\LocaleInterface $locale, + array $data = array() ) { parent::__construct( $request, @@ -115,7 +119,9 @@ class Context extends \Magento\Core\Block\Context $logger, $app, $escaper, - $filterManager + $filterManager, + $locale, + $data ); $this->_appState = $appState; @@ -158,7 +164,7 @@ class Context extends \Magento\Core\Block\Context /** * Get view file system model * - * @return \Magento\Core\Model\View\FileSystem + * @return \Magento\View\FileSystem */ public function getViewFileSystem() { diff --git a/app/code/Magento/Core/Controller/Varien/Action.php b/app/code/Magento/Core/Controller/Varien/Action.php index 8d92cf3a721..dfcf474a3dd 100644 --- a/app/code/Magento/Core/Controller/Varien/Action.php +++ b/app/code/Magento/Core/Controller/Varien/Action.php @@ -129,13 +129,6 @@ class Action extends \Magento\App\Action\AbstractAction */ protected $_eventManager; - /** - * Should inherited page be rendered - * - * @var bool - */ - protected $_isRenderInherited; - /** * @var \Magento\HTTP\Authentication */ @@ -152,7 +145,6 @@ class Action extends \Magento\App\Action\AbstractAction $this->_frontController = $context->getFrontController(); $this->_layout = $context->getLayout(); $this->_eventManager = $context->getEventManager(); - $this->_isRenderInherited = $context->isRenderInherited(); $this->_frontController->setAction($this); $this->authentication = $context->getAuthentication(); @@ -280,7 +272,7 @@ class Action extends \Magento\App\Action\AbstractAction */ public function addActionLayoutHandles() { - if (!$this->_isRenderInherited || !$this->addPageLayoutHandles()) { + if (!$this->addPageLayoutHandles()) { $this->getLayout()->getUpdate()->addHandle($this->getDefaultLayoutHandle()); } return $this; diff --git a/app/code/Magento/Core/Controller/Varien/Action/Context.php b/app/code/Magento/Core/Controller/Varien/Action/Context.php index e76f4ed68ad..3243698fbf7 100644 --- a/app/code/Magento/Core/Controller/Varien/Action/Context.php +++ b/app/code/Magento/Core/Controller/Varien/Action/Context.php @@ -57,13 +57,6 @@ class Context implements \Magento\ObjectManager\ContextInterface */ protected $_eventManager; - /** - * Should inherited page be rendered - * - * @var bool - */ - protected $_isRenderInherited; - /** * @var \Magento\Logger */ @@ -83,7 +76,6 @@ class Context implements \Magento\ObjectManager\ContextInterface * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\HTTP\Authentication $authentication - * @param bool $isRenderInherited */ public function __construct( \Magento\Logger $logger, @@ -93,8 +85,7 @@ class Context implements \Magento\ObjectManager\ContextInterface \Magento\App\FrontController $frontController, \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, - \Magento\HTTP\Authentication $authentication, - $isRenderInherited + \Magento\HTTP\Authentication $authentication ) { $this->_request = $request; $this->_response = $response; @@ -102,21 +93,10 @@ class Context implements \Magento\ObjectManager\ContextInterface $this->_frontController = $frontController; $this->_layout = $layout; $this->_eventManager = $eventManager; - $this->_isRenderInherited = $isRenderInherited; $this->_logger = $logger; $this->authentication = $authentication; } - /** - * Should inherited page be rendered - * - * @return bool - */ - public function isRenderInherited() - { - return $this->_isRenderInherited; - } - /** * @return \Magento\App\FrontController */ diff --git a/app/code/Magento/Core/Helper/AbstractHelper.php b/app/code/Magento/Core/Helper/AbstractHelper.php index 3952405aa7d..d4bf3321ff0 100644 --- a/app/code/Magento/Core/Helper/AbstractHelper.php +++ b/app/code/Magento/Core/Helper/AbstractHelper.php @@ -55,7 +55,7 @@ abstract class AbstractHelper protected $_translator; /** - * @var \Magento\Core\Model\ModuleManager + * @var \Magento\Module\Manager */ private $_moduleManager; @@ -172,7 +172,7 @@ abstract class AbstractHelper * * @param string $moduleName Full module name * @return boolean - * @deprecated use \Magento\Core\Model\ModuleManager::isOutputEnabled() + * @deprecated use \Magento\Module\Manager::isOutputEnabled() */ public function isModuleOutputEnabled($moduleName = null) { @@ -187,7 +187,7 @@ abstract class AbstractHelper * * @param string $moduleName the full module name, example Magento_Core * @return boolean - * @deprecated use \Magento\Core\Model\ModuleManager::isEnabled() + * @deprecated use \Magento\Module\Manager::isEnabled() */ public function isModuleEnabled($moduleName = null) { diff --git a/app/code/Magento/Core/Helper/Context.php b/app/code/Magento/Core/Helper/Context.php index f7d892d6345..2bf88939763 100644 --- a/app/code/Magento/Core/Helper/Context.php +++ b/app/code/Magento/Core/Helper/Context.php @@ -33,7 +33,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_translator; /** - * @var \Magento\Core\Model\ModuleManager + * @var \Magento\Module\Manager */ protected $_moduleManager; @@ -53,15 +53,10 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_httpRequest; /** - * @var \Magento\Core\Model\Cache\Config + * @var \Magento\Cache\ConfigInterface */ protected $_cacheConfig; - /** - * @var \Magento\Core\Model\Fieldset\Config - */ - protected $_fieldsetConfig; - /** * @var \Magento\Core\Model\App */ @@ -85,10 +80,9 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * @param \Magento\Logger $logger * @param \Magento\Core\Model\Translate $translator - * @param \Magento\Core\Model\ModuleManager $moduleManager + * @param \Magento\Module\Manager $moduleManager * @param \Magento\App\RequestInterface $httpRequest - * @param \Magento\Core\Model\Cache\Config $cacheConfig - * @param \Magento\Core\Model\Fieldset\Config $fieldsetConfig + * @param \Magento\Cache\ConfigInterface $cacheConfig * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\App $app * @param \Magento\UrlInterface $urlBuilder @@ -98,10 +92,9 @@ class Context implements \Magento\ObjectManager\ContextInterface public function __construct( \Magento\Logger $logger, \Magento\Core\Model\Translate $translator, - \Magento\Core\Model\ModuleManager $moduleManager, + \Magento\Module\Manager $moduleManager, \Magento\App\RequestInterface $httpRequest, - \Magento\Core\Model\Cache\Config $cacheConfig, - \Magento\Core\Model\Fieldset\Config $fieldsetConfig, + \Magento\Cache\ConfigInterface $cacheConfig, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\App $app, \Magento\UrlInterface $urlBuilder, @@ -112,7 +105,6 @@ class Context implements \Magento\ObjectManager\ContextInterface $this->_moduleManager = $moduleManager; $this->_httpRequest = $httpRequest; $this->_cacheConfig = $cacheConfig; - $this->_fieldsetConfig = $fieldsetConfig; $this->_eventManager = $eventManager; $this->_logger = $logger; $this->_app = $app; @@ -130,7 +122,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\Core\Model\ModuleManager + * @return \Magento\Module\Manager */ public function getModuleManager() { @@ -162,7 +154,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\Core\Model\Cache\Config + * @return \Magento\Cache\ConfigInterface */ public function getCacheConfig() { @@ -177,14 +169,6 @@ class Context implements \Magento\ObjectManager\ContextInterface return $this->_eventManager; } - /** - * @return \Magento\Core\Model\Fieldset\Config - */ - public function getFieldsetConfig() - { - return $this->_fieldsetConfig; - } - /** * @return \Magento\Logger */ diff --git a/app/code/Magento/Core/Helper/Data.php b/app/code/Magento/Core/Helper/Data.php index e7d9ef9eada..0ca295bb001 100644 --- a/app/code/Magento/Core/Helper/Data.php +++ b/app/code/Magento/Core/Helper/Data.php @@ -47,30 +47,11 @@ class Data extends \Magento\Core\Helper\AbstractHelper */ const XML_PATH_SYSTEM_SMTP_DISABLE = 'system/smtp/disable'; - protected $_allowedFormats = array( - \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_FULL, - \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_LONG, - \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM, - \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT - ); - - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** - * @var \Magento\Core\Model\Cache\Config + * @var \Magento\Cache\ConfigInterface */ protected $_cacheConfig; - /** - * @var \Magento\Core\Model\Fieldset\Config - */ - protected $_fieldsetConfig; - /** * Core store config * @@ -88,11 +69,6 @@ class Data extends \Magento\Core\Helper\AbstractHelper */ protected $_locale; - /** - * @var \Magento\Core\Model\Date - */ - protected $_dateModel; - /** * @var \Magento\App\State */ @@ -110,33 +86,26 @@ class Data extends \Magento\Core\Helper\AbstractHelper /** * @param Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param bool $dbCompatibleMode */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, $dbCompatibleMode = true ) { - $this->_eventManager = $eventManager; $this->_coreStoreConfig = $coreStoreConfig; $this->_remoteAddress = $context->getRemoteAddress(); parent::__construct($context); $this->_cacheConfig = $context->getCacheConfig(); - $this->_fieldsetConfig = $context->getFieldsetConfig(); $this->_storeManager = $storeManager; $this->_locale = $locale; - $this->_dateModel = $dateModel; $this->_appState = $appState; $this->_dbCompatibleMode = $dbCompatibleMode; } @@ -203,77 +172,6 @@ class Data extends \Magento\Core\Helper\AbstractHelper return $this->_storeManager->getStore()->formatPrice($price, $includeContainer); } - /** - * Format date using current locale options and time zone. - * - * @param date|Zend_Date|null $date - * @param string $format See \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_* constants - * @param bool $showTime Whether to include time - * @return string - */ - public function formatDate( - $date = null, - $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, - $showTime = false - ) { - if (!in_array($format, $this->_allowedFormats, true)) { - return $date; - } - if (!($date instanceof \Zend_Date) && $date && !strtotime($date)) { - return ''; - } - if (is_null($date)) { - $date = $this->_locale->date( - $this->_dateModel->gmtTimestamp(), - null, - null - ); - } elseif (!$date instanceof \Zend_Date) { - $date = $this->_locale->date(strtotime($date), null, null); - } - - if ($showTime) { - $format = $this->_locale->getDateTimeFormat($format); - } else { - $format = $this->_locale->getDateFormat($format); - } - - return $date->toString($format); - } - - /** - * Format time using current locale options - * - * @param date|Zend_Date|null $time - * @param string $format - * @param bool $showDate - * @return string - */ - public function formatTime( - $time = null, - $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, - $showDate = false - ) { - if (!in_array($format, $this->_allowedFormats, true)) { - return $time; - } - - if (is_null($time)) { - $date = $this->_locale->date(time()); - } else if ($time instanceof \Zend_Date) { - $date = $time; - } else { - $date = $this->_locale->date(strtotime($time)); - } - - if ($showDate) { - $format = $this->_locale->getDateTimeFormat($format); - } else { - $format = $this->_locale->getTimeFormat($format); - } - - return $date->toString($format); - } /** * @param null $storeId @@ -310,167 +208,6 @@ class Data extends \Magento\Core\Helper\AbstractHelper return $types; } - /** - * Copy data from object|array to object|array containing fields - * from fieldset matching an aspect. - * - * Contents of $aspect are a field name in target object or array. - * If targetField attribute is not provided - will be used the same name as in the source object or array. - * - * @param string $fieldset - * @param string $aspect - * @param array|\Magento\Object $source - * @param array|\Magento\Object $target - * @param string $root - * @return array|\Magento\Object|null the value of $target - */ - public function copyFieldsetToTarget($fieldset, $aspect, $source, $target, $root='global') - { - if (!$this->_isFieldsetInputValid($source, $target)) { - return null; - } - $fields = $this->_fieldsetConfig->getFieldset($fieldset, $root); - if (is_null($fields)) { - return $target; - } - $targetIsArray = is_array($target); - - foreach ($fields as $code => $node) { - if (empty($node[$aspect])) { - continue; - } - - $value = $this->_getFieldsetFieldValue($source, $code); - - $targetCode = (string)$node[$aspect]; - $targetCode = $targetCode == '*' ? $code : $targetCode; - - if ($targetIsArray) { - $target[$targetCode] = $value; - } else { - $target->setDataUsingMethod($targetCode, $value); - } - } - - $eventName = sprintf('core_copy_fieldset_%s_%s', $fieldset, $aspect); - $this->_eventManager->dispatch($eventName, array( - 'target' => $target, - 'source' => $source, - 'root' => $root - )); - - return $target; - } - - /** - * Check if source and target are valid input for converting using fieldset - * - * @param array|\Magento\Object $source - * @param array|\Magento\Object $target - * @return bool - */ - private function _isFieldsetInputValid($source, $target) - { - return (is_array($source) || $source instanceof \Magento\Object) - && (is_array($target) || $target instanceof \Magento\Object); - } - - /** - * Get value of source by code - * - * @param $source - * @param $code - * @return null - */ - private function _getFieldsetFieldValue($source, $code) - { - if (is_array($source)) { - $value = isset($source[$code]) ? $source[$code] : null; - } else { - $value = $source->getDataUsingMethod($code); - } - return $value; - } - - /** - * Decorate a plain array of arrays or objects - * The array actually can be an object with Iterator interface - * - * Keys with prefix_* will be set: - * *_is_first - if the element is first - * *_is_odd / *_is_even - for odd/even elements - * *_is_last - if the element is last - * - * The respective key/attribute will be set to element, depending on object it is or array. - * \Magento\Object is supported. - * - * $forceSetAll true will cause to set all possible values for all elements. - * When false (default), only non-empty values will be set. - * - * @param mixed $array - * @param string $prefix - * @param bool $forceSetAll - * @return mixed - */ - public function decorateArray($array, $prefix = 'decorated_', $forceSetAll = false) - { - // check if array or an object to be iterated given - if (!(is_array($array) || is_object($array))) { - return $array; - } - - $keyIsFirst = "{$prefix}is_first"; - $keyIsOdd = "{$prefix}is_odd"; - $keyIsEven = "{$prefix}is_even"; - $keyIsLast = "{$prefix}is_last"; - - $count = count($array); // this will force Iterator to load - $i = 0; - $isEven = false; - foreach ($array as $key => $element) { - if (is_object($element)) { - $this->_decorateArrayObject($element, $keyIsFirst, (0 === $i), $forceSetAll || (0 === $i)); - $this->_decorateArrayObject($element, $keyIsOdd, !$isEven, $forceSetAll || !$isEven); - $this->_decorateArrayObject($element, $keyIsEven, $isEven, $forceSetAll || $isEven); - $isEven = !$isEven; - $i++; - $this->_decorateArrayObject($element, $keyIsLast, ($i === $count), $forceSetAll || ($i === $count)); - } elseif (is_array($element)) { - if ($forceSetAll || (0 === $i)) { - $array[$key][$keyIsFirst] = (0 === $i); - } - if ($forceSetAll || !$isEven) { - $array[$key][$keyIsOdd] = !$isEven; - } - if ($forceSetAll || $isEven) { - $array[$key][$keyIsEven] = $isEven; - } - $isEven = !$isEven; - $i++; - if ($forceSetAll || ($i === $count)) { - $array[$key][$keyIsLast] = ($i === $count); - } - } - } - - return $array; - } - - /** - * Mark passed object with specified flag and appropriate value. - * - * @param \Magento\Object $element - * @param string $key - * @param mixed $value - * @param bool $dontSkip - */ - private function _decorateArrayObject($element, $key, $value, $dontSkip) - { - if ($dontSkip && $element instanceof \Magento\Object) { - $element->setData($key, $value); - } - } - /** * Encode the mixed $valueToEncode into the JSON format * diff --git a/app/code/Magento/Core/Helper/Js.php b/app/code/Magento/Core/Helper/Js.php index 502d6e924ba..76032fd153d 100644 --- a/app/code/Magento/Core/Helper/Js.php +++ b/app/code/Magento/Core/Helper/Js.php @@ -39,7 +39,7 @@ class Js extends \Magento\Core\Helper\AbstractHelper protected $_translateData = null; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -53,12 +53,12 @@ class Js extends \Magento\Core\Helper\AbstractHelper /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl */ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\Context $context, - \Magento\Core\Model\View\Url $viewUrl + \Magento\View\Url $viewUrl ) { $this->_coreData = $coreData; parent::__construct($context); diff --git a/app/code/Magento/Core/Helper/Theme.php b/app/code/Magento/Core/Helper/Theme.php index 8f21ca882da..81c1c0cfece 100644 --- a/app/code/Magento/Core/Helper/Theme.php +++ b/app/code/Magento/Core/Helper/Theme.php @@ -53,7 +53,7 @@ class Theme extends \Magento\Core\Helper\AbstractHelper protected $_themeCollection; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -62,14 +62,14 @@ class Theme extends \Magento\Core\Helper\AbstractHelper * @param \Magento\App\Dir $dirs * @param \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory * @param \Magento\Core\Model\Resource\Theme\Collection $themeCollection - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\FileSystem $viewFileSystem */ public function __construct( \Magento\Core\Helper\Context $context, \Magento\App\Dir $dirs, \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory, \Magento\Core\Model\Resource\Theme\Collection $themeCollection, - \Magento\Core\Model\View\FileSystem $viewFileSystem + \Magento\View\FileSystem $viewFileSystem ) { $this->_dirs = $dirs; $this->_layoutProcessorFactory = $layoutProcessorFactory; @@ -217,7 +217,7 @@ class Theme extends \Magento\Core\Helper\AbstractHelper throw new \LogicException(__('Theme path "%1/%2" is incorrect', $area, $theme)); } $themeModel = $this->_themeCollection->getThemeByFullPath( - $area . \Magento\Core\Model\Theme::PATH_SEPARATOR . $theme + $area . \Magento\View\Design\ThemeInterface::PATH_SEPARATOR . $theme ); if (!$themeModel || !$themeModel->getThemeId()) { diff --git a/app/code/Magento/Core/Model/Acl/Cache.php b/app/code/Magento/Core/Model/Acl/Cache.php index a0db48540af..a204e7e9c3d 100644 --- a/app/code/Magento/Core/Model/Acl/Cache.php +++ b/app/code/Magento/Core/Model/Acl/Cache.php @@ -30,7 +30,7 @@ class Cache implements \Magento\Acl\CacheInterface /** * Cache * - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_cache; @@ -47,10 +47,10 @@ class Cache implements \Magento\Acl\CacheInterface protected $_acl = null; /** - * @param \Magento\Core\Model\Cache\Type\Config $cache + * @param \Magento\App\Cache\Type\Config $cache * @param string $cacheKey */ - function __construct(\Magento\Core\Model\Cache\Type\Config $cache, $cacheKey) + function __construct(\Magento\App\Cache\Type\Config $cache, $cacheKey) { $this->_cache = $cache; $this->_cacheKey = $cacheKey; diff --git a/app/code/Magento/Core/Model/App.php b/app/code/Magento/Core/Model/App.php index f2b8dbf3156..3b56af02c00 100644 --- a/app/code/Magento/Core/Model/App.php +++ b/app/code/Magento/Core/Model/App.php @@ -53,7 +53,7 @@ class App implements \Magento\Core\Model\AppInterface /** * Magento version */ - const VERSION = '2.0.0.0-dev51'; + const VERSION = '2.0.0.0-dev52'; /** @@ -801,7 +801,7 @@ class App implements \Magento\Core\Model\AppInterface 'revision' => '0', 'patch' => '0', 'stability' => 'dev', - 'number' => '51', + 'number' => '52', ); } } diff --git a/app/code/Magento/Core/Model/Config/Cache.php b/app/code/Magento/Core/Model/Config/Cache.php index 4ddf2235be4..42f93299fec 100644 --- a/app/code/Magento/Core/Model/Config/Cache.php +++ b/app/code/Magento/Core/Model/Config/Cache.php @@ -41,7 +41,7 @@ class Cache protected $_containerFactory; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -60,11 +60,11 @@ class Cache protected $_loadedConfig = null; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Model\Config\BaseFactory $containerFactory */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Model\Config\BaseFactory $containerFactory ) { $this->_containerFactory = $containerFactory; diff --git a/app/code/Magento/Core/Model/Config/Initial.php b/app/code/Magento/Core/Model/Config/Initial.php index 1c01ec699fb..99fa5a05376 100644 --- a/app/code/Magento/Core/Model/Config/Initial.php +++ b/app/code/Magento/Core/Model/Config/Initial.php @@ -43,12 +43,12 @@ class Initial /** * @param \Magento\Core\Model\Config\Initial\Reader $reader - * @param \Magento\Core\Model\Cache\Type\Config $cache + * @param \Magento\App\Cache\Type\Config $cache * @param string $cacheId */ public function __construct( \Magento\Core\Model\Config\Initial\Reader $reader, - \Magento\Core\Model\Cache\Type\Config $cache, + \Magento\App\Cache\Type\Config $cache, $cacheId = 'initial_config' ) { $data = $cache->load($cacheId); diff --git a/app/code/Magento/Core/Model/Date.php b/app/code/Magento/Core/Model/Date.php index 65ecdaa684a..1933ef6a2d8 100644 --- a/app/code/Magento/Core/Model/Date.php +++ b/app/code/Magento/Core/Model/Date.php @@ -39,18 +39,6 @@ class Date */ private $_offset = 0; - /** - * Current system offset in seconds - * - * @var int - */ - private $_systemOffset = 0; - - /** - * @var \Magento\Core\Model\StoreManager - */ - protected $_storeManager; - /** * @var \Magento\Core\Model\LocaleInterface */ @@ -64,21 +52,8 @@ class Date \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\LocaleInterface $locale ) { - $this->_systemOffset = $this->calculateOffset(); - $this->_storeManager = $storeManager; $this->_locale = $locale; - $this->_offset = $this->calculateOffset($this->_getConfigTimezone()); - } - - /** - * Gets the store config timezone - * - * @return string - */ - protected function _getConfigTimezone() - { - return $this->_storeManager->getStore() - ->getConfig('general/locale/timezone'); + $this->_offset = $this->calculateOffset($locale->getConfigTimezone()); } /** diff --git a/app/code/Magento/Core/Model/Email/Template.php b/app/code/Magento/Core/Model/Email/Template.php index 61bb9e35303..b4bebc8c152 100644 --- a/app/code/Magento/Core/Model/Email/Template.php +++ b/app/code/Magento/Core/Model/Email/Template.php @@ -96,12 +96,12 @@ class Template extends \Magento\Core\Model\Template protected $_filesystem; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -141,8 +141,8 @@ class Template extends \Magento\Core\Model\Template * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\View\Url $viewUrl - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\Url $viewUrl + * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\ConfigInterface $coreConfig @@ -159,8 +159,8 @@ class Template extends \Magento\Core\Model\Template \Magento\Core\Model\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Filesystem $filesystem, - \Magento\Core\Model\View\Url $viewUrl, - \Magento\Core\Model\View\FileSystem $viewFileSystem, + \Magento\View\Url $viewUrl, + \Magento\View\FileSystem $viewFileSystem, \Magento\View\DesignInterface $design, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\ConfigInterface $coreConfig, diff --git a/app/code/Magento/Core/Model/Email/Template/Filter.php b/app/code/Magento/Core/Model/Email/Template/Filter.php index 43aeee2868d..3c458bbbab4 100644 --- a/app/code/Magento/Core/Model/Email/Template/Filter.php +++ b/app/code/Magento/Core/Model/Email/Template/Filter.php @@ -62,7 +62,7 @@ class Filter extends \Magento\Filter\Template protected $_plainTemplateMode = false; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -124,7 +124,7 @@ class Filter extends \Magento\Filter\Template * @param \Magento\Stdlib\String $string * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\VariableFactory $coreVariableFactory * @param \Magento\Core\Model\StoreManager $storeManager @@ -136,7 +136,7 @@ class Filter extends \Magento\Filter\Template \Magento\Stdlib\String $string, \Magento\Logger $logger, \Magento\Escaper $escaper, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\VariableFactory $coreVariableFactory, \Magento\Core\Model\StoreManager $storeManager, diff --git a/app/code/Magento/Core/Model/Image/Adapter/Config.php b/app/code/Magento/Core/Model/Image/Adapter/Config.php new file mode 100644 index 00000000000..9ac6f5b3d5b --- /dev/null +++ b/app/code/Magento/Core/Model/Image/Adapter/Config.php @@ -0,0 +1,59 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Image\Adapter; + +class Config implements \Magento\Image\Adapter\ConfigInterface +{ + const XML_PATH_IMAGE_ADAPTER = 'dev/image/default_adapter'; + const XML_PATH_IMAGE_ADAPTERS = 'dev/image/adapters'; + + /** + * @var \Magento\Core\Model\ConfigInterface + */ + protected $config; + + /** + * @param \Magento\Core\Model\ConfigInterface $config + */ + public function __construct(\Magento\Core\Model\ConfigInterface $config) + { + $this->config = $config; + } + + /** + * {@inherit} + */ + public function getAdapterAlias() + { + return (string)$this->config->getValue(self::XML_PATH_IMAGE_ADAPTER); + } + + /** + * {@inherit} + */ + public function getAdapters() + { + return $this->config->getValue(self::XML_PATH_IMAGE_ADAPTERS); + } +} diff --git a/app/code/Magento/Core/Model/Image/AdapterFactory.php b/app/code/Magento/Core/Model/Image/AdapterFactory.php deleted file mode 100644 index d319fce7ea8..00000000000 --- a/app/code/Magento/Core/Model/Image/AdapterFactory.php +++ /dev/null @@ -1,140 +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 Magento - * @package Magento_Core - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Core\Model\Image; - -class AdapterFactory -{ - const ADAPTER_GD2 = 'GD2'; - const ADAPTER_IM = 'IMAGEMAGICK'; - - const XML_PATH_IMAGE_ADAPTER = 'dev/image/adapter'; - - /** - * @var array - */ - protected $_adapterClasses; - - /** - * @var \Magento\ObjectManager - */ - protected $_objectManager; - - /** - * @var \Magento\Core\Model\Store\Config - */ - protected $_storeConfig; - - /** - * @var \Magento\Core\Model\Config\Storage\WriterInterface - */ - protected $_configWriter; - - /** - * @var \Magento\Core\Model\Config - */ - protected $_config; - - /** - * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Store\Config $storeConfig - * @param \Magento\Core\Model\Config\Storage\WriterInterface $configWriter - * @param \Magento\Core\Model\Config $configModel - */ - public function __construct( - \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Store\Config $storeConfig, - \Magento\Core\Model\Config\Storage\WriterInterface $configWriter, - \Magento\Core\Model\Config $configModel - ) { - $this->_objectManager = $objectManager; - $this->_storeConfig = $storeConfig; - $this->_configWriter = $configWriter; - $this->_config = $configModel; - $this->_adapterClasses = array( - self::ADAPTER_GD2 => 'Magento\Image\Adapter\Gd2', - self::ADAPTER_IM => 'Magento\Image\Adapter\ImageMagick', - ); - } - - /** - * Return specified image adapter - * - * @param string $adapterType - * @return \Magento\Image\Adapter\AbstractAdapter - * @throws \InvalidArgumentException - * @throws \Exception if some of dependecies are missing - */ - public function create($adapterType = null) - { - if (!isset($adapterType)) { - $adapterType = $this->_getImageAdapterType(); - } - if (!isset($this->_adapterClasses[$adapterType])) { - throw new \InvalidArgumentException( - __('Invalid adapter selected.') - ); - } - $imageAdapter = $this->_objectManager->create($this->_adapterClasses[$adapterType]); - $imageAdapter->checkDependencies(); - return $imageAdapter; - } - - /** - * Returns image adapter type - * - * @return string|null - * @throws \Magento\Core\Exception - */ - public function _getImageAdapterType() - { - $adapterType = $this->_storeConfig->getConfig(self::XML_PATH_IMAGE_ADAPTER); - if (!isset($adapterType)) { - $errorMessage = ''; - foreach ($this->_adapterClasses as $adapter => $class) { - try { - $this->_objectManager->create($class)->checkDependencies(); - - $this->_configWriter->save( - self::XML_PATH_IMAGE_ADAPTER, - $adapter, - \Magento\Core\Model\Config::SCOPE_DEFAULT - ); - - $this->_config->reinit(); - $adapterType = $adapter; - break; - } catch (\Exception $e) { - $errorMessage .= $e->getMessage(); - } - } - if (!isset($adapterType)) { - throw new \Magento\Core\Exception($errorMessage); - } - } - return $adapterType; - } -} diff --git a/app/code/Magento/Core/Model/Layout.php b/app/code/Magento/Core/Model/Layout.php index 6cbfd64d3b6..82dc52564df 100644 --- a/app/code/Magento/Core/Model/Layout.php +++ b/app/code/Magento/Core/Model/Layout.php @@ -33,6 +33,8 @@ */ namespace Magento\Core\Model; +use Magento\View\Element\BlockFactory; + /** * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -109,7 +111,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn protected $_update; /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; @@ -234,7 +236,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn /** * @var \Magento\Core\Model\Resource\Theme\CollectionFactory */ - protected $_themeFactory; + protected $themeFactory; /** * @var \Magento\App\State @@ -266,7 +268,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn \Magento\Core\Model\Factory\Helper $factoryHelper, \Magento\Core\Helper\Data $coreData, \Magento\View\DesignInterface $design, - \Magento\Core\Model\BlockFactory $blockFactory, + \Magento\View\Element\BlockFactory $blockFactory, \Magento\Data\Structure $structure, \Magento\Core\Model\Layout\Argument\Processor $argumentProcessor, \Magento\Core\Model\Layout\ScheduledStructure $scheduledStructure, @@ -291,7 +293,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn $this->_scheduledStructure = $scheduledStructure; $this->_dataServiceGraph = $dataServiceGraph; $this->_processorFactory = $processorFactory; - $this->_themeFactory = $themeFactory; + $this->themeFactory = $themeFactory; $this->_logger = $logger; } @@ -342,7 +344,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn if (is_numeric($themeIdentifier)) { $result = $themeCollection->getItemById($themeIdentifier); } else { - $themeFullPath = $area . \Magento\Core\Model\Theme::PATH_SEPARATOR . $themeIdentifier; + $themeFullPath = $area . \Magento\View\Design\ThemeInterface::PATH_SEPARATOR . $themeIdentifier; $result = $themeCollection->getThemeByFullPath($themeFullPath); } return $result; @@ -1576,7 +1578,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn /** * Retrieve block factory * - * @return \Magento\Core\Model\BlockFactory + * @return \Magento\View\Element\BlockFactory */ public function getBlockFactory() { diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index 3e100449112..9ee6813d4b5 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -32,9 +32,15 @@ namespace Magento\Core\Model\Layout; class Merge implements \Magento\View\Layout\ProcessorInterface { /**#@+ - * Available item type names + * Layout abstraction based on designer prerogative. */ - const TYPE_PAGE = 'page'; + const DESIGN_ABSTRACTION_CUSTOM = 'custom'; + /**#@-*/ + + /**#@+ + * Layout generalization guaranteed to load into View + */ + const DESIGN_ABSTRACTION_PAGE_LAYOUT = 'page_layout'; /**#@-*/ /** @@ -272,8 +278,7 @@ class Merge implements \Magento\View\Layout\ProcessorInterface if (empty($handles)) { return null; } - $condition = '@type="' . self::TYPE_PAGE . '"'; - $nodes = $this->getFileLayoutUpdatesXml()->xpath("/layouts/handle[@id=\"{$handleName}\" and ($condition)]"); + $nodes = $this->getFileLayoutUpdatesXml()->xpath("/layouts/handle[@id=\"{$handleName}\"]"); return $nodes ? reset($nodes) : null; } @@ -288,26 +293,26 @@ class Merge implements \Magento\View\Layout\ProcessorInterface } /** - * Retrieve all page and fragment types that exist in the system. + * Retrieve all design abstractions that exist in the system. * * Result format: * array( * 'handle_name_1' => array( * 'name' => 'handle_name_1', * 'label' => 'Handle Name 1', - * 'type' => self::TYPE_PAGE, + * 'design_abstraction' => self::DESIGN_ABSTRACTION_PAGE_LAYOUT or self::DESIGN_ABSTRACTION_CUSTOM * ), * // ... * ) * * @return array */ - public function getAllPageHandles() + public function getAllDesignAbstractions() { $result = array(); $conditions = array( - '(@type="' . self::TYPE_PAGE . '")' + '(@design_abstraction="' . self::DESIGN_ABSTRACTION_PAGE_LAYOUT . '" or @design_abstraction="' . self::DESIGN_ABSTRACTION_CUSTOM . '")' ); $xpath = '/layouts/*[' . implode(' or ', $conditions) . ']'; $nodes = $this->getFileLayoutUpdatesXml()->xpath($xpath) ?: array(); @@ -317,7 +322,7 @@ class Merge implements \Magento\View\Layout\ProcessorInterface $info = array( 'name' => $name, 'label' => __((string)$node->getAttribute('label')), - 'type' => $node->getAttribute('type'), + 'design_abstraction' => $node->getAttribute('design_abstraction'), ); $result[$name] = $info; } diff --git a/app/code/Magento/Core/Model/Layout/PageType/Config.php b/app/code/Magento/Core/Model/Layout/PageType/Config.php new file mode 100644 index 00000000000..46a662136ff --- /dev/null +++ b/app/code/Magento/Core/Model/Layout/PageType/Config.php @@ -0,0 +1,80 @@ +<?php +/** + * Page layout config model + * + * 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 Magento + * @package Magento_Page + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Layout\PageType; + +class Config +{ + /** + * Available page types + * + * @var array + */ + protected $_pageTypes = null; + + /** @var \Magento\Config\DataInterface */ + protected $_dataStorage; + + /** + * Constructor + * + * @param \Magento\Config\DataInterface $dataStorage + */ + public function __construct( + \Magento\Config\DataInterface $dataStorage + ) { + $this->_dataStorage = $dataStorage; + } + + /** + * Initialize page types list + * + * @return \Magento\Core\Model\Layout\PageType\Config + */ + protected function _initPageTypes() + { + if ($this->_pageTypes === null) { + $this->_pageTypes = array(); + foreach ($this->_dataStorage->get(null) as $pageTypeId => $pageTypeConfig) { + $pageTypeConfig['label'] = __($pageTypeConfig['label']); + $this->_pageTypes[$pageTypeId] = new \Magento\Object($pageTypeConfig); + } + } + return $this; + } + + /** + * Retrieve available page types + * + * @return array \Magento\Object[] + */ + public function getPageTypes() + { + $this->_initPageTypes(); + return $this->_pageTypes; + } +} diff --git a/app/code/Magento/Core/Model/Layout/PageType/Config/Converter.php b/app/code/Magento/Core/Model/Layout/PageType/Config/Converter.php new file mode 100644 index 00000000000..bab50adc1d1 --- /dev/null +++ b/app/code/Magento/Core/Model/Layout/PageType/Config/Converter.php @@ -0,0 +1,52 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Layout\PageType\Config; + +class Converter implements \Magento\Config\ConverterInterface +{ + /** + * {@inheritdoc} + */ + public function convert($source) + { + $page_types = array(); + $xpath = new \DOMXPath($source); + + /** @var $widget \DOMNode */ + foreach ($xpath->query('/page_types/type') as $type) { + $typeAttributes = $type->attributes; + + $id = $typeAttributes->getNamedItem('id')->nodeValue; + $label = $typeAttributes->getNamedItem('label')->nodeValue; + + $pageArray = [ + "id" => $id, + "label" => $label + ]; + + $page_types[$id] = $pageArray; + } + return $page_types; + } +} diff --git a/app/code/Magento/Core/Model/Layout/PageType/Config/Reader.php b/app/code/Magento/Core/Model/Layout/PageType/Config/Reader.php new file mode 100644 index 00000000000..35666fa4e46 --- /dev/null +++ b/app/code/Magento/Core/Model/Layout/PageType/Config/Reader.php @@ -0,0 +1,38 @@ +<?php +/** + * Page layout config reader + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Layout\PageType\Config; + +class Reader extends \Magento\Config\Reader\Filesystem +{ + /** + * List of identifier attributes for merging + * + * @var array + */ + protected $_idAttributes = array( + '/page_types/type' => 'id', + ); +} diff --git a/app/code/Magento/Core/Model/Layout/PageType/Config/SchemaLocator.php b/app/code/Magento/Core/Model/Layout/PageType/Config/SchemaLocator.php new file mode 100644 index 00000000000..798f1280e94 --- /dev/null +++ b/app/code/Magento/Core/Model/Layout/PageType/Config/SchemaLocator.php @@ -0,0 +1,64 @@ +<?php +/** + * Locator for page_types XSD schemas. + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Layout\PageType\Config; + +class SchemaLocator implements \Magento\Config\SchemaLocatorInterface +{ + /** + * Path to corresponding XSD file with validation rules for config + * + * @var string + */ + protected $_schema = null; + + /** + * @param \Magento\Module\Dir\Reader $moduleReader + */ + public function __construct(\Magento\Module\Dir\Reader $moduleReader) + { + $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Core') . '/page_types.xsd'; + } + + /** + * Get path to merged config schema + * + * @return string|null + */ + public function getSchema() + { + return $this->_schema; + } + + /** + * Get path to per file validation schema + * + * @return string|null + */ + public function getPerFileSchema() + { + return $this->_schema; + } +} diff --git a/app/code/Magento/Core/Model/Locale.php b/app/code/Magento/Core/Model/Locale.php index 99e4e097abd..62850f29a57 100644 --- a/app/code/Magento/Core/Model/Locale.php +++ b/app/code/Magento/Core/Model/Locale.php @@ -108,6 +108,21 @@ class Locale implements \Magento\Core\Model\LocaleInterface */ protected $dateTime; + /** + * @var \Magento\Core\Model\Date + */ + protected $_dateModel; + + /** + * @var array + */ + protected $_allowedFormats = array( + \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_FULL, + \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_LONG, + \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM, + \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT + ); + /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Translate $translate @@ -117,6 +132,7 @@ class Locale implements \Magento\Core\Model\LocaleInterface * @param \Magento\Core\Model\Locale\Config $config * @param \Magento\Core\Model\App $app * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Core\Model\Date $dateModel * @param string $locale */ public function __construct( @@ -128,6 +144,7 @@ class Locale implements \Magento\Core\Model\LocaleInterface \Magento\Core\Model\Locale\Config $config, \Magento\Core\Model\App $app, \Magento\Stdlib\DateTime $dateTime, + \Magento\Core\Model\Date $dateModel, $locale = null ) { $this->_eventManager = $eventManager; @@ -138,6 +155,7 @@ class Locale implements \Magento\Core\Model\LocaleInterface $this->_config = $config; $this->_app = $app; $this->dateTime = $dateTime; + $this->_dateModel = $dateModel; $this->setLocale($locale); } @@ -196,6 +214,16 @@ class Locale implements \Magento\Core\Model\LocaleInterface return \Magento\Core\Model\LocaleInterface::DEFAULT_TIMEZONE; } + /** + * Gets the store config timezone + * + * @return string + */ + public function getConfigTimezone() + { + return $this->_storeManager->getStore()->getConfig('general/locale/timezone'); + } + /** * Retrieve currency code * @@ -553,6 +581,74 @@ class Locale implements \Magento\Core\Model\LocaleInterface return $date; } + /** + * Format date using current locale options and time zone. + * + * @param date|Zend_Date|null $date + * @param string $format See \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_* constants + * @param bool $showTime Whether to include time + * @return string + */ + public function formatDate( + $date = null, $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, $showTime = false + ) { + if (!in_array($format, $this->_allowedFormats, true)) { + return $date; + } + if (!($date instanceof \Zend_Date) && $date && !strtotime($date)) { + return ''; + } + if (is_null($date)) { + $date = $this->date( + $this->_dateModel->gmtTimestamp(), + null, + null + ); + } elseif (!$date instanceof \Zend_Date) { + $date = $this->date(strtotime($date), null, null); + } + + if ($showTime) { + $format = $this->getDateTimeFormat($format); + } else { + $format = $this->getDateFormat($format); + } + + return $date->toString($format); + } + + /** + * Format time using current locale options + * + * @param date|Zend_Date|null $time + * @param string $format + * @param bool $showDate + * @return string + */ + public function formatTime( + $time = null, $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, $showDate = false + ) { + if (!in_array($format, $this->_allowedFormats, true)) { + return $time; + } + + if (is_null($time)) { + $date = $this->date(time()); + } elseif ($time instanceof \Zend_Date) { + $date = $time; + } else { + $date = $this->date(strtotime($time)); + } + + if ($showDate) { + $format = $this->getDateTimeFormat($format); + } else { + $format = $this->getTimeFormat($format); + } + + return $date->toString($format); + } + /** * Create \Zend_Date object with date converted from store's timezone * to UTC time zone. Date can be passed in format of store's locale diff --git a/app/code/Magento/Core/Model/LocaleInterface.php b/app/code/Magento/Core/Model/LocaleInterface.php index 8965efa8d1a..d1e262aa627 100644 --- a/app/code/Magento/Core/Model/LocaleInterface.php +++ b/app/code/Magento/Core/Model/LocaleInterface.php @@ -345,4 +345,35 @@ interface LocaleInterface * @return bool */ public function isStoreDateInInterval($store, $dateFrom = null, $dateTo = null); + + /** + * Format date using current locale options and time zone. + * + * @param Zend_Date|null $date + * @param string $format + * @param bool $showTime + * @return string + */ + public function formatDate( + $date = null, $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, $showTime = false + ); + + /** + * Format time using current locale options + * + * @param Zend_Date|null $time + * @param string $format + * @param bool $showDate + * @return string + */ + public function formatTime( + $time = null, $format = \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT, $showDate = false + ); + + /** + * Gets the store config timezone + * + * @return string + */ + public function getConfigTimezone(); } diff --git a/app/code/Magento/Core/Model/Module/Output/Config.php b/app/code/Magento/Core/Model/Module/Output/Config.php new file mode 100644 index 00000000000..872498c9641 --- /dev/null +++ b/app/code/Magento/Core/Model/Module/Output/Config.php @@ -0,0 +1,64 @@ +<?php +/** + * Module Output Config Model + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Module\Output; + + +class Config implements \Magento\Module\Output\ConfigInterface +{ + /** + * XPath in the configuration where module statuses are stored + */ + const XML_PATH_MODULE_OUTPUT_STATUS = 'advanced/modules_disable_output/%s'; + + /** + * @var \Magento\Core\Model\Store\ConfigInterface + */ + protected $_storeConfig; + + /** + * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig + */ + public function __construct(\Magento\Core\Model\Store\ConfigInterface $storeConfig) + { + $this->_storeConfig = $storeConfig; + } + + /** + * @inheritdoc + */ + public function isEnabled($moduleName) + { + return $this->getFlag(sprintf(self::XML_PATH_MODULE_OUTPUT_STATUS, $moduleName)); + } + + /** + * @inheritdoc + */ + public function getFlag($path) + { + return $this->_storeConfig->getConfigFlag($path); + } +} diff --git a/app/code/Magento/Core/Model/Observer.php b/app/code/Magento/Core/Model/Observer.php index 0f27862cc22..e7e23ab3da2 100644 --- a/app/code/Magento/Core/Model/Observer.php +++ b/app/code/Magento/Core/Model/Observer.php @@ -34,7 +34,7 @@ namespace Magento\Core\Model; class Observer { /** - * @var \Magento\Core\Model\Cache\Frontend\Pool + * @var \Magento\App\Cache\Frontend\Pool */ private $_cacheFrontendPool; @@ -69,7 +69,7 @@ class Observer protected $_logger; /** - * @param \Magento\Core\Model\Cache\Frontend\Pool $cacheFrontendPool + * @param \Magento\App\Cache\Frontend\Pool $cacheFrontendPool * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Page $page * @param \Magento\Core\Model\ConfigInterface $config @@ -78,7 +78,7 @@ class Observer * @param \Magento\Logger $logger */ public function __construct( - \Magento\Core\Model\Cache\Frontend\Pool $cacheFrontendPool, + \Magento\App\Cache\Frontend\Pool $cacheFrontendPool, \Magento\View\DesignInterface $design, \Magento\Core\Model\Page $page, \Magento\Core\Model\ConfigInterface $config, @@ -140,7 +140,7 @@ class Observer foreach ($this->_currentTheme->getCustomization()->getFiles() as $themeFile) { try { $service = $themeFile->getCustomizationService(); - if ($service instanceof \Magento\Core\Model\Theme\Customization\FileAssetInterface) { + if ($service instanceof \Magento\View\Design\Theme\Customization\FileAssetInterface) { $asset = $this->_assetFileFactory->create(array( 'file' => $themeFile->getFullPath(), 'contentType' => $service->getContentType() diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeService.php b/app/code/Magento/Core/Model/Page/Asset/MergeService.php index 30731ab0bbe..8a533ab9e67 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeService.php +++ b/app/code/Magento/Core/Model/Page/Asset/MergeService.php @@ -92,8 +92,8 @@ class MergeService */ public function getMergedAssets(array $assets, $contentType) { - $isCss = $contentType == \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS; - $isJs = $contentType == \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS; + $isCss = $contentType == \Magento\View\Publisher::CONTENT_TYPE_CSS; + $isJs = $contentType == \Magento\View\Publisher::CONTENT_TYPE_JS; if (!$isCss && !$isJs) { throw new \InvalidArgumentException("Merge for content type '$contentType' is not supported."); } diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Direct.php b/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Direct.php index 3361279a13f..e1e7ae00906 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Direct.php +++ b/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Direct.php @@ -40,23 +40,23 @@ class Direct implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface private $_dirs; /** - * @var \Magento\Core\Helper\Css + * @var \Magento\View\Url\CssResolver */ - private $_cssHelper; + private $_cssUrlResolver; /** * @param \Magento\Filesystem $filesystem * @param \Magento\App\Dir $dirs - * @param \Magento\Core\Helper\Css $cssHelper + * @param \Magento\View\Url\CssResolver $cssUrlResolver */ public function __construct( \Magento\Filesystem $filesystem, \Magento\App\Dir $dirs, - \Magento\Core\Helper\Css $cssHelper + \Magento\View\Url\CssResolver $cssUrlResolver ) { $this->_filesystem = $filesystem; $this->_dirs = $dirs; - $this->_cssHelper = $cssHelper; + $this->_cssUrlResolver = $cssUrlResolver; } /** @@ -82,7 +82,7 @@ class Direct implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface protected function _composeMergedContent(array $publicFiles, $targetFile, $contentType) { $result = array(); - $isCss = $contentType == \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS; + $isCss = $contentType == \Magento\View\Publisher::CONTENT_TYPE_CSS; foreach ($publicFiles as $file) { if (!$this->_filesystem->has($file)) { @@ -90,7 +90,7 @@ class Direct implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface } $content = $this->_filesystem->read($file); if ($isCss) { - $content = $this->_cssHelper->replaceCssRelativeUrls($content, $file, $targetFile); + $content = $this->_cssUrlResolver->replaceCssRelativeUrls($content, $file, $targetFile); } $result[] = $content; } diff --git a/app/code/Magento/Core/Model/Page/Asset/Minified.php b/app/code/Magento/Core/Model/Page/Asset/Minified.php index 038c2ac108c..74ec58aa2d7 100644 --- a/app/code/Magento/Core/Model/Page/Asset/Minified.php +++ b/app/code/Magento/Core/Model/Page/Asset/Minified.php @@ -51,7 +51,7 @@ class Minified implements \Magento\Core\Model\Page\Asset\MergeableInterface protected $_url; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -63,13 +63,13 @@ class Minified implements \Magento\Core\Model\Page\Asset\MergeableInterface /** * @param \Magento\Core\Model\Page\Asset\LocalInterface $asset * @param \Magento\Code\Minifier $minifier - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Logger $logger */ public function __construct( \Magento\Core\Model\Page\Asset\LocalInterface $asset, \Magento\Code\Minifier $minifier, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Logger $logger ) { $this->_originalAsset = $asset; diff --git a/app/code/Magento/Core/Model/Page/Asset/PublicFile.php b/app/code/Magento/Core/Model/Page/Asset/PublicFile.php index 026509dee35..5ecf6500c67 100644 --- a/app/code/Magento/Core/Model/Page/Asset/PublicFile.php +++ b/app/code/Magento/Core/Model/Page/Asset/PublicFile.php @@ -32,7 +32,7 @@ namespace Magento\Core\Model\Page\Asset; class PublicFile implements \Magento\Core\Model\Page\Asset\LocalInterface { /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -47,11 +47,11 @@ class PublicFile implements \Magento\Core\Model\Page\Asset\LocalInterface private $_contentType; /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param string $file * @param string $contentType */ - public function __construct(\Magento\Core\Model\View\Url $viewUrl, $file, $contentType) + public function __construct(\Magento\View\Url $viewUrl, $file, $contentType) { $this->_viewUrl = $viewUrl; $this->_file = $file; diff --git a/app/code/Magento/Core/Model/Page/Asset/ViewFile.php b/app/code/Magento/Core/Model/Page/Asset/ViewFile.php index 4cd43c6b5b4..1b57e71a3ff 100644 --- a/app/code/Magento/Core/Model/Page/Asset/ViewFile.php +++ b/app/code/Magento/Core/Model/Page/Asset/ViewFile.php @@ -32,7 +32,7 @@ namespace Magento\Core\Model\Page\Asset; class ViewFile implements \Magento\Core\Model\Page\Asset\MergeableInterface { /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -47,13 +47,13 @@ class ViewFile implements \Magento\Core\Model\Page\Asset\MergeableInterface private $_contentType; /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param string $file * @param string $contentType * @throws \InvalidArgumentException */ public function __construct( - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, $file, $contentType ) { diff --git a/app/code/Magento/Core/Model/Resource/Cache.php b/app/code/Magento/Core/Model/Resource/Cache.php index 46b26a24c38..bad70b2088b 100644 --- a/app/code/Magento/Core/Model/Resource/Cache.php +++ b/app/code/Magento/Core/Model/Resource/Cache.php @@ -34,7 +34,7 @@ */ namespace Magento\Core\Model\Resource; -class Cache extends \Magento\Core\Model\Resource\Db\AbstractDb +class Cache extends \Magento\Core\Model\Resource\Db\AbstractDb implements \Magento\App\Cache\State\OptionsInterface { /** * Define main table diff --git a/app/code/Magento/Core/Model/Resource/Theme/Collection.php b/app/code/Magento/Core/Model/Resource/Theme/Collection.php index 9b69e996c0f..4f2a3ace42c 100644 --- a/app/code/Magento/Core/Model/Resource/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Theme/Collection.php @@ -107,7 +107,12 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl */ public function filterVisibleThemes() { - $this->addTypeFilter(array(\Magento\Core\Model\Theme::TYPE_PHYSICAL, \Magento\Core\Model\Theme::TYPE_VIRTUAL)); + $this->addTypeFilter( + array( + \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL, + \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL + ) + ); return $this; } @@ -190,7 +195,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl ) { $this->addAreaFilter(\Magento\Core\Model\App\Area::AREA_FRONTEND) - ->addTypeFilter(\Magento\Core\Model\Theme::TYPE_PHYSICAL); + ->addTypeFilter(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL); if ($page) { $this->setPageSize($pageSize)->setCurPage($page); } @@ -202,11 +207,11 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * * @param string $area * @param int $type - * @return $this + * @return \Magento\Core\Model\Resource\Theme\Collection */ public function filterThemeCustomizations( $area = \Magento\Core\Model\App\Area::AREA_FRONTEND, - $type = \Magento\Core\Model\Theme::TYPE_VIRTUAL + $type = \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL ) { $this->addAreaFilter($area)->addTypeFilter($type); return $this; diff --git a/app/code/Magento/Core/Model/Resource/Theme/File/Collection.php b/app/code/Magento/Core/Model/Resource/Theme/File/Collection.php index cbc6de8ddbb..6c9a3825825 100644 --- a/app/code/Magento/Core/Model/Resource/Theme/File/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Theme/File/Collection.php @@ -30,6 +30,7 @@ namespace Magento\Core\Model\Resource\Theme\File; class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection + implements \Magento\View\Design\Theme\File\CollectionInterface { /** * Collection initialization diff --git a/app/code/Magento/Core/Model/Store.php b/app/code/Magento/Core/Model/Store.php index fef96aefcfd..f8b50a4ca6a 100644 --- a/app/code/Magento/Core/Model/Store.php +++ b/app/code/Magento/Core/Model/Store.php @@ -129,7 +129,7 @@ class Store extends \Magento\Core\Model\AbstractModel const BASE_URL_PLACEHOLDER = '{{base_url}}'; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -293,7 +293,7 @@ class Store extends \Magento\Core\Model\AbstractModel * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Model\Url $url * @param \Magento\App\State $appState * @param \Magento\App\RequestInterface $request @@ -311,7 +311,7 @@ class Store extends \Magento\Core\Model\AbstractModel \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Model\Url $url, \Magento\App\State $appState, \Magento\App\RequestInterface $request, diff --git a/app/code/Magento/Core/Model/TemplateEngine/Decorator/DebugHints.php b/app/code/Magento/Core/Model/TemplateEngine/Decorator/DebugHints.php index 17546d991bc..d01cbe248a8 100644 --- a/app/code/Magento/Core/Model/TemplateEngine/Decorator/DebugHints.php +++ b/app/code/Magento/Core/Model/TemplateEngine/Decorator/DebugHints.php @@ -54,7 +54,7 @@ class DebugHints implements \Magento\View\TemplateEngineInterface * * {@inheritdoc} */ - public function render(\Magento\Core\Block\Template $block, $templateFile, array $dictionary = array()) + public function render(\Magento\View\Element\BlockInterface $block, $templateFile, array $dictionary = array()) { $result = $this->_subject->render($block, $templateFile, $dictionary); if ($this->_showBlockHints) { @@ -87,10 +87,10 @@ HTML; * Insert block debugging hints into the rendered block contents * * @param string $blockHtml - * @param \Magento\Core\Block\Template $block + * @param \Magento\View\Element\BlockInterface $block * @return string */ - protected function _renderBlockHints($blockHtml, \Magento\Core\Block\Template $block) + protected function _renderBlockHints($blockHtml, \Magento\View\Element\BlockInterface $block) { $blockClass = get_class($block); return <<<HTML diff --git a/app/code/Magento/Core/Model/Theme.php b/app/code/Magento/Core/Model/Theme.php index 2bd65ac5151..b34409f06e9 100644 --- a/app/code/Magento/Core/Model/Theme.php +++ b/app/code/Magento/Core/Model/Theme.php @@ -57,14 +57,6 @@ namespace Magento\Core\Model; */ class Theme extends \Magento\Core\Model\AbstractModel implements \Magento\View\Design\ThemeInterface { - /**#@+ - * Theme types group - */ - const TYPE_PHYSICAL = 0; - const TYPE_VIRTUAL = 1; - const TYPE_STAGING = 2; - /**#@-*/ - /** * Filename of view configuration */ @@ -85,32 +77,32 @@ class Theme extends \Magento\Core\Model\AbstractModel implements \Magento\View\D protected $_eventObject = 'theme'; /** - * @var \Magento\Core\Model\Theme\FlyweightFactory + * @var \Magento\View\Design\Theme\FlyweightFactory */ protected $_themeFactory; /** - * @var \Magento\Core\Model\Theme\Domain\Factory + * @var \Magento\View\Design\Theme\Domain\Factory */ protected $_domainFactory; /** - * @var \Magento\Core\Model\Theme\ImageFactory + * @var \Magento\View\Design\Theme\ImageFactory */ protected $_imageFactory; /** - * @var \Magento\Core\Model\Theme\Validator + * @var \Magento\View\Design\Theme\Validator */ protected $_validator; /** - * @var \Magento\Core\Model\Theme\Customization + * @var \Magento\View\Design\Theme\Customization */ protected $_customization; /** - * @var \Magento\Core\Model\Theme\CustomizationFactory + * @var \Magento\View\Design\Theme\CustomizationFactory */ protected $_customFactory; @@ -119,30 +111,19 @@ class Theme extends \Magento\Core\Model\AbstractModel implements \Magento\View\D */ protected $_appState; - /** - * All possible types of a theme - * - * @var array - */ - public static $types = array( - self::TYPE_PHYSICAL, - self::TYPE_VIRTUAL, - self::TYPE_STAGING, - ); - /** * Initialize dependencies - * - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Theme\FlyweightFactory $themeFactory - * @param \Magento\Core\Model\Theme\Domain\Factory $domainFactory - * @param \Magento\Core\Model\Theme\ImageFactory $imageFactory - * @param \Magento\Core\Model\Theme\Validator $validator - * @param \Magento\Core\Model\Theme\CustomizationFactory $customizationFactory + * + * @param Context $context + * @param Registry $registry + * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory + * @param \Magento\View\Design\Theme\Domain\Factory $domainFactory + * @param \Magento\View\Design\Theme\ImageFactory $imageFactory + * @param \Magento\View\Design\Theme\Validator $validator + * @param \Magento\View\Design\Theme\CustomizationFactory $customizationFactory * @param \Magento\App\State $appState - * @param \Magento\Core\Model\Resource\Theme $resource - * @param \Magento\Core\Model\Resource\Theme\Collection $resourceCollection + * @param Resource\Theme $resource + * @param Resource\Theme\Collection $resourceCollection * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -150,11 +131,11 @@ class Theme extends \Magento\Core\Model\AbstractModel implements \Magento\View\D public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Theme\FlyweightFactory $themeFactory, - \Magento\Core\Model\Theme\Domain\Factory $domainFactory, - \Magento\Core\Model\Theme\ImageFactory $imageFactory, - \Magento\Core\Model\Theme\Validator $validator, - \Magento\Core\Model\Theme\CustomizationFactory $customizationFactory, + \Magento\View\Design\Theme\FlyweightFactory $themeFactory, + \Magento\View\Design\Theme\Domain\Factory $domainFactory, + \Magento\View\Design\Theme\ImageFactory $imageFactory, + \Magento\View\Design\Theme\Validator $validator, + \Magento\View\Design\Theme\CustomizationFactory $customizationFactory, \Magento\App\State $appState, \Magento\Core\Model\Resource\Theme $resource = null, \Magento\Core\Model\Resource\Theme\Collection $resourceCollection = null, @@ -184,7 +165,7 @@ class Theme extends \Magento\Core\Model\AbstractModel implements \Magento\View\D /** * Get theme image model * - * @return \Magento\Core\Model\Theme\Image + * @return \Magento\View\Design\Theme\Image */ public function getThemeImage() { @@ -192,7 +173,7 @@ class Theme extends \Magento\Core\Model\AbstractModel implements \Magento\View\D } /** - * @return \Magento\Core\Model\Theme\Customization + * @return \Magento\View\Design\Theme\Customization */ public function getCustomization() { @@ -260,7 +241,7 @@ class Theme extends \Magento\Core\Model\AbstractModel implements \Magento\View\D public function hasChildThemes() { return (bool)$this->getCollection() - ->addTypeFilter(\Magento\Core\Model\Theme::TYPE_VIRTUAL) + ->addTypeFilter(self::TYPE_VIRTUAL) ->addFieldToFilter('parent_id', array('eq' => $this->getId())) ->getSize(); } diff --git a/app/code/Magento/Core/Model/Theme/Collection.php b/app/code/Magento/Core/Model/Theme/Collection.php index 0308169d709..1212e36c635 100644 --- a/app/code/Magento/Core/Model/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Theme/Collection.php @@ -252,13 +252,15 @@ class Collection extends \Magento\Data\Collection $parentPathPieces = array_merge($pathPieces, $parentPathPieces); } - $themePath = implode(\Magento\Core\Model\Theme::PATH_SEPARATOR, $pathData['theme_path_pieces']); - $themeCode = implode(\Magento\Core\Model\Theme::CODE_SEPARATOR, $pathData['theme_path_pieces']); - $parentPath = $parentPathPieces ? implode(\Magento\Core\Model\Theme::PATH_SEPARATOR, $parentPathPieces) : null; + $themePath = implode(\Magento\View\Design\ThemeInterface::PATH_SEPARATOR, $pathData['theme_path_pieces']); + $themeCode = implode(\Magento\View\Design\ThemeInterface::CODE_SEPARATOR, $pathData['theme_path_pieces']); + $parentPath = $parentPathPieces + ? implode(\Magento\View\Design\ThemeInterface::PATH_SEPARATOR, $parentPathPieces) + : null; return array( 'parent_id' => null, - 'type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL, + 'type' => \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL, 'area' => $pathData['area'], 'theme_path' => $themePath, 'code' => $themeCode, @@ -317,7 +319,7 @@ class Collection extends \Magento\Data\Collection /** * Retrieve item id * - * @param \Magento\Core\Model\Theme|\Magento\Object $item + * @param \Magento\View\Design\ThemeInterface|\Magento\Object $item * @return string */ protected function _getItemId(\Magento\Object $item) diff --git a/app/code/Magento/Core/Model/Theme/CopyService.php b/app/code/Magento/Core/Model/Theme/CopyService.php index 8af315c0e13..8f09b2ed3dc 100644 --- a/app/code/Magento/Core/Model/Theme/CopyService.php +++ b/app/code/Magento/Core/Model/Theme/CopyService.php @@ -37,7 +37,7 @@ class CopyService protected $_filesystem; /** - * @var \Magento\Core\Model\Theme\FileFactory + * @var \Magento\View\Design\Theme\FileFactory */ protected $_fileFactory; @@ -57,25 +57,25 @@ class CopyService protected $_eventManager; /** - * @var \Magento\Core\Model\Theme\Customization\Path + * @var \Magento\View\Design\Theme\Customization\Path */ protected $_customizationPath; /** * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\Theme\FileFactory $fileFactory + * @param \Magento\View\Design\Theme\FileFactory $fileFactory * @param \Magento\Core\Model\Layout\Link $link * @param \Magento\Core\Model\Layout\UpdateFactory $updateFactory * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Model\Theme\Customization\Path $customization + * @param \Magento\View\Design\Theme\Customization\Path $customization */ public function __construct( \Magento\Filesystem $filesystem, - \Magento\Core\Model\Theme\FileFactory $fileFactory, + \Magento\View\Design\Theme\FileFactory $fileFactory, \Magento\Core\Model\Layout\Link $link, \Magento\Core\Model\Layout\UpdateFactory $updateFactory, \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Model\Theme\Customization\Path $customization + \Magento\View\Design\Theme\Customization\Path $customization ) { $this->_filesystem = $filesystem; $this->_fileFactory = $fileFactory; diff --git a/app/code/Magento/Core/Model/Theme/Customization/Config.php b/app/code/Magento/Core/Model/Theme/Customization/Config.php new file mode 100644 index 00000000000..156e1fad325 --- /dev/null +++ b/app/code/Magento/Core/Model/Theme/Customization/Config.php @@ -0,0 +1,66 @@ +<?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 Magento + * @package Magento_Core + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * {@inheritdoc} + */ +namespace Magento\Core\Model\Theme\Customization; + +class Config implements \Magento\View\Design\Theme\Customization\ConfigInterface +{ + /** + * XML path to definitions of customization services + */ + const XML_PATH_CUSTOM_FILES = 'theme/customization'; + + /** + * @var \Magento\Core\Model\Config + */ + protected $config; + + /** + * @param \Magento\Core\Model\Config $config + */ + public function __construct(\Magento\Core\Model\Config $config) + { + $this->config = $config; + } + + /** + * {@inheritdoc} + */ + public function getFileTypes() + { + $types = array(); + $convertNode = $this->config->getValue(self::XML_PATH_CUSTOM_FILES, 'default'); + if ($convertNode) { + foreach ($convertNode as $name => $value) { + $types[$name] = $value; + } + } + return $types; + } +} diff --git a/app/code/Magento/Core/Model/Theme/Domain/Physical.php b/app/code/Magento/Core/Model/Theme/Domain/Physical.php index 3cd53635583..35b30986a68 100644 --- a/app/code/Magento/Core/Model/Theme/Domain/Physical.php +++ b/app/code/Magento/Core/Model/Theme/Domain/Physical.php @@ -34,7 +34,7 @@ class Physical /** * Physical theme model instance * - * @var \Magento\Core\Model\Theme + * @var \Magento\View\Design\ThemeInterface */ protected $_theme; @@ -75,7 +75,7 @@ class Physical * Create theme customization * * @param \Magento\View\Design\ThemeInterface $theme - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ public function createVirtualTheme($theme) { @@ -84,7 +84,7 @@ class Physical $themeData['theme_id'] = null; $themeData['theme_path'] = null; $themeData['theme_title'] = $this->_getVirtualThemeTitle($theme); - $themeData['type'] = \Magento\Core\Model\Theme::TYPE_VIRTUAL; + $themeData['type'] = \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL; /** @var $themeCustomization \Magento\View\Design\ThemeInterface */ $themeCustomization = $this->_themeFactory->create()->setData($themeData); @@ -105,7 +105,7 @@ class Physical protected function _getVirtualThemeTitle($theme) { $themeCopyCount = $this->_themeCollection->addAreaFilter(\Magento\Core\Model\App\Area::AREA_FRONTEND) - ->addTypeFilter(\Magento\Core\Model\Theme::TYPE_VIRTUAL) + ->addTypeFilter(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) ->addFilter('parent_id', $theme->getId()) ->count(); diff --git a/app/code/Magento/Core/Model/Theme/Domain/Staging.php b/app/code/Magento/Core/Model/Theme/Domain/Staging.php index f1302a2d0ce..9007f0b74b3 100644 --- a/app/code/Magento/Core/Model/Theme/Domain/Staging.php +++ b/app/code/Magento/Core/Model/Theme/Domain/Staging.php @@ -34,7 +34,7 @@ class Staging /** * Staging theme model instance * - * @var \Magento\Core\Model\Theme + * @var \Magento\View\Design\ThemeInterface */ protected $_theme; diff --git a/app/code/Magento/Core/Model/Theme/Domain/Virtual.php b/app/code/Magento/Core/Model/Theme/Domain/Virtual.php index bf1579275a3..96d784364a2 100644 --- a/app/code/Magento/Core/Model/Theme/Domain/Virtual.php +++ b/app/code/Magento/Core/Model/Theme/Domain/Virtual.php @@ -34,7 +34,7 @@ class Virtual /** * Virtual theme model instance * - * @var \Magento\Core\Model\Theme + * @var \Magento\View\Design\ThemeInterface */ protected $_theme; @@ -46,7 +46,7 @@ class Virtual /** * Staging theme model instance * - * @var \Magento\Core\Model\Theme + * @var \Magento\View\Design\ThemeInterface */ protected $_stagingTheme; @@ -83,7 +83,7 @@ class Virtual /** * Get 'staging' theme * - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ public function getStagingTheme() { @@ -100,7 +100,7 @@ class Virtual /** * Get 'physical' theme * - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ public function getPhysicalTheme() { @@ -130,7 +130,7 @@ class Virtual /** * Create 'staging' theme associated with current 'virtual' theme * - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ protected function _createStagingTheme() { @@ -142,7 +142,7 @@ class Virtual 'theme_title' => sprintf('%s - Staging', $this->_theme->getThemeTitle()), 'preview_image' => $this->_theme->getPreviewImage(), 'is_featured' => $this->_theme->getIsFeatured(), - 'type' => \Magento\Core\Model\Theme::TYPE_STAGING + 'type' => \Magento\View\Design\ThemeInterface::TYPE_STAGING )); $stagingTheme->save(); return $stagingTheme; diff --git a/app/code/Magento/Core/Model/Theme/File.php b/app/code/Magento/Core/Model/Theme/File.php index c7fb466d569..379d9c7864d 100644 --- a/app/code/Magento/Core/Model/Theme/File.php +++ b/app/code/Magento/Core/Model/Theme/File.php @@ -30,7 +30,7 @@ namespace Magento\Core\Model\Theme; class File extends \Magento\Core\Model\AbstractModel - implements \Magento\Core\Model\Theme\FileInterface + implements \Magento\View\Design\Theme\FileInterface { /** * {@inheritdoc} @@ -47,30 +47,30 @@ class File extends \Magento\Core\Model\AbstractModel protected $_eventObject = 'file'; /** - * @var \Magento\Core\Model\Theme + * @var \Magento\View\Design\ThemeInterface */ protected $_theme; /** - * @var \Magento\Core\Model\Theme\Customization\FileServiceFactory + * @var \Magento\View\Design\Theme\Customization\FileServiceFactory */ protected $_fileServiceFactory; /** - * @var \Magento\Core\Model\Theme\Customization\FileInterface + * @var \Magento\View\Design\Theme\Customization\FileInterface */ protected $_fileService; /** - * @var \Magento\Core\Model\Theme\FlyweightFactory + * @var \Magento\View\Design\Theme\FlyweightFactory */ protected $_themeFactory; /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Theme\FlyweightFactory $themeFactory - * @param \Magento\Core\Model\Theme\Customization\FileServiceFactory $fileServiceFactory + * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory + * @param \Magento\View\Design\Theme\Customization\FileServiceFactory $fileServiceFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -78,15 +78,15 @@ class File extends \Magento\Core\Model\AbstractModel public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Theme\FlyweightFactory $themeFactory, - \Magento\Core\Model\Theme\Customization\FileServiceFactory $fileServiceFactory, + \Magento\View\Design\Theme\FlyweightFactory $themeFactory, + \Magento\View\Design\Theme\Customization\FileServiceFactory $fileServiceFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_themeFactory = $themeFactory; $this->_fileServiceFactory = $fileServiceFactory; + parent::__construct($context, $registry, $resource, $resourceCollection, $data); } /** @@ -102,7 +102,7 @@ class File extends \Magento\Core\Model\AbstractModel * * @return $this */ - public function setCustomizationService(\Magento\Core\Model\Theme\Customization\FileInterface $fileService) + public function setCustomizationService(\Magento\View\Design\Theme\Customization\FileInterface $fileService) { $this->_fileService = $fileService; return $this; @@ -130,6 +130,7 @@ class File extends \Magento\Core\Model\AbstractModel { $this->_theme = $theme; $this->setData('theme_id', $theme->getId()); + $this->setData('theme_path', $theme->getThemePath()); return $this; } diff --git a/app/code/Magento/Core/Model/Theme/FileProvider.php b/app/code/Magento/Core/Model/Theme/FileProvider.php new file mode 100644 index 00000000000..dca04802da3 --- /dev/null +++ b/app/code/Magento/Core/Model/Theme/FileProvider.php @@ -0,0 +1,55 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Theme; + +class FileProvider implements \Magento\View\Design\Theme\FileProviderInterface +{ + /** + * @var \Magento\Core\Model\Resource\Theme\File\CollectionFactory + */ + protected $fileFactory; + + /** + * @param \Magento\Core\Model\Resource\Theme\File\CollectionFactory $fileFactory + */ + public function __construct(\Magento\Core\Model\Resource\Theme\File\CollectionFactory $fileFactory) + { + $this->fileFactory = $fileFactory; + } + + /** + * {@inheritdoc} + */ + public function getItems(\Magento\View\Design\ThemeInterface $theme, array $filters = array()) + { + /** @var \Magento\View\Design\Theme\File\CollectionInterface $themeFiles */ + $themeFiles = $this->fileFactory->create(); + $themeFiles->addThemeFilter($theme); + foreach ($filters as $field => $value) { + $themeFiles->addFieldToFilter($field, $value); + } + $themeFiles->setDefaultOrder(); + return $themeFiles->getItems(); + } +} diff --git a/app/code/Magento/Core/Model/Theme/Image/Path.php b/app/code/Magento/Core/Model/Theme/Image/Path.php index 9fc553dd6a7..7eba34128ba 100644 --- a/app/code/Magento/Core/Model/Theme/Image/Path.php +++ b/app/code/Magento/Core/Model/Theme/Image/Path.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,13 +27,8 @@ */ namespace Magento\Core\Model\Theme\Image; -class Path +class Path implements \Magento\View\Design\Theme\Image\PathInterface { - /** - * Image preview path - */ - const PREVIEW_DIRECTORY_PATH = 'theme/preview'; - /** * Default theme preview image */ @@ -44,33 +37,33 @@ class Path /** * @var \Magento\App\Dir */ - protected $_dir; + protected $dir; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ - protected $_viewUrl; + protected $viewUrl; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\UrlInterface */ - protected $_storeManager; + protected $storeManager; /** * Initialize dependencies * * @param \Magento\App\Dir $dir - * @param \Magento\Core\Model\View\Url $viewUrl - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\View\Url $viewUrl + * @param \Magento\UrlInterface $storeManager */ public function __construct( \Magento\App\Dir $dir, - \Magento\Core\Model\View\Url $viewUrl, - \Magento\Core\Model\StoreManager $storeManager + \Magento\View\Url $viewUrl, + \Magento\Core\Model\StoreManagerInterface $storeManager ) { - $this->_dir = $dir; - $this->_viewUrl = $viewUrl; - $this->_storeManager = $storeManager; + $this->dir = $dir; + $this->viewUrl = $viewUrl; + $this->storeManager = $storeManager; } /** @@ -80,7 +73,7 @@ class Path */ public function getPreviewImageDirectoryUrl() { - return $this->_storeManager->getStore()->getBaseUrl(\Magento\Core\Model\Store::URL_TYPE_MEDIA) + return $this->storeManager->getStore()->getBaseUrl(\Magento\Core\Model\Store::URL_TYPE_MEDIA) . self::PREVIEW_DIRECTORY_PATH . '/'; } @@ -91,7 +84,7 @@ class Path */ public function getPreviewImageDefaultUrl() { - return $this->_viewUrl->getViewFileUrl(self::DEFAULT_PREVIEW_IMAGE); + return $this->viewUrl->getViewFileUrl(self::DEFAULT_PREVIEW_IMAGE); } /** @@ -101,7 +94,7 @@ class Path */ public function getImagePreviewDirectory() { - return $this->_dir->getDir(\Magento\App\Dir::MEDIA) . DIRECTORY_SEPARATOR + return $this->dir->getDir(\Magento\App\Dir::MEDIA) . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, self::PREVIEW_DIRECTORY_PATH); } @@ -113,7 +106,7 @@ class Path public function getTemporaryDirectory() { return implode(DIRECTORY_SEPARATOR, array( - $this->_dir->getDir(\Magento\App\Dir::MEDIA), 'theme', 'origin' + $this->dir->getDir(\Magento\App\Dir::MEDIA), 'theme', 'origin' )); } } diff --git a/app/code/Magento/Core/Model/Theme/Observer.php b/app/code/Magento/Core/Model/Theme/Observer.php index c985b9bc41c..c94d7363b30 100644 --- a/app/code/Magento/Core/Model/Theme/Observer.php +++ b/app/code/Magento/Core/Model/Theme/Observer.php @@ -32,7 +32,7 @@ namespace Magento\Core\Model\Theme; class Observer { /** - * @var \Magento\Core\Model\Theme\ImageFactory + * @var \Magento\View\Design\Theme\ImageFactory */ protected $_themeImageFactory; @@ -52,13 +52,13 @@ class Observer protected $_eventDispatcher; /** - * @param \Magento\Core\Model\Theme\ImageFactory $themeImageFactory + * @param \Magento\View\Design\Theme\ImageFactory $themeImageFactory * @param \Magento\Core\Model\Resource\Layout\Update\Collection $updateCollection * @param \Magento\Theme\Model\Config\Customization $themeConfig * @param \Magento\Event\ManagerInterface $eventDispatcher */ public function __construct( - \Magento\Core\Model\Theme\ImageFactory $themeImageFactory, + \Magento\View\Design\Theme\ImageFactory $themeImageFactory, \Magento\Core\Model\Resource\Layout\Update\Collection $updateCollection, \Magento\Theme\Model\Config\Customization $themeConfig, \Magento\Event\ManagerInterface $eventDispatcher @@ -78,7 +78,7 @@ class Observer public function cleanThemeRelatedContent(\Magento\Event\Observer $observer) { $theme = $observer->getEvent()->getData('theme'); - if ($theme instanceof \Magento\Core\Model\Theme) { + if ($theme instanceof \Magento\View\Design\ThemeInterface) { return; } /** @var $theme \Magento\View\Design\ThemeInterface */ @@ -97,7 +97,7 @@ class Observer public function checkThemeIsAssigned(\Magento\Event\Observer $observer) { $theme = $observer->getEvent()->getData('theme'); - if ($theme instanceof \Magento\Core\Model\Theme) { + if ($theme instanceof \Magento\View\Design\ThemeInterface) { /** @var $theme \Magento\View\Design\ThemeInterface */ if ($this->_themeConfig->isThemeAssignedToStore($theme)) { $this->_eventDispatcher->dispatch('assigned_theme_changed', array('theme' => $this)); diff --git a/app/code/Magento/Core/Model/Theme/Registration.php b/app/code/Magento/Core/Model/Theme/Registration.php index 2e0d0a8a565..7905c2ca541 100644 --- a/app/code/Magento/Core/Model/Theme/Registration.php +++ b/app/code/Magento/Core/Model/Theme/Registration.php @@ -29,6 +29,8 @@ */ namespace Magento\Core\Model\Theme; +use \Magento\View\Design\ThemeInterface; + class Registration { /** @@ -49,8 +51,8 @@ class Registration * @var array */ protected $_allowedRelations = array( - array(\Magento\Core\Model\Theme::TYPE_PHYSICAL, \Magento\Core\Model\Theme::TYPE_VIRTUAL), - array(\Magento\Core\Model\Theme::TYPE_VIRTUAL, \Magento\Core\Model\Theme::TYPE_STAGING) + array(ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_VIRTUAL), + array(ThemeInterface::TYPE_VIRTUAL, ThemeInterface::TYPE_STAGING) ); /** @@ -59,8 +61,8 @@ class Registration * @var array */ protected $_forbiddenRelations = array( - array(\Magento\Core\Model\Theme::TYPE_VIRTUAL, \Magento\Core\Model\Theme::TYPE_VIRTUAL), - array(\Magento\Core\Model\Theme::TYPE_PHYSICAL, \Magento\Core\Model\Theme::TYPE_STAGING) + array(ThemeInterface::TYPE_VIRTUAL, ThemeInterface::TYPE_VIRTUAL), + array(ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_STAGING) ); /** @@ -82,7 +84,7 @@ class Registration * * @param string $baseDir * @param string $pathPattern - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ public function register($baseDir = '', $pathPattern = '') { @@ -137,7 +139,7 @@ class Registration } $this->_savePreviewImage($theme); - $theme->setType(\Magento\Core\Model\Theme::TYPE_PHYSICAL); + $theme->setType(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL); $theme->save(); return $this; @@ -149,7 +151,7 @@ class Registration * @param \Magento\View\Design\ThemeInterface $theme * @return $this */ - protected function _savePreviewImage(\Magento\View\Design\ThemeInterface $theme) + protected function _savePreviewImage(ThemeInterface $theme) { $themeDirectory = $theme->getCustomization()->getThemeFilesPath(); if (!$theme->getPreviewImage() || !$themeDirectory) { @@ -166,7 +168,7 @@ class Registration * Get theme from DB by full path * * @param string $fullPath - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ public function getThemeFromDb($fullPath) { @@ -180,11 +182,11 @@ class Registration */ public function checkPhysicalThemes() { - $themes = $this->_collectionFactory->create()->addTypeFilter(\Magento\Core\Model\Theme::TYPE_PHYSICAL); + $themes = $this->_collectionFactory->create()->addTypeFilter(ThemeInterface::TYPE_PHYSICAL); /** @var $theme \Magento\View\Design\ThemeInterface */ foreach ($themes as $theme) { if (!$this->_themeCollection->hasTheme($theme)) { - $theme->setType(\Magento\Core\Model\Theme::TYPE_VIRTUAL)->save(); + $theme->setType(ThemeInterface::TYPE_VIRTUAL)->save(); } } return $this; diff --git a/app/code/Magento/Core/Model/Theme/ThemeProvider.php b/app/code/Magento/Core/Model/Theme/ThemeProvider.php new file mode 100644 index 00000000000..8c64bba1e42 --- /dev/null +++ b/app/code/Magento/Core/Model/Theme/ThemeProvider.php @@ -0,0 +1,83 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Theme; + +class ThemeProvider implements \Magento\View\Design\Theme\ThemeProviderInterface +{ + /** + * @var \Magento\Core\Model\Resource\Theme\CollectionFactory + */ + protected $collectionFactory; + + /** + * @var \Magento\Core\Model\ThemeFactory + */ + protected $themeFactory; + + /** + * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\ThemeFactory $themeFactory + */ + public function __construct( + \Magento\Core\Model\Resource\Theme\CollectionFactory $collectionFactory, + \Magento\Core\Model\ThemeFactory $themeFactory + ) { + $this->collectionFactory = $collectionFactory; + $this->themeFactory = $themeFactory; + } + + /** + * {@inheritdoc} + */ + public function getThemeByFullPath($fullPath) + { + /** @var $themeCollection \Magento\Core\Model\Resource\Theme\Collection */ + $themeCollection = $this->collectionFactory->create(); + return $themeCollection->getThemeByFullPath($fullPath); + } + + /** + * {@inheritdoc} + */ + public function getThemeCustomizations( + $area = \Magento\Core\Model\App\Area::AREA_FRONTEND, + $type = \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL + ) { + /** @var $themeCollection \Magento\Core\Model\Resource\Theme\Collection */ + $themeCollection = $this->collectionFactory->create(); + $themeCollection->addAreaFilter($area) + ->addTypeFilter($type); + return $themeCollection; + } + + /** + * {@inheritdoc} + */ + public function getThemeById($themeId) + { + /** @var $themeModel \Magento\View\Design\ThemeInterface */ + $themeModel = $this->themeFactory->create(); + return $themeModel->load($themeId); + } +} diff --git a/app/code/Magento/Core/Model/Translate.php b/app/code/Magento/Core/Model/Translate.php index d83df445b10..321f3fbaf36 100644 --- a/app/code/Magento/Core/Model/Translate.php +++ b/app/code/Magento/Core/Model/Translate.php @@ -154,7 +154,7 @@ class Translate private $_cache; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -198,7 +198,7 @@ class Translate * @param \Magento\Core\Model\Locale\Hierarchy\Config $config * @param \Magento\Core\Model\Translate\Factory $translateFactory * @param \Magento\Cache\FrontendInterface $cache - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\Phrase\Renderer\Placeholder $placeholderRender * @param \Magento\Module\ModuleList $moduleList * @param \Magento\Module\Dir\Reader $modulesReader @@ -215,7 +215,7 @@ class Translate \Magento\Core\Model\Locale\Hierarchy\Config $config, \Magento\Core\Model\Translate\Factory $translateFactory, \Magento\Cache\FrontendInterface $cache, - \Magento\Core\Model\View\FileSystem $viewFileSystem, + \Magento\View\FileSystem $viewFileSystem, \Magento\Phrase\Renderer\Placeholder $placeholderRender, \Magento\Module\ModuleList $moduleList, \Magento\Module\Dir\Reader $modulesReader, @@ -334,9 +334,9 @@ class Translate */ public function processAjaxPost($translate) { - /** @var \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList */ - $cacheTypeList = $this->_translateFactory->create(array(), 'Magento\Core\Model\Cache\TypeListInterface'); - $cacheTypeList->invalidate(\Magento\Core\Model\Cache\Type\Translate::TYPE_IDENTIFIER); + /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */ + $cacheTypeList = $this->_translateFactory->create(array(), 'Magento\App\Cache\TypeListInterface'); + $cacheTypeList->invalidate(\Magento\App\Cache\Type\Translate::TYPE_IDENTIFIER); /** @var $parser \Magento\Core\Model\Translate\InlineParser */ $parser = $this->_translateFactory->create(array(), 'Magento\Core\Model\Translate\InlineParser'); $parser->processAjaxPost($translate, $this->getInlineObject()); @@ -658,7 +658,7 @@ class Translate public function getCacheId() { if (is_null($this->_cacheId)) { - $this->_cacheId = \Magento\Core\Model\Cache\Type\Translate::TYPE_IDENTIFIER; + $this->_cacheId = \Magento\App\Cache\Type\Translate::TYPE_IDENTIFIER; if (isset($this->_config[self::CONFIG_KEY_LOCALE])) { $this->_cacheId .= '_' . $this->_config[self::CONFIG_KEY_LOCALE]; } diff --git a/app/code/Magento/Core/Model/Variable/Config.php b/app/code/Magento/Core/Model/Variable/Config.php index 71cd6f8a3ff..e4d202dd495 100644 --- a/app/code/Magento/Core/Model/Variable/Config.php +++ b/app/code/Magento/Core/Model/Variable/Config.php @@ -36,7 +36,7 @@ namespace Magento\Core\Model\Variable; class Config { /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -46,10 +46,10 @@ class Config protected $_url; /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Backend\Model\Url $url */ - public function __construct(\Magento\Core\Model\View\Url $viewUrl, \Magento\Backend\Model\Url $url) + public function __construct(\Magento\View\Url $viewUrl, \Magento\Backend\Model\Url $url) { $this->_viewUrl = $viewUrl; $this->_url = $url; diff --git a/app/code/Magento/Core/Model/View/Design.php b/app/code/Magento/Core/Model/View/Design.php index 7f924d65fb4..fd682ebdb28 100644 --- a/app/code/Magento/Core/Model/View/Design.php +++ b/app/code/Magento/Core/Model/View/Design.php @@ -80,7 +80,7 @@ class Design implements \Magento\View\DesignInterface protected $_storeManager; /** - * @var \Magento\Core\Model\Theme\FlyweightFactory + * @var \Magento\View\Design\Theme\FlyweightFactory */ protected $_flyweightFactory; @@ -111,7 +111,7 @@ class Design implements \Magento\View\DesignInterface /** * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Theme\FlyweightFactory $flyweightFactory + * @param \Magento\View\Design\Theme\FlyweightFactory $flyweightFactory * @param \Magento\Core\Model\ConfigInterface $config * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig * @param \Magento\Core\Model\ThemeFactory $themeFactory @@ -121,7 +121,7 @@ class Design implements \Magento\View\DesignInterface */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Theme\FlyweightFactory $flyweightFactory, + \Magento\View\Design\Theme\FlyweightFactory $flyweightFactory, \Magento\Core\Model\ConfigInterface $config, \Magento\Core\Model\Store\ConfigInterface $storeConfig, \Magento\Core\Model\ThemeFactory $themeFactory, @@ -167,7 +167,7 @@ class Design implements \Magento\View\DesignInterface /** * Set theme path * - * @param \Magento\Core\Model\Theme|int|string $theme + * @param \Magento\View\Design\ThemeInterface|string $theme * @param string $area * @return \Magento\Core\Model\View\Design */ @@ -179,7 +179,7 @@ class Design implements \Magento\View\DesignInterface $area = $this->getArea(); } - if ($theme instanceof \Magento\Core\Model\Theme) { + if ($theme instanceof \Magento\View\Design\ThemeInterface) { $this->_theme = $theme; } else { $this->_theme = $this->_flyweightFactory->create($theme, $area); diff --git a/app/code/Magento/Core/Model/Image/Factory.php b/app/code/Magento/Core/Model/View/Url/Config.php similarity index 61% rename from app/code/Magento/Core/Model/Image/Factory.php rename to app/code/Magento/Core/Model/View/Url/Config.php index 62aeec8e5cf..b469b555358 100644 --- a/app/code/Magento/Core/Model/Image/Factory.php +++ b/app/code/Magento/Core/Model/View/Url/Config.php @@ -24,33 +24,33 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Image; +namespace Magento\Core\Model\View\Url; -class Factory +class Config implements \Magento\View\Url\ConfigInterface { /** - * @var \Magento\Core\Model\Image\AdapterFactory + * @var \Magento\Core\Model\Store\Config */ - protected $_adapterFactory; + protected $_storeConfig; /** - * @param \Magento\Core\Model\Image\AdapterFactory $adapterFactory + * View url config model + * + * @param \Magento\Core\Model\Store\Config $storeConfig */ - public function __construct(\Magento\Core\Model\Image\AdapterFactory $adapterFactory) + public function __construct(\Magento\Core\Model\Store\Config $storeConfig) { - $this->_adapterFactory = $adapterFactory; + $this->_storeConfig = $storeConfig; } /** - * Return \Magento\Image + * Retrieve url store config value * - * @param string $fileName - * @param string $adapterType - * @return \Magento\Image + * @param string $path + * @return mixed */ - public function create($fileName = null, $adapterType = null) + public function getValue($path) { - $adapter = $this->_adapterFactory->create($adapterType); - return new \Magento\Image($adapter, $fileName); + return $this->_storeConfig->getConfig($path); } } diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php index 6282084b476..5e2c8c4b27e 100644 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php +++ b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php @@ -31,7 +31,7 @@ $filesystemCollection->addDefaultPattern('*'); /** @var $theme \Magento\View\Design\ThemeInterface */ foreach ($this->_themeResourceFactory->create() as $theme) { $themeType = $filesystemCollection->hasTheme($theme) - ? \Magento\Core\Model\Theme::TYPE_PHYSICAL - : \Magento\Core\Model\Theme::TYPE_VIRTUAL; + ? \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL + : \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL; $theme->setType($themeType)->save(); } diff --git a/app/code/Magento/Core/etc/cache.xml b/app/code/Magento/Core/etc/cache.xml index 1480b547a49..6fc59f69613 100644 --- a/app/code/Magento/Core/etc/cache.xml +++ b/app/code/Magento/Core/etc/cache.xml @@ -24,23 +24,23 @@ */ --> <config> - <type name="config" translate="label,description" instance="Magento\Core\Model\Cache\Type\Config"> + <type name="config" translate="label,description" instance="Magento\App\Cache\Type\Config"> <label>Configuration</label> <description>System(config.xml, local.xml) and modules configuration files(config.xml).</description> </type> - <type name="layout" translate="label,description" instance="Magento\Core\Model\Cache\Type\Layout"> + <type name="layout" translate="label,description" instance="Magento\App\Cache\Type\Layout"> <label>Layouts</label> <description>Layout building instructions.</description> </type> - <type name="block_html" translate="label,description" instance="Magento\Core\Model\Cache\Type\Block"> + <type name="block_html" translate="label,description" instance="Magento\App\Cache\Type\Block"> <label>Blocks HTML output</label> <description>Page blocks HTML.</description> </type> - <type name="translate" translate="label,description" instance="Magento\Core\Model\Cache\Type\Translate"> + <type name="translate" translate="label,description" instance="Magento\App\Cache\Type\Translate"> <label>Translations</label> <description>Translation files.</description> </type> - <type name="collections" translate="label,description" instance="Magento\Core\Model\Cache\Type\Collection"> + <type name="collections" translate="label,description" instance="Magento\App\Cache\Type\Collection"> <label>Collections Data</label> <description>Collection data files.</description> </type> diff --git a/app/code/Magento/Core/etc/config.xml b/app/code/Magento/Core/etc/config.xml index f79a59e1061..d21b1f20af4 100644 --- a/app/code/Magento/Core/etc/config.xml +++ b/app/code/Magento/Core/etc/config.xml @@ -57,6 +57,19 @@ <minify_files>0</minify_files> <minify_adapter>Magento\Code\Minifier\Adapter\Js\Jsmin</minify_adapter> </js> + <image> + <default_adapter>GD2</default_adapter> + <adapters> + <GD2> + <title>PHP GD2</title> + <class>Magento\Image\Adapter\Gd2</class> + </GD2> + <IMAGEMAGICK> + <title>ImageMagick</title> + <class>Magento\Image\Adapter\ImageMagick</class> + </IMAGEMAGICK> + </adapters> + </image> </dev> <system> <filesystem> @@ -78,6 +91,107 @@ <design_theme_folder>theme</design_theme_folder> </allowed_resources> </media_storage_configuration> + <filesystem> + <directory> + <base> + <read_only>true</read_only> + <path/> + </base> + <app> + <read_only>true</read_only> + <path>app</path> + </app> + <code> + <read_only>true</read_only> + <path>app/code</path> + </code> + <design> + <read_only>true</read_only> + <path>app/design</path> + </design> + <etc> + <read_only>false</read_only> + <path>app/etc</path> + <allow_create_dirs>false</allow_create_dirs> + <permissions>777</permissions> + </etc> + <lib> + <read_only>true</read_only> + <path>lib</path> + </lib> + <var> + <read_only>false</read_only> + <path>var</path> + <allow_create_dirs>true</allow_create_dirs> + <permissions>777</permissions> + </var> + <tmp> + <read_only>false</read_only> + <path>var/tmp</path> + <allow_create_dirs>true</allow_create_dirs> + <permissions>777</permissions> + </tmp> + <cache> + <read_only>false</read_only> + <path>var/cache</path> + <allow_create_dirs>true</allow_create_dirs> + <permissions>777</permissions> + </cache> + <log> + <read_only>false</read_only> + <path>var/log</path> + <allow_create_dirs>true</allow_create_dirs> + <permissions>777</permissions> + </log> + <session> + <read_only>false</read_only> + <path>var/session</path> + <allow_create_dirs>true</allow_create_dirs> + <permissions>777</permissions> + </session> + <di> + <read_only>false</read_only> + <path>var/di</path> + <allow_create_dirs>true</allow_create_dirs> + <permissions>777</permissions> + </di> + <generation> + <read_only>false</read_only> + <path>var/generation</path> + <allow_create_dirs>true</allow_create_dirs> + <permissions>777</permissions> + </generation> + <pub> + <read_only>true</read_only> + <path>pub</path> + <permissions>777</permissions> + </pub> + <pub_lib> + <read_only>true</read_only> + <path>pub/lib</path> + </pub_lib> + <media> + <read_only>false</read_only> + <path>pub/media</path> + <permissions>777</permissions> + </media> + <upload> + <read_only>false</read_only> + <path>pub/media/upload</path> + <permissions>777</permissions> + </upload> + <static> + <read_only>false</read_only> + <path>pub/static</path> + <permissions>777</permissions> + </static> + <view_cache> + <read_only>false</read_only> + <path>pub/cache</path> + <permissions>777</permissions> + </view_cache> + </directory> + </filesystem> </system> <trans_email> <ident_custom1> @@ -189,8 +303,8 @@ </general> <theme> <customization> - <css>Magento\Core\Model\Theme\Customization\File\Css</css> - <js>Magento\Core\Model\Theme\Customization\File\Js</js> + <css>Magento\View\Design\Theme\Customization\File\Css</css> + <js>Magento\View\Design\Theme\Customization\File\Js</js> </customization> </theme> </default> diff --git a/app/code/Magento/Core/etc/di.xml b/app/code/Magento/Core/etc/di.xml index 2d9f468fa86..ea8699421ba 100644 --- a/app/code/Magento/Core/etc/di.xml +++ b/app/code/Magento/Core/etc/di.xml @@ -39,6 +39,7 @@ <preference for="Magento\Core\Model\Config\Storage\WriterInterface" type="Magento\Core\Model\Config\Storage\Writer\Db" /> <preference for="Magento\PubSub\Event\QueueWriterInterface" type="Magento\PubSub\Event\QueueWriter" /> <preference for="Magento\PubSub\Event\FactoryInterface" type="Magento\PubSub\Event\Factory" /> + <preference for="Magento\View\Design\Theme\FileInterface" type="Magento\Core\Model\Theme\File" /> <preference for="Magento\PubSub\Message\DispatcherAsyncInterface" type="Magento\PubSub\Message\DispatcherAsync" /> <preference for="Magento\Config\ConverterInterface" type="Magento\Config\Converter\Dom"/> <preference for="Magento\Phrase\RendererInterface" type="Magento\Phrase\Renderer\Composite" /> @@ -46,6 +47,10 @@ <preference for="Magento\App\DefaultPathInterface" type="Magento\App\DefaultPath\DefaultPath" /> <preference for="Magento\Encryption\EncryptorInterface" type="Magento\Encryption\Encryptor" /> <preference for="Magento\Filter\Encrypt\AdapterInterface" type=" Magento\Filter\Encrypt\Basic" /> + <preference for="Magento\Cache\ConfigInterface" type="Magento\Cache\Config" /> + <preference for="Magento\View\Design\Theme\ThemeProviderInterface" type="Magento\Core\Model\Theme\ThemeProvider" /> + <preference for="Magento\View\Design\Theme\FileProviderInterface" type="Magento\Core\Model\Theme\FileProvider" /> + <preference for="Magento\View\Design\Theme\Customization\ConfigInterface" type="Magento\Core\Model\Theme\Customization\Config" /> <type name="Magento\App\DefaultPath\DefaultPath"> <param name="parts"> <value> @@ -71,7 +76,7 @@ <type name="Magento\Data\Structure" shared="false" /> <type name="Magento\Data\Collection\Db\FetchStrategy\Cache"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Collection" /> + <instance type="Magento\App\Cache\Type\Collection" /> </param> <param name="cacheIdPrefix"> <value>collection_</value> @@ -95,7 +100,7 @@ </type> <virtualType name="Magento\Core\Model\Resource\Website\Collection\FetchStrategy" type="Magento\Data\Collection\Db\FetchStrategy\Cache"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Collection" /> + <instance type="Magento\App\Cache\Type\Collection" /> </param> <param name="cacheIdPrefix"> <value>app_</value> @@ -111,7 +116,7 @@ </virtualType> <virtualType name="Magento\Core\Model\Resource\Store\Group\Collection\FetchStrategy" type="Magento\Data\Collection\Db\FetchStrategy\Cache"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Collection" /> + <instance type="Magento\App\Cache\Type\Collection" /> </param> <param name="cacheIdPrefix"> <value>app_</value> @@ -127,7 +132,7 @@ </virtualType> <virtualType name="Magento\Core\Model\Resource\Store\Collection\FetchStrategy" type="Magento\Data\Collection\Db\FetchStrategy\Cache"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Collection" /> + <instance type="Magento\App\Cache\Type\Collection" /> </param> <param name="cacheIdPrefix"> <value>app_</value> @@ -168,12 +173,12 @@ <instance type="Magento\View\Layout\File\Source\Aggregated" /> </param> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Layout" /> + <instance type="Magento\App\Cache\Type\Layout" /> </param> </type> <type name="Magento\Core\Model\Resource\Layout\Update"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Layout" /> + <instance type="Magento\App\Cache\Type\Layout" /> </param> </type> <virtualType name="layoutFileSourceBaseFiltered" type="Magento\View\Layout\File\Source\Decorator\ModuleOutput"> @@ -230,9 +235,9 @@ <instance type="layoutFileSourceOverrideThemeSorted" /> </param> </type> - <type name="Magento\Core\Model\Theme\Image"> + <type name="Magento\View\Design\Theme\Image"> <param name="uploader"> - <instance type="Magento\Core\Model\Theme\Image\Uploader\Proxy" /> + <instance type="Magento\View\Design\Theme\Image\Uploader\Proxy" /> </param> </type> <type name="Magento\Phrase\Renderer\Composite"> @@ -252,7 +257,7 @@ </type> <type name="Magento\Core\Model\Config\SectionPool"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Config" /> + <instance type="Magento\App\Cache\Type\Config" /> </param> </type> <type name="Magento\Core\Model\Config\Section\Reader\Website"> @@ -288,11 +293,6 @@ </value> </param> </type> - <type name="Magento\Core\Controller\Varien\Action\Context"> - <param name="isRenderInherited"> - <value type="bool">false</value> - </param> - </type> <type name="Magento\Core\Model\View\Design"> <param name="themes"> <value> @@ -302,22 +302,30 @@ </value> </param> </type> - <type name="Magento\Core\Model\View\Publisher"> - <param name="allowFilesDuplication"> + <type name="Magento\View\Publisher"> + <param name="allowDuplication"> <value type="bool">true</value> </param> </type> - <type name="Magento\Core\Model\Fieldset\Config\Reader"> + <type name="Magento\Object\Copy\Config\Reader"> <param name="fileName"> <value>fieldset.xml</value> </param> <param name="schemaLocator"> - <instance type="Magento\Core\Model\Fieldset\Config\SchemaLocator" /> + <instance type="Magento\Object\Copy\Config\SchemaLocator" /> + </param> + </type> + <type name="Magento\Object\Copy\Config\SchemaLocator"> + <param name="schema"> + <value>lib/Magento/Object/etc/fieldset.xsd</value> + </param> + <param name="perFileSchema"> + <value>lib/Magento/Object/etc/fieldset_file.xsd</value> </param> </type> - <type name="Magento\Core\Model\Fieldset\Config\Data"> + <type name="Magento\Object\Copy\Config\Data"> <param name="reader"> - <instance type="Magento\Core\Model\Fieldset\Config\Reader" /> + <instance type="Magento\Object\Copy\Config\Reader" /> </param> <param name="cacheId"> <value>fieldset_config</value> @@ -337,9 +345,6 @@ <param name="locale"> <instance type="Magento\Core\Model\Locale\Proxy" /> </param> - <param name="dateModel"> - <instance type="Magento\Core\Model\Date\Proxy" /> - </param> </type> <type name="Magento\Core\Model\Resource\Setup\Migration"> <param name="confPathToMapFile"> @@ -393,7 +398,7 @@ <instance type="Magento\Core\Model\File\Storage\File\Proxy" /> </param> </type> - <type name="Magento\Core\Model\View\Service"> + <type name="Magento\View\Service"> <param name="design"> <instance type="Magento\Core\Model\View\Design\Proxy" /> </param> @@ -401,6 +406,38 @@ <type name="Magento\View\TemplateEngineFactory"> <plugin name="debug_hints" type="Magento\Core\Model\TemplateEngine\Plugin\DebugHints" sortOrder="10"/> </type> + <type name="\Magento\Image"> + <param name="adapter"> + <instance type="Magento\Image\Adapter\Gd2"/> + </param> + </type> + <type name="Magento\Core\Model\Layout\PageType\Config\Reader"> + <param name="fileName"> + <value>page_types.xml</value> + </param> + <param name="converter"> + <instance type="Magento\Core\Model\Layout\PageType\Config\Converter" /> + </param> + <param name="schemaLocator"> + <instance type="Magento\Core\Model\Layout\PageType\Config\SchemaLocator" /> + </param> + <param name="defaultScope"> + <value>frontend</value> + </param> + </type> + <virtualType name="Magento\Core\Model\Layout\PageType\Config\Data" type="Magento\Config\Data"> + <param name='reader'> + <instance type="Magento\Core\Model\Layout\PageType\Config\Reader" /> + </param> + <param name="cacheId"> + <value>page_types_config</value> + </param> + </virtualType> + <type name="Magento\Core\Model\Layout\PageType\Config"> + <param name="dataStorage"> + <instance type="Magento\Core\Model\Layout\PageType\Config\Data" /> + </param> + </type> <type name="Magento\Core\Model\Store\Storage\Db"> <param name="url"> <instance type="Magento\Backend\Model\Url\Proxy" /> @@ -414,4 +451,9 @@ <type name="Magento\App\FrontController"> <plugin name="dispatchExceptionHandler" type="Magento\Core\App\FrontController\Plugin\DispatchExceptionHandler" sortOrder="30"/> </type> + <type name="Magento\Core\Model\Locale"> + <param name="dateModel"> + <instance type="Magento\Core\Model\Date\Proxy" /> + </param> + </type> </config> diff --git a/app/code/Magento/Core/etc/layouts.xsd b/app/code/Magento/Core/etc/layouts.xsd index 4a7a5d954c5..09794115fa5 100644 --- a/app/code/Magento/Core/etc/layouts.xsd +++ b/app/code/Magento/Core/etc/layouts.xsd @@ -56,6 +56,14 @@ </xs:sequence> <xs:attribute type="xs:string" name="type"/> <xs:attribute type="xs:string" name="label"/> + <xs:attribute name="design_abstraction"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="custom"/> + <xs:enumeration value="page_layout"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> </xs:complexType> <xs:complexType name="argumentsType"> diff --git a/app/code/Magento/Core/etc/page_types.xsd b/app/code/Magento/Core/etc/page_types.xsd new file mode 100644 index 00000000000..5ffa93cde4c --- /dev/null +++ b/app/code/Magento/Core/etc/page_types.xsd @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="page_types"> + <xs:complexType> + <xs:sequence> + <xs:element name="type" type="typeDeclaration" minOccurs="1" maxOccurs="unbounded"> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:complexType name="typeDeclaration"> + <xs:annotation> + <xs:documentation> + Type declaration. + </xs:documentation> + </xs:annotation> + <xs:attribute name="id" type="xs:ID" use="required" /> + <xs:attribute name="label" type="pageTypeLabel" use="required" /> + </xs:complexType> + + <xs:simpleType name="pageTypeLabel"> + <xs:annotation> + <xs:documentation> + Label can contain any character. + </xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:pattern value=".+" /> + </xs:restriction> + </xs:simpleType> +</xs:schema> diff --git a/app/code/Magento/CurrencySymbol/Helper/Data.php b/app/code/Magento/CurrencySymbol/Helper/Data.php index 414c06f31f1..799be90d5f0 100644 --- a/app/code/Magento/CurrencySymbol/Helper/Data.php +++ b/app/code/Magento/CurrencySymbol/Helper/Data.php @@ -42,22 +42,18 @@ class Data extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolFactory * @param bool $dbCompatibleMode */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolFactory, $dbCompatibleMode = true @@ -65,11 +61,9 @@ class Data extends \Magento\Core\Helper\Data $this->_symbolFactory = $symbolFactory; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php b/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php index 7cc457a3342..5d4d665703f 100644 --- a/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php +++ b/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php @@ -61,9 +61,9 @@ class Currencysymbol * @var array */ protected $_cacheTypes = array( - \Magento\Core\Model\Cache\Type\Config::TYPE_IDENTIFIER, - \Magento\Core\Model\Cache\Type\Block::TYPE_IDENTIFIER, - \Magento\Core\Model\Cache\Type\Layout::TYPE_IDENTIFIER, + \Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, + \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER, + \Magento\App\Cache\Type\Layout::TYPE_IDENTIFIER, ); /** @@ -90,7 +90,7 @@ class Currencysymbol protected $_eventManager; /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -130,7 +130,7 @@ class Currencysymbol * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Backend\Model\Config\Factory $configFactory - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Model\System\Store $systemStore @@ -140,7 +140,7 @@ class Currencysymbol \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Config $coreConfig, \Magento\Backend\Model\Config\Factory $configFactory, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, + \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Model\System\Store $systemStore, diff --git a/app/code/Magento/Customer/Block/Address/Edit.php b/app/code/Magento/Customer/Block/Address/Edit.php index aaf3d5da1f8..bb5ff34e22b 100644 --- a/app/code/Magento/Customer/Block/Address/Edit.php +++ b/app/code/Magento/Customer/Block/Address/Edit.php @@ -53,7 +53,7 @@ class Edit extends \Magento\Directory\Block\Data /** * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory @@ -65,7 +65,7 @@ class Edit extends \Magento\Directory\Block\Data public function __construct( \Magento\Core\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php index 713dc37aa9b..068335dafe1 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php @@ -144,7 +144,7 @@ class View */ public function getCreateDate() { - return $this->_coreData->formatDate( + return $this->formatDate( $this->getCustomer()->getCreatedAtTimestamp(), \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM, true @@ -184,7 +184,7 @@ class View { $date = $this->getCustomerLog()->getLoginAtTimestamp(); if ($date) { - return $this->_coreData->formatDate( + return $this->formatDate( $date, \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM, true @@ -329,4 +329,4 @@ class View } return true; } -} \ No newline at end of file +} diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php index d2fed16e56d..4ffb6c7c989 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php @@ -37,7 +37,7 @@ namespace Magento\Customer\Block\Adminhtml\Form\Element; class File extends \Magento\Data\Form\Element\AbstractElement { /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -53,7 +53,7 @@ class File extends \Magento\Data\Form\Element\AbstractElement * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param array $attributes */ public function __construct( @@ -61,7 +61,7 @@ class File extends \Magento\Data\Form\Element\AbstractElement \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, $attributes = array() ) { $this->_adminhtmlData = $adminhtmlData; diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index 7292a69437b..40ef4a7fcdd 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -44,7 +44,7 @@ class Register extends \Magento\Directory\Block\Data protected $_customerSession; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession @@ -55,7 +55,7 @@ class Register extends \Magento\Directory\Block\Data * @param array $data */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Customer/Helper/Address.php b/app/code/Magento/Customer/Helper/Address.php index a35462a3158..93309fc8349 100644 --- a/app/code/Magento/Customer/Helper/Address.php +++ b/app/code/Magento/Customer/Helper/Address.php @@ -67,7 +67,7 @@ class Address extends \Magento\Core\Helper\AbstractHelper /** * Block factory * - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; @@ -94,7 +94,7 @@ class Address extends \Magento\Core\Helper\AbstractHelper /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\BlockFactory $blockFactory + * @param \Magento\View\Element\BlockFactory $blockFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Eav\Model\Config $eavConfig @@ -102,7 +102,7 @@ class Address extends \Magento\Core\Helper\AbstractHelper */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Core\Model\BlockFactory $blockFactory, + \Magento\View\Element\BlockFactory $blockFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php index 3e6573f1a87..f578d61c893 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php @@ -37,7 +37,7 @@ namespace Magento\Customer\Model\Resource\Customer; class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection { /** - * @var \Magento\Core\Model\Fieldset\Config + * @var \Magento\Object\Copy\Config */ protected $_fieldsetConfig; @@ -51,7 +51,7 @@ class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory - * @param \Magento\Core\Model\Fieldset\Config $fieldsetConfig + * @param \Magento\Object\Copy\Config $fieldsetConfig */ public function __construct( \Magento\Event\ManagerInterface $eventManager, @@ -63,7 +63,7 @@ class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, - \Magento\Core\Model\Fieldset\Config $fieldsetConfig + \Magento\Object\Copy\Config $fieldsetConfig ) { $this->_fieldsetConfig = $fieldsetConfig; parent::__construct( diff --git a/app/code/Magento/Customer/etc/fieldset.xml b/app/code/Magento/Customer/etc/fieldset.xml index 0b7d88e7234..7ef094fe85e 100644 --- a/app/code/Magento/Customer/etc/fieldset.xml +++ b/app/code/Magento/Customer/etc/fieldset.xml @@ -26,7 +26,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="customer_account"> <field name="prefix"> diff --git a/app/code/Magento/Customer/etc/frontend/page_types.xml b/app/code/Magento/Customer/etc/frontend/page_types.xml new file mode 100644 index 00000000000..5fd4f6e7f7d --- /dev/null +++ b/app/code/Magento/Customer/etc/frontend/page_types.xml @@ -0,0 +1,37 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="customer_account_confirmation" label="Customer Account Confirmation"/> + <type id="customer_account_create" label="Customer Account Registration Form"/> + <type id="customer_account_createpassword" label="Reset a Password"/> + <type id="customer_account_edit" label="Customer Account Edit Form"/> + <type id="customer_account_forgotpassword" label="Customer Forgot Password Form"/> + <type id="customer_account_index" label="Customer My Account Dashboard"/> + <type id="customer_account_login" label="Customer Account Login Form"/> + <type id="customer_account_logoutsuccess" label="Customer Account Logout Success"/> + <type id="customer_address_form" label="Customer My Account Address Edit Form"/> + <type id="customer_address_index" label="Customer My Account Address Book"/> +</page_types> diff --git a/app/code/Magento/Customer/view/frontend/account/dashboard/address.phtml b/app/code/Magento/Customer/view/frontend/account/dashboard/address.phtml index 2e4329b4fe3..b0c420fc344 100644 --- a/app/code/Magento/Customer/view/frontend/account/dashboard/address.phtml +++ b/app/code/Magento/Customer/view/frontend/account/dashboard/address.phtml @@ -19,32 +19,33 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="col2-set"> - <div class="box"> - <div class="box-title"> - <h3><?php echo __('Address Book') ?></h3> - <a href="<?php echo $this->getAddressBookUrl() ?>"><?php echo __('Manage Addresses') ?></a> +<div class="block dashboard addresses"> + <div class="title"> + <strong><?php echo __('Address Book') ?></strong> + <a class="action edit" href="<?php echo $this->getAddressBookUrl() ?>"><span><?php echo __('Manage Addresses') ?></span></a> + </div> + <div class="content"> + <div class="box address billing"> + <strong class="subtitle"> + <span><?php echo __('Default Billing Address') ?></span> + <a class="action edit" href="<?php echo $this->getPrimaryBillingAddressEditUrl() ?>"><span><?php echo __('Edit Address') ?></span></a> + </strong> + <address> + <?php echo $this->getPrimaryBillingAddressHtml() ?> + </address> </div> - <div class="box-content"> - <div class="col-1"> - <h4><?php echo __('Default Billing Address') ?></h4> - <address> - <?php echo $this->getPrimaryBillingAddressHtml() ?><br /> - <a href="<?php echo $this->getPrimaryBillingAddressEditUrl() ?>"><?php echo __('Edit Address') ?></a> - </address> - </div> - <div class="col-2"> - <h4><?php echo __('Default Shipping Address') ?></h4> - <address> - <?php echo $this->getPrimaryShippingAddressHtml() ?><br /> - <a href="<?php echo $this->getPrimaryShippingAddressEditUrl() ?>"><?php echo __('Edit Address') ?></a> - </address> - </div> + <div class="box address shipping"> + <strong class="subtitle"> + <span><?php echo __('Default Shipping Address') ?></span> + <a class="action edit" href="<?php echo $this->getPrimaryShippingAddressEditUrl() ?>"><span><?php echo __('Edit Address') ?></span></a> + </strong> + <address> + <?php echo $this->getPrimaryShippingAddressHtml() ?> + </address> </div> </div> </div> diff --git a/app/code/Magento/Customer/view/frontend/account/dashboard/hello.phtml b/app/code/Magento/Customer/view/frontend/account/dashboard/hello.phtml index 04a590f7ec5..29e0f6bbfe2 100644 --- a/app/code/Magento/Customer/view/frontend/account/dashboard/hello.phtml +++ b/app/code/Magento/Customer/view/frontend/account/dashboard/hello.phtml @@ -19,12 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="welcome-msg"> - <p class="hello"><strong><?php echo __('Hello, %1!', $this->escapeHtml($this->getCustomerName())) ?></strong></p> - <p><?php echo __('From your dashboard you can review recent account activity and edit your account information.') ?></p> +<div class="block dashboard welcome"> + <div class="title"><strong><?php echo __('Hello, %1!', $this->escapeHtml($this->getCustomerName())) ?></strong></div> + <div class="content"> + <p><?php echo __('From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.') ?></p> + </div> </div> diff --git a/app/code/Magento/Customer/view/frontend/account/dashboard/info.phtml b/app/code/Magento/Customer/view/frontend/account/dashboard/info.phtml index f9297800293..9c5c531fbc4 100644 --- a/app/code/Magento/Customer/view/frontend/account/dashboard/info.phtml +++ b/app/code/Magento/Customer/view/frontend/account/dashboard/info.phtml @@ -19,46 +19,40 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="col2-set"> - <div class="col-1"> - <div class="box"> - <div class="box-title"> - <h3><?php echo __('Contact Information') ?></h3> - <a href="<?php echo $this->getUrl('customer/account/edit') ?>"><?php echo __('Edit') ?></a> - </div> - <div class="box-content"> - <p> - <?php echo $this->escapeHtml($this->getCustomer()->getName()) ?><br /> - <?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?><br /> - <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo __('Change Password') ?></a> - </p> - </div> +<div class="block dashboard info"> + <div class="title"><strong><?php echo __('Account Information') ?></strong></div> + <div class="content"> + <div class="box information"> + <strong class="subtitle"> + <?php echo __('Contact Information') ?> + <a class="action edit" href="<?php echo $this->getUrl('customer/account/edit') ?>"><span><?php echo __('Edit') ?></span></a> + </strong> + <p> + <?php echo $this->escapeHtml($this->getCustomer()->getName()) ?><br> + <?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?><br> + <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo __('Change Password') ?></a> + </p> </div> - </div> - <?php if( $this->isNewsletterEnabled() ): ?> - <div class="col-2"> - <div class="box"> - <div class="box-title"> - <h3><?php echo __('Newsletters') ?></h3> - <a href="<?php echo $this->getUrl('newsletter/manage') ?>"><?php echo __('Edit') ?></a> - </div> - <div class="box-content"> + <?php if( $this->isNewsletterEnabled() ): ?> + <div class="box newsletter"> + <strong class="subtitle"> + <?php echo __('Newsletters') ?> + <a class="action edit" href="<?php echo $this->getUrl('newsletter/manage') ?>"><span><?php echo __('Edit') ?></span></a> + </strong> <p> <?php if( $this->getIsSubscribed() ): ?> - <?php echo __("You subscribe to 'General Subscription'.") ?> + <?php echo __("You are currently subscribed to 'General Subscription'.") ?> <?php else: ?> - <?php echo __('You do not subscribe to a newsletter.') ?> + <?php echo __('You are currently not subscribed to any newsletter.') ?> <?php endif; ?> </p> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.account.dashboard.info.extra')?> </div> - </div> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.account.dashboard.info.extra')?> + <?php endif; ?> </div> - <?php endif; ?> </div> diff --git a/app/code/Magento/Customer/view/frontend/account/link/back.phtml b/app/code/Magento/Customer/view/frontend/account/link/back.phtml index 3e2076b14da..f983ab287d7 100644 --- a/app/code/Magento/Customer/view/frontend/account/link/back.phtml +++ b/app/code/Magento/Customer/view/frontend/account/link/back.phtml @@ -19,11 +19,10 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="buttons-set"> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> +<div class="actions"> + <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a></div> </div> diff --git a/app/code/Magento/Customer/view/frontend/account/navigation.phtml b/app/code/Magento/Customer/view/frontend/account/navigation.phtml index 3211833fdb5..4c32d516857 100644 --- a/app/code/Magento/Customer/view/frontend/account/navigation.phtml +++ b/app/code/Magento/Customer/view/frontend/account/navigation.phtml @@ -18,19 +18,22 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * + * @category design * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this \Magento\Page\Block\Links */ ?> <?php /** @var $this \Magento\Customer\Block\Account\Navigation */ ?> -<div class="block block-account"> - <div class="block-title"> - <strong><span><?php echo __('My Account'); ?></span></strong> +<div class="block account nav"> + <div class="title"> + <strong><?php echo __('My Account'); ?></strong> </div> - <div class="block-content"> - <ul> - <?php echo $this->getChildHtml();?> - </ul> + <div class="content"> + <navigation class="account nav"> + <ul class="nav items"> + <?php echo $this->getChildHtml();?> + </ul> + </navigation> </div> </div> diff --git a/app/code/Magento/Customer/view/frontend/address/book.phtml b/app/code/Magento/Customer/view/frontend/address/book.phtml index ccfa6b6e5fb..55fe8c99957 100644 --- a/app/code/Magento/Customer/view/frontend/address/book.phtml +++ b/app/code/Magento/Customer/view/frontend/address/book.phtml @@ -18,8 +18,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category customer address book - * @package mage + * @category design * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -30,75 +29,81 @@ * @var $this \Magento\Customer\Block\Address\Book */ ?> -<div class="page-title title-buttons"> - <h1><?php echo __('Address Book') ?></h1> - <button type="button" role="add-address" title="<?php echo __('Add New Address') ?>" class="button"><span><span><?php echo __('Add New Address') ?></span></span></button> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<div class="col2-set addresses-list"> - <div class="col-1 addresses-primary"> - <h2><?php echo __('Default Addresses') ?></h2> - <ol> +<div class="block addresses default"> + <div class="title"><strong><?php echo __('Default Addresses') ?></strong></div> + <div class="content"> <?php if($_pAddsses = $this->getDefaultBilling()): ?> - <li class="item"> - <h3><?php echo __('Default Billing Address') ?></h3> + <div class="box address billing"> + <strong class="subtitle"> + <span><?php echo __('Default Billing Address') ?></span> + <a class="action edit" href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"> + <span><?php echo __('Change Billing Address') ?></span> + </a> + </strong> <address> <?php echo $this->getAddressHtml($this->getAddressById($_pAddsses)) ?> </address> - <p><a href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"><?php echo __('Change Billing Address') ?></a></p> - </li> + </div> <?php else: ?> - <li class="item"> - <h3><?php echo __('Default Billing Address') ?></h3> - <?php echo __('You have no default billing address in your address book.') ?> - </li> + <div class="box address billing"> + <strong class="subtitle"><span><?php echo __('Default Billing Address') ?></span></strong> + <p><?php echo __('You have no default billing address in your address book.') ?></p> + </div> <?php endif ?> <?php if($_pAddsses = $this->getDefaultShipping()): ?> - <li class="item"> - <h3><?php echo __('Default Shipping Address') ?></h3> + <div class="box address shipping"> + <strong class="subtitle"> + <span><?php echo __('Default Shipping Address') ?></span> + <a class="action edit" href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"> + <span><?php echo __('Change Shipping Address') ?></span> + </a> + </strong> <address> <?php echo $this->getAddressHtml($this->getAddressById($_pAddsses)) ?> </address> - <p><a href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"><?php echo __('Change Shipping Address') ?></a></p> - </li> + </div> <?php else: ?> - <li class="item empty"> - <h3><?php echo __('Default Shipping Address') ?></h3> + <div class="box address shipping"> + <strong class="subtitle"><span><?php echo __('Default Shipping Address') ?></span></strong> <p><?php echo __('You have no default shipping address in your address book.') ?></p> - </li> + </div> <?php endif ?> - </ol> </div> - <div class="col-2 addresses-additional"> - <h2><?php echo __('Additional Address Entries') ?></h2> - <ol> +</div> + +<div class="block addresses list"> + <div class="title"><strong><?php echo __('Additional Address Entries') ?></strong></div> + <div class="content"> <?php if($_pAddsses = $this->getAdditionalAddresses()): ?> - <?php foreach($_pAddsses as $_address): ?> - <li class="item"> - <address> - <?php echo $this->getAddressHtml($_address) ?> - </address> - <p><a href="<?php echo $this->getUrl('customer/address/edit', array('id'=>$_address->getId())) ?>"><?php echo __('Edit Address') ?></a> <span class="separator">|</span> <a href="#" class="link-remove" role="delete-address" data-address="<?php echo $_address->getId() ?>"><?php echo __('Delete Address') ?></a></p> - </li> - <?php endforeach; ?> + <ol class="items addresses"> + <?php foreach($_pAddsses as $_address): ?> + <li class="item"> + <address> + <?php echo $this->getAddressHtml($_address) ?><br /> + </address> + <div class="item actions"> + <a class="action edit" href="<?php echo $this->getUrl('customer/address/edit', array('id'=>$_address->getId())) ?>"><span><?php echo __('Edit Address') ?></span></a> + <a class="action delete" href="#" role="delete-address" data-address="<?php echo $_address->getId() ?>"><span><?php echo __('Delete Address') ?></span></a> + </div> + </li> + <?php endforeach; ?> + </ol> <?php else: ?> - <li class="item empty"> - <p><?php echo __('You have no more address entries in your address book.') ?></p> - </li> + <p class="empty"><?php echo __('You have no additional address entries in your address book.') ?></p> <?php endif ?> - </ol> </div> </div> -<div class="buttons-set"> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> + +<div class="actions"> + <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a></div> </div> <script type="text/javascript"> - head.js("<?php echo $this->getViewFileUrl('Magento_Customer::address.js');?>", function() { - jQuery('div.page-title').address({ + head.js("<?php echo $this->getViewFileUrl('Magento_Customer::address.js'); ?>", function() { + jQuery('.page.main').address({ deleteAddress: "li.item a[role='delete-address']", deleteUrlPrefix: '<?php echo $this->getDeleteUrl() ?>id/', - addAddress: "div.title-buttons button[role='add-address']", + addAddress: "button[role='add-address']", addAddressLocation: '<?php echo $this->getAddAddressUrl() ?>' }); }); diff --git a/app/design/frontend/magento_plushe/Magento_Customer/address/button.phtml b/app/code/Magento/Customer/view/frontend/address/button.phtml similarity index 91% rename from app/design/frontend/magento_plushe/Magento_Customer/address/button.phtml rename to app/code/Magento/Customer/view/frontend/address/button.phtml index 7cf5a8cafe8..7d4f76c99af 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/address/button.phtml +++ b/app/code/Magento/Customer/view/frontend/address/button.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,17 +16,17 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Temlate for \Magento\Customer\Block\Address\Book block - * @var $test \Magento\Customer\Block\Address\Book - */ -?> -<button type="button" role="add-address" title="<?php echo __('Add New Address') ?>" class="action add"><span><?php echo __('Add New Address') ?></span></button> \ No newline at end of file + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * Temlate for \Magento\Customer\Block\Address\Book block + * @var $this \Magento\Customer\Block\Address\Book + */ +?> +<button type="button" role="add-address" title="<?php echo __('Add New Address') ?>" class="action add"><span><?php echo __('Add New Address') ?></span></button> diff --git a/app/code/Magento/Customer/view/frontend/address/edit.phtml b/app/code/Magento/Customer/view/frontend/address/edit.phtml index e726d3a6e2a..9910b6b783c 100644 --- a/app/code/Magento/Customer/view/frontend/address/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/address/edit.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -31,125 +30,113 @@ * @var $this \Magento\Customer\Block\Address\Edit */ ?> -<?php if($this->getTitle()): ?> -<div class="page-title"> - <h1><?php echo $this->getTitle() ?></h1> -</div> -<?php endif; ?> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate"> - <div class="fieldset"> - <?php echo $this->getBlockHtml('formkey')?> - <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" /> - <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" /> - <h2 class="legend"><?php echo __('Contact Information') ?></h2> - <ul class="form-list"> - <li class="fields"> - <?php echo $this->getNameBlockHtml() ?> - </li> - <li class="wide"> - <label for="company"><?php echo __('Company') ?></label> - <div class="input-box"> - <input type="text" name="company" id="company" title="<?php echo __('Company') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="telephone" class="required"><em>*</em><?php echo __('Telephone') ?></label> - <div class="input-box"> - <input type="text" name="telephone" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone" /> - </div> - </div> - <div class="field"> - <label for="fax"><?php echo __('Fax') ?></label> - <div class="input-box"> - <input type="text" name="fax" id="fax" title="<?php echo __('Fax') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('fax') ?>" /> - </div> - </div> - </li> - </ul> - </div> - <div class="fieldset"> - <h2 class="legend"><?php echo __('Address') ?></h2> - <ul class="form-list"> +<form class="form address edit" action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data" data-hasrequired="<?php echo __('* Required Fields') ?>"> + <fieldset class="fieldset"> + <legend class="legend"><span><?php echo __('Contact Information') ?></span></legend><br> + <?php echo $this->getBlockHtml('formkey')?> + <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>"> + <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>"> + <?php echo $this->getNameBlockHtml() ?> + <div class="field company"> + <label class="label" for="company"><span><?php echo __('Company') ?></span></label> + <div class="control"> + <input type="text" name="company" id="company" title="<?php echo __('Company') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>"> + </div> + </div> + <div class="field telephone required"> + <label class="label" for="telephone"><span><?php echo __('Telephone') ?></span></label> + <div class="control"> + <input type="text" name="telephone" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone"> + </div> + </div> + <div class="field fax"> + <label class="label" for="fax"><span><?php echo __('Fax') ?></span></label> + <div class="control"> + <input type="text" name="fax" id="fax" title="<?php echo __('Fax') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('fax') ?>"> + </div> + </div> + </fieldset> + <fieldset class="fieldset"> + <legend class="legend"><span><?php echo __('Address') ?></span></legend><br> <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> - <li class="wide"> - <label for="street_1" class="required"><em>*</em><?php echo __('Street Address') ?></label> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </li> - <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> - <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> - <li class="wide"> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> + <div class="field street required"> + <label for="street_1" class="label"><span><?php echo __('Street Address') ?></span></label> + <div class="control"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> + <div class="nested"> + <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> + <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> + <div class="field additional"> + <div class="control"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>"> + </div> + </div> + <?php endfor; ?> </div> - </li> - <?php endfor; ?> - <?php if ($this->helper('Magento\Customer\Helper\Address')->isVatAttributeVisible()) : ?> - <li class="wide"> - <label for="vat_id"><?php echo __('VAT Number') ?></label> - <div class="input-box"> - <input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo __('VAT Number') ?>" id="vat_id" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('vat_id') ?>" /> + </div> + </div> + + <?php if ($this->helper('Magento\Customer\Helper\Address')->isVatAttributeVisible()) : ?> + <div class="field taxvat"> + <label class="label" for="vat_id"><span><?php echo __('VAT Number') ?></span></label> + <div class="control"> + <input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo __('VAT Number') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('vat_id') ?>" id="vat_id"> </div> - </li> - <?php endif; ?> - <li class="fields"> - <div class="field"> - <label for="city" class="required"><em>*</em><?php echo __('City') ?></label> - <div class="input-box"> - <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> - </div> - </div> - <div class="field"> - <label for="region_id" class="required"><em>*</em><?php echo __('State/Province') ?></label> - <div class="input-box"> - <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;" <?php if (!$this->getConfig('general/region/display_all')) { ?>disabled="disabled"<?php } ?>> - <option value=""><?php echo __('Please select region, state or province') ?></option> - </select> - <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" <?php if (!$this->getConfig('general/region/display_all')) { ?>disabled="disabled"<?php } ?>/> - </div> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="zip" class="required"><em>*</em><?php echo __('Zip/Postal Code') ?></label> - <div class="input-box"> - <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> - </div> - </div> - <div class="field"> - <label for="country" class="required"><em>*</em><?php echo __('Country') ?></label> - <div class="input-box"> - <?php echo $this->getCountryHtmlSelect() ?> - </div> - </div> - </li> - <li<?php if($this->canSetAsDefaultBilling()) echo ' class="control"' ?>> - <?php if($this->isDefaultBilling()): ?> - <strong><?php echo __('Default Billing Address') ?></strong> - <?php elseif($this->canSetAsDefaultBilling()): ?> - <input type="checkbox" id="primary_billing" name="default_billing" value="1" title="<?php echo __('Use this as my default billing address.') ?>" class="checkbox" /><label for="primary_billing"><?php echo __('Use as my default billing address') ?></label> - <?php else: ?> - <input type="hidden" name="default_billing" value="1" /> - <?php endif; ?> - </li> - <li<?php if($this->canSetAsDefaultShipping()) echo ' class="control"' ?>> - <?php if($this->isDefaultShipping()): ?> - <strong><?php echo __('Default Shipping Address') ?></strong> - <?php elseif($this->canSetAsDefaultShipping()): ?> - <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" title="<?php echo __('Use this as my default shipping address.') ?>" class="checkbox" /><label for="primary_shipping"><?php echo __('Use as my default shipping address') ?></label> - <?php else: ?> - <input type="hidden" name="default_shipping" value="1" /> - <?php endif; ?> - </li> - </ul> - </div> - <div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button type="submit" title="<?php echo __('Save Address') ?>" class="button"><span><span><?php echo __('Save Address') ?></span></span></button> + </div> + <?php endif; ?> + <div class="field city required"> + <label class="label" for="city"><span><?php echo __('City') ?></span></label> + <div class="control"> + <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city"> + </div> + </div> + <div class="field region required"> + <label class="label" for="region_id"><span><?php echo __('State/Province') ?></span></label> + <div class="control"> + <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"<?php echo (!$this->getConfig('general/region/display_all')) ? ' disabled="disabled"' :'';?>> + <option value=""><?php echo __('Please select region, state or province') ?></option> + </select> + <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>"<?php echo (!$this->getConfig('general/region/display_all')) ? ' disabled="disabled"' :'';?>/> + </div> + </div> + <div class="field zip required"> + <label class="label" for="zip"><span><?php echo __('Zip/Postal Code') ?></span></label> + <div class="control"> + <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>"> + </div> + </div> + <div class="field country required"> + <label class="label" for="country"><span><?php echo __('Country') ?></span></label> + <div class="control"> + <?php echo $this->getCountryHtmlSelect() ?> + </div> + </div> + + <?php if($this->isDefaultBilling()): ?> + <div class="field note default"><?php echo __('Default Billing Address') ?></div> + <?php elseif($this->canSetAsDefaultBilling()): ?> + <div class="field choice set billing"> + <input type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox"> + <label class="label" for="primary_billing"><span><?php echo __('Use as my default billing address') ?></span></label> + </div> + <?php else: ?> + <input type="hidden" name="default_billing" value="1" /> + <?php endif; ?> + + <?php if($this->isDefaultShipping()): ?> + <div class="field note default"><?php echo __('Default Shipping Address') ?></div> + <?php elseif($this->canSetAsDefaultShipping()): ?> + <div class="field choice set shipping"> + <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" class="checkbox"> + <label class="label" for="primary_shipping"><span><?php echo __('Use as my default shipping address') ?></span></label> + </div> + <?php else: ?> + <input type="hidden" name="default_shipping" value="1"> + <?php endif; ?> + </fieldset> + <div class="actions"> + <div class="primary"><button type="submit" class="action submit" title="<?php echo __('Save Address') ?>"><span><?php echo __('Save Address') ?></span></button></div> + <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Go back') ?></span></a></div> </div> </form> <script type="text/javascript"> diff --git a/app/code/Magento/Customer/view/frontend/form/confirmation.phtml b/app/code/Magento/Customer/view/frontend/form/confirmation.phtml index 8f8f0863f14..1956b26aa8c 100644 --- a/app/code/Magento/Customer/view/frontend/form/confirmation.phtml +++ b/app/code/Magento/Customer/view/frontend/form/confirmation.phtml @@ -19,32 +19,27 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="page-title"> - <h1><?php echo __('Send confirmation link') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="" method="post" id="form-validate"> - <div class="fieldset"> - <h2 class="legend"><?php echo __('Retrieve your confirmation link here') ?></h2> - <p><?php echo __('Please enter your email below and we\'ll send you confirmation link for it.') ?></p> - <ul class="form-list"> - <li> - <label for="email_address" class="required"><em>*</em><?php echo __('Email Address') ?></label> - <div class="input-box"> - <input type="text" name="email" id="email_address" title="<?php echo __('Email Address') ?>" class="input-text" value="<?php echo $this->escapeHtml($this->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}"/> - </div> - </li> - </ul> - </div> - <div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>"><small>« </small><?php echo __('Back to Login') ?></a></p> - <button type="submit" title="<?php echo __('Submit') ?>" class="button"><span><span><?php echo __('Submit') ?></span></span></button> +<form action="" method="post" id="form-validate" class="form send confirmation"> + <fieldset class="fieldset" data-hasrequired="<?php echo __('* Required Fields') ?>"> + <p class="field note"><?php echo __('Please enter your email below and we will send you the confirmation link for it.') ?></p> + <div class="field email required"> + <label for="email_address" class="label"><span><?php echo __('Email Address') ?></span></label> + <div class="control"> + <input type="text" name="email" id="email_address" class="input-text" value="<?php echo $this->escapeHtml($this->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}"> + </div> + </div> + </fieldset> + <div class="actions"> + <div class="primary"> + <button type="submit" class="action send"><span><?php echo __('Send confirmation link') ?></span></button> + </div> + <div class="secondary"> + <a href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>" class="action back"><span><?php echo __('Back to Login') ?></span></a> + </div> </div> </form> <script type="text/javascript"> diff --git a/app/code/Magento/Customer/view/frontend/form/edit.phtml b/app/code/Magento/Customer/view/frontend/form/edit.phtml index 1eb2db90e04..2aa77595ea1 100644 --- a/app/code/Magento/Customer/view/frontend/form/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/form/edit.phtml @@ -19,75 +19,67 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="page-title"> - <h1><?php echo __('Edit Account Information') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate"> - <div class="fieldset"> +<form class="form edit account" action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate" enctype="multipart/form-data" data-hasrequired="<?php echo __('* Required Fields') ?>" autocomplete="off"> + <fieldset class="fieldset info"> <?php echo $this->getBlockHtml('formkey')?> - <h2 class="legend"><?php echo __('Account Information') ?></h2> - <ul class="form-list"> - <li class="fields"> - <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getCustomer())->toHtml() ?> - </li> - <li> - <label for="email" class="required"><em>*</em><?php echo __('Email Address') ?></label> - <div class="input-box"> - <input type="text" name="email" id="email" value="<?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}"/> - </div> - </li> + <legend class="legend"><span><?php echo __('Account Information') ?></span></legend><br> + <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getCustomer())->toHtml() ?> + <div class="field email required"> + <label class="label" for="email"><span><?php echo __('Email Address') ?></span></label> + <div class="control"> + <input type="text" name="email" id="email" value="<?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}"> + </div> + </div> <?php $_dob = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> + <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> + <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> <?php if ($_dob->isEnabled()): ?> - <li><?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></li> + <?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?> <?php endif ?> - <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> <?php if ($_taxvat->isEnabled()): ?> - <li><?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></li> + <?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?> <?php endif ?> - <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> <?php if ($_gender->isEnabled()): ?> - <li><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></li> + <?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?> <?php endif ?> - <li class="control"> - <input type="checkbox" name="change_password" id="change-password" value="1" title="<?php echo __('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="change-password"><?php echo __('Change Password') ?></label> - </li> - </ul> - </div> - <div class="fieldset" style="display:none;"> - <h2 class="legend"><?php echo __('Change Password') ?></h2> - <ul class="form-list"> - <li> - <label for="current-password" class="required"><em>*</em><?php echo __('Current Password') ?></label> - <div class="input-box"> - <input type="password" title="<?php echo __('Current Password') ?>" class="input-text" name="current_password" id="current-password" /> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="password" class="required"><em>*</em><?php echo __('New Password') ?></label> - <div class="input-box"> - <input type="password" title="<?php echo __('New Password') ?>" class="input-text" name="password" id="password" /> - </div> - </div> - <div class="field"> - <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm New Password') ?></label> - <div class="input-box"> - <input type="password" title="<?php echo __('Confirm New Password') ?>" class="input-text" name="confirmation" id="confirmation" /> - </div> - </div> - </li> - </ul> - </div> - <div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button type="submit" title="<?php echo __('Save') ?>" class="button"><span><span><?php echo __('Save') ?></span></span></button> + <div class="field choice"> + <input type="checkbox" name="change_password" id="change-password" value="1" title="<?php echo __('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox"> + <label class="label" for="change-password"><span><?php echo __('Change Password') ?></span></label> + </div> + </fieldset> + + <fieldset class="fieldset password" style="display:none;"> + <legend class="legend"><span><?php echo __('Change Password') ?></span></legend><br> + <div class="field password current required"> + <label class="label" for="current-password"><span><?php echo __('Current Password') ?></span></label> + <div class="control"> + <input type="password" class="input-text" name="current_password" id="current-password"> + </div> + </div> + <div class="field new password required"> + <label class="label" for="password"><span><?php echo __('New Password') ?></span></label> + <div class="control"> + <input type="password" class="input-text" name="password" id="password"> + </div> + </div> + <div class="field confirm password required"> + <label class="label" for="confirmation"><span><?php echo __('Confirm New Password') ?></span></label> + <div class="control"> + <input type="password" class="input-text" name="confirmation" id="confirmation"> + </div> + </div> + </fieldset> + <div class="actions"> + <div class="primary"> + <button type="submit" class="action save" title="<?php echo __('Save') ?>"><span><?php echo __('Save') ?></span></button> + </div> + <div class="secondary"> + <a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Go back') ?></span></a> + </div> </div> </form> <script type="text/javascript"> @@ -99,21 +91,25 @@ "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", "<?php echo $this->getViewFileUrl('Magento_Customer::set-password.js') ?>", <?php if ($_dob->isEnabled()): ?> - "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", <?php endif ?> function() { $('#change-password').setPassword({ currentPasswordId: '#current-password', passwordId: '#password', confirmationId: '#confirmation', - passwordContainer: 'div.fieldset', + passwordContainer: 'fieldset.fieldset.password', showOnDefault: <?php echo $this->getCustomer()->getChangePassword() ? 'true' : 'false' ?> }); - $('#form-validate').validation({ + var dataForm = $('#form-validate'), ignore; <?php if ($_dob->isEnabled()): ?> + ignore = 'input[id$="full"]'; + <?php endif ?> + dataForm.validation({ + <?php if ($_dob->isEnabled()): ?> errorPlacement: function(error, element) { - if (element.prop('id') === 'dob') { - var dobElement = $('.customer-dob'), + if (element.prop('id').search('full') !== -1) { + var dobElement = $(element).parents('.customer-dob'), errorClass = error.prop('class'); error.insertAfter(element.parent()); dobElement.find('.validate-custom').addClass(errorClass) @@ -123,7 +119,9 @@ error.insertAfter(element); } }, - ignore: ':hidden:not(#dob)' + ignore: ':hidden:not(' + ignore + ')' + <?php else: ?> + ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden' <?php endif ?> }); }); diff --git a/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml b/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml index 0be49d25afd..48cd1f7dee4 100644 --- a/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml +++ b/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml @@ -19,33 +19,28 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="page-title"> - <h1><?php echo __('Forgot Your Password?') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $this->getUrl('*/*/forgotpasswordpost') ?>" method="post" id="form-validate"> - <div class="fieldset"> - <h2 class="legend"><?php echo __('Retrieve your password here') ?></h2> - <p><?php echo __("Please enter your email address. We'll send a link to reset your password.") ?></p> - <ul class="form-list"> - <li> - <label for="email_address" class="required"><em>*</em><?php echo __('Email Address') ?></label> - <div class="input-box"> - <input type="text" name="email" alt="email" id="email_address" class="input-text" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" data-validate="{required:true, 'validate-email':true}" /> - </div> - </li> - <?php echo $this->getChildHtml('form.additional.info'); ?> - </ul> - </div> - <div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>"><small>« </small><?php echo __('Back to Login') ?></a></p> - <button type="submit" title="<?php echo __('Submit') ?>" class="button"><span><span><?php echo __('Submit') ?></span></span></button> +<form class="form password forget" action="<?php echo $this->getUrl('*/*/forgotpasswordpost') ?>" method="post" id="form-validate"> + <fieldset class="fieldset" data-hasrequired="<?php echo __('* Required Fields') ?>"> + <p class="field note"><?php echo __('Please enter your email address below. You will receive a link to reset your password.'); ?></p> + <div class="field email required"> + <label for="email_address" class="label"><span><?php echo __('Email Address') ?></span></label> + <div class="control"> + <input type="text" name="email" alt="email" id="email_address" class="input-text" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" data-validate="{required:true, 'validate-email':true}"> + </div> + </div> + <?php echo $this->getChildHtml('form_additional_info'); ?> + </fieldset> + <div class="actions"> + <div class="primary"> + <button type="submit" class="action submit"><span><?php echo __('Submit') ?></span></button> + </div> + <div class="secondary"> + <a class="action back" href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>"><span><?php echo __('Go back') ?></span></a> + </div> </div> </form> <script type="text/javascript"> diff --git a/app/code/Magento/Customer/view/frontend/form/login.phtml b/app/code/Magento/Customer/view/frontend/form/login.phtml index b65a21e4d50..374fc86688e 100644 --- a/app/code/Magento/Customer/view/frontend/form/login.phtml +++ b/app/code/Magento/Customer/view/frontend/form/login.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -31,58 +30,32 @@ * @see \Magento\Customer\Block\Form\Login */ ?> -<div class="account-login"> - <div class="page-title"> - <h1><?php echo __('Login or Create an Account') ?></h1> - </div> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.form.login.extra')?> - <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form"> - <div class="col2-set"> - <div class="col-1 new-users"> - <div class="content"> - <h2><?php echo __('New Customers') ?></h2> - <p><?php echo __('With your own account, you can check out faster, store multiple shipping addesses, see your shopping activity and more.') ?></p> - </div> - </div> - <div class="col-2 registered-users"> - <div class="content"> - <h2><?php echo __('Registered Customers') ?></h2> - <p><?php echo __('If you have an account with us, please log in.') ?></p> - <ul class="form-list"> - <li> - <label for="email" class="required"><em>*</em><?php echo __('Email Address') ?></label> - <div class="input-box"> - <input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text" title="<?php echo __('Email Address') ?>" data-validate="{required:true, 'validate-email':true}" /> - </div> - </li> - <li> - <label for="pass" class="required"><em>*</em><?php echo __('Password') ?></label> - <div class="input-box"> - <input type="password" name="login[password]" class="input-text" id="pass" title="<?php echo __('Password') ?>" data-validate="{required:true, 'validate-password':true}" /> - </div> - </li> - <?php echo $this->getChildHtml('form.additional.info'); ?> - </ul> - <p class="required"><?php echo __('* Required Fields') ?></p> +<div class="block customer login"> + <div class="title"><strong><?php echo __('Registered Customers') ?></strong></div> + <div class="content"> + <form class="form login" action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form"> + <fieldset class="fieldset login" data-hasrequired="<?php echo __('* Required Fields') ?>"> + <p class="field note"><?php echo __('If you have an account with us, log in using your email address.') ?></p> + <div class="field email required"> + <label class="label" for="email"><span><?php echo __('Email Address') ?></span></label> + <div class="control"> + <input name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" type="text" class="input-text" title="<?php echo __('Email Address') ?>" data-validate="{required:true, 'validate-email':true}"> + </div> </div> - </div> - </div> - <div class="col2-set"> - <div class="col-1 new-users"> - <div class="buttons-set"> - <button type="button" title="<?php echo __('Create an Account') ?>" class="button"><span><span><?php echo __('Create an Account') ?></span></span></button> + <div class="field password required"> + <label for="pass" class="label"><span><?php echo __('Password') ?></span></label> + <div class="control"> + <input name="login[password]" type="password" class="input-text" id="pass" title="<?php echo __('Password') ?>" data-validate="{required:true, 'validate-password':true}"> + </div> </div> - </div> - <div class="col-2 registered-users"> - <div class="buttons-set"> - <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo __('Forgot Your Password?') ?></a> - <button type="submit" class="button" title="<?php echo __('Login') ?>" name="send" id="send2"><span><span><?php echo __('Login') ?></span></span></button> + <?php echo $this->getChildHtml('form_additional_info'); ?> + <div class="actions"> + <div class="primary"><button type="submit" class="action login" name="send" id="send2"><span><?php echo __('Login') ?></span></button></div> + <div class="secondary"><a class="action remind" href="<?php echo $this->getForgotPasswordUrl() ?>"><span><?php echo __('Forgot Your Password?') ?></span></a></div> </div> - </div> - </div> - </form> + </fieldset> + </form> + </div> <script type="text/javascript"> (function($) { head.js( @@ -91,7 +64,6 @@ "<?php echo $this->getViewFileUrl('mage/validation.js')?>", "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", function() { - $('#login-form .new-users button').on('click', function() {window.location='<?php echo $this->getCreateAccountUrl() ?>';}); $('#login-form').validation(); }); })(jQuery); diff --git a/app/code/Magento/Customer/view/frontend/form/newsletter.phtml b/app/code/Magento/Customer/view/frontend/form/newsletter.phtml index ea4a329d870..f5c1b698245 100644 --- a/app/code/Magento/Customer/view/frontend/form/newsletter.phtml +++ b/app/code/Magento/Customer/view/frontend/form/newsletter.phtml @@ -19,30 +19,26 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="page-title"> - <h1><?php echo __('Newsletter Subscription') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> <?php echo $this->getChildHtml('form_before')?> -<form action="<?php echo $this->getAction() ?>" method="post" id="form-validate"> - <div class="fieldset"> - <?php echo $this->getBlockHtml('formkey')?> - <h2 class="legend"><?php echo __('Newsletter Subscription') ?></h2> - <ul class="form-list"> - <li class="control"><input type="checkbox" name="is_subscribed" id="subscription" value="1" title="<?php echo __('General Subscription') ?>"<?php if($this->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="subscription"><?php echo __('General Subscription') ?></label></li> + <form class="form newsletter manage" action="<?php echo $this->getAction() ?>" method="post" id="form-validate"> + <fieldset class="fieldset"> + <?php echo $this->getBlockHtml('formkey')?> + <legend class="legend"><span><?php echo __('Subscription option') ?></span></legend><br> + <div class="field choice"> + <input type="checkbox" name="is_subscribed" id="subscription" value="1" title="<?php echo __('General Subscription') ?>"<?php if($this->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox"> + <label for="subscription" class="label"><span><?php echo __('General Subscription') ?></span></label> + </div> <?php /* Extensions placeholder */ ?> <?php echo $this->getChildHtml('customer.form.newsletter.extra')?> - </ul> - </div> - <div class="buttons-set"> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button type="submit" title="<?php echo __('Save') ?>" class="button"><span><span><?php echo __('Save') ?></span></span></button> - </div> -</form> + </fieldset> + <div class="actions"> + <div class="primary"><button type="submit" title="<?php echo __('Save') ?>" class="action save"><span><?php echo __('Save') ?></span></button></div> + <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a></div> + </div> + </form> <?php /* Extensions placeholder */ ?> <?php echo $this->getChildHtml('customer.form.newsletter.extra2')?> diff --git a/app/code/Magento/Customer/view/frontend/form/register.phtml b/app/code/Magento/Customer/view/frontend/form/register.phtml index be9f1775230..23feacec27f 100644 --- a/app/code/Magento/Customer/view/frontend/form/register.phtml +++ b/app/code/Magento/Customer/view/frontend/form/register.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -31,192 +30,198 @@ * @var $this \Magento\Customer\Block\Form\Register */ ?> -<div class="account-create"> - <div class="page-title"> - <h1><?php echo __('Create an Account') ?></h1> - </div> - <?php echo $this->getChildHtml('form_fields_before')?> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.form.register.extra')?> - <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate"> - <div class="fieldset"> - <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" /> - <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" /> - <h2 class="legend"><?php echo __('Personal Information') ?></h2> - <ul class="form-list"> - <li class="fields"> - <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?> - </li> - <li> - <label for="email_address" class="required"><em>*</em><?php echo __('Email Address') ?></label> - <div class="input-box"> - <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}" /> - </div> - </li> - <?php if ($this->isNewsletterEnabled()): ?> - <li class="control"> - <div class="input-box"> - <input type="checkbox" name="is_subscribed" title="<?php echo __('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" /> - </div> - <label for="is_subscribed"><?php echo __('Sign Up for Newsletter') ?></label> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.form.register.newsletter')?> - </li> - <?php endif ?> - <?php $_dob = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> - <?php if ($_dob->isEnabled()): ?> - <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li> - <?php endif ?> - <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> - <?php if ($_taxvat->isEnabled()): ?> - <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li> - <?php endif ?> - <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> - <?php if ($_gender->isEnabled()): ?> - <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li> - <?php endif ?> - </ul> +<?php echo $this->getChildHtml('form_fields_before')?> +<?php /* Extensions placeholder */ ?> +<?php echo $this->getChildHtml('customer.form.register.extra')?> +<form class="form create account" action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data" autocomplete="off"> + <fieldset class="fieldset create info"> + <legend class="legend"><span><?php echo __('Personal Information') ?></span></legend><br> + <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>"> + <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>"> + <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?> + <div class="field required"> + <label for="email_address" class="label"><span><?php echo __('Email Address') ?></span></label> + <div class="control"> + <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}"> + </div> </div> + <?php if ($this->isNewsletterEnabled()): ?> + <div class="field choice newsletter"> + <input type="checkbox" name="is_subscribed" title="<?php echo __('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox"> + <label for="is_subscribed" class="label"><span><?php echo __('Sign Up for Newsletter') ?></span></label> + </div> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.form.register.newsletter')?> + <?php endif ?> + + <?php $_dob = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> + <?php if ($_dob->isEnabled()): ?> + <?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?> + <?php endif ?> + + <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> + <?php if ($_taxvat->isEnabled()): ?> + <?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?> + <?php endif ?> + + <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> + <?php if ($_gender->isEnabled()): ?> + <?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?> + <?php endif ?> + </fieldset> <?php if($this->getShowAddressFields()): ?> - <div class="fieldset"> + <fieldset class="fieldset address"> + <legend class="legend"><span><?php echo __('Address Information') ?></span></legend><br> <input type="hidden" name="create_address" value="1" /> - <h2 class="legend"><?php echo __('Address Information') ?></h2> - <ul class="form-list"> - <li class="fields"> - <div class="field"> - <label for="company"><?php echo __('Company') ?></label> - <div class="input-box"> - <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo __('Company') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> - </div> - </div> - <div class="field"> - <label for="telephone" class="required"><em>*</em><?php echo __('Telephone') ?></label> - <div class="input-box"> - <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" /> - </div> - </div> - </li> + <div class="field company"> + <label for="company" class="label"><span><?php echo __('Company') ?></span></label> + <div class="control"> + <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo __('Company') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>"> + </div> + </div> + <div class="field telephone"> + <label for="telephone" class="label"><span><?php echo __('Telephone') ?></span></label> + <div class="control"> + <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>"> + </div> + </div> + <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> - <li class="wide"> - <label for="street_1" class="required"><em>*</em><?php echo __('Street Address') ?></label> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </li> - <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> - <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> - <li class="wide"> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </li> - <?php endfor; ?> - <li class="fields"> - <div class="field"> - <label for="city" class="required"><em>*</em><?php echo __('City') ?></label> - <div class="input-box"> - <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> - </div> - </div> - <div class="field"> - <label for="region_id" class="required"><em>*</em><?php echo __('State/Province') ?></label> - <div class="input-box"> - <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> - <option value=""><?php echo __('Please select a region, state or province.') ?></option> - </select> - <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" style="display:none;" /> - </div> + <div class="field street required"> + <label for="street_1" class="label"><span><?php echo __('Street Address') ?></span></label> + <div class="control"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(0)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>"> + <div class="nested"> + <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> + <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> + <div class="field additional no-label"> + <div class="control"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i - 1)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>"> + </div> + </div> + <?php endfor; ?> </div> - </li> - <li class="fields"> - <div class="field"> - <label for="zip" class="required"><em>*</em><?php echo __('Zip/Postal Code') ?></label> - <div class="input-box"> - <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> - </div> - </div> - <div class="field"> - <label for="country" class="required"><em>*</em><?php echo __('Country') ?></label> - <div class="input-box"> - <?php echo $this->getCountryHtmlSelect() ?> - </div> - </div> - </li> - </ul> - <input type="hidden" name="default_billing" value="1" /> - <input type="hidden" name="default_shipping" value="1" /> - </div> + </div> + </div> + + <div class="field required"> + <label for="city" class="label"><span><?php echo __('City') ?></span></label> + <div class="control"> + <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city"> + </div> + </div> + + <div class="field region required"> + <label for="region_id" class="label"><span><?php echo __('State/Province') ?></span></label> + <div class="control"> + <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> + <option value=""><?php echo __('Please select region, state or province') ?></option> + </select> + <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" style="display:none;"> + </div> + </div> + + <div class="field zip required"> + <label for="zip" class="label"><span><?php echo __('Zip/Postal Code') ?></span></label> + <div class="control"> + <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>"> + </div> + </div> + + <div class="field country required"> + <label for="country" class="label"><span><?php echo __('Country') ?></span></label> + <div class="control"> + <?php echo $this->getCountryHtmlSelect() ?> + </div> + </div> + <?php $addressAttributes = $this->getChildBlock('customer_form_address_user_attributes');?> + <?php if ($addressAttributes): ?> + <?php $addressAttributes->setEntity($this->getAddress());?> + <?php $addressAttributes->setFieldIdFormat('address:%1$s')->setFieldNameFormat('address[%1$s]');?> + <?php $this->restoreSessionData($addressAttributes->getForm(), 'address');?> + <?php echo $addressAttributes->setShowContainer(false)->toHtml()?> + <?php endif;?> + <input type="hidden" name="default_billing" value="1"> + <input type="hidden" name="default_shipping" value="1"> + </fieldset> + <?php endif; ?> - <div class="fieldset"> - <h2 class="legend"><?php echo __('Login Information') ?></h2> - <ul class="form-list"> - <li class="fields"> - <div class="field"> - <label for="password" class="required"><em>*</em><?php echo __('Password') ?></label> - <div class="input-box"> - <input type="password" name="password" id="password" title="<?php echo __('Password') ?>" class="input-text" data-validate="{required:true, 'validate-password':true}" /> - </div> - </div> - <div class="field"> - <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm Password') ?></label> - <div class="input-box"> - <input type="password" name="confirmation" title="<?php echo __('Confirm Password') ?>" id="confirmation" class="input-text" data-validate="{required:true, equalTo:'#password'}" /> - </div> - </div> - </li> - <?php echo $this->getChildHtml('form.additional.info'); ?> - </ul> + <fieldset class="fieldset create account" data-hasrequired="<?php echo __('* Required Fields') ?>"> + <legend class="legend"><span><?php echo __('Login Information') ?></span></legend><br> + + <div class="field password required"> + <label for="password" class="label"><span><?php echo __('Password') ?></span></label> + <div class="control"> + <input type="password" name="password" id="password" title="<?php echo __('Password') ?>" class="input-text" data-validate="{required:true, 'validate-password':true}"> + </div> + </div> + <div class="field confirmation required"> + <label for="confirmation" class="label"><span><?php echo __('Confirm Password') ?></span></label> + <div class="control"> + <input type="password" name="confirmation" title="<?php echo __('Confirm Password') ?>" id="confirmation" class="input-text" data-validate="{required:true, equalTo:'#password'}"> + </div> + </div> + <?php echo $this->getChildHtml('form_additional_info'); ?> + </fieldset> + <div class="actions"> + <div class="primary"> + <button type="submit" class="action submit" title="<?php echo __('Submit') ?>"><span><?php echo __('Submit') ?></span></button> </div> - <div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>« </small><?php echo __('Back') ?></a></p> - <button type="submit" title="<?php echo __('Submit') ?>" class="button"><span><span><?php echo __('Submit') ?></span></span></button> + <div class="secondary"> + <a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a> </div> - </form> - <script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", + </div> +</form> +<script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + <?php if ($this->getShowAddressFields()): ?> + "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", + <?php endif ?> + <?php if ($_dob->isEnabled()): ?> + "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", + <?php endif ?> + function() { + var dataForm = $('#form-validate'), ignore; <?php if ($_dob->isEnabled()): ?> - "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", + ignore = 'input[id$="full"]'; <?php endif ?> - function() { - var dataForm = $('#form-validate').validation({ - <?php if ($_dob->isEnabled()): ?> - errorPlacement: function(error, element) { - if (element.prop('id') === 'dob') { - var dobElement = $('.customer-dob'), - errorClass = error.prop('class'); - error.insertAfter(element.parent()); - dobElement.find('.validate-custom').addClass(errorClass) - .after('<div class="' + errorClass + '"></div>'); - } - else { - error.insertAfter(element); - } - }, - ignore: ':hidden:not(#dob)' - <?php endif ?> - }); - <?php if($this->getShowAddressFields()): ?> - $('#country').regionUpdater({ - optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all')? 'true' : 'false'); ?>, - regionListId: '#region_id', - regionInputId: '#region', - postcodeId: '#zip', - form: dataForm, - regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, - defaultRegion: "<?php echo $this->getAddress()->getRegionId() ?>", - countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> - }); - <?php endif; ?> + dataForm.validation({ + <?php if ($_dob->isEnabled()): ?> + errorPlacement: function(error, element) { + if (element.prop('id').search('full') !== -1) { + var dobElement = $(element).parents('.customer.dob'), + errorClass = error.prop('class'); + error.insertAfter(element.parent()); + dobElement.find('.validate-custom').addClass(errorClass) + .after('<div class="' + errorClass + '"></div>'); + } + else { + error.insertAfter(element); + } + }, + ignore: ':hidden:not(' + ignore + ')' + <?php else: ?> + ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden' + <?php endif ?> + }).find('input:text').attr('autocomplete', 'off'); + <?php if ($this->getShowAddressFields()): ?> + $('#country').regionUpdater({ + optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all')? 'true' : 'false'); ?>, + regionListId: '#region_id', + regionInputId: '#region', + postcodeId: '#zip', + form: dataForm, + regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, + defaultRegion: "<?php echo $this->getFormData()->getRegionId() ?>", + countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> }); - })(jQuery); - </script> -</div> + <?php endif; ?> + }); + })(jQuery); +</script> diff --git a/app/code/Magento/Customer/view/frontend/form/resetforgottenpassword.phtml b/app/code/Magento/Customer/view/frontend/form/resetforgottenpassword.phtml index 33643a7501c..3188cc44612 100644 --- a/app/code/Magento/Customer/view/frontend/form/resetforgottenpassword.phtml +++ b/app/code/Magento/Customer/view/frontend/form/resetforgottenpassword.phtml @@ -19,37 +19,29 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="page-title"> - <h1><?php echo __('Create a new password'); ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml(); ?> -<form action="<?php echo $this->getUrl('*/*/resetpasswordpost', array('_query' => array('id' => $this->getCustomerId(), 'token' => $this->getResetPasswordLinkToken()))); ?>" method="post" id="form-validate"> - <div class="fieldset" style="margin-top: 70px;"> - <ul class="form-list"> - <li class="fields"> - <div class="field"> - <label for="password" class="required"><em>*</em><?php echo __('New Password'); ?></label> - <div class="input-box"> - <input type="password" class="input-text" name="password" id="password" data-validate="{required:true, 'validate-password':true}"/> - </div> - </div> - <div class="field"> - <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm New Password'); ?></label> - <div class="input-box"> - <input type="password" class="input-text" name="confirmation" id="confirmation" data-validate="{required:true,equalTo:'#password'}"/> - </div> - </div> - </li> - </ul> - </div> - <div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields'); ?></p> - <button type="submit" title="<?php echo __('Submit'); ?>" class="button"><span><span><?php echo __('Submit'); ?></span></span></button> +<form action="<?php echo $this->getUrl('*/*/resetpasswordpost', array('_query' => array('id' => $this->getCustomerId(), 'token' => $this->getResetPasswordLinkToken()))); ?>" method="post" id="form-validate" class="form password reset"> + <fieldset class="fieldset" data-hasrequired="<?php echo __('* Required Fields'); ?>"> + <div class="field password required"> + <label class="label" for="password"><span><?php echo __('New Password'); ?></span></label> + <div class="control"> + <input type="password" class="input-text" name="password" id="password" data-validate="{required:true, 'validate-password':true}"> + </div> + </div> + <div class="field confirmation required"> + <label class="label" for="confirmation"><span><?php echo __('Confirm New Password'); ?></span></label> + <div class="control"> + <input type="password" class="input-text" name="confirmation" id="confirmation" data-validate="{required:true,equalTo:'#password'}"> + </div> + </div> + </fieldset> + <div class="actions"> + <div class="primary"> + <button type="submit" title="<?php echo __('Reset a Password'); ?>" class="action submit"><span><?php echo __('Reset a Password'); ?></span></button> + </div> </div> </form> <script type="text/javascript"> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml index 6ceee87de25..ca526741059 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml @@ -23,14 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account (All Pages)" type="page"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">2columns-left.phtml</argument> - </action> - </referenceBlock> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account (All Pages)" design_abstraction="custom"> <referenceContainer name="content"> - <container name="my.account.wrapper" label="My Account Wrapper" htmlTag="div" htmlClass="my-account"/> + <container name="my.account.wrapper" label="My Account Wrapper" htmlTag="div" htmlClass="my-account" after="-"/> </referenceContainer> <referenceContainer name="left"> <block class="Magento\Page\Block\Links" name="customer_account_navigation" before="-" template="Magento_Customer::account/navigation.phtml"> @@ -55,6 +50,4 @@ </block> <block class="Magento\Catalog\Block\Product\Compare\Sidebar" name="catalog.compare.sidebar" template="product/compare/sidebar.phtml"/> </referenceContainer> - <move element="cart_sidebar" destination="left" before="catalog.compare.sidebar"/> - <remove name="tags_popular"/> </layout> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml index 7713da2330f..60fa97c0f6b 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml @@ -23,14 +23,16 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Confirmation" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="head"> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Send confirmation link</argument> + </action> + </referenceBlock> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> </action> - <action method="setHeaderTitle"> - <argument translate="true" name="title" xsi:type="string">Send confirmation link</argument> - </action> </referenceBlock> <referenceContainer name="content"> <block class="Magento\Core\Block\Template" name="accountConfirmation" template="Magento_Customer::form/confirmation.phtml"/> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml index 215203399e6..cd4704141b4 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Registration Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> @@ -31,6 +31,7 @@ </referenceBlock> <referenceContainer name="content"> <block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="form/register.phtml"> + <container name="form.additional.info" label="invisible" as="form_additional_info"/> <container name="customer.form.register.fields.before" as="form_fields_before" label="Form Fields Before" htmlTag="div" htmlClass="customer-form-before"/> </block> </referenceContainer> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml index 804c22a1843..370d80d7754 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Reset a Password" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Reset a Password</argument> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml index 23ed447c98d..8b16db6de66 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml @@ -23,14 +23,14 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceBlock name="root"> - <action method="setHeaderTitle"> - <argument translate="true" name="title" xsi:type="string">Edit Account Info</argument> + <referenceBlock name="page.main.title"> + <action method="setPageTitle"> + <argument translate="true" name="title" xsi:type="string">Edit Account Information</argument> </action> </referenceBlock> - <referenceContainer name="my.account.wrapper"> + <referenceContainer name="content"> <block class="Magento\Customer\Block\Form\Edit" name="customer_edit" template="form/edit.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml index a8debcfed93..0d523b544db 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Forgot Password Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Forgot Your Password</argument> @@ -38,6 +38,8 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\Customer\Block\Account\Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml"/> + <block class="Magento\Customer\Block\Account\Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml"> + <container name="form.additional.info" label="invisible" as="form_additional_info"/> + </block> </referenceContainer> </layout> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml index 503459ec40e..4fbb35b4323 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml @@ -23,20 +23,17 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Dashboard" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">2columns-left.phtml</argument> + <referenceBlock name="page.main.title"> + <action method="setPageTitle"> + <argument translate="true" name="title" xsi:type="string">My Dashboard</argument> </action> </referenceBlock> - <referenceContainer name="my.account.wrapper"> - <block class="Magento\Customer\Block\Account\Dashboard" name="customer_account_dashboard" template="account/dashboard.phtml"> - <block class="Magento\Customer\Block\Account\Dashboard\Hello" name="customer_account_dashboard_hello" as="hello" template="account/dashboard/hello.phtml"/> - <block class="Magento\Core\Block\Template" name="customer_account_dashboard_top" as="top"/> - <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml"/> - <block class="Magento\Customer\Block\Account\Dashboard\Newsletter" name="customer_account_dashboard_newsletter" as="newsletter" template="account/dashboard/newsletter.phtml"/> - <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml"/> - </block> + <referenceContainer name="content"> + <block class="Magento\Customer\Block\Account\Dashboard\Hello" name="customer_account_dashboard_hello" as="hello" template="account/dashboard/hello.phtml"/> + <block class="Magento\Core\Block\Template" name="customer_account_dashboard_top" as="top"/> + <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml"/> + <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml index 42532503f04..6cafab88bd4 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml @@ -23,13 +23,19 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Login Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="form/login.phtml"/> + <!-- customer.form.login.extra --> + <container name="customer.login.container" label="Customer Login Container" htmlTag="div" htmlClass="login container"> + <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="form/login.phtml"> + <container name="form.additional.info" label="invisible" as="form_additional_info"/> + </block> + <block class="Magento\Customer\Block\Form\Login" name="customer.new" template="newcustomer.phtml"/> + </container> </referenceContainer> </layout> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml index 90ea6202ed8..1834231f22a 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml @@ -23,12 +23,17 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Logout Success" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> </action> </referenceBlock> + <referenceBlock name="page.main.title"> + <action method="setPageTitle"> + <argument name="title" translate="true" xsi:type="string">You are now logged out</argument> + </action> + </referenceBlock> <referenceContainer name="content"> <block class="Magento\Core\Block\Template" name="customer_logout" template="Magento_Customer::logout.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml index 13d538470a2..c4faa5b6d62 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Address Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceContainer name="my.account.wrapper"> + <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Edit" name="customer_address_edit" template="address/edit.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml b/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml index 560c899a7cd..95942cd1a7c 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml @@ -23,9 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Address Book" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceContainer name="my.account.wrapper"> + <referenceBlock name="page.main.title"> + <block class="Magento\Customer\Block\Address\Book" name="address.book.button" template="address/button.phtml"/> + </referenceBlock> + <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Book" name="address_book" template="address/book.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Customer/view/frontend/logout.phtml b/app/code/Magento/Customer/view/frontend/logout.phtml index d7959ecc7d4..24bd4bf8911 100644 --- a/app/code/Magento/Customer/view/frontend/logout.phtml +++ b/app/code/Magento/Customer/view/frontend/logout.phtml @@ -19,17 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="page-title"> - <h1><?php echo __('You are now logged out') ?></h1> -</div> <p><?php echo __('You have logged out and will be redirected to our homepage in 5 seconds.') ?></p> <script type="text/javascript"> (function($){ - $($.mage.redirect("<?php echo $this->getUrl() ?>","assign",5000)); + $($.mage.redirect("<?php echo $this->getUrl() ?>", "assign", 5000)); })(jQuery); </script> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/newcustomer.phtml b/app/code/Magento/Customer/view/frontend/newcustomer.phtml similarity index 98% rename from app/design/frontend/magento_plushe/Magento_Customer/newcustomer.phtml rename to app/code/Magento/Customer/view/frontend/newcustomer.phtml index 52620acc2d5..35b49e96c94 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/newcustomer.phtml +++ b/app/code/Magento/Customer/view/frontend/newcustomer.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,29 +16,28 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * New Customer block template - * - * @see \Magento\Customer\Block\Form\Login - */ -?> -<?php if ($this->helper('Magento\Customer\Helper\Data')->isRegistrationAllowed()): ?> -<div class="block new customer"> - <div class="title"><strong><?php echo __('New Customers') ?></strong></div> - <div class="content"> - <p><?php echo __('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?></p> - <div class="actions"> - <a href="<?php echo $this->getCreateAccountUrl() ?>" class="action create"><span><?php echo __('Register') ?></span></a> - </div> - </div> -</div> -<?php endif; ?> - + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * New Customer block template + * + * @see \Magento\Customer\Block\Form\Login + */ +?> +<?php if ($this->helper('Magento\Customer\Helper\Data')->isRegistrationAllowed()): ?> +<div class="block new customer"> + <div class="title"><strong><?php echo __('New Customers') ?></strong></div> + <div class="content"> + <p><?php echo __('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?></p> + <div class="actions"> + <a href="<?php echo $this->getCreateAccountUrl() ?>" class="action create"><span><?php echo __('Register') ?></span></a> + </div> + </div> +</div> +<?php endif; ?> diff --git a/app/code/Magento/Customer/view/frontend/widget/dob.phtml b/app/code/Magento/Customer/view/frontend/widget/dob.phtml index 6da24c4ee36..0668242b957 100644 --- a/app/code/Magento/Customer/view/frontend/widget/dob.phtml +++ b/app/code/Magento/Customer/view/frontend/widget/dob.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -49,34 +48,35 @@ NOTE: Regarding styles - if we leave it this way, we'll move it to boxes.css * @see \Magento\Customer\Block\Widget\Dob */ ?> -<label for="<?php echo $this->getFieldId('month')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo __('Date of Birth') ?></label> -<div class="input-box customer-dob"> -<?php - $this->setDateInput('d', - '<div class="dob-day"> - <input type="text" id="' . $this->getFieldId('day') . '" name="' . $this->getFieldName('day') . '" value="' . $this->getDay() . '" title="' . __('Day') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /> - <label for="' . $this->getFieldId('day') . '">' . __('Day (DD)') . '</label> - </div>' - ); +<div class="field dob<?php if ($this->isRequired()) echo ' required' ?>"> + <label class="label" for="<?php echo $this->getFieldId('month')?>"><span><?php echo __('Date of Birth') ?></span></label> + <div class="control customer-dob"> + <div class="fields group group-3"> + <?php + $this->setDateInput('d', + '<div class="field dob-day day"> + <label class="label" for="' . $this->getFieldId('day') . '"><span>' . __('DD') . '</span></label> + <div class="control"><input type="text" id="' . $this->getFieldId('day') . '" name="' . $this->getFieldName('day') . '" value="' . $this->getDay() . '" title="' . __('Day') . '" class="input-text validate-custom" ' . $this->getFieldParams() . '></div> + </div>' + ); - $this->setDateInput('m', - '<div class="dob-month"> - <input type="text" id="' . $this->getFieldId('month') . '" name="' . $this->getFieldName('month') . '" value="' . $this->getMonth() . '" title="' . __('Month') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /> - <label for="' . $this->getFieldId('month') . '">' . __('Month (MM)') . '</label> - </div>' - ); + $this->setDateInput('m', + '<div class="field dob-month month"> + <label class="label" for="' . $this->getFieldId('month') . '"><span>' . __('MM') . '</span></label> + <div class="control"><input type="text" id="' . $this->getFieldId('month') . '" name="' . $this->getFieldName('month') . '" value="' . $this->getMonth() . '" title="' . __('Month') . '" class="input-text validate-custom" ' . $this->getFieldParams() . '></div> + </div>' + ); - $this->setDateInput('y', - '<div class="dob-year"> - <input type="text" id="' . $this->getFieldId('year') . '" name="' . $this->getFieldName('year') . '" value="' . $this->getYear() . '" title="' . __('Year') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /> - <label for="' . $this->getFieldId('year') . '">' . __('Year (YYYY)') . '</label> - </div>' - ); -?> - <?php echo $this->getSortedDateInputs() ?> - <div class="dob-full" style="display:none;"> - <input type="hidden" id="<?php echo $this->getFieldId('dob')?>" name="<?php echo $this->getFieldName('dob')?>" data-validate="{'validate-dob': ['.dob-day', '.dob-month', '.dob-year', <?php echo $this->isRequired() ? 'true' : 'false' ?>]}"/> + $this->setDateInput('y', + '<div class="field dob-year year"> + <label class="label" for="' . $this->getFieldId('year') . '"><span>' . __('YYYY') . '</span></label> + <div class="control"><input type="text" id="' . $this->getFieldId('year') . '" name="' . $this->getFieldName('year') . '" value="' . $this->getYear() . '" title="' . __('Year') . '" class="input-text validate-custom" ' . $this->getFieldParams() . '></div> + </div>' + ); + ?> + <?php echo $this->getSortedDateInputs() ?> + </div> + <input type="hidden" id="<?php echo $this->getFieldId('full')?>" name="<?php echo $this->getFieldName('dob')?>" data-validate="{'validate-dob': ['.dob-day', '.dob-month', '.dob-year', <?php echo $this->isRequired() ? 'true' : 'false' ?>]<?php if ($this->getMinDateRange() && $this->getMaxDateRange()):?>, 'validate-date-between':['<?php echo $this->getMinDateRange()?>', '<?php echo $this->getMaxDateRange()?>']<?php endif;?>}"> + <div class="validation-advice" id="<?php echo $this->getFieldId('date-advice')?>" style="opacity:0.999999; display:none;"></div> </div> - - <div class="validation-advice" style="display:none;"></div> </div> diff --git a/app/code/Magento/Customer/view/frontend/widget/gender.phtml b/app/code/Magento/Customer/view/frontend/widget/gender.phtml index fe8a9909b69..13010e23213 100644 --- a/app/code/Magento/Customer/view/frontend/widget/gender.phtml +++ b/app/code/Magento/Customer/view/frontend/widget/gender.phtml @@ -19,18 +19,19 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<label for="<?php echo $this->getFieldId('gender')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo __('Gender') ?></label> -<div class="input-box"> - <select id="<?php echo $this->getFieldId('gender')?>" name="<?php echo $this->getFieldName('gender')?>" title="<?php echo __('Gender') ?>"<?php if ($this->isRequired()):?> class="validate-select" data-validate="{required:true}"<?php endif; ?> <?php echo $this->getFieldParams() ?>> - <?php $options = $this->getGenderOptions(); ?> - <?php $value = $this->getGender();?> - <?php foreach ($options as $option):?> - <option value="<?php echo $option['value'] ?>"<?php if ($option['value'] == $value) echo ' selected="selected"' ?>><?php echo $option['label'] ?></option> - <?php endforeach;?> - </select> +<div class="field gender<?php if ($this->isRequired()) echo ' required' ?>"> + <label class="label" for="<?php echo $this->getFieldId('gender')?>"><span><?php echo __('Gender') ?></span></label> + <div class="control"> + <select id="<?php echo $this->getFieldId('gender')?>" name="<?php echo $this->getFieldName('gender')?>" title="<?php echo __('Gender') ?>"<?php if ($this->isRequired()):?> class="validate-select" data-validate="{required:true}"<?php endif; ?> <?php echo $this->getFieldParams() ?>> + <?php $options = $this->getGenderOptions(); ?> + <?php $value = $this->getGender();?> + <?php foreach ($options as $option):?> + <option value="<?php echo $option['value'] ?>"<?php if ($option['value'] == $value) echo ' selected="selected"' ?>><?php echo $option['label'] ?></option> + <?php endforeach;?> + </select> + </div> </div> diff --git a/app/code/Magento/Customer/view/frontend/widget/name.phtml b/app/code/Magento/Customer/view/frontend/widget/name.phtml index 7b907ef099d..50336258ed3 100644 --- a/app/code/Magento/Customer/view/frontend/widget/name.phtml +++ b/app/code/Magento/Customer/view/frontend/widget/name.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -43,59 +42,118 @@ For checkout/onepage/shipping.phtml: ->toHtml() ?> */ /* @var $this \Magento\Customer\Block\Widget\Name */ +$prefix = $this->showPrefix(); +$middle = $this->showMiddlename(); +$suffix = $this->showSuffix(); ?> -<div class="<?php echo $this->getContainerClassName()?>"> -<?php if ($this->showPrefix()): ?> - <div class="field name-prefix"> - <label for="<?php echo $this->getFieldId('prefix')?>"<?php if ($this->isPrefixRequired()) echo ' class="required"' ?>><?php if ($this->isPrefixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('prefix') ?></label> - <div class="input-box"> - <?php if ($this->getPrefixOptions() === false): ?> - <input type="text" id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?> /> - <?php else: ?> - <select id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?> > - <?php foreach ($this->getPrefixOptions() as $_option): ?> - <option value="<?php echo $_option?>"<?php if ($this->getObject()->getPrefix()==$_option):?> selected="selected"<?php endif; ?>><?php echo __($_option)?></option> - <?php endforeach; ?> - </select> - <?php endif; ?> +<?php if ($prefix || $middle || $suffix && !$this->getNoWrap()): ?> +<div class="field required fullname <?php echo $this->getContainerClassName() ?>"> + <label for="<?php echo $this->getFieldId('firstname') ?>" class="label"> + <span><?php echo __('Name') ?></span> + </label> + <div class="control"> + <div class="fields group <?php echo 2 + intval($prefix) + intval($middle) + intval($suffix) ?>"> + <?php endif; ?> + <?php if ($prefix): ?>$ + <div class="field name prefix<?php if ($this->isPrefixRequired()) echo ' required' ?>"> + <label class="label" for="<?php echo $this->getFieldId('prefix') ?>"> + <span><?php echo $this->getStoreLabel('prefix') ?></span> + </label> + + <div class="control"> + <?php if ($this->getPrefixOptions() === false): ?> + <input type="text" id="<?php echo $this->getFieldId('prefix') ?>" + name="<?php echo $this->getFieldName('prefix') ?>" + value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>" + title="<?php echo $this->getStoreLabel('prefix') ?>" + class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?>> + <?php else: ?> + <select id="<?php echo $this->getFieldId('prefix') ?>" + name="<?php echo $this->getFieldName('prefix') ?>" + title="<?php echo $this->getStoreLabel('prefix') ?>" + class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?> > + <?php foreach ($this->getPrefixOptions() as $_option): ?> + <option value="<?php echo $_option ?>"<?php if ($this->getObject()->getPrefix() == $_option): ?> selected="selected"<?php endif; ?>> + <?php echo __($_option) ?> + </option> + <?php endforeach; ?> + </select> + <?php endif; ?> + </div> </div> - </div> -<?php endif; ?> - <div class="field name-firstname"> - <label for="<?php echo $this->getFieldId('firstname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('firstname') ?></label> - <div class="input-box"> - <input type="text" id="<?php echo $this->getFieldId('firstname')?>" name="<?php echo $this->getFieldName('firstname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>" title="<?php echo $this->getStoreLabel('firstname') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') == 'required-entry') echo ' data-validate="{required:true}"' ?> /> + <?php endif; ?> + <div class="field name firstname required"> + <label class="label" for="<?php echo $this->getFieldId('firstname') ?>"> + <span><?php echo $this->getStoreLabel('firstname') ?></span> + </label> + + <div class="control"> + <input type="text" id="<?php echo $this->getFieldId('firstname') ?>" + name="<?php echo $this->getFieldName('firstname') ?>" + value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>" + title="<?php echo $this->getStoreLabel('firstname') ?>" + class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') == 'required-entry') echo ' data-validate="{required:true}"' ?>> + </div> </div> - </div> -<?php if ($this->showMiddlename()): ?> -<?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?> - <div class="field name-middlename"> - <label for="<?php echo $this->getFieldId('middlename')?>"<?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?><?php echo $this->getStoreLabel('middlename') ?></label> - <div class="input-box"> - <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> <?php echo $isMiddlenameRequired ? ' data-validate="{required:true}"' : '' ?> /> + <?php if ($middle): ?> + <?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?> + <div class="field name middlename<?php echo $isMiddlenameRequired ? ' required' : '' ?>"> + <label class="label" for="<?php echo $this->getFieldId('middlename') ?>"> + <span><?php echo $this->getStoreLabel('middlename') ?></span> + </label> + + <div class="control"> + <input type="text" id="<?php echo $this->getFieldId('middlename') ?>" + name="<?php echo $this->getFieldName('middlename') ?>" + value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" + title="<?php echo $this->getStoreLabel('middlename') ?>" + class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> <?php echo $isMiddlenameRequired ? ' data-validate="{required:true}"' : '' ?>> + </div> </div> - </div> -<?php endif; ?> - <div class="field name-lastname"> - <label for="<?php echo $this->getFieldId('lastname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('lastname') ?></label> - <div class="input-box"> - <input type="text" id="<?php echo $this->getFieldId('lastname')?>" name="<?php echo $this->getFieldName('lastname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>" title="<?php echo $this->getStoreLabel('lastname') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') == 'required-entry') echo ' data-validate="{required:true}"' ?> /> + <?php endif; ?> + <div class="field name lastname required"> + <label class="label" for="<?php echo $this->getFieldId('lastname') ?>"> + <span><?php echo $this->getStoreLabel('lastname') ?></span> + </label> + + <div class="control"> + <input type="text" id="<?php echo $this->getFieldId('lastname') ?>" + name="<?php echo $this->getFieldName('lastname') ?>" + value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>" + title="<?php echo $this->getStoreLabel('lastname') ?>" + class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') == 'required-entry') echo ' data-validate="{required:true}"' ?>> + </div> </div> - </div> -<?php if ($this->showSuffix()): ?> - <div class="field name-suffix"> - <label for="<?php echo $this->getFieldId('suffix')?>"<?php if ($this->isSuffixRequired()) echo ' class="required"' ?>><?php if ($this->isSuffixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('suffix') ?></label> - <div class="input-box"> - <?php if ($this->getSuffixOptions() === false): ?> - <input type="text" id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getSuffix()) ?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?> /> - <?php else: ?> - <select id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?>> - <?php foreach ($this->getSuffixOptions() as $_option): ?> - <option value="<?php echo $_option?>"<?php if ($this->getObject()->getSuffix()==$_option):?> selected="selected"<?php endif; ?>><?php echo __($_option)?></option> - <?php endforeach; ?> - </select> - <?php endif; ?> + <?php if ($suffix): ?> + <div class="field name suffix<?php if ($this->isSuffixRequired()) echo ' required' ?>"> + <label class="label" for="<?php echo $this->getFieldId('suffix') ?>"> + <span><?php echo $this->getStoreLabel('suffix') ?></span> + </label> + + <div class="control"> + <?php if ($this->getSuffixOptions() === false): ?> + <input type="text" id="<?php echo $this->getFieldId('suffix') ?>" + name="<?php echo $this->getFieldName('suffix') ?>" + value="<?php echo $this->escapeHtml($this->getObject()->getSuffix()) ?>" + title="<?php echo $this->getStoreLabel('suffix') ?>" + class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?>> + <?php else: ?> + <select id="<?php echo $this->getFieldId('suffix') ?>" + name="<?php echo $this->getFieldName('suffix') ?>" + title="<?php echo $this->getStoreLabel('suffix') ?>" + class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?>> + <?php foreach ($this->getSuffixOptions() as $_option): ?> + <option value="<?php echo $_option ?>"<?php if ($this->getObject()->getSuffix() == $_option): ?> selected="selected"<?php endif; ?>> + <?php echo __($_option) ?> + </option> + <?php endforeach; ?> + </select> + <?php endif; ?> + </div> + </div> + <?php endif; ?> + <?php if ($prefix || $middle || $suffix && !$this->getNoWrap()): ?> </div> </div> -<?php endif; ?> </div> +<?php endif; ?> diff --git a/app/code/Magento/Customer/view/frontend/widget/taxvat.phtml b/app/code/Magento/Customer/view/frontend/widget/taxvat.phtml index 4ae3ef6e291..2d9417178bb 100644 --- a/app/code/Magento/Customer/view/frontend/widget/taxvat.phtml +++ b/app/code/Magento/Customer/view/frontend/widget/taxvat.phtml @@ -19,12 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<label for="<?php echo $this->getFieldId('taxvat')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo __('Tax/VAT number') ?></label> -<div class="input-box"> - <input type="text" id="<?php echo $this->getFieldId('taxvat')?>" name="<?php echo $this->getFieldName('taxvat')?>" value="<?php echo $this->escapeHtml($this->getTaxvat()) ?>" title="<?php echo __('Tax/VAT number') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('taxvat') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isRequired()) echo ' data-validate="{required:true}"' ?> /> +<div class="field taxvat<?php if ($this->isRequired()) echo ' required'; ?>"> + <label class="label" for="<?php echo $this->getFieldId('taxvat')?>"><span><?php echo __('Tax/VAT number') ?></span></label> + <div class="control"> + <input type="text" id="<?php echo $this->getFieldId('taxvat')?>" name="<?php echo $this->getFieldName('taxvat')?>" value="<?php echo $this->escapeHtml($this->getTaxvat()) ?>" title="<?php echo __('Tax/VAT number') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('taxvat') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isRequired()) echo ' data-validate="{required:true}"' ?>> + </div> </div> diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Save.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Save.php index f721b508849..5a2f534c3eb 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Save.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Save.php @@ -52,10 +52,10 @@ class Save extends \Magento\Backend\Block\Widget\Button\SplitButton { $theme = $this->getTheme(); $themeType = $theme->getType(); - if ($themeType == \Magento\Core\Model\Theme::TYPE_PHYSICAL) { + if ($themeType == \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL) { $this->_initPhysical(); - } else if ($themeType == \Magento\Core\Model\Theme::TYPE_VIRTUAL) { - if ($theme->getDomainModel(\Magento\Core\Model\Theme::TYPE_VIRTUAL)->isAssigned()) { + } else if ($themeType == \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) { + if ($theme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL)->isAssigned()) { $this->_initAssigned(); } else { $this->_initUnAssigned(); diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php index 4e0c8fe9823..90866a7e879 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php @@ -146,7 +146,7 @@ class Custom extends \Magento\Backend\Block\Widget\Form\Generic * Get theme file (with custom CSS) * * @param \Magento\View\Design\ThemeInterface $theme - * @return \Magento\Core\Model\Theme\FileInterface|null + * @return \Magento\View\Design\Theme\FileInterface|null */ protected function _getCustomCss($theme) { diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php index df05cf2a656..d0be1f28234 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php @@ -155,7 +155,7 @@ class Js extends \Magento\Backend\Block\Widget\Form\Generic public function getFiles() { $customization = $this->_themeContext->getStagingTheme()->getCustomization(); - $jsFiles = $customization->getFilesByType(\Magento\Core\Model\Theme\Customization\File\Js::TYPE); + $jsFiles = $customization->getFilesByType(\Magento\View\Design\Theme\Customization\File\Js::TYPE); return $this->helper('Magento\Core\Helper\Data')->jsonEncode($customization->generateFileInfo($jsFiles)); } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php index f4de4068626..f4420557e5a 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php @@ -114,7 +114,7 @@ class Editor extends \Magento\Backend\Controller\Adminhtml\Action $themeContext->setEditableThemeById($themeId); $launchedTheme = $themeContext->getEditableTheme(); if ($launchedTheme->isPhysical()) { - $launchedTheme = $launchedTheme->getDomainModel(\Magento\Core\Model\Theme::TYPE_PHYSICAL) + $launchedTheme = $launchedTheme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL) ->createVirtualTheme($launchedTheme); $this->_redirect($this->getUrl('adminhtml/*/*', array('theme_id' => $launchedTheme->getId()))); return; @@ -169,7 +169,8 @@ class Editor extends \Magento\Backend\Controller\Adminhtml\Action $themeCustomization = $theme->isVirtual() ? $theme - : $theme->getDomainModel(\Magento\Core\Model\Theme::TYPE_PHYSICAL)->createVirtualTheme($theme); + : $theme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL) + ->createVirtualTheme($theme); /** @var $themeCustomization \Magento\View\Design\ThemeInterface */ $this->_themeConfig->assignToStore($themeCustomization, $this->_getStores()); @@ -316,7 +317,8 @@ class Editor extends \Magento\Backend\Controller\Adminhtml\Action try { /** @var $copyService \Magento\Core\Model\Theme\CopyService */ $copyService = $this->_objectManager->get('Magento\Core\Model\Theme\CopyService'); - $stagingTheme = $virtualTheme->getDomainModel(\Magento\Core\Model\Theme::TYPE_VIRTUAL)->getStagingTheme(); + $stagingTheme = $virtualTheme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) + ->getStagingTheme(); switch ($revertTo) { case 'last_saved': $copyService->copy($virtualTheme, $stagingTheme); @@ -326,7 +328,7 @@ class Editor extends \Magento\Backend\Controller\Adminhtml\Action break; case 'physical': - $physicalTheme = $virtualTheme->getDomainModel(\Magento\Core\Model\Theme::TYPE_VIRTUAL) + $physicalTheme = $virtualTheme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) ->getPhysicalTheme(); $copyService->copy($physicalTheme, $stagingTheme); $message = __('Theme "%1" reverted to last default state', @@ -364,8 +366,8 @@ class Editor extends \Magento\Backend\Controller\Adminhtml\Action */ protected function _loadThemeById($themeId) { - /** @var $themeFactory \Magento\Core\Model\Theme\FlyweightFactory */ - $themeFactory = $this->_objectManager->create('Magento\Core\Model\Theme\FlyweightFactory'); + /** @var $themeFactory \Magento\View\Design\Theme\FlyweightFactory */ + $themeFactory = $this->_objectManager->create('Magento\View\Design\Theme\FlyweightFactory'); $theme = $themeFactory->create($themeId); if (empty($theme)) { throw new \Magento\Core\Exception(__('We can\'t find this theme.')); @@ -468,7 +470,7 @@ class Editor extends \Magento\Backend\Controller\Adminhtml\Action { $isCustomized = (bool)$this->_objectManager->get('Magento\Core\Model\Resource\Theme\CollectionFactory') ->create() - ->addTypeFilter(\Magento\Core\Model\Theme::TYPE_VIRTUAL) + ->addTypeFilter(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) ->getSize(); return !$isCustomized; } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php index 19fdb2007d3..79dc781bb0a 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php @@ -119,7 +119,7 @@ class Tools extends \Magento\Backend\Controller\Adminhtml\Action $themeContext = $this->_initContext(); $editableTheme = $themeContext->getStagingTheme(); $customization = $editableTheme->getCustomization(); - $customJsFiles = $customization->getFilesByType(\Magento\Core\Model\Theme\Customization\File\Js::TYPE); + $customJsFiles = $customization->getFilesByType(\Magento\View\Design\Theme\Customization\File\Js::TYPE); $result = array('error' => false, 'files' => $customization->generateFileInfo($customJsFiles)); $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result)); } catch (\Exception $e) { @@ -134,8 +134,8 @@ class Tools extends \Magento\Backend\Controller\Adminhtml\Action { /** @var $serviceModel \Magento\Theme\Model\Uploader\Service */ $serviceModel = $this->_objectManager->get('Magento\Theme\Model\Uploader\Service'); - /** @var $jsService \Magento\Core\Model\Theme\Customization\File\Js */ - $jsService = $this->_objectManager->create('Magento\Core\Model\Theme\Customization\File\Js'); + /** @var $jsService \Magento\View\Design\Theme\Customization\File\Js */ + $jsService = $this->_objectManager->create('Magento\View\Design\Theme\Customization\File\Js'); try { $themeContext = $this->_initContext(); $editableTheme = $themeContext->getStagingTheme(); @@ -184,7 +184,7 @@ class Tools extends \Magento\Backend\Controller\Adminhtml\Action $themeContext = $this->_initContext(); $editableTheme = $themeContext->getStagingTheme(); $editableTheme->getCustomization()->reorder( - \Magento\Core\Model\Theme\Customization\File\Js::TYPE, $reorderJsFiles + \Magento\View\Design\Theme\Customization\File\Js::TYPE, $reorderJsFiles ); $result = array('success' => true); } catch (\Magento\Core\Exception $e) { diff --git a/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php b/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php index 28ce76acf9d..1da6b44c4a1 100644 --- a/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php +++ b/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php @@ -54,17 +54,17 @@ class Factory protected $_objectManager; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\FileSystem $viewFileSystem */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\Core\Model\View\FileSystem $viewFileSystem + \Magento\View\FileSystem $viewFileSystem ) { $this->_objectManager = $objectManager; $this->_viewFileSystem = $viewFileSystem; diff --git a/app/code/Magento/DesignEditor/Model/Observer.php b/app/code/Magento/DesignEditor/Model/Observer.php index 7ef1c94d7a8..efb288cb10e 100644 --- a/app/code/Magento/DesignEditor/Model/Observer.php +++ b/app/code/Magento/DesignEditor/Model/Observer.php @@ -85,7 +85,7 @@ class Observer $nonVdeAssets = array_diff_key($pageAssets->getAll(), $vdeAssets); foreach ($nonVdeAssets as $assetId => $asset) { - if ($asset->getContentType() == \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS) { + if ($asset->getContentType() == \Magento\View\Publisher::CONTENT_TYPE_JS) { $pageAssets->remove($assetId); } } diff --git a/app/code/Magento/DesignEditor/Model/State.php b/app/code/Magento/DesignEditor/Model/State.php index adcbb59ffd5..51081a97d52 100644 --- a/app/code/Magento/DesignEditor/Model/State.php +++ b/app/code/Magento/DesignEditor/Model/State.php @@ -71,7 +71,7 @@ class State /** * Application Cache Manager * - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ protected $_cacheState; @@ -94,7 +94,7 @@ class State * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Core\Model\Layout\Factory $layoutFactory * @param \Magento\DesignEditor\Model\Url\Factory $urlModelFactory - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\DesignEditor\Helper\Data $dataHelper * @param \Magento\ObjectManager $objectManager * @param \Magento\Core\Model\App $application @@ -104,7 +104,7 @@ class State \Magento\Backend\Model\Session $backendSession, \Magento\Core\Model\Layout\Factory $layoutFactory, \Magento\DesignEditor\Model\Url\Factory $urlModelFactory, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, \Magento\DesignEditor\Helper\Data $dataHelper, \Magento\ObjectManager $objectManager, \Magento\Core\Model\App $application, diff --git a/app/code/Magento/DesignEditor/Model/Theme/Context.php b/app/code/Magento/DesignEditor/Model/Theme/Context.php index dc0b8bd1fa7..c98c55ecb9e 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Context.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Context.php @@ -89,7 +89,7 @@ class Context if (!$this->_theme->load($themeId)->getId()) { throw new \Magento\Core\Exception(__('We can\'t find theme "%1".', $themeId)); } - if ($this->_theme->getType() === \Magento\Core\Model\Theme::TYPE_STAGING) { + if ($this->_theme->getType() === \Magento\View\Design\ThemeInterface::TYPE_STAGING) { throw new \Magento\Core\Exception(__('Wrong theme type set as editable')); } return $this; @@ -124,7 +124,7 @@ class Context __('Theme "%1" is not editable.', $editableTheme->getThemeTitle()) ); } - $this->_stagingTheme = $editableTheme->getDomainModel(\Magento\Core\Model\Theme::TYPE_VIRTUAL) + $this->_stagingTheme = $editableTheme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) ->getStagingTheme(); } return $this->_stagingTheme; diff --git a/app/code/Magento/DesignEditor/Model/Theme/Customization/File/QuickStyleCss.php b/app/code/Magento/DesignEditor/Model/Theme/Customization/File/QuickStyleCss.php index 0846bd1ceb3..8ef0caaf8c7 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Customization/File/QuickStyleCss.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Customization/File/QuickStyleCss.php @@ -30,7 +30,7 @@ namespace Magento\DesignEditor\Model\Theme\Customization\File; class QuickStyleCss - extends \Magento\Core\Model\Theme\Customization\AbstractFile + extends \Magento\View\Design\Theme\Customization\AbstractFile { /**#@+ * QuickStyles CSS file type customization @@ -68,7 +68,7 @@ class QuickStyleCss /** * {@inheritdoc} */ - protected function _prepareFileName(\Magento\Core\Model\Theme\FileInterface $file) + protected function _prepareFileName(\Magento\View\Design\Theme\FileInterface $file) { $file->setFileName(self::FILE_NAME); } @@ -76,7 +76,7 @@ class QuickStyleCss /** * {@inheritdoc} */ - protected function _prepareSortOrder(\Magento\Core\Model\Theme\FileInterface $file) + protected function _prepareSortOrder(\Magento\View\Design\Theme\FileInterface $file) { $file->setData('sort_order', self::SORT_ORDER); } diff --git a/app/code/Magento/Directory/Block/Data.php b/app/code/Magento/Directory/Block/Data.php index a6ccce8b4ab..01bf250cdf4 100644 --- a/app/code/Magento/Directory/Block/Data.php +++ b/app/code/Magento/Directory/Block/Data.php @@ -32,7 +32,7 @@ namespace Magento\Directory\Block; class Data extends \Magento\Core\Block\Template { /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -52,7 +52,7 @@ class Data extends \Magento\Core\Block\Template protected $_countryCollFactory; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -61,7 +61,7 @@ class Data extends \Magento\Core\Block\Template * @param array $data */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Directory/Helper/Data.php b/app/code/Magento/Directory/Helper/Data.php index 42fa1fd0235..7e19fb1ab1e 100644 --- a/app/code/Magento/Directory/Helper/Data.php +++ b/app/code/Magento/Directory/Helper/Data.php @@ -82,7 +82,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_optZipCountries = null; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -113,7 +113,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Country\Collection $countryCollection * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regCollFactory, * @param \Magento\Core\Helper\Data $coreHelper @@ -123,7 +123,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Country\Collection $countryCollection, \Magento\Directory\Model\Resource\Region\CollectionFactory $regCollFactory, \Magento\Core\Helper\Data $coreHelper, diff --git a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php index 13933ef70c8..ddff3a25299 100644 --- a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php @@ -41,32 +41,41 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct protected $_calculationModel; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Tax\Model\Calculation $calculationModel * @param array $data */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\Registry $coreRegistry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Tax\Model\Calculation $calculationModel, array $data = array() ) { $this->_calculationModel = $calculationModel; - parent::__construct($storeManager, $catalogConfig, $registry, $taxData, $catalogData, $coreData, $context, - $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Downloadable/Block/Catalog/Product/Samples.php b/app/code/Magento/Downloadable/Block/Catalog/Product/Samples.php index 4220a747c9d..f6f6d8fedcc 100644 --- a/app/code/Magento/Downloadable/Block/Catalog/Product/Samples.php +++ b/app/code/Magento/Downloadable/Block/Catalog/Product/Samples.php @@ -35,32 +35,6 @@ namespace Magento\Downloadable\Block\Catalog\Product; class Samples extends \Magento\Catalog\Block\Product\AbstractProduct { - /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param array $data - */ - public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $registry, - \Magento\Tax\Helper\Data $taxData, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, - array $data = array() - ) { - parent::__construct($storeManager, $catalogConfig, $registry, $taxData, $catalogData, $coreData, - $context, $data); - } - /** * Enter description here... * diff --git a/app/code/Magento/Downloadable/Model/Observer.php b/app/code/Magento/Downloadable/Model/Observer.php index 5dec751941e..375d3e23201 100644 --- a/app/code/Magento/Downloadable/Model/Observer.php +++ b/app/code/Magento/Downloadable/Model/Observer.php @@ -74,6 +74,11 @@ class Observer */ protected $_itemsFactory; + /** + * @var \Magento\Object\Copy + */ + protected $_objectCopyService; + /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -82,6 +87,7 @@ class Observer * @param \Magento\Downloadable\Model\Link\Purchased\ItemFactory $itemFactory * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory + * @param \Magento\Object\Copy $objectCopyService */ public function __construct( \Magento\Core\Helper\Data $coreData, @@ -90,7 +96,8 @@ class Observer \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Downloadable\Model\Link\Purchased\ItemFactory $itemFactory, \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory + \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, + \Magento\Object\Copy $objectCopyService ) { $this->_helper = $coreData; $this->_coreStoreConfig = $coreStoreConfig; @@ -99,6 +106,7 @@ class Observer $this->_itemFactory = $itemFactory; $this->_checkoutSession = $checkoutSession; $this->_itemsFactory = $itemsFactory; + $this->_objectCopyService = $objectCopyService; } /** @@ -177,13 +185,13 @@ class Observer $links = $product->getTypeInstance()->getLinks($product); if ($linkIds = $orderItem->getProductOptionByCode('links')) { $linkPurchased = $this->_createPurchasedModel(); - $this->_helper->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'downloadable_sales_copy_order', 'to_downloadable', $orderItem->getOrder(), $linkPurchased ); - $this->_helper->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'downloadable_sales_copy_order_item', 'to_downloadable', $orderItem, @@ -202,7 +210,7 @@ class Observer ->setPurchasedId($linkPurchased->getId()) ->setOrderItemId($orderItem->getId()); - $this->_helper->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'downloadable_sales_copy_link', 'to_purchased', $links[$linkId], diff --git a/app/code/Magento/Downloadable/etc/fieldset.xml b/app/code/Magento/Downloadable/etc/fieldset.xml index 055c17f5ff3..a772c1bc47a 100644 --- a/app/code/Magento/Downloadable/etc/fieldset.xml +++ b/app/code/Magento/Downloadable/etc/fieldset.xml @@ -26,7 +26,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="downloadable_sales_copy_order"> <field name="entity_id"> diff --git a/app/code/Magento/Oauth/etc/adminhtml/routes.xml b/app/code/Magento/Downloadable/etc/frontend/page_types.xml similarity index 83% rename from app/code/Magento/Oauth/etc/adminhtml/routes.xml rename to app/code/Magento/Downloadable/etc/frontend/page_types.xml index 4d501423052..0fa6e68fe81 100644 --- a/app/code/Magento/Oauth/etc/adminhtml/routes.xml +++ b/app/code/Magento/Downloadable/etc/frontend/page_types.xml @@ -23,10 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config> - <router id="admin"> - <route id="adminhtml"> - <module name="Magento_Oauth_Adminhtml" before="Magento_Adminhtml" /> - </route> - </router> -</config> \ No newline at end of file +<page_types> + <type id="downloadable_customer_products" label="Customer My Account Downloadable Items"/> +</page_types> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml b/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml index a9b5612b219..1c26d3d58ae 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Downloadable)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="product.info"> <block class="Magento\Downloadable\Block\Catalog\Product\View\Type" name="product.info.downloadable" as="product_type_data" template="catalog/product/type.phtml"> <block class="Magento\Downloadable\Block\Catalog\Product\Samples" name="product.info.downloadable.samples" as="samples" template="catalog/product/samples.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml index a5b223b8e4f..5d11450ed14 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Cart Item" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="catalog_product_view_type_downloadable"/> </layout> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml index d4d70ebe0f4..a4616435e4e 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Downloadable Items" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Downloadable\Block\Customer\Products\ListProducts" name="downloadable_customer_products_list" template="customer/products/list.phtml"/> diff --git a/app/code/Magento/Eav/Model/Cache/Type.php b/app/code/Magento/Eav/Model/Cache/Type.php index 36e37c02ea9..e6bcf28897a 100644 --- a/app/code/Magento/Eav/Model/Cache/Type.php +++ b/app/code/Magento/Eav/Model/Cache/Type.php @@ -44,9 +44,9 @@ class Type extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'EAV'; /** - * @param \Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Eav/Model/Config.php b/app/code/Magento/Eav/Model/Config.php index 0d898463de4..6c95518915f 100644 --- a/app/code/Magento/Eav/Model/Config.php +++ b/app/code/Magento/Eav/Model/Config.php @@ -120,13 +120,13 @@ class Config /** * @param \Magento\Core\Model\App $app * @param \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\Validator\UniversalFactory $universalFactory */ public function __construct( \Magento\Core\Model\App $app, \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, \Magento\Validator\UniversalFactory $universalFactory ) { $this->_app = $app; diff --git a/app/code/Magento/GiftMessage/Helper/Message.php b/app/code/Magento/GiftMessage/Helper/Message.php index 665038955cc..8ac53fd55c6 100644 --- a/app/code/Magento/GiftMessage/Helper/Message.php +++ b/app/code/Magento/GiftMessage/Helper/Message.php @@ -74,11 +74,9 @@ class Message extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\View\LayoutFactory $layoutFactory @@ -88,11 +86,9 @@ class Message extends \Magento\Core\Helper\Data */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\View\LayoutFactory $layoutFactory, @@ -106,11 +102,9 @@ class Message extends \Magento\Core\Helper\Data $this->_giftMessageFactory = $giftMessageFactory; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/GoogleCheckout/etc/frontend/page_types.xml b/app/code/Magento/GoogleCheckout/etc/frontend/page_types.xml new file mode 100644 index 00000000000..bf5d4484203 --- /dev/null +++ b/app/code/Magento/GoogleCheckout/etc/frontend/page_types.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="googlecheckout_redirect_redirect" label="GoogleCheckout Redirect"/> +</page_types> diff --git a/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml b/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml index 146a9d6b7f2..c0089e2ee15 100644 --- a/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml +++ b/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="GoogleCheckout Redirect" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/ImportExport/Helper/Data.php b/app/code/Magento/ImportExport/Helper/Data.php index 1edcb6dc8ab..d0f0e8f8e9d 100644 --- a/app/code/Magento/ImportExport/Helper/Data.php +++ b/app/code/Magento/ImportExport/Helper/Data.php @@ -49,22 +49,18 @@ class Data extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\File\Size $fileSize * @param bool $dbCompatibleMode */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\File\Size $fileSize, $dbCompatibleMode = true @@ -72,11 +68,9 @@ class Data extends \Magento\Core\Helper\Data $this->_fileSize = $fileSize; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index b6b8620e1e1..5464fe6ec42 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -36,6 +36,8 @@ */ namespace Magento\ImportExport\Model; +use Magento\HTTP\Adapter\FileTransferFactory; + class Import extends \Magento\ImportExport\Model\AbstractModel { /**#@+ @@ -111,7 +113,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel protected $_csvFactory; /** - * @var \Magento\ImportExport\Model\HttpAdapterFactory + * @var \Magento\HTTP\Adapter\FileTransferFactory */ protected $_httpFactory; @@ -140,7 +142,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel * @param Import\Entity\Factory $entityFactory * @param Resource\Import\Data $importData * @param Export\Adapter\CsvFactory $csvFactory - * @param HttpAdapterFactory $httpFactory + * @param FileTransferFactory $httpFactory * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory * @param Source\Import\Behavior\Factory $behaviorFactory * @param \Magento\Index\Model\Indexer $indexer @@ -156,7 +158,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel \Magento\ImportExport\Model\Import\Entity\Factory $entityFactory, \Magento\ImportExport\Model\Resource\Import\Data $importData, \Magento\ImportExport\Model\Export\Adapter\CsvFactory $csvFactory, - \Magento\ImportExport\Model\HttpAdapterFactory $httpFactory, + \Magento\HTTP\Adapter\FileTransferFactory $httpFactory, \Magento\Core\Model\File\UploaderFactory $uploaderFactory, \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory, \Magento\Index\Model\Indexer $indexer, diff --git a/app/code/Magento/ImportExport/Model/Import/Uploader.php b/app/code/Magento/ImportExport/Model/Import/Uploader.php index 82743bd4ee9..f8eb4a9e97d 100644 --- a/app/code/Magento/ImportExport/Model/Import/Uploader.php +++ b/app/code/Magento/ImportExport/Model/Import/Uploader.php @@ -46,7 +46,7 @@ class Uploader extends \Magento\Core\Model\File\Uploader const DEFAULT_FILE_TYPE = 'application/octet-stream'; /** - * @var \Magento\Core\Model\Image\AdapterFactory + * @var \Magento\Image\AdapterFactory */ protected $_imageFactory; @@ -58,14 +58,14 @@ class Uploader extends \Magento\Core\Model\File\Uploader /** * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Helper\File\Storage $coreFileStorage - * @param \Magento\Core\Model\Image\AdapterFactory $imageFactory + * @param \Magento\Image\AdapterFactory $imageFactory * @param \Magento\Core\Model\File\Validator\NotProtectedExtension $validator * @param string $filePath */ public function __construct( \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Helper\File\Storage $coreFileStorage, - \Magento\Core\Model\Image\AdapterFactory $imageFactory, + \Magento\Image\AdapterFactory $imageFactory, \Magento\Core\Model\File\Validator\NotProtectedExtension $validator, $filePath = null ) { diff --git a/app/code/Magento/Install/Controller/Action.php b/app/code/Magento/Install/Controller/Action.php index 208b96f10b2..7eabca0122d 100644 --- a/app/code/Magento/Install/Controller/Action.php +++ b/app/code/Magento/Install/Controller/Action.php @@ -42,7 +42,7 @@ class Action extends \Magento\Core\Controller\Varien\Action /** * @var \Magento\Core\Model\Theme\CollectionFactory */ - protected $_collectionFactory; + protected $collectionFactory; /** * Application @@ -76,10 +76,10 @@ class Action extends \Magento\Core\Controller\Varien\Action ) { $this->_configScope = $configScope; $this->_viewDesign = $viewDesign; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context); + $this->collectionFactory = $collectionFactory; $this->_app = $app; $this->_appState = $appState; + parent::__construct($context); } protected function _construct() @@ -115,7 +115,7 @@ class Action extends \Magento\Core\Controller\Varien\Action protected function _initDefaultTheme($areaCode) { /** @var $themesCollection \Magento\Core\Model\Theme\Collection */ - $themesCollection = $this->_collectionFactory->create(); + $themesCollection = $this->collectionFactory->create(); $themeModel = $themesCollection->addDefaultPattern($areaCode) ->addFilter('theme_path', $this->_viewDesign->getConfigurationDesignTheme($areaCode)) ->getFirstItem(); diff --git a/app/code/Magento/Install/Controller/Index.php b/app/code/Magento/Install/Controller/Index.php index 0a57e7066f4..6c62e0aecd3 100644 --- a/app/code/Magento/Install/Controller/Index.php +++ b/app/code/Magento/Install/Controller/Index.php @@ -57,8 +57,8 @@ class Index extends \Magento\Install\Controller\Action \Magento\App\State $appState, \Magento\App\Dir $coreDir ) { - parent::__construct($context, $configScope, $viewDesign, $collectionFactory, $app, $appState); $this->_coreDir = $coreDir; + parent::__construct($context, $configScope, $viewDesign, $collectionFactory, $app, $appState); } /** diff --git a/app/code/Magento/Install/Controller/Wizard.php b/app/code/Magento/Install/Controller/Wizard.php index 20f8e0db71c..fca33f531d1 100644 --- a/app/code/Magento/Install/Controller/Wizard.php +++ b/app/code/Magento/Install/Controller/Wizard.php @@ -92,15 +92,14 @@ class Wizard extends \Magento\Install\Controller\Action \Magento\Module\UpdaterInterface $dbUpdater, \Magento\Core\Model\StoreManagerInterface $storeManager ) { - parent::__construct($context, $configScope, $viewDesign, $collectionFactory, $app, $appState); $this->_installer = $installer; $this->_wizard = $wizard; $this->_session = $session; $this->_dbUpdater = $dbUpdater; $this->_storeManager = $storeManager; + parent::__construct($context, $configScope, $viewDesign, $collectionFactory, $app, $appState); } - /** * Perform necessary checks for all actions * diff --git a/app/code/Magento/Install/Model/Installer.php b/app/code/Magento/Install/Model/Installer.php index f295f4415fd..38db0f5153b 100644 --- a/app/code/Magento/Install/Model/Installer.php +++ b/app/code/Magento/Install/Model/Installer.php @@ -61,12 +61,12 @@ class Installer extends \Magento\Object protected $_config; /** - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ protected $_cacheState; /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -162,8 +162,8 @@ class Installer extends \Magento\Object * @param \Magento\Core\Model\ConfigInterface $config * @param \Magento\Module\UpdaterInterface $dbUpdater * @param \Magento\App\CacheInterface $cache - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\StateInterface $cacheState * @param \Magento\Module\Updater\SetupFactory $setupFactory * @param \Magento\App\Config $localConfig * @param \Magento\Core\Model\App $app @@ -184,8 +184,8 @@ class Installer extends \Magento\Object \Magento\Core\Model\ConfigInterface $config, \Magento\Module\UpdaterInterface $dbUpdater, \Magento\App\CacheInterface $cache, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\App\Cache\StateInterface $cacheState, \Magento\Module\Updater\SetupFactory $setupFactory, \Magento\App\Config $localConfig, \Magento\Core\Model\App $app, diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php index 21493db48e1..457cd8a66c2 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,79 +16,79 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Integration\Block\Adminhtml\Integration; - -use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; -use Magento\Integration\Controller\Adminhtml\Integration; - -class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container -{ - /** - * Core registry - * - * @var \Magento\Core\Model\Registry - */ - protected $_registry = null; - - /** - * Initialize dependencies. - * - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data - */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { - $this->_registry = $registry; - parent::__construct($coreData, $context, $data); - } - - /** - * Initialize Integration edit page - * - */ - protected function _construct() - { - $this->_controller = 'adminhtml_integration'; - $this->_blockGroup = 'Magento_Integration'; - parent::_construct(); - } - - /** - * Get header text for edit page. - * - * @return string - */ - public function getHeaderText() - { - if (isset($this->_registry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION)[Info::DATA_ID])) { - return __( - "Edit Integration '%1'", - $this->escapeHtml( - $this->_registry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION)[Info::DATA_NAME] - ) - ); - } else { - return __('New Integration'); - } - } - - /** - * {@inheritdoc} - */ - public function getFormActionUrl() - { - return $this->getUrl('*/*/save'); - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Integration; + +use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; +use Magento\Integration\Controller\Adminhtml\Integration; + +class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container +{ + /** + * Core registry + * + * @var \Magento\Core\Model\Registry + */ + protected $_registry = null; + + /** + * Initialize dependencies. + * + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data + */ + public function __construct( + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + $this->_registry = $registry; + parent::__construct($coreData, $context, $data); + } + + /** + * Initialize Integration edit page + * + */ + protected function _construct() + { + $this->_controller = 'adminhtml_integration'; + $this->_blockGroup = 'Magento_Integration'; + parent::_construct(); + } + + /** + * Get header text for edit page. + * + * @return string + */ + public function getHeaderText() + { + if (isset($this->_registry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION)[Info::DATA_ID])) { + return __( + "Edit Integration '%1'", + $this->escapeHtml( + $this->_registry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION)[Info::DATA_NAME] + ) + ); + } else { + return __('New Integration'); + } + } + + /** + * {@inheritdoc} + */ + public function getFormActionUrl() + { + return $this->getUrl('*/*/save'); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php index a2ec2aa9681..1280eca8bfa 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,180 +16,180 @@ * * 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 Magento - * @package Magento_Integration - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Integration\Block\Adminhtml\Integration\Edit\Tab; - -use \Magento\Integration\Controller\Adminhtml\Integration; - -/** - * Main Integration info edit form - * - * @category Magento - * @package Magento_Integration - * @SuppressWarnings(PHPMD.DepthOfInheritance) - */ -class Info extends \Magento\Backend\Block\Widget\Form\Generic - implements \Magento\Backend\Block\Widget\Tab\TabInterface -{ - /** @var \Magento\Integration\Model\Integration\Source\Authentication */ - protected $_authTypeSource; - - /**#@+ - * edit_form element names. - */ - const HTML_ID_PREFIX = 'integration_properties_'; - const DATA_ID = 'integration_id'; - const DATA_NAME = 'name'; - const DATA_EMAIL = 'email'; - const DATA_AUTHENTICATION = 'authentication'; - const DATA_ENDPOINT = 'endpoint'; - /**#@-*/ - - /** - * Construct - * - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data - * @param \Magento\Integration\Model\Integration\Source\Authentication $authTypeSource - */ - public function __construct( - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Integration\Model\Integration\Source\Authentication $authTypeSource, - array $data = array() - ) { - parent::__construct($registry, $formFactory, $coreData, $context, $data); - $this->_authTypeSource = $authTypeSource; - } - - /** - * Set form id prefix, declare fields for integration info - * - * @return \Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info - */ - protected function _prepareForm() - { - /** @var \Magento\Data\Form $form */ - $form = $this->_formFactory->create(); - $form->setHtmlIdPrefix(self::HTML_ID_PREFIX); - $integrationData = $this->_coreRegistry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION); - $fieldset = $form->addFieldset('base_fieldset', array('legend' => __('Integration'))); - if (isset($integrationData[self::DATA_ID])) { - $fieldset->addField(self::DATA_ID, 'hidden', array('name' => 'id')); - } - $fieldset->addField( - self::DATA_NAME, - 'text', - array( - 'label' => __('Integration Name'), - 'name' => self::DATA_NAME, - 'required' => true, - 'disabled' => false, - 'maxlength' => '255' - ) - ); - $fieldset->addField( - self::DATA_EMAIL, - 'text', - array( - 'label' => __('Email'), - 'name' => self::DATA_EMAIL, - 'required' => true, - 'disabled' => false, - 'class' => 'validate-email', - 'maxlength' => '254', - ) - ); - $fieldset->addField( - self::DATA_AUTHENTICATION, - 'select', - array( - 'label' => __('Authentication'), - 'name' => self::DATA_AUTHENTICATION, - 'disabled' => false, - 'options' => $this->_authTypeSource->toOptionArray() - ) - ); - $fieldset->addField( - self::DATA_ENDPOINT, - 'text', - array('label' => __('Endpoint URL'), 'name' => self::DATA_ENDPOINT, 'required' => true, 'disabled' => false) - ); - $form->setValues($integrationData); - $this->setForm($form); - return $this; - } - - /** - * Prepare label for tab - * - * @return string - */ - public function getTabLabel() - { - return __('Integration Info'); - } - - /** - * Prepare title for tab - * - * @return string - */ - public function getTabTitle() - { - return $this->getTabLabel(); - } - - /** - * Returns status flag about this tab can be showen or not - * - * @return true - */ - public function canShowTab() - { - return true; - } - - /** - * Returns status flag about this tab hidden or not - * - * @return true - */ - public function isHidden() - { - return false; - } - - /** - * Get additional script for tabs block - * - * @return string - */ - protected function _toHtml() - { - $oauth = \Magento\Integration\Model\Integration::AUTHENTICATION_OAUTH; - $authFieldIdSelector = '#' . self::HTML_ID_PREFIX . self::DATA_AUTHENTICATION; - $endpointIdSelector = '#' . self::HTML_ID_PREFIX . self::DATA_ENDPOINT; - $endpointClassSel = '.field-' . self::DATA_ENDPOINT; - $script = <<<HTML - jQuery(function(){ - jQuery('$authFieldIdSelector') - .mage('integration', {"authType": $oauth, "formSelector": '#edit_form', - endpointIdSelector: '$endpointIdSelector', endpointContainerClassSelector: '$endpointClassSel'}); - }); -HTML; - return parent::_toHtml() . sprintf('<script type="text/javascript">%s</script>', $script); - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Integration + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Integration\Edit\Tab; + +use \Magento\Integration\Controller\Adminhtml\Integration; + +/** + * Main Integration info edit form + * + * @category Magento + * @package Magento_Integration + * @SuppressWarnings(PHPMD.DepthOfInheritance) + */ +class Info extends \Magento\Backend\Block\Widget\Form\Generic + implements \Magento\Backend\Block\Widget\Tab\TabInterface +{ + /** @var \Magento\Integration\Model\Integration\Source\Authentication */ + protected $_authTypeSource; + + /**#@+ + * edit_form element names. + */ + const HTML_ID_PREFIX = 'integration_properties_'; + const DATA_ID = 'integration_id'; + const DATA_NAME = 'name'; + const DATA_EMAIL = 'email'; + const DATA_AUTHENTICATION = 'authentication'; + const DATA_ENDPOINT = 'endpoint'; + /**#@-*/ + + /** + * Construct + * + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Block\Template\Context $context + * @param array $data + * @param \Magento\Integration\Model\Integration\Source\Authentication $authTypeSource + */ + public function __construct( + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Block\Template\Context $context, + \Magento\Integration\Model\Integration\Source\Authentication $authTypeSource, + array $data = array() + ) { + parent::__construct($registry, $formFactory, $coreData, $context, $data); + $this->_authTypeSource = $authTypeSource; + } + + /** + * Set form id prefix, declare fields for integration info + * + * @return \Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info + */ + protected function _prepareForm() + { + /** @var \Magento\Data\Form $form */ + $form = $this->_formFactory->create(); + $form->setHtmlIdPrefix(self::HTML_ID_PREFIX); + $integrationData = $this->_coreRegistry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION); + $fieldset = $form->addFieldset('base_fieldset', array('legend' => __('Integration'))); + if (isset($integrationData[self::DATA_ID])) { + $fieldset->addField(self::DATA_ID, 'hidden', array('name' => 'id')); + } + $fieldset->addField( + self::DATA_NAME, + 'text', + array( + 'label' => __('Integration Name'), + 'name' => self::DATA_NAME, + 'required' => true, + 'disabled' => false, + 'maxlength' => '255' + ) + ); + $fieldset->addField( + self::DATA_EMAIL, + 'text', + array( + 'label' => __('Email'), + 'name' => self::DATA_EMAIL, + 'required' => true, + 'disabled' => false, + 'class' => 'validate-email', + 'maxlength' => '254', + ) + ); + $fieldset->addField( + self::DATA_AUTHENTICATION, + 'select', + array( + 'label' => __('Authentication'), + 'name' => self::DATA_AUTHENTICATION, + 'disabled' => false, + 'options' => $this->_authTypeSource->toOptionArray() + ) + ); + $fieldset->addField( + self::DATA_ENDPOINT, + 'text', + array('label' => __('Endpoint URL'), 'name' => self::DATA_ENDPOINT, 'required' => true, 'disabled' => false) + ); + $form->setValues($integrationData); + $this->setForm($form); + return $this; + } + + /** + * Prepare label for tab + * + * @return string + */ + public function getTabLabel() + { + return __('Integration Info'); + } + + /** + * Prepare title for tab + * + * @return string + */ + public function getTabTitle() + { + return $this->getTabLabel(); + } + + /** + * Returns status flag about this tab can be showen or not + * + * @return true + */ + public function canShowTab() + { + return true; + } + + /** + * Returns status flag about this tab hidden or not + * + * @return true + */ + public function isHidden() + { + return false; + } + + /** + * Get additional script for tabs block + * + * @return string + */ + protected function _toHtml() + { + $oauth = \Magento\Integration\Model\Integration::AUTHENTICATION_OAUTH; + $authFieldIdSelector = '#' . self::HTML_ID_PREFIX . self::DATA_AUTHENTICATION; + $endpointIdSelector = '#' . self::HTML_ID_PREFIX . self::DATA_ENDPOINT; + $endpointClassSel = '.field-' . self::DATA_ENDPOINT; + $script = <<<HTML + jQuery(function(){ + jQuery('$authFieldIdSelector') + .mage('integration', {"authType": $oauth, "formSelector": '#edit_form', + endpointIdSelector: '$endpointIdSelector', endpointContainerClassSelector: '$endpointClassSel'}); + }); +HTML; + return parent::_toHtml() . sprintf('<script type="text/javascript">%s</script>', $script); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php index c2a4ed0d3fa..2b5e77ee31e 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,27 +16,27 @@ * * 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 Magento - * @package Magento_Integration - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Integration\Block\Adminhtml\Integration\Edit; - -class Tabs extends \Magento\Adminhtml\Block\Widget\Tabs -{ - /** - * Initialize integration edit page tabs - * - */ - protected function _construct() - { - parent::_construct(); - $this->setId('integration_edit_tabs'); - $this->setDestElementId('edit_form'); - $this->setTitle(__('Integration Information')); - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Integration + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Integration\Edit; + +class Tabs extends \Magento\Adminhtml\Block\Widget\Tabs +{ + /** + * Initialize integration edit page tabs + * + */ + protected function _construct() + { + parent::_construct(); + $this->setId('integration_edit_tabs'); + $this->setDestElementId('edit_form'); + $this->setTitle(__('Integration Information')); + } +} diff --git a/app/code/Magento/Oauth/Controller/Token.php b/app/code/Magento/Integration/Controller/Token.php similarity index 67% rename from app/code/Magento/Oauth/Controller/Token.php rename to app/code/Magento/Integration/Controller/Token.php index c5538659a79..8ce71831877 100644 --- a/app/code/Magento/Oauth/Controller/Token.php +++ b/app/code/Magento/Integration/Controller/Token.php @@ -25,25 +25,25 @@ /** * oAuth token controller */ -namespace Magento\Oauth\Controller; +namespace Magento\Integration\Controller; class Token extends \Magento\Core\Controller\Front\Action { - /** @var \Magento\Oauth\Service\OauthV1Interface */ + /** @var \Magento\Oauth\OauthInterface */ protected $_oauthService; - /** @var \Magento\Oauth\Helper\Data */ + /** @var \Magento\Oauth\Helper\Request */ protected $_helper; /** - * @param \Magento\Oauth\Service\OauthV1Interface $oauthService + * @param \Magento\Oauth\OauthInterface $oauthService * @param \Magento\Core\Controller\Varien\Action\Context $context - * @param \Magento\Oauth\Helper\Data $helper + * @param \Magento\Oauth\Helper\Request $helper */ public function __construct( \Magento\Core\Controller\Varien\Action\Context $context, - \Magento\Oauth\Service\OauthV1Interface $oauthService, - \Magento\Oauth\Helper\Data $helper + \Magento\Oauth\OauthInterface $oauthService, + \Magento\Oauth\Helper\Request $helper ) { parent::__construct($context); $this->_oauthService = $oauthService; @@ -56,11 +56,12 @@ class Token extends \Magento\Core\Controller\Front\Action public function requestAction() { try { - $request = $this->_helper->prepareServiceRequest($this->getRequest()); - - //Request request token - $response = $this->_oauthService->getRequestToken($request); + $requestUrl = $this->_helper->getRequestUrl($this->getRequest()); + $request = $this->_helper->prepareRequest($this->getRequest(), $requestUrl); + // Request request token + $response = $this->_oauthService->getRequestToken( + $request, $requestUrl, $this->getRequest()->getMethod()); } catch (\Exception $exception) { $response = $this->_helper->prepareErrorResponse( $exception, @@ -76,11 +77,12 @@ class Token extends \Magento\Core\Controller\Front\Action public function accessAction() { try { - $request = $this->_helper->prepareServiceRequest($this->getRequest()); - - //Request access token in exchange of a pre-authorized token - $response = $this->_oauthService->getAccessToken($request); + $requestUrl = $this->_helper->getRequestUrl($this->getRequest()); + $request = $this->_helper->prepareRequest($this->getRequest(), $requestUrl); + // Request access token in exchange of a pre-authorized token + $response = $this->_oauthService->getAccessToken( + $request, $requestUrl, $this->getRequest()->getMethod()); } catch (\Exception $exception) { $response = $this->_helper->prepareErrorResponse( $exception, @@ -89,5 +91,4 @@ class Token extends \Magento\Core\Controller\Front\Action } $this->getResponse()->setBody(http_build_query($response)); } - } diff --git a/app/code/Magento/Integration/Helper/Oauth/Consumer.php b/app/code/Magento/Integration/Helper/Oauth/Consumer.php new file mode 100644 index 00000000000..70cd70b5516 --- /dev/null +++ b/app/code/Magento/Integration/Helper/Oauth/Consumer.php @@ -0,0 +1,144 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Helper\Oauth; + +use \Magento\Oauth\OauthInterface; + +class Consumer +{ + /** @var \Magento\Core\Model\StoreManagerInterface */ + protected $_storeManager; + + /** @var \Magento\Integration\Model\Oauth\Consumer\Factory */ + protected $_consumerFactory; + + /** @var \Magento\Integration\Model\Oauth\Token\Factory */ + protected $_tokenFactory; + + /** @var \Magento\Integration\Helper\Oauth\Data */ + protected $_dataHelper; + + /** @var \Magento\HTTP\ZendClient */ + protected $_httpClient; + + /** @var \Magento\Logger */ + protected $_logger; + + /** + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory + * @param \Magento\Integration\Model\Oauth\Token\Factory $tokenFactory + * @param \Magento\Integration\Helper\Oauth\Data $dataHelper + * @param \Magento\HTTP\ZendClient $httpClient + * @param \Magento\Logger $logger + */ + public function __construct( + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory, + \Magento\Integration\Model\Oauth\Token\Factory $tokenFactory, + \Magento\Integration\Helper\Oauth\Data $dataHelper, + \Magento\HTTP\ZendClient $httpClient, + \Magento\Logger $logger + ) { + $this->_storeManager = $storeManager; + $this->_consumerFactory = $consumerFactory; + $this->_tokenFactory = $tokenFactory; + $this->_dataHelper = $dataHelper; + $this->_httpClient = $httpClient; + $this->_logger = $logger; + } + + /** + * Create a new consumer account when an integration is installed. + * + * @param array $consumerData - Information provided by an integration when the integration is installed. + * <pre> + * array( + * 'name' => 'Integration Name', + * 'key' => 'a6aa81cc3e65e2960a4879392445e718', + * 'secret' => 'b7bb92dd4f76f3a71b598a4a3556f829' + * ) + * </pre> + * @return array - The integration (consumer) data. + * @throws \Magento\Core\Exception + * @throws \Magento\Oauth\Exception + */ + public function createConsumer($consumerData) + { + try { + $consumer = $this->_consumerFactory->create($consumerData); + $consumer->save(); + return $consumer->getData(); + } catch (\Magento\Core\Exception $exception) { + throw $exception; + } catch (\Exception $exception) { + throw new \Magento\Oauth\Exception(__('Unexpected error. Unable to create OAuth Consumer account.')); + } + } + + /** + * Execute post to integration (consumer) HTTP Post URL. Generate and return oauth_verifier. + * + * @param int $consumerId - The consumer Id. + * @param string $endpointUrl - The integration endpoint Url (for HTTP Post) + * @return string - The oauth_verifier. + * @throws \Magento\Core\Exception + * @throws \Magento\Oauth\Exception + */ + public function postToConsumer($consumerId, $endpointUrl) + { + try { + $consumer = $this->_consumerFactory->create()->load($consumerId); + if (!$consumer->getId()) { + throw new \Magento\Oauth\Exception( + __('A consumer with ID %1 does not exist', $consumerId), OauthInterface::ERR_PARAMETER_REJECTED); + } + $consumerData = $consumer->getData(); + $verifier = $this->_tokenFactory->create()->createVerifierToken($consumerId); + $storeBaseUrl = $this->_storeManager->getStore()->getBaseUrl(); + $this->_httpClient->setUri($endpointUrl); + $this->_httpClient->setParameterPost( + array( + 'oauth_consumer_key' => $consumerData['key'], + 'oauth_consumer_secret' => $consumerData['secret'], + 'store_base_url' => $storeBaseUrl, + 'oauth_verifier' => $verifier->getVerifier() + ) + ); + $maxredirects = $this->_dataHelper->getConsumerPostMaxRedirects(); + $timeout = $this->_dataHelper->getConsumerPostTimeout(); + $this->_httpClient->setConfig(array('maxredirects' => $maxredirects, 'timeout' => $timeout)); + $this->_httpClient->request(\Magento\HTTP\ZendClient::POST); + return $verifier->getVerifier(); + } catch (\Magento\Core\Exception $exception) { + throw $exception; + } catch (\Magento\Oauth\Exception $exception) { + throw $exception; + } catch (\Exception $exception) { + $this->_logger->logException($exception); + throw new \Magento\Oauth\Exception(__('Unable to post data to consumer due to an unexpected error')); + } + } +} diff --git a/app/code/Magento/Integration/Helper/Oauth/Data.php b/app/code/Magento/Integration/Helper/Oauth/Data.php new file mode 100644 index 00000000000..2d597e85172 --- /dev/null +++ b/app/code/Magento/Integration/Helper/Oauth/Data.php @@ -0,0 +1,125 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * OAuth View Helper for Controllers + */ +namespace Magento\Integration\Helper\Oauth; + +class Data +{ + /** @var \Magento\Core\Model\Store\Config */ + protected $_storeConfig; + + /** + * @param \Magento\Core\Model\Store\Config $storeConfig + */ + public function __construct(\Magento\Core\Model\Store\Config $storeConfig) + { + $this->_storeConfig = $storeConfig; + } + + /**#@+ + * Cleanup xpath config settings + */ + const XML_PATH_CLEANUP_PROBABILITY = 'oauth/cleanup/cleanup_probability'; + const XML_PATH_CLEANUP_EXPIRATION_PERIOD = 'oauth/cleanup/expiration_period'; + /**#@-*/ + + /** + * Cleanup expiration period in minutes + */ + const CLEANUP_EXPIRATION_PERIOD_DEFAULT = 120; + + /**#@+ + * Consumer xpath settings + */ + const XML_PATH_CONSUMER_EXPIRATION_PERIOD = 'oauth/consumer/expiration_period'; + const XML_PATH_CONSUMER_POST_MAXREDIRECTS = 'oauth/consumer/post_maxredirects'; + const XML_PATH_CONSUMER_POST_TIMEOUT = 'oauth/consumer/post_timeout'; + /**#@-*/ + + /**#@+ + * Consumer default settings + */ + const CONSUMER_EXPIRATION_PERIOD_DEFAULT = 300; + const CONSUMER_POST_TIMEOUT_DEFAULT = 5; + /**#@-*/ + + /** + * Calculate cleanup possibility for data with lifetime property + * + * @return bool + */ + public function isCleanupProbability() + { + // Safe get cleanup probability value from system configuration + $configValue = (int) $this->_storeConfig->getConfig(self::XML_PATH_CLEANUP_PROBABILITY); + return $configValue > 0 ? 1 == mt_rand(1, $configValue) : false; + } + + /** + * Get cleanup expiration period value from system configuration in minutes + * + * @return int + */ + public function getCleanupExpirationPeriod() + { + $minutes = (int) $this->_storeConfig->getConfig(self::XML_PATH_CLEANUP_EXPIRATION_PERIOD); + return $minutes > 0 ? $minutes : self::CLEANUP_EXPIRATION_PERIOD_DEFAULT; + } + + /** + * Get consumer expiration period value from system configuration in seconds + * + * @return int + */ + public function getConsumerExpirationPeriod() + { + $seconds = (int)$this->_storeConfig->getConfig(self::XML_PATH_CONSUMER_EXPIRATION_PERIOD); + return $seconds > 0 ? $seconds : self::CONSUMER_EXPIRATION_PERIOD_DEFAULT; + } + + /** + * Get the number of consumer post maximum redirects + * + * @return int + */ + public function getConsumerPostMaxRedirects() + { + $redirects = (int)$this->_storeConfig->getConfig(self::XML_PATH_CONSUMER_POST_MAXREDIRECTS); + return $redirects > 0 ? $redirects : 0; + } + + /** + * Get the number seconds for the consumer post timeout + * + * @return int + */ + public function getConsumerPostTimeout() + { + $seconds = (int)$this->_storeConfig->getConfig(self::XML_PATH_CONSUMER_POST_TIMEOUT); + return $seconds > 0 ? $seconds : self::CONSUMER_POST_TIMEOUT_DEFAULT; + } +} diff --git a/app/code/Magento/Integration/Model/Integration.php b/app/code/Magento/Integration/Model/Integration.php index ff5f86953bc..bd4eb4424a5 100644 --- a/app/code/Magento/Integration/Model/Integration.php +++ b/app/code/Magento/Integration/Model/Integration.php @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,96 +16,96 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Integration\Model; - -/** - * Integration model. - * - * @method \string getName() - * @method Integration setName(\string $name) - * @method \string getEmail() - * @method Integration setEmail(\string $email) - * @method \int getStatus() - * @method Integration setStatus(\int $value) - * @method \int getAuthentication() - * @method Integration setAuthentication(\int $value) - * @method \string getEndpoint() - * @method Integration setEndpoint(\string $endpoint) - * @method \string getCreatedAt() - * @method Integration setCreatedAt(\string $createdAt) - * @method \string getUpdatedAt() - * @method Integration setUpdatedAt(\string $createdAt) - */ -class Integration extends \Magento\Core\Model\AbstractModel -{ - /**#@+ - * Integration statuses. - */ - const STATUS_INACTIVE = 0; - const STATUS_ACTIVE = 1; - /**#@-*/ - - /**#@+ - * Authentication mechanism - */ - const AUTHENTICATION_OAUTH = 1; - const AUTHENTICATION_MANUAL = 2; - /**#@-*/ - - /** - * @var \Magento\Stdlib\DateTime - */ - protected $_dateTime; - - /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Customer\Model\Resource\Customer $resource - * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Data\Collection\Db|null $resourceCollection - * @param array $data - */ - public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Stdlib\DateTime $dateTime, - \Magento\Core\Model\Resource\AbstractResource $resource = null, - \Magento\Data\Collection\Db $resourceCollection = null, - array $data = array() - ) { - $this->_dateTime = $dateTime; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->_init('Magento\Integration\Model\Resource\Integration'); - } - - /** - * Prepare data to be saved to database - * - * @return Integration - */ - protected function _beforeSave() - { - parent::_beforeSave(); - if ($this->isObjectNew()) { - $this->setCreatedAt($this->_dateTime->formatDate(true)); - } - $this->setUpdatedAt($this->_dateTime->formatDate(true)); - return $this; - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Model; + +/** + * Integration model. + * + * @method \string getName() + * @method Integration setName(\string $name) + * @method \string getEmail() + * @method Integration setEmail(\string $email) + * @method \int getStatus() + * @method Integration setStatus(\int $value) + * @method \int getAuthentication() + * @method Integration setAuthentication(\int $value) + * @method \string getEndpoint() + * @method Integration setEndpoint(\string $endpoint) + * @method \string getCreatedAt() + * @method Integration setCreatedAt(\string $createdAt) + * @method \string getUpdatedAt() + * @method Integration setUpdatedAt(\string $createdAt) + */ +class Integration extends \Magento\Core\Model\AbstractModel +{ + /**#@+ + * Integration statuses. + */ + const STATUS_INACTIVE = 0; + const STATUS_ACTIVE = 1; + /**#@-*/ + + /**#@+ + * Authentication mechanism + */ + const AUTHENTICATION_OAUTH = 1; + const AUTHENTICATION_MANUAL = 2; + /**#@-*/ + + /** + * @var \Magento\Stdlib\DateTime + */ + protected $_dateTime; + + /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Customer\Model\Resource\Customer $resource + * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Data\Collection\Db|null $resourceCollection + * @param array $data + */ + public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Stdlib\DateTime $dateTime, + \Magento\Core\Model\Resource\AbstractResource $resource = null, + \Magento\Data\Collection\Db $resourceCollection = null, + array $data = array() + ) { + $this->_dateTime = $dateTime; + parent::__construct($context, $registry, $resource, $resourceCollection, $data); + } + + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + parent::_construct(); + $this->_init('Magento\Integration\Model\Resource\Integration'); + } + + /** + * Prepare data to be saved to database + * + * @return Integration + */ + protected function _beforeSave() + { + parent::_beforeSave(); + if ($this->isObjectNew()) { + $this->setCreatedAt($this->_dateTime->formatDate(true)); + } + $this->setUpdatedAt($this->_dateTime->formatDate(true)); + return $this; + } +} diff --git a/app/code/Magento/Integration/Model/Integration/Source/Status.php b/app/code/Magento/Integration/Model/Integration/Source/Status.php index 8dc8a0cab64..b0e1214e4f6 100644 --- a/app/code/Magento/Integration/Model/Integration/Source/Status.php +++ b/app/code/Magento/Integration/Model/Integration/Source/Status.php @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,34 +16,34 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Integration\Model\Integration\Source; - -/** - * Integration status options. - */ -class Status implements \Magento\Core\Model\Option\ArrayInterface -{ - /** - * Retrieve status options array. - * - * @return array - */ - public function toOptionArray() - { - return array( - array( - 'value' => \Magento\Integration\Model\Integration::STATUS_INACTIVE, - 'label' => __('Inactive') - ), - array( - 'value' => \Magento\Integration\Model\Integration::STATUS_ACTIVE, - 'label' => __('Active') - ), - ); - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Integration\Model\Integration\Source; + +/** + * Integration status options. + */ +class Status implements \Magento\Core\Model\Option\ArrayInterface +{ + /** + * Retrieve status options array. + * + * @return array + */ + public function toOptionArray() + { + return array( + array( + 'value' => \Magento\Integration\Model\Integration::STATUS_INACTIVE, + 'label' => __('Inactive') + ), + array( + 'value' => \Magento\Integration\Model\Integration::STATUS_ACTIVE, + 'label' => __('Active') + ), + ); + } +} diff --git a/app/code/Magento/Oauth/Model/Consumer.php b/app/code/Magento/Integration/Model/Oauth/Consumer.php similarity index 57% rename from app/code/Magento/Oauth/Model/Consumer.php rename to app/code/Magento/Integration/Model/Oauth/Consumer.php index 958bfb9380d..262479304b4 100644 --- a/app/code/Magento/Oauth/Model/Consumer.php +++ b/app/code/Magento/Integration/Model/Oauth/Consumer.php @@ -22,53 +22,43 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Integration\Model\Oauth; + +use Magento\Oauth\ConsumerInterface; + /** - * Application model - * @author Magento Core Team <core@magentocommerce.com> - * @method \Magento\Oauth\Model\Resource\Consumer _getResource() - * @method \Magento\Oauth\Model\Resource\Consumer getResource() - * @method \Magento\Oauth\Model\Resource\Consumer\Collection getCollection() - * @method \Magento\Oauth\Model\Resource\Consumer\Collection getResourceCollection() + * Consumer model + * + * @author Magento Core Team <core@magentocommerce.com> + * @method \Magento\Integration\Model\Resource\Oauth\Consumer _getResource() + * @method \Magento\Integration\Model\Resource\Oauth\Consumer getResource() + * @method \Magento\Integration\Model\Resource\Oauth\Consumer\Collection getCollection() + * @method \Magento\Integration\Model\Resource\Oauth\Consumer\Collection getResourceCollection() * @method string getName() - * @method \Magento\Oauth\Model\Consumer setName() setName(string $name) - * @method \Magento\Oauth\Model\Consumer setKey() setKey(string $key) - * @method \Magento\Oauth\Model\Consumer setSecret() setSecret(string $secret) - * @method \Magento\Oauth\Model\Consumer setCallbackUrl() setCallbackUrl(string $url) - * @method string getCreatedAt() - * @method \Magento\Oauth\Model\Consumer setCreatedAt() setCreatedAt(string $date) + * @method Consumer setName() setName(string $name) + * @method Consumer setKey() setKey(string $key) + * @method Consumer setSecret() setSecret(string $secret) + * @method Consumer setCallbackUrl() setCallbackUrl(string $url) + * @method Consumer setCreatedAt() setCreatedAt(string $date) * @method string getUpdatedAt() - * @method \Magento\Oauth\Model\Consumer setUpdatedAt() setUpdatedAt(string $date) + * @method Consumer setUpdatedAt() setUpdatedAt(string $date) * @method string getRejectedCallbackUrl() - * @method \Magento\Oauth\Model\Consumer setRejectedCallbackUrl() setRejectedCallbackUrl(string $rejectedCallbackUrl) - * @method string getHttpPostUrl() - * @method \Magento\Oauth\Model\Consumer setHttpPostUrl() setHttpPostUrl(string $httpPostUrl) + * @method Consumer setRejectedCallbackUrl() setRejectedCallbackUrl(string $rejectedCallbackUrl) */ -namespace Magento\Oauth\Model; - -class Consumer extends \Magento\Core\Model\AbstractModel +class Consumer extends \Magento\Core\Model\AbstractModel implements ConsumerInterface { - /** - * Key hash length - */ - const KEY_LENGTH = 32; - - /** - * Secret hash length - */ - const SECRET_LENGTH = 32; - /** * @var \Magento\Url\Validator */ - protected $urlValidator; + protected $_urlValidator; /** - * @var Consumer\Validator\KeyLengthFactory + * @var \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory */ - protected $keyLengthFactory; + protected $_keyLengthFactory; /** - * @param \Magento\Oauth\Model\Consumer\Validator\KeyLengthFactory $keyLengthFactory + * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory * @param \Magento\Url\Validator $urlValidator * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry @@ -77,7 +67,7 @@ class Consumer extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Oauth\Model\Consumer\Validator\KeyLengthFactory $keyLengthFactory, + \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, \Magento\Url\Validator $urlValidator, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, @@ -85,8 +75,8 @@ class Consumer extends \Magento\Core\Model\AbstractModel \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->keyLengthFactory = $keyLengthFactory; - $this->urlValidator = $urlValidator; + $this->_keyLengthFactory = $keyLengthFactory; + $this->_urlValidator = $urlValidator; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -98,13 +88,13 @@ class Consumer extends \Magento\Core\Model\AbstractModel protected function _construct() { parent::_construct(); - $this->_init('Magento\Oauth\Model\Resource\Consumer'); + $this->_init('Magento\Integration\Model\Resource\Oauth\Consumer'); } /** * BeforeSave actions * - * @return \Magento\Oauth\Model\Consumer + * @return Consumer */ protected function _beforeSave() { @@ -117,10 +107,7 @@ class Consumer extends \Magento\Core\Model\AbstractModel } /** - * Validate data - * - * @return array|bool - * @throw \Magento\Core\Exception|Exception Throw exception on fail validation + * {@inheritdoc} */ public function validate() { @@ -128,17 +115,17 @@ class Consumer extends \Magento\Core\Model\AbstractModel $this->setCallbackUrl(trim($this->getCallbackUrl())); $this->setRejectedCallbackUrl(trim($this->getRejectedCallbackUrl())); - if ($this->getCallbackUrl() && !$this->urlValidator->isValid($this->getCallbackUrl())) { + if ($this->getCallbackUrl() && !$this->_urlValidator->isValid($this->getCallbackUrl())) { throw new \Magento\Core\Exception(__('Invalid Callback URL')); } - if ($this->getRejectedCallbackUrl() && !$this->urlValidator->isValid($this->getRejectedCallbackUrl())) { + if ($this->getRejectedCallbackUrl() && !$this->_urlValidator->isValid($this->getRejectedCallbackUrl())) { throw new \Magento\Core\Exception(__('Invalid Rejected Callback URL')); } } - /** @var $validatorLength \Magento\Oauth\Model\Consumer\Validator\KeyLength */ - $validatorLength = $this->keyLengthFactory->create( - array('options' => array('length' => self::KEY_LENGTH)) + /** @var $validatorLength \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength */ + $validatorLength = $this->_keyLengthFactory->create( + array('options' => array('length' => \Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY)) ); $validatorLength->setName('Consumer Key'); @@ -147,7 +134,7 @@ class Consumer extends \Magento\Core\Model\AbstractModel throw new \Magento\Core\Exception(array_shift($messages)); } - $validatorLength->setLength(self::SECRET_LENGTH); + $validatorLength->setLength(\Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_SECRET); $validatorLength->setName('Consumer Secret'); if (!$validatorLength->isValid($this->getSecret())) { $messages = $validatorLength->getMessages(); @@ -157,10 +144,10 @@ class Consumer extends \Magento\Core\Model\AbstractModel } /** - * Load consumer by key. + * Load consumer data by consumer key. * * @param string $key - * @return \Magento\Oauth\Model\Consumer + * @return Consumer */ public function loadByKey($key) { @@ -168,9 +155,7 @@ class Consumer extends \Magento\Core\Model\AbstractModel } /** - * Get consumer key. - * - * @return string + * {@inheritdoc} */ public function getKey() { @@ -178,9 +163,7 @@ class Consumer extends \Magento\Core\Model\AbstractModel } /** - * Get consumer secret. - * - * @return string + * {@inheritdoc} */ public function getSecret() { @@ -188,12 +171,18 @@ class Consumer extends \Magento\Core\Model\AbstractModel } /** - * Get consumer callback URL. - * - * @return string + * {@inheritdoc} */ - public function getCallBackUrl() + public function getCallbackUrl() { return $this->getData('callback_url'); } + + /** + * {@inheritdoc} + */ + public function getCreatedAt() + { + return $this->getData('created_at'); + } } diff --git a/app/code/Magento/Oauth/Model/Consumer/Factory.php b/app/code/Magento/Integration/Model/Oauth/Consumer/Factory.php similarity index 87% rename from app/code/Magento/Oauth/Model/Consumer/Factory.php rename to app/code/Magento/Integration/Model/Oauth/Consumer/Factory.php index 2e4e285401e..8a9c70c2f03 100644 --- a/app/code/Magento/Oauth/Model/Consumer/Factory.php +++ b/app/code/Magento/Integration/Model/Oauth/Consumer/Factory.php @@ -23,7 +23,8 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Oauth\Model\Consumer; + +namespace Magento\Integration\Model\Oauth\Consumer; class Factory { @@ -44,11 +45,11 @@ class Factory * Create consumer model. * * @param array $data - * @return \Magento\Oauth\Model\Consumer + * @return \Magento\Integration\Model\Oauth\Consumer */ public function create(array $data = array()) { - $consumer = $this->_objectManager->create('Magento\Oauth\Model\Consumer', array()); + $consumer = $this->_objectManager->create('Magento\Integration\Model\Oauth\Consumer', array()); $consumer->setData($data); return $consumer; } diff --git a/app/code/Magento/Oauth/Model/Consumer/Validator/KeyLength.php b/app/code/Magento/Integration/Model/Oauth/Consumer/Validator/KeyLength.php similarity index 91% rename from app/code/Magento/Oauth/Model/Consumer/Validator/KeyLength.php rename to app/code/Magento/Integration/Model/Oauth/Consumer/Validator/KeyLength.php index e0091564603..5acac9c6598 100644 --- a/app/code/Magento/Oauth/Model/Consumer/Validator/KeyLength.php +++ b/app/code/Magento/Integration/Model/Oauth/Consumer/Validator/KeyLength.php @@ -31,7 +31,7 @@ * @package Magento_Oauth * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Oauth\Model\Consumer\Validator; +namespace Magento\Integration\Model\Oauth\Consumer\Validator; class KeyLength extends \Zend_Validate_StringLength { @@ -45,7 +45,7 @@ class KeyLength extends \Zend_Validate_StringLength /** * Sets validator options * - * @param integer|array|Zend_Config $options + * @param integer|array|\Zend_Config $options */ public function __construct($options = array()) { @@ -71,7 +71,7 @@ class KeyLength extends \Zend_Validate_StringLength /** * Init validation failure message template definitions * - * @return \Magento\Oauth\Model\Consumer\Validator\KeyLength + * @return \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength */ protected function _initMessageTemplates() { @@ -98,7 +98,7 @@ class KeyLength extends \Zend_Validate_StringLength * Set length * * @param $length - * @return \Magento\Oauth\Model\Consumer\Validator\KeyLength + * @return \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength */ public function setLength($length) { @@ -125,6 +125,7 @@ class KeyLength extends \Zend_Validate_StringLength * * @param string $value * @return boolean + * @throws \Exception */ public function isValid($value) { @@ -139,7 +140,7 @@ class KeyLength extends \Zend_Validate_StringLength * Set key name * * @param string $name - * @return \Magento\Oauth\Model\Consumer\Validator\KeyLength + * @return \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength */ public function setName($name) { diff --git a/app/code/Magento/Oauth/Model/Nonce.php b/app/code/Magento/Integration/Model/Oauth/Nonce.php similarity index 71% rename from app/code/Magento/Oauth/Model/Nonce.php rename to app/code/Magento/Integration/Model/Oauth/Nonce.php index a6e1a032d1a..15fcf0d959b 100644 --- a/app/code/Magento/Oauth/Model/Nonce.php +++ b/app/code/Magento/Integration/Model/Oauth/Nonce.php @@ -1,7 +1,5 @@ <?php /** - * Oauth Nonce Model - * * Magento * * NOTICE OF LICENSE @@ -22,29 +20,33 @@ * * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Model\Oauth; + +/** + * Nonce model * @author Magento Core Team <core@magentocommerce.com> * @method string getNonce() - * @method \Magento\Oauth\Model\Nonce setNonce() setNonce(string $nonce) + * @method \Magento\Integration\Model\Oauth\Nonce setNonce() setNonce(string $nonce) * @method int getConsumerId() - * @method \Magento\Oauth\Model\Nonce setConsumerId() setConsumerId(int $consumerId) + * @method \Magento\Integration\Model\Oauth\Nonce setConsumerId() setConsumerId(int $consumerId) * @method string getTimestamp() - * @method \Magento\Oauth\Model\Nonce setTimestamp() setTimestamp(string $timestamp) - * @method \Magento\Oauth\Model\Resource\Nonce getResource() - * @method \Magento\Oauth\Model\Resource\Nonce _getResource() + * @method \Magento\Integration\Model\Oauth\Nonce setTimestamp() setTimestamp(string $timestamp) + * @method \Magento\Integration\Model\Resource\Oauth\Nonce getResource() + * @method \Magento\Integration\Model\Resource\Oauth\Nonce _getResource() */ -namespace Magento\Oauth\Model; - class Nonce extends \Magento\Core\Model\AbstractModel { /** * Oauth data * - * @var \Magento\Oauth\Helper\Service + * @var \Magento\Integration\Helper\Oauth\Data */ - protected $_oauthData = null; + protected $_oauthData; /** - * @param \Magento\Oauth\Helper\Service $oauthData + * @param \Magento\Integration\Helper\Oauth\Data $oauthData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -52,15 +54,15 @@ class Nonce extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Oauth\Helper\Service $oauthData, + \Magento\Integration\Helper\Oauth\Data $oauthData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->_oauthData = $oauthData; parent::__construct($context, $registry, $resource, $resourceCollection, $data); + $this->_oauthData = $oauthData; } /** @@ -70,20 +72,20 @@ class Nonce extends \Magento\Core\Model\AbstractModel */ protected function _construct() { - $this->_init('Magento\Oauth\Model\Resource\Nonce'); + $this->_init('Magento\Integration\Model\Resource\Oauth\Nonce'); } /** * "After save" actions * - * @return \Magento\Oauth\Model\Nonce + * @return \Magento\Integration\Model\Oauth\Nonce */ protected function _afterSave() { parent::_afterSave(); if ($this->_oauthData->isCleanupProbability()) { - $this->_getResource()->deleteOldEntries($this->_oauthData->getCleanupExpirationPeriod()); + $this->getResource()->deleteOldEntries($this->_oauthData->getCleanupExpirationPeriod()); } return $this; } @@ -97,9 +99,8 @@ class Nonce extends \Magento\Core\Model\AbstractModel */ public function loadByCompositeKey($nonce, $consumerId) { - /** @var \Magento\Oauth\Model\Resource\Nonce $resource */ - $resource = $this->getResource(); - $this->setData($resource->selectByCompositeKey($nonce, $consumerId)); + $data = $this->getResource()->selectByCompositeKey($nonce, $consumerId); + $this->setData($data); return $this; } } diff --git a/app/code/Magento/Oauth/Model/Nonce/Factory.php b/app/code/Magento/Integration/Model/Oauth/Nonce/Factory.php similarity index 73% rename from app/code/Magento/Oauth/Model/Nonce/Factory.php rename to app/code/Magento/Integration/Model/Oauth/Nonce/Factory.php index 9addea0dbc3..460663040f7 100644 --- a/app/code/Magento/Oauth/Model/Nonce/Factory.php +++ b/app/code/Magento/Integration/Model/Oauth/Nonce/Factory.php @@ -4,7 +4,7 @@ * * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Oauth\Model\Nonce; +namespace Magento\Integration\Model\Oauth\Nonce; class Factory { @@ -25,10 +25,10 @@ class Factory * Create nonce model. * * @param array $arguments - * @return \Magento\Oauth\Model\Nonce + * @return \Magento\Integration\Model\Oauth\Nonce */ public function create($arguments = array()) { - return $this->_objectManager->create('Magento\Oauth\Model\Nonce', $arguments); + return $this->_objectManager->create('Magento\Integration\Model\Oauth\Nonce', $arguments); } } diff --git a/app/code/Magento/Integration/Model/Oauth/Nonce/Generator.php b/app/code/Magento/Integration/Model/Oauth/Nonce/Generator.php new file mode 100644 index 00000000000..03174d29524 --- /dev/null +++ b/app/code/Magento/Integration/Model/Oauth/Nonce/Generator.php @@ -0,0 +1,118 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Model\Oauth\Nonce; + +use Magento\Oauth\OauthInterface; +use Magento\Oauth\ConsumerInterface; +use Magento\Oauth\NonceGeneratorInterface; + +class Generator implements NonceGeneratorInterface +{ + /** @var \Magento\Oauth\Helper\Oauth */ + protected $_oauthHelper; + + /** @var \Magento\Integration\Model\Oauth\Nonce\Factory */ + protected $_nonceFactory; + + /** @var int */ + protected $_nonceLength; + + /** @var \Magento\Core\Model\Date */ + protected $_date; + + /** + * Possible time deviation for timestamp validation in seconds. + */ + const TIME_DEVIATION = 600; + + /** + * @param \Magento\Oauth\Helper\Oauth $oauthHelper + * @param \Magento\Integration\Model\Oauth\Nonce\Factory $nonceFactory + * @param \Magento\Core\Model\Date $date + * @param int $nonceLength - Length of the generated nonce + */ + public function __construct( + \Magento\Oauth\Helper\Oauth $oauthHelper, + \Magento\Integration\Model\Oauth\Nonce\Factory $nonceFactory, + \Magento\Core\Model\Date $date, + $nonceLength = \Magento\Oauth\Helper\Oauth::LENGTH_NONCE + ) { + $this->_oauthHelper = $oauthHelper; + $this->_nonceFactory = $nonceFactory; + $this->_date = $date; + $this->_nonceLength = $nonceLength; + } + + /** + * {@inheritdoc} + */ + public function generateNonce(ConsumerInterface $consumer = null) + { + return $this->_oauthHelper->generateRandomString($this->_nonceLength); + } + + /** + * {@inheritdoc} + */ + public function generateTimestamp() + { + return $this->_date->timestamp(); + } + + /** + * {@inheritdoc} + */ + public function validateNonce(ConsumerInterface $consumer, $nonce, $timestamp) + { + try { + $timestamp = (int)$timestamp; + if ($timestamp <= 0 || $timestamp > (time() + self::TIME_DEVIATION)) { + throw new \Magento\Oauth\Exception( + __('Incorrect timestamp value in the oauth_timestamp parameter'), + OauthInterface::ERR_TIMESTAMP_REFUSED + ); + } + + /** @var \Magento\Integration\Model\Oauth\Nonce $nonceObj */ + $nonceObj = $this->_nonceFactory->create()->loadByCompositeKey($nonce, $consumer->getId()); + + if ($nonceObj->getNonce()) { + throw new \Magento\Oauth\Exception( + __('The nonce is already being used by the consumer with ID %1', $consumer->getId()), + OauthInterface::ERR_NONCE_USED + ); + } + + $nonceObj->setNonce($nonce) + ->setConsumerId($consumer->getId()) + ->setTimestamp($timestamp) + ->save(); + } catch (\Magento\Oauth\Exception $exception) { + throw $exception; + } catch (\Exception $exception) { + throw new \Magento\Oauth\Exception(__('An error occurred validating the nonce')); + } + } +} diff --git a/app/code/Magento/Oauth/Model/Token.php b/app/code/Magento/Integration/Model/Oauth/Token.php similarity index 60% rename from app/code/Magento/Oauth/Model/Token.php rename to app/code/Magento/Integration/Model/Oauth/Token.php index 5239c3bfe57..d5cbe354c01 100644 --- a/app/code/Magento/Oauth/Model/Token.php +++ b/app/code/Magento/Integration/Model/Oauth/Token.php @@ -22,36 +22,37 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Oauth\Model; +namespace Magento\Integration\Model\Oauth; /** * oAuth token model * * @method string getName() Consumer name (joined from consumer table) - * @method \Magento\Oauth\Model\Resource\Token\Collection getCollection() - * @method \Magento\Oauth\Model\Resource\Token\Collection getResourceCollection() - * @method \Magento\Oauth\Model\Resource\Token getResource() - * @method \Magento\Oauth\Model\Resource\Token _getResource() + * @method \Magento\Integration\Model\Resource\Oauth\Token\Collection getCollection() + * @method \Magento\Integration\Model\Resource\Oauth\Token\Collection getResourceCollection() + * @method \Magento\Integration\Model\Resource\Oauth\Token getResource() + * @method \Magento\Integration\Model\Resource\Oauth\Token _getResource() * @method int getConsumerId() - * @method \Magento\Oauth\Model\Token setConsumerId() setConsumerId(int $consumerId) + * @method \Magento\Integration\Model\Oauth\Token setConsumerId() setConsumerId(int $consumerId) * @method int getAdminId() - * @method \Magento\Oauth\Model\Token setAdminId() setAdminId(int $adminId) + * @method \Magento\Integration\Model\Oauth\Token setAdminId() setAdminId(int $adminId) * @method int getCustomerId() - * @method \Magento\Oauth\Model\Token setCustomerId() setCustomerId(int $customerId) + * @method \Magento\Integration\Model\Oauth\Token setCustomerId() setCustomerId(int $customerId) * @method string getType() - * @method \Magento\Oauth\Model\Token setType() setType(string $type) + * @method \Magento\Integration\Model\Oauth\Token setType() setType(string $type) * @method string getCallbackUrl() - * @method \Magento\Oauth\Model\Token setCallbackUrl() setCallbackUrl(string $callbackUrl) + * @method \Magento\Integration\Model\Oauth\Token setCallbackUrl() setCallbackUrl(string $callbackUrl) * @method string getCreatedAt() - * @method \Magento\Oauth\Model\Token setCreatedAt() setCreatedAt(string $createdAt) + * @method \Magento\Integration\Model\Oauth\Token setCreatedAt() setCreatedAt(string $createdAt) * @method string getToken() - * @method \Magento\Oauth\Model\Token setToken() setToken(string $token) + * @method \Magento\Integration\Model\Oauth\Token setToken() setToken(string $token) * @method string getSecret() - * @method \Magento\Oauth\Model\Token setSecret() setSecret(string $tokenSecret) + * @method \Magento\Integration\Model\Oauth\Token setSecret() setSecret(string $tokenSecret) * @method int getRevoked() - * @method \Magento\Oauth\Model\Token setRevoked() setRevoked(int $revoked) + * @method \Magento\Integration\Model\Oauth\Token setRevoked() setRevoked(int $revoked) * @method int getAuthorized() - * @method \Magento\Oauth\Model\Token setAuthorized() setAuthorized(int $authorized) + * @method \Magento\Integration\Model\Oauth\Token setAuthorized() setAuthorized(int $authorized) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Token extends \Magento\Core\Model\AbstractModel { @@ -63,71 +64,65 @@ class Token extends \Magento\Core\Model\AbstractModel const TYPE_VERIFIER = 'verifier'; /**#@- */ - /**#@+ - * Lengths of token fields - */ - const LENGTH_TOKEN = 32; - const LENGTH_SECRET = 32; - const LENGTH_VERIFIER = 32; - /**#@- */ - /**#@+ * Customer types */ const USER_TYPE_ADMIN = 'admin'; const USER_TYPE_CUSTOMER = 'customer'; + /**#@- */ + + /** @var \Magento\Oauth\Helper\Oauth */ + protected $_oauthHelper; - /** @var \Magento\Oauth\Helper\Service */ + /** @var \Magento\Integration\Helper\Oauth\Data */ protected $_oauthData; - /** @var \Magento\Oauth\Model\Consumer\Factory */ + /** @var \Magento\Integration\Model\Oauth\Consumer\Factory */ protected $_consumerFactory; - /** - * @var \Magento\Url\Validator - */ - protected $urlValidator; + /** @var \Magento\Url\Validator */ + protected $_urlValidator; - /** - * @var Consumer\Validator\KeyLengthFactory - */ - protected $keyLengthFactory; + /** @var Consumer\Validator\KeyLengthFactory */ + protected $_keyLengthFactory; - /** - * @var \Magento\Stdlib\DateTime - */ - protected $dateTime; + /** @var \Magento\Stdlib\DateTime */ + protected $_dateTime; /** - * @param \Magento\Oauth\Model\Consumer\Validator\KeyLengthFactory $keyLengthFactory + * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory * @param \Magento\Url\Validator $urlValidator * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Oauth\Model\Consumer\Factory $consumerFactory - * @param \Magento\Oauth\Helper\Service $oauthData + * @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory + * @param \Magento\Integration\Helper\Oauth\Data $oauthData + * @param \Magento\Oauth\Helper\Oauth $oauthHelper * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Oauth\Model\Consumer\Validator\KeyLengthFactory $keyLengthFactory, + \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, \Magento\Url\Validator $urlValidator, \Magento\Stdlib\DateTime $dateTime, - \Magento\Oauth\Model\Consumer\Factory $consumerFactory, - \Magento\Oauth\Helper\Service $oauthData, + \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory, + \Magento\Integration\Helper\Oauth\Data $oauthData, + \Magento\Oauth\Helper\Oauth $oauthHelper, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->keyLengthFactory = $keyLengthFactory; - $this->urlValidator = $urlValidator; - $this->dateTime = $dateTime; parent::__construct($context, $registry, $resource, $resourceCollection, $data); + $this->_keyLengthFactory = $keyLengthFactory; + $this->_urlValidator = $urlValidator; + $this->_dateTime = $dateTime; $this->_consumerFactory = $consumerFactory; $this->_oauthData = $oauthData; + $this->_oauthHelper = $oauthHelper; } /** @@ -137,19 +132,19 @@ class Token extends \Magento\Core\Model\AbstractModel */ protected function _construct() { - $this->_init('Magento\Oauth\Model\Resource\Token'); + $this->_init('Magento\Integration\Model\Resource\Oauth\Token'); } /** * "After save" actions * - * @return \Magento\Oauth\Model\Token + * @return \Magento\Integration\Model\Oauth\Token */ protected function _afterSave() { parent::_afterSave(); - //Cleanup old entries + // Cleanup old entries if ($this->_oauthData->isCleanupProbability()) { $this->_getResource()->deleteOldEntries($this->_oauthData->getCleanupExpirationPeriod()); } @@ -160,21 +155,20 @@ class Token extends \Magento\Core\Model\AbstractModel * Generate an oauth_verifier for a consumer, if the consumer doesn't already have one. * * @param int $consumerId - The id of the consumer associated with the verifier to be generated. - * @return \Magento\Oauth\Model\Token + * @return \Magento\Integration\Model\Oauth\Token */ public function createVerifierToken($consumerId) { - $tokenData = $this->getResource() - ->selectTokenByType($consumerId, \Magento\Oauth\Model\Token::TYPE_VERIFIER); + $tokenData = $this->getResource()->selectTokenByType($consumerId, self::TYPE_VERIFIER); $this->setData($tokenData ? $tokenData : array()); if (!$this->getId()) { $this->setData(array( 'consumer_id' => $consumerId, - 'type' => \Magento\Oauth\Model\Token::TYPE_VERIFIER, - 'token' => $this->_oauthData->generateToken(), - 'secret' => $this->_oauthData->generateTokenSecret(), - 'verifier' => $this->_oauthData->generateVerifier(), - 'callback_url' => \Magento\Oauth\Helper\Service::CALLBACK_ESTABLISHED + 'type' => self::TYPE_VERIFIER, + 'token' => $this->_oauthHelper->generateToken(), + 'secret' => $this->_oauthHelper->generateTokenSecret(), + 'verifier' => $this->_oauthHelper->generateVerifier(), + 'callback_url' => \Magento\Oauth\Helper\Oauth::CALLBACK_ESTABLISHED )); $this->save(); } @@ -186,26 +180,26 @@ class Token extends \Magento\Core\Model\AbstractModel * * @param int $userId Authorization user identifier * @param string $userType Authorization user type - * @return \Magento\Oauth\Model\Token + * @return \Magento\Integration\Model\Oauth\Token * @throws \Magento\Oauth\Exception */ public function authorize($userId, $userType) { if (!$this->getId() || !$this->getConsumerId()) { - throw new \Magento\Oauth\Exception('Token is not ready to be authorized'); + throw new \Magento\Oauth\Exception(__('Token is not ready to be authorized')); } if ($this->getAuthorized()) { - throw new \Magento\Oauth\Exception('Token is already authorized'); + throw new \Magento\Oauth\Exception(__('Token is already authorized')); } if (self::USER_TYPE_ADMIN == $userType) { $this->setAdminId($userId); } elseif (self::USER_TYPE_CUSTOMER == $userType) { $this->setCustomerId($userId); } else { - throw new \Magento\Oauth\Exception('User type is unknown'); + throw new \Magento\Oauth\Exception(__('User type is unknown')); } - $this->setVerifier($this->_oauthData->generateVerifier()); + $this->setVerifier($this->_oauthHelper->generateVerifier()); $this->setAuthorized(1); $this->save(); @@ -217,18 +211,18 @@ class Token extends \Magento\Core\Model\AbstractModel /** * Convert token to access type * - * @return \Magento\Oauth\Model\Token + * @return \Magento\Integration\Model\Oauth\Token * @throws \Magento\Oauth\Exception */ public function convertToAccess() { - if (\Magento\Oauth\Model\Token::TYPE_REQUEST != $this->getType()) { - throw new \Magento\Oauth\Exception('Can not convert due to token is not request type'); + if (self::TYPE_REQUEST != $this->getType()) { + throw new \Magento\Oauth\Exception(__('Cannot convert to access token due to token is not request type')); } $this->setType(self::TYPE_ACCESS); - $this->setToken($this->_oauthData->generateToken()); - $this->setSecret($this->_oauthData->generateTokenSecret()); + $this->setToken($this->_oauthHelper->generateToken()); + $this->setSecret($this->_oauthHelper->generateTokenSecret()); $this->save(); return $this; @@ -239,15 +233,15 @@ class Token extends \Magento\Core\Model\AbstractModel * * @param int $entityId Token identifier * @param string $callbackUrl Callback URL - * @return \Magento\Oauth\Model\Token + * @return \Magento\Integration\Model\Oauth\Token */ public function createRequestToken($entityId, $callbackUrl) { $this->setData(array( 'entity_id' => $entityId, 'type' => self::TYPE_REQUEST, - 'token' => $this->_oauthData->generateToken(), - 'secret' => $this->_oauthData->generateTokenSecret(), + 'token' => $this->_oauthHelper->generateToken(), + 'secret' => $this->_oauthHelper->generateTokenSecret(), 'callback_url' => $callbackUrl )); $this->save(); @@ -268,7 +262,7 @@ class Token extends \Magento\Core\Model\AbstractModel } elseif ($this->getCustomerId()) { return self::USER_TYPE_CUSTOMER; } else { - throw new \Magento\Oauth\Exception('User type is unknown'); + throw new \Magento\Oauth\Exception(__('User type is unknown')); } } @@ -287,14 +281,14 @@ class Token extends \Magento\Core\Model\AbstractModel /** * Before save actions * - * @return \Magento\Oauth\Model\Consumer + * @return \Magento\Integration\Model\Oauth\Consumer */ protected function _beforeSave() { $this->validate(); if ($this->isObjectNew() && null === $this->getCreatedAt()) { - $this->setCreatedAt($this->dateTime->now()); + $this->setCreatedAt($this->_dateTime->now()); } parent::_beforeSave(); return $this; @@ -308,23 +302,23 @@ class Token extends \Magento\Core\Model\AbstractModel */ public function validate() { - if (\Magento\Oauth\Helper\Service::CALLBACK_ESTABLISHED != $this->getCallbackUrl() - && !$this->urlValidator->isValid($this->getCallbackUrl()) + if (\Magento\Oauth\Helper\Oauth::CALLBACK_ESTABLISHED != $this->getCallbackUrl() + && !$this->_urlValidator->isValid($this->getCallbackUrl()) ) { - $messages = $this->urlValidator->getMessages(); + $messages = $this->_urlValidator->getMessages(); throw new \Magento\Oauth\Exception(array_shift($messages)); } - /** @var $validatorLength \Magento\Oauth\Model\Consumer\Validator\KeyLength */ - $validatorLength = $this->keyLengthFactory->create(); - $validatorLength->setLength(self::LENGTH_SECRET); + /** @var $validatorLength \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength */ + $validatorLength = $this->_keyLengthFactory->create(); + $validatorLength->setLength(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_SECRET); $validatorLength->setName('Token Secret Key'); if (!$validatorLength->isValid($this->getSecret())) { $messages = $validatorLength->getMessages(); throw new \Magento\Oauth\Exception(array_shift($messages)); } - $validatorLength->setLength(self::LENGTH_TOKEN); + $validatorLength->setLength(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN); $validatorLength->setName('Token Key'); if (!$validatorLength->isValid($this->getToken())) { $messages = $validatorLength->getMessages(); @@ -332,7 +326,7 @@ class Token extends \Magento\Core\Model\AbstractModel } if (null !== ($verifier = $this->getVerifier())) { - $validatorLength->setLength(self::LENGTH_VERIFIER); + $validatorLength->setLength(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_VERIFIER); $validatorLength->setName('Verifier Key'); if (!$validatorLength->isValid($verifier)) { $messages = $validatorLength->getMessages(); @@ -345,7 +339,7 @@ class Token extends \Magento\Core\Model\AbstractModel /** * Get Token Consumer * - * @return \Magento\Oauth\Model\Consumer + * @return \Magento\Integration\Model\Oauth\Consumer */ public function getConsumer() { @@ -371,7 +365,7 @@ class Token extends \Magento\Core\Model\AbstractModel * Set the token's verifier. * * @param string $verifier - * @return \Magento\Oauth\Model\Token + * @return \Magento\Integration\Model\Oauth\Token */ public function setVerifier($verifier) { diff --git a/app/code/Magento/Oauth/Model/Token/Factory.php b/app/code/Magento/Integration/Model/Oauth/Token/Factory.php similarity index 73% rename from app/code/Magento/Oauth/Model/Token/Factory.php rename to app/code/Magento/Integration/Model/Oauth/Token/Factory.php index b9f3f0e5aa1..b237a46cfa2 100644 --- a/app/code/Magento/Oauth/Model/Token/Factory.php +++ b/app/code/Magento/Integration/Model/Oauth/Token/Factory.php @@ -4,7 +4,7 @@ * * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Oauth\Model\Token; +namespace Magento\Integration\Model\Oauth\Token; class Factory { @@ -25,10 +25,10 @@ class Factory * Create token model. * * @param array $arguments - * @return \Magento\Oauth\Model\Token + * @return \Magento\Integration\Model\Oauth\Token */ public function create($arguments = array()) { - return $this->_objectManager->create('Magento\Oauth\Model\Token', $arguments); + return $this->_objectManager->create('Magento\Integration\Model\Oauth\Token', $arguments); } } diff --git a/app/code/Magento/Integration/Model/Oauth/Token/Provider.php b/app/code/Magento/Integration/Model/Oauth/Token/Provider.php new file mode 100644 index 00000000000..c493b854217 --- /dev/null +++ b/app/code/Magento/Integration/Model/Oauth/Token/Provider.php @@ -0,0 +1,297 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Model\Oauth\Token; + +use Magento\Oauth\OauthInterface; +use Magento\Oauth\TokenProviderInterface; + +class Provider implements TokenProviderInterface +{ + /** @var \Magento\Integration\Model\Oauth\Consumer\Factory */ + protected $_consumerFactory; + + /** @var \Magento\Integration\Model\Oauth\Token\Factory */ + protected $_tokenFactory; + + /** @var \Magento\Integration\Helper\Oauth\Data */ + protected $_dataHelper; + + /** @var \Magento\Core\Model\Date */ + protected $_date; + + /** + * @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory + * @param \Magento\Integration\Model\Oauth\Token\Factory $tokenFactory + * @param \Magento\Integration\Helper\Oauth\Data $dataHelper + * @param \Magento\Core\Model\Date $date + */ + public function __construct( + \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory, + \Magento\Integration\Model\Oauth\Token\Factory $tokenFactory, + \Magento\Integration\Helper\Oauth\Data $dataHelper, + \Magento\Core\Model\Date $date + ) { + $this->_consumerFactory = $consumerFactory; + $this->_tokenFactory = $tokenFactory; + $this->_dataHelper = $dataHelper; + $this->_date = $date; + } + + /** + * {@inheritdoc} + */ + public function validateConsumer($consumer) + { + // Must use consumer within expiration period. + $consumerTS = strtotime($consumer->getCreatedAt()); + $expiry = $this->_dataHelper->getConsumerExpirationPeriod(); + if ($this->_date->timestamp() - $consumerTS > $expiry) { + throw new \Magento\Oauth\Exception( + __('Consumer key has expired'), OauthInterface::ERR_CONSUMER_KEY_INVALID); + } + return true; + } + + /** + * {@inheritdoc} + */ + public function createRequestToken($consumer) + { + $token = $this->_getTokenByConsumer($consumer->getId()); + if ($token->getType() != \Magento\Integration\Model\Oauth\Token::TYPE_VERIFIER) { + throw new \Magento\Oauth\Exception( + __('Cannot create request token because consumer token is not a verifier token'), + OauthInterface::ERR_TOKEN_REJECTED + ); + } + $requestToken = $token->createRequestToken($token->getId(), $consumer->getCallbackUrl()); + return array('oauth_token' => $requestToken->getToken(), 'oauth_token_secret' => $requestToken->getSecret()); + } + + /** + * {@inheritdoc} + */ + public function validateRequestToken($requestToken, $consumer, $oauthVerifier) + { + $token = $this->_getToken($requestToken); + + if (!$this->_isTokenAssociatedToConsumer($token, $consumer)) { + throw new \Magento\Oauth\Exception( + __('Request token is not associated with the specified consumer'), OauthInterface::ERR_TOKEN_REJECTED); + } + + // The pre-auth token has a value of "request" in the type when it is requested and created initially. + // In this flow (token flow) the token has to be of type "request" else its marked as reused. + if (\Magento\Integration\Model\Oauth\Token::TYPE_REQUEST != $token->getType()) { + throw new \Magento\Oauth\Exception(__('Token is already being used'), OauthInterface::ERR_TOKEN_USED); + } + + $this->_validateVerifierParam($oauthVerifier, $token->getVerifier()); + + return $token->getSecret(); + } + + /** + * {@inheritdoc} + */ + public function getAccessToken($consumer) + { + /** TODO: log the request token in dev mode since its not persisted. */ + $token = $this->_getTokenByConsumer($consumer->getId()); + if (\Magento\Integration\Model\Oauth\Token::TYPE_REQUEST != $token->getType()) { + throw new \Magento\Oauth\Exception( + __('Cannot get access token because consumer token is not a request token')); + } + $accessToken = $token->convertToAccess(); + return array('oauth_token' => $accessToken->getToken(), 'oauth_token_secret' => $accessToken->getSecret()); + } + + /** + * {@inheritdoc} + */ + public function validateAccessTokenRequest($accessToken, $consumer) + { + $token = $this->_getToken($accessToken); + + if (!$this->_isTokenAssociatedToConsumer($token, $consumer)) { + throw new \Magento\Oauth\Exception( + __('Token is not associated with the specified consumer'), OauthInterface::ERR_TOKEN_REJECTED); + } + if (\Magento\Integration\Model\Oauth\Token::TYPE_ACCESS != $token->getType()) { + throw new \Magento\Oauth\Exception( + __('Token is not an access token'), OauthInterface::ERR_TOKEN_REJECTED); + } + if ($token->getRevoked()) { + throw new \Magento\Oauth\Exception(__('Access token has been revoked'), OauthInterface::ERR_TOKEN_REVOKED); + } + + return $token->getSecret(); + } + + /** + * {@inheritdoc} + */ + public function validateAccessToken($accessToken) + { + $token = $this->_getToken($accessToken); + // Make sure a consumer is associated with the token. + $this->_getConsumer($token->getConsumerId()); + + if (\Magento\Integration\Model\Oauth\Token::TYPE_ACCESS != $token->getType()) { + throw new \Magento\Oauth\Exception(__('Token is not an access token'), OauthInterface::ERR_TOKEN_REJECTED); + } + + if ($token->getRevoked()) { + throw new \Magento\Oauth\Exception( + __('Access token has been revoked'), OauthInterface::ERR_TOKEN_REVOKED); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function validateOauthToken($oauthToken) + { + return strlen($oauthToken) == \Magento\Oauth\Helper\Oauth::LENGTH_TOKEN; + } + + /** + * {@inheritdoc} + */ + public function getConsumerByKey($consumerKey) + { + if (strlen($consumerKey) != \Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY) { + throw new \Magento\Oauth\Exception( + __('Consumer key is not the correct length'), OauthInterface::ERR_CONSUMER_KEY_REJECTED); + } + + $consumer = $this->_consumerFactory->create()->loadByKey($consumerKey); + + if (!$consumer->getId()) { + throw new \Magento\Oauth\Exception( + __('A consumer having the specified key does not exist'), OauthInterface::ERR_CONSUMER_KEY_REJECTED); + } + + return $consumer; + } + + /** + * Validate 'oauth_verifier' parameter. + * + * @param string $oauthVerifier + * @param string $tokenVerifier + * @throws \Magento\Oauth\Exception + */ + protected function _validateVerifierParam($oauthVerifier, $tokenVerifier) + { + if (!is_string($oauthVerifier)) { + throw new \Magento\Oauth\Exception(__('Verifier is invalid'), OauthInterface::ERR_VERIFIER_INVALID); + } + if (!$this->validateOauthToken($oauthVerifier)) { + throw new \Magento\Oauth\Exception( + __('Verifier is not the correct length'), OauthInterface::ERR_VERIFIER_INVALID); + } + if ($tokenVerifier != $oauthVerifier) { + throw new \Magento\Oauth\Exception( + __('Token verifier and verifier token do not match'), OauthInterface::ERR_VERIFIER_INVALID); + } + } + + /** + * Get consumer by consumer_id for a given token. + * + * @param $consumerId + * @return \Magento\Oauth\ConsumerInterface + * @throws \Magento\Oauth\Exception + */ + protected function _getConsumer($consumerId) + { + $consumer = $this->_consumerFactory->create()->load($consumerId); + + if (!$consumer->getId()) { + throw new \Magento\Oauth\Exception( + __('A consumer with the ID %1 does not exist', $consumerId), OauthInterface::ERR_TOKEN_REJECTED); + } + + return $consumer; + } + + /** + * Load token object and validate it. + * + * @param string $token + * @return \Magento\Integration\Model\Oauth\Token + * @throws \Magento\Oauth\Exception + */ + protected function _getToken($token) + { + if (!$this->validateOauthToken($token)) { + throw new \Magento\Oauth\Exception( + __('Token is not the correct length'), OauthInterface::ERR_TOKEN_REJECTED); + } + + $tokenObj = $this->_tokenFactory->create()->load($token, 'token'); + + if (!$tokenObj->getId()) { + throw new \Magento\Oauth\Exception( + __('Specified token does not exist'), OauthInterface::ERR_TOKEN_REJECTED); + } + + return $tokenObj; + } + + /** + * Load token object given a consumer Id. + * + * @param int $consumerId - The Id of the consumer. + * @return \Magento\Integration\Model\Oauth\Token + * @throws \Magento\Oauth\Exception + */ + protected function _getTokenByConsumer($consumerId) + { + $token = $this->_tokenFactory->create()->load($consumerId, 'consumer_id'); + + if (!$token->getId()) { + throw new \Magento\Oauth\Exception( + __('A token with consumer ID %1 does not exist', $consumerId), OauthInterface::ERR_TOKEN_REJECTED); + } + + return $token; + } + + /** + * Check if token belongs to the same consumer. + * + * @param $token \Magento\Integration\Model\Oauth\Token + * @param $consumer \Magento\Oauth\ConsumerInterface + * @return boolean + */ + protected function _isTokenAssociatedToConsumer($token, $consumer) + { + return $token->getConsumerId() == $consumer->getId(); + } +} diff --git a/app/code/Magento/Integration/Model/Resource/Integration.php b/app/code/Magento/Integration/Model/Resource/Integration.php index 65f2fa75337..9f6671a1b72 100644 --- a/app/code/Magento/Integration/Model/Resource/Integration.php +++ b/app/code/Magento/Integration/Model/Resource/Integration.php @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,28 +16,28 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Integration resource model - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Integration\Model\Resource; - -class Integration extends \Magento\Core\Model\Resource\Db\AbstractDb -{ - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - $this->_init('integration', 'integration_id'); - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Integration resource model + * + * @author Magento Core Team <core@magentocommerce.com> + */ +namespace Magento\Integration\Model\Resource; + +class Integration extends \Magento\Core\Model\Resource\Db\AbstractDb +{ + /** + * Initialize resource model + * + * @return void + */ + protected function _construct() + { + $this->_init('integration', 'integration_id'); + } +} diff --git a/app/code/Magento/Oauth/Model/Resource/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php similarity index 85% rename from app/code/Magento/Oauth/Model/Resource/Consumer.php rename to app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index d410bcf614a..21a4937a9d4 100644 --- a/app/code/Magento/Oauth/Model/Resource/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -22,19 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * OAuth Application resource model - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Oauth\Model\Resource; +namespace Magento\Integration\Model\Resource\Oauth; class Consumer extends \Magento\Core\Model\Resource\Db\AbstractDb { /** * @var \Magento\Stdlib\DateTime */ - protected $dateTime; + protected $_dateTime; /** * @param \Magento\Stdlib\DateTime $dateTime @@ -42,7 +37,7 @@ class Consumer extends \Magento\Core\Model\Resource\Db\AbstractDb */ public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\App\Resource $resource) { - $this->dateTime = $dateTime; + $this->_dateTime = $dateTime; parent::__construct($resource); } @@ -60,11 +55,11 @@ class Consumer extends \Magento\Core\Model\Resource\Db\AbstractDb * Set updated_at automatically before saving * * @param \Magento\Core\Model\AbstractModel $object - * @return \Magento\Oauth\Model\Resource\Consumer + * @return \Magento\Integration\Model\Resource\Oauth\Consumer */ public function _beforeSave(\Magento\Core\Model\AbstractModel $object) { - $object->setUpdatedAt($this->dateTime->formatDate(time())); + $object->setUpdatedAt($this->_dateTime->formatDate(time())); return parent::_beforeSave($object); } @@ -72,7 +67,7 @@ class Consumer extends \Magento\Core\Model\Resource\Db\AbstractDb * Delete all Nonce entries associated with the consumer * * @param \Magento\Core\Model\AbstractModel $object - * @return \Magento\Oauth\Model\Resource\Consumer + * @return \Magento\Integration\Model\Resource\Oauth\Consumer */ public function _afterDelete(\Magento\Core\Model\AbstractModel $object) { diff --git a/app/code/Magento/Oauth/Model/Resource/Consumer/Collection.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer/Collection.php similarity index 88% rename from app/code/Magento/Oauth/Model/Resource/Consumer/Collection.php rename to app/code/Magento/Integration/Model/Resource/Oauth/Consumer/Collection.php index 95abc53d5f0..f10b6eadae1 100644 --- a/app/code/Magento/Oauth/Model/Resource/Consumer/Collection.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer/Collection.php @@ -31,7 +31,7 @@ * @package Magento_Oauth * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Oauth\Model\Resource\Consumer; +namespace Magento\Integration\Model\Resource\Oauth\Consumer; class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { @@ -42,6 +42,6 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl */ protected function _construct() { - $this->_init('Magento\Oauth\Model\Consumer', 'Magento\Oauth\Model\Resource\Consumer'); + $this->_init('Magento\Integration\Model\Oauth\Consumer', 'Magento\Integration\Model\Resource\Oauth\Consumer'); } } diff --git a/app/code/Magento/Oauth/Model/Resource/Nonce.php b/app/code/Magento/Integration/Model/Resource/Oauth/Nonce.php similarity index 92% rename from app/code/Magento/Oauth/Model/Resource/Nonce.php rename to app/code/Magento/Integration/Model/Resource/Oauth/Nonce.php index 33fc9f2dc2f..4562eb21630 100644 --- a/app/code/Magento/Oauth/Model/Resource/Nonce.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Nonce.php @@ -27,11 +27,9 @@ /** * oAuth nonce resource model * - * @category Magento - * @package Magento_Oauth - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Oauth\Model\Resource; +namespace Magento\Integration\Model\Resource\Oauth; class Nonce extends \Magento\Core\Model\Resource\Db\AbstractDb { @@ -69,7 +67,7 @@ class Nonce extends \Magento\Core\Model\Resource\Db\AbstractDb * * @param string $nonce - The nonce string * @param int $consumerId - The consumer id - * @return array + * @return array - Array of data */ public function selectByCompositeKey($nonce, $consumerId) { @@ -78,7 +76,6 @@ class Nonce extends \Magento\Core\Model\Resource\Db\AbstractDb ->from($this->getMainTable()) ->where('nonce = ?', $nonce)->where('consumer_id = ?', $consumerId); $row = $adapter->fetchRow($select); - return $row ? $row : array(); } } diff --git a/app/code/Magento/Oauth/Model/Resource/Nonce/Collection.php b/app/code/Magento/Integration/Model/Resource/Oauth/Nonce/Collection.php similarity index 88% rename from app/code/Magento/Oauth/Model/Resource/Nonce/Collection.php rename to app/code/Magento/Integration/Model/Resource/Oauth/Nonce/Collection.php index a170730d618..f688ef6cd0a 100644 --- a/app/code/Magento/Oauth/Model/Resource/Nonce/Collection.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Nonce/Collection.php @@ -31,7 +31,7 @@ * @package Magento_Oauth * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Oauth\Model\Resource\Nonce; +namespace Magento\Integration\Model\Resource\Oauth\Nonce; class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { @@ -42,6 +42,6 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl */ protected function _construct() { - $this->_init('Magento\Oauth\Model\Nonce', 'Magento\Oauth\Model\Resource\Nonce'); + $this->_init('Magento\Integration\Model\Oauth\Nonce', 'Magento\Integration\Model\Resource\Oauth\Nonce'); } } diff --git a/app/code/Magento/Oauth/Model/Resource/Token.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php similarity index 86% rename from app/code/Magento/Oauth/Model/Resource/Token.php rename to app/code/Magento/Integration/Model/Resource/Oauth/Token.php index d7d55e33a24..9495ab1e796 100644 --- a/app/code/Magento/Oauth/Model/Resource/Token.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php @@ -26,19 +26,16 @@ /** * OAuth token resource model - * - * @category Magento - * @package Magento_Oauth - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Oauth\Model\Resource; + +namespace Magento\Integration\Model\Resource\Oauth; class Token extends \Magento\Core\Model\Resource\Db\AbstractDb { /** * @var \Magento\Stdlib\DateTime */ - protected $dateTime; + protected $_dateTime; /** * @param \Magento\Stdlib\DateTime $dateTime @@ -46,7 +43,7 @@ class Token extends \Magento\Core\Model\Resource\Db\AbstractDb */ public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\App\Resource $resource) { - $this->dateTime = $dateTime; + $this->_dateTime = $dateTime; parent::__construct($resource); } @@ -61,11 +58,11 @@ class Token extends \Magento\Core\Model\Resource\Db\AbstractDb /** * Clean up old authorized tokens for specified consumer-user pairs * - * @param \Magento\Oauth\Model\Token $exceptToken Token just created to exclude from delete + * @param \Magento\Integration\Model\Oauth\Token $exceptToken Token just created to exclude from delete * @throws \Magento\Core\Exception * @return int The number of affected rows */ - public function cleanOldAuthorizedTokensExcept(\Magento\Oauth\Model\Token $exceptToken) + public function cleanOldAuthorizedTokensExcept(\Magento\Integration\Model\Oauth\Token $exceptToken) { if (!$exceptToken->getId() || !$exceptToken->getAuthorized()) { throw new \Magento\Core\Exception('Invalid token to except'); @@ -100,8 +97,8 @@ class Token extends \Magento\Core\Model\Resource\Db\AbstractDb return $adapter->delete( $this->getMainTable(), $adapter->quoteInto( - 'type = "' . \Magento\Oauth\Model\Token::TYPE_REQUEST . '" AND created_at <= ?', - $this->dateTime->formatDate(time() - $minutes * 60) + 'type = "' . \Magento\Integration\Model\Oauth\Token::TYPE_REQUEST . '" AND created_at <= ?', + $this->_dateTime->formatDate(time() - $minutes * 60) ) ); } else { diff --git a/app/code/Magento/Oauth/Model/Resource/Token/Collection.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token/Collection.php similarity index 78% rename from app/code/Magento/Oauth/Model/Resource/Token/Collection.php rename to app/code/Magento/Integration/Model/Resource/Oauth/Token/Collection.php index 94c2ba88f74..fa63547007b 100644 --- a/app/code/Magento/Oauth/Model/Resource/Token/Collection.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token/Collection.php @@ -27,11 +27,9 @@ /** * OAuth token resource collection model * - * @category Magento - * @package Magento_Oauth - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Oauth\Model\Resource\Token; +namespace Magento\Integration\Model\Resource\Oauth\Token; class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { @@ -42,7 +40,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl */ protected function _construct() { - $this->_init('Magento\Oauth\Model\Token', 'Magento\Oauth\Model\Resource\Token'); + $this->_init('Magento\Integration\Model\Oauth\Token', 'Magento\Integration\Model\Resource\Oauth\Token'); } /** @@ -50,7 +48,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * * Method use for show applications list (token-consumer) * - * @return \Magento\Oauth\Model\Resource\Token\Collection + * @return \Magento\Integration\Model\Resource\Oauth\Token\Collection */ public function joinConsumerAsApplication() { @@ -68,7 +66,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * Add filter by admin ID * * @param int $adminId - * @return \Magento\Oauth\Model\Resource\Token\Collection + * @return \Magento\Integration\Model\Resource\Oauth\Token\Collection */ public function addFilterByAdminId($adminId) { @@ -80,7 +78,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * Add filter by customer ID * * @param int $customerId - * @return \Magento\Oauth\Model\Resource\Token\Collection + * @return \Magento\Integration\Model\Resource\Oauth\Token\Collection */ public function addFilterByCustomerId($customerId) { @@ -92,7 +90,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * Add filter by consumer ID * * @param int $consumerId - * @return \Magento\Oauth\Model\Resource\Token\Collection + * @return \Magento\Integration\Model\Resource\Oauth\Token\Collection */ public function addFilterByConsumerId($consumerId) { @@ -104,7 +102,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * Add filter by type * * @param string $type - * @return \Magento\Oauth\Model\Resource\Token\Collection + * @return \Magento\Integration\Model\Resource\Oauth\Token\Collection */ public function addFilterByType($type) { @@ -115,12 +113,12 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl /** * Add filter by ID * - * @param array|int $id - * @return \Magento\Oauth\Model\Resource\Token\Collection + * @param array|int $tokenId + * @return \Magento\Integration\Model\Resource\Oauth\Token\Collection */ - public function addFilterById($id) + public function addFilterById($tokenId) { - $this->addFilter('main_table.entity_id', array('in' => $id), 'public'); + $this->addFilter('main_table.entity_id', array('in' => $tokenId), 'public'); return $this; } @@ -128,7 +126,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * Add filter by "Is Revoked" status * * @param bool|int $flag - * @return \Magento\Oauth\Model\Resource\Token\Collection + * @return \Magento\Integration\Model\Resource\Oauth\Token\Collection */ public function addFilterByRevoked($flag) { diff --git a/app/code/Magento/Oauth/etc/adminhtml/system.xml b/app/code/Magento/Integration/etc/adminhtml/system.xml similarity index 98% rename from app/code/Magento/Oauth/etc/adminhtml/system.xml rename to app/code/Magento/Integration/etc/adminhtml/system.xml index 747cae31516..83d9a2f3b30 100644 --- a/app/code/Magento/Oauth/etc/adminhtml/system.xml +++ b/app/code/Magento/Integration/etc/adminhtml/system.xml @@ -28,7 +28,7 @@ <section id="oauth" translate="label" type="text" sortOrder="300" showInDefault="1" showInWebsite="1" showInStore="1"> <label>OAuth</label> <tab>service</tab> - <resource>Magento_Oauth::oauth</resource> + <resource>Magento_Integration::config_oauth</resource> <group id="cleanup" translate="label" type="text" sortOrder="300" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Cleanup Settings</label> <field id="cleanup_probability" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"> diff --git a/app/code/Magento/Oauth/etc/config.xml b/app/code/Magento/Integration/etc/config.xml similarity index 96% rename from app/code/Magento/Oauth/etc/config.xml rename to app/code/Magento/Integration/etc/config.xml index a42cd98b1d7..ce1056cfd66 100644 --- a/app/code/Magento/Oauth/etc/config.xml +++ b/app/code/Magento/Integration/etc/config.xml @@ -19,8 +19,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Oauth * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/Magento/Integration/etc/di.xml b/app/code/Magento/Integration/etc/di.xml index 74336eeea7c..15c3df5d0ff 100644 --- a/app/code/Magento/Integration/etc/di.xml +++ b/app/code/Magento/Integration/etc/di.xml @@ -25,4 +25,17 @@ --> <config> <preference for="Magento\Integration\Service\IntegrationV1Interface" type="Magento\Integration\Service\IntegrationV1" /> + <preference for="Magento\Oauth\ConsumerInterface" type="Magento\Integration\Model\Oauth\Consumer"/> + <preference for="Magento\Oauth\NonceGeneratorInterface" type="Magento\Integration\Model\Oauth\Nonce\Generator"/> + <preference for="Magento\Oauth\TokenProviderInterface" type="Magento\Integration\Model\Oauth\Token\Provider"/> + <type name="Magento\Integration\Model\Oauth\Nonce\Generator"> + <param name="date"> + <instance type="Magento\Core\Model\Date\Proxy"/> + </param> + </type> + <type name="Magento\Integration\Model\Oauth\Token\Provider"> + <param name="date"> + <instance type="Magento\Core\Model\Date\Proxy"/> + </param> + </type> </config> diff --git a/app/code/Magento/Oauth/etc/frontend/routes.xml b/app/code/Magento/Integration/etc/frontend/routes.xml similarity index 94% rename from app/code/Magento/Oauth/etc/frontend/routes.xml rename to app/code/Magento/Integration/etc/frontend/routes.xml index 6afeb512d30..db1d9d21a97 100644 --- a/app/code/Magento/Oauth/etc/frontend/routes.xml +++ b/app/code/Magento/Integration/etc/frontend/routes.xml @@ -26,7 +26,7 @@ <config> <router id="standard"> <route id="oauth" frontName="oauth"> - <module name="Magento_Oauth" /> + <module name="Magento_Integration" /> </route> </router> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/Integration/etc/module.xml b/app/code/Magento/Integration/etc/module.xml index 59c2b029079..a064c18a09c 100755 --- a/app/code/Magento/Integration/etc/module.xml +++ b/app/code/Magento/Integration/etc/module.xml @@ -26,6 +26,7 @@ <config> <module name="Magento_Integration" version="1.0.0.0" active="true"> <sequence> + <module name="Magento_Core"/> <module name="Magento_Adminhtml"/> </sequence> <depends> diff --git a/app/code/Magento/Oauth/i18n/de_DE.csv b/app/code/Magento/Integration/i18n/de_DE.csv similarity index 100% rename from app/code/Magento/Oauth/i18n/de_DE.csv rename to app/code/Magento/Integration/i18n/de_DE.csv diff --git a/app/code/Magento/Oauth/i18n/en_US.csv b/app/code/Magento/Integration/i18n/en_US.csv similarity index 100% rename from app/code/Magento/Oauth/i18n/en_US.csv rename to app/code/Magento/Integration/i18n/en_US.csv diff --git a/app/code/Magento/Oauth/i18n/es_ES.csv b/app/code/Magento/Integration/i18n/es_ES.csv similarity index 100% rename from app/code/Magento/Oauth/i18n/es_ES.csv rename to app/code/Magento/Integration/i18n/es_ES.csv diff --git a/app/code/Magento/Oauth/i18n/fr_FR.csv b/app/code/Magento/Integration/i18n/fr_FR.csv similarity index 100% rename from app/code/Magento/Oauth/i18n/fr_FR.csv rename to app/code/Magento/Integration/i18n/fr_FR.csv diff --git a/app/code/Magento/Oauth/i18n/nl_NL.csv b/app/code/Magento/Integration/i18n/nl_NL.csv similarity index 100% rename from app/code/Magento/Oauth/i18n/nl_NL.csv rename to app/code/Magento/Integration/i18n/nl_NL.csv diff --git a/app/code/Magento/Oauth/i18n/pt_BR.csv b/app/code/Magento/Integration/i18n/pt_BR.csv similarity index 100% rename from app/code/Magento/Oauth/i18n/pt_BR.csv rename to app/code/Magento/Integration/i18n/pt_BR.csv diff --git a/app/code/Magento/Oauth/i18n/zh_CN.csv b/app/code/Magento/Integration/i18n/zh_CN.csv similarity index 100% rename from app/code/Magento/Oauth/i18n/zh_CN.csv rename to app/code/Magento/Integration/i18n/zh_CN.csv diff --git a/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php b/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php index 61e93facc48..5159af92dee 100644 --- a/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php +++ b/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php @@ -1,6 +1,6 @@ <?php /** - * Upgrade script for integration table creation. + * Install script for integration table creation. * * Magento * @@ -28,6 +28,183 @@ $installer = $this; $installer->startSetup(); +/** + * Create table 'oauth_consumer' + */ +$table = $installer->getConnection() + ->newTable($installer->getTable('oauth_consumer')) + ->addColumn('entity_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Entity Id') + ->addColumn('created_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array( + 'nullable' => false, + 'default' => \Magento\DB\Ddl\Table::TIMESTAMP_INIT + ), 'Created At') + ->addColumn('updated_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array( + 'nullable' => true + ), 'Updated At') + ->addColumn('name', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array( + 'nullable' => false + ), 'Name of consumer') + ->addColumn('key', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY, array( + 'nullable' => false + ), 'Key code') + ->addColumn('secret', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_SECRET, array( + 'nullable' => false + ), 'Secret code') + ->addColumn('callback_url', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array(), 'Callback URL') + ->addColumn('rejected_callback_url', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array( + 'nullable' => false + ), 'Rejected callback URL') + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth_consumer'), + array('key'), + \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + array('key'), + array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth_consumer'), + array('secret'), + \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + array('secret'), + array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) + ->addIndex($installer->getIdxName('oauth_consumer', array('created_at')), array('created_at')) + ->addIndex($installer->getIdxName('oauth_consumer', array('updated_at')), array('updated_at')) + ->setComment('OAuth Consumers'); +$installer->getConnection()->createTable($table); + +/** + * Create table 'oauth_token' + */ +$table = $installer->getConnection() + ->newTable($installer->getTable('oauth_token')) + ->addColumn('entity_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( + 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, + ), 'Entity ID') + ->addColumn('consumer_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false + ), 'Consumer ID') + ->addColumn('admin_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => true + ), 'Admin user ID') + ->addColumn('customer_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => true + ), 'Customer user ID') + ->addColumn('type', \Magento\DB\Ddl\Table::TYPE_TEXT, 16, array( + 'nullable' => false + ), 'Token Type') + ->addColumn('token', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Helper\Oauth::LENGTH_TOKEN, array( + 'nullable' => false + ), 'Token') + ->addColumn('secret', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_SECRET, array( + 'nullable' => false + ), 'Token Secret') + ->addColumn('verifier', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_VERIFIER, array( + 'nullable' => true + ), 'Token Verifier') + ->addColumn('callback_url', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array( + 'nullable' => false + ), 'Token Callback URL') + ->addColumn('revoked', \Magento\DB\Ddl\Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => 0, + ), 'Is Token revoked') + ->addColumn('authorized', \Magento\DB\Ddl\Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => 0, + ), 'Is Token authorized') + ->addColumn('created_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array( + 'nullable' => false, + 'default' => \Magento\DB\Ddl\Table::TIMESTAMP_INIT + ), 'Token creation timestamp') + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth_token'), + array('consumer_id'), + \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX + ), + array('consumer_id'), + array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX)) + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth_token'), + array('token'), + \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + array('token'), + array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) + ->addForeignKey( + $installer->getFkName('oauth_token', 'admin_id', 'admin_user', 'user_id'), + 'admin_id', + $installer->getTable('admin_user'), + 'user_id', + \Magento\DB\Ddl\Table::ACTION_CASCADE, + \Magento\DB\Ddl\Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName('oauth_token', 'consumer_id', 'oauth_consumer', 'entity_id'), + 'consumer_id', + $installer->getTable('oauth_consumer'), + 'entity_id', + \Magento\DB\Ddl\Table::ACTION_CASCADE, + \Magento\DB\Ddl\Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName('oauth_token', 'customer_id', 'customer_entity', 'entity_id'), + 'customer_id', + $installer->getTable('customer_entity'), + 'entity_id', + \Magento\DB\Ddl\Table::ACTION_CASCADE, + \Magento\DB\Ddl\Table::ACTION_CASCADE) + ->setComment('OAuth Tokens'); +$installer->getConnection()->createTable($table); + +/** + * Create table 'oauth_nonce' + */ +$table = $installer->getConnection() + ->newTable($installer->getTable('oauth_nonce')) + ->addColumn('nonce', \Magento\DB\Ddl\Table::TYPE_TEXT, 32, array( + 'nullable' => false + ), 'Nonce String') + ->addColumn('timestamp', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, array( + 'unsigned' => true, + 'nullable' => false + ), 'Nonce Timestamp') + ->addColumn( + 'consumer_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false + ), 'Consumer ID') + ->addIndex( + $installer->getIdxName( + $installer->getTable('oauth_nonce'), + array('nonce', 'consumer_id'), + \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + array('nonce', 'consumer_id'), + array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) + ->addForeignKey( + $installer->getFkName('oauth_nonce', 'consumer_id', 'oauth_consumer', 'entity_id'), + 'consumer_id', + $installer->getTable('oauth_consumer'), + 'entity_id', + \Magento\DB\Ddl\Table::ACTION_CASCADE, + \Magento\DB\Ddl\Table::ACTION_CASCADE) + ->setComment('OAuth Nonce') + ->setOption('type', 'MyISAM'); +$installer->getConnection()->createTable($table); + $table = $installer->getConnection() ->newTable($installer->getTable('integration')) ->addColumn( diff --git a/app/code/Magento/Newsletter/etc/frontend/page_types.xml b/app/code/Magento/Newsletter/etc/frontend/page_types.xml new file mode 100644 index 00000000000..65ae89fad49 --- /dev/null +++ b/app/code/Magento/Newsletter/etc/frontend/page_types.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="newsletter_manage_index" label="Customer My Account Newsletter Subscriptions"/> +</page_types> diff --git a/app/code/Magento/Newsletter/view/frontend/layout/default.xml b/app/code/Magento/Newsletter/view/frontend/layout/default.xml index 9a30093906b..fcd852ac5f7 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/default.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/default.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="left"> - <block class="Magento\Newsletter\Block\Subscribe" name="newsletter_subscription" template="subscribe.phtml"/> + <referenceContainer name="footer"> + <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml b/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml index 8b568d45f27..49b19a5d883 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Newsletter Subscriptions" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceContainer name="my.account.wrapper"> + <referenceContainer name="content"> <block class="Magento\Customer\Block\Newsletter" name="customer_newsletter"> - <container name="customer.newsletter.form.before" as="form_before" label="Newsletter Subscription Form Before"/> + <container name="customer.newsletter.form.before" as="form_before" label="Newsletter Subscription Form Before" htmlTag="div" htmlClass="rewards"/> </block> </referenceContainer> </layout> diff --git a/app/code/Magento/Newsletter/view/frontend/subscribe.phtml b/app/code/Magento/Newsletter/view/frontend/subscribe.phtml index c09f08e78d6..c3e45339281 100644 --- a/app/code/Magento/Newsletter/view/frontend/subscribe.phtml +++ b/app/code/Magento/Newsletter/view/frontend/subscribe.phtml @@ -19,46 +19,44 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="block block-subscribe"> - <div class="block-title"> - <strong><span><?php echo __('Newsletter') ?></span></strong> - </div> - <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> - <div class="block-content"> - <div class="form-subscribe-header"> - <label for="newsletter"><?php echo __('Sign Up for Our Newsletter:') ?></label> - </div> - <div class="input-box"> - <input type="text" name="email" id="newsletter" - title="<?php echo __('Sign up for our newsletter') ?>" - value="<?php echo __('Enter your email address') ?>" - class="input-text" data-validate="{required:true, 'validate-email':true}"/> - </div> - <div class="actions"> - <button type="submit" title="<?php echo __('Subscribe') ?>" class="button"> - <span><span><?php echo __('Subscribe') ?></span></span></button> +<div class="block newsletter"> + <div class="title"><strong>Newsletter</strong></div> + <div class="content"> + <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> + <div class="field newsletter"> + <label class="label" for="newsletter"><?php echo __('Sign Up for Our Newsletter:') ?></label> + <div class="control"> + <input name="email" type="text" id="newsletter" + placeholder="<?php echo __('Enter your email address') ?>" + data-validate="{required:true, 'validate-email':true}"/> + </div> + <div class="actions"> + <button class="action subscribe" title="<?php echo __('Subscribe') ?>" type="submit"> + <span><?php echo __('Subscribe') ?></span> + </button> + </div> </div> - </div> - </form> - <script type="text/javascript"> - //<![CDATA[ - (function($) { - head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", - "<?php echo $this->getViewFileUrl('Magento_Newsletter::newsletter.js')?>", function() { - $('#newsletter').newsletter({ - formSelector: '#newsletter-validate-detail', - placeholder: '<?php echo __('Enter your email address') ?>' - }); - }); - })(jQuery); - //]]> - </script> + </form> + </div> </div> + +<script type="text/javascript"> + //<![CDATA[ + (function($) { + head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", + "<?php echo $this->getViewFileUrl('Magento_Newsletter::newsletter.js')?>", function() { + $('#newsletter').newsletter({ + formSelector: '#newsletter-validate-detail', + placeholder: '<?php echo __('Enter your email address') ?>' + }); + }); + })(jQuery); + //]]> +</script> diff --git a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer.php b/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer.php deleted file mode 100644 index 1dd23ca9f5b..00000000000 --- a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer.php +++ /dev/null @@ -1,49 +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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * OAuth consumers grid container block - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Oauth\Block\Adminhtml\Oauth; - -class Consumer extends \Magento\Backend\Block\Widget\Grid\Container -{ - /** - * Construct grid container - */ - protected function _construct() - { - parent::_construct(); - - $this->_blockGroup = 'Magento_Oauth'; - $this->_controller = 'adminhtml_oauth_consumer'; - $this->_headerText = __('Add-Ons'); - - if (!$this->_authorization->isAllowed('Magento_Oauth::consumer_edit')) { - $this->_removeButton('add'); - } - } -} diff --git a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php b/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php deleted file mode 100644 index bb1bdd43728..00000000000 --- a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php +++ /dev/null @@ -1,103 +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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * OAuth Consumer Edit Block - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Oauth\Block\Adminhtml\Oauth\Consumer; - -class Edit extends \Magento\Backend\Block\Widget\Form\Container -{ - /** Key used to store subscription data into the registry */ - const REGISTRY_KEY_CURRENT_CONSUMER = 'current_consumer'; - - /** Keys used to retrieve values from consumer data array */ - const DATA_ENTITY_ID = 'entity_id'; - - /** @var array $_consumerData */ - protected $_consumerData; - - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data - */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); - $this->_consumerData = $registry->registry(self::REGISTRY_KEY_CURRENT_CONSUMER); - if (!$this->_consumerData - || !$this->_consumerData[self::DATA_ENTITY_ID] - || !$this->_authorization->isAllowed('Magento_Oauth::consumer_delete') - ) { - $this->_removeButton('delete'); - } - } - - /** - * Construct edit page - */ - protected function _construct() - { - parent::_construct(); - $this->_objectId = 'id'; - $this->_blockGroup = 'Magento_Oauth'; - $this->_controller = 'adminhtml_oauth_consumer'; - - $this->_addButton('save_and_continue_edit', array( - 'label' => __('Save and Continue Edit'), - 'class' => 'save', - 'data_attribute' => array( - 'mage-init' => array( - 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form'), - ), - ), - ), 100); - - $this->_updateButton('save', 'label', __('Save')); - $this->_updateButton('save', 'id', 'save_button'); - $this->_updateButton('delete', 'label', __('Delete')); - } - - /** - * Get header text - * - * @return string - */ - public function getHeaderText() - { - if ($this->_consumerData[self::DATA_ENTITY_ID]) { - return __('Edit Add-On'); - } else { - return __('New Add-On'); - } - } -} diff --git a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit/Form.php b/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit/Form.php deleted file mode 100644 index d37f368ee77..00000000000 --- a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Edit/Form.php +++ /dev/null @@ -1,121 +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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * OAuth consumer edit form block - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Edit; - -class Form extends \Magento\Backend\Block\Widget\Form\Generic -{ - /** Key used to store consumer data into the registry */ - const REGISTRY_KEY_CURRENT_CONSUMER = 'current_consumer'; - - /** Keys used to retrieve values from subscription data array */ - const DATA_ENTITY_ID = 'entity_id'; - - /** - * Prepare form before rendering HTML - * - * @return \Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Edit\Form - */ - protected function _prepareForm() - { - $consumerData = $this->_coreRegistry->registry(self::REGISTRY_KEY_CURRENT_CONSUMER); - - $form = $this->_formFactory->create(array( - 'attributes' => array( - 'id' => 'edit_form', - 'action' => $this->getUrl('adminhtml/*/save', - $consumerData[self::DATA_ENTITY_ID] - ? array('id' => $consumerData[self::DATA_ENTITY_ID]) : array()), - 'method' => 'post' - )) - ); - - $fieldset = $form->addFieldset('consumer_fieldset', array( - 'legend' => __('Add-On Information'), 'class' => 'fieldset-wide' - )); - - if ($consumerData[self::DATA_ENTITY_ID]) { - $fieldset->addField( - 'id', 'hidden', array('name' => 'id', 'value' => $consumerData[self::DATA_ENTITY_ID])); - } - - $fieldset->addField('name', 'text', array( - 'name' => 'name', - 'label' => __('Name'), - 'title' => __('Name'), - 'required' => true - )); - - $fieldset->addField('key', 'text', array( - 'name' => 'key', - 'label' => __('Key'), - 'title' => __('Key'), - 'disabled' => true, - 'required' => true - )); - - $fieldset->addField('secret', 'text', array( - 'name' => 'secret', - 'label' => __('Secret'), - 'title' => __('Secret'), - 'disabled' => true, - 'required' => true - )); - - $fieldset->addField('callback_url', 'text', array( - 'name' => 'callback_url', - 'label' => __('Callback URL'), - 'title' => __('Callback URL'), - 'required' => false, - 'class' => 'validate-url', - )); - - $fieldset->addField('rejected_callback_url', 'text', array( - 'name' => 'rejected_callback_url', - 'label' => __('Rejected Callback URL'), - 'title' => __('Rejected Callback URL'), - 'required' => false, - 'class' => 'validate-url', - )); - - $fieldset->addField('http_post_url', 'text', array( - 'name' => 'http_post_url', - 'label' => __('Http Post URL'), - 'title' => __('Http Post URL'), - 'required' => true, - 'class' => 'validate-url' - )); - - $form->setUseContainer(true); - $form->setValues($consumerData); - $this->setForm($form); - - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php b/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php deleted file mode 100644 index 1ad491a445b..00000000000 --- a/app/code/Magento/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php +++ /dev/null @@ -1,146 +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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * OAuth Consumer grid block - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Oauth\Block\Adminhtml\Oauth\Consumer; - -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended -{ - /** @var \Magento\Oauth\Model\Consumer\Factory */ - private $_consumerFactory; - - /** - * Allow edit status - * - * @var bool - */ - protected $_editAllow = false; - - /** - * Internal constructor. Override _construct(), not __construct(). - * - * @param \Magento\Oauth\Model\Consumer\Factory $consumerFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Url $urlModel - * @param array $data - */ - public function __construct( - \Magento\Oauth\Model\Consumer\Factory $consumerFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); - $this->_consumerFactory = $consumerFactory; - } - - /** - * Internal constructor: override this in subclasses - */ - public function _construct() - { - parent::_construct(); - $this->setId('consumerGrid'); - $this->setSaveParametersInSession(true); - $this->setDefaultSort('entity_id')->setDefaultDir(\Magento\DB\Select::SQL_DESC); - $this->_editAllow = $this->_authorization->isAllowed('Magento_Oauth::consumer_edit'); - } - - /** - * Prepare collection - * - * @return \Magento\Backend\Block\Widget\Grid - */ - protected function _prepareCollection() - { - $collection = $this->_consumerFactory->create()->getCollection(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Prepare columns - * - * @return \Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Grid - */ - protected function _prepareColumns() - { - $this->addColumn('entity_id', array( - 'header' => __('ID'), - 'index' => 'entity_id', - 'align' => 'right', - 'width' => '50px' - )); - - $this->addColumn('name', array( - 'header' => __('Add-On Name'), - 'index' => 'name', - 'escape' => true - )); - - $this->addColumn('http_post_url', array( - 'header' => __('Http Post URL'), - 'index' => 'http_post_url', - )); - - $this->addColumn('created_at', array( - 'header' => __('Created'), - 'index' => 'created_at' - )); - - return parent::_prepareColumns(); - } - - /** - * Get grid URL - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('adminhtml/*/grid', array('_current' => true)); - } - - /** - * Get row URL - * - * @param \Magento\Oauth\Model\Consumer $row - * @return string|null - */ - public function getRowUrl($row) - { - if ($this->_editAllow) { - return $this->getUrl('adminhtml/*/edit', array('id' => $row->getId())); - } - return null; - } -} diff --git a/app/code/Magento/Oauth/Block/Authorize/AbstractAuthorize.php b/app/code/Magento/Oauth/Block/Authorize/AbstractAuthorize.php deleted file mode 100644 index 95f032508e1..00000000000 --- a/app/code/Magento/Oauth/Block/Authorize/AbstractAuthorize.php +++ /dev/null @@ -1,113 +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 Magento - * @package Magento_Oauth - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * OAuth abstract authorization block - * - * @category Magento - * @package Magento_Oauth - * @author Magento Core Team <core@magentocommerce.com> - * @method string getToken() - * @method \Magento\Oauth\Block\AbstractAuthorizeBase setToken() setToken(string $token) - * @method boolean getIsSimple() - * @method \Magento\Oauth\Block\Authorize\Button setIsSimple() setIsSimple(boolean $flag) - * @method boolean getHasException() - * @method \Magento\Oauth\Block\AbstractAuthorizeBase setIsException() setHasException(boolean $flag) - * @method boolean getVerifier() - * @method \Magento\Oauth\Block\AbstractAuthorizeBase setVerifier() setVerifier(string $verifier) - * @method boolean getIsLogged() - * @method \Magento\Oauth\Block\AbstractAuthorizeBase setIsLogged() setIsLogged(boolean $flag) - */ -namespace Magento\Oauth\Block\Authorize; - -abstract class AbstractAuthorize extends \Magento\Core\Block\Template -{ - /** - * Consumer model - * - * @var \Magento\Oauth\Model\Consumer - */ - protected $_consumer; - - /** - * @var \Magento\Oauth\Model\TokenFactory - */ - protected $tokenFactory; - - /** - * @param \Magento\Oauth\Model\TokenFactory $tokenFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param array $data - */ - public function __construct( - \Magento\Oauth\Model\TokenFactory $tokenFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, - array $data = array() - ) { - $this->tokenFactory = $tokenFactory; - parent::__construct($coreData, $context, $data); - } - - /** - * Get consumer instance by token value - * - * @return \Magento\Oauth\Model\Consumer - */ - public function getConsumer() - { - if (null === $this->_consumer) { - /** @var $token \Magento\Oauth\Model\Token */ - $token = $this->tokenFactory->create(); - $token->load($this->getToken(), 'token'); - $this->_consumer = $token->getConsumer(); - } - return $this->_consumer; - } - - /** - * Get absolute path to template - * - * Load template from adminhtml/default area flag is_simple is set - * - * @return string - */ - public function getTemplateFile() - { - if (!$this->getIsSimple()) { - return parent::getTemplateFile(); - } - - //load base template from admin area - $params = array( - '_relative' => true, - 'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, - 'package' => 'default' - ); - return $this->_viewFileSystem->getFilename($this->getTemplate(), $params); - } -} diff --git a/app/code/Magento/Oauth/Block/Customer/Token/ListToken.php b/app/code/Magento/Oauth/Block/Customer/Token/ListToken.php deleted file mode 100644 index b41a7ede1c6..00000000000 --- a/app/code/Magento/Oauth/Block/Customer/Token/ListToken.php +++ /dev/null @@ -1,196 +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 Magento - * @package Magento_Oauth - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - - -/** - * Customer My Applications list block - * - * @category Magento - * @package Magento_Oauth - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Oauth\Block\Customer\Token; - -class ListToken extends \Magento\Customer\Block\Account\Dashboard -{ - /** - * Collection model - * - * @var \Magento\Oauth\Model\Resource\Token\Collection - */ - protected $_collection; - - /** - * @var \Magento\Oauth\Model\TokenFactory - */ - protected $tokenFactory; - - /** - * @param \Magento\Oauth\Model\TokenFactory $tokenFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param array $data - */ - public function __construct( - \Magento\Oauth\Model\TokenFactory $tokenFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, - \Magento\Customer\Model\Session $customerSession, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - array $data = array() - ) { - $this->tokenFactory = $tokenFactory; - parent::__construct($coreData, $context, $customerSession, $subscriberFactory, $data); - } - - /** - * Prepare collection - */ - protected function _construct() - { - /** @var $collection \Magento\Oauth\Model\Resource\Token\Collection */ - $collection = $this->tokenFactory->create()->getCollection(); - $collection->joinConsumerAsApplication() - ->addFilterByType(\Magento\Oauth\Model\Token::TYPE_ACCESS) - ->addFilterByCustomerId($this->_customerSession->getCustomerId()); - $this->_collection = $collection; - } - - /** - * Get count of total records - * - * @return int - */ - public function count() - { - return $this->_collection->getSize(); - } - - /** - * Get toolbar html - * - * @return string - */ - public function getToolbarHtml() - { - return $this->getChildHtml('toolbar'); - } - - /** - * Prepare layout - * - * @return \Magento\Oauth\Block\Customer\Token\ListToken - */ - protected function _prepareLayout() - { - /** @var $toolbar \Magento\Page\Block\Html\Pager */ - $toolbar = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager', 'customer_token.toolbar'); - $toolbar->setCollection($this->_collection); - $this->setChild('toolbar', $toolbar); - parent::_prepareLayout(); - return $this; - } - - /** - * Get collection - * - * @return \Magento\Oauth\Model\Resource\Token\Collection - */ - public function getCollection() - { - return $this->_collection; - } - - /** - * Get link for update revoke status - * - * @param \Magento\Oauth\Model\Token $model - * @return string - */ - public function getUpdateRevokeLink(\Magento\Oauth\Model\Token $model) - { - return $this->_urlBuilder->getUrl('oauth/customer_token/revoke/', - array('id' => $model->getId(), 'status' => (int) !$model->getRevoked())); - } - - /** - * Get delete link - * - * @param \Magento\Oauth\Model\Token $model - * @return string - */ - public function getDeleteLink(\Magento\Oauth\Model\Token $model) - { - return $this->_urlBuilder->getUrl('oauth/customer_token/delete/', array('id' => $model->getId())); - } - - /** - * Retrieve a token status label - * - * @param int $revokedStatus Token status of revoking - * @return string - */ - public function getStatusLabel($revokedStatus) - { - $labels = array( - __('Enabled'), - __('Disabled') - ); - return $labels[$revokedStatus]; - } - - /** - * Retrieve a label of link to change a token status - * - * @param int $revokedStatus Token status of revoking - * @return string - */ - public function getChangeStatusLabel($revokedStatus) - { - $labels = array( - __('Disable'), - __('Enable') - ); - return $labels[$revokedStatus]; - } - - /** - * Retrieve a message to confirm an action to change a token status - * - * @param int $revokedStatus Token status of revoking - * @return string - */ - public function getChangeStatusConfirmMessage($revokedStatus) - { - $messages = array( - __('Are you sure you want to disable this application?'), - __('Are you sure you want to enable this application?') - ); - return $messages[$revokedStatus]; - } -} diff --git a/app/code/Magento/Oauth/Controller/Adminhtml/Oauth/Consumer.php b/app/code/Magento/Oauth/Controller/Adminhtml/Oauth/Consumer.php deleted file mode 100644 index 1968d302e4a..00000000000 --- a/app/code/Magento/Oauth/Controller/Adminhtml/Oauth/Consumer.php +++ /dev/null @@ -1,353 +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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Manage consumers controller - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Oauth\Controller\Adminhtml\Oauth; - -class Consumer extends \Magento\Backend\Controller\AbstractAction -{ - /** Param Key for extracting consumer id from Request */ - const PARAM_CONSUMER_ID = 'id'; - - /** Data keys for extracting information from Consumer data array */ - const DATA_CONSUMER_ID = 'consumer_id'; - const DATA_ENTITY_ID = 'entity_id'; - const DATA_KEY = 'key'; - const DATA_SECRET = 'secret'; - const DATA_VERIFIER = 'oauth_verifier'; - - /** Keys used for registering data into the registry */ - const REGISTRY_KEY_CURRENT_CONSUMER = 'current_consumer'; - - /** Key use for storing/retrieving consumer data in/from the session */ - const SESSION_KEY_CONSUMER_DATA = 'consumer_data'; - - /** @var \Magento\Core\Model\Registry */ - private $_registry; - - /** @var \Magento\Oauth\Model\Consumer\Factory */ - private $_consumerFactory; - - /** @var \Magento\Oauth\Service\OauthV1Interface */ - private $_oauthService; - - /** @var \Magento\Oauth\Helper\Service */ - protected $_oauthHelper; - - /** @var \Magento\Logger */ - protected $_logger; - - /** - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Oauth\Helper\Service $oauthHelper - * @param \Magento\Oauth\Model\Consumer\Factory $consumerFactory - * @param \Magento\Oauth\Service\OauthV1Interface $oauthService - * @param \Magento\Logger $logger - * @param \Magento\Backend\Controller\Context $context - */ - public function __construct( - \Magento\Core\Model\Registry $registry, - \Magento\Oauth\Helper\Service $oauthHelper, - \Magento\Oauth\Model\Consumer\Factory $consumerFactory, - \Magento\Oauth\Service\OauthV1Interface $oauthService, - \Magento\Logger $logger, - \Magento\Backend\Controller\Context $context - ) { - parent::__construct($context); - $this->_registry = $registry; - $this->_oauthHelper = $oauthHelper; - $this->_consumerFactory = $consumerFactory; - $this->_oauthService = $oauthService; - $this->_logger = $logger; - } - - /** - * Perform layout initialization actions - * - * @return \Magento\Oauth\Controller\Adminhtml\Oauth\Consumer - */ - protected function _initAction() - { - $this->loadLayout()->_setActiveMenu('Magento_Oauth::system_oauth_consumer'); - return $this; - } - - /** - * Unset unused data from request - * Skip getting "key" and "secret" because its generated from server side only - * - * @param array $data - * @return array - */ - protected function _filter(array $data) - { - foreach (array(self::PARAM_CONSUMER_ID, self::DATA_KEY, self::DATA_SECRET, 'back', 'form_key') as $field) { - if (isset($data[$field])) { - unset($data[$field]); - } - } - return $data; - } - - /** - * Retrieve the consumer. - * - * @param int $consumerId - The ID of the consumer - * @return \Magento\Oauth\Model\Consumer - */ - protected function _fetchConsumer($consumerId) - { - $consumer = $this->_consumerFactory->create(); - - if (!$consumerId) { - $this->_getSession()->addError(__('Invalid ID parameter.')); - $this->_redirect('adminhtml/*/index'); - return $consumer; - } - - $consumer = $consumer->load($consumerId); - - if (!$consumer->getId()) { - $this->_getSession() - ->addError(__('An add-on with ID %1 was not found.', $consumerId)); - $this->_redirect('adminhtml/*/index'); - } - - return $consumer; - } - - /** - * Init titles - * - * @return \Magento\Oauth\Controller\Adminhtml\Oauth\Consumer - */ - public function preDispatch() - { - $this->_title(__('Add-Ons')); - parent::preDispatch(); - return $this; - } - - /** - * Render grid page - */ - public function indexAction() - { - $this->_initAction(); - $this->renderLayout(); - } - - /** - * Render grid AJAX request - */ - public function gridAction() - { - $this->loadLayout(); - $this->renderLayout(); - } - - /** - * Create new consumer action - */ - public function newAction() - { - $consumer = $this->_consumerFactory->create(); - - $formData = $this->_getFormData(); - if ($formData) { - $this->_setFormData($formData); - $consumer->addData($formData); - } else { - $consumer->setData(self::DATA_KEY, $this->_oauthHelper->generateConsumerKey()); - $consumer->setData(self::DATA_SECRET, $this->_oauthHelper->generateConsumerSecret()); - $this->_setFormData($consumer->getData()); - } - - $this->_registry->register(self::REGISTRY_KEY_CURRENT_CONSUMER, $consumer->getData()); - - $this->_initAction(); - $this->renderLayout(); - } - - /** - * Edit consumer action - */ - public function editAction() - { - $consumerId = (int)$this->getRequest()->getParam(self::PARAM_CONSUMER_ID); - $consumer = $this->_fetchConsumer($consumerId); - - $consumer->addData($this->_filter($this->getRequest()->getParams())); - $this->_registry->register(self::REGISTRY_KEY_CURRENT_CONSUMER, $consumer->getData()); - - $this->_initAction(); - $this->renderLayout(); - } - - /** - * Redirect either to edit an existing consumer or to add a new consumer. - * - * @param int|null $consumerId - A consumer id. - */ - private function _redirectToEditOrNew($consumerId) - { - if ($consumerId) { - $this->_redirect('adminhtml/*/edit', array(self::PARAM_CONSUMER_ID => $consumerId)); - } else { - $this->_redirect('adminhtml/*/new'); - } - } - - /** - * Save consumer action - */ - public function saveAction() - { - $consumerId = $this->getRequest()->getParam(self::PARAM_CONSUMER_ID); - if (!$this->_validateFormKey()) { - $this->_redirectToEditOrNew($consumerId); - return; - } - - $data = $this->_filter($this->getRequest()->getParams()); - - if ($consumerId) { - $data = array_merge($this->_fetchConsumer($consumerId)->getData(), $data); - } else { - $dataForm = $this->_getFormData(); - if ($dataForm) { - $data[self::DATA_KEY] = $dataForm[self::DATA_KEY]; - $data[self::DATA_SECRET] = $dataForm[self::DATA_SECRET]; - } else { - // If an admin started to create a new consumer and at this moment he has been edited an existing - // consumer, we save the new consumer with a new key-secret pair - $data[self::DATA_KEY] = $this->_oauthHelper->generateConsumerKey(); - $data[self::DATA_SECRET] = $this->_oauthHelper->generateConsumerSecret(); - } - } - - $verifier = array(); - try { - $consumerData = $this->_oauthService->createConsumer($data); - $consumerId = $consumerData[self::DATA_ENTITY_ID]; - $verifier = $this->_oauthService->postToConsumer(array(self::DATA_CONSUMER_ID => $consumerId)); - $this->_getSession()->addSuccess(__('The add-on has been saved.')); - $this->_setFormData(null); - } catch (\Magento\Core\Exception $e) { - $this->_setFormData($data); - $this->_getSession()->addError($this->_objectManager->get('Magento\Escaper')->escapeHtml($e->getMessage())); - $this->getRequest()->setParam('back', 'edit'); - } catch (\Exception $e) { - $this->_setFormData(null); - $this->_logger->logException($e); - $this->_getSession()->addError(__('An error occurred on saving consumer data.')); - } - - if ($this->getRequest()->getParam('back')) { - $this->_redirectToEditOrNew($consumerId); - } else if ($verifier[self::DATA_VERIFIER]) { - /** TODO: Complete when we have the Add-On website URL */ - //$this->_redirect('<Add-On Website URL>', array( - //'oauth_consumer_key' => $consumerData[self::DATA_KEY], - //'oauth_verifier' => $verifier[self::DATA_VERIFIER], - //'callback_url' => $this->getUrl('adminhtml/*/index') - //)); - $this->_redirect('adminhtml/*/index'); - } else { - $this->_redirect('adminhtml/*/index'); - } - } - - /** - * Check admin permissions for this controller - * - * @return boolean - */ - protected function _isAllowed() - { - $action = $this->getRequest()->getActionName(); - $resourceId = null; - - switch ($action) { - case 'delete': - $resourceId = 'Magento_Oauth::consumer_delete'; - break; - case 'new': - case 'save': - $resourceId = 'Magento_Oauth::consumer_edit'; - break; - default: - $resourceId = 'Magento_Oauth::consumer'; - break; - } - - return $this->_authorization->isAllowed($resourceId); - } - - /** - * Get form data - * - * @return array - */ - protected function _getFormData() - { - return $this->_getSession()->getData(self::SESSION_KEY_CONSUMER_DATA, true); - } - - /** - * Set form data - * - * @param $data - * @return \Magento\Oauth\Controller\Adminhtml\Oauth\Consumer - */ - protected function _setFormData($data) - { - $this->_getSession()->setData(self::SESSION_KEY_CONSUMER_DATA, $data); - return $this; - } - - /** - * Delete consumer action - */ - public function deleteAction() - { - $consumerId = (int) $this->getRequest()->getParam(self::PARAM_CONSUMER_ID); - if ($consumerId) { - try { - $this->_fetchConsumer($consumerId)->delete(); - $this->_getSession()->addSuccess(__('The add-on has been deleted.')); - } catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - } catch (\Exception $e) { - $this->_getSession() - ->addException($e, __('An error occurred while deleting the add-on.')); - } - } - $this->_redirect('adminhtml/*/index'); - } -} diff --git a/app/code/Magento/Oauth/Service/OauthV1.php b/app/code/Magento/Oauth/Service/OauthV1.php deleted file mode 100644 index 62886e5b155..00000000000 --- a/app/code/Magento/Oauth/Service/OauthV1.php +++ /dev/null @@ -1,626 +0,0 @@ -<?php -/** - * Web API Oauth Service. - * - * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -/** - * Class \Magento\Oauth\Service\OauthV1 - */ -namespace Magento\Oauth\Service; - -class OauthV1 implements \Magento\Oauth\Service\OauthV1Interface -{ - /** - * Possible time deviation for timestamp validation in sec. - */ - const TIME_DEVIATION = 600; - - /** - * Consumer xpath settings - */ - const XML_PATH_CONSUMER_EXPIRATION_PERIOD = 'oauth/consumer/expiration_period'; - - /** - * Consumer expiration period in seconds - */ - const CONSUMER_EXPIRATION_PERIOD_DEFAULT = 300; - - /** - * Consumer HTTP POST maxredirects xpath - */ - const XML_PATH_CONSUMER_POST_MAXREDIRECTS = 'oauth/consumer/post_maxredirects'; - - /** - * Consumer HTTPS POST maxredirects default - */ - const CONSUMER_POST_MAXREDIRECTS = 0; - - /** - * Consumer HTTP TIMEOUT xpath - */ - const XML_PATH_CONSUMER_POST_TIMEOUT = 'oauth/consumer/post_timeout'; - - /** - * Consumer HTTP TIMEOUT default - */ - const CONSUMER_POST_TIMEOUT = 5; - - /** @var \Magento\Oauth\Model\Consumer\Factory */ - private $_consumerFactory; - - /** @var \Magento\Oauth\Model\Nonce\Factory */ - private $_nonceFactory; - - /** @var \Magento\Oauth\Model\Token\Factory */ - private $_tokenFactory; - - /** @var \Magento\Core\Model\StoreManagerInterface */ - protected $_storeManager; - - /** @var \Magento\HTTP\ZendClient */ - protected $_httpClient; - - /** @var \Zend_Oauth_Http_Utility */ - protected $_httpUtility; - - /** @var \Magento\Core\Model\Date */ - protected $_date; - - /** - * @param \Magento\Oauth\Model\Consumer\Factory $consumerFactory - * @param \Magento\Oauth\Model\Nonce\Factory $nonceFactory - * @param \Magento\Oauth\Model\Token\Factory $tokenFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\HTTP\ZendClient $httpClient - * @param \Zend_Oauth_Http_Utility $httpUtility - * @param \Magento\Core\Model\Date $date - */ - public function __construct( - \Magento\Oauth\Model\Consumer\Factory $consumerFactory, - \Magento\Oauth\Model\Nonce\Factory $nonceFactory, - \Magento\Oauth\Model\Token\Factory $tokenFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\HTTP\ZendClient $httpClient, - \Zend_Oauth_Http_Utility $httpUtility, - \Magento\Core\Model\Date $date - ) { - $this->_consumerFactory = $consumerFactory; - $this->_nonceFactory = $nonceFactory; - $this->_tokenFactory = $tokenFactory; - $this->_storeManager = $storeManager; - $this->_httpClient = $httpClient; - $this->_httpUtility = $httpUtility; - $this->_date = $date; - } - - /** - * Retrieve array of supported signature methods. - * - * @return array - Supported HMAC-SHA1 and HMAC-SHA256 signature methods. - */ - public static function getSupportedSignatureMethods() - { - return array(self::SIGNATURE_SHA1, self::SIGNATURE_SHA256); - } - - /** - * {@inheritdoc} - */ - public function createConsumer($consumerData) - { - try { - $consumer = $this->_consumerFactory->create($consumerData); - $consumer->save(); - return $consumer->getData(); - } catch (\Magento\Core\Exception $exception) { - throw $exception; - } catch (\Exception $exception) { - throw new \Magento\Oauth\Exception(__('Unexpected error. Unable to create OAuth Consumer account.')); - } - } - - /** - * {@inheritdoc} - */ - public function postToConsumer($request) - { - try { - $consumerData = $this->_getConsumer($request['consumer_id'])->getData(); - $storeBaseUrl = $this->_storeManager->getStore()->getBaseUrl(); - $verifier = $this->_tokenFactory->create()->createVerifierToken($request['consumer_id']); - $this->_httpClient->setUri($consumerData['http_post_url']); - $this->_httpClient->setParameterPost( - array( - 'oauth_consumer_key' => $consumerData['key'], - 'oauth_consumer_secret' => $consumerData['secret'], - 'store_base_url' => $storeBaseUrl, - 'oauth_verifier' => $verifier->getVerifier() - ) - ); - $maxredirects = $this->_getConfigValue( - self::XML_PATH_CONSUMER_POST_MAXREDIRECTS, - self::CONSUMER_POST_MAXREDIRECTS - ); - $timeout = $this->_getConfigValue( - self::XML_PATH_CONSUMER_POST_TIMEOUT, - self::CONSUMER_POST_TIMEOUT - ); - $this->_httpClient->setConfig(array('maxredirects' => $maxredirects, 'timeout' => $timeout)); - $this->_httpClient->request(\Magento\HTTP\ZendClient::POST); - return array('oauth_verifier' => $verifier->getVerifier()); - } catch (\Magento\Core\Exception $exception) { - throw $exception; - } catch (\Exception $exception) { - throw new \Magento\Oauth\Exception(__('Unexpected error. Unable to post data to consumer.')); - } - } - - /** - * {@inheritdoc} - */ - public function getRequestToken($signedRequest) - { - $this->_validateVersionParam($signedRequest['oauth_version']); - $consumer = $this->_getConsumerByKey($signedRequest['oauth_consumer_key']); - // must use consumer within expiration period - $consumerTS = strtotime($consumer->getCreatedAt()); - $expiry = $this->_getConfigValue( - self::XML_PATH_CONSUMER_EXPIRATION_PERIOD, - self::CONSUMER_EXPIRATION_PERIOD_DEFAULT - ); - if ($this->_date->timestamp() - $consumerTS > $expiry) { - throw new \Magento\Oauth\Exception('', self::ERR_CONSUMER_KEY_INVALID); - } - $this->_validateNonce($signedRequest['oauth_nonce'], $consumer->getId(), $signedRequest['oauth_timestamp']); - $token = $this->_getTokenByConsumer($consumer->getId()); - if ($token->getType() != \Magento\Oauth\Model\Token::TYPE_VERIFIER) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - $this->_validateSignature( - $signedRequest, - $consumer->getSecret(), - $signedRequest['http_method'], - $signedRequest['request_url'] - ); - $requestToken = $token->createRequestToken($token->getId(), $consumer->getCallBackUrl()); - return array('oauth_token' => $requestToken->getToken(), 'oauth_token_secret' => $requestToken->getSecret()); - } - - /** - * TODO: log the request token in dev mode since its not persisted - * - * {@inheritdoc} - */ - public function getAccessToken($request) - { - $required = array( - 'oauth_consumer_key', - 'oauth_signature', - 'oauth_signature_method', - 'oauth_nonce', - 'oauth_timestamp', - 'oauth_token', - 'oauth_verifier', - 'request_url', - 'http_method', - ); - - // Make generic validation of request parameters - $this->_validateProtocolParams($request, $required); - - $oauthToken = $request['oauth_token']; - $requestUrl = $request['request_url']; - $httpMethod = $request['http_method']; - $consumerKeyParam = $request['oauth_consumer_key']; - - $consumer = $this->_getConsumerByKey($consumerKeyParam); - $token = $this->_getToken($oauthToken); - - if (!$this->_isTokenAssociatedToConsumer($token, $consumer)) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - - // The pre-auth token has a value of "request" in the type when it is requested and created initially. - // In this flow (token flow) the token has to be of type "request" else its marked as reused. - if (\Magento\Oauth\Model\Token::TYPE_REQUEST != $token->getType()) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_USED); - } - - $this->_validateVerifierParam($request['oauth_verifier'], $token->getVerifier()); - - $this->_validateSignature( - $request, - $consumer->getSecret(), - $httpMethod, - $requestUrl, - $token->getSecret() - ); - - $accessToken = $token->convertToAccess(); - return array('oauth_token' => $accessToken->getToken(), 'oauth_token_secret' => $accessToken->getSecret()); - } - - /** - * {@inheritdoc} - */ - public function validateAccessTokenRequest($request) - { - $required = array( - 'oauth_consumer_key', - 'oauth_signature', - 'oauth_signature_method', - 'oauth_nonce', - 'oauth_timestamp', - 'oauth_token', - 'http_method', - 'request_url', - ); - - // make generic validation of request parameters - $this->_validateProtocolParams($request, $required); - - $oauthToken = $request['oauth_token']; - $requestUrl = $request['request_url']; - $httpMethod = $request['http_method']; - $consumerKey = $request['oauth_consumer_key']; - - $consumer = $this->_getConsumerByKey($consumerKey); - $token = $this->_getToken($oauthToken); - - if (!$this->_isTokenAssociatedToConsumer($token, $consumer)) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - - if (\Magento\Oauth\Model\Token::TYPE_ACCESS != $token->getType()) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - if ($token->getRevoked()) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REVOKED); - } - - $this->_validateSignature( - $request, - $consumer->getSecret(), - $httpMethod, - $requestUrl, - $token->getSecret() - ); - - // If no exceptions were raised return as a valid token - return array('isValid' => true); - } - - /** - * {@inheritdoc} - */ - public function validateAccessToken($request) - { - $token = $this->_getToken($request['token']); - - //Make sure a consumer is associated with the token - $this->_getConsumer($token->getConsumerId()); - - if (\Magento\Oauth\Model\Token::TYPE_ACCESS != $token->getType()) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - if ($token->getRevoked()) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REVOKED); - } - - return array('isValid' => true); - } - - - /** - * Validate (oauth_nonce) Nonce string. - * - * @param string $nonce - Nonce string - * @param int $consumerId - Consumer Id (Entity Id) - * @param string|int $timestamp - Unix timestamp - * @throws \Magento\Oauth\Exception - */ - protected function _validateNonce($nonce, $consumerId, $timestamp) - { - try { - $timestamp = (int)$timestamp; - if ($timestamp <= 0 || $timestamp > (time() + self::TIME_DEVIATION)) { - throw new \Magento\Oauth\Exception( - __('Incorrect timestamp value in the oauth_timestamp parameter.'), - self::ERR_TIMESTAMP_REFUSED - ); - } - - $nonceObj = $this->_getNonce($nonce, $consumerId); - - if ($nonceObj->getConsumerId()) { - throw new \Magento\Oauth\Exception( - __('The nonce is already being used by the consumer with id %1.', $consumerId), - self::ERR_NONCE_USED - ); - } - - $consumer = $this->_getConsumer($consumerId); - - if ($nonceObj->getTimestamp() == $timestamp) { - throw new \Magento\Oauth\Exception( - __('The nonce/timestamp combination has already been used.'), - self::ERR_NONCE_USED); - } - - $nonceObj->setNonce($nonce) - ->setConsumerId($consumer->getId()) - ->setTimestamp($timestamp) - ->save(); - } catch (\Magento\Oauth\Exception $exception) { - throw $exception; - } catch (\Exception $exception) { - throw new \Magento\Oauth\Exception(__('An error occurred validating the nonce.')); - } - } - - /** - * Validate 'oauth_verifier' parameter - * - * @param string $verifier - * @param string $verifierFromToken - * @throws \Magento\Oauth\Exception - */ - protected function _validateVerifierParam($verifier, $verifierFromToken) - { - if (!is_string($verifier)) { - throw new \Magento\Oauth\Exception('', self::ERR_VERIFIER_INVALID); - } - if (strlen($verifier) != \Magento\Oauth\Model\Token::LENGTH_VERIFIER) { - throw new \Magento\Oauth\Exception('', self::ERR_VERIFIER_INVALID); - } - if ($verifierFromToken != $verifier) { - throw new \Magento\Oauth\Exception('', self::ERR_VERIFIER_INVALID); - } - } - - /** - * Validate signature based on the signature method used - * - * @param array $params - * @param string $consumerSecret - * @param string $httpMethod - * @param string $requestUrl - * @param string $tokenSecret - * @throws \Magento\Oauth\Exception - */ - protected function _validateSignature($params, $consumerSecret, $httpMethod, $requestUrl, $tokenSecret = null) - { - if (!in_array($params['oauth_signature_method'], self::getSupportedSignatureMethods())) { - throw new \Magento\Oauth\Exception('', self::ERR_SIGNATURE_METHOD_REJECTED); - } - - $allowedSignParams = $params; - //unset unused signature parameters - unset($allowedSignParams['oauth_signature']); - unset($allowedSignParams['http_method']); - unset($allowedSignParams['request_url']); - - $calculatedSign = $this->_httpUtility->sign( - $allowedSignParams, - $params['oauth_signature_method'], - $consumerSecret, - $tokenSecret, - $httpMethod, - $requestUrl - ); - - if ($calculatedSign != $params['oauth_signature']) { - throw new \Magento\Oauth\Exception( - 'Invalid signature.', self::ERR_SIGNATURE_INVALID); - } - } - - /** - * Validate oauth version - * - * @param string $version - * @throws \Magento\Oauth\Exception - */ - protected function _validateVersionParam($version) - { - // validate version if specified - if ('1.0' != $version) { - throw new \Magento\Oauth\Exception('', self::ERR_VERSION_REJECTED); - } - } - - /** - * Validate request and header parameters - * - * @param $protocolParams - * @param $requiredParams - * @throws \Magento\Oauth\Exception - */ - protected function _validateProtocolParams($protocolParams, $requiredParams) - { - // validate version if specified - if (isset($protocolParams['oauth_version']) && '1.0' != $protocolParams['oauth_version']) { - throw new \Magento\Oauth\Exception('', self::ERR_VERSION_REJECTED); - } - // required parameters validation. Default to minimum required params if not provided - if (empty($requiredParams)) { - $requiredParams = array( - "oauth_consumer_key", - "oauth_signature", - "oauth_signature_method", - "oauth_nonce", - "oauth_timestamp" - ); - } - $this->_checkRequiredParams($protocolParams, $requiredParams); - - if (isset($protocolParams['oauth_token']) && strlen( - $protocolParams['oauth_token'] - ) != \Magento\Oauth\Model\Token::LENGTH_TOKEN - ) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - - // validate signature method - if (!in_array($protocolParams['oauth_signature_method'], self::getSupportedSignatureMethods())) { - throw new \Magento\Oauth\Exception('', self::ERR_SIGNATURE_METHOD_REJECTED); - } - - $consumer = $this->_getConsumerByKey($protocolParams['oauth_consumer_key']); - - $this->_validateNonce($protocolParams['oauth_nonce'], $consumer->getId(), $protocolParams['oauth_timestamp']); - } - - /** - * Get consumer by consumer_id - * - * @param $consumerId - * @return \Magento\Oauth\Model\Consumer - * @throws \Magento\Oauth\Exception - */ - protected function _getConsumer($consumerId) - { - $consumer = $this->_consumerFactory->create()->load($consumerId); - - if (!$consumer->getId()) { - throw new \Magento\Oauth\Exception('', self::ERR_PARAMETER_REJECTED); - } - - return $consumer; - } - - /** - * Get a consumer from its key - * - * @param string $consumerKey to load - * @return \Magento\Oauth\Model\Consumer - * @throws \Magento\Oauth\Exception - */ - protected function _getConsumerByKey($consumerKey) - { - if (strlen($consumerKey) != \Magento\Oauth\Model\Consumer::KEY_LENGTH) { - throw new \Magento\Oauth\Exception('', self::ERR_CONSUMER_KEY_REJECTED); - } - - $consumer = $this->_consumerFactory->create()->loadByKey($consumerKey); - - if (!$consumer->getId()) { - throw new \Magento\Oauth\Exception('', self::ERR_CONSUMER_KEY_REJECTED); - } - - return $consumer; - } - - /** - * Load token object, validate it depending on request type, set access data and save - * - * @param string $token - * @return \Magento\Oauth\Model\Token - * @throws \Magento\Oauth\Exception - */ - protected function _getToken($token) - { - if (strlen($token) != \Magento\Oauth\Model\Token::LENGTH_TOKEN) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - - $tokenObj = $this->_tokenFactory->create()->load($token, 'token'); - - if (!$tokenObj->getId()) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - - return $tokenObj; - } - - /** - * Load token object given a consumer id - * - * @param int $consumerId - The id of the consumer - * @return \Magento\Oauth\Model\Token - * @throws \Magento\Oauth\Exception - */ - protected function _getTokenByConsumer($consumerId) - { - $token = $this->_tokenFactory->create()->load($consumerId, 'consumer_id'); - - if (!$token->getId()) { - throw new \Magento\Oauth\Exception('', self::ERR_TOKEN_REJECTED); - } - - return $token; - } - - /** - * Fetch nonce based on a composite key consisting of the nonce string and a consumer id. - * - * @param string $nonce - The nonce string - * @param int $consumerId - A consumer id - * @return \Magento\Oauth\Model\Nonce - */ - protected function _getNonce($nonce, $consumerId) - { - $nonceObj = $this->_nonceFactory->create()->loadByCompositeKey($nonce, $consumerId); - return $nonceObj; - } - - /** - * Check if token belongs to the same consumer - * - * @param $token \Magento\Oauth\Model\Token - * @param $consumer \Magento\Oauth\Model\Consumer - * @return boolean - */ - protected function _isTokenAssociatedToConsumer($token, $consumer) - { - return $token->getConsumerId() == $consumer->getId(); - } - - /** - * Check if mandatory OAuth parameters are present - * - * @param $protocolParams - * @param $requiredParams - * @return mixed - * @throws \Magento\Oauth\Exception - */ - protected function _checkRequiredParams($protocolParams, $requiredParams) - { - foreach ($requiredParams as $param) { - if (!isset($protocolParams[$param])) { - throw new \Magento\Oauth\Exception($param, self::ERR_PARAMETER_ABSENT); - } - } - } - - /** - * Get value from store configuration - * - * @return int - */ - protected function _getConfigValue($xpath, $default) - { - $value = (int)$this->_storeManager->getStore()->getConfig($xpath); - return $value > 0 ? $value : $default; - } -} diff --git a/app/code/Magento/Oauth/etc/schema/OauthV1.xsd b/app/code/Magento/Oauth/etc/schema/OauthV1.xsd deleted file mode 100644 index 44005096b88..00000000000 --- a/app/code/Magento/Oauth/etc/schema/OauthV1.xsd +++ /dev/null @@ -1,687 +0,0 @@ -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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. - - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://magento.com/oauthV1" xmlns="http://magento.com/oauthV1"> - - <xsd:complexType name="CreateConsumerRequest"> - <xsd:annotation> - <xsd:documentation/> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="name" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Add-On Name</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="key" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>OAuth Consumer Key</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:length>32</inf:length> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="secret" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>OAuth Consumer Secret</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:length>32</inf:length> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="http_post_url" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Add-On HTTP POST Url</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="CreateConsumerResponse"> - <xsd:annotation> - <xsd:documentation>Response container for the CreateConsumer call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="entity_id" type="xsd:integer"> - <xsd:annotation> - <xsd:documentation>Consumer Id</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="key" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>OAuth Consumer Key</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:length>32</inf:length> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="secret" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>OAuth Consumer Secret</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:length>32</inf:length> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="http_post_url" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Add-On HTTP Post URL</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:callInfo> - <inf:callName>CreateConsumer</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="PostToConsumerRequest"> - <xsd:annotation> - <xsd:documentation/> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="consumer_id" type="xsd:integer"> - <xsd:annotation> - <xsd:documentation>Consumer Id</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:callInfo> - <inf:callName>PostToConsumer</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="PostToConsumerResponse"> - <xsd:annotation> - <xsd:documentation>Response container for the PostToConsumer call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="oauth_verifier" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>OAuth Verifier Token</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:length>32</inf:length> - <inf:callInfo> - <inf:callName>PostToConsumer</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="GetRequestTokenRequest"> - <xsd:annotation> - <xsd:documentation>Request container for the GetRequestToken call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="oauth_consumer_key" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The Consumer Key value provided after the registration of the application.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_nonce" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>A random value, uniquely generated by the application.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_signature_method" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Name of the signature method used to sign the request. Can have one of the following values: HMAC-SHA256.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_signature" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Calculated signature based on the signature method specified.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_timestamp" type="xsd:integer"> - <xsd:annotation> - <xsd:documentation>a positive integer, expressed in the number of seconds since January 1, 1970 00:00:00 GMT.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_version" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The version of Oauth protocol being used.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="http_method" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>the HTTP method used for the call GET or POST</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="request_url" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The url of the current request</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="GetRequestTokenResponse"> - <xsd:annotation> - <xsd:documentation>Response container for the GetRequestToken call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="oauth_token" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The Access Token that provides access to protected resources.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:maxLength/> - <inf:callInfo> - <inf:callName>GetRequestToken</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_token_secret" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The secret that is associated with the Access Token.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:maxLength/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="GetAccessTokenRequest"> - <xsd:annotation> - <xsd:documentation>Response container for the GetAccessToken call</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="oauth_consumer_key" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The Consumer Key value provided after the registration of the application.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_token" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Request token obtained in first step of Oauth.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_verifier" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Verification code provided by Magento during Add on registration.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_nonce" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>A random value, uniquely generated by the application.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_signature_method" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Name of the signature method used to sign the request. Can have one of the following values: HMAC-SHA256.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_signature" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Calculated signature based on the signature method specified.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_timestamp" type="xsd:integer"> - <xsd:annotation> - <xsd:documentation>a positive integer, expressed in the number of seconds since January 1, 1970 00:00:00 GMT.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_version" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The version of Oauth protocol being used.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="http_method" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>the HTTP method used for the call GET or POST</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="request_url" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The url of the current request</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="GetAccessTokenResponse"> - <xsd:annotation> - <xsd:documentation>Response container for the GetAccessToken call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="oauth_token" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The Access Token that provides access to protected resources.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:maxLength/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_token_secret" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The secret that is associated with the Access Token.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:maxLength/> - <inf:callInfo> - <inf:callName>GetAccessToken</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="ValidateAccessTokenRequestRequest"> - <xsd:annotation> - <xsd:documentation>Request container for the ValidateAccessTokenRequest call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="oauth_consumer_key" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The Consumer Key value provided after the registration of the application.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_token" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Access token obtained in second step of Oauth.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_nonce" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>A random value, uniquely generated by the application.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_signature_method" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Name of the signature method used to sign the request. Can have one of the following values: HMAC-SHA256.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_signature" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>Calculated signature based on the signature method specified.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_timestamp" type="xsd:integer"> - <xsd:annotation> - <xsd:documentation>a positive integer, expressed in the number of seconds since January 1, 1970 00:00:00 GMT.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="oauth_version" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The version of Oauth protocol being used.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="http_method" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>the HTTP method used for the call GET or POST</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="request_url" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The url of the current request</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="ValidateAccessTokenRequestResponse"> - <xsd:annotation> - <xsd:documentation>Response container for the ValidateAccessTokenRequest call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="isValid" type="xsd:boolean"> - <xsd:annotation> - <xsd:documentation>True or false depending of the access token request validation.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:maxLength/> - <inf:callInfo> - <inf:callName>ValidateAccessTokenRequest</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="ValidateAccessTokenRequest"> - <xsd:annotation> - <xsd:documentation>Request container for the ValidateAccessToken call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="token" type="xsd:string"> - <xsd:annotation> - <xsd:documentation>The access token that needs to be validated.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:min/> - <inf:max/> - <inf:callInfo> - <inf:callName>ValidateAccessToken</inf:callName> - <inf:requiredInput>Yes</inf:requiredInput> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="ValidateAccessTokenResponse"> - <xsd:annotation> - <xsd:documentation>Response container for the ValidateAccessToken call.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"/> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="isValid" type="xsd:boolean"> - <xsd:annotation> - <xsd:documentation>True or false depending on the validity.</xsd:documentation> - <xsd:appinfo xmlns:inf="http://magento.ll/webapi/soap"> - <inf:maxLength/> - <inf:callInfo> - <inf:callName>ValidateAccessToken</inf:callName> - <inf:returned>Always</inf:returned> - </inf:callInfo> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - -</xsd:schema> diff --git a/app/code/Magento/Oauth/sql/oauth_setup/install-1.0.0.0.php b/app/code/Magento/Oauth/sql/oauth_setup/install-1.0.0.0.php deleted file mode 100644 index c795ca474dc..00000000000 --- a/app/code/Magento/Oauth/sql/oauth_setup/install-1.0.0.0.php +++ /dev/null @@ -1,198 +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 Magento - * @package Magento_Oauth - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -/** - * Installation of OAuth module tables - */ -/** @var $install \Magento\Core\Model\Resource\Setup */ -$installer = $this; - -$installer->startSetup(); - -/** @var $adapter \Magento\DB\Adapter\Pdo\Mysql */ -$adapter = $installer->getConnection(); - -/** - * Create table 'oauth_consumer' - */ -$table = $adapter->newTable($installer->getTable('oauth_consumer')) - ->addColumn('entity_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - ), 'Entity Id') - ->addColumn('created_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array( - 'nullable' => false, - 'default' => \Magento\DB\Ddl\Table::TIMESTAMP_INIT - ), 'Created At') - ->addColumn('updated_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array( - 'nullable' => true - ), 'Updated At') - ->addColumn('name', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array( - 'nullable' => false - ), 'Name of consumer') - ->addColumn('key', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Model\Consumer::KEY_LENGTH, array( - 'nullable' => false - ), 'Key code') - ->addColumn('secret', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Model\Consumer::SECRET_LENGTH, array( - 'nullable' => false - ), 'Secret code') - ->addColumn('callback_url', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array(), 'Callback URL') - ->addColumn('rejected_callback_url', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array( - 'nullable' => false - ), 'Rejected callback URL') - ->addIndex( - $installer->getIdxName( - $installer->getTable('oauth_consumer'), - array('key'), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - array('key'), - array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) - ->addIndex( - $installer->getIdxName( - $installer->getTable('oauth_consumer'), - array('secret'), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - array('secret'), - array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('oauth_consumer', array('created_at')), array('created_at')) - ->addIndex($installer->getIdxName('oauth_consumer', array('updated_at')), array('updated_at')) - ->setComment('OAuth Consumers'); -$adapter->createTable($table); - -/** - * Create table 'oauth_token' - */ -$table = $adapter->newTable($installer->getTable('oauth_token')) - ->addColumn('entity_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( - 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, - ), 'Entity ID') - ->addColumn('consumer_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( - 'unsigned' => true, - 'nullable' => false - ), 'Consumer ID') - ->addColumn('admin_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( - 'unsigned' => true, - 'nullable' => true - ), 'Admin user ID') - ->addColumn('customer_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( - 'unsigned' => true, - 'nullable' => true - ), 'Customer user ID') - ->addColumn('type', \Magento\DB\Ddl\Table::TYPE_TEXT, 16, array( - 'nullable' => false - ), 'Token Type') - ->addColumn('token', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Model\Token::LENGTH_TOKEN, array( - 'nullable' => false - ), 'Token') - ->addColumn('secret', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Model\Token::LENGTH_SECRET, array( - 'nullable' => false - ), 'Token Secret') - ->addColumn('verifier', \Magento\DB\Ddl\Table::TYPE_TEXT, \Magento\Oauth\Model\Token::LENGTH_VERIFIER, array( - 'nullable' => true - ), 'Token Verifier') - ->addColumn('callback_url', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array( - 'nullable' => false - ), 'Token Callback URL') - ->addColumn('revoked', \Magento\DB\Ddl\Table::TYPE_SMALLINT, null, array( - 'unsigned' => true, - 'nullable' => false, - 'default' => 0, - ), 'Is Token revoked') - ->addColumn('authorized', \Magento\DB\Ddl\Table::TYPE_SMALLINT, null, array( - 'unsigned' => true, - 'nullable' => false, - 'default' => 0, - ), 'Is Token authorized') - ->addColumn('created_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array( - 'nullable' => false, - 'default' => \Magento\DB\Ddl\Table::TIMESTAMP_INIT - ), 'Token creation timestamp') - ->addIndex( - $installer->getIdxName( - $installer->getTable('oauth_token'), - array('consumer_id'), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX - ), - array('consumer_id'), - array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX)) - ->addIndex( - $installer->getIdxName( - $installer->getTable('oauth_token'), - array('token'), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - array('token'), - array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) - ->addForeignKey( - $installer->getFkName('oauth_token', 'admin_id', $installer->getTable('admin_user'), 'user_id'), - 'admin_id', - $installer->getTable('admin_user'), - 'user_id', - \Magento\DB\Ddl\Table::ACTION_CASCADE, - \Magento\DB\Ddl\Table::ACTION_CASCADE) - ->addForeignKey( - $installer->getFkName('oauth_token', 'consumer_id', $installer->getTable('oauth_consumer'), 'entity_id'), - 'consumer_id', - $installer->getTable('oauth_consumer'), - 'entity_id', - \Magento\DB\Ddl\Table::ACTION_CASCADE, - \Magento\DB\Ddl\Table::ACTION_CASCADE) - ->addForeignKey( - $installer->getFkName('oauth_token', 'customer_id', $installer->getTable('customer_entity'), 'entity_id'), - 'customer_id', - $installer->getTable('customer_entity'), - 'entity_id', - \Magento\DB\Ddl\Table::ACTION_CASCADE, - \Magento\DB\Ddl\Table::ACTION_CASCADE) - ->setComment('OAuth Tokens'); -$adapter->createTable($table); - -/** - * Create table 'oauth_nonce - */ -$table = $adapter->newTable($installer->getTable('oauth_nonce')) - ->addColumn('nonce', \Magento\DB\Ddl\Table::TYPE_TEXT, 32, array( - 'nullable' => false - ), 'Nonce String') - ->addColumn('timestamp', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, array( - 'unsigned' => true, - 'nullable' => false - ), 'Nonce Timestamp') - ->addIndex( - $installer->getIdxName( - $installer->getTable('oauth_nonce'), - array('nonce'), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - array('nonce'), - array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) - ->setOption('type', 'MyISAM'); -$adapter->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Oauth/sql/oauth_setup/upgrade-1.0.0.0-1.0.0.1.php b/app/code/Magento/Oauth/sql/oauth_setup/upgrade-1.0.0.0-1.0.0.1.php deleted file mode 100644 index 0127f813837..00000000000 --- a/app/code/Magento/Oauth/sql/oauth_setup/upgrade-1.0.0.0-1.0.0.1.php +++ /dev/null @@ -1,88 +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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** @var $installer \Magento\Core\Model\Resource\Setup */ -$installer = $this; -$installer->startSetup(); - -$installer - ->getConnection() - ->dropIndex($installer->getTable('oauth_nonce'), $installer->getIdxName( - 'oauth_nonce', - array('nonce'), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - )); - -$installer - ->getConnection() - ->addColumn( - $installer->getTable('oauth_nonce'), - 'consumer_id', - array( - 'type' => \Magento\DB\Ddl\Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Consumer ID' - )); - -$keyFieldsList = array('nonce', 'consumer_id'); -$installer - ->getConnection() - ->addIndex( - $installer->getTable('oauth_nonce'), - $installer->getIdxName( - 'oauth_nonce', - $keyFieldsList, - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - $keyFieldsList, - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ); - -$installer - ->getConnection() - ->addForeignKey( - $installer->getFkName('oauth_nonce', 'consumer_id', 'oauth_consumer', 'entity_id'), - $installer->getTable('oauth_nonce'), - 'consumer_id', - $installer->getTable('oauth_consumer'), - 'entity_id', - \Magento\DB\Ddl\Table::ACTION_CASCADE, - \Magento\DB\Ddl\Table::ACTION_CASCADE - ); - -$installer - ->getConnection() - ->addColumn( - $installer->getTable('oauth_consumer'), - 'http_post_url', - array( - 'type' => \Magento\DB\Ddl\Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => false, - 'comment' => 'Http Post URL' - ) - ); - -$installer->endSetup(); diff --git a/app/code/Magento/Ogone/etc/frontend/page_types.xml b/app/code/Magento/Ogone/etc/frontend/page_types.xml new file mode 100644 index 00000000000..a87b1e8476d --- /dev/null +++ b/app/code/Magento/Ogone/etc/frontend/page_types.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="ogone_api_paypage" label="Ogone Paygate Payment"/> + <type id="ogone_api_placeform" label="Ogone Paygate Payment Place"/> +</page_types> diff --git a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml index 869871ab8d5..5ae97bedfd2 100644 --- a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml +++ b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Ogone Paygate Payment" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <remove name="catalog.topnav"/> <referenceBlock name="header"> <remove name="top.links"/> diff --git a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml index 17f0118b461..2a9ae971609 100644 --- a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml +++ b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Ogone Paygate Payment Place" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Ogone\Block\Placeform" name="ogone_placeform" template="placeform.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Page/Block/Html/Head.php b/app/code/Magento/Page/Block/Html/Head.php index 9a920200f54..2ca8136a90a 100644 --- a/app/code/Magento/Page/Block/Html/Head.php +++ b/app/code/Magento/Page/Block/Html/Head.php @@ -204,10 +204,10 @@ class Head extends \Magento\Core\Block\Template } } - if ($contentType == \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS ) { + if ($contentType == \Magento\View\Publisher::CONTENT_TYPE_JS ) { $groupTemplate = '<script' . $attributes . ' type="text/javascript" src="%s"></script>' . "\n"; } else { - if ($contentType == \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS) { + if ($contentType == \Magento\View\Publisher::CONTENT_TYPE_CSS) { $attributes = ' rel="stylesheet" type="text/css"' . ($attributes ?: ' media="all"'); } $groupTemplate = '<link' . $attributes . ' href="%s" />' . "\n"; diff --git a/app/code/Magento/Page/Block/Html/Head/Css.php b/app/code/Magento/Page/Block/Html/Head/Css.php index 230728ed87a..ab64703aa45 100644 --- a/app/code/Magento/Page/Block/Html/Head/Css.php +++ b/app/code/Magento/Page/Block/Html/Head/Css.php @@ -49,7 +49,7 @@ class Css extends \Magento\Core\Block\AbstractBlock $this->setAsset( $viewFileFactory->create(array( 'file' => (string)$this->getFile(), - 'contentType' => \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS + 'contentType' => \Magento\View\Publisher::CONTENT_TYPE_CSS )) ); } diff --git a/app/code/Magento/Page/Block/Html/Head/Script.php b/app/code/Magento/Page/Block/Html/Head/Script.php index b70b8d8e3fa..0e9f99f13fd 100644 --- a/app/code/Magento/Page/Block/Html/Head/Script.php +++ b/app/code/Magento/Page/Block/Html/Head/Script.php @@ -48,7 +48,7 @@ class Script extends \Magento\Core\Block\AbstractBlock $this->setAsset( $viewFileFactory->create(array( 'file' => (string)$this->getFile(), - 'contentType' => \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS + 'contentType' => \Magento\View\Publisher::CONTENT_TYPE_JS )) ); } diff --git a/app/code/Magento/Page/Block/Html/Topmenu.php b/app/code/Magento/Page/Block/Html/Topmenu.php index 92dd2af573b..6c8e30a5106 100644 --- a/app/code/Magento/Page/Block/Html/Topmenu.php +++ b/app/code/Magento/Page/Block/Html/Topmenu.php @@ -48,16 +48,6 @@ class Topmenu extends \Magento\Core\Block\Template public function _construct() { $this->_menu = new \Magento\Data\Tree\Node(array(), 'root', new \Magento\Data\Tree()); - - // enabling the cache for this topmenu to not expire until changes made in admin area - // this is to prevent the menu from being rebuild every request and to prevent new categories from showing up - // immediately - $this->addData(array( - 'cache_lifetime' => false, - 'cache_tags' => array( - \Magento\Core\Model\Store\Group::CACHE_TAG - ), - )); } /** diff --git a/app/code/Magento/Page/view/frontend/1column.phtml b/app/code/Magento/Page/view/frontend/1column.phtml index 8ab698c3416..d51c07bf583 100644 --- a/app/code/Magento/Page/view/frontend/1column.phtml +++ b/app/code/Magento/Page/view/frontend/1column.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo $this->getChildHtml('head') ?> </head> <body class="col1-layout<?php echo $bodyCss ?>" data-container="body" data-mage-init="{loaderAjax: {}, loader: {}}"> diff --git a/app/code/Magento/Page/view/frontend/2columns-left.phtml b/app/code/Magento/Page/view/frontend/2columns-left.phtml index d5b79afb517..89f05398636 100644 --- a/app/code/Magento/Page/view/frontend/2columns-left.phtml +++ b/app/code/Magento/Page/view/frontend/2columns-left.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo $this->getChildHtml('head') ?> </head> <body class="col2-left-layout<?php echo $bodyCss ?>" data-container="body" data-mage-init="{loaderAjax: {}, loader: {}}"> diff --git a/app/code/Magento/Page/view/frontend/2columns-right.phtml b/app/code/Magento/Page/view/frontend/2columns-right.phtml index c96f684a0cf..50a3a649672 100644 --- a/app/code/Magento/Page/view/frontend/2columns-right.phtml +++ b/app/code/Magento/Page/view/frontend/2columns-right.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo $this->getChildHtml('head') ?> </head> <body class="col2-right-layout<?php echo $bodyCss ?>" data-container="body" data-mage-init="{loaderAjax: {}, loader: {}}"> diff --git a/app/code/Magento/Page/view/frontend/3columns.phtml b/app/code/Magento/Page/view/frontend/3columns.phtml index 4b87500e5c2..c5e2fa8df9a 100644 --- a/app/code/Magento/Page/view/frontend/3columns.phtml +++ b/app/code/Magento/Page/view/frontend/3columns.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo $this->getChildHtml('head') ?> </head> <body class="col3-layout<?php echo $bodyCss ?>" data-container="body" data-mage-init="{loaderAjax: {}, loader: {}}"> diff --git a/app/code/Magento/Page/view/frontend/empty.phtml b/app/code/Magento/Page/view/frontend/empty.phtml index cf2775f7e9e..6d44c2cacfb 100644 --- a/app/code/Magento/Page/view/frontend/empty.phtml +++ b/app/code/Magento/Page/view/frontend/empty.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo $this->getChildHtml('head') ?> </head> <body class="page-empty<?php echo $bodyCss ?>" data-container="body" data-mage-init="{loaderAjax: {}, loader: {}}"> diff --git a/app/code/Magento/Page/view/frontend/js/splitbutton.js b/app/code/Magento/Page/view/frontend/js/splitbutton.js new file mode 100644 index 00000000000..9f2418eb54e --- /dev/null +++ b/app/code/Magento/Page/view/frontend/js/splitbutton.js @@ -0,0 +1,74 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 Magento + * @package Magento_Persistent + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/*jshint browser:true jquery:true*/ +(function($, undefined) { + "use strict"; + $.widget('mage.splitButton', { + /** + * options with default values + */ + options: { + splitButton: '.split-button', + arrowButton: '.change', + activeClass: 'active' + }, + + /** + * Initialize split button events + * @private + */ + _create: function() { + $(document).on('click', this.options.splitButton + ' > ' + this.options.arrowButton, $.proxy(this._toggleDropDown, this)); + $(document).on('click', $.proxy(this._hideDropDown, this)); + }, + + /** + * Toggle css class for the split button to hide or show drop down menu + * Saves current state of the target. Closes all open drop downs and then + * depending on the stored state the target drop down is toggled. + * @private + * @param {Object} e + */ + _toggleDropDown: function(e) { + var state = $(e.target).closest(this.options.splitButton).hasClass(this.options.activeClass); + this._hideDropDown(); + if (state) { + this._hideDropDown(); + } else { + $(e.target).closest(this.options.splitButton).addClass(this.options.activeClass); + } + return false; + }, + + /** + * Hide all the drop down menus when clicked any where on the page + * @private + */ + _hideDropDown: function() { + $(document).find(this.options.splitButton).removeClass(this.options.activeClass); + } + }); +})(jQuery); diff --git a/app/code/Magento/Page/view/frontend/js/truncate.js b/app/code/Magento/Page/view/frontend/js/truncate.js index 469865bb9f1..1573f1b5d66 100644 --- a/app/code/Magento/Page/view/frontend/js/truncate.js +++ b/app/code/Magento/Page/view/frontend/js/truncate.js @@ -29,7 +29,7 @@ options: { detailsLink: 'a.details', mouseEvents: 'mouseover mouseout', - truncatedFullValue: 'div.truncated_full_value' + truncatedFullValue: 'div.truncated.full.value' }, /** diff --git a/app/code/Magento/Page/view/frontend/layout/default.xml b/app/code/Magento/Page/view/frontend/layout/default.xml index 747454accd3..14c3a8c96eb 100644 --- a/app/code/Magento/Page/view/frontend/layout/default.xml +++ b/app/code/Magento/Page/view/frontend/layout/default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Pages" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Page\Block\Html" name="root" output="1" template="3columns.phtml"> <block class="Magento\Page\Block\Html\Head" name="head" as="head"> <block class="Magento\Page\Block\Js\Cookie" name="js_cookies" template="js/cookie.phtml"/> @@ -44,7 +44,7 @@ </container> <container name="page_top" as="page_top" label="After Page Header"> <block class="Magento\Page\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml"/> - <container name="top.container" as="topContainer" label="Page Header" htmlTag="div" htmlClass="top-container"/> + <container name="top.container" as="topContainer" label="After Page Header Top" htmlTag="div" htmlClass="top-container"/> <block class="Magento\Page\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> </container> <!-- diff --git a/app/code/Magento/Page/view/frontend/layout/page_empty.xml b/app/code/Magento/Page/view/frontend/layout/page_empty.xml index a1edaed6518..b3ecd97bb8f 100644 --- a/app/code/Magento/Page/view/frontend/layout/page_empty.xml +++ b/app/code/Magento/Page/view/frontend/layout/page_empty.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Empty Layout Pages" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Empty Layout Pages" design_abstraction="page_layout"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">empty.phtml</argument> diff --git a/app/code/Magento/Page/view/frontend/layout/page_one_column.xml b/app/code/Magento/Page/view/frontend/layout/page_one_column.xml index 14703c9c3bc..648d8e67dcf 100644 --- a/app/code/Magento/Page/view/frontend/layout/page_one_column.xml +++ b/app/code/Magento/Page/view/frontend/layout/page_one_column.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All One-Column Layout Pages" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All One-Column Layout Pages" design_abstraction="page_layout"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Page/view/frontend/layout/page_three_columns.xml b/app/code/Magento/Page/view/frontend/layout/page_three_columns.xml index dfa9dd0b38a..5439877833c 100644 --- a/app/code/Magento/Page/view/frontend/layout/page_three_columns.xml +++ b/app/code/Magento/Page/view/frontend/layout/page_three_columns.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Three-Column Layout Pages" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Three-Column Layout Pages" design_abstraction="page_layout"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">3columns.phtml</argument> diff --git a/app/code/Magento/Page/view/frontend/layout/page_two_columns_left.xml b/app/code/Magento/Page/view/frontend/layout/page_two_columns_left.xml index d7e9f322dac..4875c5e1d60 100644 --- a/app/code/Magento/Page/view/frontend/layout/page_two_columns_left.xml +++ b/app/code/Magento/Page/view/frontend/layout/page_two_columns_left.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Two-Column Layout Pages (Left Column)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-left.phtml</argument> diff --git a/app/code/Magento/Page/view/frontend/layout/page_two_columns_right.xml b/app/code/Magento/Page/view/frontend/layout/page_two_columns_right.xml index 5b2d6f4f17c..b199d400573 100644 --- a/app/code/Magento/Page/view/frontend/layout/page_two_columns_right.xml +++ b/app/code/Magento/Page/view/frontend/layout/page_two_columns_right.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Two-Column Layout Pages (Right Column)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Two-Column Layout Pages (Right Column)" design_abstraction="page_layout"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/Page/view/frontend/layout/print.xml b/app/code/Magento/Page/view/frontend/layout/print.xml index befe0f664c0..c8cf050b371 100644 --- a/app/code/Magento/Page/view/frontend/layout/print.xml +++ b/app/code/Magento/Page/view/frontend/layout/print.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="All Pages (Print Version)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Page\Block\Html" name="root" output="1" template="print.phtml"> <block class="Magento\Page\Block\Html\Head" name="head" as="head"/> <container name="after_body_start" as="after_body_start" label="Page Top"/> diff --git a/app/code/Magento/Page/view/frontend/page.phtml b/app/code/Magento/Page/view/frontend/page.phtml index b2cfc58945d..09cf7c39640 100644 --- a/app/code/Magento/Page/view/frontend/page.phtml +++ b/app/code/Magento/Page/view/frontend/page.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo $this->getChildHtml('head') ?> </head> <body class="<?php echo $bodyCss ?>" data-container="body" data-mage-init="{loaderAjax: {}, loader: {}}"> diff --git a/app/code/Magento/Page/view/frontend/popup.phtml b/app/code/Magento/Page/view/frontend/popup.phtml index 8f7006b44d3..6d012f7bf14 100644 --- a/app/code/Magento/Page/view/frontend/popup.phtml +++ b/app/code/Magento/Page/view/frontend/popup.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" content="width=device-width"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo $this->getChildHtml('head') ?> </head> <body class="page popup<?php echo $bodyCss ?>" data-container="body" data-mage-init="{loaderAjax: {}, loader: {}}"> diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php index 3cfa27be14f..6218800cdad 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php @@ -73,7 +73,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic { /* @var $model \Magento\Paypal\Model\Report\Settlement\Row */ $model = $this->_coreRegistry->registry('current_transaction'); - $coreHelper = $this->helper('Magento\Core\Helper\Data'); $fieldsets = array( 'reference_fieldset' => array( 'fields' => array( @@ -99,7 +98,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic ), 'transaction_initiation_date' => array( 'label' => $this->_settlement->getFieldLabel('transaction_initiation_date'), - 'value' => $coreHelper->formatDate( + 'value' => $this->formatDate( $model->getData('transaction_initiation_date'), \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM, true @@ -107,7 +106,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic ), 'transaction_completion_date' => array( 'label' => $this->_settlement->getFieldLabel('transaction_completion_date'), - 'value' => $coreHelper->formatDate( + 'value' => $this->formatDate( $model->getData('transaction_completion_date'), \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM, true diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 0b0f3291b61..abb958687d2 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -139,7 +139,7 @@ class Checkout protected $_order; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -157,13 +157,6 @@ class Checkout */ protected $_taxData; - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - /** * Customer data * @@ -226,16 +219,20 @@ class Checkout */ protected $_apiTypeFactory; + /** + * @var \Magento\Object\Copy + */ + protected $_objectCopyService; + /** * Set config, session and quote instances * * @param \Magento\Logger $logger * @param \Magento\Customer\Helper\Data $customerData - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Checkout\Helper\Data $checkoutData * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Paypal\Model\Info $paypalInfo * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -246,19 +243,17 @@ class Checkout * @param \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory * @param \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\Paypal\Model\Api\Type\Factory $apiTypeFactory + * @param \Magento\Object\Copy $objectCopyService * @param array $params * @throws \Exception - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Logger $logger, \Magento\Customer\Helper\Data $customerData, - \Magento\Core\Helper\Data $coreData, \Magento\Tax\Helper\Data $taxData, \Magento\Checkout\Helper\Data $checkoutData, \Magento\Customer\Model\Session $customerSession, - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Model\LocaleInterface $locale, \Magento\Paypal\Model\Info $paypalInfo, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -269,10 +264,10 @@ class Checkout \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory, \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory, \Magento\Paypal\Model\Api\Type\Factory $apiTypeFactory, + \Magento\Object\Copy $objectCopyService, $params = array() ) { $this->_customerData = $customerData; - $this->_coreData = $coreData; $this->_taxData = $taxData; $this->_checkoutData = $checkoutData; $this->_customerSession = $customerSession; @@ -288,6 +283,7 @@ class Checkout $this->_serviceQuoteFactory = $serviceQuoteFactory; $this->_agreementFactory = $agreementFactory; $this->_apiTypeFactory = $apiTypeFactory; + $this->_objectCopyService = $objectCopyService; if (isset($params['config']) && $params['config'] instanceof \Magento\Paypal\Model\Config) { $this->_config = $params['config']; @@ -1060,7 +1056,7 @@ class Checkout $billing->setCustomerGender($quote->getCustomerGender()); } - $this->_coreData->copyFieldsetToTarget('checkout_onepage_billing', 'to_customer', $billing, $customer); + $this->_objectCopyService->copyFieldsetToTarget('checkout_onepage_billing', 'to_customer', $billing, $customer); $customer->setEmail($quote->getCustomerEmail()); $customer->setPrefix($quote->getCustomerPrefix()); $customer->setFirstname($quote->getCustomerFirstname()); diff --git a/app/code/Magento/Paypal/etc/frontend/page_types.xml b/app/code/Magento/Paypal/etc/frontend/page_types.xml new file mode 100644 index 00000000000..ca6658ae826 --- /dev/null +++ b/app/code/Magento/Paypal/etc/frontend/page_types.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="paypal_express_review" label="PayPal Express Order Review Form"/> + <type id="paypal_hostedpro_cancel" label="Paypal Hosted Pro Frame"/> + <type id="paypal_payflow_cancelpayment" label="Paypal Payflow Cancel Payment"/> + <type id="paypal_payflow_form" label="Paypal Payflow Form"/> + <type id="paypal_payflow_returnurl" label="Paypal Payflow Return URL"/> + <type id="paypal_payflowadvanced_cancelpayment" label="Paypal Payflow Advanced Cancel Payment"/> + <type id="paypal_payflowadvanced_form" label="Paypal Payflow Advanced Form"/> + <type id="paypal_payflowadvanced_returnurl" label="Paypal Payflow Advanced Return URL"/> +</page_types> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml index 42ba54058d0..c6a19283424 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="PayPal Express Order Review Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml index e40967effa8..41cc25c05eb 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Hosted Pro Frame" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Hosted\Pro\Iframe" name="hosted.pro.iframe" output="1" template="hss/redirect.phtml"/> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml index 68f8ce811fa..3a4fd7a2ee3 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Cancel Payment" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" template="payflowlink/redirect.phtml"/> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml index ff64b403b62..0c2999b4b3d 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" template="payflowlink/form.phtml"/> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml index c8a429aa448..3a4fd7a2ee3 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Return URL" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" template="payflowlink/redirect.phtml"/> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml index a72eb037793..0abd43d662e 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Advanced Cancel Payment" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" template="payflowadvanced/redirect.phtml"/> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml index c1d41e2be0f..e846ef8b4f4 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Advanced Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" template="payflowadvanced/form.phtml"/> </layout> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml index dc3bb8c0032..0abd43d662e 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Advanced Return URL" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" template="payflowadvanced/redirect.phtml"/> </layout> diff --git a/app/code/Magento/PaypalUk/etc/frontend/page_types.xml b/app/code/Magento/PaypalUk/etc/frontend/page_types.xml new file mode 100644 index 00000000000..5106ef04c81 --- /dev/null +++ b/app/code/Magento/PaypalUk/etc/frontend/page_types.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="paypaluk_express_review" label="PayPal Express Order Review Form"/> +</page_types> diff --git a/app/code/Magento/PaypalUk/view/frontend/layout/paypaluk_express_review.xml b/app/code/Magento/PaypalUk/view/frontend/layout/paypaluk_express_review.xml index 9cab13fe4b8..684f1f5dca5 100644 --- a/app/code/Magento/PaypalUk/view/frontend/layout/paypaluk_express_review.xml +++ b/app/code/Magento/PaypalUk/view/frontend/layout/paypaluk_express_review.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="PayPal Express Order Review Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Persistent/Block/Form/Remember.php b/app/code/Magento/Persistent/Block/Form/Remember.php index 76b1b7f94eb..2db218eee56 100644 --- a/app/code/Magento/Persistent/Block/Form/Remember.php +++ b/app/code/Magento/Persistent/Block/Form/Remember.php @@ -43,19 +43,28 @@ class Remember extends \Magento\Core\Block\Template */ protected $_persistentData = null; + /** + * @var \Magento\Math\Random + */ + protected $mathRandom; + /** * @param \Magento\Persistent\Helper\Data $persistentData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param array $data + * @param \Magento\Math\Random $mathRandom */ public function __construct( \Magento\Persistent\Helper\Data $persistentData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, array $data = array() ) { $this->_persistentData = $persistentData; + $this->mathRandom = $mathRandom; parent::__construct($coreData, $context, $data); } @@ -81,4 +90,16 @@ class Remember extends \Magento\Core\Block\Template && $this->_persistentData->isRememberMeEnabled() && $this->_persistentData->isRememberMeCheckedDefault(); } + + /** + * Get random string + * + * @param int $length + * @param string|null $chars + * @return string + */ + public function getRandomString($length, $chars = null) + { + return $this->mathRandom->getRandomString($length, $chars); + } } diff --git a/app/code/Magento/Persistent/Helper/Data.php b/app/code/Magento/Persistent/Helper/Data.php index 242d0d90cf3..8d7d92ccedf 100644 --- a/app/code/Magento/Persistent/Helper/Data.php +++ b/app/code/Magento/Persistent/Helper/Data.php @@ -78,12 +78,9 @@ class Data extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Module\Dir\Reader $modulesReader * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\Core\Helper\Url $coreUrl * @param \Magento\Checkout\Helper\Data $checkoutData @@ -93,16 +90,14 @@ class Data extends \Magento\Core\Helper\Data */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, - \Magento\Module\Dir\Reader $modulesReader, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\Core\Helper\Url $coreUrl, \Magento\Checkout\Helper\Data $checkoutData, \Magento\Persistent\Helper\Session $persistentSession, + \Magento\Module\Dir\Reader $modulesReader, \Magento\Escaper $escaper, $dbCompatibleMode = true ) { @@ -114,11 +109,9 @@ class Data extends \Magento\Core\Helper\Data parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/Persistent/Helper/Session.php b/app/code/Magento/Persistent/Helper/Session.php index 165c4887a9c..d812ed31ae1 100644 --- a/app/code/Magento/Persistent/Helper/Session.php +++ b/app/code/Magento/Persistent/Helper/Session.php @@ -81,11 +81,9 @@ class Session extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param Data $persistentData * @param \Magento\Checkout\Model\Session $checkoutSession @@ -95,11 +93,9 @@ class Session extends \Magento\Core\Helper\Data */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\Persistent\Helper\Data $persistentData, \Magento\Checkout\Model\Session $checkoutSession, @@ -113,11 +109,9 @@ class Session extends \Magento\Core\Helper\Data $this->_sessionFactory = $sessionFactory; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/Persistent/etc/module.xml b/app/code/Magento/Persistent/etc/module.xml index d6fe4809f2b..447255c73b5 100755 --- a/app/code/Magento/Persistent/etc/module.xml +++ b/app/code/Magento/Persistent/etc/module.xml @@ -37,7 +37,6 @@ <module name="Magento_Paypal"/> <module name="Magento_Sales"/> <module name="Magento_Cron"/> - <module name="Magento_Directory"/> </depends> </module> </config> diff --git a/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml index 3a7af3478c3..1147945ddc7 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml @@ -24,17 +24,12 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="checkout.onepage.login"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">Magento_Persistent::checkout/onepage/login.phtml</argument> - </action> - block class="Magento\Persistent\Block\Form\Remember" name="checkout.onepage.login.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> - </referenceBlock> - <referenceBlock name="checkout.onepage.billing"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">Magento_Persistent::checkout/onepage/billing.phtml</argument> - </action> - <block class="Magento\Persistent\Block\Form\Remember" name="checkout.onepage.billing.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> - <block class="Magento\Core\Block\Template" name="checkout.onepage.billing.persistent.remember.me.tooltip" as="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> - </referenceBlock> + <referenceContainer name="form.login.additional.info"> + <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> + <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + </referenceContainer> + <referenceContainer name="form.billing.additional.info"> + <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me.billing" template="remember_me.phtml" before="-"/> + <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip.billing" template="Magento_Persistent::remember_me_tooltip.phtml"/> + </referenceContainer> </layout> diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml index d750cd77df5..8ac15eae415 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml @@ -24,11 +24,8 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="customer_form_register"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">Magento_Persistent::customer/form/register.phtml</argument> - </action> - <block class="Magento\Persistent\Block\Form\Remember" name="customer_form_register.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> - <block class="Magento\Core\Block\Template" name="customer_form_register.persistent.remember.me.tooltip" as="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> - </referenceBlock> + <referenceContainer name="form.additional.info"> + <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> + <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + </referenceContainer> </layout> diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml index 82366aead37..8ac15eae415 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml @@ -24,11 +24,8 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="customer_form_login"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">Magento_Persistent::customer/form/login.phtml</argument> - </action> - <block class="Magento\Persistent\Block\Form\Remember" name="customer_form_login.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> - <block class="Magento\Core\Block\Template" name="customer_form_login.persistent.remember.me.tooltip" as="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> - </referenceBlock> + <referenceContainer name="form.additional.info"> + <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> + <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + </referenceContainer> </layout> diff --git a/app/code/Magento/Persistent/view/frontend/remember-me-popup.js b/app/code/Magento/Persistent/view/frontend/remember-me-popup.js index 2e04ae6ee6c..f4c0050bc23 100644 --- a/app/code/Magento/Persistent/view/frontend/remember-me-popup.js +++ b/app/code/Magento/Persistent/view/frontend/remember-me-popup.js @@ -26,22 +26,15 @@ (function ($) { $.widget('mage.rememberMePopup', { options: { - closeBtn: '.btn-close', - windowOverlayTemplate: '<div class="window-overlay"></div>', - popupBlockTemplate: '<div class="popup-block block popup-remember-tip active">' + - '<div class="block-title">' + + closeBtn: '.action.close', + windowOverlayTemplate: '<div class="window overlay"></div>', + popupBlockTemplate: '<div class="popup block remember tip active">' + + '<div class="title">' + '<strong>${title}</strong>' + - '<div class="btn-close"></div>' + + '<div class="action close"></div>' + '</div>' + - '<div class="block-content">' + + '<div class="content">' + '<p>${content}</p>' + - '<div class="buttons-set">' + - '<button class="button btn-close" type="button">' + - '<span>' + - '<span>Close</span>' + - '</span>' + - '</button>' + - '</div>' + '</div>' + '</div>' }, diff --git a/app/code/Magento/Persistent/view/frontend/remember_me.phtml b/app/code/Magento/Persistent/view/frontend/remember_me.phtml index ec0bfa722f7..8cede9c8332 100644 --- a/app/code/Magento/Persistent/view/frontend/remember_me.phtml +++ b/app/code/Magento/Persistent/view/frontend/remember_me.phtml @@ -31,11 +31,12 @@ * @var $this \Magento\Persistent\Block\Form\Remember */ ?> -<li id="remember-me-box" class="control"> - <?php $rememberMeId = 'remember_me' . $this->helper('Magento\Core\Helper\Data')->getRandomString(10); ?> - <div class="input-box"> - <input type="checkbox" name="persistent_remember_me" class="checkbox" id="<?php echo $rememberMeId; ?>"<?php if ($this->isRememberMeChecked()): ?> checked="checked"<?php endif; ?> title="<?php echo __('Remember Me') ?>" /> - </div> - <label for="<?php echo $rememberMeId; ?>"><?php echo __('Remember Me') ?></label> - <a class="link-tip" href="#"><?php echo __('What\'s this?') ?></a> -</li> +<div id="remember-me-box" class="field choice persistent"> + <?php $rememberMeId = 'remember_me' . $this->getRandomString(10); ?> + <input type="checkbox" name="persistent_remember_me" class="checkbox" id="<?php echo $rememberMeId; ?>"<?php if ($this->isRememberMeChecked()): ?> checked="checked"<?php endif; ?> title="<?php echo __('Remember Me') ?>" /> + <label for="<?php echo $rememberMeId; ?>" class="label"><span><?php echo __('Remember Me') ?></span></label> + <a class="link tip" href="#"><?php echo __('What\'s this?') ?></a> +</div> +<?php if ($this->helper('Magento\Checkout\Helper\Data')->isContextCheckout()): ?> + <input name="context" type="hidden" value="checkout" /> +<?php endif; ?> diff --git a/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml b/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml index 8bb7fc4eac6..8cefb973f32 100644 --- a/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml +++ b/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml @@ -31,28 +31,14 @@ */ /** @var $this \Magento\Core\Block\Template */ ?> -<div id="window-overlay" class="window-overlay" style="display:none;"></div> -<div id="remember-me-popup" class="remember-me-popup" style="display:none;"> - <div class="remember-me-popup-head"> - <h3>What's this?</h3> - <a href="#" class="remember-me-popup-close" title="<?php echo __('Close') ?>"><?php echo __('Close') ?></a> - </div> - <div class="remember-me-popup-body"> - <p>Checking "Remember Me" will let you access your shopping cart on this computer when you are logged out</p> - <div class="remember-me-popup-close-button a-right"> - <a href="#" class="remember-me-popup-close button" title="<?php echo __('Close') ?>"><span><?php echo __('Close') ?></span></a> - </div> - </div> -</div> <script type="text/javascript"> (function($) { head.js( "<?php echo $this->getViewFileUrl('Magento_Persistent::remember-me-popup.js') ?>", function() { $('#remember-me-box').rememberMePopup({ - windowOverlay: '#window-overlay', - popupBlock: '#remember-me-popup', - closeBtn: '.remember-me-popup-close' + title: '<?php echo __('What is this?');?>', + content: '<?php echo __('Check "Remember Me" to access your shopping cart on this computer when you are logged out')?>' }); }); })(jQuery); diff --git a/app/code/Magento/ProductAlert/view/frontend/email/price.phtml b/app/code/Magento/ProductAlert/view/frontend/email/price.phtml index 58a16bc4fa2..34b572a637b 100644 --- a/app/code/Magento/ProductAlert/view/frontend/email/price.phtml +++ b/app/code/Magento/ProductAlert/view/frontend/email/price.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -29,9 +28,17 @@ <table> <?php foreach ($_products as $_product): ?> <tr> - <td><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>"><img src="<?php echo $_product->getThumbnailUrl() ?>" border="0" align="left" height="75" width="75" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" /></a></td> - <td> - <p><a href="<?php echo $_product->getProductUrl() ?>"><strong><?php echo $this->escapeHtml($_product->getName()) ?></strong></a></p> + <td class="col photo"> + <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>"> + <img src="<?php echo $_product->getThumbnailUrl() ?>" height="75" width="75" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" /> + </a> + </td> + <td class="col item"> + <p> + <strong class="product name"> + <a href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->escapeHtml($_product->getName()) ?></a> + </strong> + </p> <?php if ($shortDescription = $this->escapeHtml($_product->getShortDescription())): ?> <p><small><?php echo $shortDescription ?></small></p> <?php endif; ?> diff --git a/app/code/Magento/ProductAlert/view/frontend/email/stock.phtml b/app/code/Magento/ProductAlert/view/frontend/email/stock.phtml index c84f26c0420..299c6e6fe24 100644 --- a/app/code/Magento/ProductAlert/view/frontend/email/stock.phtml +++ b/app/code/Magento/ProductAlert/view/frontend/email/stock.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -29,9 +28,17 @@ <table> <?php foreach ($_products as $_product): ?> <tr> - <td><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>"><img src="<?php echo $this->getThumbnailUrl($_product) ?>" width="<?php echo $this->getThumbnailSize()?>" height="<?php echo $this->getThumbnailSize()?>" border="0" align="left" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" /></a></td> - <td> - <p><a href="<?php echo $_product->getProductUrl() ?>"><strong><?php echo $this->escapeHtml($_product->getName()) ?></strong></a></p> + <td class="col photo"> + <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>" class="product photo"> + <img src="<?php echo $this->getThumbnailUrl($_product) ?>" width="<?php echo $this->getThumbnailSize()?>" height="<?php echo $this->getThumbnailSize()?>" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" class="photo image" /> + </a> + </td> + <td class="col item"> + <p> + <strong class="product name"> + <a href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->escapeHtml($_product->getName()) ?></a> + </strong> + </p> <?php if ($shortDescription = $this->escapeHtml($_product->getShortDescription())): ?> <p><small><?php echo $shortDescription ?></small></p> <?php endif; ?> diff --git a/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml index b51304a8eb8..f74dd4dbe7d 100644 --- a/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml @@ -29,7 +29,7 @@ <referenceContainer name="alert.urls"> <block class="Magento\ProductAlert\Block\Product\View\Price" name="productalert.price" as="productalert_price" template="product/view.phtml"> <action method="setHtmlClass"> - <argument name="value" xsi:type="string">alert-price link-price-alert</argument> + <argument name="value" xsi:type="string">price</argument> </action> <action method="setSignupLabel"> <argument translate="true" name="value" xsi:type="string">Sign up for price alert</argument> @@ -37,7 +37,7 @@ </block> <block class="Magento\ProductAlert\Block\Product\View\Stock" name="productalert.stock" as="productalert_stock" template="product/view.phtml"> <action method="setHtmlClass"> - <argument name="value" xsi:type="string">alert-stock link-stock-alert</argument> + <argument name="value" xsi:type="string">stock</argument> </action> <action method="setSignupLabel"> <argument translate="true" name="value" xsi:type="string">Sign up to be notified when this product is back in stock.</argument> diff --git a/app/code/Magento/ProductAlert/view/frontend/product/view.phtml b/app/code/Magento/ProductAlert/view/frontend/product/view.phtml index e4dc918d78b..202c7b2d1c7 100644 --- a/app/code/Magento/ProductAlert/view/frontend/product/view.phtml +++ b/app/code/Magento/ProductAlert/view/frontend/product/view.phtml @@ -19,12 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php /* @var $this \Magento\ProductAlert\Block\Product\View */?> -<p class="<?php echo $this->getHtmlClass() ?>"> - <a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>" title="<?php echo $this->escapeHtml(__($this->getSignupLabel())); ?>"><?php echo $this->escapeHtml(__($this->getSignupLabel())); ?></a> -</p> +<div class="product alert <?php echo $this->getHtmlClass() ?>"> + <a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>" title="<?php echo $this->escapeHtml(__($this->getSignupLabel())); ?>" class="action alert"> + <?php echo $this->escapeHtml(__($this->getSignupLabel())); ?> + </a> +</div> diff --git a/app/code/Magento/Reports/Block/Product/AbstractProduct.php b/app/code/Magento/Reports/Block/Product/AbstractProduct.php index 12bd746b4c9..0ec548d4e41 100644 --- a/app/code/Magento/Reports/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Reports/Block/Product/AbstractProduct.php @@ -61,8 +61,6 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr protected $_indexFactory; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -70,6 +68,7 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Model\Product\Visibility $productVisibility * @param \Magento\Reports\Model\Product\Index\Factory $indexFactory * @param array $data @@ -84,14 +83,24 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Catalog\Model\Product\Visibility $productVisibility, \Magento\Reports\Model\Product\Index\Factory $indexFactory, array $data = array() ) { - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, $context, - $data); $this->_productVisibility = $productVisibility; $this->_indexFactory = $indexFactory; + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php index 5161b07ebe0..c73de9efaee 100644 --- a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php @@ -97,7 +97,7 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory - * @param \Magento\Core\Model\Fieldset\Config $fieldsetConfig + * @param \Magento\Object\Copy\Config $fieldsetConfig * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Sales\Model\Resource\Quote\Item\CollectionFactory $quoteItemFactory * @@ -113,7 +113,7 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, - \Magento\Core\Model\Fieldset\Config $fieldsetConfig, + \Magento\Object\Copy\Config $fieldsetConfig, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Sales\Model\Resource\Quote\Item\CollectionFactory $quoteItemFactory ) { diff --git a/app/code/Magento/Review/Block/Customer/View.php b/app/code/Magento/Review/Block/Customer/View.php index 9a4836e1c93..5dafcd48a6c 100644 --- a/app/code/Magento/Review/Block/Customer/View.php +++ b/app/code/Magento/Review/Block/Customer/View.php @@ -43,11 +43,6 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct */ protected $_productFactory; - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Review\Model\ReviewFactory */ @@ -69,8 +64,6 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct protected $_customerSession; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -78,14 +71,13 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Review\Model\ReviewFactory $reviewFactory * @param \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory * @param \Magento\Rating\Model\RatingFactory $ratingFactory * @param \Magento\Customer\Model\Session $customerSession * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -95,6 +87,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Review\Model\ReviewFactory $reviewFactory, \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory, @@ -103,14 +96,21 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct array $data = array() ) { $this->_productFactory = $productFactory; - $this->_storeManager = $storeManager; $this->_reviewFactory = $reviewFactory; $this->_voteFactory = $voteFactory; $this->_ratingFactory = $ratingFactory; $this->_customerSession = $customerSession; - - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, $context, - $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } diff --git a/app/code/Magento/Review/Block/Product/View.php b/app/code/Magento/Review/Block/Product/View.php index 129d2c25027..adf3e77ad67 100644 --- a/app/code/Magento/Review/Block/Product/View.php +++ b/app/code/Magento/Review/Block/Product/View.php @@ -57,6 +57,7 @@ class View extends \Magento\Catalog\Block\Product\View * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Review\Model\Resource\Review\CollectionFactory $collectionFactory * @param array $data * @@ -74,12 +75,26 @@ class View extends \Magento\Catalog\Block\Product\View \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Review\Model\Resource\Review\CollectionFactory $collectionFactory, array $data = array() ) { $this->_reviewsColFactory = $collectionFactory; - parent::__construct($storeManager, $catalogConfig, $productFactory, $locale, $taxCalculation, $coreRegistry, - $string, $taxData, $catalogData, $coreData, $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $productFactory, + $locale, + $taxCalculation, + $coreRegistry, + $string, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Review/Block/View.php b/app/code/Magento/Review/Block/View.php index bf8c4030155..36e9ab9f4a5 100644 --- a/app/code/Magento/Review/Block/View.php +++ b/app/code/Magento/Review/Block/View.php @@ -54,8 +54,6 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct protected $_reviewFactory; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -63,8 +61,8 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Rating\Model\RatingFactory $ratingFactory * @param \Magento\Review\Model\ReviewFactory $reviewFactory * @param array $data @@ -79,17 +77,26 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory, \Magento\Rating\Model\RatingFactory $ratingFactory, \Magento\Review\Model\ReviewFactory $reviewFactory, array $data = array() ) { $this->_voteFactory = $voteFactory; - $this->_storeManager = $storeManager; + $this->_ratingFactory = $ratingFactory; $this->_reviewFactory = $reviewFactory; - - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data + ); } /** diff --git a/app/code/Magento/Review/etc/frontend/page_types.xml b/app/code/Magento/Review/etc/frontend/page_types.xml new file mode 100644 index 00000000000..5b71c4fef72 --- /dev/null +++ b/app/code/Magento/Review/etc/frontend/page_types.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="review_customer_index" label="Customer My Account Product Reviews"/> + <type id="review_customer_view" label="Customer My Account Review Details"/> + <type id="review_product_list" label="Catalog Product Reviews List"/> + <type id="review_product_view" label="Catalog Product Review View"/> +</page_types> diff --git a/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml index 8df4eb25e23..3b00a259d15 100644 --- a/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="my.account.wrapper"> + <referenceContainer name="content"> <block class="Magento\Review\Block\Customer\Recent" name="customer_account_dashboard_info1" template="customer/recent.phtml" after="customer_account_dashboard_address"/> - </referenceBlock> + </referenceContainer> </layout> diff --git a/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml b/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml index 93c414fd9df..8ed5d67e712 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Product Reviews" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Review\Block\Customer\ListCustomer" name="review_customer_list" template="customer/list.phtml"/> diff --git a/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml b/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml index fa0935bb3e2..dfbf58c9e7a 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Review Details" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Review\Block\Customer\View" name="customers_review"/> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml index a8d3ceb6279..ee06566961a 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Reviews List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_view.xml b/app/code/Magento/Review/view/frontend/layout/review_product_view.xml index ec04beb4727..c41c7ffd4ad 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Review View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Rss/Block/Wishlist.php b/app/code/Magento/Rss/Block/Wishlist.php index ded3ea37a8b..7c9f7dfa394 100644 --- a/app/code/Magento/Rss/Block/Wishlist.php +++ b/app/code/Magento/Rss/Block/Wishlist.php @@ -65,8 +65,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock protected $_rssFactory; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -74,6 +72,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -92,6 +91,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -103,8 +103,20 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock $this->_wishlistFactory = $wishlistFactory; $this->_customerFactory = $customerFactory; $this->_rssFactory = $rssFactory; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, $context, - $wishlistData, $customerSession, $productFactory, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $wishlistData, + $customerSession, + $productFactory, + $data + ); } /** diff --git a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php index 34e034e0220..e1ceb536717 100644 --- a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php +++ b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php @@ -33,7 +33,7 @@ namespace Magento\Rss\Model\System\Config\Backend; class Links extends \Magento\Core\Model\Config\Value { /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -42,7 +42,7 @@ class Links extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Config $config - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -52,7 +52,7 @@ class Links extends \Magento\Core\Model\Config\Value \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Config $config, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, + \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Rss/etc/frontend/page_types.xml b/app/code/Magento/Rss/etc/frontend/page_types.xml new file mode 100644 index 00000000000..4a7e38c3a50 --- /dev/null +++ b/app/code/Magento/Rss/etc/frontend/page_types.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="rss_index_index" label="RSS Feeds List"/> +</page_types> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml b/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml index 7102a6805b5..c7321bf029f 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="RSS Feeds List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/code/Magento/Rule/Model/Action/AbstractAction.php b/app/code/Magento/Rule/Model/Action/AbstractAction.php index b99a41229d1..83e1e8782e0 100644 --- a/app/code/Magento/Rule/Model/Action/AbstractAction.php +++ b/app/code/Magento/Rule/Model/Action/AbstractAction.php @@ -33,7 +33,7 @@ namespace Magento\Rule\Model\Action; abstract class AbstractAction extends \Magento\Object implements \Magento\Rule\Model\Action\ActionInterface { /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -43,12 +43,12 @@ abstract class AbstractAction extends \Magento\Object implements \Magento\Rule\M protected $_layout; /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\View\LayoutInterface $layout * @param array $data */ public function __construct( - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\View\LayoutInterface $layout, array $data = array() ) { diff --git a/app/code/Magento/Rule/Model/Action/Collection.php b/app/code/Magento/Rule/Model/Action/Collection.php index abd79c793bb..abdb49f38e5 100644 --- a/app/code/Magento/Rule/Model/Action/Collection.php +++ b/app/code/Magento/Rule/Model/Action/Collection.php @@ -35,13 +35,13 @@ class Collection extends \Magento\Rule\Model\Action\AbstractAction protected $_actionFactory; /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Rule\Model\ActionFactory $actionFactory * @param \Magento\View\LayoutInterface $layout * @param array $data */ public function __construct( - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Rule\Model\ActionFactory $actionFactory, \Magento\View\LayoutInterface $layout, array $data = array() diff --git a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php index 7e36121993a..0385f0bc402 100644 --- a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php +++ b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php @@ -62,7 +62,7 @@ abstract class AbstractCondition protected $_arrayInputTypes = array(); /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; diff --git a/app/code/Magento/Rule/Model/Condition/Context.php b/app/code/Magento/Rule/Model/Condition/Context.php index 0e7f37f0362..afe3628f887 100644 --- a/app/code/Magento/Rule/Model/Condition/Context.php +++ b/app/code/Magento/Rule/Model/Condition/Context.php @@ -31,7 +31,7 @@ namespace Magento\Rule\Model\Condition; class Context implements \Magento\ObjectManager\ContextInterface { /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -56,14 +56,14 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_logger; /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\View\LayoutInterface $layout * @param \Magento\Rule\Model\ConditionFactory $conditionFactory * @param \Magento\Logger $logger */ public function __construct( - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\View\LayoutInterface $layout, \Magento\Rule\Model\ConditionFactory $conditionFactory, @@ -77,7 +77,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\Core\Model\View\Url + * @return \Magento\View\Url */ public function getViewUrl() { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php index bfab978fab1..12d4b2466a3 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php @@ -135,11 +135,11 @@ class Info extends \Magento\Backend\Block\Template $this->setCustomerEmail($customer->getEmail()); $this->setStatus($agreement->getStatusLabel()); $this->setCreatedAt( - $this->helper('Magento\Core\Helper\Data')->formatDate($agreement->getCreatedAt(), 'short', true) + $this->formatDate($agreement->getCreatedAt(), 'short', true) ); $this->setUpdatedAt( ($agreement->getUpdatedAt()) - ? $this->helper('Magento\Core\Helper\Data')->formatDate($agreement->getUpdatedAt(), 'short', true) + ? $this->formatDate($agreement->getUpdatedAt(), 'short', true) : __('N/A') ); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php index 7224aa1439d..59ca335157a 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php @@ -170,9 +170,9 @@ class History return ''; } if ('date' === $dateType) { - return $this->helper('Magento\Core\Helper\Data')->formatDate($item['created_at'], $format); + return $this->formatDate($item['created_at'], $format); } - return $this->helper('Magento\Core\Helper\Data')->formatTime($item['created_at'], $format); + return $this->formatTime($item['created_at'], $format); } /** diff --git a/app/code/Magento/Sales/Block/Billing/Agreement/View.php b/app/code/Magento/Sales/Block/Billing/Agreement/View.php index 4fd2608d92f..20cd583b085 100644 --- a/app/code/Magento/Sales/Block/Billing/Agreement/View.php +++ b/app/code/Magento/Sales/Block/Billing/Agreement/View.php @@ -137,7 +137,7 @@ class View extends \Magento\Core\Block\Template $value = $order->getIncrementId(); break; case 'created_at': - $value = $this->helper('Magento\Core\Helper\Data')->formatDate($order->getCreatedAt(), 'short', true); + $value = $this->formatDate($order->getCreatedAt(), 'short', true); break; case 'shipping_address': $value = $order->getShippingAddress() @@ -221,12 +221,12 @@ class View extends \Magento\Core\Block\Template $updatedAt = $this->_billingAgreementInstance->getUpdatedAt(); $this->setAgreementCreatedAt( ($createdAt) - ? $this->helper('Magento\Core\Helper\Data')->formatDate($createdAt, 'short', true) + ? $this->formatDate($createdAt, 'short', true) : __('N/A') ); if ($updatedAt) { $this->setAgreementUpdatedAt( - $this->helper('Magento\Core\Helper\Data')->formatDate($updatedAt, 'short', true) + $this->formatDate($updatedAt, 'short', true) ); } $this->setAgreementStatus($this->_billingAgreementInstance->getStatusLabel()); diff --git a/app/code/Magento/Sales/Block/Billing/Agreements.php b/app/code/Magento/Sales/Block/Billing/Agreements.php index e965e1b281f..83b462597d3 100644 --- a/app/code/Magento/Sales/Block/Billing/Agreements.php +++ b/app/code/Magento/Sales/Block/Billing/Agreements.php @@ -120,7 +120,7 @@ class Agreements extends \Magento\Core\Block\Template case 'created_at': case 'updated_at': $value = ($item->getData($key)) - ? $this->helper('Magento\Core\Helper\Data')->formatDate($item->getData($key), 'short', true) + ? $this->formatDate($item->getData($key), 'short', true) : __('N/A'); break; case 'edit_url': diff --git a/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php b/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php index b4c6b93c350..5e59d7df117 100644 --- a/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php +++ b/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php @@ -46,11 +46,6 @@ class Grid extends \Magento\Sales\Block\Recurring\Profiles */ protected $_storeManager; - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * Profiles collection * @@ -63,7 +58,6 @@ class Grid extends \Magento\Sales\Block\Recurring\Profiles * @param \Magento\Sales\Model\Recurring\Profile $profile * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManager $storeManager - * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Helper\Data $coreData * @param array $data */ @@ -72,7 +66,6 @@ class Grid extends \Magento\Sales\Block\Recurring\Profiles \Magento\Sales\Model\Recurring\Profile $profile, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManager $storeManager, - \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Helper\Data $coreData, array $data = array() ) { @@ -80,7 +73,6 @@ class Grid extends \Magento\Sales\Block\Recurring\Profiles $this->_recurringProfile = $profile; $this->_registry = $registry; $this->_storeManager = $storeManager; - $this->_locale = $locale; } /** @@ -145,7 +137,7 @@ class Grid extends \Magento\Sales\Block\Recurring\Profiles $profiles = array(); $store = $this->_storeManager->getStore(); foreach ($this->_profiles as $profile) { - $profile->setStore($store)->setLocale($this->_locale); + $profile->setStore($store)->setLocale($this->locale); $profiles[] = new \Magento\Object(array( 'reference_id' => $profile->getReferenceId(), 'reference_id_link_url' => $this->getUrl( diff --git a/app/code/Magento/Sales/Helper/Guest.php b/app/code/Magento/Sales/Helper/Guest.php index 900a724e08c..6d26213988c 100644 --- a/app/code/Magento/Sales/Helper/Guest.php +++ b/app/code/Magento/Sales/Helper/Guest.php @@ -79,11 +79,9 @@ class Guest extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession @@ -95,11 +93,9 @@ class Guest extends \Magento\Core\Helper\Data */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\Core\Model\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, @@ -117,11 +113,9 @@ class Guest extends \Magento\Core\Helper\Data $this->_orderFactory = $orderFactory; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/Sales/Helper/Reorder.php b/app/code/Magento/Sales/Helper/Reorder.php index 3a43e685440..3f6fa04683c 100644 --- a/app/code/Magento/Sales/Helper/Reorder.php +++ b/app/code/Magento/Sales/Helper/Reorder.php @@ -40,22 +40,18 @@ class Reorder extends \Magento\Core\Helper\Data /** * @param \Magento\Core\Helper\Context $context - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\Core\Model\Locale $locale - * @param \Magento\Core\Model\Date $dateModel * @param \Magento\App\State $appState * @param \Magento\Customer\Model\Session $customerSession * @param bool $dbCompatibleMode */ public function __construct( \Magento\Core\Helper\Context $context, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManager $storeManager, \Magento\Core\Model\Locale $locale, - \Magento\Core\Model\Date $dateModel, \Magento\App\State $appState, \Magento\Customer\Model\Session $customerSession, $dbCompatibleMode = true @@ -63,11 +59,9 @@ class Reorder extends \Magento\Core\Helper\Data $this->_customerSession = $customerSession; parent::__construct( $context, - $eventManager, $coreStoreConfig, $storeManager, $locale, - $dateModel, $appState, $dbCompatibleMode ); diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index 6131f9f0446..2fc9c35e224 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -127,13 +127,6 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car */ protected $_coreRegistry = null; - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData = null; - /** * @var \Magento\Logger */ @@ -156,32 +149,37 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car */ protected $_objectManager; + /** + * @var \Magento\Object\Copy + */ + protected $_objectCopyService; + /** * @param \Magento\ObjectManager $objectManager * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote * @param \Magento\Logger $logger + * @param \Magento\Object\Copy $objectCopyService * @param array $data */ public function __construct( \Magento\ObjectManager $objectManager, \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $coreRegistry, \Magento\Sales\Model\Config $salesConfig, \Magento\Adminhtml\Model\Session\Quote $sessionQuote, \Magento\Logger $logger, + \Magento\Object\Copy $objectCopyService, array $data = array() ) { $this->_objectManager = $objectManager; $this->_eventManager = $eventManager; - $this->_coreData = $coreData; $this->_coreRegistry = $coreRegistry; $this->_salesConfig = $salesConfig; $this->_logger = $logger; + $this->_objectCopyService = $objectCopyService; parent::__construct($data); $this->_session = $sessionQuote; } @@ -390,7 +388,7 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car $quote->collectTotals(); } - $this->_coreData->copyFieldsetToTarget('sales_copy_order', 'to_edit', $order, $quote); + $this->_objectCopyService->copyFieldsetToTarget('sales_copy_order', 'to_edit', $order, $quote); $this->_eventManager->dispatch('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote)); @@ -421,7 +419,7 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car protected function _initBillingAddressFromOrder(\Magento\Sales\Model\Order $order) { $this->getQuote()->getBillingAddress()->setCustomerAddressId(''); - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_copy_order_billing_address', 'to_order', $order->getBillingAddress(), @@ -435,7 +433,7 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car $quoteShippingAddress = $this->getQuote()->getShippingAddress() ->setCustomerAddressId('') ->setSameAsBilling($orderShippingAddress && $orderShippingAddress->getSameAsBilling()); - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_copy_order_shipping_address', 'to_order', $orderShippingAddress, diff --git a/app/code/Magento/Sales/Model/Config/Ordered.php b/app/code/Magento/Sales/Model/Config/Ordered.php index 749293f3d3b..7c3e7d82dbb 100644 --- a/app/code/Magento/Sales/Model/Config/Ordered.php +++ b/app/code/Magento/Sales/Model/Config/Ordered.php @@ -78,7 +78,7 @@ abstract class Ordered extends \Magento\Core\Model\Config\Base protected $_collectors = array(); /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; @@ -93,13 +93,13 @@ abstract class Ordered extends \Magento\Core\Model\Config\Base protected $_salesConfig; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Logger $logger * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Simplexml\Element $sourceData */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Logger $logger, \Magento\Sales\Model\Config $salesConfig, $sourceData = null diff --git a/app/code/Magento/Sales/Model/Convert/Order.php b/app/code/Magento/Sales/Model/Convert/Order.php index 2f0187ea7dd..ea1a2c21099 100644 --- a/app/code/Magento/Sales/Model/Convert/Order.php +++ b/app/code/Magento/Sales/Model/Convert/Order.php @@ -31,13 +31,6 @@ namespace Magento\Sales\Model\Convert; class Order extends \Magento\Object { - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData = null; - /** * Core event manager proxy * @@ -90,9 +83,13 @@ class Order extends \Magento\Object */ protected $_creditmemoItemFactory; + /** + * @var \Magento\Object\Copy + */ + protected $_objectCopyService; + /** * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Sales\Model\Quote\AddressFactory $quoteAddressFactory * @param \Magento\Sales\Model\Quote\PaymentFactory $quotePaymentFactory @@ -103,13 +100,13 @@ class Order extends \Magento\Object * @param \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory * @param \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory * @param \Magento\Sales\Model\Order\Creditmemo\ItemFactory $creditmemoItemFactory + * @param \Magento\Object\Copy $objectCopyService * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Helper\Data $coreData, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Sales\Model\Quote\AddressFactory $quoteAddressFactory, \Magento\Sales\Model\Quote\PaymentFactory $quotePaymentFactory, @@ -120,10 +117,10 @@ class Order extends \Magento\Object \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory, \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory, \Magento\Sales\Model\Order\Creditmemo\ItemFactory $creditmemoItemFactory, + \Magento\Object\Copy $objectCopyService, array $data = array() ) { $this->_eventManager = $eventManager; - $this->_coreData = $coreData; $this->_quoteFactory = $quoteFactory; $this->_quoteAddressFactory = $quoteAddressFactory; $this->_quotePaymentFactory = $quotePaymentFactory; @@ -134,6 +131,7 @@ class Order extends \Magento\Object $this->_shipmentItemFactory = $shipmentItemFactory; $this->_creditmemoFactory = $creditmemoFactory; $this->_creditmemoItemFactory = $creditmemoItemFactory; + $this->_objectCopyService = $objectCopyService; parent::__construct($data); } @@ -153,7 +151,7 @@ class Order extends \Magento\Object $quote->setStoreId($order->getStoreId()) ->setOrderId($order->getId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order', 'to_quote', $order, $quote); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order', 'to_quote', $order, $quote); $this->_eventManager->dispatch('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote)); return $quote; @@ -169,7 +167,7 @@ class Order extends \Magento\Object { $address = $this->addressToQuoteAddress($order->getShippingAddress()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order', 'to_quote_address', $order, $address); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order', 'to_quote_address', $order, $address); return $address; } @@ -187,7 +185,7 @@ class Order extends \Magento\Object ->setCustomerId($address->getCustomerId()) ->setCustomerAddressId($address->getCustomerAddressId()); - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_order_address', 'to_quote_address', $address, @@ -212,7 +210,7 @@ class Order extends \Magento\Object $quotePayment->setStoreId($payment->getStoreId()) ->setCustomerPaymentId($payment->getCustomerPaymentId()); - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_order_payment', 'to_quote_payment', $payment, @@ -235,7 +233,7 @@ class Order extends \Magento\Object ->setProductId($item->getProductId()) ->setParentProductId($item->getParentProductId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order_item', 'to_quote_item', $item, $quoteItem); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order_item', 'to_quote_item', $item, $quoteItem); return $quoteItem; } @@ -254,7 +252,7 @@ class Order extends \Magento\Object ->setBillingAddressId($order->getBillingAddressId()) ->setShippingAddressId($order->getShippingAddressId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order', 'to_invoice', $order, $invoice); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order', 'to_invoice', $order, $invoice); return $invoice; } @@ -270,7 +268,7 @@ class Order extends \Magento\Object $invoiceItem->setOrderItem($item) ->setProductId($item->getProductId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order_item', 'to_invoice_item', $item, $invoiceItem); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order_item', 'to_invoice_item', $item, $invoiceItem); return $invoiceItem; } @@ -289,7 +287,7 @@ class Order extends \Magento\Object ->setBillingAddressId($order->getBillingAddressId()) ->setShippingAddressId($order->getShippingAddressId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order', 'to_shipment', $order, $shipment); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order', 'to_shipment', $order, $shipment); return $shipment; } @@ -305,7 +303,7 @@ class Order extends \Magento\Object $shipmentItem->setOrderItem($item) ->setProductId($item->getProductId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order_item', 'to_shipment_item', $item, $shipmentItem); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order_item', 'to_shipment_item', $item, $shipmentItem); return $shipmentItem; } @@ -324,7 +322,7 @@ class Order extends \Magento\Object ->setBillingAddressId($order->getBillingAddressId()) ->setShippingAddressId($order->getShippingAddressId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order', 'to_cm', $order, $creditmemo); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order', 'to_cm', $order, $creditmemo); return $creditmemo; } @@ -340,7 +338,7 @@ class Order extends \Magento\Object $creditmemoItem->setOrderItem($item) ->setProductId($item->getProductId()); - $this->_coreData->copyFieldsetToTarget('sales_convert_order_item', 'to_cm_item', $item, $creditmemoItem); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_order_item', 'to_cm_item', $item, $creditmemoItem); return $creditmemoItem; } } diff --git a/app/code/Magento/Sales/Model/Convert/Quote.php b/app/code/Magento/Sales/Model/Convert/Quote.php index 58f28d10775..88f998d1d21 100644 --- a/app/code/Magento/Sales/Model/Convert/Quote.php +++ b/app/code/Magento/Sales/Model/Convert/Quote.php @@ -31,13 +31,6 @@ namespace Magento\Sales\Model\Convert; class Quote extends \Magento\Object { - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData = null; - /** * Core event manager proxy * @@ -64,31 +57,35 @@ class Quote extends \Magento\Object * @var \Magento\Sales\Model\Order\ItemFactory */ protected $_orderItemFactory; + /** + * @var \Magento\Object\Copy + */ + private $_objectCopyService; /** * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Order\AddressFactory $orderAddressFactory * @param \Magento\Sales\Model\Order\PaymentFactory $orderPaymentFactory * @param \Magento\Sales\Model\Order\ItemFactory $orderItemFactory + * @param \Magento\Object\Copy $objectCopyService * @param array $data */ public function __construct( \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Helper\Data $coreData, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Order\AddressFactory $orderAddressFactory, \Magento\Sales\Model\Order\PaymentFactory $orderPaymentFactory, \Magento\Sales\Model\Order\ItemFactory $orderItemFactory, + \Magento\Object\Copy $objectCopyService, array $data = array() ) { $this->_eventManager = $eventManager; - $this->_coreData = $coreData; $this->_orderFactory = $orderFactory; $this->_orderAddressFactory = $orderAddressFactory; $this->_orderPaymentFactory = $orderPaymentFactory; $this->_orderItemFactory = $orderItemFactory; + $this->_objectCopyService = $objectCopyService; parent::__construct($data); } @@ -112,7 +109,7 @@ class Quote extends \Magento\Object ->setQuote($quote) ->setCustomer($quote->getCustomer()); - $this->_coreData->copyFieldsetToTarget('sales_convert_quote', 'to_order', $quote, $order); + $this->_objectCopyService->copyFieldsetToTarget('sales_convert_quote', 'to_order', $quote, $order); $this->_eventManager->dispatch('sales_convert_quote_to_order', array('order' => $order, 'quote' => $quote)); return $order; } @@ -130,7 +127,7 @@ class Quote extends \Magento\Object $order = $this->toOrder($address->getQuote()); } - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_quote_address', 'to_order', $address, @@ -158,7 +155,7 @@ class Quote extends \Magento\Object ->setCustomerId($address->getCustomerId()) ->setCustomerAddressId($address->getCustomerAddressId()); - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_quote_address', 'to_order_address', $address, @@ -183,7 +180,7 @@ class Quote extends \Magento\Object ->setStoreId($payment->getStoreId()) ->setCustomerPaymentId($payment->getCustomerPaymentId()); - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_quote_payment', 'to_order_payment', $payment, @@ -217,7 +214,7 @@ class Quote extends \Magento\Object $options = $item->getProduct()->getTypeInstance()->getOrderOptions($item->getProduct()); } $orderItem->setProductOptions($options); - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_quote_item', 'to_order_item', $item, @@ -229,7 +226,7 @@ class Quote extends \Magento\Object } if (!$item->getNoDiscount()) { - $this->_coreData->copyFieldsetToTarget( + $this->_objectCopyService->copyFieldsetToTarget( 'sales_convert_quote_item', 'to_order_item_discount', $item, diff --git a/app/code/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRenderer.php b/app/code/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRenderer.php index 763f210043c..4fbf0a09569 100644 --- a/app/code/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRenderer.php +++ b/app/code/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRenderer.php @@ -26,14 +26,14 @@ namespace Magento\Sales\Model\Observer\Backend\RecurringProfile; class FormRenderer { /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; /** - * @param \Magento\Core\Model\BlockFactory $blockFactory + * @param \Magento\View\Element\BlockFactory $blockFactory */ - public function __construct(\Magento\Core\Model\BlockFactory $blockFactory) + public function __construct(\Magento\View\Element\BlockFactory $blockFactory) { $this->_blockFactory = $blockFactory; } diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index cfa2c04f78b..ff892f85f59 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -416,13 +416,6 @@ class Order extends \Magento\Sales\Model\AbstractModel */ protected $_paymentData; - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - /** * Core event manager proxy * @@ -545,7 +538,6 @@ class Order extends \Magento\Sales\Model\AbstractModel */ public function __construct( \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Helper\Data $coreData, \Magento\Payment\Helper\Data $paymentData, \Magento\Sales\Helper\Data $salesData, \Magento\Core\Model\Context $context, @@ -573,7 +565,6 @@ class Order extends \Magento\Sales\Model\AbstractModel array $data = array() ) { $this->_eventManager = $eventManager; - $this->_coreData = $coreData; $this->_paymentData = $paymentData; $this->_salesData = $salesData; $this->_coreStoreConfig = $coreStoreConfig; @@ -2221,7 +2212,7 @@ class Order extends \Magento\Sales\Model\AbstractModel */ public function getCreatedAtFormated($format) { - return $this->_coreData->formatDate($this->getCreatedAtStoreDate(), $format, true); + return $this->_coreLocale->formatDate($this->getCreatedAtStoreDate(), $format, true); } /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index ce738275119..d2a2f60c3e0 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -82,11 +82,9 @@ abstract class AbstractPdf extends \Magento\Object protected $string; /** - * Core data - * - * @var \Magento\Core\Helper\Data + * @var \Magento\Core\Model\LocaleInterface */ - protected $_coreData; + protected $locale; /** * Core store config @@ -127,7 +125,6 @@ abstract class AbstractPdf extends \Magento\Object /** * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\Translate $translate @@ -136,13 +133,13 @@ abstract class AbstractPdf extends \Magento\Object * @param \Magento\Sales\Model\Order\Pdf\Config $pdfConfig * @param \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory * @param \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory + * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\Translate $translate, @@ -151,10 +148,11 @@ abstract class AbstractPdf extends \Magento\Object \Magento\Sales\Model\Order\Pdf\Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, + \Magento\Core\Model\LocaleInterface $locale, array $data = array() ) { $this->_paymentData = $paymentData; - $this->_coreData = $coreData; + $this->locale = $locale; $this->string = $string; $this->_coreStoreConfig = $coreStoreConfig; $this->_translate = $translate; @@ -380,7 +378,7 @@ abstract class AbstractPdf extends \Magento\Object ); } $page->drawText( - __('Order Date: ') . $this->_coreData->formatDate( + __('Order Date: ') . $this->locale->formatDate( $order->getCreatedAtStoreDate(), 'medium', false ), 35, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php index e135af8641e..e1c4359dbf6 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php @@ -31,11 +31,6 @@ namespace Magento\Sales\Model\Order\Pdf; class Creditmemo extends \Magento\Sales\Model\Order\Pdf\AbstractPdf { - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * @var \Magento\Core\Model\StoreManagerInterface */ @@ -43,7 +38,6 @@ class Creditmemo extends \Magento\Sales\Model\Order\Pdf\AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\Translate $translate @@ -60,7 +54,6 @@ class Creditmemo extends \Magento\Sales\Model\Order\Pdf\AbstractPdf */ public function __construct( \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\Translate $translate, @@ -73,11 +66,9 @@ class Creditmemo extends \Magento\Sales\Model\Order\Pdf\AbstractPdf \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { - $this->_locale = $locale; $this->_storeManager = $storeManager; parent::__construct( $paymentData, - $coreData, $string, $coreStoreConfig, $translate, @@ -86,6 +77,7 @@ class Creditmemo extends \Magento\Sales\Model\Order\Pdf\AbstractPdf $pdfConfig, $pdfTotalFactory, $pdfItemsFactory, + $locale, $data ); } @@ -180,7 +172,7 @@ class Creditmemo extends \Magento\Sales\Model\Order\Pdf\AbstractPdf foreach ($creditmemos as $creditmemo) { if ($creditmemo->getStoreId()) { - $this->_locale->emulate($creditmemo->getStoreId()); + $this->locale->emulate($creditmemo->getStoreId()); $this->_storeManager->setCurrentStore($creditmemo->getStoreId()); } $page = $this->newPage(); @@ -218,7 +210,7 @@ class Creditmemo extends \Magento\Sales\Model\Order\Pdf\AbstractPdf } $this->_afterGetPdf(); if ($creditmemo->getStoreId()) { - $this->_locale->revert(); + $this->locale->revert(); } return $pdf; } diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php index 79774eb3087..66d5cbffd2b 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php @@ -31,11 +31,6 @@ namespace Magento\Sales\Model\Order\Pdf; class Invoice extends \Magento\Sales\Model\Order\Pdf\AbstractPdf { - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * @var \Magento\Core\Model\StoreManagerInterface */ @@ -43,7 +38,6 @@ class Invoice extends \Magento\Sales\Model\Order\Pdf\AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\Translate $translate @@ -60,7 +54,6 @@ class Invoice extends \Magento\Sales\Model\Order\Pdf\AbstractPdf */ public function __construct( \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\Translate $translate, @@ -73,11 +66,9 @@ class Invoice extends \Magento\Sales\Model\Order\Pdf\AbstractPdf \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { - $this->_locale = $locale; $this->_storeManager = $storeManager; parent::__construct( $paymentData, - $coreData, $string, $coreStoreConfig, $translate, @@ -86,6 +77,7 @@ class Invoice extends \Magento\Sales\Model\Order\Pdf\AbstractPdf $pdfConfig, $pdfTotalFactory, $pdfItemsFactory, + $locale, $data ); } @@ -171,7 +163,7 @@ class Invoice extends \Magento\Sales\Model\Order\Pdf\AbstractPdf foreach ($invoices as $invoice) { if ($invoice->getStoreId()) { - $this->_locale->emulate($invoice->getStoreId()); + $this->locale->emulate($invoice->getStoreId()); $this->_storeManager->setCurrentStore($invoice->getStoreId()); } $page = $this->newPage(); @@ -204,7 +196,7 @@ class Invoice extends \Magento\Sales\Model\Order\Pdf\AbstractPdf /* Add totals */ $this->insertTotals($page, $invoice); if ($invoice->getStoreId()) { - $this->_locale->revert(); + $this->locale->revert(); } } $this->_afterGetPdf(); diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php index 9096e98fddc..d3dfe268480 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php @@ -31,11 +31,6 @@ namespace Magento\Sales\Model\Order\Pdf; class Shipment extends \Magento\Sales\Model\Order\Pdf\AbstractPdf { - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * @var \Magento\Core\Model\StoreManagerInterface */ @@ -43,7 +38,6 @@ class Shipment extends \Magento\Sales\Model\Order\Pdf\AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\Translate $translate @@ -60,7 +54,6 @@ class Shipment extends \Magento\Sales\Model\Order\Pdf\AbstractPdf */ public function __construct( \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\Translate $translate, @@ -73,11 +66,9 @@ class Shipment extends \Magento\Sales\Model\Order\Pdf\AbstractPdf \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { - $this->_locale = $locale; $this->_storeManager = $storeManager; parent::__construct( $paymentData, - $coreData, $string, $coreStoreConfig, $translate, @@ -86,6 +77,7 @@ class Shipment extends \Magento\Sales\Model\Order\Pdf\AbstractPdf $pdfConfig, $pdfTotalFactory, $pdfItemsFactory, + $locale, $data ); } @@ -151,7 +143,7 @@ class Shipment extends \Magento\Sales\Model\Order\Pdf\AbstractPdf $this->_setFontBold($style, 10); foreach ($shipments as $shipment) { if ($shipment->getStoreId()) { - $this->_locale->emulate($shipment->getStoreId()); + $this->locale->emulate($shipment->getStoreId()); $this->_storeManager->setCurrentStore($shipment->getStoreId()); } $page = $this->newPage(); @@ -184,7 +176,7 @@ class Shipment extends \Magento\Sales\Model\Order\Pdf\AbstractPdf } $this->_afterGetPdf(); if ($shipment->getStoreId()) { - $this->_locale->revert(); + $this->locale->revert(); } return $pdf; } diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Shipment/Packaging.php b/app/code/Magento/Sales/Model/Order/Pdf/Shipment/Packaging.php index d82a1daebe5..697c4ce8801 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Shipment/Packaging.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Shipment/Packaging.php @@ -38,11 +38,6 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf */ protected $_usaData = null; - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * @var \Magento\Core\Model\StoreManagerInterface */ @@ -55,7 +50,6 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\Translate $translate @@ -64,8 +58,8 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf * @param \Magento\Sales\Model\Order\Pdf\Config $pdfConfig * @param \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory * @param \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory - * @param \Magento\Usa\Helper\Data $usaData * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\Usa\Helper\Data $usaData * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\View\LayoutInterface $layout * @param array $data @@ -74,7 +68,6 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf */ public function __construct( \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\Translate $translate, @@ -83,18 +76,29 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf \Magento\Sales\Model\Order\Pdf\Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, - \Magento\Usa\Helper\Data $usaData, \Magento\Core\Model\LocaleInterface $locale, + \Magento\Usa\Helper\Data $usaData, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\View\LayoutInterface $layout, array $data = array() ) { $this->_usaData = $usaData; - $this->_locale = $locale; $this->_storeManager = $storeManager; $this->_layout = $layout; - parent::__construct($paymentData, $coreData, $string, $coreStoreConfig, $translate, $coreDir, - $shippingConfig, $pdfConfig, $pdfTotalFactory, $pdfItemsFactory, $data); + + parent::__construct( + $paymentData, + $string, + $coreStoreConfig, + $translate, + $coreDir, + $shippingConfig, + $pdfConfig, + $pdfTotalFactory, + $pdfItemsFactory, + $locale, + $data + ); } /** @@ -113,7 +117,7 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf $page = $this->newPage(); if ($shipment->getStoreId()) { - $this->_locale->emulate($shipment->getStoreId()); + $this->locale->emulate($shipment->getStoreId()); $this->_storeManager->setCurrentStore($shipment->getStoreId()); } @@ -126,7 +130,7 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf $this->_afterGetPdf(); if ($shipment->getStoreId()) { - $this->_locale->revert(); + $this->locale->revert(); } return $pdf; } diff --git a/app/code/Magento/Sales/Model/Order/Total/Config/Base.php b/app/code/Magento/Sales/Model/Order/Total/Config/Base.php index 0edca3ce0b9..348c48029df 100644 --- a/app/code/Magento/Sales/Model/Order/Total/Config/Base.php +++ b/app/code/Magento/Sales/Model/Order/Total/Config/Base.php @@ -58,14 +58,14 @@ class Base extends \Magento\Sales\Model\Config\Ordered protected $_orderTotalFactory; /** - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Logger $logger * @param \Magento\Sales\Model\Order\TotalFactory $orderTotalFactory * @param \Magento\Sales\Model\Config $salesConfig, * @param null $sourceData */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Logger $logger, \Magento\Sales\Model\Order\TotalFactory $orderTotalFactory, \Magento\Sales\Model\Config $salesConfig, diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php index 13a50a9c432..e09e442f1f7 100644 --- a/app/code/Magento/Sales/Model/Quote.php +++ b/app/code/Magento/Sales/Model/Quote.php @@ -193,13 +193,6 @@ class Quote extends \Magento\Core\Model\AbstractModel */ protected $_preventSaving = false; - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - /** * Catalog product * @@ -293,11 +286,15 @@ class Quote extends \Magento\Core\Model\AbstractModel */ protected $_recurringProfileFactory; + /** + * @var \Magento\Object\Copy + */ + protected $_objectCopyService; + /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig @@ -314,6 +311,7 @@ class Quote extends \Magento\Core\Model\AbstractModel * @param \Magento\Sales\Model\Quote\PaymentFactory $quotePaymentFactory * @param \Magento\Sales\Model\Resource\Quote\Payment\CollectionFactory $quotePaymentCollFactory * @param \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfileFactory + * @param \Magento\Object\Copy $objectCopyService * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -324,7 +322,6 @@ class Quote extends \Magento\Core\Model\AbstractModel \Magento\Event\ManagerInterface $eventManager, \Magento\Sales\Helper\Data $salesData, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, @@ -341,6 +338,7 @@ class Quote extends \Magento\Core\Model\AbstractModel \Magento\Sales\Model\Quote\PaymentFactory $quotePaymentFactory, \Magento\Sales\Model\Resource\Quote\Payment\CollectionFactory $quotePaymentCollFactory, \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfileFactory, + \Magento\Object\Copy $objectCopyService, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -348,7 +346,6 @@ class Quote extends \Magento\Core\Model\AbstractModel $this->_eventManager = $eventManager; $this->_salesData = $salesData; $this->_catalogProduct = $catalogProduct; - $this->_coreData = $coreData; $this->_coreStoreConfig = $coreStoreConfig; $this->_storeManager = $storeManager; $this->_config = $config; @@ -363,6 +360,7 @@ class Quote extends \Magento\Core\Model\AbstractModel $this->_quotePaymentFactory = $quotePaymentFactory; $this->_quotePaymentCollFactory = $quotePaymentCollFactory; $this->_recurringProfileFactory = $recurringProfileFactory; + $this->_objectCopyService = $objectCopyService; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -610,7 +608,7 @@ class Quote extends \Magento\Core\Model\AbstractModel { $this->_customer = $customer; $this->setCustomerId($customer->getId()); - $this->_coreData->copyFieldsetToTarget('customer_account', 'to_quote', $customer, $this); + $this->_objectCopyService->copyFieldsetToTarget('customer_account', 'to_quote', $customer, $this); return $this; } diff --git a/app/code/Magento/Sales/Model/Quote/Address.php b/app/code/Magento/Sales/Model/Quote/Address.php index 61fe7a91ef9..f1cd3e161a5 100644 --- a/app/code/Magento/Sales/Model/Quote/Address.php +++ b/app/code/Magento/Sales/Model/Quote/Address.php @@ -207,13 +207,6 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress */ protected $_nominalOnly = null; - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - /** * Core store config * @@ -257,7 +250,11 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress protected $_addressTotalFactory; /** - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Object\Copy + */ + protected $_objectCopyService; + + /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Core\Model\Context $context @@ -276,6 +273,7 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @param \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory * @param \Magento\Sales\Model\Quote\Address\Total\CollectorFactory $totalCollectorFactory * @param \Magento\Sales\Model\Quote\Address\TotalFactory $addressTotalFactory + * @param \Magento\Object\Copy $objectCopyService * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -283,7 +281,6 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\Event\ManagerInterface $eventManager, \Magento\Directory\Helper\Data $directoryData, \Magento\Core\Model\Context $context, @@ -302,11 +299,11 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory, \Magento\Sales\Model\Quote\Address\Total\CollectorFactory $totalCollectorFactory, \Magento\Sales\Model\Quote\Address\TotalFactory $addressTotalFactory, + \Magento\Object\Copy $objectCopyService, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->_coreData = $coreData; $this->_coreStoreConfig = $coreStoreConfig; $this->_addressFactory = $addressFactory; $this->_addressItemFactory = $addressItemFactory; @@ -317,6 +314,7 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress $this->_rateRequestFactory = $rateRequestFactory; $this->_totalCollectorFactory = $totalCollectorFactory; $this->_addressTotalFactory = $addressTotalFactory; + $this->_objectCopyService = $objectCopyService; parent::__construct( $eventManager, $directoryData, @@ -419,7 +417,7 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress */ public function importCustomerAddress(\Magento\Customer\Model\Address $address) { - $this->_coreData->copyFieldsetToTarget('customer_address', 'to_quote_address', $address, $this); + $this->_objectCopyService->copyFieldsetToTarget('customer_address', 'to_quote_address', $address, $this); $email = null; if ($address->hasEmail()) { $email = $address->getEmail(); @@ -440,8 +438,9 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress public function exportCustomerAddress() { $address = $this->_addressFactory->create(); - $this->_coreData - ->copyFieldsetToTarget('sales_convert_quote_address', 'to_customer_address', $this, $address); + $this->_objectCopyService->copyFieldsetToTarget( + 'sales_convert_quote_address', 'to_customer_address', $this, $address + ); return $address; } @@ -458,8 +457,9 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress ->setCustomerAddressId($address->getCustomerAddressId()) ->setEmail($address->getEmail()); - $this->_coreData - ->copyFieldsetToTarget('sales_convert_order_address', 'to_quote_address', $address, $this); + $this->_objectCopyService->copyFieldsetToTarget( + 'sales_convert_order_address', 'to_quote_address', $address, $this + ); return $this; } diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php b/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php index 168c4ddb795..e2bd1b29651 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php +++ b/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php @@ -84,7 +84,7 @@ class Collector extends \Magento\Sales\Model\Config\Ordered /** * Init corresponding total models * - * @param \Magento\Core\Model\Cache\Type\Config $configCacheType + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Logger $logger * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Sales\Model\Config $salesConfig @@ -94,7 +94,7 @@ class Collector extends \Magento\Sales\Model\Config\Ordered * @param \Magento\Simplexml\Element|null $sourceData */ public function __construct( - \Magento\Core\Model\Cache\Type\Config $configCacheType, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Logger $logger, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Sales\Model\Config $salesConfig, diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml index a12cb9ec3b3..59b14f98c35 100644 --- a/app/code/Magento/Sales/etc/fieldset.xml +++ b/app/code/Magento/Sales/etc/fieldset.xml @@ -26,7 +26,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_copy_order"> <field name="customer_email"> diff --git a/app/code/Magento/Sales/etc/frontend/page_types.xml b/app/code/Magento/Sales/etc/frontend/page_types.xml new file mode 100644 index 00000000000..5f1fa0ef8b5 --- /dev/null +++ b/app/code/Magento/Sales/etc/frontend/page_types.xml @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="sales_billing_agreement_index" label="Billing Agreement"/> + <type id="sales_billing_agreement_view" label="Billing Agreement View"/> + <type id="sales_guest_creditmemo" label="Guest Order Creditmemo View"/> + <type id="sales_guest_form" label="Returns"/> + <type id="sales_guest_invoice" label="Guest Order Invoice View"/> + <type id="sales_guest_print" label="Sales Order Print View"/> + <type id="sales_guest_printcreditmemo" label="Sales Creditmemo Print View"/> + <type id="sales_guest_printinvoice" label="Sales Invoice Print View"/> + <type id="sales_guest_printshipment" label="Sales Shipment Print View"/> + <type id="sales_guest_reorder" label="Sales Guest Reorder"/> + <type id="sales_guest_shipment" label="Guest Order Shipment View"/> + <type id="sales_guest_view" label="Guest Order View"/> + <type id="sales_order_creditmemo" label="Customer My Account Order Creditmemo View"/> + <type id="sales_order_history" label="Customer My Account Order History"/> + <type id="sales_order_invoice" label="Customer My Account Order Invoice View"/> + <type id="sales_order_print" label="Sales Order Print View"/> + <type id="sales_order_printcreditmemo" label="Sales Creditmemo Print View"/> + <type id="sales_order_printinvoice" label="Sales Invoice Print View"/> + <type id="sales_order_printshipment" label="Sales Shipment Print View"/> + <type id="sales_order_reorder" label="Sales Reorder"/> + <type id="sales_order_shipment" label="Customer My Account Order Shipment View"/> + <type id="sales_order_view" label="Customer My Account Order View"/> + <type id="sales_recurring_profile_index" label="Recurring Profile"/> + <type id="sales_recurring_profile_view" label="Recurring Profile View"/> +</page_types> diff --git a/app/code/Magento/Sales/view/adminhtml/order/comments/view.phtml b/app/code/Magento/Sales/view/adminhtml/order/comments/view.phtml index 91e9c147b13..d5dbb3841b0 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/comments/view.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/comments/view.phtml @@ -44,8 +44,8 @@ <ul class="note-list"> <?php foreach ($_entity->getCommentsCollection(true) as $_comment): ?> <li> - <span class="note-list-date"><?php echo $this->helper('Magento\Core\Helper\Data')->formatDate($_comment->getCreatedAtDate(), 'medium') ?></span> - <span class="note-list-time"><?php echo $this->helper('Magento\Core\Helper\Data')->formatTime($_comment->getCreatedAtDate(), 'medium') ?></span> + <span class="note-list-date"><?php echo $this->formatDate($_comment->getCreatedAtDate(), 'medium') ?></span> + <span class="note-list-time"><?php echo $this->formatTime($_comment->getCreatedAtDate(), 'medium') ?></span> <span class="note-list-customer"> <?php echo __('Customer') ?> <?php if ($_comment->getIsCustomerNotified()): ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/view/history.phtml b/app/code/Magento/Sales/view/adminhtml/order/view/history.phtml index 36d3eae0f0f..28082a107b4 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/view/history.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/view/history.phtml @@ -56,8 +56,8 @@ <ul class="note-list"> <?php foreach ($this->getOrder()->getStatusHistoryCollection(true) as $_item): ?> <li> - <span class="note-list-date"><?php echo $this->helper('Magento\Core\Helper\Data')->formatDate($_item->getCreatedAtDate(), 'medium') ?></span> - <span class="note-list-time"><?php echo $this->helper('Magento\Core\Helper\Data')->formatTime($_item->getCreatedAtDate(), 'medium') ?></span> + <span class="note-list-date"><?php echo $this->formatDate($_item->getCreatedAtDate(), 'medium') ?></span> + <span class="note-list-time"><?php echo $this->formatTime($_item->getCreatedAtDate(), 'medium') ?></span> <span class="note-list-status"><?php echo $_item->getStatusLabel() ?></span> <span class="note-list-customer"> <?php echo __('Customer') ?> diff --git a/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml index 20442ea3140..15f9ef2d9e5 100644 --- a/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="my.account.wrapper"> + <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\Recent" name="customer_account_dashboard_top" after="customer_account_dashboard_hello" template="order/recent.phtml"/> - </referenceBlock> + </referenceContainer> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_index.xml b/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_index.xml index 0eb79578e40..086f4708782 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Billing Agreement" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceBlock name="root"> <action method="setTemplate"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_view.xml index 9093b370404..0b65274f462 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_billing_agreement_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Billing Agreement View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceBlock name="root"> <action method="setTemplate"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml index 3d735d4fecf..ee81d2f1fd5 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Creditmemo Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Creditmemo Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Creditmemo\Items" name="items" template="email/creditmemo/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/creditmemo/default.phtml"/> <block class="Magento\Sales\Block\Order\Email\Items\Order\Grouped" as="grouped" template="email/items/creditmemo/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml index 11ff51bae7f..460f70256df 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Invoice Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Invoice Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Invoice\Items" name="items" template="email/invoice/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/invoice/default.phtml"/> <block class="Magento\Sales\Block\Order\Email\Items\Order\Grouped" as="grouped" template="email/items/invoice/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml index 125e058b82f..be51800c3cc 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Order Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Order Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Items" name="items" template="email/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder" as="default" template="email/items/order/default.phtml"/> <block class="Magento\Sales\Block\Order\Email\Items\Order\Grouped" as="grouped" template="email/items/order/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml index 948e627b452..4832ea1604f 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Shipment Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Shipment Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Shipment\Items" name="items" template="email/shipment/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/shipment/default.phtml"/> </block> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml index 8b875fec3c2..e526965c14b 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order Creditmemo View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml index fd9731b7a37..8d41209b100 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Returns" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml index ff12ccdb39d..baae67bfea3 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order Invoice View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printorder.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml similarity index 95% rename from app/code/Magento/Sales/view/frontend/layout/sales_guest_printorder.xml rename to app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml index 028083d2091..a133df2e9a7 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printorder.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Order Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintShipment" name="sales.order.print" template="order/print.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printordercreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml similarity index 94% rename from app/code/Magento/Sales/view/frontend/layout/sales_guest_printordercreditmemo.xml rename to app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml index a8af83e3966..e1d9c827e93 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printordercreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Creditmemo Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Creditmemo" name="sales.order.print.creditmemo" template="order/print/creditmemo.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printorderinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml similarity index 94% rename from app/code/Magento/Sales/view/frontend/layout/sales_guest_printorderinvoice.xml rename to app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml index 74c99bc2b02..e7d01f355a0 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printorderinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Invoice Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Invoice" name="sales.order.print.invoice" template="order/print/invoice.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml index c9b3c3dd228..89fe6aa71f0 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Shipment Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Shipment" name="sales.order.print.shipment" template="order/print/shipment.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml index a5a1d6d97da..fb11d85006e 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Guest Reorder" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml index 1ca20c876af..0fb69339a3e 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order Shipment View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml index bef1f64cc68..ad6d71da074 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml index 206d1e853b3..65eca5ac25f 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order Creditmemo View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml index 244db3b4843..7cef22b6c45 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order History" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\History" name="sales.order.history"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml index bc422dd897f..483fcf55d56 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order Invoice View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml index 0ca941a869e..26800320ee7 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Order Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintShipment" name="sales.order.print" template="order/print.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printordercreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml similarity index 94% rename from app/code/Magento/Sales/view/frontend/layout/sales_order_printordercreditmemo.xml rename to app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml index 2c3df77fc7e..ff1495acf1f 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printordercreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Creditmemo Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Creditmemo" name="sales.order.print.creditmemo" template="order/print/creditmemo.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printorderinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml similarity index 95% rename from app/code/Magento/Sales/view/frontend/layout/sales_order_printorderinvoice.xml rename to app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml index 7df3af50607..9ec6691978c 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printorderinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Invoice Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Invoice" name="sales.order.print.invoice" template="order/print/invoice.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml index e9f1682cde3..4804aed2ab7 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Shipment Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Shipment" name="sales.order.print.shipment" template="order/print/shipment.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml index c246af7a129..4ab3b665ee1 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Reorder" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\View" name="sales.order.view"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml index b48bbb83697..e3d20d51e69 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order Shipment View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml index ddde2494e29..3bdaf1b391c 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_index.xml b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_index.xml index 57be56d1936..fa41d0ee611 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceBlock name="root"> <action method="setTemplate"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_orders.xml b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_orders.xml index f4266eab8ed..2b51b67e6a3 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_orders.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_orders.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile Orders List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <update handle="sales_recurring_profile_view__tabs"/> <referenceBlock name="sales.recurring.profile.view.tab.orders"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view.xml index 816ad80e9be..d9775f02ef3 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <update handle="sales_recurring_profile_view__tabs"/> <referenceBlock name="sales.recurring.profile.view.tab.profile"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml index 6900e63f006..69193005494 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile View Tabs" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile View Tabs" design_abstraction="custom"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-left.phtml</argument> diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Collection.php b/app/code/Magento/SalesRule/Model/Rule/Action/Collection.php index 0f3314c01b1..4cec475d06e 100644 --- a/app/code/Magento/SalesRule/Model/Rule/Action/Collection.php +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Collection.php @@ -30,13 +30,13 @@ namespace Magento\SalesRule\Model\Rule\Action; class Collection extends \Magento\Rule\Model\Action\Collection { /** - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Rule\Model\ActionFactory $actionFactory * @param \Magento\View\LayoutInterface $layout * @param array $data */ public function __construct( - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Rule\Model\ActionFactory $actionFactory, \Magento\View\LayoutInterface $layout, array $data = array() diff --git a/app/code/Magento/SalesRule/etc/fieldset.xml b/app/code/Magento/SalesRule/etc/fieldset.xml index 63b6b58d0c3..8c8c7142889 100644 --- a/app/code/Magento/SalesRule/etc/fieldset.xml +++ b/app/code/Magento/SalesRule/etc/fieldset.xml @@ -26,7 +26,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="discount_description"> @@ -40,4 +40,4 @@ </field> </fieldset> </scope> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/Sendfriend/etc/frontend/page_types.xml b/app/code/Magento/Sendfriend/etc/frontend/page_types.xml new file mode 100644 index 00000000000..30c616b056b --- /dev/null +++ b/app/code/Magento/Sendfriend/etc/frontend/page_types.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="sendfriend_product_send" label="Catalog Product Email to a Friend"/> +</page_types> diff --git a/app/code/Magento/Sendfriend/view/frontend/layout/sendfriend_product_send.xml b/app/code/Magento/Sendfriend/view/frontend/layout/sendfriend_product_send.xml index 27dce03336e..6f44077195e 100644 --- a/app/code/Magento/Sendfriend/view/frontend/layout/sendfriend_product_send.xml +++ b/app/code/Magento/Sendfriend/view/frontend/layout/sendfriend_product_send.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Email to a Friend" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Shipping/etc/frontend/page_types.xml b/app/code/Magento/Shipping/etc/frontend/page_types.xml new file mode 100644 index 00000000000..8bc03ece9af --- /dev/null +++ b/app/code/Magento/Shipping/etc/frontend/page_types.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page_types> + <type id="shipping_tracking_popup" label="Shipment Tracking Popup"/> +</page_types> diff --git a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml index 75df863046a..9d08f3e45c1 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Shipment Tracking Popup" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">popup.phtml</argument> diff --git a/app/code/Magento/Tax/etc/fieldset.xml b/app/code/Magento/Tax/etc/fieldset.xml index b23a6618452..bc96a6d62a2 100644 --- a/app/code/Magento/Tax/etc/fieldset.xml +++ b/app/code/Magento/Tax/etc/fieldset.xml @@ -26,7 +26,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="subtotal_incl_tax"> @@ -63,4 +63,4 @@ </field> </fieldset> </scope> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php index 61a16e2a6c0..8329c8fef99 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php @@ -32,7 +32,7 @@ namespace Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Form\Element; class Image extends \Magento\Data\Form\Element\Image { /** - * @var \Magento\Core\Model\Theme\Image\Path + * @var \Magento\View\Design\Theme\Image\PathInterface */ protected $_imagePath; @@ -41,7 +41,7 @@ class Image extends \Magento\Data\Form\Element\Image * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection * @param \Magento\UrlInterface $urlBuilder - * @param \Magento\Core\Model\Theme\Image\Path $imagePath + * @param \Magento\View\Design\Theme\Image\PathInterface $imagePath * @param array $attributes */ public function __construct( @@ -49,17 +49,11 @@ class Image extends \Magento\Data\Form\Element\Image \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\UrlInterface $urlBuilder, - \Magento\Core\Model\Theme\Image\Path $imagePath, + \Magento\View\Design\Theme\Image\PathInterface $imagePath, $attributes = array() ) { $this->_imagePath = $imagePath; - parent::__construct( - $escaper, - $factoryElement, - $factoryCollection, - $urlBuilder, - $attributes - ); + parent::__construct($escaper, $factoryElement, $factoryCollection, $urlBuilder, $attributes); } /** diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php index cc6c7279f2d..e1ce4bb991a 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php @@ -42,7 +42,7 @@ class General protected $_isThemeEditable = false; /** - * @var \Magento\Core\Model\Theme\Image\Path + * @var \Magento\View\Design\Theme\Image\PathInterface */ protected $_themeImagePath; @@ -57,7 +57,7 @@ class General * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Theme\Image\Path $themeImagePath + * @param \Magento\View\Design\Theme\Image\PathInterface $themeImagePath * @param \Magento\File\Size $fileSize * @param array $data */ @@ -67,7 +67,7 @@ class General \Magento\Backend\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Theme\Image\Path $themeImagePath, + \Magento\View\Design\Theme\Image\PathInterface $themeImagePath, \Magento\File\Size $fileSize, array $data = array() ) { diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php index 0652e5fc5b1..4dbc9e72d5a 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php @@ -61,7 +61,7 @@ class Js 'legend' => __('Theme Java Script'), )); $customization = $this->_getCurrentTheme()->getCustomization(); - $customJsFiles = $customization->getFilesByType(\Magento\Core\Model\Theme\Customization\File\Js::TYPE); + $customJsFiles = $customization->getFilesByType(\Magento\View\Design\Theme\Customization\File\Js::TYPE); /** @var $jsFieldsetRenderer \Magento\Backend\Block\Widget\Form\Renderer\Fieldset */ $jsFieldsetRenderer = $this->getChildBlock('theme_edit_tabs_tab_js_tab_content'); diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php index 6644a2b938a..10aeb0df0e3 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php @@ -86,7 +86,7 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action /** @var $theme \Magento\View\Design\ThemeInterface */ $theme = $this->_objectManager->create('Magento\View\Design\ThemeInterface'); try { - $theme->setType(\Magento\Core\Model\Theme::TYPE_VIRTUAL); + $theme->setType(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL); if ($themeId && (!$theme->load($themeId)->getId() || !$theme->isVisible())) { throw new \Magento\Core\Exception(__('We cannot find theme "%1".', $themeId)); } @@ -124,8 +124,8 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action $removeJsFiles = (array)$this->getRequest()->getParam('js_removed_files'); $reorderJsFiles = array_keys($this->getRequest()->getParam('js_order', array())); - /** @var $themeFactory \Magento\Core\Model\Theme\FlyweightFactory */ - $themeFactory = $this->_objectManager->get('Magento\Core\Model\Theme\FlyweightFactory'); + /** @var $themeFactory \Magento\View\Design\Theme\FlyweightFactory */ + $themeFactory = $this->_objectManager->get('Magento\View\Design\Theme\FlyweightFactory'); /** @var $cssService \Magento\Theme\Model\Theme\Customization\File\CustomCss */ $cssService = $this->_objectManager->get('Magento\Theme\Model\Theme\Customization\File\CustomCss'); /** @var $singleFile \Magento\Theme\Model\Theme\SingleFile */ @@ -137,7 +137,7 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action $theme = $themeFactory->create($themeData['theme_id']); } else { $parentTheme = $themeFactory->create($themeData['parent_id']); - $theme = $parentTheme->getDomainModel(\Magento\Core\Model\Theme::TYPE_PHYSICAL) + $theme = $parentTheme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL) ->createVirtualTheme($parentTheme); } if ($theme && !$theme->isEditable()) { @@ -148,10 +148,10 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action $theme->getThemeImage()->removePreviewImage(); } $theme->getThemeImage()->uploadPreviewImage('preview'); - $theme->setType(\Magento\Core\Model\Theme::TYPE_VIRTUAL); + $theme->setType(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL); $theme->save(); $customization = $theme->getCustomization(); - $customization->reorder(\Magento\Core\Model\Theme\Customization\File\Js::TYPE, $reorderJsFiles); + $customization->reorder(\Magento\View\Design\Theme\Customization\File\Js::TYPE, $reorderJsFiles); $customization->delete($removeJsFiles); $singleFile->update($theme, $customCssData); $this->_getSession()->addSuccess(__('You saved the theme.')); @@ -233,10 +233,10 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action $themeId = $this->getRequest()->getParam('id'); /** @var $serviceModel \Magento\Theme\Model\Uploader\Service */ $serviceModel = $this->_objectManager->get('Magento\Theme\Model\Uploader\Service'); - /** @var $themeFactory \Magento\Core\Model\Theme\FlyweightFactory */ - $themeFactory = $this->_objectManager->get('Magento\Core\Model\Theme\FlyweightFactory'); - /** @var $jsService \Magento\Core\Model\Theme\Customization\File\Js */ - $jsService = $this->_objectManager->get('Magento\Core\Model\Theme\Customization\File\Js'); + /** @var $themeFactory \Magento\View\Design\Theme\FlyweightFactory */ + $themeFactory = $this->_objectManager->get('Magento\View\Design\Theme\FlyweightFactory'); + /** @var $jsService \Magento\View\Design\Theme\Customization\File\Js */ + $jsService = $this->_objectManager->get('Magento\View\Design\Theme\Customization\File\Js'); try { $theme = $themeFactory->create($themeId); if (!$theme) { @@ -249,10 +249,10 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action $jsFile->setData('content', $jsFileData['content']); $jsFile->save(); - /** @var $customization \Magento\Core\Model\Theme\Customization */ - $customization = $this->_objectManager->create('Magento\Core\Model\Theme\Customization', + /** @var $customization \Magento\View\Design\Theme\Customization */ + $customization = $this->_objectManager->create('Magento\View\Design\Theme\CustomizationInterface', array('theme' => $theme)); - $customJsFiles = $customization->getFilesByType(\Magento\Core\Model\Theme\Customization\File\Js::TYPE); + $customJsFiles = $customization->getFilesByType(\Magento\View\Design\Theme\Customization\File\Js::TYPE); $result = array('error' => false, 'files' => $customization->generateFileInfo($customJsFiles)); } catch (\Magento\Core\Exception $e) { $result = array('error' => true, 'message' => $e->getMessage()); @@ -270,8 +270,8 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action { $themeId = $this->getRequest()->getParam('theme_id'); try { - /** @var $themeFactory \Magento\Core\Model\Theme\FlyweightFactory */ - $themeFactory = $this->_objectManager->create('Magento\Core\Model\Theme\FlyweightFactory'); + /** @var $themeFactory \Magento\View\Design\Theme\FlyweightFactory */ + $themeFactory = $this->_objectManager->create('Magento\View\Design\Theme\FlyweightFactory'); $theme = $themeFactory->create($themeId); if (!$theme) { throw new \InvalidArgumentException(sprintf('We cannot find a theme with id "%1".', $themeId)); @@ -280,7 +280,7 @@ class Theme extends \Magento\Backend\Controller\Adminhtml\Action $customCssFiles = $theme->getCustomization()->getFilesByType( \Magento\Theme\Model\Theme\Customization\File\CustomCss::TYPE ); - /** @var $customCssFile \Magento\Core\Model\Theme\FileInterface */ + /** @var $customCssFile \Magento\View\Design\Theme\FileInterface */ $customCssFile = reset($customCssFiles); if ($customCssFile && $customCssFile->getContent()) { $this->_prepareDownloadResponse( diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index 1a9b5b3d971..67ec4f52584 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -93,20 +93,20 @@ class Storage extends \Magento\Core\Helper\AbstractHelper protected $_session; /** - * @var \Magento\Core\Model\Theme\FlyweightFactory + * @var \Magento\View\Design\Theme\FlyweightFactory */ protected $_themeFactory; /** * @param \Magento\Filesystem $filesystem * @param \Magento\Backend\Model\Session $session - * @param \Magento\Core\Model\Theme\FlyweightFactory $themeFactory + * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory * @param \Magento\Core\Helper\Context $context */ public function __construct( \Magento\Filesystem $filesystem, \Magento\Backend\Model\Session $session, - \Magento\Core\Model\Theme\FlyweightFactory $themeFactory, + \Magento\View\Design\Theme\FlyweightFactory $themeFactory, \Magento\Core\Helper\Context $context ) { parent::__construct($context); diff --git a/app/code/Magento/Theme/Model/Config.php b/app/code/Magento/Theme/Model/Config.php index 45d9a961678..171aa7b00dd 100644 --- a/app/code/Magento/Theme/Model/Config.php +++ b/app/code/Magento/Theme/Model/Config.php @@ -142,11 +142,11 @@ class Config /** * Unassign given theme from stores that were unchecked * - * @param int $themeId + * @param string $themeId * @param array $stores * @param string $scope * @param bool $isReassigned - * @return $this + * @return Config */ protected function _unassignThemeFromStores($themeId, $stores, $scope, &$isReassigned) { @@ -163,11 +163,11 @@ class Config /** * Assign given theme to stores * - * @param int $themeId + * @param string $themeId * @param array $stores * @param string $scope * @param bool $isReassigned - * @return $this + * @return Config */ protected function _assignThemeToStores($themeId, $stores, $scope, &$isReassigned) { @@ -184,9 +184,9 @@ class Config /** * Assign theme to default scope * - * @param int $themeId + * @param string $themeId * @param bool $isReassigned - * @return $this + * @return Config */ protected function _assignThemeToDefaultScope($themeId, &$isReassigned) { diff --git a/app/code/Magento/Theme/Model/Config/Customization.php b/app/code/Magento/Theme/Model/Config/Customization.php index e86ad5868cb..58dce11ff25 100644 --- a/app/code/Magento/Theme/Model/Config/Customization.php +++ b/app/code/Magento/Theme/Model/Config/Customization.php @@ -42,9 +42,9 @@ class Customization protected $_design; /** - * @var \Magento\Core\Model\Resource\Theme\CollectionFactory + * @var \Magento\View\Design\Theme\ThemeProviderInterface */ - protected $_collectionFactory; + protected $themeProvider; /** * Theme customizations which are assigned to store views or as default @@ -63,18 +63,18 @@ class Customization protected $_unassignedTheme; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager, + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $collectionFactory + * @param \Magento\View\Design\Theme\ThemeProviderInterface $themeProvider */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Resource\Theme\CollectionFactory $collectionFactory + \Magento\View\Design\Theme\ThemeProviderInterface $themeProvider ) { - $this->_storeManager = $storeManager; - $this->_design = $design; - $this->_collectionFactory = $collectionFactory; + $this->_storeManager = $storeManager; + $this->_design = $design; + $this->themeProvider = $themeProvider; } /** @@ -184,13 +184,12 @@ class Customization * NOTE: To get into "assigned" list theme customization not necessary should be assigned to store-view directly. * It can be set to website or as default theme and be used by store-view via config fallback mechanism. * - * @return $this + * @return Customization */ protected function _prepareThemeCustomizations() { /** @var \Magento\Core\Model\Resource\Theme\Collection $themeCollection */ - $themeCollection = $this->_collectionFactory->create(); - $themeCollection->filterThemeCustomizations(); + $themeCollection = $this->themeProvider->getThemeCustomizations(\Magento\Core\Model\App\Area::AREA_FRONTEND); $assignedThemes = $this->getStoresByThemes(); @@ -209,6 +208,4 @@ class Customization return $this; } - - } diff --git a/app/code/Magento/Theme/Model/Theme/Customization/File/CustomCss.php b/app/code/Magento/Theme/Model/Theme/Customization/File/CustomCss.php index fb815405984..1be19d8656e 100644 --- a/app/code/Magento/Theme/Model/Theme/Customization/File/CustomCss.php +++ b/app/code/Magento/Theme/Model/Theme/Customization/File/CustomCss.php @@ -30,7 +30,7 @@ namespace Magento\Theme\Model\Theme\Customization\File; class CustomCss - extends \Magento\Core\Model\Theme\Customization\AbstractFile + extends \Magento\View\Design\Theme\Customization\AbstractFile { /**#@+ * Custom CSS file type customization @@ -68,7 +68,7 @@ class CustomCss /** * {@inheritdoc} */ - protected function _prepareFileName(\Magento\Core\Model\Theme\FileInterface $file) + protected function _prepareFileName(\Magento\View\Design\Theme\FileInterface $file) { if (!$file->getFileName()) { $file->setFileName(self::FILE_NAME); @@ -78,7 +78,7 @@ class CustomCss /** * {@inheritdoc} */ - protected function _prepareSortOrder(\Magento\Core\Model\Theme\FileInterface $file) + protected function _prepareSortOrder(\Magento\View\Design\Theme\FileInterface $file) { $file->setData('sort_order', self::SORT_ORDER); } diff --git a/app/code/Magento/Theme/Model/Theme/SingleFile.php b/app/code/Magento/Theme/Model/Theme/SingleFile.php index 7fba79bb644..e93a2c36586 100644 --- a/app/code/Magento/Theme/Model/Theme/SingleFile.php +++ b/app/code/Magento/Theme/Model/Theme/SingleFile.php @@ -32,14 +32,14 @@ namespace Magento\Theme\Model\Theme; class SingleFile { /** - * @var \Magento\Core\Model\Theme\Customization\FileInterface + * @var \Magento\View\Design\Theme\Customization\FileInterface */ protected $_fileService; /** - * @param \Magento\Core\Model\Theme\Customization\FileInterface $fileService + * @param \Magento\View\Design\Theme\Customization\FileInterface $fileService */ - public function __construct(\Magento\Core\Model\Theme\Customization\FileInterface $fileService) + public function __construct(\Magento\View\Design\Theme\Customization\FileInterface $fileService) { $this->_fileService = $fileService; } @@ -49,7 +49,7 @@ class SingleFile * * @param \Magento\View\Design\ThemeInterface $themeModel * @param string $fileContent - * @return \Magento\Core\Model\Theme\FileInterface + * @return \Magento\View\Design\Theme\FileInterface */ public function update(\Magento\View\Design\ThemeInterface $themeModel, $fileContent) { diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index 7929bdb736c..a6cebc9def5 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -79,7 +79,7 @@ class Storage protected $_objectManager; /** - * @var \Magento\Core\Model\Image\AdapterFactory + * @var \Magento\Image\AdapterFactory */ protected $_imageFactory; @@ -89,13 +89,13 @@ class Storage * @param \Magento\Filesystem $filesystem * @param \Magento\Theme\Helper\Storage $helper * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Image\AdapterFactory $imageFactory + * @param \Magento\Image\AdapterFactory $imageFactory */ public function __construct( \Magento\Filesystem $filesystem, \Magento\Theme\Helper\Storage $helper, \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Image\AdapterFactory $imageFactory + \Magento\Image\AdapterFactory $imageFactory ) { $this->_filesystem = $filesystem; $this->_filesystem->setIsAllowCreateDirectories(true); diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml index 6972c90799a..e0d6c92995b 100644 --- a/app/code/Magento/Theme/etc/di.xml +++ b/app/code/Magento/Theme/etc/di.xml @@ -26,10 +26,10 @@ <config> <type name="Magento\Theme\Model\Config"> <param name="configCache"> - <instance type="Magento\Core\Model\Cache\Type\Config" /> + <instance type="Magento\App\Cache\Type\Config" /> </param> <param name="layoutCache"> - <instance type="Magento\Core\Model\Cache\Type\Layout" /> + <instance type="Magento\App\Cache\Type\Layout" /> </param> </type> <type name="Magento\Theme\Model\Uploader\Service"> diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php index e2ce5fa841d..37694a8ad23 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php @@ -53,14 +53,14 @@ class PageBuilder protected $_page; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; /** * Create font instances */ - public function __construct(\Magento\Core\Model\View\FileSystem $viewFileSystem) + public function __construct(\Magento\View\FileSystem $viewFileSystem) { $this->_viewFileSystem = $viewFileSystem; $this->_fontNormal = \Zend_Pdf_Font::fontWithName(\Zend_Pdf_Font::FONT_HELVETICA); diff --git a/app/code/Magento/User/data/user_setup/data-upgrade-1.6.1.4-1.6.1.5.php b/app/code/Magento/User/data/user_setup/data-upgrade-1.6.1.4-1.6.1.5.php new file mode 100644 index 00000000000..b1d01f3ede9 --- /dev/null +++ b/app/code/Magento/User/data/user_setup/data-upgrade-1.6.1.4-1.6.1.5.php @@ -0,0 +1,37 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer \Magento\Core\Model\Resource\Setup */ +$installer = $this; +$installer->startSetup(); + +$tableName = $installer->getTable('admin_rule'); + +if ($tableName) { + /** @var \Magento\DB\Adapter\AdapterInterface $connection */ + $connection = $installer->getConnection(); + $connection->delete($tableName, array('resource_id = ?' => 'Magento_Oauth::oauth')); +} + +$installer->endSetup(); diff --git a/app/code/Magento/User/etc/module.xml b/app/code/Magento/User/etc/module.xml index 2d9ce412799..99ad2b98d25 100755 --- a/app/code/Magento/User/etc/module.xml +++ b/app/code/Magento/User/etc/module.xml @@ -24,7 +24,7 @@ */ --> <config> - <module name="Magento_User" version="1.6.1.4" active="true"> + <module name="Magento_User" version="1.6.1.5" active="true"> <sequence> <module name="Magento_Backend"/> </sequence> @@ -51,7 +51,6 @@ <module name="Magento_GoogleShopping"/> <module name="Magento_ImportExport"/> <module name="Magento_Index"/> - <module name="Magento_Oauth"/> <module name="Magento_PageCache"/> <module name="Magento_Payment"/> <module name="Magento_Paypal"/> diff --git a/app/code/Magento/Webapi/Controller/Rest.php b/app/code/Magento/Webapi/Controller/Rest.php index 6092263c482..ab2be5435ad 100644 --- a/app/code/Magento/Webapi/Controller/Rest.php +++ b/app/code/Magento/Webapi/Controller/Rest.php @@ -42,10 +42,10 @@ class Rest implements \Magento\App\FrontControllerInterface /** @var \Magento\App\State */ protected $_appState; - /** @var \Magento\Oauth\Service\OauthV1Interface */ + /** @var \Magento\Oauth\OauthInterface */ protected $_oauthService; - /** @var \Magento\Oauth\Helper\Data */ + /** @var \Magento\Oauth\Helper\Request */ protected $_oauthHelper; /** @@ -54,8 +54,8 @@ class Rest implements \Magento\App\FrontControllerInterface * @param Rest\Router $router * @param \Magento\ObjectManager $objectManager * @param \Magento\App\State $appState - * @param \Magento\Oauth\Service\OauthV1Interface $oauthService - * @param \Magento\Oauth\Helper\Data $oauthHelper + * @param \Magento\Oauth\OauthInterface $oauthService + * @param \Magento\Oauth\Helper\Request $oauthHelper */ public function __construct( \Magento\Webapi\Controller\Rest\Request $request, @@ -63,8 +63,8 @@ class Rest implements \Magento\App\FrontControllerInterface \Magento\Webapi\Controller\Rest\Router $router, \Magento\ObjectManager $objectManager, \Magento\App\State $appState, - \Magento\Oauth\Service\OauthV1Interface $oauthService, - \Magento\Oauth\Helper\Data $oauthHelper + \Magento\Oauth\OauthInterface $oauthService, + \Magento\Oauth\Helper\Request $oauthHelper ) { $this->_router = $router; $this->_request = $request; @@ -100,8 +100,13 @@ class Rest implements \Magento\App\FrontControllerInterface if (!$this->_appState->isInstalled()) { throw new \Magento\Webapi\Exception(__('Magento is not yet installed')); } - $oauthReq = $this->_oauthHelper->prepareServiceRequest($this->_request, $this->_request->getRequestData()); - $this->_oauthService->validateAccessTokenRequest($oauthReq); + $requestUrl = $this->_oauthHelper->getRequestUrl($this->_request); + $oauthRequest = $this->_oauthHelper->prepareRequest( + $this->_request, $requestUrl, $this->_request->getRequestData() + ); + $this->_oauthService->validateAccessTokenRequest( + $oauthRequest, $requestUrl, $this->_request->getMethod() + ); $route = $this->_router->match($this->_request); if ($route->isSecure() && !$this->_request->isSecure()) { diff --git a/app/code/Magento/Webapi/Controller/Soap.php b/app/code/Magento/Webapi/Controller/Soap.php index 2d689a2a65c..b326d47dc3a 100644 --- a/app/code/Magento/Webapi/Controller/Soap.php +++ b/app/code/Magento/Webapi/Controller/Soap.php @@ -58,12 +58,9 @@ class Soap implements \Magento\App\FrontControllerInterface /** @var \Magento\Core\Model\App */ protected $_application; - /** @var \Magento\Oauth\Service\OauthV1Interface */ + /** @var \Magento\Oauth\OauthInterface */ protected $_oauthService; - /** @var \Magento\Oauth\Helper\Service */ - protected $_oauthHelper; - /** * Initialize dependencies. * @@ -74,8 +71,7 @@ class Soap implements \Magento\App\FrontControllerInterface * @param \Magento\Webapi\Controller\ErrorProcessor $errorProcessor * @param \Magento\App\State $appState * @param \Magento\Core\Model\AppInterface $application - * @param \Magento\Oauth\Service\OauthV1Interface $oauthService - * @param \Magento\Oauth\Helper\Service $oauthHelper + * @param \Magento\Oauth\OauthInterface $oauthService */ public function __construct( \Magento\Webapi\Controller\Soap\Request $request, @@ -85,8 +81,7 @@ class Soap implements \Magento\App\FrontControllerInterface \Magento\Webapi\Controller\ErrorProcessor $errorProcessor, \Magento\App\State $appState, \Magento\Core\Model\AppInterface $application, - \Magento\Oauth\Service\OauthV1Interface $oauthService, - \Magento\Oauth\Helper\Service $oauthHelper + \Magento\Oauth\OauthInterface $oauthService ) { $this->_request = $request; $this->_response = $response; @@ -96,7 +91,6 @@ class Soap implements \Magento\App\FrontControllerInterface $this->_appState = $appState; $this->_application = $application; $this->_oauthService = $oauthService; - $this->_oauthHelper = $oauthHelper; } /** @@ -129,7 +123,7 @@ class Soap implements \Magento\App\FrontControllerInterface ); $this->_setResponseContentType(self::CONTENT_TYPE_WSDL_REQUEST); } else { - $this->_oauthService->validateAccessToken(array('token' => $this->_getAccessToken())); + $this->_oauthService->validateAccessToken($this->_getAccessToken()); $responseBody = $this->_soapServer->handle(); $this->_setResponseContentType(self::CONTENT_TYPE_SOAP_CALL); } diff --git a/app/code/Magento/Webapi/Model/Acl/Cache.php b/app/code/Magento/Webapi/Model/Acl/Cache.php index 386746ad9ec..a988190ece6 100644 --- a/app/code/Magento/Webapi/Model/Acl/Cache.php +++ b/app/code/Magento/Webapi/Model/Acl/Cache.php @@ -28,10 +28,10 @@ namespace Magento\Webapi\Model\Acl; class Cache extends \Magento\Core\Model\Acl\Cache { /** - * @param \Magento\Core\Model\Cache\Type\Config $cache + * @param \Magento\App\Cache\Type\Config $cache * @param string $cacheKey */ - public function __construct(\Magento\Core\Model\Cache\Type\Config $cache, $cacheKey) + public function __construct(\Magento\App\Cache\Type\Config $cache, $cacheKey) { parent::__construct($cache, $cacheKey); } diff --git a/app/code/Magento/Webapi/Model/Acl/User/Factory.php b/app/code/Magento/Webapi/Model/Acl/User/Factory.php index 39937c74840..142afb7de44 100644 --- a/app/code/Magento/Webapi/Model/Acl/User/Factory.php +++ b/app/code/Magento/Webapi/Model/Acl/User/Factory.php @@ -25,7 +25,7 @@ */ namespace Magento\Webapi\Model\Acl\User; -class Factory extends \Magento\Oauth\Model\Consumer\Factory +class Factory extends \Magento\Integration\Model\Oauth\Consumer\Factory { const CLASS_NAME = 'Magento\Webapi\Model\Acl\User'; diff --git a/app/code/Magento/Webapi/Model/Cache/Type.php b/app/code/Magento/Webapi/Model/Cache/Type.php index 162236a6caf..7b611066e3f 100644 --- a/app/code/Magento/Webapi/Model/Cache/Type.php +++ b/app/code/Magento/Webapi/Model/Cache/Type.php @@ -42,9 +42,9 @@ class Type extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'WEBSERVICE'; /** - * @param \Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Webapi/Model/Config.php b/app/code/Magento/Webapi/Model/Config.php index f87023a891c..0387cedd83d 100644 --- a/app/code/Magento/Webapi/Model/Config.php +++ b/app/code/Magento/Webapi/Model/Config.php @@ -39,7 +39,7 @@ class Config const SERVICE_CLASS_PATTERN = '/^(.+?)\\\\(.+?)\\\\Service(\\\\.+)+(V\d+)Interface$/'; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; diff --git a/app/code/Magento/Webapi/etc/di.xml b/app/code/Magento/Webapi/etc/di.xml index eb2e6b5fd1e..51b4048d2ac 100644 --- a/app/code/Magento/Webapi/etc/di.xml +++ b/app/code/Magento/Webapi/etc/di.xml @@ -158,7 +158,7 @@ <instance type="Magento\Webapi\Controller\Rest\Router\Proxy"/> </param> <param name="oauthHelper"> - <instance type="Magento\Oauth\Helper\Data\Proxy"/> + <instance type="Magento\Oauth\Helper\Request\Proxy"/> </param> </type> <type name="Magento\Webapi\Controller\Soap"> @@ -168,8 +168,5 @@ <param name="errorProcessor"> <instance type="Magento\Webapi\Controller\ErrorProcessor\Proxy"/> </param> - <param name="oauthHelper"> - <instance type="Magento\Oauth\Helper\Service\Proxy"/> - </param> </type> </config> diff --git a/app/code/Magento/Webapi/etc/module.xml b/app/code/Magento/Webapi/etc/module.xml index a24b37e1a85..570c2f364ad 100755 --- a/app/code/Magento/Webapi/etc/module.xml +++ b/app/code/Magento/Webapi/etc/module.xml @@ -27,13 +27,13 @@ <module name="Magento_Webapi" version="1.0.0.3" active="true"> <sequence> <module name="Magento_Core"/> - <module name="Magento_Oauth"/> + <module name="Magento_Integration"/> <module name="Magento_Service"/> <module name="Magento_Backend"/> </sequence> <depends> <module name="Magento_Core"/> - <module name="Magento_Oauth"/> + <module name="Magento_Integration"/> <module name="Magento_Service"/> <module name="Magento_Backend"/> </depends> diff --git a/app/code/Magento/Weee/etc/fieldset.xml b/app/code/Magento/Weee/etc/fieldset.xml index debcaee5f78..72812182fb4 100644 --- a/app/code/Magento/Weee/etc/fieldset.xml +++ b/app/code/Magento/Weee/etc/fieldset.xml @@ -26,7 +26,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_item"> <field name="weee_tax_applied"> @@ -96,4 +96,4 @@ </field> </fieldset> </scope> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php index b8a9d8f80bb..6e6e1aee703 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php @@ -89,6 +89,7 @@ class Container extends \Magento\Core\Block\Html\Select /** @var $layoutProcessor \Magento\View\Layout\ProcessorInterface */ $layoutProcessor = $this->_layoutProcessorFactory->create($layoutMergeParams); $layoutProcessor->addPageHandles(array($this->getLayoutHandle())); + $layoutProcessor->addPageHandles(array('default')); $layoutProcessor->load(); $containers = $layoutProcessor->getContainers(); diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php new file mode 100644 index 00000000000..b9f93409d72 --- /dev/null +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php @@ -0,0 +1,148 @@ +<?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 Magento + * @package Magento_Widget + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser; + +/** + * Widget Instance design abstractions chooser + * + * @method getArea() + * @method getTheme() + */ +class DesignAbstraction extends \Magento\Core\Block\Html\Select +{ + /** + * @var \Magento\View\Layout\ProcessorFactory + */ + protected $_layoutProcessorFactory; + + /** + * @var \Magento\Core\Model\Resource\Theme\CollectionFactory + */ + protected $_themesFactory; + + /** + * @var \Magento\App\State + */ + protected $_appState; + + /** + * @param \Magento\Core\Block\Context $context + * @param \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory + * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory + * @param \Magento\App\State $appState + * @param array $data + */ + public function __construct( + \Magento\Core\Block\Context $context, + \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory, + \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory, + \Magento\App\State $appState, + array $data = array() + ) { + $this->_layoutProcessorFactory = $layoutProcessorFactory; + $this->_themesFactory = $themesFactory; + $this->_appState = $appState; + parent::__construct($context, $data); + } + + /** + * Add necessary options + * + * @return \Magento\Core\Block\AbstractBlock + */ + protected function _beforeToHtml() + { + if (!$this->getOptions()) { + $this->addOption('', __('-- Please Select --')); + $layoutUpdateParams = array( + 'theme' => $this->_getThemeInstance($this->getTheme()), + ); + $designAbstractions = $this->_appState->emulateAreaCode( + 'frontend', + array($this->_getLayoutProcessor($layoutUpdateParams), 'getAllDesignAbstractions') + ); + $this->_addDesignAbstractionOptions($designAbstractions); + } + return parent::_beforeToHtml(); + } + + /** + * Retrieve theme instance by its identifier + * + * @param int $themeId + * @return \Magento\Core\Model\Theme|null + */ + protected function _getThemeInstance($themeId) + { + /** @var \Magento\Core\Model\Resource\Theme\Collection $themeCollection */ + $themeCollection = $this->_themesFactory->create(); + return $themeCollection->getItemById($themeId); + } + + /** + * Retrieve new layout merge model instance + * + * @param array $arguments + * @return \Magento\View\Layout\ProcessorInterface + */ + protected function _getLayoutProcessor(array $arguments) + { + return $this->_layoutProcessorFactory->create($arguments); + } + + /** + * Add design abstractions information to the options + * + * @param array $designAbstractions + */ + protected function _addDesignAbstractionOptions(array $designAbstractions) + { + $label = array(); + // Sort list of design abstractions by label + foreach ($designAbstractions as $key => $row) { + $label[$key] = $row['label']; + } + array_multisort($label, SORT_STRING, $designAbstractions); + + // Group the layout options + $customLayouts = array(); + $pageLayouts = array(); + + foreach ($designAbstractions as $pageTypeName => $pageTypeInfo) { + if ($pageTypeInfo['design_abstraction'] === + \Magento\Core\Model\Layout\Merge::DESIGN_ABSTRACTION_PAGE_LAYOUT) { + $pageLayouts[] = array('value' => $pageTypeName, 'label' => $pageTypeInfo['label']); + } + else { + $customLayouts[] = array('value' => $pageTypeName, 'label' => $pageTypeInfo['label']); + } + } + $params = array(); + $this->addOption($customLayouts, __('Custom Layouts'), $params); + $this->addOption($pageLayouts, __('Page Layouts'), $params); + } +} diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php index b97da01e738..f8be6127628 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php @@ -35,37 +35,21 @@ namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser; class Layout extends \Magento\Core\Block\Html\Select { /** - * @var \Magento\View\Layout\ProcessorFactory + * @var \Magento\Core\Model\Layout\PageType\Config */ - protected $_layoutProcessorFactory; - - /** - * @var \Magento\Core\Model\Resource\Theme\CollectionFactory - */ - protected $_themesFactory; - - /** - * @var \Magento\App\State - */ - protected $_appState; + protected $_config; /** * @param \Magento\Core\Block\Context $context - * @param \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory - * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory - * @param \Magento\App\State $appState + * @param \Magento\Core\Model\Layout\PageType\Config $config * @param array $data */ public function __construct( \Magento\Core\Block\Context $context, - \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory, - \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory, - \Magento\App\State $appState, + \Magento\Core\Model\Layout\PageType\Config $config, array $data = array() ) { - $this->_layoutProcessorFactory = $layoutProcessorFactory; - $this->_themesFactory = $themesFactory; - $this->_appState = $appState; + $this->_config = $config; parent::__construct($context, $data); } @@ -78,42 +62,12 @@ class Layout extends \Magento\Core\Block\Html\Select { if (!$this->getOptions()) { $this->addOption('', __('-- Please Select --')); - $layoutUpdateParams = array( - 'theme' => $this->_getThemeInstance($this->getTheme()), - ); - $pageTypes = $this->_appState->emulateAreaCode( - 'frontend', - array($this->_getLayoutProcessor($layoutUpdateParams), 'getAllPageHandles') - ); + $pageTypes = $this->_config->getPageTypes(); $this->_addPageTypeOptions($pageTypes); } return parent::_beforeToHtml(); } - /** - * Retrieve theme instance by its identifier - * - * @param int $themeId - * @return \Magento\Core\Model\Theme|null - */ - protected function _getThemeInstance($themeId) - { - /** @var \Magento\Core\Model\Resource\Theme\Collection $themeCollection */ - $themeCollection = $this->_themesFactory->create(); - return $themeCollection->getItemById($themeId); - } - - /** - * Retrieve new layout merge model instance - * - * @param array $arguments - * @return \Magento\View\Layout\ProcessorInterface - */ - protected function _getLayoutProcessor(array $arguments) - { - return $this->_layoutProcessorFactory->create($arguments); - } - /** * Add page types information to the options * @@ -130,7 +84,6 @@ class Layout extends \Magento\Core\Block\Html\Select foreach ($pageTypes as $pageTypeName => $pageTypeInfo) { $params = array(); - $this->addOption($pageTypeName, $pageTypeInfo['label'], $params); } } diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index 7762d5fe86a..1a6ffddf0f3 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -203,6 +203,10 @@ class Layout array( 'value' => 'pages', 'label' => $this->escapeJsQuote(__('Specified Page')) + ), + array( + 'value' => 'page_layouts', + 'label' => $this->escapeJsQuote(__('Page Layouts')) ) ) ); @@ -275,6 +279,26 @@ class Layout return $chooserBlock->toHtml(); } + /** + * Retrieve layout select chooser html + * + * @return string + */ + public function getPageLayoutsPageChooser() + { + $chooserBlock = $this->getLayout() + ->createBlock('Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\DesignAbstraction') + ->setName('widget_instance[{{id}}][page_layouts][layout_handle]') + ->setId('layout_handle') + ->setClass('required-entry select') + ->setExtraParams("onchange=\"WidgetInstance.loadSelectBoxByType(\'block_reference\', " + . "this.up(\'div.pages\'), this.value)\"") + ->setArea($this->getWidgetInstance()->getArea()) + ->setTheme($this->getWidgetInstance()->getThemeId()) + ; + return $chooserBlock->toHtml(); + } + /** * Retrieve add layout button html * diff --git a/app/code/Magento/Widget/Model/Template/Filter.php b/app/code/Magento/Widget/Model/Template/Filter.php index c21947dd5ba..8db19daa417 100644 --- a/app/code/Magento/Widget/Model/Template/Filter.php +++ b/app/code/Magento/Widget/Model/Template/Filter.php @@ -45,7 +45,7 @@ class Filter extends \Magento\Cms\Model\Template\Filter * @param \Magento\Stdlib\String $string * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\VariableFactory $coreVariableFactory * @param \Magento\Core\Model\StoreManager $storeManager @@ -59,7 +59,7 @@ class Filter extends \Magento\Cms\Model\Template\Filter \Magento\Stdlib\String $string, \Magento\Logger $logger, \Magento\Escaper $escaper, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\VariableFactory $coreVariableFactory, \Magento\Core\Model\StoreManager $storeManager, diff --git a/app/code/Magento/Widget/Model/Widget.php b/app/code/Magento/Widget/Model/Widget.php index d05254c5799..dbabbcd5dc2 100644 --- a/app/code/Magento/Widget/Model/Widget.php +++ b/app/code/Magento/Widget/Model/Widget.php @@ -41,17 +41,17 @@ class Widget protected $_dataStorage; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_configCacheType; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -68,15 +68,15 @@ class Widget /** * @param \Magento\Escaper $escaper * @param \Magento\Widget\Model\Config\Data $dataStorage - * @param \Magento\Core\Model\View\Url $viewUrl - * @param \Magento\Core\Model\View\Url $viewUrl - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl + * @param \Magento\View\FileSystem $viewFileSystem */ public function __construct( \Magento\Escaper $escaper, \Magento\Widget\Model\Config\Data $dataStorage, - \Magento\Core\Model\View\Url $viewUrl, - \Magento\Core\Model\View\FileSystem $viewFileSystem + \Magento\View\Url $viewUrl, + \Magento\View\FileSystem $viewFileSystem ) { $this->_escaper = $escaper; $this->_dataStorage = $dataStorage; diff --git a/app/code/Magento/Widget/Model/Widget/Config.php b/app/code/Magento/Widget/Model/Widget/Config.php index d4d85e5208d..3f773c1da5d 100644 --- a/app/code/Magento/Widget/Model/Widget/Config.php +++ b/app/code/Magento/Widget/Model/Widget/Config.php @@ -30,7 +30,7 @@ namespace Magento\Widget\Model\Widget; class Config { /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -57,13 +57,13 @@ class Config /** * @param \Magento\Backend\Model\Url $backendUrl * @param \Magento\Core\Helper\Data $coreHelper - * @param \Magento\Core\Model\View\Url $viewUrl + * @param \Magento\View\Url $viewUrl * @param \Magento\Widget\Model\WidgetFactory $widgetFactory */ public function __construct( \Magento\Backend\Model\Url $backendUrl, \Magento\Core\Helper\Data $coreHelper, - \Magento\Core\Model\View\Url $viewUrl, + \Magento\View\Url $viewUrl, \Magento\Widget\Model\WidgetFactory $widgetFactory ) { $this->_backendUrl = $backendUrl; diff --git a/app/code/Magento/Widget/Model/Widget/Instance.php b/app/code/Magento/Widget/Model/Widget/Instance.php index 39ec5567ab5..2d0aa22e233 100644 --- a/app/code/Magento/Widget/Model/Widget/Instance.php +++ b/app/code/Magento/Widget/Model/Widget/Instance.php @@ -75,7 +75,7 @@ class Instance extends \Magento\Core\Model\AbstractModel protected $_eventPrefix = 'widget_widget_instance'; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -88,7 +88,7 @@ class Instance extends \Magento\Core\Model\AbstractModel protected $_namespaceResolver; /** - * @var \Magento\Core\Model\Cache\TypeListInterface + * @var \Magento\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -111,8 +111,8 @@ class Instance extends \Magento\Core\Model\AbstractModel * @param \Magento\Escaper $escaper * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem - * @param \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList + * @param \Magento\View\FileSystem $viewFileSystem + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Catalog\Model\Product\Type $productType * @param \Magento\Widget\Model\Config\Reader $reader * @param \Magento\Widget\Model\Widget $widgetModel @@ -127,8 +127,8 @@ class Instance extends \Magento\Core\Model\AbstractModel \Magento\Escaper $escaper, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\View\FileSystem $viewFileSystem, - \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList, + \Magento\View\FileSystem $viewFileSystem, + \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\Catalog\Model\Product\Type $productType, \Magento\Widget\Model\Config\Reader $reader, \Magento\Widget\Model\Widget $widgetModel, diff --git a/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml b/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml index 9bdee8c5210..1f6cd54e6d7 100644 --- a/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml +++ b/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml @@ -157,6 +157,37 @@ var pageGroupTemplate = '<div class="fieldset-wrapper page_group_container" id=" '</tbody>'+ '</table>'+ '</div>'+ +'<div class="no-display ignore-validate pages group_container" id="page_layouts_{{id}}">'+ + '<input type="hidden" class="container_name" name="__[container_name]" value="widget_instance[{{id}}][page_layouts]" />'+ + '<input type="hidden" name="widget_instance[{{id}}][page_layouts][page_id]" value="{{page_id}}" />'+ + '<input type="hidden" class="for_all" name="widget_instance[{{id}}][page_layouts][for]" value="all" />'+ + '<table cellspacing="0" class="data-table">'+ + '<col width="200" />'+ + '<thead>'+ + '<tr>'+ + '<th><label><?php echo $this->escapeJsQuote(__('Page')) ?> <span class="required">*</span></label></th>'+ + '<th><label><?php echo $this->escapeJsQuote(__('Container')) ?> <span class="required">*</span></label></th>'+ + '<th><label><?php echo $this->escapeJsQuote(__('Template')) ?></label></th>'+ + '</tr>'+ + '</thead>'+ + '<tbody>'+ + '<tr>'+ + '<td><?php echo $this->getPageLayoutsPageChooser() ?></td>'+ + '<td>'+ + '<div class="block_reference_container">'+ + '<div class="block_reference"></div>'+ + '</div>'+ + '</td>'+ + '<td>'+ + '<div class="block_template_container">'+ + '<div class="block_template"></div>'+ + '</div>'+ + '</td>'+ + '<td> </td>'+ + '</tr>'+ + '</tbody>'+ + '</table>'+ +'</div>'+ '</div>'+ '</div>'; diff --git a/app/code/Magento/Wishlist/Block/AbstractBlock.php b/app/code/Magento/Wishlist/Block/AbstractBlock.php index 106ec277361..0a51ab94b1e 100644 --- a/app/code/Magento/Wishlist/Block/AbstractBlock.php +++ b/app/code/Magento/Wishlist/Block/AbstractBlock.php @@ -82,8 +82,6 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd protected $_productFactory; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -91,6 +89,7 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -106,6 +105,7 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -114,8 +114,16 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd $this->_wishlistData = $wishlistData; $this->_customerSession = $customerSession; $this->_productFactory = $productFactory; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, - $taxData, $catalogData, $coreData, $context, $data + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $data ); } diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php index dae3c2899b9..0ffbbd94aec 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php @@ -42,8 +42,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock protected $_helperPool; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -51,6 +49,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -67,6 +66,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -82,6 +82,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock $catalogData, $coreData, $context, + $mathRandom, $wishlistData, $customerSession, $productFactory, diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php index 45ba766ba59..514bc462ac8 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php @@ -41,8 +41,6 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock protected $_helperPool; /** - * Construct - * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $coreRegistry @@ -50,13 +48,12 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Helper\Product\ConfigurationPool $helperPool * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -66,6 +63,7 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -81,6 +79,7 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock $catalogData, $coreData, $context, + $mathRandom, $wishlistData, $customerSession, $productFactory, diff --git a/app/code/Magento/Wishlist/Block/Share/Wishlist.php b/app/code/Magento/Wishlist/Block/Share/Wishlist.php index e914e73f8a6..f692b972451 100644 --- a/app/code/Magento/Wishlist/Block/Share/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Share/Wishlist.php @@ -56,6 +56,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Math\Random $mathRandom * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -70,16 +71,28 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Core\Block\Template\Context $context, + \Magento\Math\Random $mathRandom, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, array $data = array() - ) - { + ) { $this->_customerFactory = $customerFactory; - parent::__construct($storeManager, $catalogConfig, $coreRegistry, $taxData, $catalogData, $coreData, - $context, $wishlistData, $customerSession, $productFactory, $data); + parent::__construct( + $storeManager, + $catalogConfig, + $coreRegistry, + $taxData, + $catalogData, + $coreData, + $context, + $mathRandom, + $wishlistData, + $customerSession, + $productFactory, + $data + ); } /** diff --git a/app/code/Magento/Oauth/etc/adminhtml/menu.xml b/app/code/Magento/Wishlist/etc/frontend/page_types.xml similarity index 73% rename from app/code/Magento/Oauth/etc/adminhtml/menu.xml rename to app/code/Magento/Wishlist/etc/frontend/page_types.xml index d6192ce289e..e728403ddd5 100644 --- a/app/code/Magento/Oauth/etc/adminhtml/menu.xml +++ b/app/code/Magento/Wishlist/etc/frontend/page_types.xml @@ -1,8 +1,6 @@ <?xml version="1.0"?> <!-- /** - * Admin menu settings for oAuth module. - * * Magento * * NOTICE OF LICENSE @@ -25,10 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config> - <menu> - <add id="Magento_Oauth::system_oauth_consumer" title="Add-On Management" - module="Magento_Oauth" sortOrder="13" parent="Magento_Webapi::system_webapi" - action="adminhtml/oauth_consumer/index" resource="Magento_Oauth::oauth"/> - </menu> -</config> +<page_types> + <type id="wishlist_index_index" label="Customer My Account My Wish List"/> + <type id="wishlist_index_share" label="Customer My Account Wish List Sharing Form"/> + <type id="wishlist_shared_index" label="Customer Shared Wish List View"/> + <type id="wishlist_index_configure" label="Configure Wish list Item"/> +</page_types> diff --git a/app/code/Magento/Wishlist/view/frontend/button/share.phtml b/app/code/Magento/Wishlist/view/frontend/button/share.phtml index 8e04f804ec8..f55648e3aee 100644 --- a/app/code/Magento/Wishlist/view/frontend/button/share.phtml +++ b/app/code/Magento/Wishlist/view/frontend/button/share.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -27,5 +26,7 @@ /** @var $this \Magento\Wishlist\Block\Customer\Wishlist\Button */ ?> <?php if($this->getWishlist()->getItemsCount() && $this->getWishlist()->getShared() < $this->getConfig()->getSharingEmailLimit()): ?> - <button type="submit" name="save_and_share" title="<?php echo __('Share Wish List') ?>" class="button btn-share"><span><span><?php echo __('Share Wish List') ?></span></span></button> + <button type="submit" name="save_and_share" title="<?php echo __('Share Wish List') ?>" class="action share"> + <span><?php echo __('Share Wish List') ?></span> + </button> <?php endif;?> diff --git a/app/code/Magento/Wishlist/view/frontend/button/tocart.phtml b/app/code/Magento/Wishlist/view/frontend/button/tocart.phtml index 1c36cb247ad..e52b8e8429a 100644 --- a/app/code/Magento/Wishlist/view/frontend/button/tocart.phtml +++ b/app/code/Magento/Wishlist/view/frontend/button/tocart.phtml @@ -19,12 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php if($this->getWishlist()->getItemsCount() && $this->getWishlist()->isSalable()): ?> - <button type="button" title="<?php echo __('Add All to Cart') ?>" class="button btn-add"><span><span><?php echo __('Add All to Cart') ?></span></span></button> + <button type="button" title="<?php echo __('Add All to Cart') ?>" class="action tocart"> + <span><?php echo __('Add All to Cart') ?></span> + </button> <?php endif;?> diff --git a/app/code/Magento/Wishlist/view/frontend/button/update.phtml b/app/code/Magento/Wishlist/view/frontend/button/update.phtml index 360ef83ef08..ad4eca6deac 100644 --- a/app/code/Magento/Wishlist/view/frontend/button/update.phtml +++ b/app/code/Magento/Wishlist/view/frontend/button/update.phtml @@ -19,12 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php if($this->getWishlist()->getItemsCount()): ?> - <button type="submit" name="do" title="<?php echo __('Update Wish List') ?>" class="button btn-update"><span><span><?php echo __('Update Wish List') ?></span></span></button> + <button type="submit" name="do" title="<?php echo __('Update Wish List') ?>" class="action update"> + <span><?php echo __('Update Wish List') ?></span> + </button> <?php endif;?> diff --git a/app/code/Magento/Wishlist/view/frontend/email/items.phtml b/app/code/Magento/Wishlist/view/frontend/email/items.phtml index 9fe0ef8cf30..a0674c1a492 100644 --- a/app/code/Magento/Wishlist/view/frontend/email/items.phtml +++ b/app/code/Magento/Wishlist/view/frontend/email/items.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -27,30 +26,51 @@ ?> <?php $l = $this->getWishlistItemsCount() ?> <div style="border:1px solid #E0E0E0; padding:15px; background:#F9F9F9;"> -<table cellspacing="0" cellpadding="0" border="0" width="650"> - <tr> - <?php $i = 0; foreach ($this->getWishlistItems() as $item): $i++ ?> - <?php /* @var $item \Magento\Wishlist\Model\Item */ ?> - <?php /* @var $_product \Magento\Catalog\Model\Product */ ?> - <?php $_product = $item->getProduct(); ?> - <td width="32%"> - <p align="center" style="font-size:12px;"><a href="<?php echo $this->getProductUrl($_product) ?>"><img src="<?php echo $this->getSmallImageUrl($_product); ?>" width="<?php echo $this->getSmallImageSize()?>" height="<?php echo $this->getSmallImageSize()?>" style="border:1px solid #ccc;" alt="" /></a></p> - <p align="center" style="font-size:12px;"><a href="<?php echo $this->getProductUrl($_product) ?>" style="color:#203548;"><strong><?php echo $this->escapeHtml($_product->getName()) ?></strong></a></p> - <?php if($this->hasDescription($item)): ?><p align="center" style="font-size:12px;"><?php echo __('Comment') ?>:<br /><?php echo $this->getEscapedDescription($item) ?></p><?php endif; ?> - <p align="center" style="font-size:12px;"><a href="<?php echo $this->getProductUrl($_product) ?>" style="color:#1E7EC8;"><?php echo __('View Product') ?></a> <small> - <?php if ($_product->getIsSalable()): ?>|</small> <a href="<?php echo $this->getAddToCartUrl($_product) ?>" style="color:#1E7EC8;"><strong><?php echo __('Add to Cart') ?></strong></a><?php endif;?> - </p></td> - <?php if ($i%3!=0): ?> - <td width="2%"></td> - <?php else: ?> - </tr> + <table cellspacing="0" cellpadding="0" border="0" width="650"> + <tr> + <?php $i = 0; + foreach ($this->getWishlistItems() as $item): $i++ ?> + <?php /* @var $item \Magento\Wishlist\Model\Item */ ?> + <?php /* @var $_product \Magento\Catalog\Model\Product */ ?> + <?php $_product = $item->getProduct(); ?> + <td width="32%" class="col product"> + <p align="center" style="font-size:12px;"> + <a href="<?php echo $this->getProductUrl($_product) ?>"> + <img src="<?php echo $this->getSmallImageUrl($_product); ?>" width="<?php echo $this->getSmallImageSize() ?>" height="<?php echo $this->getSmallImageSize() ?>" style="border:1px solid #ccc;" alt=""/> + </a> + </p> + + <p align="center" style="font-size:12px;"> + <a href="<?php echo $this->getProductUrl($_product) ?>" style="color:#203548;"> + <strong><?php echo $this->escapeHtml($_product->getName()) ?></strong> + </a> + </p> + <?php if ($this->hasDescription($item)): ?> + <p align="center" style="font-size:12px;"><?php echo __('Comment') ?>: + <br/><?php echo $this->getEscapedDescription($item) ?></p><?php endif; ?> + <p align="center" style="font-size:12px;"> + <a href="<?php echo $this->getProductUrl($_product) ?>" style="color:#1E7EC8;"> + <?php echo __('View Product') ?> + </a> + <small>|</small> + <?php if ($_product->getIsSalable()): ?> + <a href="<?php echo $this->getAddToCartUrl($_product) ?>" style="color:#1E7EC8;"> + <strong><?php echo __('Add to Cart') ?></strong> + </a> + <?php endif; ?> + </p> + </td> + <?php if ($i % 3 != 0): ?> + <td width="2%"></td> + <?php else: ?> + </tr> + <tr> + <td colspan="5"> </td> + </tr> + <?php if ($i < $l): ?> <tr> - <td colspan="5"> </td> - </tr> - <?php if ($i<$l): ?> - <tr> <?php endif ?> - <?php endif ?> - <?php endforeach ?> -</table> + <?php endif ?> + <?php endforeach ?> + </table> </div> diff --git a/app/code/Magento/Wishlist/view/frontend/email/rss.phtml b/app/code/Magento/Wishlist/view/frontend/email/rss.phtml index bd539d435e5..a52552ff97b 100644 --- a/app/code/Magento/Wishlist/view/frontend/email/rss.phtml +++ b/app/code/Magento/Wishlist/view/frontend/email/rss.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml b/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml index 5039cad7d0a..52a7d61f4c4 100644 --- a/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml +++ b/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -32,28 +31,35 @@ $options = $this->getChildBlock('customer.wishlist.item.options') ->setItem($item) ->getConfiguredOptions(); ?> -<div class="cart-cell"> - <?php echo $this->getPriceHtml($product, empty($options));?> - <div class="add-to-cart-alt"> - <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?> - <input type="text" class="input-text qty" data-validate="{required:true,'validate-greater-than-zero':true}" name="qty[<?php echo $item->getId() ?>]" - value="<?php echo $this->getAddToCartQty($item) * 1 ?>"/> - <?php endif; ?> - <?php if ($product->isSaleable()): ?> - <button type="button" title="<?php echo __('Add to Cart') ?>" data-item-id="<?php echo $item->getId()?>" class="button btn-cart"><span><span><?php echo __('Add to Cart') ?></span></span></button> +<?php echo $this->getPriceHtml($product, empty($options));?> +<div class="box tocart"> + <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?> + <input type="text" class="input-text qty" data-validate="{required:true,'validate-greater-than-zero':true}" + name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>"> + <?php endif; ?> + <?php if ($product->isSaleable()): ?> + <button type="button" title="<?php echo __('Add to Cart') ?>" data-item-id="<?php echo $item->getId()?>" class="action tocart"> + <span><?php echo __('Add to Cart') ?></span> + </button> + <?php else: ?> + <?php if ($product->getIsSalable()): ?> + <p class="available stock" title="<?php echo __('Availability') ?>"> + <span><?php echo __('In stock') ?></span> + </p> <?php else: ?> - <?php if ($product->getIsSalable()): ?> - <p class="availability in-stock"><span><?php echo __('In stock') ?></span></p> - <?php else: ?> - <p class="availability out-of-stock"><span><?php echo __('Out of stock') ?></span></p> - <?php endif; ?> + <p class="unavailable stock" title="<?php echo __('Availability') ?>"> + <span><?php echo __('Out of stock') ?></span> + </p> <?php endif; ?> - </div> - <?php foreach ($this->getChildNames() as $childName): ?> - <?php echo $this->getLayout()->renderElement($childName, false); ?> - <?php endforeach;?> - <?php if ($product->isVisibleInSiteVisibility()): ?> - <p><a class="link-edit" href="<?php echo $this->getItemConfigureUrl($item) ?>"><?php echo __('Edit') ?></a> - </p> - <?php endif ?> + <?php endif; ?> </div> +<?php foreach ($this->getChildNames() as $childName): ?> + <?php echo $this->getLayout()->renderElement($childName, false); ?> +<?php endforeach;?> +<?php if ($product->isVisibleInSiteVisibility()): ?> + <p> + <a class="action edit" href="<?php echo $this->getItemConfigureUrl($item) ?>"> + <span><?php echo __('Edit') ?></span> + </a> + </p> +<?php endif ?> diff --git a/app/code/Magento/Wishlist/view/frontend/item/column/image.phtml b/app/code/Magento/Wishlist/view/frontend/item/column/image.phtml index 8b473e23c75..5d5bd9f71e7 100644 --- a/app/code/Magento/Wishlist/view/frontend/item/column/image.phtml +++ b/app/code/Magento/Wishlist/view/frontend/item/column/image.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -27,7 +26,8 @@ /* @var \Magento\Wishlist\Model\Item $item */ $item = $this->getItem(); $product = $item->getProduct(); +$imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image'); ?> -<a class="product-image" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> - <img src="<?php echo $this->helper('Magento\Catalog\Helper\Image')->init($product, 'small_image')->resize(113, 113); ?>" width="113" height="113" alt="<?php echo $this->escapeHtml($product->getName()) ?>" /> +<a class="product photo" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> + <?php echo $imageBlock->init($product, 'wishlist_thumbnail')->toHtml() ?> </a> diff --git a/app/code/Magento/Wishlist/view/frontend/item/column/info.phtml b/app/code/Magento/Wishlist/view/frontend/item/column/info.phtml index be0038f57e5..d638f0bb903 100644 --- a/app/code/Magento/Wishlist/view/frontend/item/column/info.phtml +++ b/app/code/Magento/Wishlist/view/frontend/item/column/info.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -28,14 +27,20 @@ $item = $this->getItem(); $product = $item->getProduct(); ?> -<h3 class="product-name"><a href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></h3> -<div class="description std"><div class="inner"><?php echo $this->escapeHtml($this->stripTags($product->getShortDescription()));?></div></div> -<textarea name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" title="<?php echo __('Comment') ?>"><?php echo ($this->escapeHtml($item->getDescription())) ?></textarea> +<strong class="product name"> + <a href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> + <?php echo $this->escapeHtml($product->getName()) ?> + </a> +</strong> +<div class="product description"> + <?php echo $this->escapeHtml($this->stripTags($product->getShortDescription()));?> +</div> +<textarea placeholder="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->defaultCommentString() ?>" name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" title="<?php echo __('Comment') ?>"><?php echo($this->escapeHtml($item->getDescription())) ?></textarea> <?php $children = $this->getChildNames(); ?> <?php if ($children): ?> - <div class="item-manage"> - <?php foreach($children as $childName):?> - <?php echo $this->getLayout()->renderElement($childName, false);?> - <?php endforeach;?> + <div class="product manage"> + <?php foreach($children as $childName):?> + <?php echo $this->getLayout()->renderElement($childName, false);?> + <?php endforeach;?> </div> <?php endif; ?> diff --git a/app/code/Magento/Wishlist/view/frontend/item/column/remove.phtml b/app/code/Magento/Wishlist/view/frontend/item/column/remove.phtml index 4401a16baae..2947bb6f689 100644 --- a/app/code/Magento/Wishlist/view/frontend/item/column/remove.phtml +++ b/app/code/Magento/Wishlist/view/frontend/item/column/remove.phtml @@ -19,11 +19,11 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ - ?> -<a href="<?php echo $this->getItemRemoveUrl($this->getItem()); ?>" title="<?php echo __('Remove Item') ?>" - class="btn-remove btn-remove2"><?php echo __('Remove item');?></a> + +<a href="<?php echo $this->getItemRemoveUrl($this->getItem()); ?>" title="<?php echo __('Remove Item') ?>" class="action delete"> + <span><?php echo __('Remove item');?></span> +</a> diff --git a/app/code/Magento/Wishlist/view/frontend/item/configure/addto.phtml b/app/code/Magento/Wishlist/view/frontend/item/configure/addto.phtml index 02d24b18ac8..f44987f63d3 100644 --- a/app/code/Magento/Wishlist/view/frontend/item/configure/addto.phtml +++ b/app/code/Magento/Wishlist/view/frontend/item/configure/addto.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -27,13 +26,17 @@ <?php $_wishlistItem = $this->getWishlistItem(); ?> <?php $_wishlistSubmitUrl = $this->helper('Magento\Wishlist\Helper\Data')->getUpdateUrl($_wishlistItem); ?> -<ul class="add-to-links" data-role="add-to-links"> -<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> - <li><a href="<?php echo $_wishlistSubmitUrl ?>" class="link-compare"><?php echo __('Update Wish List') ?></a></li> -<?php endif; ?> -<?php $_product = $this->getProduct(); ?> -<?php $_compareUrl = $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddUrl($_product); ?> -<?php if ($_compareUrl) : ?> - <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo __('Add to Compare') ?></a></li> -<?php endif; ?> -</ul> +<div class="product addto links" data-role="add-to-links"> + <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> + <a href="<?php echo $_wishlistSubmitUrl ?>" class="action towishlist updated"> + <span><?php echo __('Update Wish List') ?></span> + </a> + <?php endif; ?> + <?php $_product = $this->getProduct(); ?> + <?php $_compareUrl = $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddUrl($_product); ?> + <?php if ($_compareUrl) : ?> + <a href="<?php echo $_compareUrl ?>" class="action tocompare"> + <span><?php echo __('Add to Compare') ?></span> + </a> + <?php endif; ?> +</div> diff --git a/app/code/Magento/Wishlist/view/frontend/item/list.phtml b/app/code/Magento/Wishlist/view/frontend/item/list.phtml index cdd7ba090c9..0acbe76248f 100644 --- a/app/code/Magento/Wishlist/view/frontend/item/list.phtml +++ b/app/code/Magento/Wishlist/view/frontend/item/list.phtml @@ -19,39 +19,37 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php - $columns = $this->getColumns(); +$columns = $this->getColumns(); ?> -<table class="data-table" id="wishlist-table"> +<table class="table data wishlist" id="wishlist-table"> <thead> - <tr> - <?php foreach ($columns as $column): ?> - <th><?php echo $column->getTitle();?></th> - <?php endforeach; ?> - </tr> + <tr> + <?php foreach ($columns as $column): ?> + <th class="col <?php echo $column->getColClass(); ?>"><?php echo $column->getTitle();?></th> + <?php endforeach; ?> + </tr> </thead> <tbody> - <?php if (count($this->getItems())): ?> - <?php foreach ($this->getItems() as $item): ?> - <tr id="item_<?php echo $item->getId();?>"> - <?php foreach ($columns as $column): ?> - <td><?php $column->setItem($item); echo $column->toHtml($item);?></td> - <?php endforeach; ?> - </tr> - <?php endforeach ?> - <?php else: ?> - <td colspan="<?php echo count($columns);?>" class="wishlist-empty"><?php echo __('This Wish List has no Items');?></td> - <?php endif; ?> + <?php if (count($this->getItems())): ?> + <?php foreach ($this->getItems() as $item): ?> + <tr id="item_<?php echo $item->getId();?>"> + <?php foreach ($columns as $column): ?> + <td class="col <?php echo $column->getColClass(); ?>"> + <?php $column->setItem($item); echo $column->toHtml($item);?> + </td> + <?php endforeach; ?> + </tr> + <?php endforeach ?> + <?php else: ?> + <td colspan="<?php echo count($columns);?>" class="col empty"><?php echo __('This Wish List has no Items');?></td> + <?php endif; ?> </tbody> </table> <?php foreach ($columns as $column): ?> <?php echo $column->getAdditionalHtml();?> <?php endforeach; ?> -<script type="text/javascript"> - jQuery('#wishlist-table').decorate('table'); -</script> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml index e3f3630fa50..59ae5684536 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml @@ -23,16 +23,17 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wish list Item" type="page"> - <referenceBlock name="product.info"> - <block class="Magento\Wishlist\Block\Item\Configure" name="product.info.addto" as="addto" template="item/configure/addto.phtml"/> - </referenceBlock> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <update handle="catalog_product_view"/> + <referenceContainer name="product.info.main"> + <block class="Magento\Wishlist\Block\Item\Configure" name="product.info.addto" as="addto" template="Magento_Wishlist::item/configure/addto.phtml"/> + </referenceContainer> <referenceBlock name="product.info.options.wrapper.bottom"> <action method="unsetChild"> - <argument name="name" xsi:type="string">product.info.addto.additional</argument> + <argument name="name" xsi:type="string">product.info.addtocart.additional</argument> </action> <action method="append"> - <argument name="element" xsi:type="string">product.info.addto.additional</argument> + <argument name="element" xsi:type="string">product.info.addtocart.additional</argument> </action> </referenceBlock> </layout> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml index a0016fef01a..7965073a56f 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Bundle)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-bundle-js"> <arguments> @@ -36,21 +36,24 @@ </arguments> </block> </referenceBlock> + <referenceBlock name="root"> + <action method="addBodyClass"> + <argument name="value" xsi:type="string">type-bundle</argument> + </action> + </referenceBlock> <referenceBlock name="product.info"> - <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle" name="product.info.bundle" as="product_type_data" template="catalog/product/view/type/bundle.phtml"> - <action method="addPriceBlockType"> - <argument name="type" xsi:type="string">bundle</argument> - <argument name="block" xsi:type="string">Magento\Bundle\Block\Catalog\Product\Price</argument> - <argument name="template" xsi:type="string">catalog/product/price.phtml</argument> - </action> + <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.summary" as="form_top" template="catalog/product/view/summary.phtml"> <block class="Magento\Bundle\Block\Catalog\Product\Price" name="bundle.prices" as="bundle_prices" template="catalog/product/view/price.phtml"> <action method="setMAPTemplate"> <argument name="tmpl" xsi:type="string">Magento_Catalog::product/price_msrp_item.phtml</argument> </action> </block> + <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.bundle" as="addtocart" template="product/view/addtocart.phtml"/> + <block class="Magento\Catalog\Block\Product\View" name="product.info.addto.bundle" as="addto" template="product/view/addto.phtml"/> </block> </referenceBlock> <referenceBlock name="product.info.options.wrapper"> + <block class="Magento\Catalog\Block\Product\View" name="bundle.product.view.options.notice" template="Magento_Bundle::catalog/product/view/options/notice.phtml"/> <block class="Magento\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="-"> <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Select" name="product.info.bundle.options.select" as="select"/> <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Multi" name="product.info.bundle.options.multi" as="multi"/> @@ -62,7 +65,32 @@ <remove name="product.tierprices"/> <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.tierprices" as="tierprices" before="-" template="Magento_Bundle::catalog/product/view/tierprices.phtml"/> <block class="Magento\CatalogInventory\Block\Qtyincrements" name="product.info.qtyincrements" before="-" template="qtyincrements.phtml"/> + <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.back.button" as="backButton" after="-" template="catalog/product/view/backbutton.phtml"/> + <action method="unsetChild"> + <argument name="block" xsi:type="string">product.info.addtocart</argument> + </action> + <action method="setHideRequiredNotice"> + <argument name="flag" xsi:type="string">1</argument> + </action> + <action method="unsetChild"> + <argument name="block" xsi:type="string">product.info.addto</argument> + </action> </referenceBlock> + <referenceContainer name="content"> + <container name="bundle.options.container" label="invisible" htmlTag="div" htmlClass="bundle options container" after="product.info.media"/> + <move element="product.info" destination="bundle.options.container" before="-"/> + </referenceContainer> + <referenceContainer name="product.info.type"> + <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle" name="product.info.bundle" as="product_type_data" template="catalog/product/view/type/bundle.phtml"> + <action method="addPriceBlockType"> + <argument name="type" xsi:type="string">bundle</argument> + <argument name="block" xsi:type="string">Magento\Bundle\Block\Catalog\Product\Price</argument> + <argument name="template" xsi:type="string">catalog/product/price.phtml</argument> + </action> + </block> + <container name="product.info.bundle.extra" after="product.info.bundle" as="product_type_data_extra" label="Product Extra Info"/> + <block class="Magento\Bundle\Block\Catalog\Product\View" name="customize.button" as="customize_button" template="catalog/product/view/customize.phtml"/> + </referenceContainer> <referenceBlock name="product.clone_prices"> <action method="addPriceBlockType"> <argument name="type" xsi:type="string">bundle</argument> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml index e6afc097fcb..baf5f2d8391 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml @@ -23,12 +23,16 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Configurable)" type="page"> - <referenceBlock name="product.info"> - <block class="Magento\Catalog\Block\Product\View\Type\Configurable" name="product.info.configurable" as="product_type_data" template="product/view/type/default.phtml"> - <container name="product.info.configurable.extra" as="product_type_data_extra" label="Product Extra Info"/> - </block> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="root"> + <action method="addBodyClass"> + <argument name="value" xsi:type="string">type-configurable</argument> + </action> </referenceBlock> + <referenceContainer name="product.info.type"> + <block class="Magento\Catalog\Block\Product\View\Type\Configurable" name="product.info.configurable" as="product_type_data" template="product/view/type/default.phtml"/> + <container name="product.info.configurable.extra" after="product.info.configurable" as="product_type_data_extra" label="Product Extra Info"/> + </referenceContainer> <referenceBlock name="product.info.options.wrapper"> <block class="Magento\Catalog\Block\Product\View\Type\Configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="product/view/type/options/configurable.phtml"/> </referenceBlock> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml index 91c6bd25a01..e86dc99138f 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml @@ -23,11 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Grouped)" type="page"> - <referenceBlock name="product.info"> - <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped" as="product_type_data" template="product/view/type/grouped.phtml"> - <container name="product.info.grouped.extra" as="product_type_data_extra" label="Product Extra Info"/> - </block> - <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped.grid" as="product_type_data_grid" template="product/view/type/grouped.phtml"/> - </referenceBlock> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceContainer name="product.info.form.content"> + <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/> + <container name="product.info.grouped.extra" after="product.info.grouped" before="product.info.grouped" as="product_type_data_extra" label="Product Extra Info"/> + </referenceContainer> </layout> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml index 5511ff2db5d..6c60196129d 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml @@ -23,6 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Simple)" type="page"> - <update handle="catalog_product_view_type_simple"/> -</layout> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml index c1262ad6aed..b0dd14215ba 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml @@ -23,27 +23,34 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account My Wish List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceContainer name="my.account.wrapper"> + <referenceContainer name="content"> <block class="Magento\Wishlist\Block\Customer\Wishlist" name="customer.wishlist" template="view.phtml"> - <action method="setTitle"> - <argument translate="true" name="title" xsi:type="string">My Wish List</argument> - </action> <block class="Magento\Wishlist\Block\Customer\Wishlist\Items" name="customer.wishlist.items" as="items" template="item/list.phtml"> - <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Image" name="customer.wishlist.item.image" template="item/column/image.phtml"/> + <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Image" name="customer.wishlist.item.image" before="-" template="item/column/image.phtml"> + <arguments> + <argument name="col_class" xsi:type="string">photo</argument> + </arguments> + </block> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Comment" name="customer.wishlist.item.info" template="item/column/info.phtml"> - <action method="setTitle"> - <argument translate="true" name="title" xsi:type="string">Product Details and Comment</argument> - </action> + <arguments> + <argument name="col_class" xsi:type="string">item</argument> + <argument name="title" translate="true" xsi:type="string">Product Details and Comment</argument> + </arguments> </block> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart" name="customer.wishlist.item.cart" template="item/column/cart.phtml"> - <action method="setTitle"> - <argument translate="true" name="title" xsi:type="string">Add to Cart</argument> - </action> + <arguments> + <argument name="col_class" xsi:type="string">actions</argument> + <argument name="title" translate="true" xsi:type="string">Add to Cart</argument> + </arguments> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Options" name="customer.wishlist.item.options"/> </block> - <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="item/column/remove.phtml"/> + <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="item/column/remove.phtml"> + <arguments> + <argument name="col_class" xsi:type="string">remove</argument> + </arguments> + </block> </block> <container name="customer.wishlist.buttons" as="control_buttons" label="Wishlist Control Buttons"> <block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.share" template="button/share.phtml"/> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml index ffda63b67f3..538aa8db1f5 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml @@ -23,9 +23,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Wish List Sharing Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceContainer name="my.account.wrapper"> + <referenceContainer name="content"> <block class="Magento\Wishlist\Block\Customer\Sharing" name="wishlist.sharing" template="sharing.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml index 7ed767417f8..5514a660d28 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Shared Wish List View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Wishlist\Block\Share\Wishlist" name="customer.wishlist" template="shared.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Wishlist/view/frontend/options_list.phtml b/app/code/Magento/Wishlist/view/frontend/options_list.phtml index 62a51932241..ab745165775 100644 --- a/app/code/Magento/Wishlist/view/frontend/options_list.phtml +++ b/app/code/Magento/Wishlist/view/frontend/options_list.phtml @@ -19,7 +19,6 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -29,23 +28,21 @@ <?php $options = $this->getOptionList(); ?> <?php if ($options): ?> <div class="truncated" data-mage-init="{truncateOptions:[]}"> - <div class="truncated_full_value"> - <div class="item-options"> - <p><?php echo __('Options Details'); ?></p> - <dl> - <?php foreach ($options as $option): ?> - <dt><?php echo $this->escapeHtml($option['label']) ?></dt> - <dd> - <?php if (is_array($option['value'])): ?> - <?php echo nl2br(implode("\n", $option['value'])) ?> - <?php else: ?> - <?php echo $option['value'] ?> - <?php endif; ?> - </dd> - <?php endforeach; ?> - </dl> - </div> + <div class="truncated full value"> + <p><?php echo __('Options Details'); ?></p> + <dl> + <?php foreach ($options as $option): ?> + <dt class="label"><?php echo $this->escapeHtml($option['label']) ?></dt> + <dd class="values"> + <?php if (is_array($option['value'])): ?> + <?php echo nl2br(implode("\n", $option['value'])) ?> + <?php else: ?> + <?php echo $option['value'] ?> + <?php endif; ?> + </dd> + <?php endforeach; ?> + </dl> </div> - <a href="#" onclick="return false;" class="details"><?php echo __('View Details') ?></a> + <a href="#" onclick="return false;" class="action details"><?php echo __('View Details') ?></a> </div> <?php endif ?> diff --git a/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_item.phtml b/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_item.phtml index 617a7193877..db300cc8c67 100644 --- a/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_item.phtml +++ b/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_item.phtml @@ -43,46 +43,46 @@ $_id = $_product->getId(); $_msrpPrice = ''; ?> - <div class="price-box map-info"> +<div class="price-box msrp"> <?php $_price = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_product->getMsrp()) ?> - <?php if($_product->getMsrp()): ?> - <?php $_msrpPrice = $_coreHelper->currency($_product->getMsrp(),true,true) ?> - <span class="old-price" ><?php echo $_msrpPrice ?></span> - <?php endif; ?> - <?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?> - <?php $priceElementId = 'product-price-' . $_id . $this->getIdSuffix(); ?> - <span id="<?php echo $priceElementId ?>" style="display:none"></span> - <?php $popupId = 'msrp-popup-' . $_id . $this->getRandomString(20); ?> - <a href="#" id="<?php echo($popupId);?>"><?php echo __('Click for price'); ?></a> - <?php else: ?> - <span class="msrp-price-hide-message"> - <?php echo $_catalogHelper->getMsrpPriceMessage($_product) ?> - </span> - <?php endif; ?> - <?php $helpLinkId = 'msrp-help-' . $_id . $this->getRandomString(20); ?> - <a href="#" id="<?php echo($helpLinkId);?>"><?php echo __("What's this?"); ?></a> - </div> - <script type="text/javascript"> - (function ($) { - head.js("<?php echo $this->getViewFileUrl('Magento_Catalog::js/msrp.js') ?>", - function () { - <?php if ($this->helper('Magento\Catalog\Helper\Data')->isShowPriceOnGesture($_product)): ?> - $('#<?php echo($popupId);?>').addToCart({ - cartForm: "#wishlist-view-form", - popupId: "#<?php echo($popupId);?>", - productName: '<?php echo $_product->getName() ?>', - realPrice: '<?php echo $this->getRealPriceJs($_product) ?>', - msrpPrice: '<?php echo $_msrpPrice ?>', - priceElementId: '<?php echo $priceElementId ?>', - closeButtonId: '#map-popup-close', - popupCartButtonId: "#map-popup-button" - }); - <?php endif; ?> - $("#<?php echo($helpLinkId);?>").addToCart({ - helpLinkId: "#<?php echo($helpLinkId);?>", - productName: '<?php echo $_product->getName() ?>' - }); + <?php if($_product->getMsrp()): ?> + <?php $_msrpPrice = $_coreHelper->currency($_product->getMsrp(),true,true) ?> + <span class="old-price" ><?php echo $_msrpPrice ?></span> + <?php endif; ?> + <?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?> + <?php $priceElementId = 'product-price-' . $_id . $this->getIdSuffix(); ?> + <span id="<?php echo $priceElementId ?>" style="display:none"></span> + <?php $popupId = 'msrp-popup-' . $_id . $this->getRandomString(20); ?> + <a href="#" id="<?php echo($popupId);?>"><?php echo __('Click for price'); ?></a> + <?php else: ?> + <span class="msrp message"> + <?php echo $_catalogHelper->getMsrpPriceMessage($_product) ?> + </span> + <?php endif; ?> + <?php $helpLinkId = 'msrp-help-' . $_id . $this->getRandomString(20); ?> + <a href="#" id="<?php echo($helpLinkId);?>" class="link tip"><?php echo __("What's this?"); ?></a> +</div> +<script type="text/javascript"> +(function ($) { + head.js("<?php echo $this->getViewFileUrl('Magento_Catalog::js/msrp.js') ?>", + function () { + <?php if ($this->helper('Magento\Catalog\Helper\Data')->isShowPriceOnGesture($_product)): ?> + $('#<?php echo($popupId);?>').addToCart({ + cartForm: "#wishlist-view-form", + popupId: "#<?php echo($popupId);?>", + productName: '<?php echo $_product->getName() ?>', + realPrice: '<?php echo $this->getRealPriceJs($_product) ?>', + msrpPrice: '<?php echo $_msrpPrice ?>', + priceElementId: '<?php echo $priceElementId ?>', + closeButtonId: '#map-popup-close', + popupCartButtonId: "#map-popup-button" }); - })(jQuery); - </script> + <?php endif; ?> + $("#<?php echo($helpLinkId);?>").addToCart({ + helpLinkId: "#<?php echo($helpLinkId);?>", + productName: '<?php echo $_product->getName() ?>' + }); + }); + })(jQuery); +</script> diff --git a/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_rss.phtml b/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_rss.phtml index c120000ba68..fcd359088d1 100644 --- a/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_rss.phtml +++ b/app/code/Magento/Wishlist/view/frontend/render/item/price_msrp_rss.phtml @@ -31,7 +31,7 @@ * @var $this \Magento\Catalog\Block\Product\Price */ ?> -<div class="price-box map-info"> +<div class="price-box msrp"> <?php if ($this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($this->getProduct())): ?> <a href="<?php echo $this->getProduct()->getProductUrl() ?>"><?php echo __('Click for price'); ?></a> <?php endif; ?> diff --git a/app/code/Magento/Wishlist/view/frontend/shared.phtml b/app/code/Magento/Wishlist/view/frontend/shared.phtml index 6f190c773c9..2d3ab568ec3 100644 --- a/app/code/Magento/Wishlist/view/frontend/shared.phtml +++ b/app/code/Magento/Wishlist/view/frontend/shared.phtml @@ -19,67 +19,74 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this \Magento\Wishlist\Block\Share\Wishlist */ +$imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image'); ?> -<div class="my-wishlist"> - <div class="page-title"> - <h1><?php echo $this->escapeHtml($this->getHeader()) ?></h1> - </div> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> - <?php if ($this->hasWishlistItems()): ?> - <form action="<?php echo $this->getUrl('*/*/update') ?>" method="post"> - <fieldset> - <table class="data-table" id="wishlist-table"> - <col width="1" /> - <col /> - <col width="1" /> + +<?php if ($this->hasWishlistItems()): ?> + <form class="form shared wishlist" action="<?php echo $this->getUrl('*/*/update') ?>" method="post"> + <table class="table data wishlist" id="wishlist-table"> <thead> - <tr> - <th><?php echo __('Product') ?></th> - <th><?php echo __('Comment') ?></th> - <th> </th> - </tr> + <tr> + <th class="col product"><?php echo __('Product') ?></th> + <th class="col comment"><?php echo __('Comment') ?></th> + <th class="col actions"><?php echo __('Add to Cart') ?></th> + </tr> </thead> <tbody> <?php foreach($this->getWishlistItems() as $item): ?> <?php - $product = $item->getProduct(); - $isVisibleProduct = $product->isVisibleInSiteVisibility(); + $product = $item->getProduct(); + $isVisibleProduct = $product->isVisibleInSiteVisibility(); ?> <tr> - <td> - <a class="product-image" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"><img src="<?php echo $this->getImageUrl($product); ?>" width="<?php echo $this->getImageSize()?>" height="<?php echo $this->getImageSize()?>" alt="<?php echo $this->escapeHtml($item->getName()) ?>" /></a> - <h2 class="product-name"><a href="<?php echo $this->getProductUrl($item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></h2> + <td class="col product"> + <a class="product photo" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> + <?php echo $imageBlock->init($product, 'customer_shared_wishlist')->toHtml() ?> + </a> + <strong class="product name"> + <a href="<?php echo $this->getProductUrl($item) ?>"> + <?php echo $this->escapeHtml($product->getName()) ?> + </a> + </strong> <?php echo $this->getPriceHtml($product) ?> <?php echo $this->getDetailsHtml($item) ?> </td> - <td><?php echo $this->getEscapedDescription($item) ?></td> - <td class="a-center"> - <?php if ($product->isSaleable()): ?> - <?php if ($isVisibleProduct): ?> - <button type="button" title="<?php echo __('Add to Cart') ?>" onclick="setLocation('<?php echo $this->getSharedItemAddToCartUrl($item) ?>')" class="button btn-cart"><span><span><?php echo __('Add to Cart') ?></span></span></button> - <?php endif ?> - <?php endif; ?> - <p><a href="<?php echo $this->getAddToWishlistUrl($item) ?>" onclick="setLocation(this.href); return false;" class="link-wishlist" data-action="add-to-wishlist"><?php echo __('Add to Wishlist') ?></a></p> + <td class="col comment"><?php echo $this->getEscapedDescription($item) ?></td> + <td class="col actions"> + <?php if ($product->isSaleable()): ?> + <?php if ($isVisibleProduct): ?> + <button type="button" title="<?php echo __('Add to Cart') ?>" onclick="setLocation('<?php echo $this->getSharedItemAddToCartUrl($item) ?>')" class="action tocart"> + <span><?php echo __('Add to Cart') ?></span> + </button> + <?php endif ?> + <?php endif; ?> + <a href="<?php echo $this->getAddToWishlistUrl($item) ?>" onclick="setLocation(this.href); return false;" class="action towishlist" data-action="add-to-wishlist"> + <span><?php echo __('Add to Wishlist') ?></span> + </a> </td> </tr> <?php endforeach ?> </tbody> - </table> - <script type="text/javascript">(function($) {$('#wishlist-table').decorate('table')})(jQuery)</script> - </fieldset> - <div class="buttons-set"> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> + </table> + <div class="actions"> <?php if($this->isSaleable()):?> - <button type="button" title="<?php echo __('Add All to Cart') ?>" onclick="setLocation('<?php echo $this->getUrl('*/*/allcart', array('_current'=>true)) ?>')" class="button"><span><span><?php echo __('Add All to Cart') ?></span></span></button> + <div class="primary"> + <button type="button" title="<?php echo __('Add All to Cart') ?>" onclick="setLocation('<?php echo $this->getUrl('*/*/allcart', array('_current'=>true)) ?>')" class="action tocart"> + <span><?php echo __('Add All to Cart') ?></span> + </button> + </div> <?php endif;?> + <div class="secondary"> + <a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="action back"> + <span><?php echo __('Back') ?></span> + </a> + </div> </div> </form> - <?php else: ?> - <p><?php echo __('Wish List is empty now.') ?></p> - <?php endif ?> -</div> +<?php else: ?> + <p><?php echo __('Wish List is empty now.') ?></p> +<?php endif ?> diff --git a/app/code/Magento/Wishlist/view/frontend/sharing.phtml b/app/code/Magento/Wishlist/view/frontend/sharing.phtml index 0568968baf0..b0b5ac85af5 100644 --- a/app/code/Magento/Wishlist/view/frontend/sharing.phtml +++ b/app/code/Magento/Wishlist/view/frontend/sharing.phtml @@ -19,48 +19,48 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this \Magento\Wishlist\Block\Customer\Sharing */ ?> -<div class="page-title"> - <h1><?php echo __('Share Your Wish List') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $this->getSendUrl() ?>" id="form-validate" method="post"> - <div class="fieldset"> +<form class="form wishlist share" action="<?php echo $this->getSendUrl() ?>" id="form-validate" method="post" data-hasrequired="<?php echo __('* Required Fields') ?>"> + <fieldset class="fieldset"> <?php echo $this->getBlockHtml('formkey')?> - <h2 class="legend"><?php echo __('Sharing Information') ?></h2> - <ul class="form-list"> - <li class="wide"> - <label for="email_address" class="required"><em>*</em><?php echo __('Email addresses, separated by commas (max %1 addresses)', $this->getEmailSharingLimit()); ?></label> - <div class="input-box"> - <textarea name="emails" cols="60" rows="5" id="email_address" data-validate="{required:true,'validate-emails':true}"><?php echo $this->getEnteredData('emails') ?></textarea> - </div> - </li> - <li class="wide"> - <label for="message"><?php echo __('Message') ?></label> - <div class="input-box"> - <textarea id="message" name="message" cols="60" rows="5" class="validate-length maximum-length-<?php echo $this->getTextSharingLimit();?>"><?php echo $this->getEnteredData('message') ?></textarea> - </div> - </li> - <?php if($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow()): ?> - <li class="control"> - <div class="input-box"> - <input type="checkbox" name="rss_url" id="rss_url" value="1" title="<?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?>" class="checkbox" /> - </div> - <label for="rss_url"><?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?></label> - </li> - <?php endif; ?> - </ul> - </div> - <div class="buttons-set form-buttons"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->getBackUrl(); ?>"><small>« </small><?php echo __('Back')?></a></p> - <button type="submit" title="<?php echo __('Share Wish List') ?>" class="button"><span><span><?php echo __('Share Wish List') ?></span></span></button> + <legend class="legend"><span><?php echo __('Sharing Information') ?></span></legend><br /> + <div class="field emails required"> + <label class="label" for="email_address"><span><?php echo __('Email addresses, separated by commas') ?></span></label> + <div class="control"> + <textarea name="emails" cols="60" rows="5" id="email_address" data-validate="{required:true,'validate-emails':true}"><?php echo $this->getEnteredData('emails') ?></textarea> + </div> + </div> + <div class="field text"> + <label class="label" for="message"><span><?php echo __('Message') ?></span></label> + <div class="control"> + <textarea id="message" name="message" cols="60" rows="5"><?php echo $this->getEnteredData('message') ?></textarea> + </div> + </div> + <?php if($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow()): ?> + <div class="field choice rss"> + <input type="checkbox" name="rss_url" id="rss_url" value="1" title="<?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?>" class="checkbox"> + <label class="label" for="rss_url"> + <span> + <?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?> + </span> + </label> + </div> + <?php endif; ?> + </fieldset> + <div class="actions"> + <div class="primary"> + <button type="submit" title="<?php echo __('Share Wishlist') ?>" class="action submit"> + <span><?php echo __('Share Wishlist') ?></span> + </button> + </div> + <div class="secondary"> + <a class="action back" href="<?php echo $this->getBackUrl(); ?>"><span><?php echo __('Back')?></span></a> + </div> </div> </form> <script type="text/javascript"> diff --git a/app/code/Magento/Wishlist/view/frontend/sidebar.phtml b/app/code/Magento/Wishlist/view/frontend/sidebar.phtml index 99e2f17b763..426803cf14f 100644 --- a/app/code/Magento/Wishlist/view/frontend/sidebar.phtml +++ b/app/code/Magento/Wishlist/view/frontend/sidebar.phtml @@ -19,43 +19,54 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this \Magento\Wishlist\Block\Customer\Sidebar */ ?> + <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> -<div class="block block-wishlist"> - <div class="block-title"> - <strong><span><?php echo $this->getTitle(); ?></span></strong> + <?php $imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image');?> + <div class="block wishlist"> + <div class="title"> + <strong><?php echo $this->getTitle(); ?></strong> + </div> + <div class="content"> + <strong class="subtitle"><?php echo __('Last Added Items') ?></strong> + <?php if ($this->hasWishlistItems()): ?> + <ol class="items minilist products" id="wishlist-sidebar"> + <?php $iterator = 1; ?> + <?php foreach ($this->getWishlistItems() as $_item): ?> + <?php $product = $_item->getProduct(); ?> + <?php echo ($iterator++==1) ? '<li class="item product">' : '</li><li class="item product">' ?> + <div class="product"> + <a class="product photo" href="<?php echo $this->getProductUrl($_item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> + <?php echo $imageBlock->init($product, 'wishlist_sidebar_block')->toHtml() ?> + </a> + <div class="product details"> + <strong class="product name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></strong> + <?php echo $this->getPriceHtml($product, false, '-wishlist') ?> + <div class="product actions"> + <?php if ($product->isSaleable() && $product->isVisibleInSiteVisibility()): ?> + <div class="primary"><a href="<?php echo $this->getItemAddToCartUrl($_item) ?>" class="action tocart"><span><?php echo __('Add to Cart') ?></span></a></div> + <?php endif; ?> + <div class="secondary"> + <a href="<?php echo $this->getItemRemoveUrl($_item) ?>" title="<?php echo __('Remove This Item') ?>" onclick="return confirm('<?php echo __('Are you sure you would like to remove this item from the wishlist?') ?>');" class="action delete"> + <span><?php echo __('Remove This Item') ?></span> + </a> + </div> + </div> + </div> + </div> + <?php echo ($iterator==count($this->getWishlistItems())+1) ? '</li>' : '' ?> + <?php endforeach; ?> + </ol> + <div class="actions"> + <a class="action details" href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getListUrl() ?>"><span><?php echo __('Go to Wish List') ?></span></a> + </div> + <?php else: ?> + <p class="empty"><?php echo __('You have no items in your wish list.') ?></p> + <?php endif ?> + </div> </div> - <div class="block-content"> - <p class="block-subtitle"><?php echo __('Last Added Items') ?></p> - <?php if ($this->hasWishlistItems()): ?> - <ol class="mini-products-list" id="wishlist-sidebar"> - <?php foreach ($this->getWishlistItems() as $_item): ?> - <?php $product = $_item->getProduct(); ?> - <li class="item"> - <a href="<?php echo $this->getProductUrl($_item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>" class="product-image"><img src="<?php echo $this->getThumbnailSidebarUrl($product); ?>" width="<?php echo $this->getThumbnailSidebarSize()?>" height="<?php echo $this->getThumbnailSidebarSize()?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a> - <div class="product-details"> - <a href="<?php echo $this->getItemRemoveUrl($_item) ?>" title="<?php echo __('Remove This Item') ?>" onclick="return confirm('<?php echo __('Are you sure you would like to remove this item from the wishlist?') ?>');" class="btn-remove"><?php echo __('Remove This Item') ?></a> - <p class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></p> - <?php echo $this->getPriceHtml($product, false, '-wishlist') ?> - <?php if ($product->isSaleable() && $product->isVisibleInSiteVisibility()): ?> - <a href="<?php echo $this->getItemAddToCartUrl($_item) ?>" class="link-cart"><?php echo __('Add to Cart') ?></a> - <?php endif; ?> - </div> - </li> - <?php endforeach; ?> - </ol> - <script type="text/javascript">(function($) {$('#wishlist-sidebar').decorate('list', false)})(jQuery)</script> - <div class="actions"> - <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getListUrl() ?>"><?php echo __('Go to Wish List') ?></a> - </div> - <?php else: ?> - <p class="empty"><?php echo __('You have no items in your wishlist.') ?></p> - <?php endif ?> - </div> -</div> <?php endif ?> diff --git a/app/code/Magento/Wishlist/view/frontend/view.phtml b/app/code/Magento/Wishlist/view/frontend/view.phtml index 6e819be1005..b9145822508 100644 --- a/app/code/Magento/Wishlist/view/frontend/view.phtml +++ b/app/code/Magento/Wishlist/view/frontend/view.phtml @@ -19,67 +19,66 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this \Magento\Wishlist\Block\Customer\Wishlist */ ?> + <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> - <div class="my-wishlist"> - <div class="page-title title-buttons"> - <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow() && $this->hasWishlistItems()): ?> - <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="link-rss"><?php echo __('RSS Feed') ?></a> - <?php endif; ?> - <h1><?php echo $this->getTitle(); ?></h1> + <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow() && $this->hasWishlistItems()): ?> + <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="action rss wishlist"> + <span><?php echo __('RSS Feed') ?></span> + </a> + <?php endif; ?> + <form class="form wishlist items" id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post"> + <?php echo $this->getChildHtml('top'); ?> + <?php if ($this->hasWishlistItems()): ?> + <?php echo $this->getBlockHtml('formkey');?> + <?php $this->getChildBlock('items')->setItems($this->getWishlistItems()); ?> + <?php echo $this->getChildHtml('items');?> + <?php else: ?> + <p class="empty"><?php echo __('You have no items in your wish list.') ?></p> + <?php endif ?> + <?php echo $this->getChildHtml('bottom'); ?> + <div class="actions"> + <div class="primary"><?php echo $this->getChildHtml('control_buttons');?></div> + <div class="secondary"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="action back"> + <span><?php echo __('Back') ?></span></a> + </div> </div> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> - - <form id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post"> - <?php echo $this->getChildHtml('top'); ?> - <fieldset> - <?php if ($this->hasWishlistItems()): ?> - <?php echo $this->getBlockHtml('formkey');?> - <?php $this->getChildBlock('items')->setItems($this->getWishlistItems()); ?> - <?php echo $this->getChildHtml('items');?> - <?php else: ?> - <p class="wishlist-empty"><?php echo __('You have no items in your wish list.') ?></p> - <?php endif ?> - <div class="buttons-set buttons-set2"> - <?php echo $this->getChildHtml('control_buttons');?> - </div> - </fieldset> + </form> + <script id="form-tmpl" type="text/x-jQuery-tmpl"> + <form id="wishlist-hidden-form" method="post" action="${url}" class="no-display"> + {{if itemId}}<input name="item_id" value="${itemId}">{{/if}} + {{if wishlistId}}<input name="wishlist_id" value="${wishlistId}">{{/if}} + {{if qty}}<input name="qty" value="${qty}">{{/if}} + {{if item}}<input name="item" value="${item}">{{/if}} + {{if entity}}<input name="entity" value="${entity}">{{/if}} </form> - <script id="form-tmpl" type="text/x-jQuery-tmpl"> - <form id="wishlist-hidden-form" method="post" action="${url}" class="no-display"> - {{if itemId}}<input name="item_id" value="${itemId}"/>{{/if}} - {{if wishlistId}}<input name="wishlist_id" value="${wishlistId}"/>{{/if}} - {{if qty}}<input name="qty" value="${qty}"/>{{/if}} - {{if item}}<input name="item" value="${item}"/>{{/if}} - {{if entity}}<input name="entity" value="${entity}"/>{{/if}} - </form> - </script> - <script> - (function($) { - head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", - "<?php echo $this->getViewFileUrl('Magento_Persistent::splitbutton.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Wishlist::wishlist.js')?>", function() { - $('#wishlist-view-form').wishlist({ - addToCartUrl: '<?php echo $this->getItemAddToCartUrl('%item%');?>' , - confirmRemoveMessage: '<?php echo __('Are you sure you want to remove this product from your wish list?') ?>', - addAllToCartUrl : '<?php echo $this->getUrl('*/*/allcart', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>', - commentString : '<?php echo $this->helper('Magento\Wishlist\Helper\Data')->defaultCommentString()?>' - }); - $('body').splitButton(); + </script> + <script> + (function($) { + head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", + "<?php echo $this->getViewFileUrl('Magento_Wishlist::wishlist.js')?>", function() { + $('#wishlist-view-form').wishlist({ + dataAttribute: 'item-id', + nameFormat: 'qty[{0}]', + btnRemoveSelector: '.action.delete', + qtySelector: '.qty', + addToCartSelector: '.action.tocart', + addAllToCartSelector: '.primary > .action.tocart', + commentInputType: 'textarea', + infoList: false, + addToCartUrl: '<?php echo $this->getItemAddToCartUrl('%item%');?>' , + confirmRemoveMessage: '<?php echo __('Are you sure you want to remove this product from your wishlist?') ?>', + addAllToCartUrl : '<?php echo $this->getUrl('*/*/allcart', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>', + commentString : '' }); - })(jQuery); - </script> - </div> - <?php echo $this->getChildHtml('bottom'); ?> - <div class="buttons-set"> - <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> - </div> + }); + })(jQuery); + </script> <?php endif ?> diff --git a/app/design/frontend/magento_plushe/Magento_Captcha/captcha.js b/app/design/frontend/magento_backup/Magento_Captcha/captcha.js similarity index 96% rename from app/design/frontend/magento_plushe/Magento_Captcha/captcha.js rename to app/design/frontend/magento_backup/Magento_Captcha/captcha.js index dd6ef9edd81..2f43f664a69 100644 --- a/app/design/frontend/magento_plushe/Magento_Captcha/captcha.js +++ b/app/design/frontend/magento_backup/Magento_Captcha/captcha.js @@ -1,4 +1,4 @@ -/** +/** * Magento * * NOTICE OF LICENSE @@ -15,56 +15,57 @@ * * 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 captcha - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/*jshint browser:true jquery:true*/ -(function($, undefined) { - "use strict"; - $.widget('mage.captcha', { - options: { - refreshClass: 'refreshing', - reloadSelector: '.captcha-reload', - imageSelector: '.captcha-img' - }, - - /** - * Method binds click event to reload image - * @private - */ - _create: function() { - this.element.on('click', this.options.reloadSelector, $.proxy(this.refresh, this)); - }, - - /** - * Method triggeres an AJAX request to refresh the CAPTCHA image - * @param e - Event - */ - refresh: function(e) { - var reloadImage = $(e.currentTarget); - reloadImage.addClass(this.options.refreshClass); - $.ajax({ - url: this.options.url, - type: 'post', - dataType: 'json', - context: this, - data: { - 'formId': this.options.type - }, - success: function (response) { - if (response.imgSrc) { - this.element.find(this.options.imageSelector).attr('src', response.imgSrc); - } - }, - complete: function() { - reloadImage.removeClass(this.options.refreshClass); - } - }); - } - }); -})(jQuery); - + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category mage + * @package captcha + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true*/ +(function($, undefined) { + "use strict"; + $.widget('mage.captcha', { + options: { + refreshClass: 'refreshing', + reloadSelector: '.captcha-reload', + imageSelector: '.captcha-img' + }, + + /** + * Method binds click event to reload image + * @private + */ + _create: function() { + this.element.on('click', this.options.reloadSelector, $.proxy(this.refresh, this)); + }, + + /** + * Method triggeres an AJAX request to refresh the CAPTCHA image + * @param e - Event + */ + refresh: function(e) { + var reloadImage = $(e.currentTarget); + reloadImage.addClass(this.options.refreshClass); + $.ajax({ + url: this.options.url, + type: 'post', + async:false, + dataType: 'json', + context: this, + data: { + 'formId': this.options.type + }, + success: function (response) { + if (response.imgSrc) { + this.element.find(this.options.imageSelector).attr('src', response.imgSrc); + } + }, + complete: function() { + reloadImage.removeClass(this.options.refreshClass); + } + }); + } + }); +})(jQuery); + diff --git a/app/design/frontend/magento_backup/Magento_Captcha/default.phtml b/app/design/frontend/magento_backup/Magento_Captcha/default.phtml new file mode 100644 index 00000000000..88467e786b4 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Captcha/default.phtml @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 Magento + * @package Magento_Captcha + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php /* @var $this \Magento\Captcha\Block\Captcha\DefaultCaptcha */ ?> + +<?php /* @var $captcha \Magento\Captcha\Model\ModelInterface */ ?> +<?php $captcha = $this->getCaptchaModel() ?> +<li role="<?php echo $this->getFormId()?>"> + <label for="captcha_<?php echo $this->getFormId() ?>" class="required"><em>*</em><?php echo __('Please enter the letters below')?></label> + <div class="input-box captcha"> + <input name="<?php echo \Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php echo $this->getFormId() ?>" /> + </div> +</li> +<li data-captcha="<?php echo $this->getFormId()?>" id="captcha-container-<?php echo $this->getFormId()?>"> + <div class="captcha-image"> + <img class="captcha-reload" src="<?php echo $this->getViewFileUrl('Magento_Captcha::reload.png') ?>" alt="<?php echo __('Reload captcha') ?>"> + <img class="captcha-img" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>"/> + <?php if ($captcha->isCaseSensitive()) :?> + <div class="captcha-note"> + <?php echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?> + </div> + <?php endif; ?> + </div> + <script type="text/javascript">//<![CDATA[ + (function ($) { + head.js("<?php echo $this->getViewFileUrl('Magento_Captcha::captcha.js') ?>",function() { + $('#captcha-container-<?php echo $this->getFormId()?>').captcha({ + url: '<?php echo $this->getRefreshUrl()?>', + type: '<?php echo $this->getFormId() ?>' + }); + }); + })(jQuery); + //]]></script> +</li> diff --git a/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/checkout_onepage_index.xml b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/checkout_onepage_index.xml new file mode 100644 index 00000000000..6084f7595ea --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/checkout_onepage_index.xml @@ -0,0 +1,75 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="checkout.onepage.login"> + <container name="login.form.additional.info" label="Form Additional Info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_login</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </container> + </referenceBlock> + <referenceBlock name="checkout.onepage.billing"> + <container name="form.additional.info" label="Form Additional Info"> + <referenceBlock name="head"> + <block class="Magento\Page\Block\Html\Head\Script" name="magento-captcha-onepage-js"> + <arguments> + <argument name="file" xsi:type="string">Magento_Captcha::onepage.js</argument> + </arguments> + </block> + </referenceBlock> + <block class="Magento\Captcha\Block\Captcha" name="captcha.guest.checkout"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">guest_checkout</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + <block class="Magento\Captcha\Block\Captcha" name="captcha.register.during.checkout"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">register_during_checkout</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </container> + </referenceBlock> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_login.xml b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/contacts_index_index.xml similarity index 93% rename from app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_login.xml rename to app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/contacts_index_index.xml index 95dff1a4b3f..de3980ceb36 100644 --- a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_login.xml +++ b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/contacts_index_index.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,24 +17,24 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="form.additional.info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_login</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceContainer name="form.additional.info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">contact_us</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_create.xml b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_create.xml similarity index 57% rename from app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_create.xml rename to app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_create.xml index 8a497d5df2d..99cb001b740 100644 --- a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_create.xml +++ b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_create.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,24 +17,26 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="form.additional.info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_create</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="customer_form_register"> + <container name="form.additional.info" label="Form Additional Info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_create</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </container> + </referenceBlock> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_forgotpassword.xml b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_forgotpassword.xml similarity index 57% rename from app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_forgotpassword.xml rename to app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_forgotpassword.xml index c61719c3ff9..c9abccaf050 100644 --- a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/customer_account_forgotpassword.xml +++ b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_forgotpassword.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,24 +17,26 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="form.additional.info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_forgotpassword</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="forgotPassword"> + <container name="form.additional.info" label="Form Additional Info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_forgotpassword</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </container> + </referenceBlock> +</layout> diff --git a/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_login.xml b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_login.xml new file mode 100644 index 00000000000..160e8839ec5 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Captcha/layout/override/base/customer_account_login.xml @@ -0,0 +1,42 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="customer_form_login"> + <container name="form.additional.info" label="Form Additional Info"> + <block class="Magento\Captcha\Block\Captcha" name="captcha"> + <action method="setFormId"> + <argument name="formId" xsi:type="string">user_login</argument> + </action> + <action method="setImgWidth"> + <argument name="width" xsi:type="string">230</argument> + </action> + <action method="setImgHeight"> + <argument name="width" xsi:type="string">50</argument> + </action> + </block> + </container> + </referenceBlock> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Captcha/onepage.js b/app/design/frontend/magento_backup/Magento_Captcha/onepage.js similarity index 78% rename from app/design/frontend/magento_plushe/Magento_Captcha/onepage.js rename to app/design/frontend/magento_backup/Magento_Captcha/onepage.js index 42e01875c09..3ecfd263a38 100644 --- a/app/design/frontend/magento_plushe/Magento_Captcha/onepage.js +++ b/app/design/frontend/magento_backup/Magento_Captcha/onepage.js @@ -1,4 +1,4 @@ -/** +/** * Magento * * NOTICE OF LICENSE @@ -15,26 +15,22 @@ * * 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 captcha - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/*jshint browser:true jquery:true*/ -(function($, window, document, undefined) { - "use strict"; - - $(document).on("login:setMethod", function() { - $("[role='guest_checkout'], [role='register_during_checkout']").hide(); - var type = ($("#login\\:guest").is(':checked')) ? 'guest_checkout' : 'register_during_checkout'; - $("[role='" + type + "']").show(); - }); - - $(document).on('billing-request:completed', function() { - if (typeof window.checkout !== 'undefined') { - $(".captcha-reload:visible").trigger("click"); - } - }); -})(jQuery, window, document); \ No newline at end of file + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category mage + * @package captcha + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true*/ +(function($, window, document) { + "use strict"; + $(document).on("login",function() { + $("[data-captcha='guest_checkout'], [data-captcha='register_during_checkout']").hide(); + $("[role='guest_checkout'], [role='register_during_checkout']").hide(); + var type = ($("#login\\:guest").is(':checked')) ? 'guest_checkout' : 'register_during_checkout'; + $("[role='" + type + "'], [data-captcha='" + type + "']").show(); + }).on('billingSave', function() { + $(".captcha-reload:visible").trigger("click"); + }); +})(jQuery, window, document); diff --git a/app/code/Magento/Captcha/view/frontend/reload.png b/app/design/frontend/magento_backup/Magento_Captcha/reload.png similarity index 100% rename from app/code/Magento/Captcha/view/frontend/reload.png rename to app/design/frontend/magento_backup/Magento_Captcha/reload.png diff --git a/app/code/Magento/Customer/view/frontend/account/dashboard.phtml b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard.phtml similarity index 98% rename from app/code/Magento/Customer/view/frontend/account/dashboard.phtml rename to app/design/frontend/magento_backup/Magento_Customer/account/dashboard.phtml index f3dd8107d6d..71bdc537d38 100644 --- a/app/code/Magento/Customer/view/frontend/account/dashboard.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,30 +16,30 @@ * * 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 design - * @package base_default - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="dashboard"> - <div class="page-title"> - <h1><?php echo __('My Dashboard') ?></h1> - </div> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> - <?php echo $this->getChildHtml('hello') ?> - <?php echo $this->getChildHtml('top') ?> - <div class="box-account box-info"> - <div class="box-head"> - <h2><?php echo __('Account Information') ?></h2> - </div> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.account.dashboard.extra') ?> - <?php echo $this->getChildHtml('info') ?> - <?php echo $this->getChildHtml('address') ?> - </div> - <?php echo $this->getChildHtml('info1') ?> - <?php echo $this->getChildHtml('info2') ?> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="dashboard"> + <div class="page-title"> + <h1><?php echo __('My Dashboard') ?></h1> + </div> + <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getChildHtml('hello') ?> + <?php echo $this->getChildHtml('top') ?> + <div class="box-account box-info"> + <div class="box-head"> + <h2><?php echo __('Account Information') ?></h2> + </div> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.account.dashboard.extra') ?> + <?php echo $this->getChildHtml('info') ?> + <?php echo $this->getChildHtml('address') ?> + </div> + <?php echo $this->getChildHtml('info1') ?> + <?php echo $this->getChildHtml('info2') ?> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/address.phtml b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/address.phtml new file mode 100644 index 00000000000..c43dbb709ed --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/address.phtml @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="col2-set"> + <div class="box"> + <div class="box-title"> + <h3><?php echo __('Address Book') ?></h3> + <a href="<?php echo $this->getAddressBookUrl() ?>"><?php echo __('Manage Addresses') ?></a> + </div> + <div class="box-content"> + <div class="col-1"> + <h4><?php echo __('Default Billing Address') ?></h4> + <address> + <?php echo $this->getPrimaryBillingAddressHtml() ?><br /> + <a href="<?php echo $this->getPrimaryBillingAddressEditUrl() ?>"><?php echo __('Edit Address') ?></a> + </address> + </div> + <div class="col-2"> + <h4><?php echo __('Default Shipping Address') ?></h4> + <address> + <?php echo $this->getPrimaryShippingAddressHtml() ?><br /> + <a href="<?php echo $this->getPrimaryShippingAddressEditUrl() ?>"><?php echo __('Edit Address') ?></a> + </address> + </div> + </div> + </div> +</div> diff --git a/app/code/Magento/Oauth/etc/di.xml b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/hello.phtml similarity index 72% rename from app/code/Magento/Oauth/etc/di.xml rename to app/design/frontend/magento_backup/Magento_Customer/account/dashboard/hello.phtml index 9b7e5c54053..ac1e45a25aa 100644 --- a/app/code/Magento/Oauth/etc/di.xml +++ b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/hello.phtml @@ -1,5 +1,5 @@ -<!-- -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,17 +16,15 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<config> - <preference for="Magento\Oauth\Service\OauthV1Interface" type="Magento\Oauth\Service\OauthV1"/> - <type name="Magento\Oauth\Service\OauthV1"> - <param name="date"> - <instance type="Magento\Core\Model\Date\Proxy"/> - </param> - </type> -</config> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="welcome-msg"> + <p class="hello"><strong><?php echo __('Hello, %1!', $this->escapeHtml($this->getCustomerName())) ?></strong></p> + <p><?php echo __('From your dashboard you can review recent account activity and edit your account information.') ?></p> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/info.phtml b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/info.phtml new file mode 100644 index 00000000000..919b2556f1d --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/info.phtml @@ -0,0 +1,64 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="col2-set"> + <div class="col-1"> + <div class="box"> + <div class="box-title"> + <h3><?php echo __('Contact Information') ?></h3> + <a href="<?php echo $this->getUrl('customer/account/edit') ?>"><?php echo __('Edit') ?></a> + </div> + <div class="box-content"> + <p> + <?php echo $this->escapeHtml($this->getCustomer()->getName()) ?><br /> + <?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?><br /> + <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo __('Change Password') ?></a> + </p> + </div> + </div> + </div> + <?php if( $this->isNewsletterEnabled() ): ?> + <div class="col-2"> + <div class="box"> + <div class="box-title"> + <h3><?php echo __('Newsletters') ?></h3> + <a href="<?php echo $this->getUrl('newsletter/manage') ?>"><?php echo __('Edit') ?></a> + </div> + <div class="box-content"> + <p> + <?php if( $this->getIsSubscribed() ): ?> + <?php echo __("You subscribe to 'General Subscription'.") ?> + <?php else: ?> + <?php echo __('You do not subscribe to a newsletter.') ?> + <?php endif; ?> + </p> + </div> + </div> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.account.dashboard.info.extra')?> + </div> + <?php endif; ?> +</div> diff --git a/app/code/Magento/Customer/view/frontend/account/dashboard/newsletter.phtml b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/newsletter.phtml similarity index 98% rename from app/code/Magento/Customer/view/frontend/account/dashboard/newsletter.phtml rename to app/design/frontend/magento_backup/Magento_Customer/account/dashboard/newsletter.phtml index 7e1de16116f..acbb68584c9 100644 --- a/app/code/Magento/Customer/view/frontend/account/dashboard/newsletter.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/account/dashboard/newsletter.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,16 +16,16 @@ * * 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 design - * @package base_default - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="col-2"> - <h4><?php echo __('Newsletters') ?></h4> - <a href="<?php echo $this->getUrl('newsletter/manage') ?>"><?php echo __('Edit Newsletters') ?></a> - <p><?php echo __('You subscribe to our newsletter.') ?></p> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="col-2"> + <h4><?php echo __('Newsletters') ?></h4> + <a href="<?php echo $this->getUrl('newsletter/manage') ?>"><?php echo __('Edit Newsletters') ?></a> + <p><?php echo __('You subscribe to our newsletter.') ?></p> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/account/link/back.phtml b/app/design/frontend/magento_backup/Magento_Customer/account/link/back.phtml similarity index 81% rename from app/design/frontend/magento_plushe/Magento_Customer/account/link/back.phtml rename to app/design/frontend/magento_backup/Magento_Customer/account/link/back.phtml index f983ab287d7..5dd122210dc 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/account/link/back.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/account/link/back.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,13 +16,14 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="actions"> - <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a></div> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="buttons-set"> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/account/navigation.phtml b/app/design/frontend/magento_backup/Magento_Customer/account/navigation.phtml similarity index 80% rename from app/design/frontend/magento_plushe/Magento_Customer/account/navigation.phtml rename to app/design/frontend/magento_backup/Magento_Customer/account/navigation.phtml index cb0c609ef62..9fe95fd9470 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/account/navigation.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/account/navigation.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,23 +16,21 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php /** @var $this \Magento\Customer\Block\Account\Navigation */ ?> -<div class="block account nav"> - <div class="title"> - <strong><?php echo __('My Account'); ?></strong> - </div> - <div class="content"> - <navigation class="account nav"> - <ul class="nav items"> - <?php echo $this->getChildHtml();?> - </ul> - </navigation> - </div> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/** @var $this \Magento\Page\Block\Links */ +?> +<?php /** @var $this \Magento\Customer\Block\Account\Navigation */ ?> +<div class="block block-account"> + <div class="block-title"> + <strong><span><?php echo __('My Account'); ?></span></strong> + </div> + <div class="block-content"> + <ul> + <?php echo $this->getChildHtml();?> + </ul> + </div> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Customer/address.js b/app/design/frontend/magento_backup/Magento_Customer/address.js new file mode 100644 index 00000000000..5e63a788204 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/address.js @@ -0,0 +1,73 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 customer view + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true, jquery:true*/ +/*global confirm:true*/ +(function($, window) { + "use strict"; + $.widget('mage.address', { + /** + * Options common to all instances of this widget. + * @type {Object} + */ + options: { + deleteConfirmMessage: $.mage.__('Are you sure you want to delete this address?') + }, + + /** + * Bind event handlers for adding and deleting addresses. + * @private + */ + _create: function() { + $(this.options.addAddress).on('click', $.proxy(this._addAddress, this)); + $(this.options.deleteAddress).on('click', $.proxy(this._deleteAddress, this)); + }, + + /** + * Add a new address. + * @private + */ + _addAddress: function() { + window.location = this.options.addAddressLocation; + }, + + /** + * Delete the address whose id is specified in a data attribute after confirmation from the user. + * @private + * @param {Event} + * @return {Boolean} + */ + _deleteAddress: function(e) { + if (confirm(this.options.deleteConfirmMessage)) { + if (typeof $(e.target).parent().data('address') !== 'undefined') { + window.location = this.options.deleteUrlPrefix + $(e.target).parent().data('address'); + } + else { + window.location = this.options.deleteUrlPrefix + $(e.target).data('address'); + } + } + return false; + } + }); +})(jQuery, window); diff --git a/app/code/Magento/Customer/view/frontend/address.phtml b/app/design/frontend/magento_backup/Magento_Customer/address.phtml similarity index 98% rename from app/code/Magento/Customer/view/frontend/address.phtml rename to app/design/frontend/magento_backup/Magento_Customer/address.phtml index 25591391f21..9587b2ff326 100644 --- a/app/code/Magento/Customer/view/frontend/address.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/address.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,81 +16,81 @@ * * 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 customer address - * @package mage - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="page-title"> - <h1><?php echo __('Address Books') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<table width="100%"> - <tr> - <td style="width:50%;"><h3>Default</h3> - <table width="100%"> - <?php if(!empty($primaryAddresses)): ?> - <?php foreach($primaryAddresses as $_address): ?> - <tr> - <td> - <address> - <?php echo $_address->format('html') ?> - </address> - <p> - <strong><a href="<?php echo $this->getUrl('customer/address/form', array('address'=>$_address->getAddressId())) ?>" class="red-link"><?php echo __('Edit Address') ?></a></strong> - </p> - </td> - </tr> - <?php endforeach; ?> - <?php else: ?> - <tr> - <td> - <p><?php echo __('You have no default entries in your address book.') ?></p> - </td> - </tr> - <?php endif ?> - </table> - </td> - <td style="width:50%;"><h3><?php echo __('Additional Address Entries') ?></h3> - <table width="100%"> - <?php if(!empty($alternativeAddresses)): ?> - <?php foreach($alternativeAddresses as $_address): ?> - <tr> - <td> - <address> - <?php echo $_address->format('html') ?> - </address> - <p> - <strong><a href="<?php echo $this->getUrl('customer/address/form', array('address'=>$_address->getAddressId())) ?>" class="red-link"><?php echo __('Edit Address') ?></a></strong><span class="separator"> | </span><strong><a href="#" role="delete-address" data-address="<?php echo $_address->getAddressId() ?>" class="red-link"><?php echo __('Delete Address') ?></a></strong> - </p> - </td> - </tr> - <?php endforeach; ?> - <?php else: ?> - <tr> - <td> - <p><?php echo __('You have no additional entries in your address book.') ?></p> - </td> - </tr> - <?php endif ?> - </table> - </td> - </tr> -</table> -<div class="buttons-set"> - <p class="back-link"><a href="<?php echo $this->getUrl('customer/account/') ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button type="button" class="button" role="add-address"><span><span><?php echo __('New Address') ?></span></span></button> -</div> -<script type="text/javascript"> - head.js("<?php echo $this->getViewFileUrl('Magento_Customer::address.js') ?>", function() { - jQuery('div.page-title').address({ - deleteAddress: "p a[role='delete-address']", - deleteUrlPrefix: "<?php echo $this->getUrl('customer/address/delete') ?>address/", - addAddress: "div.buttons-set button[role='add-address']", - addAddressLocation: "<?php echo $this->getUrl('customer/address/form') ?>" - }); - }); -</script> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category customer address + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('Address Books') ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<table width="100%"> + <tr> + <td style="width:50%;"><h3>Default</h3> + <table width="100%"> + <?php if(!empty($primaryAddresses)): ?> + <?php foreach($primaryAddresses as $_address): ?> + <tr> + <td> + <address> + <?php echo $_address->format('html') ?> + </address> + <p> + <strong><a href="<?php echo $this->getUrl('customer/address/form', array('address'=>$_address->getAddressId())) ?>" class="red-link"><?php echo __('Edit Address') ?></a></strong> + </p> + </td> + </tr> + <?php endforeach; ?> + <?php else: ?> + <tr> + <td> + <p><?php echo __('You have no default entries in your address book.') ?></p> + </td> + </tr> + <?php endif ?> + </table> + </td> + <td style="width:50%;"><h3><?php echo __('Additional Address Entries') ?></h3> + <table width="100%"> + <?php if(!empty($alternativeAddresses)): ?> + <?php foreach($alternativeAddresses as $_address): ?> + <tr> + <td> + <address> + <?php echo $_address->format('html') ?> + </address> + <p> + <strong><a href="<?php echo $this->getUrl('customer/address/form', array('address'=>$_address->getAddressId())) ?>" class="red-link"><?php echo __('Edit Address') ?></a></strong><span class="separator"> | </span><strong><a href="#" role="delete-address" data-address="<?php echo $_address->getAddressId() ?>" class="red-link"><?php echo __('Delete Address') ?></a></strong> + </p> + </td> + </tr> + <?php endforeach; ?> + <?php else: ?> + <tr> + <td> + <p><?php echo __('You have no additional entries in your address book.') ?></p> + </td> + </tr> + <?php endif ?> + </table> + </td> + </tr> +</table> +<div class="buttons-set"> + <p class="back-link"><a href="<?php echo $this->getUrl('customer/account/') ?>"><small>« </small><?php echo __('Back') ?></a></p> + <button type="button" class="button" role="add-address"><span><span><?php echo __('New Address') ?></span></span></button> +</div> +<script type="text/javascript"> + head.js("<?php echo $this->getViewFileUrl('Magento_Customer::address.js') ?>", function() { + jQuery('div.page-title').address({ + deleteAddress: "p a[role='delete-address']", + deleteUrlPrefix: "<?php echo $this->getUrl('customer/address/delete') ?>address/", + addAddress: "div.buttons-set button[role='add-address']", + addAddressLocation: "<?php echo $this->getUrl('customer/address/form') ?>" + }); + }); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Customer/address/book.phtml b/app/design/frontend/magento_backup/Magento_Customer/address/book.phtml new file mode 100644 index 00000000000..b119c1ce8ec --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/address/book.phtml @@ -0,0 +1,105 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 customer address book + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * Temlate for \Magento\Customer\Block\Address\Book block + * @var $this \Magento\Customer\Block\Address\Book + */ +?> +<div class="page-title title-buttons"> + <h1><?php echo __('Address Book') ?></h1> + <button type="button" role="add-address" title="<?php echo __('Add New Address') ?>" class="button"><span><span><?php echo __('Add New Address') ?></span></span></button> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<div class="col2-set addresses-list"> + <div class="col-1 addresses-primary"> + <h2><?php echo __('Default Addresses') ?></h2> + <ol> + <?php if($_pAddsses = $this->getDefaultBilling()): ?> + <li class="item"> + <h3><?php echo __('Default Billing Address') ?></h3> + <address> + <?php echo $this->getAddressHtml($this->getAddressById($_pAddsses)) ?> + </address> + <p><a href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"><?php echo __('Change Billing Address') ?></a></p> + </li> + <?php else: ?> + <li class="item"> + <h3><?php echo __('Default Billing Address') ?></h3> + <?php echo __('You have no default billing address in your address book.') ?> + </li> + <?php endif ?> + + <?php if($_pAddsses = $this->getDefaultShipping()): ?> + <li class="item"> + <h3><?php echo __('Default Shipping Address') ?></h3> + <address> + <?php echo $this->getAddressHtml($this->getAddressById($_pAddsses)) ?> + </address> + <p><a href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"><?php echo __('Change Shipping Address') ?></a></p> + </li> + <?php else: ?> + <li class="item empty"> + <h3><?php echo __('Default Shipping Address') ?></h3> + <p><?php echo __('You have no default shipping address in your address book.') ?></p> + </li> + <?php endif ?> + </ol> + </div> + <div class="col-2 addresses-additional"> + <h2><?php echo __('Additional Address Entries') ?></h2> + <ol> + <?php if($_pAddsses = $this->getAdditionalAddresses()): ?> + <?php foreach($_pAddsses as $_address): ?> + <li class="item"> + <address> + <?php echo $this->getAddressHtml($_address) ?> + </address> + <p><a href="<?php echo $this->getUrl('customer/address/edit', array('id'=>$_address->getId())) ?>"><?php echo __('Edit Address') ?></a> <span class="separator">|</span> <a href="#" class="link-remove" role="delete-address" data-address="<?php echo $_address->getId() ?>"><?php echo __('Delete Address') ?></a></p> + </li> + <?php endforeach; ?> + <?php else: ?> + <li class="item empty"> + <p><?php echo __('You have no more address entries in your address book.') ?></p> + </li> + <?php endif ?> + </ol> + </div> +</div> +<div class="buttons-set"> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> +</div> +<script type="text/javascript"> + head.js("<?php echo $this->getViewFileUrl('Magento_Customer::address.js');?>", function() { + jQuery('div.page-title').address({ + deleteAddress: "li.item a[role='delete-address']", + deleteUrlPrefix: '<?php echo $this->getDeleteUrl() ?>id/', + addAddress: "div.title-buttons button[role='add-address']", + addAddressLocation: '<?php echo $this->getAddAddressUrl() ?>' + }); + }); +</script> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/address.phtml b/app/design/frontend/magento_backup/Magento_Customer/address/edit.phtml similarity index 52% rename from app/design/frontend/magento_plushe/Magento_Customer/form/address.phtml rename to app/design/frontend/magento_backup/Magento_Customer/address/edit.phtml index b2493aded84..c74bf1efc29 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/address.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/address/edit.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,140 +16,161 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="page-title"> - <h1><?php if($data->getAddressId()): ?><?php echo __('Edit Address Entry') ?><?php else: ?><?php echo __('New Address Entry') ?><?php endif ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $action ?>" method="post" id="form-validate"> - <div class="fieldset"> - <input type="hidden" name="address_id" value="<?php echo $data->getAddressId() ?>" /> - <input type="hidden" name="customer_id" id="address_id" value="<?php echo $data->getCustomerId() ?>" /> - <h2 class="legend"><?php echo __('Personal Information') ?></h2> - <ul class="form-list"> - <li class="fields"> - <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($data)->toHtml() ?> - </li> - <li> - <label for="company"><?php echo __('Company') ?></label> - <div class="input-box"> - <input type="text" name="company" id="company" title="<?php echo __('Company') ?>" value="<?php echo $this->escapeHtml($data->getCompany()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> - </div> - </li> - </ul> - </div> - <div class="fieldset"> - <h2 class="legend"><?php echo __('Address') ?></h2> - <ul class="form-list"> - <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> - <li> - <label for="street_1" class="required"><em>*</em><?php echo __('Street Address') ?></label> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($data->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </li> - <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> - <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> - <li class="add-field"> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($data->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </li> - <?php endfor; ?> - <li class="fields"> - <div class="field"> - <label for="city" class="required"><em>*</em><?php echo __('City') ?></label> - <div class="input-box"> - <input type="text" name="city" value="<?php echo $this->escapeHtml($data->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> - </div> - </div> - <div class="field"> - <label for="region_id" class="required"><em>*</em><?php echo __('State/Province') ?></label> - <div class="input-box"> - <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> - <option value=""><?php echo __('Please select region, state or province') ?></option> - </select> - <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" style="display:none;" /> - </div> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="zip" class="required"><em>*</em><?php echo __('Zip/Postal Code') ?></label> - <div class="input-box"> - <input type="text" name="postcode" value="<?php echo $this->escapeHtml($data->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> - </div> - </div> - <div class="field"> - <label for="country" class="required"><em>*</em><?php echo __('Country') ?></label> - <div class="input-box"> - <select name="country_id" id="country" title="<?php echo __('Country') ?>" class="validate-select"> - <?php echo $countries->toHtmlOptions($data->getCountryId()) ?> - </select> - </div> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="telephone" class="required"><em>*</em><?php echo __('Telephone') ?></label> - <div class="input-box"> - <input type="text" name="telephone" value="<?php echo $this->escapeHtml($data->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone" /> - </div> - </div> - <div class="field"> - <label for="fax"><?php echo __('Fax') ?></label> - <div class="input-box"> - <input type="text" name="fax" value="<?php echo $this->escapeHtml($data->getFax()) ?>" title="<?php echo __('Fax') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('fax') ?>" id="fax" /> - </div> - </div> - </li> - <?php foreach ($primaryTypes as $code=>$type): ?> - <li class="control"> - <?php if ($address->isPrimary($type['address_type_id'])): ?> - <p><?php echo __("This is My Default %1 Address", ucfirst($type['name'])) ?></p> - <?php else: ?> - <div class="input-box"> - <input type="checkbox" id="primary_<?php echo $code ?>" name="primary_types[]" value="<?php echo $type['address_type_id'] ?>" class="checkbox" /> - </div> - <label for="primary_<?php echo $code ?>"><?php echo __("Use as My Default %1 Address", ucfirst($type['name'])) ?></label> - <?php endif ?> - </li> - <?php endforeach ?> - </ul> - </div> - <div class="buttons-set form-buttons"> - <p class="back-link"><a href="<?php echo $this->getUrl('customer/address/') ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button class="button" type="submit"><span><span><?php echo __('Save Address') ?></span></span></button> - </div> - <p class="required"><?php echo __('* Required Fields') ?></p> -</form> -<script type="text/javascript"> - //<![CDATA[ - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", - function() { - $('#country').regionUpdater({ - optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all')? 'true' : 'false'); ?>, - regionListId: '#region_id', - regionInputId: '#region', - postcodeId: '#zip', - form: $('#form-validate').validation(), - regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, - defaultRegion: "<?php echo $this->getAddress()->getRegionId() ?>", - countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> - }); - }); - })(jQuery); - //]]> -</script> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * Edit customer address template + * + * @var $this \Magento\Customer\Block\Address\Edit + */ +?> +<?php if($this->getTitle()): ?> +<div class="page-title"> + <h1><?php echo $this->getTitle() ?></h1> +</div> +<?php endif; ?> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate"> + <div class="fieldset"> + <?php echo $this->getBlockHtml('formkey')?> + <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" /> + <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" /> + <h2 class="legend"><?php echo __('Contact Information') ?></h2> + <ul class="form-list"> + <li class="fields"> + <?php echo $this->getNameBlockHtml() ?> + </li> + <li class="wide"> + <label for="company"><?php echo __('Company') ?></label> + <div class="input-box"> + <input type="text" name="company" id="company" title="<?php echo __('Company') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> + </div> + </li> + <li class="fields"> + <div class="field"> + <label for="telephone" class="required"><em>*</em><?php echo __('Telephone') ?></label> + <div class="input-box"> + <input type="text" name="telephone" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone" /> + </div> + </div> + <div class="field"> + <label for="fax"><?php echo __('Fax') ?></label> + <div class="input-box"> + <input type="text" name="fax" id="fax" title="<?php echo __('Fax') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('fax') ?>" /> + </div> + </div> + </li> + </ul> + </div> + <div class="fieldset"> + <h2 class="legend"><?php echo __('Address') ?></h2> + <ul class="form-list"> + <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> + <li class="wide"> + <label for="street_1" class="required"><em>*</em><?php echo __('Street Address') ?></label> + <div class="input-box"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> + </div> + </li> + <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> + <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> + <li class="wide"> + <div class="input-box"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> + </div> + </li> + <?php endfor; ?> + <?php if ($this->helper('Magento\Customer\Helper\Address')->isVatAttributeVisible()) : ?> + <li class="wide"> + <label for="vat_id"><?php echo __('VAT Number') ?></label> + <div class="input-box"> + <input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo __('VAT Number') ?>" id="vat_id" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('vat_id') ?>" /> + </div> + </li> + <?php endif; ?> + <li class="fields"> + <div class="field"> + <label for="city" class="required"><em>*</em><?php echo __('City') ?></label> + <div class="input-box"> + <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> + </div> + </div> + <div class="field"> + <label for="region_id" class="required"><em>*</em><?php echo __('State/Province') ?></label> + <div class="input-box"> + <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;" <?php if ($this->getConfigNode('general/region/display_all') === 0) { ?>disabled="disabled"<?php } ?>> + <option value=""><?php echo __('Please select region, state or province') ?></option> + </select> + <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" <?php if ($this->getConfigNode('general/region/display_all') === 0) { ?>disabled="disabled"<?php } ?>/> + </div> + </div> + </li> + <li class="fields"> + <div class="field"> + <label for="zip" class="required"><em>*</em><?php echo __('Zip/Postal Code') ?></label> + <div class="input-box"> + <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> + </div> + </div> + <div class="field"> + <label for="country" class="required"><em>*</em><?php echo __('Country') ?></label> + <div class="input-box"> + <?php echo $this->getCountryHtmlSelect() ?> + </div> + </div> + </li> + <li<?php if($this->canSetAsDefaultBilling()) echo ' class="control"' ?>> + <?php if($this->isDefaultBilling()): ?> + <strong><?php echo __('Default Billing Address') ?></strong> + <?php elseif($this->canSetAsDefaultBilling()): ?> + <input type="checkbox" id="primary_billing" name="default_billing" value="1" title="<?php echo __('Use this as my default billing address.') ?>" class="checkbox" /><label for="primary_billing"><?php echo __('Use as my default billing address') ?></label> + <?php else: ?> + <input type="hidden" name="default_billing" value="1" /> + <?php endif; ?> + </li> + <li<?php if($this->canSetAsDefaultShipping()) echo ' class="control"' ?>> + <?php if($this->isDefaultShipping()): ?> + <strong><?php echo __('Default Shipping Address') ?></strong> + <?php elseif($this->canSetAsDefaultShipping()): ?> + <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" title="<?php echo __('Use this as my default shipping address.') ?>" class="checkbox" /><label for="primary_shipping"><?php echo __('Use as my default shipping address') ?></label> + <?php else: ?> + <input type="hidden" name="default_shipping" value="1" /> + <?php endif; ?> + </li> + </ul> + </div> + <div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> + <button type="submit" title="<?php echo __('Save Address') ?>" class="button"><span><span><?php echo __('Save Address') ?></span></span></button> + </div> +</form> +<script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", + function() { + $('#country').regionUpdater({ + optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all')? 'true' : 'false'); ?>, + regionListId: '#region_id', + regionInputId: '#region', + postcodeId: '#zip', + form: $('#form-validate').validation(), + regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, + defaultRegion: "<?php echo $this->getAddress()->getRegionId() ?>", + countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> + }); + }); + })(jQuery); +</script> diff --git a/app/code/Magento/Customer/view/frontend/balance.phtml b/app/design/frontend/magento_backup/Magento_Customer/balance.phtml similarity index 98% rename from app/code/Magento/Customer/view/frontend/balance.phtml rename to app/design/frontend/magento_backup/Magento_Customer/balance.phtml index cfbc85f772e..2fa29d65b4c 100644 --- a/app/code/Magento/Customer/view/frontend/balance.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/balance.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,16 +16,16 @@ * * 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 design - * @package base_default - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<?php echo __('Your account balance is: %1', $customer->getStoreBalance()) ?> -<div class="buttons-set"> - <p class="back-link"><a href="<?php echo $this->getUrl('customer/account') ?>"><small>« </small><?php echo __('Back') ?></a></p> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<?php echo __('Your account balance is: %1', $customer->getStoreBalance()) ?> +<div class="buttons-set"> + <p class="back-link"><a href="<?php echo $this->getUrl('customer/account') ?>"><small>« </small><?php echo __('Back') ?></a></p> +</div> diff --git a/app/code/Magento/Customer/view/frontend/form/address.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/address.phtml similarity index 98% rename from app/code/Magento/Customer/view/frontend/form/address.phtml rename to app/design/frontend/magento_backup/Magento_Customer/form/address.phtml index 1db177a0da5..9bcabcd4004 100644 --- a/app/code/Magento/Customer/view/frontend/form/address.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/form/address.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,139 +16,139 @@ * * 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 design - * @package base_default - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<div class="page-title"> - <h1><?php if($data->getAddressId()): ?><?php echo __('Edit Address Entry') ?><?php else: ?><?php echo __('New Address Entry') ?><?php endif ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $action ?>" method="post" id="form-validate"> - <div class="fieldset"> - <input type="hidden" name="address_id" value="<?php echo $data->getAddressId() ?>" /> - <input type="hidden" name="customer_id" id="address_id" value="<?php echo $data->getCustomerId() ?>" /> - <h2 class="legend"><?php echo __('Personal Information') ?></h2> - <ul class="form-list"> - <li class="fields"> - <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($data)->toHtml() ?> - </li> - <li> - <label for="company"><?php echo __('Company') ?></label> - <div class="input-box"> - <input type="text" name="company" id="company" title="<?php echo __('Company') ?>" value="<?php echo $this->escapeHtml($data->getCompany()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> - </div> - </li> - </ul> - </div> - <div class="fieldset"> - <h2 class="legend"><?php echo __('Address') ?></h2> - <ul class="form-list"> - <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> - <li class="wide"> - <label for="street_1" class="required"><em>*</em><?php echo __('Street Address') ?></label> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($data->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </li> - <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> - <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> - <li class="wide"> - <div class="input-box"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($data->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </li> - <?php endfor; ?> - <li class="fields"> - <div class="field"> - <label for="city" class="required"><em>*</em><?php echo __('City') ?></label> - <div class="input-box"> - <input type="text" name="city" value="<?php echo $this->escapeHtml($data->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> - </div> - </div> - <div class="field"> - <label for="region_id" class="required"><em>*</em><?php echo __('State/Province') ?></label> - <div class="input-box"> - <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> - <option value=""><?php echo __('Please select a region, state or province.') ?></option> - </select> - <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" style="display:none;" /> - </div> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="zip" class="required"><em>*</em><?php echo __('Zip/Postal Code') ?></label> - <div class="input-box"> - <input type="text" name="postcode" value="<?php echo $this->escapeHtml($data->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> - </div> - </div> - <div class="field"> - <label for="country" class="required"><em>*</em><?php echo __('Country') ?></label> - <div class="input-box"> - <select name="country_id" id="country" title="<?php echo __('Country') ?>" class="validate-select"> - <?php echo $countries->toHtmlOptions($data->getCountryId()) ?> - </select> - </div> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="telephone" class="required"><em>*</em><?php echo __('Telephone') ?></label> - <div class="input-box"> - <input type="text" name="telephone" value="<?php echo $this->escapeHtml($data->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone" > - </div> - </div> - <div class="field"> - <label for="fax"><?php echo __('Fax') ?></label> - <div class="input-box"> - <input type="text" name="fax" value="<?php echo $this->escapeHtml($data->getFax()) ?>" title="<?php echo __('Fax') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('fax') ?>" id="fax" /> - </div> - </div> - </li> - <?php foreach ($primaryTypes as $code=>$type): ?> - <li<?php if (!$address->isPrimary($type['address_type_id'])) echo ' class="control"' ?>> - <?php if ($address->isPrimary($type['address_type_id'])): ?> - <strong><?php echo __("This is my default %1 address.", ucfirst($type['name'])) ?></strong> - <?php else: ?> - <input type="checkbox" id="primary_<?php echo $code ?>" name="primary_types[]" value="<?php echo $type['address_type_id'] ?>" class="checkbox" /><label for="primary_<?php echo $code ?>"><?php echo __("Use this as my default %1 address.", ucfirst($type['name'])) ?></label> - <?php endif ?> - </li> - <?php endforeach ?> - </ul> - </div> - <div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->getUrl('customer/address/') ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button type="submit" class="button" title="<?php echo __('Save Address') ?>"><span><span><?php echo __('Save Address') ?></span></span></button> - </div> -</form> -<script type="text/javascript"> -//<![CDATA[ -(function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", - function() { - $('#country').regionUpdater({ - optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all') ? 'true' : 'false'); ?>, - regionListId: '#region_id', - regionInputId: '#region', - postcodeId: '#zip', - form: $('#form-validate').validation(), - regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, - defaultRegion: "<?php echo $this->getAddress()->getRegionId() ?>", - countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> - }); - }); -})(jQuery); -//]]> -</script> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<div class="page-title"> + <h1><?php if($data->getAddressId()): ?><?php echo __('Edit Address Entry') ?><?php else: ?><?php echo __('New Address Entry') ?><?php endif ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<form action="<?php echo $action ?>" method="post" id="form-validate"> + <div class="fieldset"> + <input type="hidden" name="address_id" value="<?php echo $data->getAddressId() ?>" /> + <input type="hidden" name="customer_id" id="address_id" value="<?php echo $data->getCustomerId() ?>" /> + <h2 class="legend"><?php echo __('Personal Information') ?></h2> + <ul class="form-list"> + <li class="fields"> + <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($data)->toHtml() ?> + </li> + <li> + <label for="company"><?php echo __('Company') ?></label> + <div class="input-box"> + <input type="text" name="company" id="company" title="<?php echo __('Company') ?>" value="<?php echo $this->escapeHtml($data->getCompany()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> + </div> + </li> + </ul> + </div> + <div class="fieldset"> + <h2 class="legend"><?php echo __('Address') ?></h2> + <ul class="form-list"> + <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> + <li class="wide"> + <label for="street_1" class="required"><em>*</em><?php echo __('Street Address') ?></label> + <div class="input-box"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($data->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> + </div> + </li> + <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> + <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> + <li class="wide"> + <div class="input-box"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($data->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> + </div> + </li> + <?php endfor; ?> + <li class="fields"> + <div class="field"> + <label for="city" class="required"><em>*</em><?php echo __('City') ?></label> + <div class="input-box"> + <input type="text" name="city" value="<?php echo $this->escapeHtml($data->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> + </div> + </div> + <div class="field"> + <label for="region_id" class="required"><em>*</em><?php echo __('State/Province') ?></label> + <div class="input-box"> + <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> + <option value=""><?php echo __('Please select a region, state or province.') ?></option> + </select> + <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" style="display:none;" /> + </div> + </div> + </li> + <li class="fields"> + <div class="field"> + <label for="zip" class="required"><em>*</em><?php echo __('Zip/Postal Code') ?></label> + <div class="input-box"> + <input type="text" name="postcode" value="<?php echo $this->escapeHtml($data->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> + </div> + </div> + <div class="field"> + <label for="country" class="required"><em>*</em><?php echo __('Country') ?></label> + <div class="input-box"> + <select name="country_id" id="country" title="<?php echo __('Country') ?>" class="validate-select"> + <?php echo $countries->toHtmlOptions($data->getCountryId()) ?> + </select> + </div> + </div> + </li> + <li class="fields"> + <div class="field"> + <label for="telephone" class="required"><em>*</em><?php echo __('Telephone') ?></label> + <div class="input-box"> + <input type="text" name="telephone" value="<?php echo $this->escapeHtml($data->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone" > + </div> + </div> + <div class="field"> + <label for="fax"><?php echo __('Fax') ?></label> + <div class="input-box"> + <input type="text" name="fax" value="<?php echo $this->escapeHtml($data->getFax()) ?>" title="<?php echo __('Fax') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('fax') ?>" id="fax" /> + </div> + </div> + </li> + <?php foreach ($primaryTypes as $code=>$type): ?> + <li<?php if (!$address->isPrimary($type['address_type_id'])) echo ' class="control"' ?>> + <?php if ($address->isPrimary($type['address_type_id'])): ?> + <strong><?php echo __("This is my default %1 address.", ucfirst($type['name'])) ?></strong> + <?php else: ?> + <input type="checkbox" id="primary_<?php echo $code ?>" name="primary_types[]" value="<?php echo $type['address_type_id'] ?>" class="checkbox" /><label for="primary_<?php echo $code ?>"><?php echo __("Use this as my default %1 address.", ucfirst($type['name'])) ?></label> + <?php endif ?> + </li> + <?php endforeach ?> + </ul> + </div> + <div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->getUrl('customer/address/') ?>"><small>« </small><?php echo __('Back') ?></a></p> + <button type="submit" class="button" title="<?php echo __('Save Address') ?>"><span><span><?php echo __('Save Address') ?></span></span></button> + </div> +</form> +<script type="text/javascript"> +//<![CDATA[ +(function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", + function() { + $('#country').regionUpdater({ + optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all') ? 'true' : 'false'); ?>, + regionListId: '#region_id', + regionInputId: '#region', + postcodeId: '#zip', + form: $('#form-validate').validation(), + regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, + defaultRegion: "<?php echo $this->getAddress()->getRegionId() ?>", + countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> + }); + }); +})(jQuery); +//]]> +</script> diff --git a/app/code/Magento/Customer/view/frontend/form/changepassword.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/changepassword.phtml similarity index 98% rename from app/code/Magento/Customer/view/frontend/form/changepassword.phtml rename to app/design/frontend/magento_backup/Magento_Customer/form/changepassword.phtml index fe98d887a66..1e4ff4df641 100644 --- a/app/code/Magento/Customer/view/frontend/form/changepassword.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/form/changepassword.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,88 +16,88 @@ * * 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 design - * @package base_default - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="page-title"> - <h1><?php echo __('Change Account Password') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $action ?>" method="post" id="form-validate"> -<div class="fieldset"> - <h2 class="legend"><?php echo __('Change Account Password') ?></h2> - <ul class="form-list"> - <li> - <label for="current_password" class="required"><em>*</em><?php echo __('Current Password') ?></label> - <div class="input-box"> - <input type="password" title="<?php echo __('Current Password') ?>" class="input-text" name="current_password" id="current_password" /> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="password" class="required"><em>*</em><?php echo __('New Password') ?></label> - <div class="input-box"> - <input type="password" title="<?php echo __('New Password') ?>" class="input-text" name="password" id="password" /> - </div> - </div> - <div class="field"> - <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm New Password') ?></label> - <div class="input-box"> - <input type="password" title="<?php echo __('Confirm New Password') ?>" class="input-text" name="confirmation" id="confirmation" /> - </div> - </div> - </li> - </ul> -</div> -<div class="buttons-set"> - <p class="required"><?php echo __('* Required Fields') ?></p> - <p class="back-link"><a href="<?php echo $this->getUrl('customer/account') ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button type="submit" title="<?php echo __('Save Password') ?>" class="button"><span><span><?php echo __('Save Password') ?></span></span></button> -</div> -</form> -<script type="text/javascript"> -//<![CDATA[ -(function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Customer::set-password.js') ?>", - <?php if ($_dob->isEnabled()): ?> - "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", - <?php endif ?> - function() { - $('#change-password').setPassword({ - currentPasswordId: '#current-password', - passwordId: '#password', - confirmationId: '#confirmation', - passwordContainer: 'div.fieldset', - showOnDefault: <?php echo $this->getCustomer()->getChangePassword() ? 'true' : 'false' ?> - }); - $('#form-validate').validation({ - <?php if ($_dob->isEnabled()): ?> - errorPlacement: function(error, element) { - if (element.prop('id') === 'dob') { - var dobElement = $('.customer-dob'), - errorClass = error.prop('class'); - error.insertAfter(element.parent()); - dobElement.find('.validate-custom').addClass(errorClass) - .after('<div class="' + errorClass + '"></div>'); - } - else { - error.insertAfter(element); - } - }, - ignore: ':hidden:not(#dob)' - <?php endif ?> - }); - }); -})(jQuery); -//]]> -</script> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('Change Account Password') ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<form action="<?php echo $action ?>" method="post" id="form-validate"> +<div class="fieldset"> + <h2 class="legend"><?php echo __('Change Account Password') ?></h2> + <ul class="form-list"> + <li> + <label for="current_password" class="required"><em>*</em><?php echo __('Current Password') ?></label> + <div class="input-box"> + <input type="password" title="<?php echo __('Current Password') ?>" class="input-text" name="current_password" id="current_password" /> + </div> + </li> + <li class="fields"> + <div class="field"> + <label for="password" class="required"><em>*</em><?php echo __('New Password') ?></label> + <div class="input-box"> + <input type="password" title="<?php echo __('New Password') ?>" class="input-text" name="password" id="password" /> + </div> + </div> + <div class="field"> + <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm New Password') ?></label> + <div class="input-box"> + <input type="password" title="<?php echo __('Confirm New Password') ?>" class="input-text" name="confirmation" id="confirmation" /> + </div> + </div> + </li> + </ul> +</div> +<div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->getUrl('customer/account') ?>"><small>« </small><?php echo __('Back') ?></a></p> + <button type="submit" title="<?php echo __('Save Password') ?>" class="button"><span><span><?php echo __('Save Password') ?></span></span></button> +</div> +</form> +<script type="text/javascript"> +//<![CDATA[ +(function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + "<?php echo $this->getViewFileUrl('Magento_Customer::set-password.js') ?>", + <?php if ($_dob->isEnabled()): ?> + "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", + <?php endif ?> + function() { + $('#change-password').setPassword({ + currentPasswordId: '#current-password', + passwordId: '#password', + confirmationId: '#confirmation', + passwordContainer: 'div.fieldset', + showOnDefault: <?php echo $this->getCustomer()->getChangePassword() ? 'true' : 'false' ?> + }); + $('#form-validate').validation({ + <?php if ($_dob->isEnabled()): ?> + errorPlacement: function(error, element) { + if (element.prop('id') === 'dob') { + var dobElement = $('.customer-dob'), + errorClass = error.prop('class'); + error.insertAfter(element.parent()); + dobElement.find('.validate-custom').addClass(errorClass) + .after('<div class="' + errorClass + '"></div>'); + } + else { + error.insertAfter(element); + } + }, + ignore: ':hidden:not(#dob)' + <?php endif ?> + }); + }); +})(jQuery); +//]]> +</script> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/confirmation.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/confirmation.phtml similarity index 75% rename from app/design/frontend/magento_plushe/Magento_Customer/form/confirmation.phtml rename to app/design/frontend/magento_backup/Magento_Customer/form/confirmation.phtml index e1c81f393e7..415eecd38d1 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/confirmation.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/form/confirmation.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,44 +16,46 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="page-title"> - <h1><?php echo __('Send confirmation link') ?></h1> -</div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="" method="post" id="form-validate"> - <div class="fieldset"> - <p><?php echo __('Please enter your email below and we will send you the confirmation link for it.') ?></p> - <ul class="form-list"> - <li> - <label for="email_address" class="required"><em>*</em><?php echo __('Email Address') ?></label> - <div class="input-box"> - <input type="text" name="email" id="email_address" class="input-text" value="<?php echo $this->escapeHtml($this->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}"/> - </div> - </li> - </ul> - </div> - <div class="buttons-set form-buttons"> - <p class="back-link"><a href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>"><small>« </small><?php echo __('Back to Login') ?></a></p> - <button type="submit" class="button right"><span><span><?php echo __('Submit') ?></span></span></button> - </div> - <p class="required"><?php echo __('* Required Fields') ?></p> -</form> -<script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - function() { - $('#form-validate').validation(); - }); - })(jQuery); -</script> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('Send confirmation link') ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<form action="" method="post" id="form-validate"> + <div class="fieldset"> + <h2 class="legend"><?php echo __('Retrieve your confirmation link here') ?></h2> + <p><?php echo __('Please enter your email below and we\'ll send you confirmation link for it.') ?></p> + <ul class="form-list"> + <li> + <label for="email_address" class="required"><em>*</em><?php echo __('Email Address') ?></label> + <div class="input-box"> + <input type="text" name="email" id="email_address" title="<?php echo __('Email Address') ?>" class="input-text" value="<?php echo $this->escapeHtml($this->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}"/> + </div> + </li> + </ul> + </div> + <div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>"><small>« </small><?php echo __('Back to Login') ?></a></p> + <button type="submit" title="<?php echo __('Submit') ?>" class="button"><span><span><?php echo __('Submit') ?></span></span></button> + </div> +</form> +<script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + function() { + $('#form-validate').validation(); + }); + })(jQuery); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Customer/form/edit.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/edit.phtml new file mode 100644 index 00000000000..211c497882b --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/form/edit.phtml @@ -0,0 +1,131 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('Edit Account Information') ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate"> + <div class="fieldset"> + <?php echo $this->getBlockHtml('formkey')?> + <h2 class="legend"><?php echo __('Account Information') ?></h2> + <ul class="form-list"> + <li class="fields"> + <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getCustomer())->toHtml() ?> + </li> + <li> + <label for="email" class="required"><em>*</em><?php echo __('Email Address') ?></label> + <div class="input-box"> + <input type="text" name="email" id="email" value="<?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}"/> + </div> + </li> + <?php $_dob = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> + <?php if ($_dob->isEnabled()): ?> + <li><?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></li> + <?php endif ?> + <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> + <?php if ($_taxvat->isEnabled()): ?> + <li><?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></li> + <?php endif ?> + <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> + <?php if ($_gender->isEnabled()): ?> + <li><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></li> + <?php endif ?> + <li class="control"> + <input type="checkbox" name="change_password" id="change-password" value="1" title="<?php echo __('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="change-password"><?php echo __('Change Password') ?></label> + </li> + </ul> + </div> + <div class="fieldset" style="display:none;"> + <h2 class="legend"><?php echo __('Change Password') ?></h2> + <ul class="form-list"> + <li> + <label for="current-password" class="required"><em>*</em><?php echo __('Current Password') ?></label> + <div class="input-box"> + <input type="password" title="<?php echo __('Current Password') ?>" class="input-text" name="current_password" id="current-password" /> + </div> + </li> + <li class="fields"> + <div class="field"> + <label for="password" class="required"><em>*</em><?php echo __('New Password') ?></label> + <div class="input-box"> + <input type="password" title="<?php echo __('New Password') ?>" class="input-text" name="password" id="password" /> + </div> + </div> + <div class="field"> + <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm New Password') ?></label> + <div class="input-box"> + <input type="password" title="<?php echo __('Confirm New Password') ?>" class="input-text" name="confirmation" id="confirmation" /> + </div> + </div> + </li> + </ul> + </div> + <div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> + <button type="submit" title="<?php echo __('Save') ?>" class="button"><span><span><?php echo __('Save') ?></span></span></button> + </div> +</form> +<script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + "<?php echo $this->getViewFileUrl('Magento_Customer::set-password.js') ?>", + <?php if ($_dob->isEnabled()): ?> + "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", + <?php endif ?> + function() { + $('#change-password').setPassword({ + currentPasswordId: '#current-password', + passwordId: '#password', + confirmationId: '#confirmation', + passwordContainer: 'div.fieldset', + showOnDefault: <?php echo $this->getCustomer()->getChangePassword() ? 'true' : 'false' ?> + }); + $('#form-validate').validation({ + <?php if ($_dob->isEnabled()): ?> + errorPlacement: function(error, element) { + if (element.prop('id') === 'dob') { + var dobElement = $('.customer-dob'), + errorClass = error.prop('class'); + error.insertAfter(element.parent()); + dobElement.find('.validate-custom').addClass(errorClass) + .after('<div class="' + errorClass + '"></div>'); + } + else { + error.insertAfter(element); + } + }, + ignore: ':hidden:not(#dob)' + <?php endif ?> + }); + }); + })(jQuery); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Customer/form/forgotpassword.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/forgotpassword.phtml new file mode 100644 index 00000000000..c59d80ba863 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/form/forgotpassword.phtml @@ -0,0 +1,62 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('Forgot Your Password?') ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<form action="<?php echo $this->getUrl('*/*/forgotpasswordpost') ?>" method="post" id="form-validate"> + <div class="fieldset"> + <h2 class="legend"><?php echo __('Retrieve your password here') ?></h2> + <p><?php echo __("Please enter your email address. We'll send a link to reset your password.") ?></p> + <ul class="form-list"> + <li> + <label for="email_address" class="required"><em>*</em><?php echo __('Email Address') ?></label> + <div class="input-box"> + <input type="text" name="email" alt="email" id="email_address" class="input-text" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" data-validate="{required:true, 'validate-email':true}" /> + </div> + </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> + </ul> + </div> + <div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>"><small>« </small><?php echo __('Back to Login') ?></a></p> + <button type="submit" title="<?php echo __('Submit') ?>" class="button"><span><span><?php echo __('Submit') ?></span></span></button> + </div> +</form> +<script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + function() { + $('#form-validate').validation(); + }); + })(jQuery); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Customer/form/login.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/login.phtml new file mode 100644 index 00000000000..fa3b3e4e670 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/form/login.phtml @@ -0,0 +1,99 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * Customer login form template + * + * @see \Magento\Customer\Block\Form\Login + */ +?> +<div class="account-login"> + <div class="page-title"> + <h1><?php echo __('Login or Create an Account') ?></h1> + </div> + <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.form.login.extra')?> + <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form"> + <div class="col2-set"> + <div class="col-1 new-users"> + <div class="content"> + <h2><?php echo __('New Customers') ?></h2> + <p><?php echo __('With your own account, you can check out faster, store multiple shipping addesses, see your shopping activity and more.') ?></p> + </div> + </div> + <div class="col-2 registered-users"> + <div class="content"> + <h2><?php echo __('Registered Customers') ?></h2> + <p><?php echo __('If you have an account with us, please log in.') ?></p> + <ul class="form-list"> + <li> + <label for="email" class="required"><em>*</em><?php echo __('Email Address') ?></label> + <div class="input-box"> + <input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text" title="<?php echo __('Email Address') ?>" data-validate="{required:true, 'validate-email':true}" /> + </div> + </li> + <li> + <label for="pass" class="required"><em>*</em><?php echo __('Password') ?></label> + <div class="input-box"> + <input type="password" name="login[password]" class="input-text" id="pass" title="<?php echo __('Password') ?>" data-validate="{required:true, 'validate-password':true}" /> + </div> + </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> + </ul> + <p class="required"><?php echo __('* Required Fields') ?></p> + </div> + </div> + </div> + <div class="col2-set"> + <div class="col-1 new-users"> + <div class="buttons-set"> + <button type="button" title="<?php echo __('Create an Account') ?>" class="button"><span><span><?php echo __('Create an Account') ?></span></span></button> + </div> + </div> + <div class="col-2 registered-users"> + <div class="buttons-set"> + <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo __('Forgot Your Password?') ?></a> + <button type="submit" class="button" title="<?php echo __('Login') ?>" name="send" id="send2"><span><span><?php echo __('Login') ?></span></span></button> + </div> + </div> + </div> + </form> + <script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + function() { + $('#login-form .new-users button').on('click', function() {window.location='<?php echo $this->getCreateAccountUrl() ?>';}); + $('#login-form').validation(); + }); + })(jQuery); + </script> +</div> diff --git a/app/code/Magento/Customer/view/frontend/form/mini.login.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/mini.login.phtml similarity index 98% rename from app/code/Magento/Customer/view/frontend/form/mini.login.phtml rename to app/design/frontend/magento_backup/Magento_Customer/form/mini.login.phtml index 9618af49ce0..be42c0ce0c8 100644 --- a/app/code/Magento/Customer/view/frontend/form/mini.login.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/form/mini.login.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,25 +16,25 @@ * * 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 design - * @package base_default - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="block block-login"> - <div class="block-title"> - <strong><span><?php echo __('Login') ?></span></strong> - </div> - <form action="<?php echo $this->getPostActionUrl() ?>" method="post"> - <div class="block-content"> - <label for="mini-login"><?php echo __('Email:') ?></label><input type="text" name="login[username]" id="mini-login" class="input-text" /> - <label for="mini-password"><?php echo __('Password:') ?></label><input type="password" name="login[password]" id="mini-password" class="input-text" /> - <div class="actions"> - <button type="submit" class="button"><span><span><?php echo __('Login') ?></span></span></button> - </div> - </div> - </form> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="block block-login"> + <div class="block-title"> + <strong><span><?php echo __('Login') ?></span></strong> + </div> + <form action="<?php echo $this->getPostActionUrl() ?>" method="post"> + <div class="block-content"> + <label for="mini-login"><?php echo __('Email:') ?></label><input type="text" name="login[username]" id="mini-login" class="input-text" /> + <label for="mini-password"><?php echo __('Password:') ?></label><input type="password" name="login[password]" id="mini-password" class="input-text" /> + <div class="actions"> + <button type="submit" class="button"><span><span><?php echo __('Login') ?></span></span></button> + </div> + </div> + </form> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/newsletter.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/newsletter.phtml similarity index 54% rename from app/design/frontend/magento_plushe/Magento_Customer/form/newsletter.phtml rename to app/design/frontend/magento_backup/Magento_Customer/form/newsletter.phtml index cd4a812be37..0c51597d8a3 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/newsletter.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/form/newsletter.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,30 +16,33 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php echo $this->getChildHtml('form_before')?> -<form class="form newsletter manage" action="<?php echo $this->getAction() ?>" method="post" id="form-validate"> - <fieldset class="fieldset"> - <?php echo $this->getBlockHtml('formkey')?> - <legend class="legend"><span><?php echo __('Subscription option') ?></span></legend><br /> - <div class="field choice"> - <input type="checkbox" name="is_subscribed" id="subscription" value="1" title="<?php echo __('General Subscription') ?>"<?php if($this->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" /> - <label for="subscription" class="label"><span><?php echo __('General Subscription') ?></span></label> - </div> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.form.newsletter.extra')?> - </ul> - </fieldset> - <div class="actions"> - <div class="primary"><button type="submit" title="<?php echo __('Save') ?>" class="action save"><span><?php echo __('Save') ?></span></button></div> - <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a></div> - </div> -</form> -<?php /* Extensions placeholder */ ?> -<?php echo $this->getChildHtml('customer.form.newsletter.extra2')?> \ No newline at end of file + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('Newsletter Subscription') ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<?php echo $this->getChildHtml('form_before')?> +<form action="<?php echo $this->getAction() ?>" method="post" id="form-validate"> + <div class="fieldset"> + <?php echo $this->getBlockHtml('formkey')?> + <h2 class="legend"><?php echo __('Newsletter Subscription') ?></h2> + <ul class="form-list"> + <li class="control"><input type="checkbox" name="is_subscribed" id="subscription" value="1" title="<?php echo __('General Subscription') ?>"<?php if($this->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="subscription"><?php echo __('General Subscription') ?></label></li> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.form.newsletter.extra')?> + </ul> + </div> + <div class="buttons-set"> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> + <button type="submit" title="<?php echo __('Save') ?>" class="button"><span><span><?php echo __('Save') ?></span></span></button> + </div> +</form> +<?php /* Extensions placeholder */ ?> +<?php echo $this->getChildHtml('customer.form.newsletter.extra2')?> diff --git a/app/design/frontend/magento_backup/Magento_Customer/form/register.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/register.phtml new file mode 100644 index 00000000000..3b5e2c03ae2 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/form/register.phtml @@ -0,0 +1,222 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * Create account form template + * + * @var $this \Magento\Customer\Block\Form\Register + */ +?> +<div class="account-create"> + <div class="page-title"> + <h1><?php echo __('Create an Account') ?></h1> + </div> + <?php echo $this->getChildHtml('form_fields_before')?> + <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.form.register.extra')?> + <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate"> + <div class="fieldset"> + <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" /> + <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" /> + <h2 class="legend"><?php echo __('Personal Information') ?></h2> + <ul class="form-list"> + <li class="fields"> + <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?> + </li> + <li> + <label for="email_address" class="required"><em>*</em><?php echo __('Email Address') ?></label> + <div class="input-box"> + <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}" /> + </div> + </li> + <?php if ($this->isNewsletterEnabled()): ?> + <li class="control"> + <div class="input-box"> + <input type="checkbox" name="is_subscribed" title="<?php echo __('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" /> + </div> + <label for="is_subscribed"><?php echo __('Sign Up for Newsletter') ?></label> + <?php /* Extensions placeholder */ ?> + <?php echo $this->getChildHtml('customer.form.register.newsletter')?> + </li> + <?php endif ?> + <?php $_dob = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> + <?php if ($_dob->isEnabled()): ?> + <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li> + <?php endif ?> + <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> + <?php if ($_taxvat->isEnabled()): ?> + <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li> + <?php endif ?> + <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> + <?php if ($_gender->isEnabled()): ?> + <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li> + <?php endif ?> + </ul> + </div> + <?php if($this->getShowAddressFields()): ?> + <div class="fieldset"> + <input type="hidden" name="create_address" value="1" /> + <h2 class="legend"><?php echo __('Address Information') ?></h2> + <ul class="form-list"> + <li class="fields"> + <div class="field"> + <label for="company"><?php echo __('Company') ?></label> + <div class="input-box"> + <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo __('Company') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> + </div> + </div> + <div class="field"> + <label for="telephone" class="required"><em>*</em><?php echo __('Telephone') ?></label> + <div class="input-box"> + <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" /> + </div> + </div> + </li> + <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> + <li class="wide"> + <label for="street_1" class="required"><em>*</em><?php echo __('Street Address') ?></label> + <div class="input-box"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> + </div> + </li> + <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> + <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> + <li class="wide"> + <div class="input-box"> + <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> + </div> + </li> + <?php endfor; ?> + <li class="fields"> + <div class="field"> + <label for="city" class="required"><em>*</em><?php echo __('City') ?></label> + <div class="input-box"> + <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> + </div> + </div> + <div class="field"> + <label for="region_id" class="required"><em>*</em><?php echo __('State/Province') ?></label> + <div class="input-box"> + <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> + <option value=""><?php echo __('Please select a region, state or province.') ?></option> + </select> + + <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" style="display:none;" /> + </div> + </div> + </li> + <li class="fields"> + <div class="field"> + <label for="zip" class="required"><em>*</em><?php echo __('Zip/Postal Code') ?></label> + <div class="input-box"> + <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> + </div> + </div> + <div class="field"> + <label for="country" class="required"><em>*</em><?php echo __('Country') ?></label> + <div class="input-box"> + <?php echo $this->getCountryHtmlSelect() ?> + </div> + </div> + </li> + </ul> + <input type="hidden" name="default_billing" value="1" /> + <input type="hidden" name="default_shipping" value="1" /> + </div> + <?php endif; ?> + <div class="fieldset"> + <h2 class="legend"><?php echo __('Login Information') ?></h2> + <ul class="form-list"> + <li class="fields"> + <div class="field"> + <label for="password" class="required"><em>*</em><?php echo __('Password') ?></label> + <div class="input-box"> + <input type="password" name="password" id="password" title="<?php echo __('Password') ?>" class="input-text" data-validate="{required:true, 'validate-password':true}" /> + </div> + </div> + <div class="field"> + <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm Password') ?></label> + <div class="input-box"> + <input type="password" name="confirmation" title="<?php echo __('Confirm Password') ?>" id="confirmation" class="input-text" data-validate="{required:true, equalTo:'#password'}" /> + </div> + </div> + </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> + </ul> + </div> + <div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>« </small><?php echo __('Back') ?></a></p> + <button type="submit" title="<?php echo __('Submit') ?>" class="button"><span><span><?php echo __('Submit') ?></span></span></button> + </div> + </form> + <script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", + <?php if ($_dob->isEnabled()): ?> + "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", + <?php endif ?> + function() { + var dataForm = $('#form-validate').validation({ + <?php if ($_dob->isEnabled()): ?> + errorPlacement: function(error, element) { + if (element.prop('id') === 'dob') { + var dobElement = $('.customer-dob'), + errorClass = error.prop('class'); + error.insertAfter(element.parent()); + dobElement.find('.validate-custom').addClass(errorClass) + .after('<div class="' + errorClass + '"></div>'); + } + else { + error.insertAfter(element); + } + }, + ignore: ':hidden:not(#dob)' + <?php endif ?> + }); + <?php if($this->getShowAddressFields()): ?> + $('#country').regionUpdater({ + optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all')? 'true' : 'false'); ?>, + regionListId: '#region_id', + regionInputId: '#region', + postcodeId: '#zip', + form: dataForm, + regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, + defaultRegion: "<?php echo $this->getAddress()->getRegionId() ?>", + countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> + }); + <?php endif; ?> + }); + })(jQuery); + </script> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/resetforgottenpassword.phtml b/app/design/frontend/magento_backup/Magento_Customer/form/resetforgottenpassword.phtml similarity index 54% rename from app/design/frontend/magento_plushe/Magento_Customer/form/resetforgottenpassword.phtml rename to app/design/frontend/magento_backup/Magento_Customer/form/resetforgottenpassword.phtml index 5cb725070f6..470eafe25a2 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/resetforgottenpassword.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/form/resetforgottenpassword.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,44 +16,51 @@ * * 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 design - * @package base_default - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<form action="<?php echo $this->getUrl('*/*/resetpasswordpost', array('_query' => array('id' => $this->getCustomerId(), 'token' => $this->getResetPasswordLinkToken()))); ?>" method="post" id="form-validate" class="form password reset"> - <fieldset class="fieldset" data-hasrequired="<?php echo __('* Required Fields'); ?>"> - <div class="field password required"> - <label class="label" for="password"><span><?php echo __('New Password'); ?></span></label> - <div class="control"> - <input type="password" class="input-text" name="password" id="password" data-validate="{required:true, 'validate-password':true}"/> - </div> - </div> - <div class="field confirmation required"> - <label class="label" for="confirmation"><span><?php echo __('Confirm New Password'); ?></span></label> - <div class="control"> - <input type="password" class="input-text" name="confirmation" id="confirmation" data-validate="{required:true,equalTo:'#password'}"/> - </div> - </div> - </fieldset> - <div class="actions"> - <div class="primary"> - <button type="submit" title="<?php echo __('Reset a Password'); ?>" class="action submit"><span><?php echo __('Reset a Password'); ?></span></button> - </div> - </div> -</form> -<script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - function() { - $('#form-validate').validation(); - }); - })(jQuery); -</script> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('Create a new password'); ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml(); ?> +<form action="<?php echo $this->getUrl('*/*/resetpasswordpost', array('_query' => array('id' => $this->getCustomerId(), 'token' => $this->getResetPasswordLinkToken()))); ?>" method="post" id="form-validate"> + <div class="fieldset" style="margin-top: 70px;"> + <ul class="form-list"> + <li class="fields"> + <div class="field"> + <label for="password" class="required"><em>*</em><?php echo __('New Password'); ?></label> + <div class="input-box"> + <input type="password" class="input-text" name="password" id="password" data-validate="{required:true, 'validate-password':true}"/> + </div> + </div> + <div class="field"> + <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm New Password'); ?></label> + <div class="input-box"> + <input type="password" class="input-text" name="confirmation" id="confirmation" data-validate="{required:true,equalTo:'#password'}"/> + </div> + </div> + </li> + </ul> + </div> + <div class="buttons-set"> + <p class="required"><?php echo __('* Required Fields'); ?></p> + <button type="submit" title="<?php echo __('Submit'); ?>" class="button"><span><span><?php echo __('Submit'); ?></span></span></button> + </div> +</form> +<script type="text/javascript"> + (function($) { + head.js( + "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", + function() { + $('#form-validate').validation(); + }); + })(jQuery); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Customer/js/checkout-balance.js b/app/design/frontend/magento_backup/Magento_Customer/js/checkout-balance.js new file mode 100644 index 00000000000..b95e8ce5013 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/js/checkout-balance.js @@ -0,0 +1,52 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @package EE_Checkout_Balance + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true*/ +(function($) { + "use strict"; + $.widget('mage.checkoutBalance', { + /** + * Initialize store credit events + * @private + */ + _create: function() { + this.eventData = { + price: this.options.balance, + totalPrice: 0 + }; + this.element.on('change', $.proxy(function(e) { + if ($(e.target).is(':checked')) { + this.eventData.price = -1 * this.options.balance; + } else { + if (this.options.amountSubstracted) { + this.eventData.price = this.options.usedAmount; + this.options.amountSubstracted = false; + } else { + this.eventData.price = this.options.balance; + } + } + this.element.trigger('updateCheckoutPrice', this.eventData); + }, this)); + } + }); +})(jQuery); diff --git a/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account.xml new file mode 100644 index 00000000000..7fa2bdb7b59 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account.xml @@ -0,0 +1,60 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account (All Pages)" type="page"> + <referenceBlock name="root"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">2columns-left.phtml</argument> + </action> + </referenceBlock> + <referenceContainer name="content"> + <container name="my.account.wrapper" label="My Account Wrapper" htmlTag="div" htmlClass="my-account"/> + </referenceContainer> + <referenceContainer name="left"> + <block class="Magento\Page\Block\Links" name="customer_account_navigation" before="-" template="Magento_Customer::account/navigation.phtml"> + <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-account-link"> + <arguments> + <argument name="label" xsi:type="string">Account Dashboard</argument> + <argument name="path" xsi:type="string">customer/account</argument> + </arguments> + </block> + <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-account-edit-link"> + <arguments> + <argument name="label" xsi:type="string">Account Information</argument> + <argument name="path" xsi:type="string">customer/account/edit</argument> + </arguments> + </block> + <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-address-link"> + <arguments> + <argument name="label" xsi:type="string">Address Book</argument> + <argument name="path" xsi:type="string">customer/address</argument> + </arguments> + </block> + </block> + <block class="Magento\Catalog\Block\Product\Compare\Sidebar" name="catalog.compare.sidebar" template="product/compare/sidebar.phtml"/> + </referenceContainer> + <move element="cart_sidebar" destination="left" before="catalog.compare.sidebar"/> + <remove name="tags_popular"/> +</layout> diff --git a/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_confirmation.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_confirmation.xml new file mode 100644 index 00000000000..0b74bb3978f --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_confirmation.xml @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Confirmation" type="page"> + <referenceBlock name="root"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">1column.phtml</argument> + </action> + <action method="setHeaderTitle"> + <argument translate="true" name="title" xsi:type="string">Send confirmation link</argument> + </action> + </referenceBlock> + <referenceContainer name="content"> + <block class="Magento\Core\Block\Template" name="accountConfirmation" template="Magento_Customer::form/confirmation.phtml"/> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_create.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_create.xml similarity index 69% rename from app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_create.xml rename to app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_create.xml index f44b4fa9e81..0ef9e4c454e 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_create.xml +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_create.xml @@ -23,20 +23,15 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Registration Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> </action> </referenceBlock> - <container name="customer.form.register.fields.before" label="Form Fields Before" htmlTag="div" htmlClass="rewards"/> <referenceContainer name="content"> <block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="form/register.phtml"> - <container name="form.additional.info" label="invisible" as="form_additional_info"/> - <action method="append"> - <argument name="element" xsi:type="string">customer.form.register.fields.before</argument> - <argument name="alias" xsi:type="string">form_fields_before</argument> - </action> + <container name="customer.form.register.fields.before" as="form_fields_before" label="Form Fields Before" htmlTag="div" htmlClass="customer-form-before"/> </block> </referenceContainer> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_createpassword.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_createpassword.xml new file mode 100644 index 00000000000..e0ac7ce426e --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_createpassword.xml @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Reset a Password" type="page"> + <referenceBlock name="head"> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Reset a Password</argument> + </action> + </referenceBlock> + <referenceBlock name="root"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">1column.phtml</argument> + </action> + <action method="setHeaderTitle"> + <argument translate="true" name="title" xsi:type="string">Reset a Password</argument> + </action> + </referenceBlock> + <referenceContainer name="content"> + <block class="Magento\Customer\Block\Account\Resetpassword" name="resetPassword" template="form/resetforgottenpassword.phtml"/> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_edit.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_edit.xml similarity index 82% rename from app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_edit.xml rename to app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_edit.xml index 0082acde99e..0afcc479a77 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_edit.xml +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_edit.xml @@ -23,14 +23,14 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceBlock name="page.main.title"> - <action method="setPageTitle"> + <referenceBlock name="root"> + <action method="setHeaderTitle"> <argument translate="true" name="title" xsi:type="string">Edit Account Info</argument> </action> </referenceBlock> - <referenceBlock name="my.account.wrapper"> + <referenceContainer name="my.account.wrapper"> <block class="Magento\Customer\Block\Form\Edit" name="customer_edit" template="form/edit.phtml"/> - </referenceBlock> + </referenceContainer> </layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_forgotpassword.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_forgotpassword.xml similarity index 84% rename from app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_forgotpassword.xml rename to app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_forgotpassword.xml index d91fa6040c3..7edcb2693b7 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_forgotpassword.xml +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_forgotpassword.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Forgot Password Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Forgot Your Password</argument> @@ -38,8 +38,6 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\Customer\Block\Account\Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml"> - <container name="form.additional.info" label="invisible" as="form_additional_info"/> - </block> + <block class="Magento\Customer\Block\Account\Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml"/> </referenceContainer> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_index.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_index.xml new file mode 100644 index 00000000000..b360dfb9e65 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_index.xml @@ -0,0 +1,42 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Dashboard" type="page"> + <update handle="customer_account"/> + <referenceBlock name="root"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">2columns-left.phtml</argument> + </action> + </referenceBlock> + <referenceContainer name="my.account.wrapper"> + <block class="Magento\Customer\Block\Account\Dashboard" name="customer_account_dashboard" template="account/dashboard.phtml"> + <block class="Magento\Customer\Block\Account\Dashboard\Hello" name="customer_account_dashboard_hello" as="hello" template="account/dashboard/hello.phtml"/> + <block class="Magento\Core\Block\Template" name="customer_account_dashboard_top" as="top"/> + <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml"/> + <block class="Magento\Customer\Block\Account\Dashboard\Newsletter" name="customer_account_dashboard_newsletter" as="newsletter" template="account/dashboard/newsletter.phtml"/> + <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml"/> + </block> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_login.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_login.xml similarity index 70% rename from app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_login.xml rename to app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_login.xml index e661706b1e7..79c1494f7cc 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_login.xml +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_login.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,25 +17,19 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Login Form" type="page"> - <referenceBlock name="root"> - <action method="setTemplate"> - <argument name="template" xsi:type="string">1column.phtml</argument> - </action> - </referenceBlock> - <referenceContainer name="content"> - <!-- customer.form.login.extra --> - <container name="customer.login.container" label="Customer Login Container" htmlTag="div" htmlClass="login container"> - <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="form/login.phtml"> - <container name="form.additional.info" label="invisible" as="form_additional_info"/> - </block> - <block class="Magento\Customer\Block\Form\Login" name="customer.new" template="newcustomer.phtml"/> - </container> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Login Form" type="page"> + <referenceBlock name="root"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">1column.phtml</argument> + </action> + </referenceBlock> + <referenceContainer name="content"> + <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="form/login.phtml"/> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_address_index.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_logoutsuccess.xml similarity index 70% rename from app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_address_index.xml rename to app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_logoutsuccess.xml index d8484e97dfc..05c3a7da0e2 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_address_index.xml +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_account_logoutsuccess.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,18 +17,19 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Address Book" type="page"> - <update handle="customer_account"/> - <referenceBlock name="page.main.title"> - <block class="Magento\Customer\Block\Address\Book" name="address.book.button" template="address/button.phtml"/> - </referenceBlock> - <referenceBlock name="my.account.wrapper"> - <block class="Magento\Customer\Block\Address\Book" name="address_book" template="address/book.phtml"/> - </referenceBlock> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Account Logout Success" type="page"> + <referenceBlock name="root"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">1column.phtml</argument> + </action> + </referenceBlock> + <referenceContainer name="content"> + <block class="Magento\Core\Block\Template" name="customer_logout" template="Magento_Customer::logout.phtml"/> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_form.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_form.xml new file mode 100644 index 00000000000..25b2a9eab90 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_form.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Address Edit Form" type="page"> + <update handle="customer_account"/> + <referenceContainer name="my.account.wrapper"> + <block class="Magento\Customer\Block\Address\Edit" name="customer_address_edit" template="address/edit.phtml"/> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_index.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_index.xml similarity index 83% rename from app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_index.xml rename to app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_index.xml index adf75d91c8e..a5e18be8422 100644 --- a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_index.xml +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/customer_address_index.xml @@ -24,7 +24,8 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="content"> - <block class="Magento\Oauth\Block\Adminhtml\Oauth\Consumer" name="oauth_consumer"/> + <update handle="customer_account"/> + <referenceContainer name="my.account.wrapper"> + <block class="Magento\Customer\Block\Address\Book" name="address_book" template="address/book.phtml"/> </referenceContainer> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/default.xml b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/default.xml new file mode 100644 index 00000000000..716f6953c98 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/layout/override/base/default.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="top.links"> + <block class="Magento\Customer\Block\Account\Link" name="my-account-link"> + <arguments> + <argument name="label" xsi:type="string">My Account</argument> + </arguments> + </block> + <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link" after="onepage-checkout-link"/> + </referenceBlock> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/hello.phtml b/app/design/frontend/magento_backup/Magento_Customer/logout.phtml similarity index 69% rename from app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/hello.phtml rename to app/design/frontend/magento_backup/Magento_Customer/logout.phtml index 29e0f6bbfe2..5cdd57b3d0c 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/hello.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/logout.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,16 +16,20 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="block dashboard welcome"> - <div class="title"><strong><?php echo __('Hello, %1!', $this->escapeHtml($this->getCustomerName())) ?></strong></div> - <div class="content"> - <p><?php echo __('From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.') ?></p> - </div> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="page-title"> + <h1><?php echo __('You are now logged out') ?></h1> +</div> +<p><?php echo __('You have logged out and will be redirected to our homepage in 5 seconds.') ?></p> +<script type="text/javascript"> + (function($){ + $($.mage.redirect("<?php echo $this->getUrl() ?>","assign",5000)); + })(jQuery); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Customer/set-password.js b/app/design/frontend/magento_backup/Magento_Customer/set-password.js new file mode 100644 index 00000000000..8f4404c5ac1 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/set-password.js @@ -0,0 +1,58 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 customer view + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true expr:true*/ +(function ($) { + $.widget('mage.setPassword', { + _create: function() { + this.element.on('change', $.proxy(function(event) { + $(event.target).is(':checked') ? this._showPassword() : this._hidePassword(); + }, this)); + this.options.showOnDefault && this._showPassword(); + }, + + /** + * Hide password input fields + * @private + */ + _hidePassword: function() { + $(this.options.currentPasswordId).removeAttr('data-validate') + .parents(this.options.passwordContainer).hide(); + $(this.options.passwordId).removeAttr('data-validate'); + $(this.options.confirmationId).removeAttr('data-validate'); + }, + + /** + * Show password input fields + * @private + */ + _showPassword: function() { + $(this.options.currentPasswordId).attr('data-validate', '{required:true}') + .parents(this.options.passwordContainer).show(); + $(this.options.passwordId).attr('data-validate', "{required:true, 'validate-password':true}"); + $(this.options.confirmationId).attr('data-validate', + '{required:true, equalTo:"' + this.options.passwordId + '"}'); + } + }); +})(jQuery); diff --git a/app/design/frontend/magento_backup/Magento_Customer/widget/dob.phtml b/app/design/frontend/magento_backup/Magento_Customer/widget/dob.phtml new file mode 100644 index 00000000000..3ace2f5a707 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Customer/widget/dob.phtml @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** +USAGE: + +Simple: + +<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') + ->setDate($this->getCustomer()->getDob()) + ->toHtml() ?> + +For checkout/onepage/billing.phtml: + +<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') + ->setDate($this->getCustomer()->getDob()) + ->setFieldIdFormat('billing:%s') + ->setFieldNameFormat('billing[%s]') + ->toHtml() ?> + +NOTE: Regarding styles - if we leave it this way, we'll move it to boxes.css + Alternatively we could calculate widths automatically using block input parameters. +*/ + +/** + * @see \Magento\Customer\Block\Widget\Dob + */ +?> +<label for="<?php echo $this->getFieldId('month')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo __('Date of Birth') ?></label> +<div class="input-box customer-dob"> +<?php + $this->setDateInput('d', + '<div class="dob-day"> + <input type="text" id="' . $this->getFieldId('day') . '" name="' . $this->getFieldName('day') . '" value="' . $this->getDay() . '" title="' . __('Day') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /> + <label for="' . $this->getFieldId('day') . '">' . __('Day (DD)') . '</label> + </div>' + ); + + $this->setDateInput('m', + '<div class="dob-month"> + <input type="text" id="' . $this->getFieldId('month') . '" name="' . $this->getFieldName('month') . '" value="' . $this->getMonth() . '" title="' . __('Month') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /> + <label for="' . $this->getFieldId('month') . '">' . __('Month (MM)') . '</label> + </div>' + ); + + $this->setDateInput('y', + '<div class="dob-year"> + <input type="text" id="' . $this->getFieldId('year') . '" name="' . $this->getFieldName('year') . '" value="' . $this->getYear() . '" title="' . __('Year') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /> + <label for="' . $this->getFieldId('year') . '">' . __('Year (YYYY)') . '</label> + </div>' + ); +?> + <?php echo $this->getSortedDateInputs() ?> + <div class="dob-full" style="display:none;"> + <input type="hidden" id="<?php echo $this->getFieldId('dob')?>" name="<?php echo $this->getFieldName('dob')?>" data-validate="{'validate-dob': ['.dob-day', '.dob-month', '.dob-year', <?php echo $this->isRequired() ? 'true' : 'false' ?>]}"/> + </div> + + <div class="validation-advice" style="display:none;"></div> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/widget/gender.phtml b/app/design/frontend/magento_backup/Magento_Customer/widget/gender.phtml similarity index 51% rename from app/design/frontend/magento_plushe/Magento_Customer/widget/gender.phtml rename to app/design/frontend/magento_backup/Magento_Customer/widget/gender.phtml index 13010e23213..9ea8f5f6d42 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/widget/gender.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/widget/gender.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,22 +16,21 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="field gender<?php if ($this->isRequired()) echo ' required' ?>"> - <label class="label" for="<?php echo $this->getFieldId('gender')?>"><span><?php echo __('Gender') ?></span></label> - <div class="control"> - <select id="<?php echo $this->getFieldId('gender')?>" name="<?php echo $this->getFieldName('gender')?>" title="<?php echo __('Gender') ?>"<?php if ($this->isRequired()):?> class="validate-select" data-validate="{required:true}"<?php endif; ?> <?php echo $this->getFieldParams() ?>> - <?php $options = $this->getGenderOptions(); ?> - <?php $value = $this->getGender();?> - <?php foreach ($options as $option):?> - <option value="<?php echo $option['value'] ?>"<?php if ($option['value'] == $value) echo ' selected="selected"' ?>><?php echo $option['label'] ?></option> - <?php endforeach;?> - </select> - </div> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<label for="<?php echo $this->getFieldId('gender')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo __('Gender') ?></label> +<div class="input-box"> + <select id="<?php echo $this->getFieldId('gender')?>" name="<?php echo $this->getFieldName('gender')?>" title="<?php echo __('Gender') ?>"<?php if ($this->isRequired()):?> class="validate-select" data-validate="{required:true}"<?php endif; ?> <?php echo $this->getFieldParams() ?>> + <?php $options = $this->getGenderOptions(); ?> + <?php $value = $this->getGender();?> + <?php foreach ($options as $option):?> + <option value="<?php echo $option['value'] ?>"<?php if ($option['value'] == $value) echo ' selected="selected"' ?>><?php echo $option['label'] ?></option> + <?php endforeach;?> + </select> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/widget/name.phtml b/app/design/frontend/magento_backup/Magento_Customer/widget/name.phtml similarity index 75% rename from app/design/frontend/magento_plushe/Magento_Customer/widget/name.phtml rename to app/design/frontend/magento_backup/Magento_Customer/widget/name.phtml index cc30b8872c9..a96c443bb39 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/widget/name.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/widget/name.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,97 +16,86 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -/** -USAGE: - -Simple: - -<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name') - ->setObject($this->getAddress()) - ->toHtml() ?> - -For checkout/onepage/shipping.phtml: - -<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name') - ->setObject($this->getAddress()) - ->setFieldIdFormat('shipping:%s') - ->setFieldNameFormat('shipping[%s]') - ->setFieldParams('onchange="shipping.setSameAsBilling(false);"') - ->toHtml() ?> -*/ -/* @var $this \Magento\Customer\Block\Widget\Name */ -$prefix = $this->showPrefix(); -$middle = $this->showMiddlename(); -$suffix = $this->showSuffix(); -?> -<?php if ($prefix || $middle || $suffix && !$this->getNoWrap()): ?> -<div class="field required fullname <?php echo $this->getContainerClassName()?>"> - <label for="<?php echo $this->getFieldId('firstname')?>" class="label"><span><?php echo __('Name')?></span></label> - <div class="control"> - <div class="fields group group-<?php echo 2 + intval($prefix) + intval($middle) + intval($suffix)?>"> -<?php endif; ?> -<?php if ($prefix): ?> - <div class="field name-prefix<?php if ($this->isPrefixRequired()) echo ' required' ?>"> - <label class="label" for="<?php echo $this->getFieldId('prefix')?>"><span><?php echo $this->getStoreLabel('prefix') ?></span></label> - <div class="control"> - <?php if ($this->getPrefixOptions() === false): ?> - <input type="text" id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?> /> - <?php else: ?> - <select id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?> > - <?php foreach ($this->getPrefixOptions() as $_option): ?> - <option value="<?php echo $_option?>"<?php if ($this->getObject()->getPrefix()==$_option):?> selected="selected"<?php endif; ?>><?php echo __($_option)?></option> - <?php endforeach; ?> - </select> - <?php endif; ?> - </div> - </div> -<?php endif; ?> - <div class="field name-firstname required"> - <label class="label" for="<?php echo $this->getFieldId('firstname')?>"><span><?php echo $this->getStoreLabel('firstname') ?></span></label> - <div class="control"> - <input type="text" id="<?php echo $this->getFieldId('firstname')?>" name="<?php echo $this->getFieldName('firstname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>" title="<?php echo $this->getStoreLabel('firstname') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') == 'required-entry') echo ' data-validate="{required:true}"' ?> /> - </div> - </div> -<?php if ($middle): ?> -<?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?> - <div class="field name-middlename<?php echo $isMiddlenameRequired ? ' required' : '' ?>"> - <label class="label" for="<?php echo $this->getFieldId('middlename')?>"><span><?php echo $this->getStoreLabel('middlename') ?></span></label> - <div class="control"> - <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> <?php echo $isMiddlenameRequired ? ' data-validate="{required:true}"' : '' ?> /> - </div> - </div> -<?php endif; ?> - <div class="field name-lastname required"> - <label class="label" for="<?php echo $this->getFieldId('lastname')?>"><span><?php echo $this->getStoreLabel('lastname') ?></span></label> - <div class="control"> - <input type="text" id="<?php echo $this->getFieldId('lastname')?>" name="<?php echo $this->getFieldName('lastname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>" title="<?php echo $this->getStoreLabel('lastname') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') == 'required-entry') echo ' data-validate="{required:true}"' ?> /> - </div> - </div> -<?php if ($suffix): ?> - <div class="field name-suffix<?php if ($this->isSuffixRequired()) echo ' required' ?>"> - <label class="label" for="<?php echo $this->getFieldId('suffix')?>"><span><?php echo $this->getStoreLabel('suffix') ?></span></label> - <div class="control"> - <?php if ($this->getSuffixOptions() === false): ?> - <input type="text" id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getSuffix()) ?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?> /> - <?php else: ?> - <select id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?>> - <?php foreach ($this->getSuffixOptions() as $_option): ?> - <option value="<?php echo $_option?>"<?php if ($this->getObject()->getSuffix()==$_option):?> selected="selected"<?php endif; ?>><?php echo __($_option)?></option> - <?php endforeach; ?> - </select> - <?php endif; ?> - </div> - </div> -<?php endif; ?> -<?php if ($prefix || $middle || $suffix && !$this->getNoWrap()): ?> - </div> - </div> -</div> -<?php endif; ?> \ No newline at end of file + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** +USAGE: + +Simple: + +<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name') + ->setObject($this->getAddress()) + ->toHtml() ?> + +For checkout/onepage/shipping.phtml: + +<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name') + ->setObject($this->getAddress()) + ->setFieldIdFormat('shipping:%s') + ->setFieldNameFormat('shipping[%s]') + ->setFieldParams('onchange="shipping.setSameAsBilling(false);"') + ->toHtml() ?> +*/ +/* @var $this \Magento\Customer\Block\Widget\Name */ +?> +<div class="<?php echo $this->getContainerClassName()?>"> +<?php if ($this->showPrefix()): ?> + <div class="field name-prefix"> + <label for="<?php echo $this->getFieldId('prefix')?>"<?php if ($this->isPrefixRequired()) echo ' class="required"' ?>><?php if ($this->isPrefixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('prefix') ?></label> + <div class="input-box"> + <?php if ($this->getPrefixOptions() === false): ?> + <input type="text" id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?> /> + <?php else: ?> + <select id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isPrefixRequired()) echo ' data-validate="{required:true}"' ?> > + <?php foreach ($this->getPrefixOptions() as $_option): ?> + <option value="<?php echo $_option?>"<?php if ($this->getObject()->getPrefix()==$_option):?> selected="selected"<?php endif; ?>><?php echo __($_option)?></option> + <?php endforeach; ?> + </select> + <?php endif; ?> + </div> + </div> +<?php endif; ?> + <div class="field name-firstname"> + <label for="<?php echo $this->getFieldId('firstname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('firstname') ?></label> + <div class="input-box"> + <input type="text" id="<?php echo $this->getFieldId('firstname')?>" name="<?php echo $this->getFieldName('firstname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>" title="<?php echo $this->getStoreLabel('firstname') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('firstname') == 'required-entry') echo ' data-validate="{required:true}"' ?> /> + </div> + </div> +<?php if ($this->showMiddlename()): ?> +<?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?> + <div class="field name-middlename"> + <label for="<?php echo $this->getFieldId('middlename')?>"<?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?><?php echo $this->getStoreLabel('middlename') ?></label> + <div class="input-box"> + <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> <?php echo $isMiddlenameRequired ? ' data-validate="{required:true}"' : '' ?> /> + </div> + </div> +<?php endif; ?> + <div class="field name-lastname"> + <label for="<?php echo $this->getFieldId('lastname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('lastname') ?></label> + <div class="input-box"> + <input type="text" id="<?php echo $this->getFieldId('lastname')?>" name="<?php echo $this->getFieldName('lastname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>" title="<?php echo $this->getStoreLabel('lastname') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('lastname') == 'required-entry') echo ' data-validate="{required:true}"' ?> /> + </div> + </div> +<?php if ($this->showSuffix()): ?> + <div class="field name-suffix"> + <label for="<?php echo $this->getFieldId('suffix')?>"<?php if ($this->isSuffixRequired()) echo ' class="required"' ?>><?php if ($this->isSuffixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('suffix') ?></label> + <div class="input-box"> + <?php if ($this->getSuffixOptions() === false): ?> + <input type="text" id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getSuffix()) ?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?> /> + <?php else: ?> + <select id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="<?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isSuffixRequired()) echo ' data-validate="{required:true}"' ?>> + <?php foreach ($this->getSuffixOptions() as $_option): ?> + <option value="<?php echo $_option?>"<?php if ($this->getObject()->getSuffix()==$_option):?> selected="selected"<?php endif; ?>><?php echo __($_option)?></option> + <?php endforeach; ?> + </select> + <?php endif; ?> + </div> + </div> +<?php endif; ?> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/widget/taxvat.phtml b/app/design/frontend/magento_backup/Magento_Customer/widget/taxvat.phtml similarity index 56% rename from app/design/frontend/magento_plushe/Magento_Customer/widget/taxvat.phtml rename to app/design/frontend/magento_backup/Magento_Customer/widget/taxvat.phtml index 57fc40a725d..94af916168c 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/widget/taxvat.phtml +++ b/app/design/frontend/magento_backup/Magento_Customer/widget/taxvat.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,16 +16,15 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="field taxvat<?php if ($this->isRequired()) echo ' required'; ?>"> - <label class="label" for="<?php echo $this->getFieldId('taxvat')?>"><span><?php echo __('Tax/VAT number') ?></span></label> - <div class="control"> - <input type="text" id="<?php echo $this->getFieldId('taxvat')?>" name="<?php echo $this->getFieldName('taxvat')?>" value="<?php echo $this->escapeHtml($this->getTaxvat()) ?>" title="<?php echo __('Tax/VAT number') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('taxvat') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isRequired()) echo ' data-validate="{required:true}"' ?> /> - </div> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<label for="<?php echo $this->getFieldId('taxvat')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo __('Tax/VAT number') ?></label> +<div class="input-box"> + <input type="text" id="<?php echo $this->getFieldId('taxvat')?>" name="<?php echo $this->getFieldName('taxvat')?>" value="<?php echo $this->escapeHtml($this->getTaxvat()) ?>" title="<?php echo __('Tax/VAT number') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('taxvat') ?>" <?php echo $this->getFieldParams() ?> <?php if ($this->isRequired()) echo ' data-validate="{required:true}"' ?> /> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/customer_account.xml b/app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/customer_account.xml new file mode 100644 index 00000000000..11f782c7416 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/customer_account.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="customer_account_navigation"> + <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-newsletter-subscriptions-link"> + <arguments> + <argument name="path" xsi:type="string">newsletter/manage</argument> + <argument name="label" xsi:type="string">Newsletter Subscriptions</argument> + </arguments> + </block> + </referenceBlock> + <remove name="newsletter_subscription"/> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Newsletter/layout/override/base/default.xml b/app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/default.xml similarity index 90% rename from app/design/frontend/magento_plushe/Magento_Newsletter/layout/override/base/default.xml rename to app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/default.xml index fcd852ac5f7..67b7a5379dd 100644 --- a/app/design/frontend/magento_plushe/Magento_Newsletter/layout/override/base/default.xml +++ b/app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/default.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,14 +17,14 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="footer"> - <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceContainer name="left"> + <block class="Magento\Newsletter\Block\Subscribe" name="newsletter_subscription" template="subscribe.phtml"/> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Newsletter/layout/override/base/newsletter_manage_index.xml b/app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/newsletter_manage_index.xml similarity index 79% rename from app/design/frontend/magento_plushe/Magento_Newsletter/layout/override/base/newsletter_manage_index.xml rename to app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/newsletter_manage_index.xml index 3b7c0b011b5..13c77ee6f03 100644 --- a/app/design/frontend/magento_plushe/Magento_Newsletter/layout/override/base/newsletter_manage_index.xml +++ b/app/design/frontend/magento_backup/Magento_Newsletter/layout/override/base/newsletter_manage_index.xml @@ -23,11 +23,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Newsletter Subscriptions" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceBlock name="my.account.wrapper"> + <referenceContainer name="my.account.wrapper"> <block class="Magento\Customer\Block\Newsletter" name="customer_newsletter"> - <container name="customer.newsletter.form.before" as="form_before" label="Newsletter Subscription Form Before" htmlTag="div" htmlClass="rewards"/> + <container name="customer.newsletter.form.before" as="form_before" label="Newsletter Subscription Form Before"/> </block> - </referenceBlock> + </referenceContainer> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Newsletter/newsletter.js b/app/design/frontend/magento_backup/Magento_Newsletter/newsletter.js new file mode 100644 index 00000000000..dd738941884 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Newsletter/newsletter.js @@ -0,0 +1,47 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 frontend newsletter + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true*/ +(function ($) { + $.widget('mage.newsletter', { + options: { + errorClass: 'mage-error' + }, + _create: function() { + $(this.options.formSelector) + .validation({errorClass: this.options.errorClass}); + this.element.on('click', $.proxy(function(e) { + if ($(e.target).val() === this.options.placeholder) { + $(e.target).val(''); + } + }, this)).on('focusout', $.proxy(function(e) { + setTimeout($.proxy(function() { + if ($.trim($(e.target).val()) === '') { + $(e.target).val(this.options.placeholder); + } + }, this), 100); + }, this)); + } + }); +})(jQuery); diff --git a/app/design/frontend/magento_backup/Magento_Newsletter/subscribe.phtml b/app/design/frontend/magento_backup/Magento_Newsletter/subscribe.phtml new file mode 100644 index 00000000000..b58a97130dd --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Newsletter/subscribe.phtml @@ -0,0 +1,64 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="block block-subscribe"> + <div class="block-title"> + <strong><span><?php echo __('Newsletter') ?></span></strong> + </div> + <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> + <div class="block-content"> + <div class="form-subscribe-header"> + <label for="newsletter"><?php echo __('Sign Up for Our Newsletter:') ?></label> + </div> + <div class="input-box"> + <input type="text" name="email" id="newsletter" + title="<?php echo __('Sign up for our newsletter') ?>" + value="<?php echo __('Enter your email address') ?>" + class="input-text" data-validate="{required:true, 'validate-email':true}"/> + </div> + <div class="actions"> + <button type="submit" title="<?php echo __('Subscribe') ?>" class="button"> + <span><span><?php echo __('Subscribe') ?></span></span></button> + </div> + </div> + </form> + <script type="text/javascript"> + //<![CDATA[ + (function($) { + head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", + "<?php echo $this->getViewFileUrl('Magento_Newsletter::newsletter.js')?>", function() { + $('#newsletter').newsletter({ + formSelector: '#newsletter-validate-detail', + placeholder: '<?php echo __('Enter your email address') ?>' + }); + }); + })(jQuery); + //]]> + </script> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_express_review.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_express_review.xml index 1abdcc25f33..efdf4a64b8e 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_express_review.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_express_review.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="PayPal Express Order Review Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_hostedpro_cancel.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_hostedpro_cancel.xml index e40967effa8..41cc25c05eb 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_hostedpro_cancel.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_hostedpro_cancel.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Hosted Pro Frame" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Hosted\Pro\Iframe" name="hosted.pro.iframe" output="1" template="hss/redirect.phtml"/> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_cancelpayment.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_cancelpayment.xml index 2d6206809a4..679ab1fc539 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_cancelpayment.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_cancelpayment.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Cancel Payment" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" template="payflowlink/redirect.phtml"/> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_form.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_form.xml index c8a142b6b66..5bd6aff888a 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_form.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_form.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" template="payflowlink/form.phtml"/> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_returnurl.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_returnurl.xml index 2dbd4cc55ec..679ab1fc539 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_returnurl.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflow_returnurl.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Return URL" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" output="1" template="payflowlink/redirect.phtml"/> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_cancelpayment.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_cancelpayment.xml index b0bd45e7527..5cced7b711b 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_cancelpayment.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_cancelpayment.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Advanced Cancel Payment" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" template="payflowadvanced/redirect.phtml"/> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_form.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_form.xml index 5f48316a8c4..0a7d40e6e39 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_form.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_form.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Advanced Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" template="payflowadvanced/form.phtml"/> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_returnurl.xml b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_returnurl.xml index 69c7a612956..5cced7b711b 100644 --- a/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_returnurl.xml +++ b/app/design/frontend/magento_backup/Magento_Paypal/layout/override/paypal_payflowadvanced_returnurl.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Paypal Payflow Advanced Return URL" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" output="1" template="payflowadvanced/redirect.phtml"/> </layout> diff --git a/app/design/frontend/magento_backup/Magento_PaypalUk/layput/override/paypaluk_express_review.xml b/app/design/frontend/magento_backup/Magento_PaypalUk/layput/override/paypaluk_express_review.xml index b71402b7c93..8f74e4d8dde 100644 --- a/app/design/frontend/magento_backup/Magento_PaypalUk/layput/override/paypaluk_express_review.xml +++ b/app/design/frontend/magento_backup/Magento_PaypalUk/layput/override/paypaluk_express_review.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="PayPal Express Order Review Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/code/Magento/Persistent/view/frontend/checkout/onepage/billing.phtml b/app/design/frontend/magento_backup/Magento_Persistent/checkout/onepage/billing.phtml similarity index 100% rename from app/code/Magento/Persistent/view/frontend/checkout/onepage/billing.phtml rename to app/design/frontend/magento_backup/Magento_Persistent/checkout/onepage/billing.phtml diff --git a/app/code/Magento/Persistent/view/frontend/checkout/onepage/login.phtml b/app/design/frontend/magento_backup/Magento_Persistent/checkout/onepage/login.phtml similarity index 100% rename from app/code/Magento/Persistent/view/frontend/checkout/onepage/login.phtml rename to app/design/frontend/magento_backup/Magento_Persistent/checkout/onepage/login.phtml diff --git a/app/code/Magento/Persistent/view/frontend/customer/form/login.phtml b/app/design/frontend/magento_backup/Magento_Persistent/customer/form/login.phtml similarity index 100% rename from app/code/Magento/Persistent/view/frontend/customer/form/login.phtml rename to app/design/frontend/magento_backup/Magento_Persistent/customer/form/login.phtml diff --git a/app/code/Magento/Persistent/view/frontend/customer/form/register.phtml b/app/design/frontend/magento_backup/Magento_Persistent/customer/form/register.phtml similarity index 100% rename from app/code/Magento/Persistent/view/frontend/customer/form/register.phtml rename to app/design/frontend/magento_backup/Magento_Persistent/customer/form/register.phtml diff --git a/app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/checkout_onepage_index.xml b/app/design/frontend/magento_backup/Magento_Persistent/layout/override/checkout_onepage_index.xml similarity index 52% rename from app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/checkout_onepage_index.xml rename to app/design/frontend/magento_backup/Magento_Persistent/layout/override/checkout_onepage_index.xml index 1147945ddc7..3a7af3478c3 100644 --- a/app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/checkout_onepage_index.xml +++ b/app/design/frontend/magento_backup/Magento_Persistent/layout/override/checkout_onepage_index.xml @@ -24,12 +24,17 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="form.login.additional.info"> - <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> - <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> - </referenceContainer> - <referenceContainer name="form.billing.additional.info"> - <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me.billing" template="remember_me.phtml" before="-"/> - <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip.billing" template="Magento_Persistent::remember_me_tooltip.phtml"/> - </referenceContainer> + <referenceBlock name="checkout.onepage.login"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">Magento_Persistent::checkout/onepage/login.phtml</argument> + </action> + block class="Magento\Persistent\Block\Form\Remember" name="checkout.onepage.login.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> + </referenceBlock> + <referenceBlock name="checkout.onepage.billing"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">Magento_Persistent::checkout/onepage/billing.phtml</argument> + </action> + <block class="Magento\Persistent\Block\Form\Remember" name="checkout.onepage.billing.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> + <block class="Magento\Core\Block\Template" name="checkout.onepage.billing.persistent.remember.me.tooltip" as="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + </referenceBlock> </layout> diff --git a/app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/customer_account_create.xml b/app/design/frontend/magento_backup/Magento_Persistent/layout/override/customer_account_create.xml similarity index 65% rename from app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/customer_account_create.xml rename to app/design/frontend/magento_backup/Magento_Persistent/layout/override/customer_account_create.xml index 8ac15eae415..d750cd77df5 100644 --- a/app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/customer_account_create.xml +++ b/app/design/frontend/magento_backup/Magento_Persistent/layout/override/customer_account_create.xml @@ -24,8 +24,11 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="form.additional.info"> - <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> - <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> - </referenceContainer> + <referenceBlock name="customer_form_register"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">Magento_Persistent::customer/form/register.phtml</argument> + </action> + <block class="Magento\Persistent\Block\Form\Remember" name="customer_form_register.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> + <block class="Magento\Core\Block\Template" name="customer_form_register.persistent.remember.me.tooltip" as="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + </referenceBlock> </layout> diff --git a/app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/customer_account_login.xml b/app/design/frontend/magento_backup/Magento_Persistent/layout/override/customer_account_login.xml similarity index 66% rename from app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/customer_account_login.xml rename to app/design/frontend/magento_backup/Magento_Persistent/layout/override/customer_account_login.xml index 8ac15eae415..82366aead37 100644 --- a/app/design/frontend/magento_plushe/Magento_Persistent/layout/override/base/customer_account_login.xml +++ b/app/design/frontend/magento_backup/Magento_Persistent/layout/override/customer_account_login.xml @@ -24,8 +24,11 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="form.additional.info"> - <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> - <block class="Magento\Core\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> - </referenceContainer> + <referenceBlock name="customer_form_login"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">Magento_Persistent::customer/form/login.phtml</argument> + </action> + <block class="Magento\Persistent\Block\Form\Remember" name="customer_form_login.persistent.remember.me" as="persistent.remember.me" template="remember_me.phtml"/> + <block class="Magento\Core\Block\Template" name="customer_form_login.persistent.remember.me.tooltip" as="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + </referenceBlock> </layout> diff --git a/app/design/frontend/magento_backup/Magento_Persistent/remember-me-popup.js b/app/design/frontend/magento_backup/Magento_Persistent/remember-me-popup.js new file mode 100644 index 00000000000..2e04ae6ee6c --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Persistent/remember-me-popup.js @@ -0,0 +1,106 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 frontend Persistent remember me popup + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true*/ +(function ($) { + $.widget('mage.rememberMePopup', { + options: { + closeBtn: '.btn-close', + windowOverlayTemplate: '<div class="window-overlay"></div>', + popupBlockTemplate: '<div class="popup-block block popup-remember-tip active">' + + '<div class="block-title">' + + '<strong>${title}</strong>' + + '<div class="btn-close"></div>' + + '</div>' + + '<div class="block-content">' + + '<p>${content}</p>' + + '<div class="buttons-set">' + + '<button class="button btn-close" type="button">' + + '<span>' + + '<span>Close</span>' + + '</span>' + + '</button>' + + '</div>' + + '</div>' + + '</div>' + }, + + _create: function() { + this._renderWindowOverLay(); + this._renderPopupBlock(); + $('body').append(this.windowOverlay.hide()); + $('body').append(this.popupBlock.hide()); + this.element.find('a').on('click', $.proxy(this._showPopUp, this)); + }, + + /** + * Add windowOverlay block to body + * If windowOverlay is not an option, use default template + * @private + */ + _renderWindowOverLay: function() { + if (this.options.windowOverlay) { + this.windowOverlay = $(this.options.windowOverlay); + } else { + $.template('windowOverlayTemplate', this.options.windowOverlayTemplate); + this.windowOverlay = $.tmpl('windowOverlayTemplate').hide(); + } + this.windowOverlay.height($('body').height()); + }, + + /** + * Add popupBlock to body + * If popupBlock is not an option, use default template + * @private + */ + _renderPopupBlock: function() { + if (this.options.popupBlock) { + this.popupBlock = $(this.options.popupBlock); + } else { + $.template('popupBlockTemplate', this.options.popupBlockTemplate); + this.popupBlock = $.tmpl('popupBlockTemplate', + {title: this.options.title, content: this.options.content}); + } + this.popupBlock.find(this.options.closeBtn).on('click', $.proxy(this._hidePopUp, this)); + }, + + /** + * show windowOverlay and popupBlock + * @private + */ + _showPopUp: function() { + this.windowOverlay.show(); + this.popupBlock.show(); + }, + + /** + * hide windowOverlay and popupBlock + * @private + */ + _hidePopUp: function() { + this.windowOverlay.hide(); + this.popupBlock.hide(); + } + }); +})(jQuery); \ No newline at end of file diff --git a/app/design/frontend/magento_plushe/Magento_Persistent/remember_me.phtml b/app/design/frontend/magento_backup/Magento_Persistent/remember_me.phtml similarity index 68% rename from app/design/frontend/magento_plushe/Magento_Persistent/remember_me.phtml rename to app/design/frontend/magento_backup/Magento_Persistent/remember_me.phtml index 9ce5ee378a6..ec0bfa722f7 100644 --- a/app/design/frontend/magento_plushe/Magento_Persistent/remember_me.phtml +++ b/app/design/frontend/magento_backup/Magento_Persistent/remember_me.phtml @@ -19,6 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design + * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -30,12 +31,11 @@ * @var $this \Magento\Persistent\Block\Form\Remember */ ?> -<div id="remember-me-box" class="field choice persistent"> +<li id="remember-me-box" class="control"> <?php $rememberMeId = 'remember_me' . $this->helper('Magento\Core\Helper\Data')->getRandomString(10); ?> - <input type="checkbox" name="persistent_remember_me" class="checkbox" id="<?php echo $rememberMeId; ?>"<?php if ($this->isRememberMeChecked()): ?> checked="checked"<?php endif; ?> title="<?php echo __('Remember Me') ?>" /> - <label for="<?php echo $rememberMeId; ?>" class="label"><span><?php echo __('Remember Me') ?></span></label> + <div class="input-box"> + <input type="checkbox" name="persistent_remember_me" class="checkbox" id="<?php echo $rememberMeId; ?>"<?php if ($this->isRememberMeChecked()): ?> checked="checked"<?php endif; ?> title="<?php echo __('Remember Me') ?>" /> + </div> + <label for="<?php echo $rememberMeId; ?>"><?php echo __('Remember Me') ?></label> <a class="link-tip" href="#"><?php echo __('What\'s this?') ?></a> -</div> -<?php if ($this->helper('Magento\Checkout\Helper\Data')->isContextCheckout()): ?> - <input name="context" type="hidden" value="checkout" /> -<?php endif; ?> +</li> diff --git a/app/design/frontend/magento_plushe/Magento_Persistent/remember_me_tooltip.phtml b/app/design/frontend/magento_backup/Magento_Persistent/remember_me_tooltip.phtml similarity index 98% rename from app/design/frontend/magento_plushe/Magento_Persistent/remember_me_tooltip.phtml rename to app/design/frontend/magento_backup/Magento_Persistent/remember_me_tooltip.phtml index 100a5cee1c5..8bb7fc4eac6 100644 --- a/app/design/frontend/magento_plushe/Magento_Persistent/remember_me_tooltip.phtml +++ b/app/design/frontend/magento_backup/Magento_Persistent/remember_me_tooltip.phtml @@ -19,6 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design + * @package base_default * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/Magento/Persistent/view/frontend/splitbutton.js b/app/design/frontend/magento_backup/Magento_Persistent/splitbutton.js similarity index 100% rename from app/code/Magento/Persistent/view/frontend/splitbutton.js rename to app/design/frontend/magento_backup/Magento_Persistent/splitbutton.js diff --git a/app/design/frontend/magento_backup/Magento_ProductAlert/email/price.phtml b/app/design/frontend/magento_backup/Magento_ProductAlert/email/price.phtml new file mode 100644 index 00000000000..58a16bc4fa2 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_ProductAlert/email/price.phtml @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php if ($_products = $this->getProducts()): ?> +<p><?php echo __('You are receiving this notification because you subscribed to receive alerts when the prices for the following products changed:') ?></p> +<table> +<?php foreach ($_products as $_product): ?> + <tr> + <td><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>"><img src="<?php echo $_product->getThumbnailUrl() ?>" border="0" align="left" height="75" width="75" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" /></a></td> + <td> + <p><a href="<?php echo $_product->getProductUrl() ?>"><strong><?php echo $this->escapeHtml($_product->getName()) ?></strong></a></p> + <?php if ($shortDescription = $this->escapeHtml($_product->getShortDescription())): ?> + <p><small><?php echo $shortDescription ?></small></p> + <?php endif; ?> + <p><?php if ($_product->getPrice() != $_product->getFinalPrice()): ?> + <?php echo __('Regular Price:') ?> <strong style="text-decoration:line-through;"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_product->getPrice()) ?></strong><br /> + <strong><?php echo __('Special price:') ?> <span style="color:#FF0000;"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_product->getFinalPrice()) ?></span></strong> + <?php else: ?> + <strong><?php echo __('Price:') ?></strong> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_product->getPrice()) ?> + <?php endif; ?></p> + <p><small><a href="<?php echo $this->getProductUnsubscribeUrl($_product->getId()) ?>"><?php echo __('Click here not to receive alerts for this product.') ?></a></small></p> + </td> + </tr> +<?php endforeach; ?> +</table> +<p><a href="<?php echo $this->getUnsubscribeUrl() ?>"><?php echo __('Unsubscribe from all price alerts') ?></a></p> +<?php endif; ?> diff --git a/app/design/frontend/magento_backup/Magento_ProductAlert/email/stock.phtml b/app/design/frontend/magento_backup/Magento_ProductAlert/email/stock.phtml new file mode 100644 index 00000000000..c84f26c0420 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_ProductAlert/email/stock.phtml @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php if ($_products = $this->getProducts()): ?> +<p><?php echo __('You are receiving this notification because you subscribed to receive alerts when the following products are back in stock:') ?></p> +<table> +<?php foreach ($_products as $_product): ?> + <tr> + <td><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>"><img src="<?php echo $this->getThumbnailUrl($_product) ?>" width="<?php echo $this->getThumbnailSize()?>" height="<?php echo $this->getThumbnailSize()?>" border="0" align="left" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" /></a></td> + <td> + <p><a href="<?php echo $_product->getProductUrl() ?>"><strong><?php echo $this->escapeHtml($_product->getName()) ?></strong></a></p> + <?php if ($shortDescription = $this->escapeHtml($_product->getShortDescription())): ?> + <p><small><?php echo $shortDescription ?></small></p> + <?php endif; ?> + <p><?php if ($_product->getPrice() != $_product->getFinalPrice()): ?> + <?php echo __('Regular Price:') ?> <strong style="text-decoration:line-through;"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_product->getPrice()) ?></strong><br /> + <strong><?php echo __('Special price:') ?> <span style="color:#FF0000;"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_product->getFinalPrice()) ?></span></strong> + <?php else: ?> + <strong><?php echo __('Price:') ?></strong> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_product->getPrice()) ?> + <?php endif; ?></p> + <p><small><a href="<?php echo $this->getProductUnsubscribeUrl($_product->getId()) ?>"><?php echo __('Click here not to receive alerts for this product.') ?></a></small></p> + </td> + </tr> +<?php endforeach; ?> +</table> +<p><a href="<?php echo $this->getUnsubscribeUrl() ?>"><?php echo __('Unsubscribe from all stock alerts') ?></a></p> +<?php endif; ?> diff --git a/app/design/frontend/magento_backup/Magento_ProductAlert/layout/override/catalog_product_view.xml b/app/design/frontend/magento_backup/Magento_ProductAlert/layout/override/catalog_product_view.xml new file mode 100644 index 00000000000..b51304a8eb8 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_ProductAlert/layout/override/catalog_product_view.xml @@ -0,0 +1,49 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceContainer name="content"> + <referenceBlock name="product.info"> + <referenceContainer name="alert.urls"> + <block class="Magento\ProductAlert\Block\Product\View\Price" name="productalert.price" as="productalert_price" template="product/view.phtml"> + <action method="setHtmlClass"> + <argument name="value" xsi:type="string">alert-price link-price-alert</argument> + </action> + <action method="setSignupLabel"> + <argument translate="true" name="value" xsi:type="string">Sign up for price alert</argument> + </action> + </block> + <block class="Magento\ProductAlert\Block\Product\View\Stock" name="productalert.stock" as="productalert_stock" template="product/view.phtml"> + <action method="setHtmlClass"> + <argument name="value" xsi:type="string">alert-stock link-stock-alert</argument> + </action> + <action method="setSignupLabel"> + <argument translate="true" name="value" xsi:type="string">Sign up to be notified when this product is back in stock.</argument> + </action> + </block> + </referenceContainer> + </referenceBlock> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_backup/Magento_ProductAlert/product/view.phtml b/app/design/frontend/magento_backup/Magento_ProductAlert/product/view.phtml new file mode 100644 index 00000000000..e4dc918d78b --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_ProductAlert/product/view.phtml @@ -0,0 +1,30 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php /* @var $this \Magento\ProductAlert\Block\Product\View */?> +<p class="<?php echo $this->getHtmlClass() ?>"> + <a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>" title="<?php echo $this->escapeHtml(__($this->getSignupLabel())); ?>"><?php echo $this->escapeHtml(__($this->getSignupLabel())); ?></a> +</p> diff --git a/app/design/frontend/magento_backup/Magento_Review/layout/override/review_product_view.xml b/app/design/frontend/magento_backup/Magento_Review/layout/override/review_product_view.xml index ac9b3b3ed59..a2a84f9f112 100644 --- a/app/design/frontend/magento_backup/Magento_Review/layout/override/review_product_view.xml +++ b/app/design/frontend/magento_backup/Magento_Review/layout/override/review_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Review View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-right.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_index.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_index.xml index 0eb79578e40..086f4708782 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_index.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Billing Agreement" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceBlock name="root"> <action method="setTemplate"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_view.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_view.xml index 9093b370404..0b65274f462 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_view.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_billing_agreement_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Billing Agreement View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceBlock name="root"> <action method="setTemplate"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_creditmemo_items.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_creditmemo_items.xml index 7350fc373ea..7ea035f98da 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_creditmemo_items.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_creditmemo_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Creditmemo Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Creditmemo Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Creditmemo\Items" name="items" template="email/creditmemo/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/creditmemo/default.phtml"/> <block class="Magento\Sales\Block\Order\Email\Items\Order\Grouped" as="grouped" template="email/items/creditmemo/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_invoice_items.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_invoice_items.xml index 93e1dfe0713..4e00ef875dc 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_invoice_items.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_invoice_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Invoice Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Invoice Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Invoice\Items" name="items" template="email/invoice/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/invoice/default.phtml"/> <block class="Magento\Sales\Block\Order\Email\Items\Order\Grouped" as="grouped" template="email/items/invoice/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_items.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_items.xml index ec42d71fb15..af7fc72ac54 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_items.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Order Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Order Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Items" name="items" template="email/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder" as="default" template="email/items/order/default.phtml"/> <block class="Magento\Sales\Block\Order\Email\Items\Order\Grouped" as="grouped" template="email/items/order/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_shipment_items.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_shipment_items.xml index 948e627b452..4832ea1604f 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_shipment_items.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_email_order_shipment_items.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Shipment Items List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Email Shipment Items List" design_abstraction="custom"> <block class="Magento\Sales\Block\Order\Email\Shipment\Items" name="items" template="email/shipment/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/shipment/default.phtml"/> </block> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_creditmemo.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_creditmemo.xml index 70dc1029c0a..c50c9379fff 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_creditmemo.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_creditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order Creditmemo View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_form.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_form.xml index fd9731b7a37..8d41209b100 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_form.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_form.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Returns" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_invoice.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_invoice.xml index c2fb543c553..e4ccd347f32 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_invoice.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_invoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order Invoice View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printorder.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_print.xml similarity index 95% rename from app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printorder.xml rename to app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_print.xml index 76c4e6475af..d7fc7d72bf8 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printorder.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_print.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Order Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintShipment" name="sales.order.print" template="order/print.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/items/renderer/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printordercreditmemo.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printcreditmemo.xml similarity index 94% rename from app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printordercreditmemo.xml rename to app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printcreditmemo.xml index 489ba2241c6..b5ec83caafc 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printordercreditmemo.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printcreditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Creditmemo Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Creditmemo" name="sales.order.print.creditmemo" template="order/print/creditmemo.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printorderinvoice.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printinvoice.xml similarity index 95% rename from app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printorderinvoice.xml rename to app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printinvoice.xml index 818d84ca64a..66526bbbd78 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printorderinvoice.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printinvoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Invoice Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Invoice" name="sales.order.print.invoice" template="order/print/invoice.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printshipment.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printshipment.xml index c9b3c3dd228..89fe6aa71f0 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printshipment.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_printshipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Shipment Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Shipment" name="sales.order.print.shipment" template="order/print/shipment.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_reorder.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_reorder.xml index a5a1d6d97da..fb11d85006e 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_reorder.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_reorder.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Guest Reorder" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_shipment.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_shipment.xml index 1ca20c876af..0fb69339a3e 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_shipment.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_shipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order Shipment View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_view.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_view.xml index 42d410a682a..1b244284c3b 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_view.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_guest_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Guest Order View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_creditmemo.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_creditmemo.xml index a5148446939..33570010113 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_creditmemo.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_creditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order Creditmemo View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_history.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_history.xml index 244db3b4843..7cef22b6c45 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_history.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_history.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order History" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\History" name="sales.order.history"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_invoice.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_invoice.xml index 247e96bd3b7..cdac844a115 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_invoice.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_invoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order Invoice View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printordercreditmemo.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printcreditmemo.xml similarity index 95% rename from app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printordercreditmemo.xml rename to app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printcreditmemo.xml index 335d8293230..4621652be32 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printordercreditmemo.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printcreditmemo.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Creditmemo Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Creditmemo" name="sales.order.print.creditmemo" template="order/print/creditmemo.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printorderinvoice.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printinvoice.xml similarity index 95% rename from app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printorderinvoice.xml rename to app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printinvoice.xml index 6b30b48bda5..f6b60f60528 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printorderinvoice.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printinvoice.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Invoice Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Invoice" name="sales.order.print.invoice" template="order/print/invoice.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printshipment.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printshipment.xml index e9f1682cde3..4804aed2ab7 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printshipment.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_printshipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Shipment Print View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\PrintOrder\Shipment" name="sales.order.print.shipment" template="order/print/shipment.phtml"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_reorder.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_reorder.xml index c246af7a129..4ab3b665ee1 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_reorder.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_reorder.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Sales Reorder" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\View" name="sales.order.view"/> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_shipment.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_shipment.xml index b48bbb83697..e3d20d51e69 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_shipment.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_shipment.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order Shipment View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_view.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_view.xml index 4d1d1ab35bf..aa583d3e525 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_view.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_order_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Order View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceContainer name="my.account.wrapper"> <block class="Magento\Sales\Block\Order\Info" as="info" name="sales.order.info"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_index.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_index.xml index 57be56d1936..fa41d0ee611 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_index.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <referenceBlock name="root"> <action method="setTemplate"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_orders.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_orders.xml index f4266eab8ed..2b51b67e6a3 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_orders.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_orders.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile Orders List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <update handle="sales_recurring_profile_view__tabs"/> <referenceBlock name="sales.recurring.profile.view.tab.orders"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view.xml index 816ad80e9be..d9775f02ef3 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> <update handle="sales_recurring_profile_view__tabs"/> <referenceBlock name="sales.recurring.profile.view.tab.profile"> diff --git a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view__tabs.xml b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view__tabs.xml index 6900e63f006..da3289c27ba 100644 --- a/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view__tabs.xml +++ b/app/design/frontend/magento_backup/Magento_Sales/layout/override/sales_recurring_profile_view__tabs.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Recurring Profile View Tabs" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-left.phtml</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/button/share.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/button/share.phtml similarity index 82% rename from app/design/frontend/magento_plushe/Magento_Wishlist/button/share.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/button/share.phtml index 0b79afbd5de..08efe39a154 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/button/share.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/button/share.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,13 +16,16 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php if($this->getWishlist()->getItemsCount() && $this->getWishlist()->getShared() < $this->getConfig()->getSharingEmailLimit()): ?> - <button type="submit" name="save_and_share" title="<?php echo __('Share Wish List') ?>" class="action share"><span><span><?php echo __('Share Wish List') ?></span></span></button> -<?php endif;?> \ No newline at end of file + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Wishlist\Block\Customer\Wishlist\Button */ +?> +<?php if($this->getWishlist()->getItemsCount() && $this->getWishlist()->getShared() < $this->getConfig()->getSharingEmailLimit()): ?> + <button type="submit" name="save_and_share" title="<?php echo __('Share Wish List') ?>" class="button btn-share"><span><span><?php echo __('Share Wish List') ?></span></span></button> +<?php endif;?> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/button/tocart.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/button/tocart.phtml similarity index 88% rename from app/design/frontend/magento_plushe/Magento_Wishlist/button/tocart.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/button/tocart.phtml index e242ea90216..57bd7abb51e 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/button/tocart.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/button/tocart.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,14 +16,15 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<?php if($this->getWishlist()->getItemsCount() && $this->getWishlist()->isSalable()): ?> - <button type="button" title="<?php echo __('Add All to Cart') ?>" class="action tocart"><span><?php echo __('Add All to Cart') ?></span></button> -<?php endif;?> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php if($this->getWishlist()->getItemsCount() && $this->getWishlist()->isSalable()): ?> + <button type="button" title="<?php echo __('Add All to Cart') ?>" class="button btn-add"><span><span><?php echo __('Add All to Cart') ?></span></span></button> +<?php endif;?> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/button/update.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/button/update.phtml similarity index 87% rename from app/design/frontend/magento_plushe/Magento_Wishlist/button/update.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/button/update.phtml index 1a5b92add28..8cca098f602 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/button/update.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/button/update.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,14 +16,15 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<?php if($this->getWishlist()->getItemsCount()): ?> - <button type="submit" name="do" title="<?php echo __('Update Wishlist') ?>" class="action update"><span><?php echo __('Update Wish List') ?></span></button> -<?php endif;?> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php if($this->getWishlist()->getItemsCount()): ?> + <button type="submit" name="do" title="<?php echo __('Update Wish List') ?>" class="button btn-update"><span><span><?php echo __('Update Wish List') ?></span></span></button> +<?php endif;?> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/email/items.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/email/items.phtml new file mode 100644 index 00000000000..4b3d8c79abe --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/email/items.phtml @@ -0,0 +1,56 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* @var $this \Magento\Wishlist\Block\Share\Email\Items */ +?> +<?php $l = $this->getWishlistItemsCount() ?> +<div style="border:1px solid #E0E0E0; padding:15px; background:#F9F9F9;"> +<table cellspacing="0" cellpadding="0" border="0" width="650"> + <tr> + <?php $i = 0; foreach ($this->getWishlistItems() as $item): $i++ ?> + <?php /* @var $item \Magento\Wishlist\Model\Item */ ?> + <?php /* @var $_product \Magento\Catalog\Model\Product */ ?> + <?php $_product = $item->getProduct(); ?> + <td width="32%"> + <p align="center" style="font-size:12px;"><a href="<?php echo $this->getProductUrl($_product) ?>"><img src="<?php echo $this->getSmallImageUrl($_product); ?>" width="<?php echo $this->getSmallImageSize()?>" height="<?php echo $this->getSmallImageSize()?>" style="border:1px solid #ccc;" alt="" /></a></p> + <p align="center" style="font-size:12px;"><a href="<?php echo $this->getProductUrl($_product) ?>" style="color:#203548;"><strong><?php echo $this->escapeHtml($_product->getName()) ?></strong></a></p> + <?php if($this->hasDescription($item)): ?><p align="center" style="font-size:12px;"><?php echo __('Comment') ?>:<br /><?php echo $this->getEscapedDescription($item) ?></p><?php endif; ?> + <p align="center" style="font-size:12px;"><a href="<?php echo $this->getProductUrl($_product) ?>" style="color:#1E7EC8;"><?php echo __('View Product') ?></a> <small> + <?php if ($_product->getIsSalable()): ?>|</small> <a href="<?php echo $this->getAddToCartUrl($_product) ?>" style="color:#1E7EC8;"><strong><?php echo __('Add to Cart') ?></strong></a><?php endif;?> + </p></td> + <?php if ($i%3!=0): ?> + <td width="2%"></td> + <?php else: ?> + </tr> + <tr> + <td colspan="5"> </td> + </tr> + <?php if ($i<$l): ?> + <tr> + <?php endif ?> + <?php endif ?> + <?php endforeach ?> +</table> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/email/rss.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/email/rss.phtml new file mode 100644 index 00000000000..35ca825cc58 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/email/rss.phtml @@ -0,0 +1,31 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<p style="font-size:12px; line-height:16px; margin:0 0 16px;"> + <?php echo __("RSS link to %1's wishlist",$this->helper('Magento\Wishlist\Helper\Data')->getCustomerName()) ?> + <br /> + <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getRssUrl($this->getWishlistId()); ?>"><?php echo $this->helper('Magento\Wishlist\Helper\Data')->getRssUrl($this->getWishlistId()); ?></a> +</p> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/cart.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/cart.phtml similarity index 78% rename from app/design/frontend/magento_plushe/Magento_Wishlist/item/column/cart.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/item/column/cart.phtml index a5681f4bdf3..fca13010561 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/cart.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/cart.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,42 +16,44 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -/* @var $this \Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart */ -/* @var \Magento\Wishlist\Model\Item $item */ -$item = $this->getItem(); -$product = $item->getProduct(); -$options = $this->getChildBlock('customer.wishlist.item.options') - ->setItem($item) - ->getConfiguredOptions(); -?> - <?php echo $this->getPriceHtml($product, empty($options));?> - <div class="box tocart"> - <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?> - <input type="text" class="input-text qty" data-validate="{required:true,'validate-greater-than-zero':true}" name="qty[<?php echo $item->getId() ?>]" - value="<?php echo $this->getAddToCartQty($item) * 1 ?>"/> - <?php endif; ?> - <?php if ($product->isSaleable()): ?> - <button type="button" title="<?php echo __('Add to Cart') ?>" data-item-id="<?php echo $item->getId()?>" class="action tocart"><span><span><?php echo __('Add to Cart') ?></span></span></button> - <?php else: ?> - <?php if ($product->getIsSalable()): ?> - <p class="available stock" title="<?php echo __('Availability') ?>"><span><?php echo __('In stock') ?></span></p> - <?php else: ?> - <p class="unavailable stock" title="<?php echo __('Availability') ?>"><span><?php echo __('Out of stock') ?></span></p> - <?php endif; ?> - <?php endif; ?> - </div> - <?php foreach ($this->getChildNames() as $childName): ?> - <?php echo $this->getLayout()->renderElement($childName, false); ?> - <?php endforeach;?> - <?php if ($product->isVisibleInSiteVisibility()): ?> - <p><a class="action edit" href="<?php echo $this->getItemConfigureUrl($item) ?>"><span><?php echo __('Edit') ?></span></a> - </p> - <?php endif ?> - + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/* @var $this \Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart */ +/* @var \Magento\Wishlist\Model\Item $item */ +$item = $this->getItem(); +$product = $item->getProduct(); +$options = $this->getChildBlock('customer.wishlist.item.options') + ->setItem($item) + ->getConfiguredOptions(); +?> +<div class="cart-cell"> + <?php echo $this->getPriceHtml($product, empty($options));?> + <div class="add-to-cart-alt"> + <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?> + <input type="text" class="input-text qty" data-validate="{required:true,'validate-greater-than-zero':true}" name="qty[<?php echo $item->getId() ?>]" + value="<?php echo $this->getAddToCartQty($item) * 1 ?>"/> + <?php endif; ?> + <?php if ($product->isSaleable()): ?> + <button type="button" title="<?php echo __('Add to Cart') ?>" data-item-id="<?php echo $item->getId()?>" class="button btn-cart"><span><span><?php echo __('Add to Cart') ?></span></span></button> + <?php else: ?> + <?php if ($product->getIsSalable()): ?> + <p class="availability in-stock"><span><?php echo __('In stock') ?></span></p> + <?php else: ?> + <p class="availability out-of-stock"><span><?php echo __('Out of stock') ?></span></p> + <?php endif; ?> + <?php endif; ?> + </div> + <?php foreach ($this->getChildNames() as $childName): ?> + <?php echo $this->getLayout()->renderElement($childName, false); ?> + <?php endforeach;?> + <?php if ($product->isVisibleInSiteVisibility()): ?> + <p><a class="link-edit" href="<?php echo $this->getItemConfigureUrl($item) ?>"><?php echo __('Edit') ?></a> + </p> + <?php endif ?> +</div> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/image.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/image.phtml similarity index 77% rename from app/design/frontend/magento_plushe/Magento_Wishlist/item/column/image.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/item/column/image.phtml index 5d5bd9f71e7..b501eb0d40b 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/image.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/image.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,18 +16,18 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -/* @var \Magento\Wishlist\Model\Item $item */ -$item = $this->getItem(); -$product = $item->getProduct(); -$imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image'); -?> -<a class="product photo" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> - <?php echo $imageBlock->init($product, 'wishlist_thumbnail')->toHtml() ?> -</a> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/* @var \Magento\Wishlist\Model\Item $item */ +$item = $this->getItem(); +$product = $item->getProduct(); +?> +<a class="product-image" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> + <img src="<?php echo $this->helper('Magento\Catalog\Helper\Image')->init($product, 'small_image')->resize(113, 113); ?>" width="113" height="113" alt="<?php echo $this->escapeHtml($product->getName()) ?>" /> +</a> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/info.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/info.phtml similarity index 66% rename from app/design/frontend/magento_plushe/Magento_Wishlist/item/column/info.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/item/column/info.phtml index 275b996e650..30c2d1b749d 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/info.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/info.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,25 +16,26 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -/* @var \Magento\Wishlist\Model\Item $item */ -$item = $this->getItem(); -$product = $item->getProduct(); -?> -<strong class="product name"><a href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></strong> -<div class="product description"><?php echo $this->escapeHtml($this->stripTags($product->getShortDescription()));?></div> -<textarea placeholder="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->defaultCommentString()?>" name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" title="<?php echo __('Comment') ?>"><?php echo ($this->escapeHtml($item->getDescription())) ?></textarea> -<?php $children = $this->getChildNames(); ?> -<?php if ($children): ?> - <div class="product manage"> - <?php foreach($children as $childName):?> - <?php echo $this->getLayout()->renderElement($childName, false);?> - <?php endforeach;?> - </div> -<?php endif; ?> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/* @var \Magento\Wishlist\Model\Item $item */ +$item = $this->getItem(); +$product = $item->getProduct(); +?> +<h3 class="product-name"><a href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></h3> +<div class="description std"><div class="inner"><?php echo $this->escapeHtml($this->stripTags($product->getShortDescription()));?></div></div> +<textarea name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" title="<?php echo __('Comment') ?>"><?php echo ($this->escapeHtml($item->getDescription())) ?></textarea> +<?php $children = $this->getChildNames(); ?> +<?php if ($children): ?> + <div class="item-manage"> + <?php foreach($children as $childName):?> + <?php echo $this->getLayout()->renderElement($childName, false);?> + <?php endforeach;?> + </div> +<?php endif; ?> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/remove.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/remove.phtml similarity index 90% rename from app/design/frontend/magento_plushe/Magento_Wishlist/item/column/remove.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/item/column/remove.phtml index 91dcd50b456..9ffc7c89a1f 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/item/column/remove.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/item/column/remove.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,13 +16,14 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -?> -<a href="<?php echo $this->getItemRemoveUrl($this->getItem()); ?>" title="<?php echo __('Remove Item') ?>" - class="action delete"><span><?php echo __('Remove item');?></span></a> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +?> +<a href="<?php echo $this->getItemRemoveUrl($this->getItem()); ?>" title="<?php echo __('Remove Item') ?>" + class="btn-remove btn-remove2"><?php echo __('Remove item');?></a> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/item/configure/addto.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/item/configure/addto.phtml similarity index 78% rename from app/design/frontend/magento_plushe/Magento_Wishlist/item/configure/addto.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/item/configure/addto.phtml index 0b0f085bbc7..62648935ae2 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/item/configure/addto.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/item/configure/addto.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,22 +16,24 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php $_wishlistItem = $this->getWishlistItem(); ?> -<?php $_wishlistSubmitUrl = $this->helper('Magento\Wishlist\Helper\Data')->getUpdateUrl($_wishlistItem); ?> -<div class="product addto links" data-role="add-to-links"> -<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> - <a href="<?php echo $_wishlistSubmitUrl ?>" class="action towishlist updated"><span><?php echo __('Update Wish List') ?></span></a> -<?php endif; ?> -<?php $_product = $this->getProduct(); ?> -<?php $_compareUrl = $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddUrl($_product); ?> -<?php if ($_compareUrl) : ?> - <a href="<?php echo $_compareUrl ?>" class="action tocompare"><span><?php echo __('Add to Compare') ?></span></a> -<?php endif; ?> -</div> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php $_wishlistItem = $this->getWishlistItem(); ?> +<?php $_wishlistSubmitUrl = $this->helper('Magento\Wishlist\Helper\Data')->getUpdateUrl($_wishlistItem); ?> +<ul class="add-to-links" data-role="add-to-links"> +<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> + <li><a href="<?php echo $_wishlistSubmitUrl ?>" class="link-compare"><?php echo __('Update Wish List') ?></a></li> +<?php endif; ?> +<?php $_product = $this->getProduct(); ?> +<?php $_compareUrl = $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddUrl($_product); ?> +<?php if ($_compareUrl) : ?> + <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo __('Add to Compare') ?></a></li> +<?php endif; ?> +</ul> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/item/list.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/item/list.phtml similarity index 76% rename from app/design/frontend/magento_plushe/Magento_Wishlist/item/list.phtml rename to app/design/frontend/magento_backup/Magento_Wishlist/item/list.phtml index 96d64947ea1..bf5a7dc7ccb 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/item/list.phtml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/item/list.phtml @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -16,38 +16,42 @@ * * 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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php - $columns = $this->getColumns(); -?> -<table class="table data wishlist" id="wishlist-table"> - <thead> - <tr> - <?php foreach ($columns as $column): ?> - <th class="col <?php echo $column->getColClass(); ?>"><?php echo $column->getTitle();?></th> - <?php endforeach; ?> - </tr> - </thead> - <tbody> - <?php if (count($this->getItems())): ?> - <?php foreach ($this->getItems() as $item): ?> - <tr id="item_<?php echo $item->getId();?>"> - <?php foreach ($columns as $column): ?> - <td class="col <?php echo $column->getColClass(); ?>"><?php $column->setItem($item); echo $column->toHtml($item);?></td> - <?php endforeach; ?> - </tr> - <?php endforeach ?> - <?php else: ?> - <td colspan="<?php echo count($columns);?>" class="empty"><?php echo __('This Wish List has no Items');?></td> - <?php endif; ?> - </tbody> -</table> -<?php foreach ($columns as $column): ?> - <?php echo $column->getAdditionalHtml();?> -<?php endforeach; ?> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php + $columns = $this->getColumns(); +?> +<table class="data-table" id="wishlist-table"> + <thead> + <tr> + <?php foreach ($columns as $column): ?> + <th><?php echo $column->getTitle();?></th> + <?php endforeach; ?> + </tr> + </thead> + <tbody> + <?php if (count($this->getItems())): ?> + <?php foreach ($this->getItems() as $item): ?> + <tr id="item_<?php echo $item->getId();?>"> + <?php foreach ($columns as $column): ?> + <td><?php $column->setItem($item); echo $column->toHtml($item);?></td> + <?php endforeach; ?> + </tr> + <?php endforeach ?> + <?php else: ?> + <td colspan="<?php echo count($columns);?>" class="wishlist-empty"><?php echo __('This Wish List has no Items');?></td> + <?php endif; ?> + </tbody> +</table> +<?php foreach ($columns as $column): ?> + <?php echo $column->getAdditionalHtml();?> +<?php endforeach; ?> +<script type="text/javascript"> + jQuery('#wishlist-table').decorate('table'); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/js/add-to-wishlist.js b/app/design/frontend/magento_backup/Magento_Wishlist/js/add-to-wishlist.js new file mode 100644 index 00000000000..1c90f128567 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/js/add-to-wishlist.js @@ -0,0 +1,50 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true*/ +(function ($) { + $.widget('mage.addToWishlist', { + options: { + bundleInfo: '[id^=bundle-option-]', + configurableInfo: '.super-attribute-select', + groupedInfo: '#super-product-table input', + downloadableInfo: '.options-list input', + customOptionsInfo: '.product-custom-option' + }, + _create: function () { + this.addToWishlist(); + }, + addToWishlist: function () { + this._on({ + 'click [data-action="add-to-wishlist"]': function (event) { + var url = $(event.target).closest('a').attr('href'), + productInfo = this.options[this.options.productType + 'Info'], + additionalData = $(this.options.customOptionsInfo).serialize(); + if (productInfo !== undefined) { + additionalData += $(productInfo).serialize(); + } + $(event.target).closest('a').attr('href', url + (url.indexOf('?') == -1 ? '?' : '&') + additionalData); + } + }); + } + }); +})(jQuery); diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/js/search.js b/app/design/frontend/magento_backup/Magento_Wishlist/js/search.js new file mode 100644 index 00000000000..b7d812993a0 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/js/search.js @@ -0,0 +1,57 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 frontend wishlist search + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/*jshint browser:true jquery:true*/ +(function($) { + "use strict"; + $.widget('mage.wishlistSearch', { + + /** + * Bind handlers to events + */ + _create: function() { + this.element.on('change', $.proxy(this._toggleForm, this)); + }, + + /** + * Toggle Form + * @private + */ + _toggleForm: function() { + switch (this.element.val()) { + case 'name': + $(this.options.emailFormSelector).hide(); + $(this.options.nameFormSelector).show(); + break; + case 'email': + $(this.options.nameFormSelector).hide(); + $(this.options.emailFormSelector).show(); + break; + default: + $(this.options.emailFormSelector).add(this.options.nameFormSelector).hide(); + } + } + }); +})(jQuery); diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/customer_account.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/customer_account.xml new file mode 100644 index 00000000000..7d7127d1ab0 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/customer_account.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="customer_account_navigation"> + <block class="Magento\Page\Block\Link\Current" ifconfig="wishlist/general/active" name="customer-account-navigation-wish-list-link"> + <arguments> + <argument name="path" xsi:type="string">wishlist</argument> + <argument name="label" xsi:type="string">My Wish List</argument> + </arguments> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_edit.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/default.xml similarity index 74% rename from app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_edit.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/default.xml index 47a46f03439..38984fd8806 100644 --- a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_edit.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/default.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,16 +17,17 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="content"> - <block class="Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Edit" name="oauth_consumer.edit"> - <block class="Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Edit\Form" name="form"/> - </block> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="top.links"> + <block class="Magento\Wishlist\Block\Link" name="wish-list-link" after="my-account-link"/> + </referenceBlock> + <referenceContainer name="right"> + <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" after="cart_sidebar" template="sidebar.phtml"/> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure.xml similarity index 77% rename from app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure.xml index 6324d2fa14b..417ae117e71 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure.xml @@ -23,17 +23,16 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item" type="page"> - <update handle="catalog_product_view"/> - <referenceContainer name="product.info.main"> - <block class="Magento\Wishlist\Block\Item\Configure" name="product.info.addto" as="addto" template="Magento_Wishlist::item/configure/addto.phtml"/> - </referenceContainer> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="product.info"> + <block class="Magento\Wishlist\Block\Item\Configure" name="product.info.addto" as="addto" template="item/configure/addto.phtml"/> + </referenceBlock> <referenceBlock name="product.info.options.wrapper.bottom"> <action method="unsetChild"> - <argument name="name" xsi:type="string">product.info.addtocart.additional</argument> + <argument name="name" xsi:type="string">product.info.addto.additional</argument> </action> <action method="append"> - <argument name="element" xsi:type="string">product.info.addtocart.additional</argument> + <argument name="element" xsi:type="string">product.info.addto.additional</argument> </action> </referenceBlock> </layout> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_bundle.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_bundle.xml similarity index 64% rename from app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_bundle.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_bundle.xml index f2e28217a51..83752c4c834 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_bundle.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_bundle.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Bundle)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-bundle-js"> <arguments> @@ -36,24 +36,21 @@ </arguments> </block> </referenceBlock> - <referenceBlock name="root"> - <action method="addBodyClass"> - <argument name="value" xsi:type="string">type-bundle</argument> - </action> - </referenceBlock> <referenceBlock name="product.info"> - <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.summary" as="form_top" template="catalog/product/view/summary.phtml"> + <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle" name="product.info.bundle" as="product_type_data" template="catalog/product/view/type/bundle.phtml"> + <action method="addPriceBlockType"> + <argument name="type" xsi:type="string">bundle</argument> + <argument name="block" xsi:type="string">Magento\Bundle\Block\Catalog\Product\Price</argument> + <argument name="template" xsi:type="string">catalog/product/price.phtml</argument> + </action> <block class="Magento\Bundle\Block\Catalog\Product\Price" name="bundle.prices" as="bundle_prices" template="catalog/product/view/price.phtml"> <action method="setMAPTemplate"> - <argument name="tmpl" xsi:type="string">catalog/product/price_msrp_item.phtml</argument> + <argument name="tmpl" xsi:type="string">Magento_Catalog::product/price_msrp_item.phtml</argument> </action> </block> - <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.bundle" as="addtocart" template="product/view/addtocart.phtml"/> - <block class="Magento\Catalog\Block\Product\View" name="product.info.addto.bundle" as="addto" template="product/view/addto.phtml"/> </block> </referenceBlock> <referenceBlock name="product.info.options.wrapper"> - <block class="Magento\Catalog\Block\Product\View" name="bundle.product.view.options.notice" template="Magento_Bundle::catalog/product/view/options/notice.phtml"/> <block class="Magento\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="-"> <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Select" name="product.info.bundle.options.select" as="select"/> <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Multi" name="product.info.bundle.options.multi" as="multi"/> @@ -65,32 +62,7 @@ <remove name="product.tierprices"/> <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.tierprices" as="tierprices" before="-" template="Magento_Bundle::catalog/product/view/tierprices.phtml"/> <block class="Magento\CatalogInventory\Block\Qtyincrements" name="product.info.qtyincrements" before="-" template="qtyincrements.phtml"/> - <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.back.button" as="backButton" after="-" template="catalog/product/view/backbutton.phtml"/> - <action method="unsetChild"> - <argument name="block" xsi:type="string">product.info.addtocart</argument> - </action> - <action method="setHideRequiredNotice"> - <argument name="flag" xsi:type="string">1</argument> - </action> - <action method="unsetChild"> - <argument name="block" xsi:type="string">product.info.addto</argument> - </action> </referenceBlock> - <referenceContainer name="content"> - <container name="bundle.options.container" label="invisible" htmlTag="div" htmlClass="bundle options container" after="product.info.media"/> - <move element="product.info" destination="bundle.options.container" before="-"/> - </referenceContainer> - <referenceContainer name="product.info.type"> - <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle" name="product.info.bundle" as="product_type_data" template="catalog/product/view/type/bundle.phtml"> - <action method="addPriceBlockType"> - <argument name="type" xsi:type="string">bundle</argument> - <argument name="block" xsi:type="string">Magento\Bundle\Block\Catalog\Product\Price</argument> - <argument name="template" xsi:type="string">catalog/product/price.phtml</argument> - </action> - </block> - <container name="product.info.bundle.extra" after="product.info.bundle" as="product_type_data_extra" label="Product Extra Info"/> - <block class="Magento\Bundle\Block\Catalog\Product\View" name="customize.button" as="customize_button" template="catalog/product/view/customize.phtml"/> - </referenceContainer> <referenceBlock name="product.clone_prices"> <action method="addPriceBlockType"> <argument name="type" xsi:type="string">bundle</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_configurable.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_configurable.xml similarity index 71% rename from app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_configurable.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_configurable.xml index afd8ebcc819..2bad362d01d 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_configurable.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_configurable.xml @@ -23,16 +23,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Configurable)" type="page"> - <referenceBlock name="root"> - <action method="addBodyClass"> - <argument name="value" xsi:type="string">type-configurable</argument> - </action> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="product.info"> + <block class="Magento\Catalog\Block\Product\View\Type\Configurable" name="product.info.configurable" as="product_type_data" template="product/view/type/default.phtml"> + <container name="product.info.configurable.extra" as="product_type_data_extra" label="Product Extra Info"/> + </block> </referenceBlock> - <referenceContainer name="product.info.type"> - <block class="Magento\Catalog\Block\Product\View\Type\Configurable" name="product.info.configurable" as="product_type_data" template="product/view/type/default.phtml"/> - <container name="product.info.configurable.extra" after="product.info.configurable" as="product_type_data_extra" label="Product Extra Info"/> - </referenceContainer> <referenceBlock name="product.info.options.wrapper"> <block class="Magento\Catalog\Block\Product\View\Type\Configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="product/view/type/options/configurable.phtml"/> </referenceBlock> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_grouped.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_grouped.xml similarity index 69% rename from app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_grouped.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_grouped.xml index 1659d4b3e0f..c596eec47d5 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_grouped.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_grouped.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,15 +17,17 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Grouped)" type="page"> - <referenceContainer name="product.info.form.content"> - <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/> - <container name="product.info.grouped.extra" after="product.info.grouped" before="product.info.grouped" as="product_type_data_extra" label="Product Extra Info"/> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Grouped)" type="page"> + <referenceBlock name="product.info"> + <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped" as="product_type_data" template="product/view/type/grouped.phtml"> + <container name="product.info.grouped.extra" as="product_type_data_extra" label="Product Extra Info"/> + </block> + <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped.grid" as="product_type_data_grid" template="product/view/type/grouped.phtml"/> + </referenceBlock> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_simple.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_simple.xml similarity index 82% rename from app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_simple.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_simple.xml index 6c60196129d..23daddbc2fc 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_simple.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_configure_type_simple.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,10 +17,12 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Configure Wishlist Item (Simple)" type="page"> + <update handle="catalog_product_view_type_simple"/> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_index.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_index.xml similarity index 70% rename from app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_index.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_index.xml index 04d7e457913..83fe9d8cc4f 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_index_index.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_index.xml @@ -23,37 +23,27 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account My Wish List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="customer_account"/> - <referenceBlock name="my.account.wrapper"> + <referenceContainer name="my.account.wrapper"> <block class="Magento\Wishlist\Block\Customer\Wishlist" name="customer.wishlist" template="view.phtml"> <action method="setTitle"> - <argument name="title" translate="true" xsi:type="string">My Wish List</argument> + <argument translate="true" name="title" xsi:type="string">My Wish List</argument> </action> <block class="Magento\Wishlist\Block\Customer\Wishlist\Items" name="customer.wishlist.items" as="items" template="item/list.phtml"> - <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Image" name="customer.wishlist.item.image" before="-" template="item/column/image.phtml"> - <arguments> - <argument name="col_class" xsi:type="string">photo</argument> - </arguments> - </block> + <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Image" name="customer.wishlist.item.image" template="item/column/image.phtml"/> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Comment" name="customer.wishlist.item.info" template="item/column/info.phtml"> - <arguments> - <argument name="col_class" xsi:type="string">item</argument> - <argument name="title" translate="true" xsi:type="string">Product Details and Comment</argument> - </arguments> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Product Details and Comment</argument> + </action> </block> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart" name="customer.wishlist.item.cart" template="item/column/cart.phtml"> - <arguments> - <argument name="col_class" xsi:type="string">actions</argument> - <argument name="title" translate="true" xsi:type="string">Add to Cart</argument> - </arguments> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Add to Cart</argument> + </action> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Options" name="customer.wishlist.item.options"/> </block> - <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="item/column/remove.phtml"> - <arguments> - <argument name="col_class" xsi:type="string">remove</argument> - </arguments> - </block> + <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="item/column/remove.phtml"/> </block> <container name="customer.wishlist.buttons" as="control_buttons" label="Wishlist Control Buttons"> <block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.share" template="button/share.phtml"/> @@ -61,5 +51,5 @@ <block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.update" template="button/update.phtml"/> </container> </block> - </referenceBlock> + </referenceContainer> </layout> diff --git a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_new.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_share.xml similarity index 73% rename from app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_new.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_share.xml index 47a46f03439..a5d2536a2a9 100644 --- a/app/code/Magento/Oauth/view/adminhtml/layout/adminhtml_oauth_consumer_new.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_index_share.xml @@ -1,6 +1,6 @@ -<?xml version="1.0"?> -<!-- -/** +<?xml version="1.0"?> +<!-- +/** * Magento * * NOTICE OF LICENSE @@ -17,16 +17,15 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="content"> - <block class="Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Edit" name="oauth_consumer.edit"> - <block class="Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Edit\Form" name="form"/> - </block> - </referenceContainer> -</layout> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Wish List Sharing Form" type="page"> + <update handle="customer_account"/> + <referenceContainer name="my.account.wrapper"> + <block class="Magento\Wishlist\Block\Customer\Sharing" name="wishlist.sharing" template="sharing.phtml"/> + </referenceContainer> +</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_shared_index.xml b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_shared_index.xml similarity index 90% rename from app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_shared_index.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_shared_index.xml index bfa717b7ee2..5514a660d28 100644 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/layout/override/base/wishlist_shared_index.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/layout/override/base/wishlist_shared_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer Shared Wishlist View" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Wishlist\Block\Share\Wishlist" name="customer.wishlist" template="shared.phtml"/> </referenceContainer> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/options_list.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/options_list.phtml new file mode 100644 index 00000000000..680c0e6079f --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/options_list.phtml @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* @var $this \Magento\Wishlist\Block\Customer\Wishlist\Item\Options */ +?> + +<?php $options = $this->getOptionList(); ?> +<?php if ($options): ?> +<div class="truncated" data-mage-init="{truncateOptions:[]}"> + <div class="truncated_full_value"> + <div class="item-options"> + <p><?php echo __('Options Details'); ?></p> + <dl> + <?php foreach ($options as $option): ?> + <dt><?php echo $this->escapeHtml($option['label']) ?></dt> + <dd> + <?php if (is_array($option['value'])): ?> + <?php echo nl2br(implode("\n", $option['value'])) ?> + <?php else: ?> + <?php echo $option['value'] ?> + <?php endif; ?> + </dd> + <?php endforeach; ?> + </dl> + </div> + </div> + <a href="#" onclick="return false;" class="details"><?php echo __('View Details') ?></a> +</div> +<?php endif ?> diff --git a/app/code/Magento/Oauth/etc/module.xml b/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price.phtml old mode 100755 new mode 100644 similarity index 58% rename from app/code/Magento/Oauth/etc/module.xml rename to app/design/frontend/magento_backup/Magento_Wishlist/render/item/price.phtml index b34eb32e322..7f21d63b3f8 --- a/app/code/Magento/Oauth/etc/module.xml +++ b/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price.phtml @@ -1,6 +1,5 @@ -<?xml version="1.0"?> -<!-- -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -17,24 +16,24 @@ * * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<config> - <module name="Magento_Oauth" version="1.0.0.1" active="true"> - <sequence> - <module name="Magento_Core"/> - <module name="Magento_User"/> - </sequence> - <depends> - <module name="Magento_Core"/> - <module name="Magento_Customer"/> - <module name="Magento_Adminhtml"/> - <module name="Magento_Backend"/> - <module name="Magento_Webapi"/> - </depends> - </module> -</config> + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* @var $this \Magento\Wishlist\Block\Customer\Wishlist_Render_Item_Price */ +?> + +<?php echo $this->getCleanProductPriceHtml(); ?> + +<?php /* @var $product \Magento\Catalog\Model\Product */ ?> +<?php $product = $this->getProduct(); ?> +<?php $finalPrice = $product->getFinalPrice(1); ?> +<?php if ($product->canConfigure()): ?> + <p class="configured-price"> + <span class="price-label"><?php echo __('Configured Price:') ?></span> + <span class="price"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($finalPrice, true, false); ?></span> + </p> +<?php endif; ?> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_item.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_item.phtml new file mode 100644 index 00000000000..760bdecc9fe --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_item.phtml @@ -0,0 +1,88 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php +/** + * Template for displaying product price at product view page, gift registry and wishlist + * + * @var $this \Magento\Catalog\Block\Product\Price + */ +?> +<?php + /** @var $_coreHelper \Magento\Core\Helper\Data */ + $_coreHelper = $this->helper('Magento\Core\Helper\Data'); + /** @var $_catalogHelper \Magento\Catalog\Helper\Data */ + $_catalogHelper = $this->helper('Magento\Catalog\Helper\Data'); + + /** @var $_product \Magento\Catalog\Model\Product */ + $_product = $this->getProduct(); + $_id = $_product->getId(); + $_msrpPrice = ''; +?> + <div class="price-box map-info"> + <?php $_price = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_product->getMsrp()) ?> + <?php if($_product->getMsrp()): ?> + <?php $_msrpPrice = $_coreHelper->currency($_product->getMsrp(),true,true) ?> + <span class="old-price" ><?php echo $_msrpPrice ?></span> + <?php endif; ?> + <?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?> + <?php $priceElementId = 'product-price-' . $_id . $this->getIdSuffix(); ?> + <span id="<?php echo $priceElementId ?>" style="display:none"></span> + <?php $popupId = 'msrp-popup-' . $_id . $this->getRandomString(20); ?> + <a href="#" id="<?php echo($popupId);?>"><?php echo __('Click for price'); ?></a> + <?php else: ?> + <span class="msrp-price-hide-message"> + <?php echo $_catalogHelper->getMsrpPriceMessage($_product) ?> + </span> + <?php endif; ?> + <?php $helpLinkId = 'msrp-help-' . $_id . $this->getRandomString(20); ?> + <a href="#" id="<?php echo($helpLinkId);?>"><?php echo __("What's this?"); ?></a> + </div> + <script type="text/javascript"> + (function ($) { + head.js("<?php echo $this->getViewFileUrl('Magento_Catalog::js/msrp.js') ?>", + function () { + <?php if ($this->helper('Magento\Catalog\Helper\Data')->isShowPriceOnGesture($_product)): ?> + $('#<?php echo($popupId);?>').addToCart({ + cartForm: "#wishlist-view-form", + popupId: "#<?php echo($popupId);?>", + productName: '<?php echo $_product->getName() ?>', + realPrice: '<?php echo $this->getRealPriceJs($_product) ?>', + msrpPrice: '<?php echo $_msrpPrice ?>', + priceElementId: '<?php echo $priceElementId ?>', + closeButtonId: '#map-popup-close', + popupCartButtonId: "#map-popup-button" + }); + <?php endif; ?> + $("#<?php echo($helpLinkId);?>").addToCart({ + helpLinkId: "#<?php echo($helpLinkId);?>", + productName: '<?php echo $_product->getName() ?>' + }); + }); + })(jQuery); + </script> + diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_rss.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_rss.phtml new file mode 100644 index 00000000000..010547daeb9 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/render/item/price_msrp_rss.phtml @@ -0,0 +1,38 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * Template for displaying wishlist item price at rss feeds pages + * + * @var $this \Magento\Catalog\Block\Product\Price + */ +?> +<div class="price-box map-info"> + <?php if ($this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($this->getProduct())): ?> + <a href="<?php echo $this->getProduct()->getProductUrl() ?>"><?php echo __('Click for price'); ?></a> + <?php endif; ?> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/shared.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/shared.phtml new file mode 100644 index 00000000000..4b8bde4e6c0 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/shared.phtml @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* @var $this \Magento\Wishlist\Block\Share\Wishlist */ +?> +<div class="my-wishlist"> + <div class="page-title"> + <h1><?php echo $this->escapeHtml($this->getHeader()) ?></h1> + </div> + <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php if ($this->hasWishlistItems()): ?> + <form action="<?php echo $this->getUrl('*/*/update') ?>" method="post"> + <fieldset> + <table class="data-table" id="wishlist-table"> + <col width="1" /> + <col /> + <col width="1" /> + <thead> + <tr> + <th><?php echo __('Product') ?></th> + <th><?php echo __('Comment') ?></th> + <th> </th> + </tr> + </thead> + <tbody> + <?php foreach($this->getWishlistItems() as $item): ?> + <?php + $product = $item->getProduct(); + $isVisibleProduct = $product->isVisibleInSiteVisibility(); + ?> + <tr> + <td> + <a class="product-image" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"><img src="<?php echo $this->getImageUrl($product); ?>" width="<?php echo $this->getImageSize()?>" height="<?php echo $this->getImageSize()?>" alt="<?php echo $this->escapeHtml($item->getName()) ?>" /></a> + <h2 class="product-name"><a href="<?php echo $this->getProductUrl($item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></h2> + <?php echo $this->getPriceHtml($product) ?> + <?php echo $this->getDetailsHtml($item) ?> + </td> + <td><?php echo $this->getEscapedDescription($item) ?></td> + <td class="a-center"> + <?php if ($product->isSaleable()): ?> + <?php if ($isVisibleProduct): ?> + <button type="button" title="<?php echo __('Add to Cart') ?>" onclick="setLocation('<?php echo $this->getSharedItemAddToCartUrl($item) ?>')" class="button btn-cart"><span><span><?php echo __('Add to Cart') ?></span></span></button> + <?php endif ?> + <?php endif; ?> + <p><a href="<?php echo $this->getAddToWishlistUrl($item) ?>" onclick="setLocation(this.href); return false;" class="link-wishlist" data-action="add-to-wishlist"><?php echo __('Add to Wishlist') ?></a></p> + </td> + </tr> + <?php endforeach ?> + </tbody> + </table> + <script type="text/javascript">(function($) {$('#wishlist-table').decorate('table')})(jQuery)</script> + </fieldset> + <div class="buttons-set"> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> + <?php if($this->isSaleable()):?> + <button type="button" title="<?php echo __('Add All to Cart') ?>" onclick="setLocation('<?php echo $this->getUrl('*/*/allcart', array('_current'=>true)) ?>')" class="button"><span><span><?php echo __('Add All to Cart') ?></span></span></button> + <?php endif;?> + </div> + </form> + <?php else: ?> + <p><?php echo __('Wish List is empty now.') ?></p> + <?php endif ?> +</div> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/sharing.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/sharing.phtml new file mode 100644 index 00000000000..c421eff7339 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/sharing.phtml @@ -0,0 +1,75 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Wishlist\Block\Customer\Sharing */ +?> +<div class="page-title"> + <h1><?php echo __('Share Your Wish List') ?></h1> +</div> +<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<form action="<?php echo $this->getSendUrl() ?>" id="form-validate" method="post"> + <div class="fieldset"> + <?php echo $this->getBlockHtml('formkey')?> + <h2 class="legend"><?php echo __('Sharing Information') ?></h2> + <ul class="form-list"> + <li class="wide"> + <label for="email_address" class="required"><em>*</em><?php echo __('Email addresses, separated by commas (max %1 addresses)', $this->getEmailSharingLimit()); ?></label> + <div class="input-box"> + <textarea name="emails" cols="60" rows="5" id="email_address" data-validate="{required:true,'validate-emails':true}"><?php echo $this->getEnteredData('emails') ?></textarea> + </div> + </li> + <li class="wide"> + <label for="message"><?php echo __('Message') ?></label> + <div class="input-box"> + <textarea id="message" name="message" cols="60" rows="5" class="validate-length maximum-length-<?php echo $this->getTextSharingLimit();?>"><?php echo $this->getEnteredData('message') ?></textarea> + </div> + </li> + <?php if($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow()): ?> + <li class="control"> + <div class="input-box"> + <input type="checkbox" name="rss_url" id="rss_url" value="1" title="<?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?>" class="checkbox" /> + </div> + <label for="rss_url"><?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?></label> + </li> + <?php endif; ?> + </ul> + </div> + <div class="buttons-set form-buttons"> + <p class="required"><?php echo __('* Required Fields') ?></p> + <p class="back-link"><a href="<?php echo $this->getBackUrl(); ?>"><small>« </small><?php echo __('Back')?></a></p> + <button type="submit" title="<?php echo __('Share Wish List') ?>" class="button"><span><span><?php echo __('Share Wish List') ?></span></span></button> + </div> +</form> +<script type="text/javascript"> + (function($) { + head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", function() { + $('#form-validate').validation(); + }) + })(jQuery); +</script> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/sidebar.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/sidebar.phtml new file mode 100644 index 00000000000..2e84cde15ee --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/sidebar.phtml @@ -0,0 +1,61 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* @var $this \Magento\Wishlist\Block\Customer\Sidebar */ +?> +<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> +<div class="block block-wishlist"> + <div class="block-title"> + <strong><span><?php echo $this->getTitle(); ?></span></strong> + </div> + <div class="block-content"> + <p class="block-subtitle"><?php echo __('Last Added Items') ?></p> + <?php if ($this->hasWishlistItems()): ?> + <ol class="mini-products-list" id="wishlist-sidebar"> + <?php foreach ($this->getWishlistItems() as $_item): ?> + <?php $product = $_item->getProduct(); ?> + <li class="item"> + <a href="<?php echo $this->getProductUrl($_item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>" class="product-image"><img src="<?php echo $this->getThumbnailSidebarUrl($product); ?>" width="<?php echo $this->getThumbnailSidebarSize()?>" height="<?php echo $this->getThumbnailSidebarSize()?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a> + <div class="product-details"> + <a href="<?php echo $this->getItemRemoveUrl($_item) ?>" title="<?php echo __('Remove This Item') ?>" onclick="return confirm('<?php echo __('Are you sure you would like to remove this item from the wishlist?') ?>');" class="btn-remove"><?php echo __('Remove This Item') ?></a> + <p class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></p> + <?php echo $this->getPriceHtml($product, false, '-wishlist') ?> + <?php if ($product->isSaleable() && $product->isVisibleInSiteVisibility()): ?> + <a href="<?php echo $this->getItemAddToCartUrl($_item) ?>" class="link-cart"><?php echo __('Add to Cart') ?></a> + <?php endif; ?> + </div> + </li> + <?php endforeach; ?> + </ol> + <script type="text/javascript">(function($) {$('#wishlist-sidebar').decorate('list', false)})(jQuery)</script> + <div class="actions"> + <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getListUrl() ?>"><?php echo __('Go to Wish List') ?></a> + </div> + <?php else: ?> + <p class="empty"><?php echo __('You have no items in your wishlist.') ?></p> + <?php endif ?> + </div> +</div> +<?php endif ?> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/view.phtml b/app/design/frontend/magento_backup/Magento_Wishlist/view.phtml new file mode 100644 index 00000000000..ca2f8f10112 --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/view.phtml @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design + * @package base_default + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* @var $this \Magento\Wishlist\Block\Customer\Wishlist */ +?> +<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> + <div class="my-wishlist"> + <div class="page-title title-buttons"> + <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow() && $this->hasWishlistItems()): ?> + <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="link-rss"><?php echo __('RSS Feed') ?></a> + <?php endif; ?> + <h1><?php echo $this->getTitle(); ?></h1> + </div> + <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + + <form id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post"> + <?php echo $this->getChildHtml('top'); ?> + <fieldset> + <?php if ($this->hasWishlistItems()): ?> + <?php echo $this->getBlockHtml('formkey');?> + <?php $this->getChildBlock('items')->setItems($this->getWishlistItems()); ?> + <?php echo $this->getChildHtml('items');?> + <?php else: ?> + <p class="wishlist-empty"><?php echo __('You have no items in your wish list.') ?></p> + <?php endif ?> + <div class="buttons-set buttons-set2"> + <?php echo $this->getChildHtml('control_buttons');?> + </div> + </fieldset> + </form> + <script id="form-tmpl" type="text/x-jQuery-tmpl"> + <form id="wishlist-hidden-form" method="post" action="${url}" class="no-display"> + {{if itemId}}<input name="item_id" value="${itemId}"/>{{/if}} + {{if wishlistId}}<input name="wishlist_id" value="${wishlistId}"/>{{/if}} + {{if qty}}<input name="qty" value="${qty}"/>{{/if}} + {{if item}}<input name="item" value="${item}"/>{{/if}} + {{if entity}}<input name="entity" value="${entity}"/>{{/if}} + </form> + </script> + <script> + (function($) { + head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", + "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation.js')?>", + "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", + "<?php echo $this->getViewFileUrl('Magento_Persistent::splitbutton.js') ?>", + "<?php echo $this->getViewFileUrl('Magento_Wishlist::wishlist.js')?>", function() { + $('#wishlist-view-form').wishlist({ + addToCartUrl: '<?php echo $this->getItemAddToCartUrl('%item%');?>' , + confirmRemoveMessage: '<?php echo __('Are you sure you want to remove this product from your wish list?') ?>', + addAllToCartUrl : '<?php echo $this->getUrl('*/*/allcart', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>', + commentString : '<?php echo $this->helper('Magento\Wishlist\Helper\Data')->defaultCommentString()?>' + }); + $('body').splitButton(); + }); + })(jQuery); + </script> + </div> + <?php echo $this->getChildHtml('bottom'); ?> + <div class="buttons-set"> + <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo __('Back') ?></a></p> + </div> +<?php endif ?> diff --git a/app/design/frontend/magento_backup/Magento_Wishlist/wishlist.js b/app/design/frontend/magento_backup/Magento_Wishlist/wishlist.js new file mode 100644 index 00000000000..757fc80231c --- /dev/null +++ b/app/design/frontend/magento_backup/Magento_Wishlist/wishlist.js @@ -0,0 +1,208 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 frontend product msrp + * @package mage + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/*jshint browser:true jquery:true sub:true*/ +/*global alert*/ +(function($, window) { + "use strict"; + $.widget('mage.wishlist', { + options: { + dataAttribute: 'item-id', + nameFormat: 'qty[{0}]', + btnRemoveSelector: '.btn-remove', + qtySelector: '.qty', + addToCartSelector: '.btn-cart', + addAllToCartSelector: '.btn-add', + commentInputType: 'textarea', + infoList: false + }, + + /** + * Bind handlers to events. + */ + _create: function() { + var _this = this; + if (!this.options.infoList) { + this.element + .on('click', this.options.addToCartSelector, function() { + $.proxy(_this._addItemsToCart($(this)), _this); + }) + .on('addToCart', function(event, context) { + $.proxy(_this._addItemsToCart($(context).parents('.cart-cell').find(_this.options.addToCartSelector)), _this); + }) + .on('click', this.options.btnRemoveSelector, $.proxy(this._confirmRemoveWishlistItem, this)) + .on('click', this.options.addAllToCartSelector, $.proxy(this._addAllWItemsToCart, this)) + .on('focusin focusout', this.options.commentInputType, $.proxy(this._focusComment, this)); + } + }, + + /** + * Validate and Redirect. + * @private + * @param {string} url + */ + _validateAndRedirect: function(url) { + if (this.element.validation({ + errorPlacement: function(error, element) { + error.insertAfter(element.next()); + } + }).valid()) { + this.element.prop('action', url); + window.location.href = url; + } + }, + + /** + * Add wish list items to cart. + * @private + * @param {jQuery object} elem - clicked 'add to cart' button + */ + _addItemsToCart: function(elem) { + if (elem.data(this.options.dataAttribute)) { + var itemId = elem.data(this.options.dataAttribute), + url = this.options.addToCartUrl.replace('%item%', itemId), + inputName = $.validator.format(this.options.nameFormat, itemId), + inputValue = elem.parent().find('[name="' + inputName + '"]').val(), + separator = (url.indexOf('?') >= 0) ? '&' : '?'; + url += separator + inputName + '=' + encodeURIComponent(inputValue); + this._validateAndRedirect(url); + return; + } + + }, + + /** + * Confirmation window for removing wish list item. + * @private + */ + _confirmRemoveWishlistItem: function() { + return window.confirm(this.options.confirmRemoveMessage); + }, + + /** + * Add all wish list items to cart + * @private + */ + _addAllWItemsToCart: function() { + var url = this.options.addAllToCartUrl, + separator = (url.indexOf('?') >= 0) ? '&' : '?'; + this.element.find(this.options.qtySelector).each(function(index, element) { + url += separator + $(element).prop('name') + '=' + encodeURIComponent($(element).val()); + separator = '&'; + }); + this._validateAndRedirect(url); + }, + + /** + * Toggle comment string. + * @private + * @param {event} e + */ + _focusComment: function(e) { + var commentInput = e.currentTarget; + if (commentInput.value === '' || commentInput.value === this.options.commentString) { + commentInput.value = commentInput.value === this.options.commentString ? + '' : this.options.commentString; + } + } + }); + + // Extension for mage.wishlist - Select All checkbox + $.widget('mage.wishlist', $.mage.wishlist, { + options: { + selectAllCheckbox: '#select-all', + parentContainer: '#wishlist-table' + }, + + _create: function() { + this._super(); + var selectAllCheckboxParent = $(this.options.selectAllCheckbox).parents(this.options.parentContainer), + checkboxCount = selectAllCheckboxParent.find('input:checkbox:not(' + this.options.selectAllCheckbox + ')').length; + // If Select all checkbox is checked, check all item checkboxes, if unchecked, uncheck all item checkboxes + $(this.options.selectAllCheckbox).on('click', function() { + selectAllCheckboxParent.find('input:checkbox').attr('checked', $(this).is(':checked')); + }); + // If all item checkboxes are checked, check select all checkbox, + // if not all item checkboxes are checked, uncheck select all checkbox + selectAllCheckboxParent.on('click', 'input:checkbox:not(' + this.options.selectAllCheckbox + ')', $.proxy(function() { + var checkedCount = selectAllCheckboxParent.find('input:checkbox:checked:not(' + this.options.selectAllCheckbox + ')').length; + $(this.options.selectAllCheckbox).attr('checked', checkboxCount === checkedCount); + }, this)); + } + }); + // Extension for mage.wishlist info add to cart + $.widget('mage.wishlist', $.mage.wishlist, { + _create: function() { + this._super(); + if (this.options.infoList) { + this.element.on('addToCart', $.proxy(function(event, context) { + this.element.find('input:checkbox').attr('checked', false); + $(context).closest('tr').find('input:checkbox').attr('checked', true); + this.element.submit(); + }, this)); + this._checkBoxValidate(); + } + }, + + /** + * validate checkbox selection. + * @private + */ + _checkBoxValidate: function() { + this.element.validation({ + submitHandler: $.proxy(function(form) { + if ($(form).find('input:checkbox:checked').length) { + form.submit(); + } else { + alert(this.options.checkBoxValidationMessage); + } + }, this) + }); + } + }); + + // Extension for mage.wishlist - Add Wishlist item to Gift Registry + $.widget('mage.wishlist', $.mage.wishlist, { + options: { + formTmplSelector: '#form-tmpl', + formTmplId: '#wishlist-hidden-form' + }, + + _create: function() { + this._super(); + var _this = this; + this.element.on('click', '[data-wishlist-to-giftregistry]', function() { + var json = $(this).data('wishlist-to-giftregistry'), + tmplJson = { + item: json['itemId'], + entity: json['entity'], + url: json['url'] + }; + $(_this.options.formTmplSelector).tmpl(tmplJson).appendTo('body'); + $(_this.options.formTmplId).submit(); + }); + } + }); +})(jQuery, window); diff --git a/app/design/frontend/magento_plushe/Magento_Bundle/catalog/product/view/type/bundle/options.phtml b/app/design/frontend/magento_plushe/Magento_Bundle/catalog/product/view/type/bundle/options.phtml index f11c5e3a2f0..d09c2cb900e 100644 --- a/app/design/frontend/magento_plushe/Magento_Bundle/catalog/product/view/type/bundle/options.phtml +++ b/app/design/frontend/magento_plushe/Magento_Bundle/catalog/product/view/type/bundle/options.phtml @@ -28,7 +28,7 @@ $_product = $this->getProduct(); $_helper = $this->helper('Magento\Catalog\Helper\Output'); ?> -<?php $_options = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getOptions()); ?> +<?php $_options = $this->decorateArray($this->getOptions()); ?> <?php if ($_product->isSaleable()):?> <?php if (count($_options)): ?> <script type="text/javascript"> diff --git a/app/design/frontend/magento_plushe/Magento_Bundle/layout/override/base/catalog_product_view_type_bundle.xml b/app/design/frontend/magento_plushe/Magento_Bundle/layout/override/base/catalog_product_view_type_bundle.xml index 79d22f571cc..3e1666e39a9 100644 --- a/app/design/frontend/magento_plushe/Magento_Bundle/layout/override/base/catalog_product_view_type_bundle.xml +++ b/app/design/frontend/magento_plushe/Magento_Bundle/layout/override/base/catalog_product_view_type_bundle.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Bundle)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-bundle-js"> <arguments> diff --git a/app/design/frontend/magento_plushe/Magento_Captcha/default.phtml b/app/design/frontend/magento_plushe/Magento_Captcha/default.phtml deleted file mode 100644 index 7c9d351bfaf..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Captcha/default.phtml +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 Magento_Captcha - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php /* @var $this \Magento\Core\Block\Captcha\DefaultCaptcha */ ?> - -<?php /* @var $captcha \Magento\Core\Model\Captcha\DefaultCaptcha */ ?> -<?php $captcha = $this->getCaptchaModel() ?> -<div class="field captcha required" role="<?php echo $this->getFormId()?>"> - <label for="captcha_<?php echo $this->getFormId() ?>" class="label"><span><?php echo __('Please type the letters below')?></span></label> - <div class="control captcha"> - <input name="<?php echo \Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php echo $this->getFormId() ?>" /> - <div class="nested"> - <div class="field captcha no-label" role="<?php echo $this->getFormId()?>" id="captcha-container-<?php echo $this->getFormId()?>"> - <div class="control captcha-image"> - <button type="button" class="action reload captcha-reload" title="<?php echo __('Reload captcha') ?>"><span><?php echo __('Reload captcha') ?></span></button> - <img alt="<?php echo __('Please type the letters below')?>" class="captcha-img" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>"/> - <?php if (!$captcha->isCaseSensitive()) :?> - <div class="captcha-note note"> - <?php echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?> - </div> - <?php endif; ?> - </div> - <script type="text/javascript">//<![CDATA[ - (function ($) { - head.js("<?php echo $this->getViewFileUrl('Magento_Captcha::captcha.js') ?>",function() { - $('#captcha-container-<?php echo $this->getFormId()?>').captcha({ - url: '<?php echo $this->getRefreshUrl()?>', - type: '<?php echo $this->getFormId() ?>' - }); - }); - })(jQuery); - //]]></script> - </div> - </div> - </div> -</div> diff --git a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/checkout_onepage_index.xml b/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/checkout_onepage_index.xml deleted file mode 100644 index 86dfd2318b8..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Captcha/layout/override/base/checkout_onepage_index.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceContainer name="form.login.additional.info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> - <action method="setFormId"> - <argument name="formId" xsi:type="string">user_login</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </referenceContainer> - <referenceContainer name="form.billing.additional.info"> - <block class="Magento\Captcha\Block\Captcha" name="captcha.guest.checkout"> - <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-captcha-onepage-js"> - <arguments> - <argument name="file" xsi:type="string">Magento_Captcha::onepage.js</argument> - </arguments> - </block> - </referenceBlock> - <action method="setFormId"> - <argument name="formId" xsi:type="string">guest_checkout</argument> - </action> - <action method="setImgWidth"> - <argument name="width" xsi:type="string">230</argument> - </action> - <action method="setImgHeight"> - <argument name="width" xsi:type="string">50</argument> - </action> - </block> - </referenceContainer> -</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view.xml index a8b8f191233..250c1589815 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Category" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">2columns-left.phtml</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_default.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_default.xml index 0ec154a4b93..dabf708b519 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_default.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_default.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Non Anchor Catalog Category" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="left"> <block class="Magento\Catalog\Block\Navigation" name="catalog.leftnav" before="-" template="navigation/left.phtml"/> </referenceContainer> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_layered.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_layered.xml index 5731b6ad280..5d2abe78c9c 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_layered.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_category_view_type_layered.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Anchor Catalog Category" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="left"> <block class="Magento\Catalog\Block\Layer\View" name="catalog.leftnav" before="-" template="layer/view.phtml"/> </referenceContainer> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_compare_index.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_compare_index.xml index bb59f782413..41d6a853f6e 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_compare_index.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_compare_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Compare List" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Product\Compare\ListCompare" name="catalog.compare.list" template="product/compare/list.phtml"/> </referenceContainer> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view.xml index 09cfc4854ef..20f6f77bc02 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Any)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_configurable.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_configurable.xml index 3909d574507..baf5f2d8391 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_configurable.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_configurable.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Configurable)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="addBodyClass"> <argument name="value" xsi:type="string">type-configurable</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_grouped.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_grouped.xml index 04c859c9771..e86dc99138f 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_grouped.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_grouped.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Grouped)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="product.info.form.content"> <block class="Magento\Catalog\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/> <container name="product.info.grouped.extra" after="product.info.grouped" before="product.info.grouped" as="product_type_data_extra" label="Product Extra Info"/> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_simple.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_simple.xml index 3ab144a1bf3..b39d1f7329a 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_simple.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_simple.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Simple)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="product.info.type"> <block class="Magento\Catalog\Block\Product\View\Type\Simple" name="product.info.simple" as="product_type_data" template="product/view/type/default.phtml"/> <container name="product.info.simple.extra" after="product.info.simple" as="product_type_data_extra" label="Product Extra Info"/> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_virtual.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_virtual.xml index 75d9277f3a1..3f0089174f9 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_virtual.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/override/base/catalog_product_view_type_virtual.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Virtual)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="product.info.type"> <block class="Magento\Catalog\Block\Product\View\Type\Virtual" name="product.info.virtual" as="product_type_data" template="product/view/type/default.phtml"/> <container name="product.info.virtual.extra" after="product.info.virtual" as="product_type_data_extra" label="Product Extra Info"/> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/product/view/options.phtml b/app/design/frontend/magento_plushe/Magento_Catalog/product/view/options.phtml index b79c02ce4ac..44339ee0148 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/product/view/options.phtml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/product/view/options.phtml @@ -25,7 +25,7 @@ /* @var $this \Magento\Catalog\Block\Product\View\Options */ ?> -<?php $_options = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getOptions()) ?> +<?php $_options = $this->decorateArray($this->getOptions()) ?> <?php if (count($_options)):?> <script type="text/javascript"> (function ($) { diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/product/view/tierprices.phtml b/app/design/frontend/magento_plushe/Magento_Catalog/product/view/tierprices.phtml index 96aa074aa1b..17bbc40bf1d 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/product/view/tierprices.phtml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/product/view/tierprices.phtml @@ -26,7 +26,7 @@ <?php /** - * @see \Magento\Catalog\Block\Product\View + * @var $this \Magento\Catalog\Block\Product\View */ $_product = $this->getProduct(); $_tierPrices = $this->getTierPrices(); @@ -190,7 +190,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, <?php endif; ?> <?php if ($_catalogHelper->isShowPriceOnGesture($_product)):?> - <?php $popupId = 'msrp-popup-' . $_product->getId() . $this->helper('Magento\Core\Helper\Data')->getRandomString(20); ?> + <?php $popupId = 'msrp-popup-' . $_product->getId() . $this->getRandomString(20); ?> <?php $addToCartUrl = $this->getProduct()->isSalable() ? $this->getAddToCartUrl($_product, array('qty' => $_price['price_qty'])) @@ -216,4 +216,4 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, })(jQuery); </script> <?php endif;?> -<?php endif;?> \ No newline at end of file +<?php endif;?> diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/product/view/type/options/configurable.phtml b/app/design/frontend/magento_plushe/Magento_Catalog/product/view/type/options/configurable.phtml index 7163b9c1b51..174a4f5bd9e 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/product/view/type/options/configurable.phtml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/product/view/type/options/configurable.phtml @@ -26,7 +26,7 @@ <?php $_product = $this->getProduct(); -$_attributes = $this->helper('Magento\Core\Helper\Data')->decorateArray($this->getAllowAttributes()); +$_attributes = $this->decorateArray($this->getAllowAttributes()); ?> <?php if ($_product->isSaleable() && count($_attributes)):?> <div class="product options configure"> diff --git a/app/design/frontend/magento_plushe/Magento_CatalogSearch/layout/override/base/catalogsearch_result_index.xml b/app/design/frontend/magento_plushe/Magento_CatalogSearch/layout/override/base/catalogsearch_result_index.xml index 6dcffd213fa..0accf0cd917 100644 --- a/app/design/frontend/magento_plushe/Magento_CatalogSearch/layout/override/base/catalogsearch_result_index.xml +++ b/app/design/frontend/magento_plushe/Magento_CatalogSearch/layout/override/base/catalogsearch_result_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Quick Search Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="page_two_columns_left"/> <referenceContainer name="left"> <block class="Magento\CatalogSearch\Block\Layer" name="catalogsearch.leftnav" before="-" template="Magento_Catalog::layer/view.phtml"/> diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/js/opcheckout.js b/app/design/frontend/magento_plushe/Magento_Checkout/js/opcheckout.js index 192c4ebd6b6..0a77675d280 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/js/opcheckout.js +++ b/app/design/frontend/magento_plushe/Magento_Checkout/js/opcheckout.js @@ -128,10 +128,11 @@ this._ajaxContinue(this.options.checkout.saveUrl, {method:'register'}, this.options.billingSection); this.element.find(this.options.checkout.registerCustomerPasswordSelector).show(); } else { - alert($.mage.__('Please choose to register or to checkout as a guest')); + alert($.mage.__('Please choose to register or to checkout as a guest.')); + return false; } } - return false; + this.element.trigger('login'); }, /** diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_cart_index.xml b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_cart_index.xml index 2acfe731270..36db150feda 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_cart_index.xml +++ b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_cart_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Shopping Cart" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Cart" name="checkout.cart" template="cart.phtml"> <container name="checkout.cart.items" label="invisible" as="with-items"> diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_multishipping_customer_address.xml b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_multishipping_customer_address.xml index 5b2daa464c7..189b3da3dbf 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_multishipping_customer_address.xml +++ b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_multishipping_customer_address.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout Customer Address Edit Form" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Edit" name="customer_address_edit" template="address/edit.phtml"/> </referenceContainer> diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_failure.xml b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_failure.xml index 64a1a2d348e..f4a491f3acb 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_failure.xml +++ b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_failure.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout Failure" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="page_one_column"/> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_index.xml b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_index.xml index 0c87238d37a..eaefcb0bbd8 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_index.xml +++ b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_index.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="root"> <action method="setTemplate"> <argument name="template" xsi:type="string">1column.phtml</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_success.xml b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_success.xml index a0878de06ad..65a3aea343b 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_success.xml +++ b/app/design/frontend/magento_plushe/Magento_Checkout/layout/override/base/checkout_onepage_success.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="One Page Checkout Success" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="page_one_column"/> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/address.phtml b/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/address.phtml deleted file mode 100644 index b0c420fc344..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/address.phtml +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="block dashboard addresses"> - <div class="title"> - <strong><?php echo __('Address Book') ?></strong> - <a class="action edit" href="<?php echo $this->getAddressBookUrl() ?>"><span><?php echo __('Manage Addresses') ?></span></a> - </div> - <div class="content"> - <div class="box address billing"> - <strong class="subtitle"> - <span><?php echo __('Default Billing Address') ?></span> - <a class="action edit" href="<?php echo $this->getPrimaryBillingAddressEditUrl() ?>"><span><?php echo __('Edit Address') ?></span></a> - </strong> - <address> - <?php echo $this->getPrimaryBillingAddressHtml() ?> - </address> - </div> - <div class="box address shipping"> - <strong class="subtitle"> - <span><?php echo __('Default Shipping Address') ?></span> - <a class="action edit" href="<?php echo $this->getPrimaryShippingAddressEditUrl() ?>"><span><?php echo __('Edit Address') ?></span></a> - </strong> - <address> - <?php echo $this->getPrimaryShippingAddressHtml() ?> - </address> - </div> - </div> -</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/info.phtml b/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/info.phtml deleted file mode 100644 index c9a1d6f15fd..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/account/dashboard/info.phtml +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="block dashboard info"> - <div class="title"><strong><?php echo __('Account Information') ?></strong></div> - <div class="content"> - <div class="box information"> - <strong class="subtitle"> - <?php echo __('Contact Information') ?> - <a class="action edit" href="<?php echo $this->getUrl('customer/account/edit') ?>"><span><?php echo __('Edit') ?></span></a> - </strong> - <p> - <?php echo $this->escapeHtml($this->getCustomer()->getName()) ?><br /> - <?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?><br /> - <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo __('Change Password') ?></a> - </p> - </div> - <?php if( $this->isNewsletterEnabled() ): ?> - <div class="box newsletter"> - <strong class="subtitle"> - <?php echo __('Newsletters') ?> - <a class="action edit" href="<?php echo $this->getUrl('newsletter/manage') ?>"><span><?php echo __('Edit') ?></span></a> - </strong> - <p> - <?php if( $this->getIsSubscribed() ): ?> - <?php echo __("You are currently subscribed to 'General Subscription'.") ?> - <?php else: ?> - <?php echo __('You are currently not subscribed to any newsletter.') ?> - <?php endif; ?> - </p> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.account.dashboard.info.extra')?> - </div> - <?php endif; ?> - </div> -</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/address/book.phtml b/app/design/frontend/magento_plushe/Magento_Customer/address/book.phtml deleted file mode 100644 index 797ef9838b4..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/address/book.phtml +++ /dev/null @@ -1,110 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Temlate for \Magento\Customer\Block\Address\Book block - * @var $test \Magento\Customer\Block\Address\Book - */ -?> -<div class="block addresses default"> - <div class="title"><strong><?php echo __('Default Addresses') ?></strong></div> - <div class="content"> - <?php if($_pAddsses = $this->getDefaultBilling()): ?> - <div class="box address billing"> - <strong class="subtitle"> - <span><?php echo __('Default Billing Address') ?></span> - <a class="action edit" href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"> - <span><?php echo __('Change Billing Address') ?></span> - </a> - </strong> - <address> - <?php echo $this->getAddressHtml($this->getAddressById($_pAddsses)) ?> - </address> - </div> - <?php else: ?> - <div class="box address no billing"> - <strong class="box-title"><span><?php echo __('Default Billing Address') ?></span></strong> - <p><?php echo __('You have no default billing address in your address book.') ?></p> - </div> - <?php endif ?> - - <?php if($_pAddsses = $this->getDefaultShipping()): ?> - <div class="box address shipping"> - <strong class="subtitle"> - <span><?php echo __('Default Shipping Address') ?></span> - <a class="action edit" href="<?php echo $this->getAddressEditUrl($this->getAddressById($_pAddsses)) ?>"> - <span><?php echo __('Change Shipping Address') ?></span> - </a> - </strong> - <address> - <?php echo $this->getAddressHtml($this->getAddressById($_pAddsses)) ?> - </address> - </div> - <?php else: ?> - <div class="box address shipping"> - <strong class="subtitle"><span><?php echo __('Default Shipping Address') ?></span></strong> - <p><?php echo __('You have no default shipping address in your address book.') ?></p> - </div> - <?php endif ?> - </div> -</div> - -<div class="block addresses list"> - <div class="title"><strong><?php echo __('Additional Address Entries') ?></strong></div> - <div class="content"> - <?php if($_pAddsses = $this->getAdditionalAddresses()): ?> - <ol class="items addresses"> - <?php foreach($_pAddsses as $_address): ?> - <li class="item"> - <address> - <?php echo $this->getAddressHtml($_address) ?><br /> - </address> - <div class="item actions"> - <a class="action edit" href="<?php echo $this->getUrl('customer/address/edit', array('id'=>$_address->getId())) ?>"><span><?php echo __('Edit Address') ?></span></a> - <a class="action delete" href="#" role="delete-address" data-address="<?php echo $_address->getId() ?>"><span><?php echo __('Delete Address') ?></span></a> - </div> - </li> - <?php endforeach; ?> - </ol> - <?php else: ?> - <p><?php echo __('You have no additional address entries in your address book.') ?></p> - <?php endif ?> - </div> -</div> - -<div class="actions"> - <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a></div> -</div> -<script type="text/javascript"> - head.js("<?php echo $this->getViewFileUrl('Magento_Customer::address.js'); ?>", function() { - jQuery('hgroup.page.title').address({ - deleteAddress: "li.item a[role='delete-address']", - deleteUrlPrefix: '<?php echo $this->getDeleteUrl() ?>id/', - addAddress: "button[role='add-address']", - addAddressLocation: '<?php echo $this->getAddAddressUrl() ?>' - }); - }); -</script> \ No newline at end of file diff --git a/app/design/frontend/magento_plushe/Magento_Customer/address/edit.phtml b/app/design/frontend/magento_plushe/Magento_Customer/address/edit.phtml deleted file mode 100644 index 560d23a119d..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/address/edit.phtml +++ /dev/null @@ -1,164 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Edit customer address template - * - * @see \Magento\Customer\Block\Address\Edit - */ -?> -<form class="form address edit" action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data" data-hasrequired="<?php echo __('* Required Fields') ?>"> - <fieldset class="fieldset"> - <legend class="legend"><span><?php echo __('Contact Information') ?></span></legend><br /> - <?php echo $this->getBlockHtml('formkey')?> - <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" /> - <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" /> - <?php echo $this->getNameBlockHtml() ?> - <div class="field company"> - <label class="label" for="company"><span><?php echo __('Company') ?></span></label> - <div class="control"> - <input type="text" name="company" id="company" title="<?php echo __('Company') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> - </div> - </div> - <div class="field telephone required"> - <label class="label" for="telephone"><span><?php echo __('Telephone') ?></span></label> - <div class="control"> - <input type="text" name="telephone" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone" /> - </div> - </div> - <div class="field fax"> - <label class="label" for="fax"><span><?php echo __('Fax') ?></span></label> - <div class="control"> - <input type="text" name="fax" id="fax" title="<?php echo __('Fax') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('fax') ?>" /> - </div> - </div> - </fieldset> - <fieldset class="fieldset"> - <legend class="legend"><span><?php echo __('Address') ?></span></legend><br /> - <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> - <div class="field street required"> - <label for="street_1" class="label"><span><?php echo __('Street Address') ?></span></label> - <div class="control"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> - <div class="nested"> - <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> - <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> - <div class="field additional no-label"> - <div class="control"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </div> - <?php endfor; ?> - </div> - </div> - </div> - - <?php if ($this->helper('Magento\Customer\Helper\Address')->isVatAttributeVisible()) : ?> - <div class="field taxvat"> - <label class="label" for="vat_id"><span><?php echo __('VAT Number') ?></span></label> - <div class="control"> - <input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo __('VAT Number') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('vat_id') ?>" id="vat_id" /> - </div> - </div> - <?php endif; ?> - <div class="field city required"> - <label class="label" for="city"><span><?php echo __('City') ?></span></label> - <div class="control"> - <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> - </div> - </div> - <div class="field region required"> - <label class="label" for="region_id"><span><?php echo __('State/Province') ?></span></label> - <div class="control"> - <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> - <option value=""><?php echo __('Please select region, state or province') ?></option> - </select> - <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" /> - </div> - </div> - <div class="field zip required"> - <label class="label" for="zip"><span><?php echo __('Zip/Postal Code') ?></span></label> - <div class="control"> - <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> - </div> - </div> - <div class="field country required"> - <label class="label" for="country"><span><?php echo __('Country') ?></span></label> - <div class="control"> - <?php echo $this->getCountryHtmlSelect() ?> - </div> - </div> - - <?php if($this->isDefaultBilling()): ?> - <div class="field note default"><?php echo __('Default Billing Address') ?></div> - <?php elseif($this->canSetAsDefaultBilling()): ?> - <div class="field choice set billing"> - <input type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox" /> - <label class="label" for="primary_billing"><span><?php echo __('Use as my default billing address') ?></span></label> - </div> - <?php else: ?> - <input type="hidden" name="default_billing" value="1" /> - <?php endif; ?> - - <?php if($this->isDefaultShipping()): ?> - <div class="field note default"><?php echo __('Default Shipping Address') ?></div> - <?php elseif($this->canSetAsDefaultShipping()): ?> - <div class="field choice set shipping"> - <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" class="checkbox" /> - <label class="label" for="primary_shipping"><span><?php echo __('Use as my default shipping address') ?></span></label> - </div> - <?php else: ?> - <input type="hidden" name="default_shipping" value="1" /> - <?php endif; ?> - </fieldset> - <div class="actions"> - <div class="primary"><button type="submit" class="action submit" title="<?php echo __('Save Address') ?>"><span><?php echo __('Save Address') ?></span></button></div> - <div class="secondary"><a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Go back') ?></span></a></div> - </div> -</form> -<script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", - function() { - $('#country').regionUpdater({ - optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all')? 'true' : 'false'); ?>, - regionListId: '#region_id', - regionInputId: '#region', - postcodeId: '#zip', - form: $('#form-validate').validation(), - regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, - defaultRegion: "<?php echo $this->getAddress()->getRegionId() ?>", - countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> - }); - }); - })(jQuery); -</script> - diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/changepassword.phtml b/app/design/frontend/magento_plushe/Magento_Customer/form/changepassword.phtml deleted file mode 100644 index 756af607ee2..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/changepassword.phtml +++ /dev/null @@ -1,68 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<form action="<?php echo $action ?>" method="post" id="form-validate"> -<div class="fieldset"> - <ul class="form-list"> - <li class="fields"> - <div class="field"> - <label for="current_password" class="required"><em>*</em><?php echo __('Current Password') ?></label> - <div class="input-box"> - <input type="password" class="input-text" name="current_password" id="current_password" data-validate="{required:true, 'validate-password':true}"/> - </div> - </div> - </li> - <li class="fields"> - <div class="field"> - <label for="password" class="required"><em>*</em><?php echo __('New Password') ?></label> - <div class="input-box"> - <input type="password" class="input-text" name="password" id="password" data-validate="{required:true, 'validate-password':true}"/> - </div> - </div> - <div class="field"> - <label for="confirmation" class="required"><em>*</em><?php echo __('Confirm New Password') ?></label> - <div class="input-box"> - <input type="password" class="input-text" name="confirmation" id="confirmation" data-validate="{required:true, equalTo:'#password'}"/> - </div> - </div> - </li> - </ul> -</div> -<div class="buttons-set form-buttons"> - <p class="back-link"><a href="<?php echo $this->getUrl('customer/account') ?>"><small>« </small><?php echo __('Back') ?></a></p> - <button type="submit" class="button"><span><span><?php echo __('Save Password') ?></span></span></button> -</div> -<p class="required"><?php echo __('* Required Fields') ?></p> -</form> -<script type="text/javascript"> - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", function() { - jQuery('#form-validate').validation(); - }); -</script> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/edit.phtml b/app/design/frontend/magento_plushe/Magento_Customer/form/edit.phtml deleted file mode 100644 index 6f95865e869..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/edit.phtml +++ /dev/null @@ -1,129 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<form class="form edit account" action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate" enctype="multipart/form-data" data-hasrequired="<?php echo __('* Required Fields') ?>"> -<fieldset class="fieldset info"> - <?php echo $this->getBlockHtml('formkey')?> - <legend class="legend"><span><?php echo __('Account Information') ?></span></legend><br /> - <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getCustomer())->toHtml() ?> - <div class="field email required"> - <label class="label" for="email"><span><?php echo __('Email Address') ?></span></label> - <div class="control"> - <input type="text" name="email" id="email" value="<?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}" /> - </div> - </div> - <?php $_dob = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> - <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> - <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> - <?php if ($_dob->isEnabled()): ?> - <?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?> - <?php endif ?> - <?php if ($_taxvat->isEnabled()): ?> - <?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?> - <?php endif ?> - <?php if ($_gender->isEnabled()): ?> - <?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?> - <?php endif ?> - <div class="field choice"> - <input type="checkbox" name="change_password" id="change-password" value="1" title="<?php echo __('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /> - <label class="label" for="change-password"><span><?php echo __('Change Password') ?></span></label> - </div> -</fieldset> - -<fieldset class="fieldset password" style="display:none;"> - <legend class="legend"><span><?php echo __('Change Password') ?></span></legend><br /> - <div class="field password current required"> - <label class="label" for="current-password"><span><?php echo __('Current Password') ?></span></label> - <div class="control"> - <input type="password" class="input-text" name="current_password" id="current-password" /> - </div> - </div> - <div class="field new password required"> - <label class="label" for="password"><span><?php echo __('New Password') ?></span></label> - <div class="control"> - <input type="password" class="input-text" name="password" id="password" /> - </div> - </div> - <div class="field confirm password required"> - <label class="label" for="confirmation"><span><?php echo __('Confirm New Password') ?></span></label> - <div class="control"> - <input type="password" class="input-text" name="confirmation" id="confirmation" /> - </div> - </div> -</fieldset> -<div class="actions"> - <div class="primary"> - <button type="submit" class="action save" title="<?php echo __('Save') ?>"><span><?php echo __('Save') ?></span></button> - </div> - <div class="secondary"> - <a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Go back') ?></span></a> - </div> -</div> -</form> -<script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Customer::set-password.js') ?>", - <?php if ($_dob->isEnabled()): ?> - "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", - <?php endif ?> - function() { - $('#change-password').setPassword({ - currentPasswordId: '#current-password', - passwordId: '#password', - confirmationId: '#confirmation', - passwordContainer: 'fieldset.fieldset.password', - showOnDefault: <?php echo $this->getCustomer()->getChangePassword() ? 'true' : 'false' ?> - }); - var dataForm = $('#form-validate'), ignore; - <?php if ($_dob->isEnabled()): ?> - ignore = 'input[id$="full"]'; - <?php endif ?> - dataForm.validation({ - <?php if ($_dob->isEnabled()): ?> - errorPlacement: function(error, element) { - if (element.prop('id').search('full') !== -1) { - var dobElement = $(element).parents('.customer-dob'), - errorClass = error.prop('class'); - error.insertAfter(element.parent()); - dobElement.find('.validate-custom').addClass(errorClass) - .after('<div class="' + errorClass + '"></div>'); - } - else { - error.insertAfter(element); - } - }, - ignore: ':hidden:not(' + ignore + ')' - <?php else: ?> - ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden' - <?php endif ?> - }); - }); - })(jQuery); -</script> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/forgotpassword.phtml b/app/design/frontend/magento_plushe/Magento_Customer/form/forgotpassword.phtml deleted file mode 100644 index 8e253400da2..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/forgotpassword.phtml +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<form class="form password forget" action="<?php echo $this->getUrl('*/*/forgotpasswordpost') ?>" method="post" id="form-validate"> - <fieldset class="fieldset" data-hasrequired="<?php echo __('* Required Fields') ?>"> - <p class="field note"><?php echo __('Please enter your email address below. You will receive a link to reset your password.'); ?></p> - <div class="field email required"> - <label for="email_address" class="label"><span><?php echo __('Email Address') ?></span></label> - <div class="control"> - <input type="text" name="email" alt="email" id="email_address" class="input-text" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" data-validate="{required:true, 'validate-email':true}" /> - </div> - </div> - <?php echo $this->getChildHtml('form_additional_info'); ?> - </fieldset> - <div class="actions"> - <div class="primary"> - <button type="submit" class="action submit"><span><?php echo __('Submit') ?></span></button> - </div> - <div class="secondary"> - <a class="action back" href="<?php echo $this->helper('Magento\Customer\Helper\Data')->getLoginUrl() ?>"><span><?php echo __('Go back') ?></span></a> - </div> - </div> -</form> -<script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - function() { - $('#form-validate').validation(); - }); - })(jQuery); -</script> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/login.phtml b/app/design/frontend/magento_plushe/Magento_Customer/form/login.phtml deleted file mode 100644 index 2c6b40d8dbb..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/login.phtml +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Customer login form template - * - * @see \Magento\Customer\Block\Form\Login - */ -?> -<?php /* -<div class="account-login<?php if (!$this->helper('Magento\Customer\Helper\Data')->isRegistrationAllowed()) echo ' login-only' ?>"> - <div class="page-title"> - <h1><?php if ($this->helper('Magento\Customer\Helper\Data')->isRegistrationAllowed()): ?> - <?php echo __('Login or Create an Account') ?> - <?php else: ?> - <?php echo __('Login'); ?> - <?php endif; ?></h1> - </div> - */ -?> -<div class="block customer login"> - <div class="title"><strong><?php echo __('Registered Customers') ?></strong></div> - <div class="content"> - <form class="form login" action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form"> - <fieldset class="fieldset login" data-hasrequired="<?php echo __('* Required Fields') ?>"> - <p class="field note"><?php echo __('If you have an account with us, log in using your email address.') ?></p> - <div class="field email required"> - <label class="label" for="email"><span><?php echo __('Email Address') ?></span></label> - <div class="control"> - <input name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" type="text" class="input-text" title="<?php echo __('Email Address') ?>" data-validate="{required:true, 'validate-email':true}" /> - </div> - </div> - <div class="field password required"> - <label for="pass" class="label"><span><?php echo __('Password') ?></span></label> - <div class="control"> - <input name="login[password]" type="password" class="input-text" id="pass" title="<?php echo __('Password') ?>" data-validate="{required:true, 'validate-password':true}" /> - </div> - </div> - <?php echo $this->getChildHtml('form_additional_info'); ?> - <div class="actions"> - <div class="primary"><button type="submit" class="action login" name="send" id="send2"><span><?php echo __('Login') ?></span></button></div> - <div class="secondary"><a class="action remind" href="<?php echo $this->getForgotPasswordUrl() ?>"><span><?php echo __('Forgot Your Password?') ?></span></a></div> - </div> - </fieldset> - </form> - </div> - <script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - function() { - $('#login-form').validation(); - }); - })(jQuery); - </script> -</div> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/form/register.phtml b/app/design/frontend/magento_plushe/Magento_Customer/form/register.phtml deleted file mode 100644 index be555e0be84..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/form/register.phtml +++ /dev/null @@ -1,234 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php -/** - * Create account form template - * - * @see \Magento\Customer\Block\Form\Register - */ -?> - - <?php echo $this->getChildHtml('form_fields_before')?> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.form.register.extra')?> - <form class="form create account" action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data"> - <fieldset class="fieldset create info"> - <legend class="legend"><span><?php echo __('Personal Information') ?></span></legend><br /> - <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" /> - <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" /> - - <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?> - - <div class="field required"> - <label for="email_address" class="label"><span><?php echo __('Email Address') ?></span></label> - <div class="control"> - <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo __('Email Address') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}" /> - </div> - </div> - - <?php if ($this->isNewsletterEnabled()): ?> - <div class="field choice newsletter"> - <input type="checkbox" name="is_subscribed" title="<?php echo __('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" /> - <label for="is_subscribed" class="label"><span><?php echo __('Sign Up for Newsletter') ?></span></label> - </div> - <?php /* Extensions placeholder */ ?> - <?php echo $this->getChildHtml('customer.form.register.newsletter')?> - <?php endif ?> - - <?php $_dob = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> - <?php if ($_dob->isEnabled()): ?> - <?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?> - <?php endif ?> - - <?php $_taxvat = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Taxvat') ?> - <?php if ($_taxvat->isEnabled()): ?> - <?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?> - <?php endif ?> - - <?php $_gender = $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender') ?> - <?php if ($_gender->isEnabled()): ?> - <?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?> - <?php endif ?> - - </fieldset> - - <?php if($this->getShowAddressFields()): ?> - <fieldset class="fieldset address"> - <legend class="legend"><span><?php echo __('Address Information') ?></span></legend><br /> - <input type="hidden" name="create_address" value="1" /> - <div class="field company"> - <label for="company" class="label"><span><?php echo __('Company') ?></span></label> - <div class="control"> - <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo __('Company') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>" /> - </div> - </div> - <div class="field telephone"> - <label for="telephone" class="label"><span><?php echo __('Telephone') ?></span></label> - <div class="control"> - <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo __('Telephone') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" /> - </div> - </div> - - <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?> - - <div class="field street required"> - <label for="street_1" class="label"><span><?php echo __('Street Address') ?></span></label> - <div class="control"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(0)) ?>" title="<?php echo __('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" /> - <div class="nested"> - <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?> - <?php for ($_i = 2, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i <= $_n; $_i++): ?> - <div class="field additional no-label"> - <div class="control"> - <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i - 1)) ?>" title="<?php echo __('Street Address %1', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" /> - </div> - </div> - <?php endfor; ?> - </div> - </div> - </div> - - <div class="field required"> - <label for="city" class="label"><span><?php echo __('City') ?></span></label> - <div class="control"> - <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo __('City') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city') ?>" id="city" /> - </div> - </div> - - <div class="field region required"> - <label for="region_id" class="label"><span><?php echo __('State/Province') ?></span></label> - <div class="control"> - <select id="region_id" name="region_id" title="<?php echo __('State/Province') ?>" class="validate-select" style="display:none;"> - <option value=""><?php echo __('Please select region, state or province') ?></option> - </select> - <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo __('State/Province') ?>" class="input-text <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region') ?>" style="display:none;" /> - </div> - </div> - - <div class="field zip required"> - <label for="zip" class="label"><span><?php echo __('Zip/Postal Code') ?></span></label> - <div class="control"> - <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode') ?>" /> - </div> - </div> - - <div class="field country required"> - <label for="country" class="label"><span><?php echo __('Country') ?></span></label> - <div class="control"> - <?php echo $this->getCountryHtmlSelect() ?> - </div> - </div> - <?php $addressAttributes = $this->getChildBlock('customer_form_address_user_attributes');?> - <?php if ($addressAttributes): ?> - <?php $addressAttributes->setEntity($this->getAddress());?> - <?php $addressAttributes->setFieldIdFormat('address:%1$s')->setFieldNameFormat('address[%1$s]');?> - <?php $this->restoreSessionData($addressAttributes->getForm(), 'address');?> - <?php echo $addressAttributes->setShowContainer(false)->toHtml()?> - <?php endif;?> - <input type="hidden" name="default_billing" value="1" /> - <input type="hidden" name="default_shipping" value="1" /> - </fieldset> - - <?php endif; ?> - <fieldset class="fieldset create account" data-hasrequired="<?php echo __('* Required Fields') ?>"> - <legend class="legend"><span><?php echo __('Login Information') ?></span></legend><br /> - - <div class="field password required"> - <label for="password" class="label"><span><?php echo __('Password') ?></span></label> - <div class="control"> - <input type="password" name="password" id="password" title="<?php echo __('Password') ?>" class="input-text" data-validate="{required:true, 'validate-password':true}" /> - </div> - </div> - <div class="field confirmation required"> - <label for="confirmation" class="label"><span><?php echo __('Confirm Password') ?></span></label> - <div class="control"> - <input type="password" name="confirmation" title="<?php echo __('Confirm Password') ?>" id="confirmation" class="input-text" data-validate="{required:true, equalTo:'#password'}" /> - </div> - </div> - <?php echo $this->getChildHtml('form_additional_info'); ?> - </fieldset> - <div class="actions"> - <div class="primary"> - <button type="submit" class="action submit" title="<?php echo __('Submit') ?>"><span><?php echo __('Submit') ?></span></button> - </div> - <div class="secondary"> - <a class="action back" href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><span><?php echo __('Back') ?></span></a> - </div> - </div> - </form> - <script type="text/javascript"> - (function($) { - head.js( - "<?php echo $this->getViewFileUrl('jquery/jquery.validate.js') ?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js') ?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js') ?>", - <?php if ($this->getShowAddressFields()): ?> - "<?php echo $this->getViewFileUrl('Magento_Checkout::js/region-updater.js') ?>", - <?php endif ?> - <?php if ($_dob->isEnabled()): ?> - "<?php echo $this->getViewFileUrl('mage/validation/dob-rule.js') ?>", - <?php endif ?> - function() { - var dataForm = $('#form-validate'), ignore; - <?php if ($_dob->isEnabled()): ?> - ignore = 'input[id$="full"]'; - <?php endif ?> - dataForm.validation({ - <?php if ($_dob->isEnabled()): ?> - errorPlacement: function(error, element) { - if (element.prop('id').search('full') !== -1) { - var dobElement = $(element).parents('.customer-dob'), - errorClass = error.prop('class'); - error.insertAfter(element.parent()); - dobElement.find('.validate-custom').addClass(errorClass) - .after('<div class="' + errorClass + '"></div>'); - } - else { - error.insertAfter(element); - } - }, - ignore: ':hidden:not(' + ignore + ')' - <?php else: ?> - ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden' - <?php endif ?> - }).find('input:text').attr('autocomplete', 'off'); - <?php if ($this->getShowAddressFields()): ?> - $('#country').regionUpdater({ - optionalRegionAllowed: <?php echo ($this->getConfig('general/region/display_all')? 'true' : 'false'); ?>, - regionListId: '#region_id', - regionInputId: '#region', - postcodeId: '#zip', - form: dataForm, - regionJson: <?php echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, - defaultRegion: "<?php echo $this->getFormData()->getRegionId() ?>", - countriesWithOptionalZip: <?php echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true) ?> - }); - <?php endif; ?> - }); - })(jQuery); - </script> - diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/customer_account.xml b/app/design/frontend/magento_plushe/Magento_Customer/layout/customer_account.xml index c8cdb22c451..e8fc444df24 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/customer_account.xml +++ b/app/design/frontend/magento_plushe/Magento_Customer/layout/customer_account.xml @@ -30,6 +30,4 @@ <argument name="class" xsi:type="string">account</argument> </action> </referenceBlock> - <remove name="catalog.compare.sidebar"/> - <remove name="tags_popular"/> </layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_index.xml b/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_index.xml deleted file mode 100644 index f5b29358931..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/override/base/customer_account_index.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Customer My Account Dashboard" type="page"> - <update handle="customer_account"/> - <update handle="page_two_columns_left"/> - <referenceBlock name="page.main.title"> - <action method="setPageTitle"> - <argument translate="true" name="title" xsi:type="string">My Dashboard</argument> - </action> - </referenceBlock> - <referenceBlock name="my.account.wrapper"> - <block class="Magento\Customer\Block\Account\Dashboard\Hello" name="customer_account_dashboard_hello" as="hello" template="account/dashboard/hello.phtml"/> - <block class="Magento\Core\Block\Template" name="customer_account_dashboard_top" as="top"/> - <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml"/> - <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml"/> - </referenceBlock> -</layout> diff --git a/app/design/frontend/magento_plushe/Magento_Customer/widget/dob.phtml b/app/design/frontend/magento_plushe/Magento_Customer/widget/dob.phtml deleted file mode 100644 index 8bede142247..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Customer/widget/dob.phtml +++ /dev/null @@ -1,84 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -/** -USAGE: - -Simple: - -<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') - ->setDate($this->getCustomer()->getDob()) - ->toHtml() ?> - -For checkout/onepage/billing.phtml: - -<?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') - ->setDate($this->getCustomer()->getDob()) - ->setFieldIdFormat('billing:%s') - ->setFieldNameFormat('billing[%s]') - ->toHtml() ?> - -NOTE: Regarding styles - if we leave it this way, we'll move it to boxes.css - Alternatively we could calculate widths automatically using block input parameters. -*/ - -/** - * @see \Magento\Customer\Block\Widget\Dob - */ -?> -<div class="field dob<?php if ($this->isRequired()) echo ' required' ?>"> - <label class="label" for="<?php echo $this->getFieldId('month')?>"><span><?php echo __('Date of Birth') ?></span></label> - <div class="control customer-dob"> - <div class="fields group group-3"> - <?php - $this->setDateInput('d', - '<div class="field dob-day day"> - <label class="label" for="' . $this->getFieldId('day') . '"><span>' . __('DD') . '</span></label> - <div class="control"><input type="text" id="' . $this->getFieldId('day') . '" name="' . $this->getFieldName('day') . '" value="' . $this->getDay() . '" title="' . __('Day') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /></div> - </div>' - ); - - $this->setDateInput('m', - '<div class="field dob-month month"> - <label class="label" for="' . $this->getFieldId('month') . '"><span>' . __('MM') . '</span></label> - <div class="control"><input type="text" id="' . $this->getFieldId('month') . '" name="' . $this->getFieldName('month') . '" value="' . $this->getMonth() . '" title="' . __('Month') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /></div> - </div>' - ); - - $this->setDateInput('y', - '<div class="field dob-year year"> - <label class="label" for="' . $this->getFieldId('year') . '"><span>' . __('YYYY') . '</span></label> - <div class="control"><input type="text" id="' . $this->getFieldId('year') . '" name="' . $this->getFieldName('year') . '" value="' . $this->getYear() . '" title="' . __('Year') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' /></div> - </div>' - ); - ?> - <?php echo $this->getSortedDateInputs() ?> - </div> - <span class="dob-full" style="display:none;"> - <input type="hidden" id="<?php echo $this->getFieldId('full')?>" name="<?php echo $this->getFieldName('dob')?>" data-validate="{'validate-dob': ['.dob-day', '.dob-month', '.dob-year', <?php echo $this->isRequired() ? 'true' : 'false' ?>]<?php if ($this->getMinDateRange() && $this->getMaxDateRange()):?>, 'validate-date-between':['<?php echo $this->getMinDateRange()?>', '<?php echo $this->getMaxDateRange()?>']<?php endif;?>}"/> - </span> - <div class="validation-advice" id="<?php echo $this->getFieldId('date-advice')?>" style="opacity:0.999999; display:none;"></div> - </div> -</div> diff --git a/app/design/frontend/magento_plushe/Magento_Downloadable/layout/override/base/catalog_product_view_type_downloadable.xml b/app/design/frontend/magento_plushe/Magento_Downloadable/layout/override/base/catalog_product_view_type_downloadable.xml index 0f7f15fe927..a476967ac50 100644 --- a/app/design/frontend/magento_plushe/Magento_Downloadable/layout/override/base/catalog_product_view_type_downloadable.xml +++ b/app/design/frontend/magento_plushe/Magento_Downloadable/layout/override/base/catalog_product_view_type_downloadable.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product View (Downloadable)" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="product.info.type"> <block class="Magento\Downloadable\Block\Catalog\Product\View\Type" name="product.info.downloadable" as="product_type_data" template="catalog/product/type.phtml"> <block class="Magento\Downloadable\Block\Catalog\Product\Samples" name="product.info.downloadable.samples" as="samples" template="catalog/product/samples.phtml"/> diff --git a/app/design/frontend/magento_plushe/Magento_Newsletter/subscribe.phtml b/app/design/frontend/magento_plushe/Magento_Newsletter/subscribe.phtml deleted file mode 100644 index c3e45339281..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Newsletter/subscribe.phtml +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<div class="block newsletter"> - <div class="title"><strong>Newsletter</strong></div> - <div class="content"> - <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> - <div class="field newsletter"> - <label class="label" for="newsletter"><?php echo __('Sign Up for Our Newsletter:') ?></label> - <div class="control"> - <input name="email" type="text" id="newsletter" - placeholder="<?php echo __('Enter your email address') ?>" - data-validate="{required:true, 'validate-email':true}"/> - </div> - <div class="actions"> - <button class="action subscribe" title="<?php echo __('Subscribe') ?>" type="submit"> - <span><?php echo __('Subscribe') ?></span> - </button> - </div> - </div> - </form> - </div> -</div> - -<script type="text/javascript"> - //<![CDATA[ - (function($) { - head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", - "<?php echo $this->getViewFileUrl('Magento_Newsletter::newsletter.js')?>", function() { - $('#newsletter').newsletter({ - formSelector: '#newsletter-validate-detail', - placeholder: '<?php echo __('Enter your email address') ?>' - }); - }); - })(jQuery); - //]]> -</script> diff --git a/app/design/frontend/magento_plushe/Magento_Page/layout/default.xml b/app/design/frontend/magento_plushe/Magento_Page/layout/default.xml index e686483e6cc..37a8bf5c911 100644 --- a/app/design/frontend/magento_plushe/Magento_Page/layout/default.xml +++ b/app/design/frontend/magento_plushe/Magento_Page/layout/default.xml @@ -40,6 +40,11 @@ <argument name="file" xsi:type="string">js/matchMedia.js</argument> </arguments> </block> + <block class="Magento\Page\Block\Html\Head\Script" name="js-responsive-js"> + <arguments> + <argument name="file" xsi:type="string">js/responsive.js</argument> + </arguments> + </block> <block class="Magento\Page\Block\Html\Head\Script" name="js-head-js"> <arguments> <argument name="file" xsi:type="string">js/head.js</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Sendfriend/layout/override/base/sendfriend_product_send.xml b/app/design/frontend/magento_plushe/Magento_Sendfriend/layout/override/base/sendfriend_product_send.xml index cac967d5d01..8fca208b2b1 100644 --- a/app/design/frontend/magento_plushe/Magento_Sendfriend/layout/override/base/sendfriend_product_send.xml +++ b/app/design/frontend/magento_plushe/Magento_Sendfriend/layout/override/base/sendfriend_product_send.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Product Email to a Friend" type="page"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="page_one_column"/> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/shared.phtml b/app/design/frontend/magento_plushe/Magento_Wishlist/shared.phtml deleted file mode 100644 index bb5f0b8f425..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/shared.phtml +++ /dev/null @@ -1,79 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/* @var $this \Magento\Wishlist\Block\Share\Wishlist */ -?> - -<?php if ($this->hasWishlistItems()): ?> -<form class="form shared wishlist" action="<?php echo $this->getUrl('*/*/update') ?>" method="post"> - <table class="table data wishlist" id="wishlist-table"> - <thead> - <tr> - <th class="col product"><?php echo __('Product') ?></th> - <th class="col comment"><?php echo __('Comment') ?></th> - <th class="col actions"><?php echo __('Add to Cart') ?></th> - </tr> - </thead> - <tbody> - <?php foreach($this->getWishlistItems() as $item): ?> - <?php - $product = $item->getProduct(); - $isVisibleProduct = $product->isVisibleInSiteVisibility(); - ?> - <tr> - <td class="col product"> - <a class="product photo" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> - <span class="img photo container"><img src="<?php echo $this->getImageUrl($product); ?>" alt="<?php echo $this->escapeHtml($item->getName()) ?>"></span> - </a> - <strong class="product name"><a href="<?php echo $this->getProductUrl($item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></strong> - <?php echo $this->getPriceHtml($product) ?> - <?php echo $this->getDetailsHtml($item) ?> - </td> - <td class="col comment"><?php echo $this->getEscapedDescription($item) ?></td> - <td class="col actions"> - <?php if ($product->isSaleable()): ?> - <?php if ($isVisibleProduct): ?> - <button type="button" title="<?php echo __('Add to Cart') ?>" onclick="setLocation('<?php echo $this->getSharedItemAddToCartUrl($item) ?>')" class="action tocart"><span><?php echo __('Add to Cart') ?></span></button> - <?php endif ?> - <?php endif; ?> - <a href="<?php echo $this->getAddToWishlistUrl($item) ?>" onclick="setLocation(this.href); return false;" class="action towishlist" data-action="add-to-wishlist"><span><?php echo __('Add to Wishlist') ?></span></a> - </td> - </tr> - <?php endforeach ?> - </tbody> - </table> - <div class="actions"> - <?php if($this->isSaleable()):?> - <div class="primary"> - <button type="button" title="<?php echo __('Add All to Cart') ?>" onclick="setLocation('<?php echo $this->getUrl('*/*/allcart', array('_current'=>true)) ?>')" class="action tocart"><span><?php echo __('Add All to Cart') ?></span></button> - </div> - <?php endif;?> - <div class="secondary"> - <a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="action back"><span><?php echo __('Back') ?></span></a> - </div> - </div> -</form> -<?php else: ?> - <p><?php echo __('Wish List is empty now.') ?></p> -<?php endif ?> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/sharing.phtml b/app/design/frontend/magento_plushe/Magento_Wishlist/sharing.phtml deleted file mode 100644 index 70da9af4b1c..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/sharing.phtml +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<form class="form wishlist share" action="<?php echo $this->getSendUrl() ?>" id="form-validate" method="post" data-hasrequired="<?php echo __('* Required Fields') ?>"> - <fieldset class="fieldset"> - <?php echo $this->getBlockHtml('formkey')?> - <legend class="legend"><span><?php echo __('Sharing Information') ?></span></legend><br /> - <div class="field emails required"> - <label class="label" for="email_address"><span><?php echo __('Email addresses, separated by commas') ?></span></label> - <div class="control"> - <textarea name="emails" cols="60" rows="5" id="email_address" data-validate="{required:true,'validate-emails':true}"><?php echo $this->getEnteredData('emails') ?></textarea> - </div> - </div> - <div class="field text"> - <label class="label" for="message"><span><?php echo __('Message') ?></span></label> - <div class="control"> - <textarea id="message" name="message" cols="60" rows="5"><?php echo $this->getEnteredData('message') ?></textarea> - </div> - </div> - <?php if($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow()): ?> - <div class="field choice rss"> - <input type="checkbox" name="rss_url" id="rss_url" value="1" title="<?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?>" class="checkbox" /> - <label class="label" for="rss_url"><span><?php echo __('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?></span></label> - </div> - <?php endif; ?> - </fieldset> - <div class="actions"> - <div class="primary"> - <button type="submit" title="<?php echo __('Share Wishlist') ?>" class="action submit"><span><?php echo __('Share Wishlist') ?></span></button> - </div> - <div class="secondary"> - <a class="action back" href="<?php echo $this->getBackUrl(); ?>"><span><?php echo __('Back')?></span></a></p> - </div> - </div> -</form> -<script type="text/javascript"> - (function($) { - head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", function() { - $('#form-validate').validation(); - }) - })(jQuery); -</script> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/sidebar.phtml b/app/design/frontend/magento_plushe/Magento_Wishlist/sidebar.phtml deleted file mode 100644 index 0925ab152d4..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/sidebar.phtml +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/* @var $this \Magento\Wishlist\Block\Customer\Sidebar */ -?> -<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> -<?php $imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image');?> -<div class="block wishlist"> - <div class="title"> - <strong><?php echo $this->getTitle(); ?></strong> - </div> - <div class="content"> - <strong class="subtitle"><?php echo __('Last Added Items') ?></strong> - <?php if ($this->hasWishlistItems()): ?> - <ol class="items minilist products" id="wishlist-sidebar"> - <?php $iterator = 1; ?> - <?php foreach ($this->getWishlistItems() as $_item): ?> - <?php $product = $_item->getProduct(); ?> - <?php echo ($iterator++==1) ? '<li class="item product">' : '</li><li class="item product">' ?> - <div class="product"> - <a class="product photo" href="<?php echo $this->getProductUrl($_item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"> - <?php echo $imageBlock->init($product, 'wishlist_sidebar_block')->toHtml() ?> - </a> - <div class="product details"> - <strong class="product name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->escapeHtml($product->getName()) ?></a></strong> - <?php echo $this->getPriceHtml($product, false, '-wishlist') ?> - <div class="product actions"> - <?php if ($product->isSaleable() && $product->isVisibleInSiteVisibility()): ?> - <div class="primary"><a href="<?php echo $this->getItemAddToCartUrl($_item) ?>" class="action tocart"><span><?php echo __('Add to Cart') ?></span></a></div> - <?php endif; ?> - <div class="secondary"> - <a href="<?php echo $this->getItemRemoveUrl($_item) ?>" title="<?php echo __('Remove This Item') ?>" onclick="return confirm('<?php echo __('Are you sure you would like to remove this item from the wishlist?') ?>');" class="action delete"> - <span><?php echo __('Remove This Item') ?></span> - </a> - </div> - </div> - </div> - </div> - <?php echo ($iterator==count($this->getWishlistItems())+1) ? '</li>' : '' ?> - <?php endforeach; ?> - </ol> - <div class="actions"> - <a class="action details" href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getListUrl() ?>"><span><?php echo __('Go to Wish List') ?></span></a> - </div> - <?php else: ?> - <p class="empty"><?php echo __('You have no items in your wish list.') ?></p> - <?php endif ?> - </div> -</div> -<?php endif ?> diff --git a/app/design/frontend/magento_plushe/Magento_Wishlist/view.phtml b/app/design/frontend/magento_plushe/Magento_Wishlist/view.phtml deleted file mode 100644 index dc803e1dc10..00000000000 --- a/app/design/frontend/magento_plushe/Magento_Wishlist/view.phtml +++ /dev/null @@ -1,81 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-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 design - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/* @var $this \Magento\Wishlist\Block\Customer\Wishlist */ -?> -<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?> - <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isRssAllow() && $this->hasWishlistItems()): ?> - <a href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="action rss wishlist"><span><?php echo __('RSS Feed') ?></span></a> - <?php endif; ?> - <form class="form wishlist items" id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post"> - <?php echo $this->getChildHtml('top'); ?> - <?php if ($this->hasWishlistItems()): ?> - <?php echo $this->getBlockHtml('formkey');?> - <?php $this->getChildBlock('items')->setItems($this->getWishlistItems()); ?> - <?php echo $this->getChildHtml('items');?> - <?php else: ?> - <p class="empty"><?php echo __('You have no items in your wish list.') ?></p> - <?php endif ?> - <?php echo $this->getChildHtml('bottom'); ?> - <div class="actions"> - <div class="primary"><?php echo $this->getChildHtml('control_buttons');?></div> - <div class="secondary"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="action back"><span><?php echo __('Back') ?></span></a></div> - </div> - </form> - <script id="form-tmpl" type="text/x-jQuery-tmpl"> - <form id="wishlist-hidden-form" method="post" action="${url}" class="no-display"> - {{if itemId}}<input name="item_id" value="${itemId}"/>{{/if}} - {{if wishlistId}}<input name="wishlist_id" value="${wishlistId}"/>{{/if}} - {{if qty}}<input name="qty" value="${qty}"/>{{/if}} - {{if item}}<input name="item" value="${item}"/>{{/if}} - {{if entity}}<input name="entity" value="${entity}"/>{{/if}} - </form> - </script> - <script> - (function($) { - head.js("<?php echo $this->getViewFileUrl('jquery/jquery.validate.js')?>", - "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation.js')?>", - "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", - "<?php echo $this->getViewFileUrl('Magento_Persistent::splitbutton.js') ?>", - "<?php echo $this->getViewFileUrl('Magento_Wishlist::wishlist.js')?>", function() { - $('#wishlist-view-form').wishlist({ - dataAttribute: 'item-id', - nameFormat: 'qty[{0}]', - btnRemoveSelector: '.action.delete', - qtySelector: '.qty', - addToCartSelector: '.action.tocart', - addAllToCartSelector: '.primary > .action.tocart', - commentInputType: 'textarea', - infoList: false, - addToCartUrl: '<?php echo $this->getItemAddToCartUrl('%item%');?>' , - confirmRemoveMessage: '<?php echo __('Are you sure you want to remove this product from your wishlist?') ?>', - addAllToCartUrl : '<?php echo $this->getUrl('*/*/allcart', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>', - commentString : '' - }); - $('body').splitButton(); - }); - })(jQuery); - </script> -<?php endif ?> diff --git a/app/design/frontend/magento_plushe/css/styles.css b/app/design/frontend/magento_plushe/css/styles.css index 593148c2520..fde4119c9a9 100644 --- a/app/design/frontend/magento_plushe/css/styles.css +++ b/app/design/frontend/magento_plushe/css/styles.css @@ -455,6 +455,7 @@ input[type="button"], .form.wishlist.share .action.save, .form.password.reset .action.save, .form.paypal.review .action.save, +.form.send.confirmation .action.save, .form.send.friend .action.submit, .form.address.edit .action.submit, .form.edit.account .action.submit, @@ -466,6 +467,7 @@ input[type="button"], .form.wishlist.share .action.submit, .form.password.reset .action.submit, .form.paypal.review .action.submit, +.form.send.confirmation .action.submit, .form.send.friend .action.add, .form.address.edit .action.add, .form.edit.account .action.add, @@ -477,12 +479,14 @@ input[type="button"], .form.wishlist.share .action.add, .form.password.reset .action.add, .form.paypal.review .action.add, -.form.search.advanced .action, -.form.orders.search .action, -.form.contact .action, +.form.send.confirmation .action.add, +.form.search.advanced .actions .action, +.form.orders.search .actions .action, +.form.contact .actions .action, .data.table.wishlist + .actions .primary .action.share, .data.table.wishlist + .actions .primary .action.update, .recurring.order.details > .actions .primary .action, +.form.send.confirmation .action.send, .action.myPrimary, input[type="submit"], input[type="button"], @@ -517,6 +521,7 @@ input[type="button"], .form.wishlist.share .action.save, .form.password.reset .action.save, .form.paypal.review .action.save, +.form.send.confirmation .action.save, .form.send.friend .action.submit, .form.address.edit .action.submit, .form.edit.account .action.submit, @@ -528,6 +533,7 @@ input[type="button"], .form.wishlist.share .action.submit, .form.password.reset .action.submit, .form.paypal.review .action.submit, +.form.send.confirmation .action.submit, .form.send.friend .action.add, .form.address.edit .action.add, .form.edit.account .action.add, @@ -539,12 +545,14 @@ input[type="button"], .form.wishlist.share .action.add, .form.password.reset .action.add, .form.paypal.review .action.add, -.form.search.advanced .action, -.form.orders.search .action, -.form.contact .action, +.form.send.confirmation .action.add, +.form.search.advanced .actions .action, +.form.orders.search .actions .action, +.form.contact .actions .action, .data.table.wishlist + .actions .primary .action.share, .data.table.wishlist + .actions .primary .action.update, -.recurring.order.details > .actions .primary .action { +.recurring.order.details > .actions .primary .action, +.form.send.confirmation .action.send { background-color: #da370a; color: #ffffff; } @@ -653,6 +661,9 @@ input[type="button"]:hover, .form.paypal.review .action.save:focus, .form.paypal.review .action.save:active, .form.paypal.review .action.save:hover, +.form.send.confirmation .action.save:focus, +.form.send.confirmation .action.save:active, +.form.send.confirmation .action.save:hover, .form.send.friend .action.submit:focus, .form.send.friend .action.submit:active, .form.send.friend .action.submit:hover, @@ -686,6 +697,9 @@ input[type="button"]:hover, .form.paypal.review .action.submit:focus, .form.paypal.review .action.submit:active, .form.paypal.review .action.submit:hover, +.form.send.confirmation .action.submit:focus, +.form.send.confirmation .action.submit:active, +.form.send.confirmation .action.submit:hover, .form.send.friend .action.add:focus, .form.send.friend .action.add:active, .form.send.friend .action.add:hover, @@ -719,15 +733,18 @@ input[type="button"]:hover, .form.paypal.review .action.add:focus, .form.paypal.review .action.add:active, .form.paypal.review .action.add:hover, -.form.search.advanced .action:focus, -.form.search.advanced .action:active, -.form.search.advanced .action:hover, -.form.orders.search .action:focus, -.form.orders.search .action:active, -.form.orders.search .action:hover, -.form.contact .action:focus, -.form.contact .action:active, -.form.contact .action:hover, +.form.send.confirmation .action.add:focus, +.form.send.confirmation .action.add:active, +.form.send.confirmation .action.add:hover, +.form.search.advanced .actions .action:focus, +.form.search.advanced .actions .action:active, +.form.search.advanced .actions .action:hover, +.form.orders.search .actions .action:focus, +.form.orders.search .actions .action:active, +.form.orders.search .actions .action:hover, +.form.contact .actions .action:focus, +.form.contact .actions .action:active, +.form.contact .actions .action:hover, .data.table.wishlist + .actions .primary .action.share:focus, .data.table.wishlist + .actions .primary .action.share:active, .data.table.wishlist + .actions .primary .action.share:hover, @@ -736,7 +753,10 @@ input[type="button"]:hover, .data.table.wishlist + .actions .primary .action.update:hover, .recurring.order.details > .actions .primary .action:focus, .recurring.order.details > .actions .primary .action:active, -.recurring.order.details > .actions .primary .action:hover { +.recurring.order.details > .actions .primary .action:hover, +.form.send.confirmation .action.send:focus, +.form.send.confirmation .action.send:active, +.form.send.confirmation .action.send:hover { background-color: #a92b08; } .secondary.action, @@ -749,6 +769,8 @@ input[type="reset"], .cart.actions .action.clear, .block.compare .action.compare, .data.comparison .cell.remove .action.delete, +.sidebar .minilist.products.items .action.tocart, +.find.orders .action.submit, .form.send.friend .actions > .primary .action.add, .paypal.review.view .actions .action.update, .shipping-tracking-popup .action.close, @@ -761,6 +783,8 @@ input[type="reset"], .cart.actions .action.clear, .block.compare .action.compare, .data.comparison .cell.remove .action.delete, +.sidebar .minilist.products.items .action.tocart, +.find.orders .action.submit, .form.send.friend .actions > .primary .action.add, .paypal.review.view .actions .action.update, .shipping-tracking-popup .action.close { @@ -797,6 +821,12 @@ input[type="reset"]:hover, .data.comparison .cell.remove .action.delete:focus, .data.comparison .cell.remove .action.delete:active, .data.comparison .cell.remove .action.delete:hover, +.sidebar .minilist.products.items .action.tocart:focus, +.sidebar .minilist.products.items .action.tocart:active, +.sidebar .minilist.products.items .action.tocart:hover, +.find.orders .action.submit:focus, +.find.orders .action.submit:active, +.find.orders .action.submit:hover, .form.send.friend .actions > .primary .action.add:focus, .form.send.friend .actions > .primary .action.add:active, .form.send.friend .actions > .primary .action.add:hover, @@ -865,6 +895,8 @@ input[type="reset"], .form.newsletter.manage .action.save, .block.compare .action.compare, .data.comparison .cell.remove .action.delete, +.sidebar .minilist.products.items .action.tocart, +.find.orders .action.submit, .action.tocart, .action.primary.customize, .action.primary.tocart, @@ -881,6 +913,7 @@ input[type="reset"], .form.wishlist.share .action.save, .form.password.reset .action.save, .form.paypal.review .action.save, +.form.send.confirmation .action.save, .form.send.friend .action.submit, .form.address.edit .action.submit, .form.edit.account .action.submit, @@ -892,6 +925,7 @@ input[type="reset"], .form.wishlist.share .action.submit, .form.password.reset .action.submit, .form.paypal.review .action.submit, +.form.send.confirmation .action.submit, .form.send.friend .action.add, .form.address.edit .action.add, .form.edit.account .action.add, @@ -903,15 +937,17 @@ input[type="reset"], .form.wishlist.share .action.add, .form.password.reset .action.add, .form.paypal.review .action.add, +.form.send.confirmation .action.add, .form.send.friend .actions > .primary .action.add, -.form.search.advanced .action, -.form.orders.search .action, -.form.contact .action, +.form.search.advanced .actions .action, +.form.orders.search .actions .action, +.form.contact .actions .action, .paypal.review.view .actions .action.update, .data.table.wishlist + .actions .primary .action.share, .data.table.wishlist + .actions .primary .action.update, .shipping-tracking-popup .action.close, -.recurring.order.details > .actions .primary .action { +.recurring.order.details > .actions .primary .action, +.form.send.confirmation .action.send { border: none; border-radius: 0; font: 600 14px/16px; @@ -2166,6 +2202,9 @@ ul.messages { .navigation:after { clear: both; } +.navigation:empty { + display: none; +} .navigation > ul > .level-top { display: inline-block; line-height: 1.2; @@ -2374,12 +2413,10 @@ ul.messages { margin-top: 0; } @media only screen and (max-width: 640px) { - html { - height: 100%; - min-width: 0; + html.opened { overflow: hidden; } - body { + body.opened { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; height: 100%; @@ -2388,6 +2425,8 @@ ul.messages { } body.opened .navigation { left: 0; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); } body.opened .page.wrapper { margin-right: -86%; @@ -2409,7 +2448,7 @@ ul.messages { left: -86%; height: 100%; background: #ffffff; - overflow-x: hidden; + overflow: auto; border-right: #b6b8af 1px solid; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; @@ -2426,19 +2465,19 @@ ul.messages { .navigation ul li.hidden { display: none; } - .navigation > ul { + .navigation .nav { -webkit-transition: left 0.3s linear 0; -moz-transition: left 0.3s linear 0; transition: left 0.3s linear 0; position: relative; overflow: hidden; } - .navigation > ul > .level-top { + .navigation .nav > .level-top { display: block; padding: 0; background: #ffffff; } - .navigation > ul > .level-top > a { + .navigation .nav > .level-top > a { display: block; padding: 10px 20px; text-transform: none; @@ -2448,28 +2487,31 @@ ul.messages { color: #675f55; text-align: left; } - .navigation > ul > .level-top > a:hover, - .navigation > ul > .level-top > a:visited { + .navigation .nav > .level-top > a:hover, + .navigation .nav > .level-top > a:visited { color: #675f55; } - .navigation > ul > .level-top > a:active { + .navigation .nav > .level-top > a:active { background: #dbdcd7; } - .navigation > ul > .level-top > a:after { + .navigation .nav > .level-top > a:after { border: 0; } - .navigation > ul > .level-top.parent:after { + .navigation .nav > .level-top > a span { + color: #675f55; + } + .navigation .nav > .level-top.parent:after { display: none; } - .navigation > ul > .level-top.parent > a { + .navigation .nav > .level-top.parent > a { position: relative; text-transform: none !important; } - .navigation > ul > .level-top.parent > a:after { + .navigation .nav > .level-top.parent > a:after { font-family: "icons"; - font-size: 18px; - line-height: 18px; - height: 18px; + font-size: 14px; + line-height: 14px; + height: 14px; margin: 0; overflow: hidden; content: "\e01a"; @@ -2481,16 +2523,16 @@ ul.messages { vertical-align: middle; text-align: center; } - .navigation > ul > .level-top.parent > a:after { + .navigation .nav > .level-top.parent > a:after { position: absolute; width: 18px; - top: 12px; + top: 15px; right: 17px; left: auto; opacity: 1; z-index: auto; } - .navigation > ul > .level-top.parent > .submenu { + .navigation .nav > .level-top.parent > .submenu { position: absolute; display: block; left: 100%; @@ -2502,18 +2544,18 @@ ul.messages { -moz-transition: left 0.3s ease-out 0; transition: left 0.3s ease-out 0; } - .navigation > ul > .level-top.parent > .submenu.opened { + .navigation .nav > .level-top.parent > .submenu.opened { left: 0; z-index: 3; } - .navigation > ul > .level-top.parent > .submenu > ul { + .navigation .nav > .level-top.parent > .submenu > ul { padding-top: 0; padding-bottom: 0; } - .navigation > ul > .level-top.parent > .submenu > ul li { + .navigation .nav > .level-top.parent > .submenu > ul li { margin: 0; } - .navigation > ul > .level-top.parent > .submenu > ul li > a { + .navigation .nav > .level-top.parent > .submenu > ul li > a { display: block; padding: 10px 20px; text-transform: none; @@ -2523,36 +2565,36 @@ ul.messages { color: #675f55; text-align: left; } - .navigation > ul > .level-top.parent > .submenu > ul li > a:hover, - .navigation > ul > .level-top.parent > .submenu > ul li > a:visited { + .navigation .nav > .level-top.parent > .submenu > ul li > a:hover, + .navigation .nav > .level-top.parent > .submenu > ul li > a:visited { color: #675f55; } - .navigation > ul > .level-top.parent > .submenu > ul li > a:active { + .navigation .nav > .level-top.parent > .submenu > ul li > a:active { background: #dbdcd7; } - .navigation > ul > .level-top.parent > .submenu > ul li > a:after { + .navigation .nav > .level-top.parent > .submenu > ul li > a:after { border: 0; } - .navigation > ul > .level-top.parent > .submenu > ul li.column { + .navigation .nav > .level-top.parent > .submenu > ul li.column { width: 100%; display: block; padding-right: 0; } - .navigation > ul > .level-top.parent > .submenu > ul .parent ul { + .navigation .nav > .level-top.parent > .submenu > ul .parent ul { padding-left: 0; } - .navigation .action.back a { + .navigation .nav .action.back a { background: #675f55; position: relative; color: #ffffff !important; - border-bottom-color: transparent; + border-bottom-color: transparent !important; cursor: pointer; } - .navigation .action.back a:before { + .navigation .nav .action.back a:before { font-family: "icons"; - font-size: 18px; - line-height: 18px; - height: 18px; + font-size: 14px; + line-height: 14px; + height: 14px; margin: 0; overflow: hidden; content: "\e01b"; @@ -2564,31 +2606,40 @@ ul.messages { vertical-align: middle; text-align: center; } - .navigation .action.back a:hover, - .navigation .action.back a:active, - .navigation .action.back a:visited { + .navigation .nav .action.back a:hover, + .navigation .nav .action.back a:active, + .navigation .nav .action.back a:visited { color: #ffffff !important; background: #675f55 !important; } - .navigation .action.back a:before { + .navigation .nav .action.back a:before { position: absolute; - top: 12px; + top: 15px; left: 3px; } - .navigation .action.back a span:before { + .navigation .nav .action.back a span:before { content: ""; } - .navigation .parent:after { + .navigation .nav .action.back.fixed { + position: fixed; + top: 0; + left: 0; + width: 86%; + z-index: 1; + -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); + box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); + } + .navigation .nav .parent:after { display: none; } - .navigation .parent > a { + .navigation .nav .parent > a { position: relative; } - .navigation .parent > a:after { + .navigation .nav .parent > a:after { font-family: "icons"; - font-size: 18px; - line-height: 18px; - height: 18px; + font-size: 14px; + line-height: 14px; + height: 14px; margin: 0; overflow: hidden; content: "\e01a"; @@ -2600,16 +2651,12 @@ ul.messages { vertical-align: middle; text-align: center; } - .navigation .parent > a:after { + .navigation .nav .parent > a:after { position: absolute; - width: 18px; - top: 16px; + top: 15px; right: 17px; - left: auto; - opacity: 1; - z-index: auto; } - .navigation .parent .submenu { + .navigation .nav .parent .submenu { position: absolute; display: block; left: 100%; @@ -2621,18 +2668,18 @@ ul.messages { -moz-transition: left 0.3s ease-out 0; transition: left 0.3s ease-out 0; } - .navigation .parent .submenu.opened { + .navigation .nav .parent .submenu.opened { left: 0; z-index: 3; } - .navigation .parent .submenu > ul { + .navigation .nav .parent .submenu > ul { padding-top: 0; padding-bottom: 0; } - .navigation .parent .submenu > ul li { + .navigation .nav .parent .submenu > ul li { margin: 0; } - .navigation .parent .submenu > ul li > a { + .navigation .nav .parent .submenu > ul li > a { display: block; padding: 10px 20px; text-transform: none; @@ -2642,47 +2689,135 @@ ul.messages { color: #675f55; text-align: left; } - .navigation .parent .submenu > ul li > a:hover, - .navigation .parent .submenu > ul li > a:visited { + .navigation .nav .parent .submenu > ul li > a:hover, + .navigation .nav .parent .submenu > ul li > a:visited { color: #675f55; } - .navigation .parent .submenu > ul li > a:active { + .navigation .nav .parent .submenu > ul li > a:active { background: #dbdcd7; } - .navigation .parent .submenu > ul li > a:after { + .navigation .nav .parent .submenu > ul li > a:after { border: 0; } - .navigation .parent .submenu > ul li.column { + .navigation .nav .parent .submenu > ul li.column { width: 100%; display: block; padding-right: 0; } - .navigation .parent .submenu > ul .parent ul { + .navigation .nav .parent .submenu > ul .parent ul { padding-left: 0; } - .action.toggle.nav { - margin-top: 19px; - position: absolute; - top: 0; - left: 20px; - font-size: 0; - width: 32px; + .navigation .account.links { + padding: 0; + margin: 0; + list-style-type: none; + list-style-image: none; + } + .navigation .account.links > li > a { + background: #f8f8f8; + padding: 10px 20px; + font-weight: 600; + } + .navigation .account.links a { + text-transform: capitalize; + position: relative; display: block; - line-height: 0; - white-space: nowrap; + padding: 10px; + cursor: pointer; + font-size: 18px; + border-bottom: 1px solid #e5e5e5; + font-weight: 400; + color: #675f55; + } + .navigation .account.links a:hover, + .navigation .account.links a:visited { + color: #675f55 !important; + } + .navigation .account.links a:active { + background: #dbdcd7 ; + } + .navigation .account.links .link.compare { + display: none; + } + .navigation .account.links .customer.welcome { + display: block !important; + background: #f8f8f8; + padding: 0 10px; + border-bottom: 1px solid #e5e5e5; + } + .navigation .account.links .customer.welcome .customer.name { + position: relative; + display: block; + padding: 10px; + cursor: pointer; + font-size: 18px; + font-weight: 600; + } + .navigation .account.links .customer.welcome .customer.name:after { + font-family: "icons"; + font-size: 16px; + line-height: 16px; + height: 16px; + margin: 0; + overflow: hidden; + content: "\e00d"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; vertical-align: middle; text-align: center; - text-indent: -999em; + } + .navigation .account.links .customer.welcome .customer.name:after { + position: absolute; + top: 10px; + right: 7px; + } + .navigation .account.links .customer.welcome .customer.name.active:after { + content: "\e011"; + } + .navigation .account.links .customer.welcome .menu { + margin: 0; + padding: 0; + display: none; + } + .navigation .account.links .customer.welcome .menu > ul { + margin: 0; + padding: 0; + position: relative; + float: none; + border: none; + background: #ffffff; + } + .navigation .account.links .customer.welcome .menu > ul li { + margin: 0; + } + .navigation .account.links .customer.welcome.active { + border-bottom-color: transparent; + } + .navigation .account.links .customer.welcome.active .menu { + display: block; + } + .navigation .settings.panel { + border-bottom: 1px solid #e5e5e5; + background: #f8f8f8; + } + .navigation .settings.panel > .title { + font-weight: 600; + position: relative; + padding: 10px 20px; cursor: pointer; + font-size: 18px; } - .action.toggle.nav:after { + .navigation .settings.panel > .title:after { font-family: "icons"; - font-size: 32px; - line-height: 32px; - height: 32px; + font-size: 16px; + line-height: 16px; + height: 16px; margin: 0; overflow: hidden; - content: "\e007"; + content: "\e00d"; font-style: normal; speak: none; font-weight: normal; @@ -2691,35 +2826,97 @@ ul.messages { vertical-align: middle; text-align: center; } - .action.toggle.nav:active { - outline: 0; + .navigation .settings.panel > .title:after { + position: absolute; + top: 10px; + right: 17px; } - .action.toggle.nav:after { - text-indent: 0; + .navigation .settings.panel > .content { + display: none; + margin: 0 10px 10px; + background: #ffffff; + border-bottom: 1px solid #e5e5e5; + } + .navigation .settings.panel > .content .switcher { + padding: 10px 10px 15px; + display: block; + } + .navigation .settings.panel > .content .switcher:first-child { + padding-bottom: 0; + } + .navigation .settings.panel > .content .switcher .label { + font-weight: 400; + color: #675f55; + font-size: 16px; + display: block; + padding-bottom: 5px; + } + .navigation .settings.panel > .content .switcher .options { + display: block; + } + .navigation .settings.panel > .content .switcher .options strong { + color: #675f55; display: block; + position: relative; + padding: 10px 40px 10px 20px; + cursor: pointer; + font-size: 16px; + } + .navigation .settings.panel > .content .switcher .options strong:after { + font-family: "icons"; + font-size: 16px; + line-height: 16px; + height: 16px; margin: 0; + overflow: hidden; + content: "\e00d"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + vertical-align: middle; + text-align: center; } - .action.toggle.nav:before { + .navigation .settings.panel > .content .switcher .options strong:after { position: absolute; - width: 100%; - height: 100%; - left: -100%; - top: -20px; - padding: 20px 0; - content: ""; + top: 10px; + right: 17px; } - .active-nav .action.toggle.nav:before { - position: fixed; - padding: 0; - left: 86%; - right: 0; - top: 0; - bottom: 0; + .navigation .settings.panel > .content .switcher .options button { + display: none; } - .header { + .navigation .settings.panel > .content .switcher .options ul { + display: none; + position: static; + margin: 0 10px 10px; padding: 0; - position: relative; - margin-bottom: 35px; + border: 0; + min-width: 0; + float: none; + background: none; + color: #675f55; + font-size: 16px; + } + .navigation .settings.panel > .content .switcher .options ul li { + margin: 0; + padding: 10px 20px; + border-bottom: 1px solid #e5e5e5; + } + .navigation .settings.panel > .content .switcher .options ul li a { + color: #675f55; + } + .navigation .settings.panel > .content .switcher .options.active ul { + display: block; + } + .navigation .settings.panel > .content .switcher .options.active strong:after { + content: "\e011"; + } + .navigation .settings.panel.active > .content { + display: block; + } + .navigation .settings.panel.active > .title:after { + content: "\e011"; } } @media only screen and (max-width: 99999px) { @@ -3720,14 +3917,14 @@ ul.messages { padding: 20px; position: relative; } -.popup .close { +.popup > .close { color: #999999; cursor: pointer; position: absolute; right: 5px; top: 3px; } -.popup .close:before { +.popup > .close:before { font-family: "icons"; font-size: 12px; line-height: 12px; @@ -3743,7 +3940,7 @@ ul.messages { vertical-align: middle; text-align: center; } -.popup .close:hover { +.popup > .close:hover { color: #675f55; } .fade .popup { @@ -4272,13 +4469,11 @@ body { padding-right: 0; } @media only screen and (max-width: 640px) { - .navigation > ul { + .navigation > ul, + .navigation > ul > .level0 > .submenu > ul.level0 { min-width: 100%; max-width: 100%; } - .action.toggle.nav { - top: 100%; - } } /* General block @@ -4391,6 +4586,9 @@ body { .footer .bugs a { font-weight: bold; } +.footer .switcher-store { + margin-bottom: 30px; +} /* Switchers -------------------------------------- */ @@ -5203,6 +5401,9 @@ body { margin-right: 5px; vertical-align: middle; } +.action.toggle.checkout.progress { + display: none; +} .opc.loading .active { position: relative; z-index: 1; @@ -6292,6 +6493,9 @@ body { .checkout.methods.items .action.multicheckout { text-decoration: underline; } +.page.title .checkout.methods.items { + display: none; +} /* Magento_Checkout Mini cart @@ -7103,7 +7307,7 @@ body { .form.newsletter.manage .fieldset .legend { float: left; margin: 0 0 20px; - font-weight: 600; + font-weight: 200; } .form.newsletter.manage .fieldset .legend + br { display: block; @@ -7121,6 +7325,58 @@ body { list-style-type: none; list-style-image: none; } +.widget.static.block { + *zoom: 1; +} +.widget.static.block:before, +.widget.static.block:after { + content: ""; + display: table; +} +.widget.static.block:after { + clear: both; +} +.header .widget.static.block, +.footer .widget.static.block { + display: inline-block; +} +.product.info.main + .widget.link, +.product.info.main + .widget.static.block, +.product.info.detailed + .widget.link, +.product.info.detailed + .widget.static.block, +.block.search + .widget.link, +.block.search + .widget.static.block { + clear: both; +} +.footer .links span.widget.link, +.footer .links .widget.static.block { + margin-left: 3px; + white-space: normal; +} +.footer .links span.widget.link:before, +.footer .links .widget.static.block:before { + content: ' | '; + display: inline-block; + margin-right: 3px; +} +.minicart.wrapper .block.minicart > .content .widget.link, +.minicart.wrapper .block.minicart > .content .widget.static.block { + clear: right; + float: right; + margin: 0 -330px 15px 0; + text-align: left; + width: 310px; +} +.minicart.wrapper .block.minicart > .content .actions .widget.link, +.minicart.wrapper .block.minicart > .content .actions .widget.static.block { + margin-right: 0; +} +.widget.link + .product.info.detailed { + margin-top: 20px; +} +span.widget.link { + display: inline-block; +} /* Magento_Catalog Compare @@ -7429,8 +7685,17 @@ body { visibility: visible; } .block.crosssell .products.list.items.crosssell { + *zoom: 1; margin: 0 -13px; } +.block.crosssell .products.list.items.crosssell:before, +.block.crosssell .products.list.items.crosssell:after { + content: ""; + display: table; +} +.block.crosssell .products.list.items.crosssell:after { + clear: both; +} .block.crosssell .products.list.items.crosssell .item.product { float: left; width: 16.666666666666664%; @@ -7530,35 +7795,104 @@ body { float: none; display: inline-block; } -.product.info.detailed + .block.upsell, -.product.info.detailed + .block.related { - margin-top: 70px; - clear: none; - float: right; - width: 140px; - border-top: 0; +.sidebar .block.widget.viewed, +.sidebar .block.crosssell, +.sidebar .block.upsell, +.sidebar .block.related, +.sidebar .block.widget.new, +.sidebar .block.widget.compared { + border: 0; padding-top: 0; - padding-left: 25px; - border-left: 1px solid #e5e5e5; } -.product.info.detailed + .block.upsell .products.list, -.product.info.detailed + .block.related .products.list { +.sidebar .minilist.products.items { margin: 0; } -.product.info.detailed + .block.upsell .products.list .item.product, -.product.info.detailed + .block.related .products.list .item.product { - display: block; - width: auto; - padding: 13px 0; +.sidebar .minilist.products.items .item.product { + margin: 0 0 20px; + padding: 0; + position: relative; + width: 100%; } -.product.info.detailed + .block.upsell .products.list .item.product .product.photo, -.product.info.detailed + .block.related .products.list .item.product .product.photo { - float: none; - display: block; - margin: 0 0 10px; +.sidebar .minilist.products.items .item.product .product.actions { + visibility: hidden; } -.block.widget .pager { - float: right; +.sidebar .minilist.products.items .item.product:hover .product.actions { + visibility: visible; +} +.sidebar .minilist.products.items .product.details { + overflow: hidden; + padding-bottom: 40px; +} +.sidebar .minilist.products.items .product.photo { + float: left; + margin: 0 10px 10px 0; +} +.sidebar .minilist.products.items .product.name { + overflow: hidden; +} +.sidebar .minilist.products.items .actions { + bottom: 0; + left: 0; + position: absolute; +} +.sidebar .minilist.products.items .action.tocart { + padding: 5px 11px; + display: inline-block; +} +.block.widget.photos { + margin: 0 0 30px; +} +.block.widget.photos .items { + list-style: none; + *zoom: 1; + margin: 0; + padding: 0; +} +.block.widget.photos .items:before, +.block.widget.photos .items:after { + content: ""; + display: table; +} +.block.widget.photos .items:after { + clear: both; +} +.block.widget.photos .item { + float: left; + margin: 0 3px 3px 0; + padding: 0; +} +.block.widget.photos .product.photo { + margin-right: 0; +} +.product.info.detailed + .block.upsell, +.product.info.detailed + .block.related { + margin-top: 70px; + clear: none; + float: right; + width: 140px; + border-top: 0; + padding-top: 0; + padding-left: 25px; + border-left: 1px solid #e5e5e5; +} +.product.info.detailed + .block.upsell .products.list, +.product.info.detailed + .block.related .products.list { + margin: 0; +} +.product.info.detailed + .block.upsell .products.list .item.product, +.product.info.detailed + .block.related .products.list .item.product { + display: block; + width: auto; + padding: 13px 0; +} +.product.info.detailed + .block.upsell .products.list .item.product .product.photo, +.product.info.detailed + .block.related .products.list .item.product .product.photo { + float: none; + display: block; + margin: 0 0 10px; +} +.block.widget .pager { + float: right; } .block.widget .pager .amount { float: left; @@ -7665,6 +7999,16 @@ body { .block.widget .action.previous span:after { content: "\e017"; } +.find.orders .label { + display: block; + margin: 0 0 3px; +} +.find.orders .control { + margin: 0 0 10px; +} +.find.orders .action.submit { + padding: 5px 11px; +} /* Magento_Catalog Layered Navigation @@ -8329,6 +8673,10 @@ body { float: left; margin-right: 15px; } +.product.info.main .product.alert { + font-size: 12px; + margin: 5px 0; +} .product.main.info .product.options.wrapper .field { margin: 0 0 10px; -moz-box-sizing: border-box; @@ -9290,6 +9638,15 @@ img[align="right"] { padding-right: 10px; text-align: right; } +.form.login .field.persistent .link.tip, +.step.login .field.persistent .link.tip { + display: inline-block; + padding-top: 7px; +} +.form.login .field.persistent .checkbox, +.step.login .field.persistent .checkbox { + margin-top: 10px; +} .action.reload { border: none; border-radius: 0; @@ -9351,7 +9708,8 @@ img[align="right"] { .form.create.account .fieldset, .form.wishlist.share .fieldset, .form.password.reset .fieldset, -.form.paypal.review .fieldset { +.form.paypal.review .fieldset, +.form.send.confirmation .fieldset { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; @@ -9378,7 +9736,8 @@ img[align="right"] { .form.create.account .fieldset .field, .form.wishlist.share .fieldset .field, .form.password.reset .fieldset .field, -.form.paypal.review .fieldset .field { +.form.paypal.review .fieldset .field, +.form.send.confirmation .fieldset .field { display: inline-block; padding-right: 20px; vertical-align: top; @@ -9394,7 +9753,8 @@ img[align="right"] { .form.create.account .fieldset .nested .field, .form.wishlist.share .fieldset .nested .field, .form.password.reset .fieldset .nested .field, -.form.paypal.review .fieldset .nested .field { +.form.paypal.review .fieldset .nested .field, +.form.send.confirmation .fieldset .nested .field { width: 100%; } .form.send.friend .fieldset .actions, @@ -9407,7 +9767,8 @@ img[align="right"] { .form.create.account .fieldset .actions, .form.wishlist.share .fieldset .actions, .form.password.reset .fieldset .actions, -.form.paypal.review .fieldset .actions { +.form.paypal.review .fieldset .actions, +.form.send.confirmation .fieldset .actions { margin-right: 30px; } .form.send.friend .fieldset > *, @@ -9420,7 +9781,8 @@ img[align="right"] { .form.create.account .fieldset > *, .form.wishlist.share .fieldset > *, .form.password.reset .fieldset > *, -.form.paypal.review .fieldset > * { +.form.paypal.review .fieldset > *, +.form.send.confirmation .fieldset > * { letter-spacing: normal; word-spacing: normal; } @@ -9434,7 +9796,8 @@ img[align="right"] { .form.create.account .fieldset > .legend, .form.wishlist.share .fieldset > .legend, .form.password.reset .fieldset > .legend, -.form.paypal.review .fieldset > .legend { +.form.paypal.review .fieldset > .legend, +.form.send.confirmation .fieldset > .legend { float: left; font: 400 20px/1.2 "sourcesanspro"; margin: -30px 30px 50px -30px; @@ -9450,7 +9813,8 @@ img[align="right"] { .form.create.account .fieldset > .legend + br, .form.wishlist.share .fieldset > .legend + br, .form.password.reset .fieldset > .legend + br, -.form.paypal.review .fieldset > .legend + br { +.form.paypal.review .fieldset > .legend + br, +.form.send.confirmation .fieldset > .legend + br { display: block; *zoom: 1; } @@ -9465,6 +9829,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .legend + br:before, .form.password.reset .fieldset > .legend + br:before, .form.paypal.review .fieldset > .legend + br:before, +.form.send.confirmation .fieldset > .legend + br:before, .form.send.friend .fieldset > .legend + br:after, .form.address.edit .fieldset > .legend + br:after, .form.edit.account .fieldset > .legend + br:after, @@ -9475,7 +9840,8 @@ img[align="right"] { .form.create.account .fieldset > .legend + br:after, .form.wishlist.share .fieldset > .legend + br:after, .form.password.reset .fieldset > .legend + br:after, -.form.paypal.review .fieldset > .legend + br:after { +.form.paypal.review .fieldset > .legend + br:after, +.form.send.confirmation .fieldset > .legend + br:after { content: ""; display: table; } @@ -9489,7 +9855,8 @@ img[align="right"] { .form.create.account .fieldset > .legend + br:after, .form.wishlist.share .fieldset > .legend + br:after, .form.password.reset .fieldset > .legend + br:after, -.form.paypal.review .fieldset > .legend + br:after { +.form.paypal.review .fieldset > .legend + br:after, +.form.send.confirmation .fieldset > .legend + br:after { clear: both; } .form.send.friend .fieldset .legend, @@ -9502,7 +9869,8 @@ img[align="right"] { .form.create.account .fieldset .legend, .form.wishlist.share .fieldset .legend, .form.password.reset .fieldset .legend, -.form.paypal.review .fieldset .legend { +.form.paypal.review .fieldset .legend, +.form.send.confirmation .fieldset .legend { float: left; line-height: 1.2; font-size: 20px; @@ -9523,7 +9891,8 @@ img[align="right"] { .form.create.account .fieldset .legend + br, .form.wishlist.share .fieldset .legend + br, .form.password.reset .fieldset .legend + br, -.form.paypal.review .fieldset .legend + br { +.form.paypal.review .fieldset .legend + br, +.form.send.confirmation .fieldset .legend + br { display: block; clear: both; } @@ -9537,7 +9906,8 @@ img[align="right"] { .form.create.account .fieldset > .field, .form.wishlist.share .fieldset > .field, .form.password.reset .fieldset > .field, -.form.paypal.review .fieldset > .field { +.form.paypal.review .fieldset > .field, +.form.send.confirmation .fieldset > .field { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; @@ -9556,7 +9926,8 @@ img[align="right"] { .form.create.account .fieldset > .field > .label, .form.wishlist.share .fieldset > .field > .label, .form.password.reset .fieldset > .field > .label, -.form.paypal.review .fieldset > .field > .label { +.form.paypal.review .fieldset > .field > .label, +.form.send.confirmation .fieldset > .field > .label { display: block; padding-bottom: 5px; } @@ -9570,7 +9941,8 @@ img[align="right"] { .form.create.account .fieldset > .field .nested .field, .form.wishlist.share .fieldset > .field .nested .field, .form.password.reset .fieldset > .field .nested .field, -.form.paypal.review .fieldset > .field .nested .field { +.form.paypal.review .fieldset > .field .nested .field, +.form.send.confirmation .fieldset > .field .nested .field { margin: 5px 0; } .form.send.friend .fieldset > .field.choice > .control, @@ -9583,7 +9955,8 @@ img[align="right"] { .form.create.account .fieldset > .field.choice > .control, .form.wishlist.share .fieldset > .field.choice > .control, .form.password.reset .fieldset > .field.choice > .control, -.form.paypal.review .fieldset > .field.choice > .control { +.form.paypal.review .fieldset > .field.choice > .control, +.form.send.confirmation .fieldset > .field.choice > .control { width: auto; } .form.send.friend .fieldset > .field.choice > .label, @@ -9596,7 +9969,8 @@ img[align="right"] { .form.create.account .fieldset > .field.choice > .label, .form.wishlist.share .fieldset > .field.choice > .label, .form.password.reset .fieldset > .field.choice > .label, -.form.paypal.review .fieldset > .field.choice > .label { +.form.paypal.review .fieldset > .field.choice > .label, +.form.send.confirmation .fieldset > .field.choice > .label { display: inline; } .form.send.friend .fieldset > .field.choice > input, @@ -9609,7 +9983,8 @@ img[align="right"] { .form.create.account .fieldset > .field.choice > input, .form.wishlist.share .fieldset > .field.choice > input, .form.password.reset .fieldset > .field.choice > input, -.form.paypal.review .fieldset > .field.choice > input { +.form.paypal.review .fieldset > .field.choice > input, +.form.send.confirmation .fieldset > .field.choice > input { vertical-align: top; margin-top: 2px; margin-right: 5px; @@ -9624,7 +9999,8 @@ img[align="right"] { .form.create.account .fieldset > .field.required > .label > span:first-child:after, .form.wishlist.share .fieldset > .field.required > .label > span:first-child:after, .form.password.reset .fieldset > .field.required > .label > span:first-child:after, -.form.paypal.review .fieldset > .field.required > .label > span:first-child:after { +.form.paypal.review .fieldset > .field.required > .label > span:first-child:after, +.form.send.confirmation .fieldset > .field.required > .label > span:first-child:after { content: '*'; color: #da370a; } @@ -9638,7 +10014,8 @@ img[align="right"] { .form.create.account .fieldset > .field .addon, .form.wishlist.share .fieldset > .field .addon, .form.password.reset .fieldset > .field .addon, -.form.paypal.review .fieldset > .field .addon { +.form.paypal.review .fieldset > .field .addon, +.form.send.confirmation .fieldset > .field .addon { display: table; padding: 0; width: 100%; @@ -9654,6 +10031,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field .addon textarea, .form.password.reset .fieldset > .field .addon textarea, .form.paypal.review .fieldset > .field .addon textarea, +.form.send.confirmation .fieldset > .field .addon textarea, .form.send.friend .fieldset > .field .addon select, .form.address.edit .fieldset > .field .addon select, .form.edit.account .fieldset > .field .addon select, @@ -9665,6 +10043,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field .addon select, .form.password.reset .fieldset > .field .addon select, .form.paypal.review .fieldset > .field .addon select, +.form.send.confirmation .fieldset > .field .addon select, .form.send.friend .fieldset > .field .addon input, .form.address.edit .fieldset > .field .addon input, .form.edit.account .fieldset > .field .addon input, @@ -9675,7 +10054,8 @@ img[align="right"] { .form.create.account .fieldset > .field .addon input, .form.wishlist.share .fieldset > .field .addon input, .form.password.reset .fieldset > .field .addon input, -.form.paypal.review .fieldset > .field .addon input { +.form.paypal.review .fieldset > .field .addon input, +.form.send.confirmation .fieldset > .field .addon input { box-shadow: none; display: table-cell; margin: 0; @@ -9692,6 +10072,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field .addon .addbefore, .form.password.reset .fieldset > .field .addon .addbefore, .form.paypal.review .fieldset > .field .addon .addbefore, +.form.send.confirmation .fieldset > .field .addon .addbefore, .form.send.friend .fieldset > .field .addon .addafter, .form.address.edit .fieldset > .field .addon .addafter, .form.edit.account .fieldset > .field .addon .addafter, @@ -9702,7 +10083,8 @@ img[align="right"] { .form.create.account .fieldset > .field .addon .addafter, .form.wishlist.share .fieldset > .field .addon .addafter, .form.password.reset .fieldset > .field .addon .addafter, -.form.paypal.review .fieldset > .field .addon .addafter { +.form.paypal.review .fieldset > .field .addon .addafter, +.form.send.confirmation .fieldset > .field .addon .addafter { height: 0; white-space: nowrap; display: inline-block; @@ -9736,6 +10118,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field .addon .addbefore:focus, .form.password.reset .fieldset > .field .addon .addbefore:focus, .form.paypal.review .fieldset > .field .addon .addbefore:focus, +.form.send.confirmation .fieldset > .field .addon .addbefore:focus, .form.send.friend .fieldset > .field .addon .addafter:focus, .form.address.edit .fieldset > .field .addon .addafter:focus, .form.edit.account .fieldset > .field .addon .addafter:focus, @@ -9746,7 +10129,8 @@ img[align="right"] { .form.create.account .fieldset > .field .addon .addafter:focus, .form.wishlist.share .fieldset > .field .addon .addafter:focus, .form.password.reset .fieldset > .field .addon .addafter:focus, -.form.paypal.review .fieldset > .field .addon .addafter:focus { +.form.paypal.review .fieldset > .field .addon .addafter:focus, +.form.send.confirmation .fieldset > .field .addon .addafter:focus { border-color: #999999; } .control .form.send.friend .fieldset > .field .addon .addbefore, @@ -9760,6 +10144,7 @@ img[align="right"] { .control .form.wishlist.share .fieldset > .field .addon .addbefore, .control .form.password.reset .fieldset > .field .addon .addbefore, .control .form.paypal.review .fieldset > .field .addon .addbefore, +.control .form.send.confirmation .fieldset > .field .addon .addbefore, .control .form.send.friend .fieldset > .field .addon .addafter, .control .form.address.edit .fieldset > .field .addon .addafter, .control .form.edit.account .fieldset > .field .addon .addafter, @@ -9770,7 +10155,8 @@ img[align="right"] { .control .form.create.account .fieldset > .field .addon .addafter, .control .form.wishlist.share .fieldset > .field .addon .addafter, .control .form.password.reset .fieldset > .field .addon .addafter, -.control .form.paypal.review .fieldset > .field .addon .addafter { +.control .form.paypal.review .fieldset > .field .addon .addafter, +.control .form.send.confirmation .fieldset > .field .addon .addafter { width: 100%; } .form.send.friend .fieldset > .field .addon .addbefore:disabled, @@ -9784,6 +10170,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field .addon .addbefore:disabled, .form.password.reset .fieldset > .field .addon .addbefore:disabled, .form.paypal.review .fieldset > .field .addon .addbefore:disabled, +.form.send.confirmation .fieldset > .field .addon .addbefore:disabled, .form.send.friend .fieldset > .field .addon .addafter:disabled, .form.address.edit .fieldset > .field .addon .addafter:disabled, .form.edit.account .fieldset > .field .addon .addafter:disabled, @@ -9794,7 +10181,8 @@ img[align="right"] { .form.create.account .fieldset > .field .addon .addafter:disabled, .form.wishlist.share .fieldset > .field .addon .addafter:disabled, .form.password.reset .fieldset > .field .addon .addafter:disabled, -.form.paypal.review .fieldset > .field .addon .addafter:disabled { +.form.paypal.review .fieldset > .field .addon .addafter:disabled, +.form.send.confirmation .fieldset > .field .addon .addafter:disabled { opacity: 0.5; } .form.send.friend .fieldset > .field .addon .addbefore::-webkit-input-placeholder, @@ -9808,6 +10196,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field .addon .addbefore::-webkit-input-placeholder, .form.password.reset .fieldset > .field .addon .addbefore::-webkit-input-placeholder, .form.paypal.review .fieldset > .field .addon .addbefore::-webkit-input-placeholder, +.form.send.confirmation .fieldset > .field .addon .addbefore::-webkit-input-placeholder, .form.send.friend .fieldset > .field .addon .addafter::-webkit-input-placeholder, .form.address.edit .fieldset > .field .addon .addafter::-webkit-input-placeholder, .form.edit.account .fieldset > .field .addon .addafter::-webkit-input-placeholder, @@ -9818,7 +10207,8 @@ img[align="right"] { .form.create.account .fieldset > .field .addon .addafter::-webkit-input-placeholder, .form.wishlist.share .fieldset > .field .addon .addafter::-webkit-input-placeholder, .form.password.reset .fieldset > .field .addon .addafter::-webkit-input-placeholder, -.form.paypal.review .fieldset > .field .addon .addafter::-webkit-input-placeholder { +.form.paypal.review .fieldset > .field .addon .addafter::-webkit-input-placeholder, +.form.send.confirmation .fieldset > .field .addon .addafter::-webkit-input-placeholder { line-height: 1.333; } .form.send.friend .fieldset > .field .addon .addbefore:-ms-input-placeholder, @@ -9832,6 +10222,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field .addon .addbefore:-ms-input-placeholder, .form.password.reset .fieldset > .field .addon .addbefore:-ms-input-placeholder, .form.paypal.review .fieldset > .field .addon .addbefore:-ms-input-placeholder, +.form.send.confirmation .fieldset > .field .addon .addbefore:-ms-input-placeholder, .form.send.friend .fieldset > .field .addon .addafter:-ms-input-placeholder, .form.address.edit .fieldset > .field .addon .addafter:-ms-input-placeholder, .form.edit.account .fieldset > .field .addon .addafter:-ms-input-placeholder, @@ -9842,7 +10233,8 @@ img[align="right"] { .form.create.account .fieldset > .field .addon .addafter:-ms-input-placeholder, .form.wishlist.share .fieldset > .field .addon .addafter:-ms-input-placeholder, .form.password.reset .fieldset > .field .addon .addafter:-ms-input-placeholder, -.form.paypal.review .fieldset > .field .addon .addafter:-ms-input-placeholder { +.form.paypal.review .fieldset > .field .addon .addafter:-ms-input-placeholder, +.form.send.confirmation .fieldset > .field .addon .addafter:-ms-input-placeholder { line-height: 1.333; } .eq-ie8 .form.send.friend .fieldset > .field .addon .addbefore, @@ -9856,6 +10248,7 @@ img[align="right"] { .eq-ie8 .form.wishlist.share .fieldset > .field .addon .addbefore, .eq-ie8 .form.password.reset .fieldset > .field .addon .addbefore, .eq-ie8 .form.paypal.review .fieldset > .field .addon .addbefore, +.eq-ie8 .form.send.confirmation .fieldset > .field .addon .addbefore, .eq-ie8 .form.send.friend .fieldset > .field .addon .addafter, .eq-ie8 .form.address.edit .fieldset > .field .addon .addafter, .eq-ie8 .form.edit.account .fieldset > .field .addon .addafter, @@ -9866,7 +10259,8 @@ img[align="right"] { .eq-ie8 .form.create.account .fieldset > .field .addon .addafter, .eq-ie8 .form.wishlist.share .fieldset > .field .addon .addafter, .eq-ie8 .form.password.reset .fieldset > .field .addon .addafter, -.eq-ie8 .form.paypal.review .fieldset > .field .addon .addafter { +.eq-ie8 .form.paypal.review .fieldset > .field .addon .addafter, +.eq-ie8 .form.send.confirmation .fieldset > .field .addon .addafter { padding-top: 8px; } .form.send.friend .fieldset > .field .note, @@ -9879,7 +10273,8 @@ img[align="right"] { .form.create.account .fieldset > .field .note, .form.wishlist.share .fieldset > .field .note, .form.password.reset .fieldset > .field .note, -.form.paypal.review .fieldset > .field .note { +.form.paypal.review .fieldset > .field .note, +.form.send.confirmation .fieldset > .field .note { font-size: 12px; margin-top: 3px; padding-left: 15px; @@ -9894,7 +10289,8 @@ img[align="right"] { .form.create.account .fieldset > .field .note:before, .form.wishlist.share .fieldset > .field .note:before, .form.password.reset .fieldset > .field .note:before, -.form.paypal.review .fieldset > .field .note:before { +.form.paypal.review .fieldset > .field .note:before, +.form.send.confirmation .fieldset > .field .note:before { border-bottom: 5px solid #675f55; border-left: 5px solid transparent; border-right: 5px solid transparent; @@ -9917,7 +10313,8 @@ img[align="right"] { .form.create.account .fieldset > .field:last-child, .form.wishlist.share .fieldset > .field:last-child, .form.password.reset .fieldset > .field:last-child, -.form.paypal.review .fieldset > .field:last-child { +.form.paypal.review .fieldset > .field:last-child, +.form.send.confirmation .fieldset > .field:last-child { margin-bottom: 0; } .form.send.friend .fieldset > .field .nested, @@ -9930,7 +10327,8 @@ img[align="right"] { .form.create.account .fieldset > .field .nested, .form.wishlist.share .fieldset > .field .nested, .form.password.reset .fieldset > .field .nested, -.form.paypal.review .fieldset > .field .nested { +.form.paypal.review .fieldset > .field .nested, +.form.send.confirmation .fieldset > .field .nested { padding: 0 0 0; } .form.send.friend .fieldset > .field .nested .field, @@ -9943,7 +10341,8 @@ img[align="right"] { .form.create.account .fieldset > .field .nested .field, .form.wishlist.share .fieldset > .field .nested .field, .form.password.reset .fieldset > .field .nested .field, -.form.paypal.review .fieldset > .field .nested .field { +.form.paypal.review .fieldset > .field .nested .field, +.form.send.confirmation .fieldset > .field .nested .field { margin: 5px 0; } .form.send.friend .fieldset > .field > .label, @@ -9956,7 +10355,8 @@ img[align="right"] { .form.create.account .fieldset > .field > .label, .form.wishlist.share .fieldset > .field > .label, .form.password.reset .fieldset > .field > .label, -.form.paypal.review .fieldset > .field > .label { +.form.paypal.review .fieldset > .field > .label, +.form.send.confirmation .fieldset > .field > .label { display: block; padding: 0 0 5px; } @@ -9971,6 +10371,7 @@ img[align="right"] { .form.wishlist.share .fieldset > .field.note, .form.password.reset .fieldset > .field.note, .form.paypal.review .fieldset > .field.note, +.form.send.confirmation .fieldset > .field.note, .form.send.friend .fieldset .field.street, .form.address.edit .fieldset .field.street, .form.edit.account .fieldset .field.street, @@ -9982,6 +10383,7 @@ img[align="right"] { .form.wishlist.share .fieldset .field.street, .form.password.reset .fieldset .field.street, .form.paypal.review .fieldset .field.street, +.form.send.confirmation .fieldset .field.street, .form.send.friend .fieldset .field.choice.newsletter, .form.address.edit .fieldset .field.choice.newsletter, .form.edit.account .fieldset .field.choice.newsletter, @@ -9992,7 +10394,8 @@ img[align="right"] { .form.create.account .fieldset .field.choice.newsletter, .form.wishlist.share .fieldset .field.choice.newsletter, .form.password.reset .fieldset .field.choice.newsletter, -.form.paypal.review .fieldset .field.choice.newsletter { +.form.paypal.review .fieldset .field.choice.newsletter, +.form.send.confirmation .fieldset .field.choice.newsletter { width: 100%; } .form.send.friend .fieldset .field.fullname, @@ -10005,7 +10408,8 @@ img[align="right"] { .form.create.account .fieldset .field.fullname, .form.wishlist.share .fieldset .field.fullname, .form.password.reset .fieldset .field.fullname, -.form.paypal.review .fieldset .field.fullname { +.form.paypal.review .fieldset .field.fullname, +.form.send.confirmation .fieldset .field.fullname { width: 100%; } .form.send.friend .fieldset .field.fullname .fields.group-5 .field, @@ -10018,7 +10422,8 @@ img[align="right"] { .form.create.account .fieldset .field.fullname .fields.group-5 .field, .form.wishlist.share .fieldset .field.fullname .fields.group-5 .field, .form.password.reset .fieldset .field.fullname .fields.group-5 .field, -.form.paypal.review .fieldset .field.fullname .fields.group-5 .field { +.form.paypal.review .fieldset .field.fullname .fields.group-5 .field, +.form.send.confirmation .fieldset .field.fullname .fields.group-5 .field { width: 20%; } .form.send.friend .fieldset .field.dob .fields.group .field, @@ -10031,7 +10436,12 @@ img[align="right"] { .form.create.account .fieldset .field.dob .fields.group .field, .form.wishlist.share .fieldset .field.dob .fields.group .field, .form.password.reset .fieldset .field.dob .fields.group .field, -.form.paypal.review .fieldset .field.dob .fields.group .field { +.form.paypal.review .fieldset .field.dob .fields.group .field, +.form.send.confirmation .fieldset .field.dob .fields.group .field { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; width: 33%; position: relative; z-index: 1; @@ -10046,24 +10456,41 @@ img[align="right"] { .form.create.account .fieldset .field.dob .fields.group .field .label, .form.wishlist.share .fieldset .field.dob .fields.group .field .label, .form.password.reset .fieldset .field.dob .fields.group .field .label, -.form.paypal.review .fieldset .field.dob .fields.group .field .label { +.form.paypal.review .fieldset .field.dob .fields.group .field .label, +.form.send.confirmation .fieldset .field.dob .fields.group .field .label { position: absolute; - bottom: 0; + top: 10px; font-size: 12px; line-height: 16px; } -.form.send.friend .fieldset .field.dob .fields.group .field input, -.form.address.edit .fieldset .field.dob .fields.group .field input, -.form.edit.account .fieldset .field.dob .fields.group .field input, -.form.search.advanced .fieldset .field.dob .fields.group .field input, -.form.orders.search .fieldset .field.dob .fields.group .field input, -.form.contact .fieldset .field.dob .fields.group .field input, -.form.password.forget .fieldset .field.dob .fields.group .field input, -.form.create.account .fieldset .field.dob .fields.group .field input, -.form.wishlist.share .fieldset .field.dob .fields.group .field input, -.form.password.reset .fieldset .field.dob .fields.group .field input, -.form.paypal.review .fieldset .field.dob .fields.group .field input { - margin-bottom: 16px; +.form.send.friend .fieldset .field.dob .fields.group .field .control, +.form.address.edit .fieldset .field.dob .fields.group .field .control, +.form.edit.account .fieldset .field.dob .fields.group .field .control, +.form.search.advanced .fieldset .field.dob .fields.group .field .control, +.form.orders.search .fieldset .field.dob .fields.group .field .control, +.form.contact .fieldset .field.dob .fields.group .field .control, +.form.password.forget .fieldset .field.dob .fields.group .field .control, +.form.create.account .fieldset .field.dob .fields.group .field .control, +.form.wishlist.share .fieldset .field.dob .fields.group .field .control, +.form.password.reset .fieldset .field.dob .fields.group .field .control, +.form.paypal.review .fieldset .field.dob .fields.group .field .control, +.form.send.confirmation .fieldset .field.dob .fields.group .field .control { + margin-left: 27px; +} +.form.send.friend .fieldset .field.dob .fields.group .field:last-child, +.form.address.edit .fieldset .field.dob .fields.group .field:last-child, +.form.edit.account .fieldset .field.dob .fields.group .field:last-child, +.form.search.advanced .fieldset .field.dob .fields.group .field:last-child, +.form.orders.search .fieldset .field.dob .fields.group .field:last-child, +.form.contact .fieldset .field.dob .fields.group .field:last-child, +.form.password.forget .fieldset .field.dob .fields.group .field:last-child, +.form.create.account .fieldset .field.dob .fields.group .field:last-child, +.form.wishlist.share .fieldset .field.dob .fields.group .field:last-child, +.form.password.reset .fieldset .field.dob .fields.group .field:last-child, +.form.paypal.review .fieldset .field.dob .fields.group .field:last-child, +.form.send.confirmation .fieldset .field.dob .fields.group .field:last-child { + padding-right: 0; + width: 34%; } .form.send.friend .actions, .form.address.edit .actions, @@ -10075,7 +10502,8 @@ img[align="right"] { .form.create.account .actions, .form.wishlist.share .actions, .form.password.reset .actions, -.form.paypal.review .actions { +.form.paypal.review .actions, +.form.send.confirmation .actions { *zoom: 1; width: 690px; } @@ -10090,6 +10518,7 @@ img[align="right"] { .form.wishlist.share .actions:before, .form.password.reset .actions:before, .form.paypal.review .actions:before, +.form.send.confirmation .actions:before, .form.send.friend .actions:after, .form.address.edit .actions:after, .form.edit.account .actions:after, @@ -10100,7 +10529,8 @@ img[align="right"] { .form.create.account .actions:after, .form.wishlist.share .actions:after, .form.password.reset .actions:after, -.form.paypal.review .actions:after { +.form.paypal.review .actions:after, +.form.send.confirmation .actions:after { content: ""; display: table; } @@ -10114,7 +10544,8 @@ img[align="right"] { .form.create.account .actions:after, .form.wishlist.share .actions:after, .form.password.reset .actions:after, -.form.paypal.review .actions:after { +.form.paypal.review .actions:after, +.form.send.confirmation .actions:after { clear: both; } .form.send.friend .actions .primary, @@ -10127,7 +10558,8 @@ img[align="right"] { .form.create.account .actions .primary, .form.wishlist.share .actions .primary, .form.password.reset .actions .primary, -.form.paypal.review .actions .primary { +.form.paypal.review .actions .primary, +.form.send.confirmation .actions .primary { float: right; } .form.send.friend .actions .secondary, @@ -10140,7 +10572,8 @@ img[align="right"] { .form.create.account .actions .secondary, .form.wishlist.share .actions .secondary, .form.password.reset .actions .secondary, -.form.paypal.review .actions .secondary { +.form.paypal.review .actions .secondary, +.form.send.confirmation .actions .secondary { float: left; } .form.send.friend .fieldset.create.account:after, @@ -10153,7 +10586,8 @@ img[align="right"] { .form.create.account .fieldset.create.account:after, .form.wishlist.share .fieldset.create.account:after, .form.password.reset .fieldset.create.account:after, -.form.paypal.review .fieldset.create.account:after { +.form.paypal.review .fieldset.create.account:after, +.form.send.confirmation .fieldset.create.account:after { content: attr(data-hasrequired); display: block; position: absolute; @@ -10433,68 +10867,74 @@ img[align="right"] { .block.account.nav .item strong { font-weight: 400; } -.my-account .pager .amount, -.my-account .pager .limiter { +.account .pager .amount, +.account .pager .limiter { display: inline-block; } -.my-account .form .fieldset > .legend { +.account .form .fieldset > .legend { margin: 0 0 30px; } -.my-account > .actions, -.my-account .form > .actions, -.my-account .block > .actions { +.account .column.main > .actions, +.account .column.main .form > .actions, +.account .column.main .block > .actions { *zoom: 1; margin: 30px 0 0; } -.my-account > .actions:before, -.my-account .form > .actions:before, -.my-account .block > .actions:before, -.my-account > .actions:after, -.my-account .form > .actions:after, -.my-account .block > .actions:after { +.account .column.main > .actions:before, +.account .column.main .form > .actions:before, +.account .column.main .block > .actions:before, +.account .column.main > .actions:after, +.account .column.main .form > .actions:after, +.account .column.main .block > .actions:after { content: ""; display: table; } -.my-account > .actions:after, -.my-account .form > .actions:after, -.my-account .block > .actions:after { +.account .column.main > .actions:after, +.account .column.main .form > .actions:after, +.account .column.main .block > .actions:after { clear: both; } -.my-account > .actions > .primary, -.my-account .form > .actions > .primary, -.my-account .block > .actions > .primary { +.account .column.main > .actions > .primary, +.account .column.main .form > .actions > .primary, +.account .column.main .block > .actions > .primary { float: right; } -.my-account > .actions > .secondary, -.my-account .form > .actions > .secondary, -.my-account .block > .actions > .secondary { +.account .column.main > .actions > .secondary, +.account .column.main .form > .actions > .secondary, +.account .column.main .block > .actions > .secondary { float: left; } -.my-account .data.table { +.account .data.table { width: 100%; } -.my-account .data.table td, -.my-account .data.table th { +.account .data.table td, +.account .data.table th { padding: 10px 20px; text-align: left; } -.my-account .data.table td.col.actions, -.my-account .data.table th.col.actions { +.account .data.table td.col.actions, +.account .data.table th.col.actions { white-space: nowrap; } -.my-account .data.table td.col.actions .action:last-child, -.my-account .data.table th.col.actions .action:last-child { +.account .data.table td.col.actions .action:last-child, +.account .data.table th.col.actions .action:last-child { margin-left: 20px; } -.my-account .data.table td em, -.my-account .data.table th em { +.account .data.table td.col.actions .action:first-child, +.account .data.table th.col.actions .action:first-child, +.account .data.table td.col.actions .action.details, +.account .data.table th.col.actions .action.details { + margin-left: 0; +} +.account .data.table td em, +.account .data.table th em { font-style: normal; } -.my-account .data.table th { +.account .data.table th { font-size: 16px; font-weight: 400; } -.my-account .data.table tr:nth-child(odd) td { +.account .data.table tr:nth-child(odd) td { background: #f8f8f8; } .block.dashboard .title .action, @@ -10664,65 +11104,10 @@ img[align="right"] { .data.table.wishlist .col.actions { width: 200px; } -.data.table.wishlist .item-options { - background: rgba(0, 0, 0, 0.8); - color: #ffffff; - display: none; - position: absolute; - border-radius: 5px; - padding: 10px; - right: 100%; - top: 50%; - margin-top: -20px; - margin-right: 15px; - max-width: 200px; - min-width: 100px; -} -.data.table.wishlist .item-options > p { - margin-top: 0; -} -.data.table.wishlist .item-options dl { - margin: 0; -} -.data.table.wishlist .item-options dl dt { - display: inline; - float: left; - clear: left; - font-weight: 600; -} -.data.table.wishlist .item-options dl dt:after { - content: ':'; - margin-right: 5px; -} -.data.table.wishlist .item-options dl dd { - margin: 0; -} -.data.table.wishlist .truncated .truncated_full_value { - position: relative; -} -.data.table.wishlist .truncated .truncated_full_value.show:before { - content: ''; - border-left: 10px solid rgba(0, 0, 0, 0.8); - border-top: 10px solid transparent; - border-bottom: 10px solid transparent; - height: 0; - width: 0; - overflow: hidden; - display: block; - position: absolute; - top: 3px; - margin-top: 0; - left: -15px; - z-index: 2; -} -.data.table.wishlist .truncated .truncated_full_value.show .item-options { +.data.table.wishlist .col.actions .price-excluding-tax, +.data.table.wishlist .col.actions .price-including-tax { display: block; } -.data.table.wishlist .truncated .details { - font-size: 12px; - border-bottom: 1px dotted #332e29; - cursor: help; -} /* Page -> Advanced Search -------------------------------------- */ @@ -11117,6 +11502,9 @@ img[align="right"] { .recurring.order.details > .actions .primary { text-align: right; } +/* + My Account -> Send confirmation link +-------------------------------------- */ /* Overlay popup -------------------------------------- */ @@ -11147,7 +11535,7 @@ img[align="right"] { .popup.active { display: block; } -.popup .close span { +.popup > .action.close span { width: 16px; display: block; line-height: 0; @@ -11156,15 +11544,2679 @@ img[align="right"] { text-align: center; text-indent: -999em; } -.popup .close span:active { +.popup > .action.close span:active { outline: 0; } -.popup .close span:after { +.popup > .action.close span:after { text-indent: 0; display: block; margin: 0; } +.popup > .action.close span:after { + content: ""; +} .popup .title { font-size: 18px; margin: 0 0 30px; } +.popup .title strong { + font-weight: 400; +} +.popup .fieldset .action.close span { + line-height: inherit; + text-indent: 0; + width: auto; +} +.popup .fieldset .action.close span:after { + content: ""; + display: none; +} +.truncated { + position: relative; +} +.truncated .truncated.full.value { + background: rgba(0, 0, 0, 0.8); + color: #ffffff; + display: none; + position: absolute; + border-radius: 5px; + padding: 10px; + right: 100%; + top: 50%; + margin-top: -20px; + margin-right: 15px; + max-width: 200px; + min-width: 100px; +} +.truncated .truncated.full.value.show { + display: block; +} +.truncated .truncated.full.value.show:before { + content: ''; + border-left: 10px solid rgba(0, 0, 0, 0.8); + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + height: 0; + width: 0; + overflow: hidden; + display: block; + position: absolute; + top: 12px; + margin-top: 0; + right: -10px; + z-index: 2; +} +.truncated .truncated.full.value > p { + margin-top: 0; +} +.truncated .truncated.full.value dl { + margin: 0; +} +.truncated .truncated.full.value dl dt { + display: inline; + font-weight: 600; +} +.truncated .truncated.full.value dl dt:after { + content: ':'; +} +.truncated .truncated.full.value dl dd { + margin: 0; + white-space: normal; +} +.truncated .action.details { + font-size: 12px; + border-bottom: 1px dotted #332e29; + cursor: help; +} +.map-popup { + background: #ffffff; + border: 1px solid #c2c2c2; + position: absolute; + padding: 20px; + z-index: 10; +} +.mobileAction { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; +} +.mobileAction span { + font-size: 18px; +} +.mobilePrimaryAction { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; +} +.mobilePrimaryAction span { + font-size: 18px; +} +.mobileSecondaryAction { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #c2c2c2; + color: #ffffff; +} +.mobileSecondaryAction span { + font-size: 18px; +} +/* Smartphones (portrait) ----------- */ +@media only screen and (max-width: 640px) { + html { + height: 100%; + } + body { + padding-top: 0 !important; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + html, + .columns, + .footer > .content, + .page.main > .page.title, + .page.messages { + min-width: 0; + } + .columns, + .page.main > .page.title, + .page.messages { + padding-left: 20px; + padding-right: 20px; + } + .column.main { + min-height: 0; + } + .column.left { + padding-right: 0; + } + .column.right { + padding-left: 0; + } + .col1-layout .column.main { + float: none; + display: block; + } + .col2-left-layout .column.main { + float: none !important; + width: 100%; + display: block; + } + .col2-left-layout .column.left { + float: none; + width: 100%; + display: block; + } + .col2-right-layout .column.main { + float: none; + width: 100%; + display: block; + } + .col2-right-layout .column.right { + float: none; + width: 100%; + display: block; + } + .col3-layout .column.main { + width: 100%; + float: none !important; + display: block !important; + } + .col3-layout .column.left { + float: none; + width: 100%; + display: block; + } + .col3-layout .column.right { + float: none !important; + display: block !important; + width: 100%; + } + .column.main .block > .title strong, + .sidebar .block > .title strong { + font-weight: 400; + font-size: 20px; + } + .notice.global.site { + position: static; + } + .outer.wrapper { + overflow: hidden; + position: relative; + } + .active-nav { + height: 100%; + } + .active-nav .outer.wrapper { + height: 100%; + width: 100%; + } + .products.wrapper .products.list .item .product.actions { + opacity: 1; + visibility: visible; + } + .products.wrapper .products.list .item .product.actions .action.tocart, + .products.wrapper .products.list .item .product.actions .secondary { + visibility: visible; + width: 100%; + } + .products.wrapper .products.list .item .secondary { + margin-left: 0; + border: none; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + position: static; + } + .products.wrapper .products.list .item .secondary .action { + width: 100%; + padding: 10px 0; + display: block; + } + .products.wrapper .products.list .item:hover { + border: 1px solid transparent; + background: transparent; + } + .search.results .toolbar .pager, + .category-view .toolbar .pager { + display: none; + } + .search.results .toolbar .pager .pages > ol, + .category-view .toolbar .pager .pages > ol { + line-height: 33px; + } + .search.results .toolbar .pager .pages > ol a, + .category-view .toolbar .pager .pages > ol a, + .search.results .toolbar .pager .pages > ol strong, + .category-view .toolbar .pager .pages > ol strong { + padding: 0 5px; + } + .search.results .toolbar .sorter select, + .category-view .toolbar .sorter select, + .search.results .toolbar .limiter select, + .category-view .toolbar .limiter select { + padding: 5px 10px 4px; + } + .search.results .toolbar .modes, + .category-view .toolbar .modes { + float: right; + margin-right: 0; + margin-left: 0; + } + .search.results .toolbar .modes .mode span, + .category-view .toolbar .modes .mode span { + width: 18px; + } + .search.results .toolbar .modes .mode span:after, + .category-view .toolbar .modes .mode span:after { + font-size: 18px; + width: 18px; + height: 18px; + line-height: 18px; + } + .search.results .toolbar .modes .mode.grid, + .category-view .toolbar .modes .mode.grid { + width: 18px; + display: block; + line-height: 0; + white-space: nowrap; + vertical-align: middle; + text-align: center; + text-indent: -999em; + display: inline-block; + } + .search.results .toolbar .modes .mode.grid:after, + .category-view .toolbar .modes .mode.grid:after { + font-family: "icons"; + font-size: 18px; + line-height: 18px; + height: 18px; + margin: 0; + overflow: hidden; + content: "\e003"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + vertical-align: middle; + text-align: center; + } + .search.results .toolbar .modes .mode.grid:active, + .category-view .toolbar .modes .mode.grid:active { + outline: 0; + } + .search.results .toolbar .modes .mode.grid:after, + .category-view .toolbar .modes .mode.grid:after { + text-indent: 0; + display: block; + margin: 0; + } + .search.results .toolbar .modes .mode.list, + .category-view .toolbar .modes .mode.list { + width: 18px; + display: block; + line-height: 0; + white-space: nowrap; + vertical-align: middle; + text-align: center; + text-indent: -999em; + display: inline-block; + } + .search.results .toolbar .modes .mode.list:after, + .category-view .toolbar .modes .mode.list:after { + font-family: "icons"; + font-size: 18px; + line-height: 18px; + height: 18px; + margin: 0; + overflow: hidden; + content: "\e002"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + vertical-align: middle; + text-align: center; + } + .search.results .toolbar .modes .mode.list:active, + .category-view .toolbar .modes .mode.list:active { + outline: 0; + } + .search.results .toolbar .modes .mode.list:after, + .category-view .toolbar .modes .mode.list:after { + text-indent: 0; + display: block; + margin: 0; + } + .search.results .toolbar.bottom .toolbar .pager, + .category-view .toolbar.bottom .toolbar .pager { + display: block; + } + .search.results .toolbar.bottom .toolbar .settings, + .category-view .toolbar.bottom .toolbar .settings { + display: none; + } + .search.results .products.wrapper.grid .products.list .item.product, + .category-view .products.wrapper.grid .products.list .item.product { + width: 50%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + } + .search.results .products.wrapper.grid .products.list .item.product .secondary, + .category-view .products.wrapper.grid .products.list .item.product .secondary { + background: transparent; + } + .search.results .products.wrapper.grid .products.list .item.product .secondary .action.tocompare, + .category-view .products.wrapper.grid .products.list .item.product .secondary .action.tocompare { + display: none; + } + .search.results .products.wrapper.list .products.list .item.product .product.photo, + .category-view .products.wrapper.list .products.list .item.product .product.photo { + float: none; + } + .search.results .products.wrapper.list .products.list .item.product .product.details, + .category-view .products.wrapper.list .products.list .item.product .product.details { + display: block; + padding: 15px 0 0; + text-align: center; + } + .search.results .products.wrapper.list .products.list .item.product .product.details .product.name, + .category-view .products.wrapper.list .products.list .item.product .product.details .product.name { + font-size: 18px; + } + .search.results .products.wrapper.list .products.list .item.product .product.details .price-box, + .category-view .products.wrapper.list .products.list .item.product .product.details .price-box { + font-size: 16px; + } + .search.results .product.photo .img.photo.container, + .category-view .product.photo .img.photo.container { + position: static !important; + width: auto !important; + height: auto !important; + } + .search.results .product.photo .img.photo.container img, + .category-view .product.photo .img.photo.container img { + position: static !important; + width: auto !important; + height: auto !important; + } + img { + max-width: 100%; + } + .page.wrapper { + width: 100%; + float: right; + position: relative; + -webkit-transition: margin 0.3s ease-out 0; + -moz-transition: margin 0.3s ease-out 0; + transition: margin 0.3s ease-out 0; + } + .active-nav .page.wrapper { + margin-right: -86%; + } + .page.wrapper .navigation + .widget.static.block, + .page.wrapper .breadcrumbs + .widget.static.block { + margin: 50px 0 0; + } + .page.wrapper + .widget.static.block { + display: none; + } + .header { + padding: 0; + position: relative; + margin-bottom: 35px; + } + .header .switcher, + .header .links, + .header .panel { + display: none; + } + .header .content { + position: relative; + min-width: 0; + max-width: 100%; + padding: 0; + } + .header .logo { + float: none; + width: 100%; + text-align: center; + padding: 10px 0; + } + .header .block.search { + display: block; + height: 35px; + padding: 0; + margin: 15px 12px 0 0; + float: none; + text-align: left; + position: relative; + z-index: 13; + position: absolute; + top: 100%; + left: 0; + right: 65px; + } + .header .block.search .content { + padding-left: 65px; + } + .header .block.search .field { + float: none; + } + .header .block.search .label { + display: inline-block; + width: 32px; + height: 32px; + position: absolute; + top: 0; + left: 60px; + text-indent: -9999px; + z-index: 1; + } + .header .block.search .control { + width: auto; + float: none; + } + .header .block.search .control .input-text { + width: 0; + margin-right: 0; + height: 35px; + padding: 0; + margin-right: 32px; + border: 1px solid transparent; + box-sizing: content-box; + text-indent: 10px; + -webkit-transition: all 0.3s linear 0; + -moz-transition: all 0.3s linear 0; + transition: all 0.3s linear 0; + } + .header .block.search .control .input-text:focus { + margin-right: 0; + width: 100%; + padding: 0 65px 0 0; + border-color: #c2c2c2; + } + .header .block.search .actions { + margin-left: -105px; + position: relative; + left: 65px; + } + .header .block.search .actions .action.search { + background: none; + border: none; + } + .header .block.search .actions .action.search span { + color: #675f55; + width: 22px; + display: block; + line-height: 0; + white-space: nowrap; + vertical-align: middle; + text-align: center; + text-indent: -999em; + } + .header .block.search .actions .action.search span:after { + font-family: "icons"; + font-size: 22px; + line-height: 22px; + height: 22px; + margin: 0; + overflow: hidden; + content: "\e005"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + vertical-align: middle; + text-align: center; + } + .header .block.search .actions .action.search span:active { + outline: 0; + } + .header .block.search .actions .action.search span:after { + text-indent: 0; + display: block; + margin: 0; + } + .header .block.search .actions .action.search span:after { + height: 24px; + line-height: 24px; + } + .header .block.search .search.autocomplete { + top: 35px !important; + width: 100% !important; + } + .header .minicart.wrapper { + position: absolute; + top: 100%; + right: 20px; + margin: 15px 0 0; + } + .header .minicart.wrapper .action.showcart { + z-index: 1; + margin: 0; + color: #837d75; + } + .header .minicart.wrapper .block.minicart { + display: none; + } + .header .widget.static.block { + display: none; + } + .action.toggle.nav { + margin-top: 19px; + position: absolute; + top: 100%; + left: 20px; + font-size: 0; + z-index: 14; + width: 32px; + display: block; + line-height: 0; + white-space: nowrap; + vertical-align: middle; + text-align: center; + text-indent: -999em; + cursor: pointer; + } + .action.toggle.nav:after { + font-family: "icons"; + font-size: 32px; + line-height: 32px; + height: 32px; + margin: 0; + overflow: hidden; + content: "\e007"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + vertical-align: middle; + text-align: center; + } + .action.toggle.nav:active { + outline: 0; + } + .action.toggle.nav:after { + text-indent: 0; + display: block; + margin: 0; + } + .action.toggle.nav:before { + position: absolute; + width: 100%; + height: 100%; + left: -100%; + top: -20px; + padding: 20px 0; + content: ""; + } + .active-nav .action.toggle.nav:before { + position: fixed; + padding: 0; + left: 86%; + right: 0; + top: 0; + bottom: 0; + } + .breadcrumbs { + display: none; + } + .footer { + padding: 30px 0; + } + .footer > .content { + padding: 0 20px; + } + .footer .block.newsletter { + width: 100%; + float: none; + margin-bottom: 30px; + } + .footer .block.newsletter input[type="text"] { + height: 33px; + } + .footer .links { + width: 45%; + margin: 0 5% 0 0; + float: left; + } + .footer .links ul > li { + margin-bottom: 12px; + } + .footer .links li { + display: block; + margin-bottom: 12px; + } + .footer .links li:after { + content: ''; + } + .footer .links li a { + font-size: 16px; + } + .footer .links + .links li:first-child:before { + content: ''; + } + .footer .copyright { + padding-top: 20px; + clear: both; + font-size: 12px; + color: #c2c2c2; + } + .checkout-cart-index .page.main > .page.title { + margin: 0 0 15px; + padding: 0; + } + .checkout-cart-index .page.main > .page.title h1 { + border-top: 2px solid #e5e5e5; + display: block; + margin: 0 10px; + padding: 17px 0 0; + } + .checkout-cart-index .page.main > .page.title h1 span { + font-size: 36px; + } + .checkout-cart-index .page.main > .page.title .checkout.methods.items { + display: block; + padding: 12px 10px; + } + .checkout-cart-index .checkout.methods.items { + background: #f8f8f8; + margin: 15px 0 0; + padding: 0; + text-align: center; + } + .checkout-cart-index .checkout.methods.items > .item { + background: #ffffff; + margin: 0; + padding: 0 10px 20px; + } + .checkout-cart-index .checkout.methods.items > .item:first-child { + padding-top: 20px; + } + .checkout-cart-index .checkout.methods.items .action { + float: none; + } + .checkout-cart-index .checkout.methods.items .checkout.paypal.after:after { + line-height: 1; + } + .checkout-cart-index .paypal.checkout.paypal-logo { + background: url("../images/express-checkout-retina.png") no-repeat 50% 50%; + background-size: 100%; + max-width: 255px; + width: 100%; + } + .checkout-cart-index .paypal.checkout.paypal-logo input { + opacity: 0; + width: 100%; + } + .checkout-cart-index .action.checkout { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .checkout-cart-index .action.checkout span { + font-size: 18px; + } + .checkout-cart-index .block.crosssell { + border: 0; + padding: 0; + } + .checkout-cart-index .block.crosssell .content { + overflow-x: scroll; + } + .checkout-cart-index .block.crosssell .products.list.items.crosssell { + margin: 0; + white-space: nowrap; + } + .checkout-cart-index .block.crosssell .products.list.items.crosssell .item.product { + display: inline-block; + float: none; + margin: 0 0 10px; + width: 43%; + } + .checkout-cart-index .block.crosssell .products.list.items.crosssell .item.product .product { + white-space: normal; + } + .checkout-cart-index .block.crosssell .products.list.items.crosssell .item.product .product .actions { + display: none; + } + .checkout-cart-index .block.crosssell .products.list.items.crosssell .item.product .img.photo.container { + max-width: 100%; + } + .cart.main.actions { + *zoom: 1; + } + .cart.main.actions:before, + .cart.main.actions:after { + content: ""; + display: table; + } + .cart.main.actions:after { + clear: both; + } + .cart.main.actions .action.update, + .cart.main.actions .action.continue { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #c2c2c2; + color: #ffffff; + } + .cart.main.actions .action.update span, + .cart.main.actions .action.continue span { + font-size: 18px; + } + .cart.main.actions .action.continue { + position: relative; + top: 0; + } + .cart.main.actions .action.clear { + display: none; + } + .cart.table.wrapper, + .cart.summary { + float: none; + width: auto; + } + .cart.summary { + position: static; + display: block; + margin-left: -10px; + margin-right: -10px; + padding: 14px 10px; + } + .cart.summary .summary.title { + font-size: 22px; + padding-left: 12px; + } + .cart.summary .block { + font-size: 16px; + } + .cart.summary .block > .title { + padding: 10px 12px; + } + .cart.summary .block > .title strong { + font-size: 18px; + } + .cart.summary .block > .title strong:after { + font-size: 26px; + } + .cart.summary .block .items.methods dd { + margin-bottom: 10px; + } + .cart.summary .block .fieldset { + font-size: 14px; + } + .cart.summary .block input, + .cart.summary .block select, + .cart.summary .block .action span { + font-size: 16px; + } + .cart.table.wrapper.detailed + .cart.summary { + margin-top: 0; + } + .cart.totals { + padding: 38px 10px 10px; + } + .cart.totals td, + .cart.totals th { + padding: 8px 0 8px 5px; + } + .cart.totals .mark { + padding-left: 9px; + } + .cart.totals .amount { + padding-right: 3px; + } + .cart.totals .mark, + .cart.totals .amount, + .cart.totals td:first-child strong { + font-size: 18px; + } + .cart.totals td:not(:first-child) strong { + font-size: 30px; + } + .cart.table.wrapper thead { + display: none; + } + .cart.table.wrapper .product.photo { + max-width: 60px; + position: absolute; + left: 0; + top: 25px; + } + .cart.table.wrapper .product.photo span, + .cart.table.wrapper .product.photo img { + max-width: 60px; + max-height: 60px; + } + .cart.table.wrapper .col.item { + display: block; + padding: 25px 80px 10px 70px; + position: relative; + min-height: 60px; + } + .cart.table.wrapper .col.item .product.name { + font-size: 18px; + margin: 0 0 2px; + } + .cart.table.wrapper .col.item dl { + margin: 0; + } + .cart.table.wrapper .col.item dd { + margin-bottom: 0; + } + .cart.table.wrapper .col.price, + .cart.table.wrapper .col.subtotal { + display: block; + padding: 0 20px 5px 70px; + text-align: left; + } + .cart.table.wrapper .col.price:before, + .cart.table.wrapper .col.subtotal:before { + content: attr(data-label); + display: inline-block; + margin-right: 7px; + min-width: 65px; + } + .cart.table.wrapper .col.price span:before, + .cart.table.wrapper .col.subtotal span:before { + content: attr(data-label); + display: inline-block; + font-size: 12px; + margin-right: 7px; + } + .cart.table.wrapper .col.price.excl.tax + .col.price.incl.tax:before { + visibility: hidden; + } + .cart.table.wrapper .col.subtotal.excl.tax + .col.subtotal.incl.tax:before { + visibility: hidden; + } + .cart.table.wrapper .col.qty { + display: block; + position: absolute; + top: 15px; + right: 5px; + } + .cart.table.wrapper .col.qty:before { + content: attr(data-label); + display: inline-block; + font-size: 14px; + margin-bottom: 7px; + text-transform: uppercase; + } + .cart.table.wrapper .col.qty + .col.subtotal { + padding-top: 8px; + padding-left: 70px; + } + .cart.table.wrapper .col.qty input { + font-size: 16px; + } + .cart.table.wrapper .item.info { + *zoom: 1; + display: block; + position: relative; + font-size: 16px; + } + .cart.table.wrapper .item.info:before, + .cart.table.wrapper .item.info:after { + content: ""; + display: table; + } + .cart.table.wrapper .item.info:after { + clear: both; + } + .cart.table.wrapper .item.actions { + border-bottom: 1px solid #e5e5e5; + } + .cart.table.wrapper .item.actions td { + padding-bottom: 20px; + padding-top: 12px; + } + .cart.table.wrapper .item.actions td:before { + display: none; + } + .cart.table.wrapper .item.actions td .action { + margin-left: 25px; + } + .cart.table.wrapper .item.actions div.actions { + padding: 0; + } + .cart.table.wrapper .item.actions .action.delete span:after { + margin-top: -2px; + } + .cart.table.wrapper .items.data tbody:nth-child(2n) tr { + background: #ffffff; + } + .opc.wrapper { + float: none; + margin: 0 -18px; + width: auto; + } + .opc.wrapper > .opc .section > .step-title { + padding: 20px; + } + .opc.wrapper > .opc .section > .step-title h2 { + font-size: 22px; + } + .opc.wrapper > .opc .section.allow > .step-title h2:after { + display: none; + } + .opc.wrapper .form:not(.login) { + font-size: 16px; + } + .opc.wrapper .form:not(.login):after { + display: none; + } + .opc.wrapper .form:not(.login) .fieldset > .field { + display: block; + padding: 0; + width: 100%; + } + .opc.wrapper .form:not(.login) input, + .opc.wrapper .form:not(.login) select, + .opc.wrapper .form:not(.login) textarea { + font-size: 16px; + } + .opc.wrapper .form:not(.login) .field.fullname + .field.company, + .opc.wrapper .form:not(.login) .field.name-lastname + .field.company, + .opc.wrapper .form:not(.login) .field.country, + .opc.wrapper .form:not(.login) .field.taxvat { + margin: 0 0 10px; + } + .opc.wrapper .form:not(.login) .field .nested { + padding: 0; + } + .opc.wrapper .form:not(.login) .field .nested .field { + margin-bottom: 0; + } + .opc.wrapper .form:not(.login) .actions { + margin: 40px 0 10px; + position: relative; + text-align: center; + } + .opc.wrapper .form:not(.login) .actions .action.continue { + float: none; + padding: 18px 0 16px; + width: 90%; + } + .opc.wrapper .form:not(.login) .actions .action.continue span { + font-size: 24px; + line-height: 26px; + } + .opc.wrapper .form:not(.login) .actions .action.back span:before { + display: none; + } + .opc.wrapper .form:not(.login) .actions .secondary { + clear: none; + float: none; + padding-top: 27px; + text-align: center; + } + .opc.wrapper .form:not(.login) .choice input { + margin-top: 3px; + } + .opc.wrapper .gift.message dd { + margin-left: 0; + } + .opc.wrapper .gift.message dd.options.individual .product { + float: none; + } + .opc.wrapper .gift-messages h3 { + font-size: 16px; + } + .opc.wrapper .gift-messages-form ol, + .opc.wrapper .gift-messages-form ul { + list-style: none; + margin: 0; + padding: 0; + } + .opc.wrapper .gift-messages-form .item { + margin: 0 0 30px; + position: relative; + } + .opc.wrapper .gift-messages-form .item .details input, + .opc.wrapper .gift-messages-form .item .details textarea { + width: 100%; + } + .opc.wrapper .gift-messages-form .item .field:last-child { + margin-bottom: 10px; + } + .opc.wrapper .gift-messages-form .product-img-box { + position: absolute; + width: 60px; + left: 0; + top: 0; + } + .opc.wrapper .gift-messages-form .product-img-box p { + margin: 0 0 10px; + } + .opc.wrapper .gift-messages-form .product-img-box img { + max-height: 60px; + max-width: 60px; + } + .opc.wrapper .gift-messages-form .product-name { + font-size: 18px; + font-weight: 600; + margin: 0 0 10px; + } + .opc.wrapper .gift-messages-form .details { + padding-left: 70px; + } + .opc.wrapper .sp-methods dt { + font-weight: normal; + margin: 0 0 10px; + } + .opc.wrapper .sp-methods dd { + margin: 0; + padding: 0; + } + .opc.wrapper .sp-methods dd > ul { + list-style: none; + margin: 0; + padding: 5px 10px 15px 20px; + } + .opc.wrapper .sp-methods dd > ul > li { + margin: 5px 0 0; + } + .opc.wrapper .sp-methods dd > ul label { + display: block; + } + .opc.wrapper .sp-methods dd > ul label em { + display: none; + } + .opc.wrapper .sp-methods dd > ul label.required:after { + color: #da370a; + content: "*"; + } + .opc.wrapper .sp-methods dd > ul .input-box > input, + .opc.wrapper .sp-methods dd > ul .input-box > select { + width: 100%; + } + .opc.wrapper .sp-methods dd > ul .v-fix { + display: inline-block; + } + .opc.wrapper .order-review { + font-size: 16px; + } + .opc.wrapper .order-review .review.table.wrapper { + overflow-x: scroll; + margin-bottom: 10px; + } + .opc.wrapper .order-review .order.review.data th.col.item, + .opc.wrapper .order-review .order.review.data td:first-child { + padding-left: 0; + padding-right: 10px; + } + .opc.wrapper .order-review .order.review.data .items.data td { + padding: 10px 5px 5px; + } + .opc.wrapper .order-review th.col.item, + .opc.wrapper .order-review th.col.price, + .opc.wrapper .order-review th.col.subtotal { + white-space: nowrap; + } + .opc.wrapper .order-review th.col.price, + .opc.wrapper .order-review th.col.subtotal { + text-align: center; + } + .opc.wrapper .order-review th.excl.tax span, + .opc.wrapper .order-review th.col.incl.tax span { + font-size: 12px; + } + .opc.wrapper .grand.total { + display: block; + *zoom: 1; + } + .opc.wrapper .grand.total:before, + .opc.wrapper .grand.total:after { + content: ""; + display: table; + } + .opc.wrapper .grand.total:after { + clear: both; + } + .opc.wrapper .grand.total .mark { + font-size: 16px; + white-space: nowrap; + } + .opc.wrapper .grand.total .amount { + padding: 0; + } + .opc.wrapper .checkout.submit.order .actions .primary { + float: none; + } + .opc.wrapper .order-review .actions { + text-align: center; + } + .opc.wrapper .order-review .actions .secondary { + float: none; + margin: 30px 0 0; + } + .opc.wrapper .order-review .actions .action.checkout { + float: none; + padding: 18px 0 16px; + width: 90%; + } + .opc.wrapper .order-review .actions .action.checkout span { + font-size: 24px; + line-height: 26px; + } + .opc.wrapper .order-review .actions.back span:before { + display: none; + } + .opc.wrapper .load.indicator { + left: 0; + position: absolute; + top: 10px; + width: 100%; + } + .block.progress.onepage { + background: #f8f8f8; + border-top: 1px solid #e5e5e5; + border-bottom: 1px solid #e5e5e5; + float: none; + margin: 35px -18px 0; + width: auto; + } + .block.progress.onepage > .title { + margin: 0; + padding: 11px 22px; + position: relative; + cursor: pointer; + } + .block.progress.onepage > .title strong { + font-size: 18px; + font-weight: 600; + } + .block.progress.onepage > .title:before { + content: "\e00d"; + font-family: "icons"; + font-weight: 400; + font-size: 20px; + position: absolute; + right: 20px; + top: 9px; + } + .block.progress.onepage > .title.active:before { + content: "\e03a"; + } + .block.progress.onepage > .content { + background: #ffffff; + display: none; + margin: 0 10px 10px; + padding: 10px; + } + .block.progress.onepage dl { + margin: 0; + } + .block.progress.onepage dt { + font-size: 20px; + font-weight: 200; + } + .block.progress.onepage dt > a { + font-weight: 400; + margin-left: 20px; + text-decoration: underline; + } + .block.progress.onepage dd { + font-size: 16px; + line-height: 1.4; + } + .block.progress.onepage dd:last-child { + margin: 0; + } + .block.progress.onepage .separator { + display: none; + } + .action.toggle.checkout.progress { + background: none; + cursor: pointer; + display: block; + float: right; + height: auto; + margin: -52px 18px 0 0; + padding: 0; + overflow: hidden; + width: auto; + } + .step.login.wrapper { + padding: 0 0 20px; + } + .step.login.wrapper .block { + float: none; + font-size: 16px; + width: 100%; + } + .step.login.wrapper .block.guest { + margin: 0; + padding: 0; + } + .step.login.wrapper .block.guest:before { + display: none; + } + .step.login.wrapper .block.guest .actions { + margin-left: 0; + } + .step.login.wrapper .actions { + padding: 20px 0 0; + position: relative; + text-align: center; + width: 100%; + } + .step.login.wrapper .actions .secondary { + font-size: 14px; + margin: 15px 0 0; + } + .step.login.wrapper .actions .action.login, + .step.login.wrapper .actions .action.continue { + width: 100%; + } + .step.login.wrapper .actions .action.login span, + .step.login.wrapper .actions .action.continue span { + font-size: 18px; + } + /* + Magento_Checkout + Multishipping + -------------------------------------- */ + .multicheckout.progress { + width: 100%; + float: none; + } + .multicheckout.progress li { + display: block; + padding: 10px 20px; + text-decoration: none; + font-size: 20px; + font-weight: 600; + border-bottom: 1px solid #e5e5e5; + color: #675f55; + } + .multicheckout.progress li.active { + color: #da370a; + } + .multicheckout.progress + .form.address.edit { + float: none; + width: 100%; + } + .multicheckout.form.address, + .multicheckout.form.billing, + .multicheckout.form.shipping, + .multicheckout.form.overview, + .multicheckout.success, + .multicheckout.change.billing { + float: none; + width: 100%; + } + .multicheckout.form.address .col.address select { + max-width: 100%; + } + .multicheckout.form.address .items.data { + display: block; + width: 100%; + } + .multicheckout.form.address .items.data thead { + display: none; + } + .multicheckout.form.address .items.data tbody { + display: block; + width: 100%; + } + .multicheckout.form.address .items.data tr, + .multicheckout.form.address .items.data td { + display: block; + width: 100%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + } + .multicheckout.form.address .items.data .col.product .product.name { + font-size: 18px; + } + .multicheckout.form.address .items.data .col.delete { + border-bottom: 1px solid #e5e5e5; + padding-bottom: 10px; + margin-bottom: 20px; + } + .multicheckout.form.address .items.data .col.qty { + text-align: left; + padding-top: 0; + } + .multicheckout .actions .action { + width: 100%; + display: block; + float: none; + text-align: center; + margin-bottom: 10px; + } + .multicheckout .title .action, + .multicheckout .subtitle .action { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .multicheckout .title .action span, + .multicheckout .subtitle .action span { + font-size: 18px; + } + .multicheckout > .block.shipping .box.address, + .multicheckout.overview > .block.billing .box.address { + float: none; + width: 100%; + } + .multicheckout > .block.shipping .box.method, + .multicheckout.overview > .block.billing .box.method { + float: none; + width: 100%; + } + .multicheckout > .block.shipping .box.items, + .multicheckout.overview > .block.billing .box.items { + overflow-x: scroll; + } + .customer-account-login .page.title { + display: none; + } + .login.container { + padding: 20px; + margin: 0 -20px; + } + .login.container .block { + float: none; + width: 100%; + } + .login.container .block > .title { + margin-bottom: 15px; + } + .login.container .block .actions { + position: static; + text-align: center; + bottom: 0; + width: 100%; + margin: 0; + padding: 0; + } + .login.container .block .actions .secondary { + float: none; + margin: 15px 0 0; + } + .login.container .block.login { + padding: 0; + } + .login.container .block.login .actions { + margin: 20px 0 0; + } + .login.container .block.new { + padding: 0; + } + .login.container .block.new .actions { + margin: 20px 0 0; + } + .login.container .action.login, + .login.container .action.create { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .login.container .action.login span, + .login.container .action.create span { + font-size: 18px; + } + .form.login .fieldset.login .field .label { + padding: 0 0 5px 0; + display: block; + width: 100%; + float: none; + font-size: 16px; + text-align: left; + } + .form.login .fieldset.login .field .control { + width: 100%; + } + /* Registration */ + .form.send.friend .fieldset, + .form.address.edit .fieldset, + .form.edit.account .fieldset, + .form.search.advanced .fieldset, + .form.orders.search .fieldset, + .form.contact .fieldset, + .form.password.forget .fieldset, + .form.create.account .fieldset, + .form.wishlist.share .fieldset, + .form.password.reset .fieldset, + .form.add.tag .fieldset, + .form.paypal.review .fieldset { + width: 100%; + padding: 20px; + margin: 0 -20px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + } + .form.send.friend .fieldset .legend, + .form.address.edit .fieldset .legend, + .form.edit.account .fieldset .legend, + .form.search.advanced .fieldset .legend, + .form.orders.search .fieldset .legend, + .form.contact .fieldset .legend, + .form.password.forget .fieldset .legend, + .form.create.account .fieldset .legend, + .form.wishlist.share .fieldset .legend, + .form.password.reset .fieldset .legend, + .form.add.tag .fieldset .legend, + .form.paypal.review .fieldset .legend { + margin: 0; + padding: 0 0 10px 0; + background: transparent; + } + .form.send.friend .fieldset > .field, + .form.address.edit .fieldset > .field, + .form.edit.account .fieldset > .field, + .form.search.advanced .fieldset > .field, + .form.orders.search .fieldset > .field, + .form.contact .fieldset > .field, + .form.password.forget .fieldset > .field, + .form.create.account .fieldset > .field, + .form.wishlist.share .fieldset > .field, + .form.password.reset .fieldset > .field, + .form.add.tag .fieldset > .field, + .form.paypal.review .fieldset > .field { + width: 100%; + display: block; + padding-right: 0; + } + .form.send.friend .action.save, + .form.address.edit .action.save, + .form.edit.account .action.save, + .form.search.advanced .action.save, + .form.orders.search .action.save, + .form.contact .action.save, + .form.password.forget .action.save, + .form.create.account .action.save, + .form.wishlist.share .action.save, + .form.password.reset .action.save, + .form.add.tag .action.save, + .form.paypal.review .action.save, + .form.send.friend .action.submit, + .form.address.edit .action.submit, + .form.edit.account .action.submit, + .form.search.advanced .action.submit, + .form.orders.search .action.submit, + .form.contact .action.submit, + .form.password.forget .action.submit, + .form.create.account .action.submit, + .form.wishlist.share .action.submit, + .form.password.reset .action.submit, + .form.add.tag .action.submit, + .form.paypal.review .action.submit, + .form.send.friend .action.add, + .form.address.edit .action.add, + .form.edit.account .action.add, + .form.search.advanced .action.add, + .form.orders.search .action.add, + .form.contact .action.add, + .form.password.forget .action.add, + .form.create.account .action.add, + .form.wishlist.share .action.add, + .form.password.reset .action.add, + .form.add.tag .action.add, + .form.paypal.review .action.add { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .form.send.friend .action.save span, + .form.address.edit .action.save span, + .form.edit.account .action.save span, + .form.search.advanced .action.save span, + .form.orders.search .action.save span, + .form.contact .action.save span, + .form.password.forget .action.save span, + .form.create.account .action.save span, + .form.wishlist.share .action.save span, + .form.password.reset .action.save span, + .form.add.tag .action.save span, + .form.paypal.review .action.save span, + .form.send.friend .action.submit span, + .form.address.edit .action.submit span, + .form.edit.account .action.submit span, + .form.search.advanced .action.submit span, + .form.orders.search .action.submit span, + .form.contact .action.submit span, + .form.password.forget .action.submit span, + .form.create.account .action.submit span, + .form.wishlist.share .action.submit span, + .form.password.reset .action.submit span, + .form.add.tag .action.submit span, + .form.paypal.review .action.submit span, + .form.send.friend .action.add span, + .form.address.edit .action.add span, + .form.edit.account .action.add span, + .form.search.advanced .action.add span, + .form.orders.search .action.add span, + .form.contact .action.add span, + .form.password.forget .action.add span, + .form.create.account .action.add span, + .form.wishlist.share .action.add span, + .form.password.reset .action.add span, + .form.add.tag .action.add span, + .form.paypal.review .action.add span { + font-size: 18px; + } + .form.send.friend .actions, + .form.address.edit .actions, + .form.edit.account .actions, + .form.search.advanced .actions, + .form.orders.search .actions, + .form.contact .actions, + .form.password.forget .actions, + .form.create.account .actions, + .form.wishlist.share .actions, + .form.password.reset .actions, + .form.add.tag .actions, + .form.paypal.review .actions { + width: 100%; + margin-top: 15px; + } + .form.send.friend .actions .primary, + .form.address.edit .actions .primary, + .form.edit.account .actions .primary, + .form.search.advanced .actions .primary, + .form.orders.search .actions .primary, + .form.contact .actions .primary, + .form.password.forget .actions .primary, + .form.create.account .actions .primary, + .form.wishlist.share .actions .primary, + .form.password.reset .actions .primary, + .form.add.tag .actions .primary, + .form.paypal.review .actions .primary { + float: none; + } + .form.send.friend .actions .secondary, + .form.address.edit .actions .secondary, + .form.edit.account .actions .secondary, + .form.search.advanced .actions .secondary, + .form.orders.search .actions .secondary, + .form.contact .actions .secondary, + .form.password.forget .actions .secondary, + .form.create.account .actions .secondary, + .form.wishlist.share .actions .secondary, + .form.password.reset .actions .secondary, + .form.add.tag .actions .secondary, + .form.paypal.review .actions .secondary { + margin: 15px 0 0; + float: none; + text-align: center; + } + .form.send.friend .fieldset.create.account:after, + .form.address.edit .fieldset.create.account:after, + .form.edit.account .fieldset.create.account:after, + .form.search.advanced .fieldset.create.account:after, + .form.orders.search .fieldset.create.account:after, + .form.contact .fieldset.create.account:after, + .form.password.forget .fieldset.create.account:after, + .form.create.account .fieldset.create.account:after, + .form.wishlist.share .fieldset.create.account:after, + .form.password.reset .fieldset.create.account:after, + .form.add.tag .fieldset.create.account:after, + .form.paypal.review .fieldset.create.account:after { + content: attr(data-hasrequired); + position: relative; + } + .form.search.advanced, + .form.orders.search, + .form.contact { + padding: 20px; + margin: 0 -20px; + } + .form.search.advanced .actions, + .form.orders.search .actions, + .form.contact .actions { + padding-right: 0; + margin-top: 20px; + text-align: center; + } + .form.search.advanced .action, + .form.orders.search .action, + .form.contact .action { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .form.search.advanced .action span, + .form.orders.search .action span, + .form.contact .action span { + font-size: 18px; + } + .form.search.advanced .fields.range, + .form.orders.search .fields.range, + .form.contact .fields.range { + display: table; + width: 100%; + } + .form.search.advanced .fields.range > .field, + .form.orders.search .fields.range > .field, + .form.contact .fields.range > .field { + display: table-cell; + width: 50%; + } + .form.contact .fieldset .field.comment { + width: 100%; + margin-left: 0; + } + .form.send.friend .actions > .primary { + float: none; + } + .form.send.friend .actions > .primary .action.submit { + float: none; + margin-left: 0; + } + .form.send.friend .actions > .primary .action.add { + margin-top: 10px; + } + /* + * Mage_Customer + * + * Account + ----------------------------------------------------------------------------- */ + .col2-left-layout.account .column.main { + display: block; + width: 100%; + float: none; + } + .col2-left-layout.account .column.left { + display: block; + width: 100%; + float: none; + } + .my-account > .actions, + .billing-agreements > .actions, + .recurring-profiles .buttons-set, + .newsletter.manage > .actions { + text-align: center; + margin-bottom: 20px; + } + .block.account.nav .content { + margin: 0 -20px; + } + .block.account.nav .content .items > li { + margin-bottom: 0; + } + .block.account.nav .content .items > li a, + .block.account.nav .content .items > li strong { + display: block; + padding: 10px 20px; + text-decoration: none; + font-size: 20px; + font-weight: 600; + border-bottom: 1px solid #e5e5e5; + color: #675f55; + } + .block.account.nav .content .items > li.current strong { + color: #da370a; + } + .page.title .toggle.accountnav { + padding-top: 12px; + font-size: 16px; + background: transparent; + cursor: pointer; + } + .page.title > .action { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .page.title > .action span { + font-size: 18px; + } + .block.dashboard .box { + float: none; + width: 100%; + margin-bottom: 15px; + } + .block.dashboard .recent.orders .col.shipping { + display: none; + } + .block.dashboard.orders { + overflow-x: scroll; + } + .block.dashboard:not(.welcome):not(.orders) .content { + padding: 20px; + margin: 0 -20px; + } + .block.dashboard:not(.welcome):not(.orders) .subtitle { + margin-bottom: 10px; + } + .data.table.orders { + margin: 0 -8px; + } + .data.table.orders td, + .data.table.orders th { + padding: 10px 8px; + } + .data.table.orders td.col.actions .action, + .data.table.orders th.col.actions .action { + display: block; + } + .data.table.orders td.col.actions .action:last-child, + .data.table.orders th.col.actions .action:last-child { + margin-right: 0; + } + .data.table.orders .col.shipping { + display: none; + } + /* Address book */ + .block.addresses:not(.dashboard) .content { + padding: 20px; + margin: 0 -20px; + } + .block.addresses:not(.dashboard).default { + float: none; + width: 100%; + } + .block.addresses:not(.dashboard).list { + float: none; + width: 100%; + } + .form.newsletter .action.save { + width: 100%; + } + .my-account .tags.items.cloud .item { + font-size: 18px; + } + /* + My Account -> Billing agreements + -------------------------------------- */ + .billing.agreements .form.new.agreement .field { + display: inline-block; + padding-right: 20px; + vertical-align: top; + width: 100%; + } + .billing.agreements .form.new.agreement .nested .field { + width: 100%; + } + .billing.agreements .form.new.agreement .actions { + margin-right: 30px; + } + .billing.agreements .form.new.agreement .action.create { + width: 100%; + padding-top: 7px; + padding-bottom: 6px; + } + /* + My Account -> Downloadable products + -------------------------------------- */ + .downloadable-customer-products .my-account { + overflow-x: scroll; + } + /* + My Account -> Wishlist + -------------------------------------- */ + .review-customer-index .my-account { + overflow-x: scroll; + } + /* + My Account -> My Reviews + -------------------------------------- */ + .my-account .form.wishlist.items { + overflow-x: scroll; + } + .my-account .form.wishlist.items .actions .primary { + float: none; + } + .my-account .form.wishlist.items .actions .primary .action { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .my-account .form.wishlist.items .actions .primary .action span { + font-size: 18px; + } + .my-account .form.wishlist.items .actions .secondary { + float: none; + } + .my-account .form.wishlist.items .actions .secondary .action { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #c2c2c2; + color: #ffffff; + } + .my-account .form.wishlist.items .actions .secondary .action span { + font-size: 18px; + } + /* + * My Account -> My orders + * + ----------------------------------------------------------------------------- */ + .sales-order-history .my-account { + overflow-x: scroll; + } + .order.details .order.toolbar { + clear: both; + float: none; + } + .order.details .order.toolbar .action { + margin: 0 0 10px; + display: block; + font-size: 18px; + } + .order.details .block.order { + float: none; + width: 100%; + padding: 0; + } + .order.details .block.order .content { + padding: 20px; + margin: 0 -20px; + } + .order.details .order.info > dt { + margin-bottom: 15px; + } + .order.details .order.info > dd { + padding: 0; + background: #ffffff; + margin: 0 -20px; + } + .order.details .order.info > dd .items .item { + float: none; + margin-right: 0; + } + .order.details .order.info > dd .items .item a, + .order.details .order.info > dd .items .item strong { + display: block; + padding: 10px 20px; + text-decoration: none; + font-size: 20px; + font-weight: 600; + border-bottom: 1px solid #e5e5e5; + color: #675f55; + } + .order.details .order.info > dd .items .item strong { + color: #da370a; + } + .order.details .subtitle.caption { + margin-bottom: 20px; + } + .order.details .additional.details .order.comments { + padding: 20px; + margin: 0 -20px 20px; + } + .order.details > .actions { + text-align: center; + margin-bottom: 20px; + } + .order.details.items { + overflow-x: scroll; + } + .widget.static.block { + margin-bottom: 15px; + } + /* Product Page */ + .col1-layout .columns { + padding-left: 18px; + padding-right: 18px; + } + .col1-layout .column.main { + float: none; + } + .product.info.main, + .product.photo.main, + .product.media, + .product.data, + .box.tocart .field, + .box.tocart .actions, + .product.photo.thumbs { + float: none; + width: auto; + max-width: 100%; + } + .product.photo.thumbs { + padding: 0; + overflow-x: auto; + white-space: nowrap; + -webkit-overflow-scrolling: touch; + } + .product.photo.thumbs .item.thumb { + display: inline-block; + margin-right: 5px; + position: relative; + vertical-align: bottom; + white-space: normal; + } + .product.photo.thumbs .item.thumb span { + height: auto !important; + width: 100% !important; + max-width: 100%; + } + .product.photo.thumbs .item.thumb span img { + border: 2px solid transparent; + position: static; + height: auto !important; + width: 100% !important; + max-width: 100%; + } + .product.photo.thumbs .item.thumb .active img { + border: 2px solid #ff9600; + } + .box.tocart .actions { + text-align: center; + } + .product.data { + display: block; + } + .product.data > .item.content:before { + display: none; + } + .product.photo .notice { + display: none; + } + .product.info.main .page.title.product { + margin-bottom: 10px; + } + .product.info.main .price-box { + border: none !important; + margin: 0; + } + .product.info.main .stock { + clear: right; + float: right; + } + .product.info.main .prices.tier { + clear: both; + } + .product.info.main .product.add.form { + clear: both; + } + .product.info.main .product.add.form .actions { + margin-right: 0; + } + .product.info.main .product.add.form .actions .action.primary.customize, + .product.info.main .product.add.form .actions .action.primary.tocart { + max-width: 400px; + padding: 18px 10px 14px; + width: 100%; + } + .type-configurable .product.info.main select { + width: 99.5% !important; + } + .product.info.main .product.social.links { + border-top: 1px solid #e5e5e5; + padding: 10px 0; + float: none; + text-align: right; + } + .product.info.main .product.social.links .action.mailto { + display: inline-block; + } + .product.info.main .product.social.links .action.mailto span { + width: 24px; + display: block; + line-height: 0; + white-space: nowrap; + vertical-align: middle; + text-align: center; + text-indent: -999em; + color: #c2c2c2; + } + .product.info.main .product.social.links .action.mailto span:after { + font-family: "icons"; + font-size: 24px; + line-height: 24px; + height: 24px; + margin: 0; + overflow: hidden; + content: "\e001"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + vertical-align: middle; + text-align: center; + } + .product.info.main .product.social.links .action.mailto span:active { + outline: 0; + } + .product.info.main .product.social.links .action.mailto span:after { + text-indent: 0; + display: block; + margin: 0; + } + .product.info.main .actions.bundle { + clear: both; + text-align: center; + } + .product.info.main .actions.bundle .action.primary.customize { + margin: 24px 0; + max-width: 400px; + padding: 18px 10px 14px; + width: 100%; + } + .product.info.main .price-box .price-excluding-tax, + .product.info.main .price-box .price-including-tax { + display: block; + } + .product.info.main .product.addto.links { + display: inline-block; + font-size: 18px; + border: none; + margin: 0; + padding: 10px; + position: absolute; + vertical-align: top; + } + .product.info.main .product.addto.links .action.towishlist { + font-size: 16px; + } + .product.info.main .product.addto.links .action.tocompare { + display: none; + } + .product.info.main .table.data.grouped { + width: 100%; + clear: both; + } + .product.media .img.photo.container { + height: auto !important; + width: auto !important; + } + .product.media .img.photo.container > img { + position: static !important; + height: auto !important; + width: auto !important; + max-width: 100%; + } + .product.media:before { + content: attr(data-title); + color: #837d75; + display: block; + font-size: 30px; + font-weight: 200; + line-height: 1.2; + margin-bottom: 30px; + } + .product.info.detailed { + background: #f8f8f8; + border-bottom: 1px solid #e5e5e5; + margin: 0 -18px; + } + .product.info.detailed .product.data > .item.title { + float: none; + margin: 0; + position: relative; + } + .product.info.detailed .product.data > .item.title .switch { + background: #f8f8f8; + border: none; + border-top: 1px solid #e5e5e5; + font-size: 18px; + color: #675f55; + border-radius: 0; + padding: 11px 18px; + position: static; + text-transform: none; + } + .product.info.detailed .product.data > .item.title:before { + content: "\e00d"; + display: block; + font-family: "icons"; + font-size: 15px; + position: absolute; + top: 11px; + right: 18px; + } + .product.info.detailed .product.data > .item.title.active .switch { + padding: 11px 18px !important; + } + .product.info.detailed .product.data > .item.title.active:before { + content: "\e011"; + } + .product.info.detailed .product.data > .item.content { + color: #675f55; + font-size: 18px; + float: none; + margin: 0 10px 10px; + padding: 10px 18px; + width: auto; + } + .product.info.detailed .product.data > .item.content.active { + background: #fff; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + } + .product.info.detailed .product.data > .item.content.active + .item.title .switch { + border-top: none; + } + .product.info.detailed .product.data > .item.content:last-child { + border-bottom: 1px solid #e5e5e5; + } + .product.info.detailed .product.data > .item.content .product.attributes th { + font-size: 18px; + padding: 26px 10px 10px; + } + .product.info.detailed .block.add.review { + background: none; + } + .product.info.detailed .block.add.review .fieldset > .legend { + border: none; + margin: 0; + } + .product.info.detailed .block.add.review .fieldset > .legend strong { + display: block; + font-size: 18px; + line-height: 1.2; + margin: 0; + } + .product.info.detailed .block.add.review .actions, + .product.info.detailed .block.add.review .field:not(.ratings) { + width: 100%; + } + .product.info.detailed .block.add.review .actions { + text-align: left; + } + .block.add.review { + margin: 0; + padding: 0; + } + .block.product.tags { + margin-bottom: 0; + } + .block.product.tags .title { + display: none; + } + .block.product.tags .field .note { + font-size: 12px; + padding-left: 0; + } + .block.product.tags .field .note:before { + display: none; + } + .column.main .block.widget.viewed, + .column.main .block.crosssell, + .column.main .block.upsell, + .column.main .block.related, + .column.main .block.widget.new, + .column.main .block.widget.compared { + border: none; + padding: 0; + } + .column.main .block.widget.viewed .item.product .product.photo span, + .column.main .block.crosssell .item.product .product.photo span, + .column.main .block.upsell .item.product .product.photo span, + .column.main .block.related .item.product .product.photo span, + .column.main .block.widget.new .item.product .product.photo span, + .column.main .block.widget.compared .item.product .product.photo span { + height: auto !important; + width: auto !important; + } + .column.main .block.widget.viewed .item.product .product.photo span img, + .column.main .block.crosssell .item.product .product.photo span img, + .column.main .block.upsell .item.product .product.photo span img, + .column.main .block.related .item.product .product.photo span img, + .column.main .block.widget.new .item.product .product.photo span img, + .column.main .block.widget.compared .item.product .product.photo span img { + position: static !important; + height: auto; + width: auto; + max-width: 100%; + } + .column.main .block.widget.viewed .item.product .actions, + .column.main .block.crosssell .item.product .actions, + .column.main .block.upsell .item.product .actions, + .column.main .block.related .item.product .actions, + .column.main .block.widget.new .item.product .actions, + .column.main .block.widget.compared .item.product .actions { + display: none; + } + .column.main .block.widget.viewed .item.product:hover .actions, + .column.main .block.crosssell .item.product:hover .actions, + .column.main .block.upsell .item.product:hover .actions, + .column.main .block.related .item.product:hover .actions, + .column.main .block.widget.new .item.product:hover .actions, + .column.main .block.widget.compared .item.product:hover .actions { + visibility: hidden; + } + .column.main .block.widget.viewed .content, + .column.main .block.crosssell .content, + .column.main .block.upsell .content, + .column.main .block.related .content, + .column.main .block.widget.new .content, + .column.main .block.widget.compared .content { + overflow-x: auto; + margin: 0 -18px; + white-space: nowrap; + -webkit-overflow-scrolling: touch; + } + .column.main .block.widget.viewed .products.list, + .column.main .block.crosssell .products.list, + .column.main .block.upsell .products.list, + .column.main .block.related .products.list, + .column.main .block.widget.new .products.list, + .column.main .block.widget.compared .products.list { + margin: 0; + } + .column.main .block.widget.viewed .products.list .item.product, + .column.main .block.crosssell .products.list .item.product, + .column.main .block.upsell .products.list .item.product, + .column.main .block.related .products.list .item.product, + .column.main .block.widget.new .products.list .item.product, + .column.main .block.widget.compared .products.list .item.product { + white-space: normal; + width: 40% !important; + } + .column.main .block.widget.viewed .products.list .item.product .product.photo, + .column.main .block.crosssell .products.list .item.product .product.photo, + .column.main .block.upsell .products.list .item.product .product.photo, + .column.main .block.related .products.list .item.product .product.photo, + .column.main .block.widget.new .products.list .item.product .product.photo, + .column.main .block.widget.compared .products.list .item.product .product.photo { + display: block; + float: none; + margin: 0 0 10px; + } + .block.related .actions { + display: none; + } + .box.tocart .checkout.paypal { + display: block; + } + .box.tocart .checkout.paypal.after:before { + display: block; + } + .box.tocart .checkout.paypal.before:before { + display: block; + } + .product.info.detailed + .block.upsell, + .product.info.detailed + .block.related { + margin-top: 30px; + clear: none; + float: none; + width: auto; + border-top: 0; + padding-top: 0; + padding-left: 0; + border-left: 0; + } + .product.info.detailed + .block.upsell .products.list, + .product.info.detailed + .block.related .products.list { + margin: 0; + } + .product.info.detailed + .block.upsell .products.list .item.product, + .product.info.detailed + .block.related .products.list .item.product { + display: inline-block; + width: 40%; + padding: 20px; + } + .product.info.detailed + .block.upsell .products.list .item.product .product.photo, + .product.info.detailed + .block.related .products.list .item.product .product.photo { + float: none; + display: block; + margin: 0 0 10px; + } + input[type="password"], + input[type="text"] { + font-size: 18px; + } + .fieldset > .field > .label { + font-size: 18px; + font-weight: normal; + text-transform: none; + } + .fieldset > .field .note { + padding-left: 0 !important; + margin: 5px; + } + .fieldset > .field .note:before { + display: none; + } + .bundle.options.container { + margin: 0; + padding: 0; + } + .bundle.options.container .product.add.form { + margin: 0 -18px; + padding: 20px 18px 280px; + } + .bundle.options.container .product.options.wrapper, + .bundle.options.container .product.options.bottom { + float: none; + width: auto; + } + .bundle.options.container .product.options.bottom .price-box { + display: none; + } + .bundle.options.container .product.options.bottom .action.back.customization { + color: #c2c2c2; + width: 22px; + display: block; + line-height: 0; + white-space: nowrap; + vertical-align: middle; + text-align: center; + text-indent: -999em; + top: 26px; + right: 18px; + } + .bundle.options.container .product.options.bottom .action.back.customization:after { + font-family: "icons"; + font-size: 22px; + line-height: 22px; + height: 22px; + margin: 0; + overflow: hidden; + content: "\e012"; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + vertical-align: middle; + text-align: center; + } + .bundle.options.container .product.options.bottom .action.back.customization:active { + outline: 0; + } + .bundle.options.container .product.options.bottom .action.back.customization:after { + text-indent: 0; + display: block; + margin: 0; + } + .bundle.options.container p.required { + display: none; + } + .block.bundle.summary { + background: #f8f8f8; + margin: 0; + float: none; + position: absolute; + margin: -280px 0 0; + top: 100% !important; + width: 90%; + } + .block.bundle.summary .content { + padding: 0; + } + .block.bundle.summary .bundle.summary, + .block.bundle.summary .photo, + .block.bundle.summary .title, + .block.bundle.summary .product.name, + .block.bundle.summary .available, + .block.bundle.summary .addto { + display: none !important; + } + .block.bundle.summary .price-box .price-label { + display: block; + float: none; + margin-bottom: 5px; + } + .block.bundle.summary .price-box .price-excluding-tax { + margin-right: 10px; + } + .block.bundle.summary .price-box .full-product-price { + float: none; + } + .block.bundle.summary .box.tocart { + padding-bottom: 0; + border: none; + } + .block.bundle.summary .box.tocart .field, + .block.bundle.summary .box.tocart .actions { + display: inline-block; + } + .block.bundle.summary .box.tocart .control { + width: auto; + } + .block.bundle.summary .box.tocart .field.qty { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 18%; + } + .block.bundle.summary .box.tocart input.qty { + height: 49px; + } + .block.bundle.summary .box.tocart .actions { + width: 80%; + } + .block.bundle.summary .box.tocart .actions .action.primary.tocart { + padding: 18px 10px 14px; + width: 100%; + } + .fieldset.bundle.options > .field { + margin: 0 0 20px; + } + .fieldset.bundle.options > .field .label { + display: inline-block; + font-size: 16px; + width: 90%; + } + .fieldset.bundle.options > .field > .label { + font-size: 22px; + } + .block.widget.viewed .content, + .block.crosssell .content, + .block.upsell .content, + .block.related .content, + .block.widget.new .content, + .block.widget.compared .content { + margin: 0; + } + .block.widget.viewed .minilist.products.items .item.product .product.details, + .block.widget.new .minilist.products.items .item.product .product.details { + overflow: hidden; + padding: 0; + } + .block.widget.viewed .minilist.products.items .item.product:hover .product.actions, + .block.widget.new .minilist.products.items .item.product:hover .product.actions { + visibility: hidden; + } + /* + Overlay popup + -------------------------------------- */ + .popup { + left: 0; + top: 5%; + margin: 0 auto; + width: 90%; + } + .popup .actions .action.submit { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #da370a; + color: #ffffff; + } + .popup .actions .action.submit span { + font-size: 18px; + } + .popup .actions .action.cancel { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + background-color: #c2c2c2; + color: #ffffff; + } + .popup .actions .action.cancel span { + font-size: 18px; + } +} diff --git a/app/design/frontend/magento_plushe/images/express-checkout-retina.png b/app/design/frontend/magento_plushe/images/express-checkout-retina.png new file mode 100644 index 0000000000000000000000000000000000000000..cb7603592ef8fc83e7511a5399e592bf52ecce22 GIT binary patch literal 19622 zcmbTbW0WRAw=P(=ZQF0zwr$(Cx@_CFZQHih)n#>=)89Gw+?gMD&8#)~BQqj$KhH+& zohu_EQc+$49tH;n2nYyXN>WrA2nZPAUt0hQ;@=(lfCBs91KU+h(^bX6+||R#*$ha? z)WO({NXpL0!c5uB$kfYe(u@}f2-Mt4Rnt{dPL|um!H&V`KQauSc8>qhKtQ|#o{mN) zHfF9w#%2~)_IxC_-Tfp)R;GL;8f<b*a*iTqmR6G9&Som!@~S4@HYQxABm(?Iyq?_u z2<*&Ujfgz$Z0%jRJ^4ufi<kRf`#-~sBt-uu;%dW3^4~^j$|(|wI5?XTu`w{wn=r96 z5wQap04%H=92|5+%uE0#MkZ!P05d&+gPVn!n~90&e_bU1v^krab1RFA|1VwtdVD07 zuC9*UjEo*09t<8V3=Yl~i~ue!uK#c_Gt>W*pm*`IcQx{)w|61^9|ln~7ZYbIM^`Hc zd!qj^8W}sdx$=?xv-H1Ruyd4?``^U&F8?b~|3b#-Y2?TVU|?djv-^)<|0V6>s%-Xu zoAG~?c2V_mG-FgYb8&EUHu*On=A{1v{ujIdcSZjZ{AUffg0t1XNinh&bue+WGqZP< z66GWL_lCjL%9LB2g;i9XRY;7PS%gcB835oE<q{GR7Z+yd6k%fG6leP%j{g%DAR^2q z$^j4-;bP_h0K}NN*jZS_#6$ob|Cm@fxJ3U4D`oHEYGiL>_CI>9{^|W+SfT${EVqcW znUSl5v#NuG?f+zeqNRhYgNvnuBaw&-I}w$JmA$EhhYR(8rsu!C6*Y6VayK&-cXqHN z`mgwMTm2vOi*x*c`TgHm)Bis)WBg|f<A0Ll|B)>JGxRS5|I_^6ssFF@zl+Dr{$Is7 z|0@lNMfpM?Ajvf;Q6W{&tt&l9PrTLEZwqrDrQ6vwvrXsQF?d-3zAz#mG+PUpWB?E} zG&BTgA(-bu$Vgzqf{#NP7OpMR&2C!l-eq0e?c5B{%Un&1cD?B&dqz+BTi;j9R&KA$ zpFNlFzxmF$P_Om~#DgDw-$n61;c<l~XOg}Z(0eaW9N%9;TyT(E1Cf+@5t3v>2Kj!^ zS|pBVm#c&kaQGtQ3yls35ns4J`mrB5gfi(2YT!a=Yn#am{BH|D64KHzdB48jL<NZ{ zJQ>G8$5%CUHLY7S@Pnv?k&0q19X2eAz6+_wj9@=>)i$Mik*T&IdX>(7YW0j9aLAx~ zE8>X6yGyNS-P=hY+(nhH{Ja{=^Q-tdR<>{4-&)Umsh}0nQWXe4VyQ-2QJ3S-;3RHS zpMv!?l+Xp^?ruYS=ah&eQF4p*6e6$*-4Q<cy>rhpM)bRVY{9PmTijb-`1VKl%Aur~ ziJsYw$7$UYv~aIDj9uY24J^N8O+nu>V75HPKIU!&xYMj(_+S<*FRU231B5?iUuN)a zIMn%%ey#iENAc$?KYB>NyeTza-b62aeEX2e#b(y$-Cq)DxC_+mR_IpJI3&jkbQAEH zYEk@7^ZLnvYxtgydj45m|MAx&6f7M1iuH>JhsC%ftkvs&4$zzk)PDCIhyahcSx?Hh z_&tMTCZMbMTT8gYrU`IFi$PWry@3l`6tuDb^RX=D7Qj)2;GD3M@f-?9Ar!&m@JlXw zlWK&zl$}6!EYnwFTyjMK^>Nu`fBZ#64ya5iRMK}}))73!4Ba>=`y8Aod<l;*$lups z-E^H;CxodNF)YIj5HeikW;2r0H)}?xX>c?3_E_F7(5(U)En07HuB@U`jDdmSUq7&j zIc&%n`PKXK`4|Ix%Ka<HbZ~Pl!lz5<PQ>X%&>11vaK2QCotcV|Bo|ba&)jK6<Z2N* zqOs{mA<RHsbtIvsH%5!@P0n?$Z-DF@Pwd<%qUl>-&E&nn+L17g?FktTQPlx|rA`|v z5F?JN2^pT@GQ@(ztE|WMd3OHFuze9SpyC4;6d3`Db%b*uA+L|S`=Dg9?J@`Bkg}<2 ztMrpg5mo_si2`VjSMn5Xwh3Nn$X{aEA4>E2$9%^PljNJl2<eezPweWl*>c-YFT0ar zw?8%!RtZ4}-WADH6{NPBn9U!e(48y9or71rr+xA97&5N+yR_BSnhZFCNQv&ma9YsT zw<ue$L31()n*EYx-Bd5%H076><WwtF@m#2;GXa={J_k9*2GInJ3yIr_DgX@=pWFXz zfY=w3e?o98mX8vKgztxTaR3f%5-8P=!FnY;7xiWXqVb(HBKsR!)j>F&<!KgEC;n^J z&7*fE0Z4FVFeto%umE|QRnu|x?uNee7=h5vd(2dUR>}Mu<LHjX=kuf?zf0;%we?_c zZ?O8uz7Qv(^;|*oNMJkP#Tc|8*vjMVRX|V({EJWxaV;8*Bng=*i;DzG$e5%%FZ}f> zS20_sr#lzbA8>=2tsf1F=+$sQd_`#~skETkU2*riBufW~<KC^C>%lGBgboZ4hU(;` zsY3cu2pl!6nMi0tzz+vgQdOJhja00y)O|wp;961Z4{tg2YLQx#`0Ib&uL2q0w=oV3 zDq&DywDYC-UC*LI-;VQVkF@Y{90}VHZ2L*ke}9(6fIf=^SGnfjcj&c_N%WAWqA8_~ zO=f!9-XCbGDI59j_zPEkw)^6IUENh!W(f|4H{=Tlp48{MWB75S0UDJ-@su$vfeo~% z9z5u1UE#9ZDy`U@Q7Y*uKqR)?wg~J`AO#0v3hsA%@Xp>#0rPOlSUeBP%&7k7YySj@ zh=LvzC|>cc&z?zLV><VUo<S@|uH}BEcdP8apQ?}GND53UFNoQAKarn5`q1}4Tfb_) z|GNXBe=#7=?`qi&83KsL7;l-$t`plMbtcC-miYxBspSG}fFCF>SuFlh@Bqg;l2KG6 zgfA`IIP~)8*CSfiSNoy(5D3PYj@i5BrVic9P^cvz<lkH|xEhkv@Cf{wtEt^k?=M8H zmI_5dh1Bf#FIhATDC-$=F}t12&-)#l760m87gi+AOZH(HWLOg%Qy-j_*<XQ=zX_2Z zy4Lf5zKzQJnjdXE;Qnq<dS1bDJ{#jW=*3mX^Vl!#PMvHUP6*%#lS#Uu6tI-~AvoH4 zS9YVQ%$wlKKKcX~$Tigvp(MFEuF_n=*}|zLbpVC%^a3hA@Cm?F#k0X1Gz;H(p+1C> z;ErCZpL(l^A*ly0_K1MEWNqi67Ola-8gB{jtToi>kjeyLI@676i;~j&rGLnYNY1c% zlL&(oMOCl#924(+Q^!v=L(8f}S??{H=%Mxp`6QxUNp=!&;FK9t;lfF|Gb~rTXl5l^ z=1dsP`3()rZ{?^JK^Z1^@&Y>Ukv&0&B+fZP7z-Fh05hcgdOSo2l32?fAFQ(7hmS)q zqxb39p*y6+6!B%<E{IWcPtw$rG>~wBNpTQ-VLcH{%(<K%GXBM=>3ByfkmOk~b4G$+ zF0?V`p#J{0)C$*AQSZ4`wWffh?b=ySr%eJ~=LgFedU=Tv+|Rv;xX3{2-TEU$ViY9= zUV;(9;T*U{tpKJ#CnmJL>XiKS&Ske5aVbiV#)Bp3(OvO^8%iy9xCu=>XO2*yfwPGs zr<nquG_O^&UqrOxn-J^Rh>hp+As_?@B_Px4c(!*1T*$NPl5@WA<9HGuAQ7&r$){X~ zjwene1syh0)FQk#AnI}QhQ%SmD{zzKxBL9H#Jl04t_tEMX5@;031W2eBucH8hL);1 zcyoYwQJN5j`CZF-uC<fwnhg9s&m4>=<70vbtALqY6jBNp1VJ?<`SWM8l9eOmar<-) z0(}U6a0u1hAGSVGrI($?;a!+4Yza!*h`_P~#t;N<-lzX$Fq0E%{8*xa8DKTN??Th7 z5DZ!mZRb0T2fr{3BR4-V*}Jk&CjIfbzZZjuDT*S}!b3%6P~$6@Qc4XBTbvR)?qy5W zd^loeeFJ5ZQm*feT<FP=#A;r`OPGivM?S{MOAV1S2{$_303o9+9YC`btf&s;mQwdc za{1{UhQKC;z##^SrR=vJYPzOp+LTLpzYD?+GvA7xaLNGiE=NguxyMM;lMMeBD`^g! zNKdET6#_*tMk-2tKc*WgGY4m^uM<tc3<G9=_j!)Ni<!q7oBrHqycKTS4XErKepQ%^ z3s^zgYk=uaovA8^Y1$vQ;eKwF6ejOg+uWJtPYMS_!117jrsn^grb05jeqLqg=`4q5 z7u~>e9)T9|Ucb-(6<Mc9#n%9F!2tWk)6b;Il=3DwbRa#h=I0lB)^fDzv3^*DD=^aH zWYuw*6qyss`?|rwc`@^+;j^<D;9|`nu@z>{vB`t{m%?oMKvdHZ5=MkkN|ICdlfjJ5 zTKGxKHWFmsS^*=1dli4f2%ijXfA2)-;*2hav1xfyzar5wUQTj>!ejI#PgC}jYY|-4 z$FEKtbI9sxM?4&P-nRk%$JYY$=4X^{1}{A_fwtkN0R3J>dRnBHCq(AP6K7UuGRdrz ztl(ys?Pg0yy<uG6oYXx1^teeTe%K6_Vu&gO>4K^pz(Vfm<&T98F8^7p<!KTP+yDB( zjicH{99{UU_YaufX;Xrf>`Td{R>#u_N=j*5$WAA!^TP1wMQ{*)6-oer9=8^lR9>eC z1)XO*fE9!S1k@F*p>jA{gAs3-Z+O3_AG&fR02ALJ2GOHaY4==0sR^7%+qWaZ^<-sH zOwf_`L{ia%`~wyPbpdO_GC8^gV!P0EK4`Fa)wAYfR?Ky1@=ObhvgqYK&5t=wlS8cQ z9!%xXC>fuFq!doLAulD|w@EUfra+iO!1Dk}k_!Hu-M7gYlcDQVF30T~tmkf_(%T}2 z)BT1C&*_S#<Drl7?st-kk;lg3$`be{y0BGTE@mf|%S@JFchJckmG0q+rDJqqV`f*L z^%4>d7I75j(VA+6mZYJnbe8E-NMx(npAeCz)A=T~+DCVdSlCW^RA(1UVNm}IQmr2{ z7Rc}jjuJ+a<rFzpa7lLSX``hr!<q`(ncW)8l+A&D73AlTE}?+HuubcO78c?Bf2-uy z!(E4qMq4d%<!{dXuuwsIl%vX4ArZ*k2qGpk$)StuCrf)LVDNLG#$JMhh{A(iLTElA zDhD9i{>{i#+BU-vJAtwMdVb`x68R84_#GJ7Ug3Ca1vAGNV>n`lX5vQ}NeX>k&V*8E zKROvxxM|~KlJC)H_E`B7&c_Y8qJ7xjUL@vode&b*-oH4~>}`fGHROh4J`)9(y_-_` zt>;J9P$)b8Y}i9ZXkFr`bHqT1<Z9~w77`-`RxV8bQ~^!bcy`k&le>)yvg(w_Q%j0@ zP#0il>rfO1YHsa>m4K5ON?Lu&P-6ngeAF40@KcffY9LVq#b6T_Ss8uWG{iz+yL8;x zsh`vQ8j-S??KtgCUrf$ZL;dXy_cg-ab&R`CNbnBMT&9Di31wuA8)6+*ABR?=7(G`V zY=m1vc2ZPv2vuj$gHb6)?P-3<dm#xF7$&bN*;p1YIS43EIm(THE~r}!RU*CKXf1~q zZo)p6pfI|u6YuG(LO6c7<}`CBh+&VcaZ*(9hhj3*LUM(?KV5>kvbsOM15{@4P)Ad> z#TaTtD3nsCrtFg$u6CLG_Vt32HrsOgnIpthii2%^o``22xOpiFF)VHLkZF=%^NW>- zu<__{4am|<lju>#v!DfTk_bt%6nBlqzVO=z#SdJqRBBPt%aLCmQr62y|50V_JS^W& zE7R(xZdxQN82v2*8#ogIhdUW7yjBj)lifQ}d~aoQUz9k;HB9Gh1K3!Is|tgXtlbI! zcGp4IVnvY+R|B24Oq-Ge`2+oETBC`Uk3}pH-)kXsw0IJ}-g*=$u{V%IP0neePA#ec z3tb>#5JdZ62SwIoP6t$NRz$`pIGGlKx*#50bCodD^$ShZRR`SfkPA`q;rH(ze5+eE zQ#wZ}@#s<QmR4Nr_@Jh%Tv-=OIf;O+jSbnaX6)9%Q~t<06f)R|3T=wuO6WkAi1T|% zUf2~DY~o@ijqOkw{f(&k`s}Ef6W$OVk0m#eUBihZQQm_cyK^^G@c?{c4=JUV0NQ>; zcL6$JK|c;0&pu!t>#f#&Z1^n1A^j3kmMCSfoM3t-C+(RP^vHHzuJyoU@v?*LE(TpD zF5G+#??r4VlI0pp9VS;wF%%)1%kW4_){P@h>N5&Fs}NhM;2dr^vzyZXsp(no>b^oQ z{xN`|Mrd>F-#=R}&MvWkD$Sj-O^Ys09H2#gQsd+lnaiv^tH2-#{urv~qZLF!*i7Fb z;0gKX%nGCKE=^JL9>op_@^8Rf#0)4Uvm}_AT>ErP6D^kPJ>Sw-6u%6v0kvs(9L}JI z9q+fx2B)HNh^}p=9FJVg%5}INa#&hEkgn1kw4DOke@trb_>FpI-9f!|f+3uQ>3ZyQ z^ZvDh2ks5rdOVJh%Jj58v^`<L5DwCkp&J+bq9zGA8nRZs&z4v}`u=4%{?(rsq?N2( z=n9cptx#YzI(>URG>TXw7FMEFvk$KJ`Spz5aaVGf0M!!lauDUCP9hxiJoptpjHl!o zpwWWkba^EA>T3eq#>fS1^Xz(fqLVf_x)D!fJjh0PfT$rqKres`Svo7BhfC&+bbxD1 z{dxWV;0@3Dct8mmRR@#=O(xH4ghOXqs)f{8*avP<vl$w(4O_zLy@vI>6!<s1=EGDv zr`IV}1|5a+5|Qk=7_YWMRypOtGe4Z}^9D)?yC^sAq>uHV=gAyp$*^|8pIo7KEix57 zHK-12sTNt@w4%UZ$#v2@N+Ra+1&6C)tx!Q(5Wyp%S;1p(>$wPuq2XDu0j5z?Ro4Y7 za_}6ztg*qmSh)E#ZA@UEz?kKlKnYO`nM`$CYKLLmY#yh#7Sk?wBykmPz&xFGdLu|Q z!3LTS0IRG-oWQ0;zC#E3F)1ee%T+*~fDp~AN0bQS@Z89QH@Ao=8S4#eEP=$WAp&6r zCoN8cgUx6zf=rgu#F#x(DWPb95jI0FC(1O995$?_qj<vuCNsD(a%@vWp};^wgEDPs z2N#5%*b0vBrfLcEhWl`Yl;PJYJbs|D2qrYPM3FJ$`Igrn;V@uRoHqwDyXBD`Uis2J zM7eDs2@u77Mfh(&!GXwVWKNvp<+u2s23&*(s(PvlU4C>0uyI+raX|Ru2-qY#4CKNd zx~OS8ZmgI*uj4fs9zO#-V!w9aw*60%t{W)EJ}3AoD=Pb~^<dDnfS7$7x&tpKB5K&S z(>x1L!&zagqbAsn|E6b`F4Ui$4iG|L_4x6d>{!_NxpANBET=`r{sAuz`tc71JmB!% zkSvU>g*YN$O>V-f>YqF6@Ap^p&(C*gFx%lt_<PikB<LDj&+A<L*ZWn2gPp(9PA~Au z#EW+N9=GisXV2(V(kw@JT%i^9=L1!>b{PWHxnS}3DH&0LpY|9WUipHgC@DrI00KGt z4Z>gAVFq6=JQQgq2k$CT0GE(p!6_MjTe31k8^cU+d$TL~m2Q#^eR<hM+Y91+I8n<h z%zbBsIRSHFM)UWhCi)KZMOaG<*%9+K8|{Jp+d4a;^6_Xo3FJ;XYF1ek_bcln7rhD+ z8of=yDB%~%#NXzE7L8eoN%?_EJ7_Vud9gJy!dSf99SQ`Eu|w^w4zVZ8I+IoJAV#L8 zJWTa1aC9lyPS+HXtS;ad;!&LwWiyekgj}z#GW1;&W~|6a&b&lk)U&cfEk#ngLH)!K z8$$aY5~7>6i89(5a&-sul!dIjOMdfeWJ&$rHnjR5T|y>QNelR-Cgrv^#@HjaNzKeS z^Tw(^=qm|I){h~L<+GvYNlNBWMO>M5AO*-L$}y5MLovGVdML97+v=je^jT3_cxN#Y zn!`J2W9~(Nr3aKm2LLpo{4U575LJ$YA(@<Zw$L#kyWJJY0o0vRcry-J$<S<~bREqy z9)To&XQVEx&{SuoZ8hW^rSMf;$=6LoZaQp~iO4demTq73XD1#gC1%}&q{zn+dNdAL z+0iU$J_yjXi^5{Xf<c2Ilegj>H>hB_Z?5yKl}(U*YQ-Nw2!S<RiymO;$|zZ!);dOw zD1L*4ms$&@)DhH^Q1vxM&N8^pFjt!I3v?xAo16tZ@5{<PcV6({y*<eB-@HJiZz1bn zR%~=7tvdUhai`luw_km@WrwK_ICndgY#m=yk)F@RG(CUi(ZBCEbamausTa=2I>!-* zyQ;?z`y@C_G~_7DVy1=Ym3CB(nMtGRUXOzf4(fmH1^5tT$8Iy=LblFE0|Dox?j(yh zsirgNMsrD=9EA$ZpSPVU?6csL##@j4;;$n+m=IA>!R${zKjD@V4pH$49+j-2h%oel zVxcJg`)yu=>p1p_xAQqcfyYJxEx?oNYokFKl*>Phg1{^}F@_n2c2#L3?q-IH=qkJ) z3S*BrmWqBDQ%vD_iD9)j)JzT`0X&y0fMC;382CZx7mG$sO3_5`belKsJ_6_4)QQpG z`Qc?-V_BlJo++hi0E{ojW%t4Iy$ub9hneF;X3uYdvHqvDdfI7=O(Ee6+OiHgHeA&1 z)9kRc<L2=k>GLT8R8RM2B_UeS1cU?(M}z+kBk%o1qDL<FblGpM?P%swez@8rXPU9Q zDn~F}lT`UJfFfDInRGrgZ(K;^MiY{4VNz?hA!gC@xd(uyBf~($V#}^#n*|Tg&_6~8 z#rpj!#rNG@gMvPyYuYE1PJpK2Q+oPJSUoEEHzO`Pj&V>)Z22si4a!YD!I9ELCpxIg z-A`XlZ5<dm`5~F>pqW#2V;ip2iu}r)lA3c;j<aUHBC=;picEwqdAhKn3wN+!*25st zpcy}?9>VfH%QRsu`F$d|#2N@DHqdxltjlKoD!Y!K@g;DSQT4LMq@Kv?7XaZr$|MOU zXY#^xwP022E{F(U0lXQUVx2w2I!&00E0CXr(BK&~;T_&2($|rUmBTBtj}|M@;t1Tv znzIC)Q|fL;-FjH4;w<jpo?S5@Vm8)4hl?^>Ft}@NVJ;mR7Ne*(WWWjmx=2sV&W?xu z#+kHoAh5r;4Hq9DxGj?~mohQ`Vmt*|zAFvWq1H0M&K75mFUHct2N$HIWlRu=BR479 zgp#5#<4|rORvje@Nh`Mcy9c?Jjez&5-s^RfYgAB%QdnPIlH8eGx3dkp4nm-=+k~Y2 z=un#@5G%Sl#HbPbvBe3=tro1#Rbf<%0s+Zd)Wi`UOc>b!YZSX=;Y1p6pw(Cy8NwY> zB>PUc6K063q-&mv=9Lh*$OOkL_GhGv4}HY}Wl6Q19lPeI52-AXL?;9Na;LZx(RP}@ zNxY~S4P47gJBF0qu*zY;v^}d+_3Pq0z43k-exN~C4me}mdTHB2Ob%i<t7+HbY>(Zp zcFc~0PTb87HLv5Ibx1Q%Tw*mPKTt3U-dPRxUk1ZyAUS4a4tZ)zett3~G)2ZKy-sJ_ z+^y{I8O`;Ng>4AIE##yJR?G9n$YcwrdGG*0=&4F@Wy*F&g33-yozul{=*o%Bz8;z~ zc<8KL5;Kj(#BzP=RSTAj0-vX}5pR6`aKCa+88>%8PtE<Td>%*ZWFD?4k^F9}xqZcL z|EAiQACirg^gQtnyxXZ^g2W(e#d0@H_WWXjZT+V1a|eL{g={Zqr$2PJze)qc;ppQ^ z!?{=vU{VM)>Qeq9KG#P*cf>#>`D>-7rI-f?(rKvJCS5+?g7<g8m^XND+mFH&&!>|{ z0EaNASljtbR*IHd!nP!bpCyB6?N^kfGJDBPr71QDuf)!Jo5a>U*iG~`nHX4OByZ9E zj55>MV2`l49VqL8kM-w->5W+wd~Gd1m@iD!U&|z4{~@L(NmC&lsm&}8FD4^n7_#h$ z-AnF6WHDuAbVfgINC(YBy~IqJ6o*lT_~Jm4pO(Nny$t)XUD0GTB5-z;rjN-b#P*|% zM6e`NrwzBP2ygH0AS#31Fj{*;nF67-{$a5UloRQhPumHSs%$CjYjNjH%Z&}J2)YW& z;-)H8xsj?Um)V{=bA{S)mc$}i&=)Z^^+Or;;;K=JC{jaCQ0P<CYLE+@R(9A4c#()X zbP{bvy9Ml2qCjgJ$VUeb4a+*h=pERuY+*eHQka?OXkNLUUw_7u7M;q-blflh!17&^ zK>;n{VQfI5xpTN19-m5skcMNdkhY^@pu(BflGgaC|DJ{=OPa)5;G}w#E_S)xYIr>_ z?Z`>_oS-IUavyTEHKRT<t)?*VtaNN$dUczkYT}ZD{L*ft^I)jbV<zx?u%pLK%dMhK zn5uU>|4n(kF*$s`<Gtdk+>i*)6$7~8dRnySKwT!kgS#%Xy0f%$IX&iq6?#>;35V>Z z8Fg)(_ppXLxu&n>&4#3$)eu~}i4W|mac99P>eU{L^P4+bdfYQu4;3T49&0QuHk743 znX#Ag<FVLt6s7gi3Y!f{)N;SDA)TyCf1D``Y!o^ZXkVdRCUTc-D%MPz5Ys|T+<=HF zArIP$hP%7U9z;kLw9F_xg?hi+#JVMA$1lS<ayIF8f5OQp%&X2=;?%CRuJC{dj=pI= zKmZ^&e!9iE3vX%SOi;*CYqszV?lu;YoT}Vf!3?Ab`8%Wqe!SCx%)-QrI!ol~D#zJi zUXMsb{|mw5WCg`(z#Nk}%K=k@#F+ErV|!;ZTJ}z;QD)X?rPUp=?(gB^_O!zl@Xfom zkItIx$i#*kNZ1564UfV^teFyO>X42VauB#kd1mC{$}PFG+cc#t2VyP7hSn_KS7d~Z z@Xh-p8@G<54!D^NVf!$d?Wy=%Gnwz#Q*Oc>Eetd=+()3)8G3tK00h#3994tU=uX2p zC@t`sWSTUB7%R5}#-bn)I@uw1s#v}Z&hD-hN)3`D8imX!4#<<lMm-L~Mf9$?t)7^d zSg-k_m>+z|w1|nxU}Lj1mtiCZ?pMAHQG$XBAD%<aR-}f2b}_g_vDs}*8fwC9w*HjP zkFyPapcUqW_^Hu5UC~>o)x?ann12{5J^>+47EhzM3;N!VGp*ionO-`zCUfiN`QXhv zyDWZY@FBIk?do!ZHr@;n;@g!RJp)=Q_eA&8V1hgl<>_Idg@E8Nd(rmjrnZhOSGMj1 z?cCrsCPM+&hR8KoLo*BP><oDvI50CBs(6WsEe0%1`><)VQhP-%t8tPr@{P9#A`VWM z<l-z~(2P9{0uLYz%XDjb|MxPEPI9c~aPs6qGf`GNfih5%(Rv%y(?}22ddpYanty5~ zA~z*jr>UGTXwgcG*R?BfXZ_~8Q2>lvtkYd~hFHrOR-%%Rm^=PMCupYGI8(8UhFG<4 zIyQCavO(Bs0rjMj41z{V`danTc7=SboA!$tA!%D#$<?u6S~3NcjD|`QA;R`H_WDQI z^pOi`x%{CQk*(eA7AXpaL_Lwr5G`=vPd-O+4_iPCGKOYm;WS54^KP(DUd@PO(^B#{ z4`<XG6N{iL6Qhg?C61m&;x9(u$F~W*S><vv><+bWZw*ZO4<&}2H;7mUm3<K~UW&8_ zQX6a{auj+H39r@Jplpm44R65Ta+}733Oe48aps9@A={F9^LT}!uXHq{Evah9xhLGl z(@|_mg=8dKXq&VcJGS|?)rINI8JHNbj3iM6pn1P7Fj%e8PLt~#;WiI(!;-#|QXJ2) zv5_Ul5%;~fs?_*ds4-5?bk&B!spu3{QVK+lzxZ>RKu(zM3u59cd2EnsZVWa1>eZu2 zkGVyfWLc$S$#Ay3QkBi}NBx^(a2KKR{R98bY6yg5*hHIYW>PC0LP;s{1q56O1YR1N zNIpMqISkFU_{AHy5^h?=ZZ&7z5PJj1^R=fkL&o&c_{)RpSi!lh_=4tCl2NdqkZ5$a z0L84i@@&FWoN(38Er*rARCvxOwQIsA&4@;hNnSpWWQ{E!m3Ap2I$avdwqlV2?b~sQ zEHV5#M8N739OZ-0a^^m|I_1WWr>E}M6==DZFV)ST(|4AN%YLIclKqXh=WfEnl${&t zIYQH)on#TyUg`Mo|Hai06)w;Qkvgk%w{R0ZsvGO8Cq?n>O0_X8I7RjZBN8+3Otf4g zXk~RHZ-&SXNvKyoTxUa?0F#j2e9Q&KpTs5u<27>F8wHI%7Lds!!fltP1IzGwe{MD3 z`zS6_R3#!JV0KzGOA@0f<}9V^*C@Ah`)2-PdmS0M$d5U4{S&CXAS-S}5QqanO54{c z{;iPJYnmM>MU1|lmlOAA-+pMb-EKIEN5)aK5S-9|CsOCOR**&O$n7U1LKb8G&a=^} zJe$<ty=vm$8qAVs@y`?b31}Ayl}XL$?Wj`nRfdZ$1qNRaq<eIf%Ac~LMf9;<h1Fr{ z??2i7j6&vp(Bp)8Q5O4FW7RH6PHTzhC5pM6f7^KuDO>vAB&_hfrZ0Id?MV6^SOI}3 zJOrKnaOrwo(BnVmu>9JpQK}CfBBCm@B_Wsuc|qj{_9NHPw0HB_VSjtR>|WH4N;Por z1w7(Jy@4-1fX3(Dk8(Y5oz_{<J8u7kp1~|U<<$(>Fs_iA^q^`<d1DL2YWj%)eKTO| z^&yb}gXp}^3`8xh41$ZpYx@#rSKA!g6g$mGE=5B5<=F;j>!$y`^+yg@pcdoPnkwru zS5@UGENe<co2%(0TJ*j;MaYULy7^iz6)jChvhpM>R)Jyi9vlggDfld8N{j;Xl7LgS z<Bp*135f56gK)NTUe5j80g$?|rAKt~EN(>5hRmkUa$3kEmkec!F66up7t0(Ny$sH! zKcScweMsPQ#Of|OjTrY8%}XVY%GT8Hi8)jM)sC?*mRA1>-p%beE5)C1-&(|0^|G5? z({_%|h#txa+gt!;t@SS{)x6)(G9e1HL9R52-5iEug=H>w73G-8;yEG4c23rPJ?CFa zqN^~iQ%-S8(8WyhVWHE~`EJeJ;mvDg9=WoYP0t%yh}UHyUyv49ZYKNC)F&qLcVekt zCrW856S_|v+_+~Jb--`Dg5#TP^q5McOvWBYj&Pc`r^{gJ%Lpi@p3^)3T{XgjP)N0H zk5a1Gq`r)~sO$}`nJ_gdLR26fH1Ih()n4FfQ*b&TKA1O|_G*P%DbAryKA%^yHIiuF z<9I8n+h&P4*X6|16xqkY7S5D|=Ce7(9D^%_D%saB{h~j-lR|O|1C`Sjy`b1pNI%ic zVActtZz{$&*6)BHR$Zac@6&>VD6lTc5FiUhbrhF>GBiL{P8kAOKOx~Ff`s{Fgn5Iv z8-USeFW-gi@a4xlmaf_Pqb*~fkV)YR^AujI(D^u`TGMNUr8UdV`|izh)5C;|(uv93 zsRV0Id6;K_iR`#?Pz|rQgTE_h$M5X}sN<uAbuNy_gw}IY##ytQ9{o~SJ$ho~@$?3; ztcSdfmkgSwL&aDMY8Au?-dK#6pd7FnFNxtg?PY3t9xU-fxiZd_VsHFgiUcQ^%A5+n zKXvhK%_RNo=)I1n#0?l-b96VjkFMo$hK<&YlFhu!KgPJVbaCqRU32_7-cl(Sw9<zN zmSs&`^u@X5o3*dmRu0}}s~yqQ<P+u5-r6k@MSk@IZfOQ-o+-&QJNhP)9>XYPRhV8& zfuCO3p~9#*0oNqaXnBA^@t!H<j~%DYw;zxotfMf`s*~6P-(w8kjq<7cLPqorx7HX= z;eftgnGsJrO&QtK7GtoXq<(JBSAQa4Fn?OM!x=UV7}=R{7f@EA^L&56#!ANs(EWmk zLx6Bq7d<0jXM1m~T?@V*$(oijzu55y2_otmqS@(Vid3Srw8F<qzbufkw6*o?4KF|N zTFfl)AqC4=4g+kh0Ec4htCN+BK5N|+Ja<W*rtwVR8+|{BQ~B(XF%G~lW|fWxt?;W) zR~M~8OI1ruO17SmL&ZI3t0AAp%gmvzx_5=~FIw*p6sob&^6HI&iCFGIt*QZYS>U{t zCKop3&SvTiV~&b-98A>`=diBE#VW*%RonEMvJPdan~q5(=P+@TO`PQ2=_lDT^iYM9 z8z+n~&+*&UMhIfOWr0(3=BBuNLcFE>V>d~RL3#h&3?X}3fXZ3wA#GAa<S-8g(mA`J zIinAeDP>ZFp}@-A9dR(!R3jLoH0HV>$OOgK;o3tF2?hX&$3xoBa~f-|%ZPxB1HykL z1+zq!Hf&W!(9S&32}jYnBM);j!b-%pAICcEIwJ9KyH$ZEYZkNyV+AYxRgp8bO5ah8 zNUn@!^mqeA>DEMBlosTMtX#(pj0mQdB0yVU=H<q2np|l%?uH*%{(t~Gl9fDYrw0Pm zj)IYu)n$n1FRr%KYN_c}<QXEo=>oOfPx(Vg7AXa-@>v?risC%KeEX!w(2k#N<_1c~ z<BrtzT9O?tX2&VBaqjZd^M}WAX%`k2_L{G<!Huw?8c1l$Qew`rV);_C156(8@Qk(8 z^{><<_qUU;?!0^X&W&--vclSKg66w_I#sKMjASF)<?1Pn5!Z7AwThbx*?)-|UmSOz z-`XoF>fPR4Lx|pHf~(0ntyWy|O}{6=4bHza7(Q&!@wy+X&P<oGZ?6f_WW>prBGuR0 z56kSQn5g+-&gy6`a}c1V`bckWvLzW`n3>vL&!2!uwBxp?1qA;h@WaA_<zDtoX{^cK zDFXQED>vM}hD}wudyy9<LUN!BbW%K36SdVG`%1Q!xv(!1x*T4XqBZh_S+QbW-3K5e z;`#86v#n#NskWU(t94k(iyM2Fj4|3EX|g8yQW2(1#Y>*A2~B2*`a1)r-R`Tn((p|c zYJ|(BrLP9m$|)}cIo@aJNw11<S+$XNcRj5$gAwgRc9PDL$A(xNi=%3=#2A8Q1Bj+^ zW=)9f$Od_iseIy}h>Q}tCoE1Xg|ZBmz>~E`Mk!B^jHUV+TJdj8)!fYOZJAX>P0^R$ zN*;}zsWYO@NW@(pjob+ajQvia?Tw+Ye1mlcYM`w$*!c9iF(FLxAB!T<=(Wkss3xMG zMRUAd+2?rGS1h@ncFoKGE`x`3lk8|#yi+hx&QA|bN-TTn8FlH0ycRM=ls;|!JG*FB zlv#5$p?{lpmx%|C7~_)M%tWynmFM;|gQ<jKD&qney=&&Uf70o`9b+5bbFcKu-Aq$? z&K5ge^VJ_1F#48J!$k)(wU3EOuWgp5d)SN`Q-FjjuD~Ax4?xAI%M$Pi$A_yXOe;qu z^{CqJEDS#M>{8Emg&}-D*Vq3FrH^3)v>`9DVAI=|#7+(4r{_#mvkcc+8xxKM#87Wc zS(|@)XR)M3H-nqj#7ChFi@KVUWHyy*Gnpx~&+*k@rOz}B3yq;ZoqV6nj+8yS>h_t! z_ie6KftzAy8)l+=1VHMw)?oJ5pv0U!gcQRJfwO~<<_Zwc&vh%WqYtq|;Cbi7*l=Kv zW|A%gVvJ<cvp3pOb)!q{+xGVTfqG^X%*D$ItS=EF>@JDJxTTnqIc*NJU$110AB`fW z@+YY_8(&ybP}Jkx^A8@tK<RF2FZgq+ras{Io~=XBBbCBe6L6K`wW26s(PS7P5m#-? z0cjbw&e#!k#Yc9M_e>N-n&rhEg?|>kKmUq<xir2w1TAW}Z{R~6!zn!G+=RnM0(#4l zO%W$A82pfZ{D&XoCTk`!PJ>Wja9&G7H!Idf2UV|;!#I_(R6Fw=(_@!q0OsTYD=cB3 zJv7&eC_Uz4QF-i02ZoujDCT3FQSl>fFo;!}Tk*9ViBH+)zj}dVurtGpPS8Xp8||p& zv0^CT2=k)v!KJ7eCI({wR*nHXDHrL;J6{knqp(OVxl#GwH(WjMkKtR!okga04-@Z{ zTyz;OpLi*9G{x*W6AH`+$4}k&NU$+W9y#|&xJJ0pvpGyzDZgzBKJ`juU-`uUSeP77 z)zTpq!h--11gL+e4eUmb8S9BQ0naloR5O%EahHrFY1E_-v$v5-Hz9y@a!}>Q9Q3Zn z7R#g!Qc`4iv~tXHl1XC{#w=Z1kbn|2+6U(Aj6@sab`I=jmyL5)scwGJ26wI*7W>iD zHoBa<35|;S!o~>-KjUaBEt)lSL8mg%aO8kgc$pzf9wp!K00BSk=-;?mtZRcZNNBQj zlHyurk;`Y&#x-p8eR)}kTGM+e=%z?%3p>|dgjLys135bajukjONW#E*DT-gSNWuDc z;EZ2sb{KQktPn#gnNZQb?JZ0eOvs~1H^G`@u4=45)ift2bHK%|zTIwahO~yO8&P5y zNaQPEIy0!y!WaMc33{T(MZu0dsw$ql$L>Ek(eSl4c5vvm;l-E?W3-qmX*;$|S~8Y2 z!l7l&pgSp?wa8NI53y(bDnLK&`w3b{chJ-aMuXOxkZnBJ6A~a>xuYt6ZC?$2z8&8U z4dvex5j3+>5Jx4->f^Ku9-lfO*Xf5zg8sdAA)fn%^y}9zTz$VVK@%*k7uD{t?`u6y z=Tl2w=j~1`l?(_{&9Vq|rPzTfIkqj5F0^iUKjrtDBHff&qJ_$Dys5T7#PU7hp~En) z1_o=o6vlwsmB#3wJKk9-MHi2vc|lt@lbgilyJ?j%!Od@?q04WOML`C90G)uIpN*SO zyjT=J?K0{RJ!SlW14hijCj6QmhJC}s$Bi*>0M>@jiHL8s;;cr*N?lOrm1{*DbjRUu zm=z6V+@pI)jN(W~pq|4Kl+TL^V>IrK4*PNq2t@Jy_jmhTqbJjbF>{^-V+7~Q?JYc^ z1<c_H;jJ>>WQpb5-}n)>zl4(6jSS*F(mFy>A9IH`*dc>LvCV_+uTq6BFgo|7fsmbj zx`fO4Ir7h&H4M@rBMQpj!A2cWH5cUx<85}<UG&rlG|8V#T%}epNbgtb3J{!UM?E?{ zKtV0RdGx567VHod9+I!5S>suW*|W|P0(Wp(>W$g7f==Y5I4?Vk70(`zQ~&mpwaW@~ zK7wv7gh9tH0h_#oHF0OYnoqBHrHL*-8QH(h^Soi5kR`h5{H2|ZM~OrZkv!y;i+GKs z3GY=Dt^tbdOqUvAmlu|t8O*-zucuFuUeefTb0g-Pj2pl0fHHA`CgXpDrarJX+)5qD z=)T*_g3(7?n{|ca6pzITLlK|UX-iJMI+5n7BGcfB?_|cXlL2cxh%41LS`UtaQ|tkr z%e(1$$3uCL4p|p~o&@OXOegVSuiC3a9<Mc#E=tQdfLT$q?=baaS<y76uhv^`3pIEm z`aH*XLm)dqu0(|M!&s56W+7Bw@%qY;nQ&EWNG;!{#};yg9G7Dr9;!@$?|(tv9qymE zn?5OM$EfukH#CL?MA$VFSvSH$xF<&^ccZ3P)9&Jg%3*W|ijZOY2;)pDeYg{_pwU-? zGHq<xFIN>PnGnMyLBV(3NSIKP{RP8|B1X4kDD7p;Hj@<fEu!=Q54~V*u9s!w{3w&T z;CHCbhIo>G^_TDoLwG*ykD<=M1E#B=8(Nf!lMru$ysY=f+?)gI;=X>Zp}>7xLn<?O zOPY!3xfw!lIM}|>MT@Pcn34<n!)!HJNeF}TFu?^a|Lp0^JhP#{yMa1<;I9bPW(qkL z&q)4qL@&BVN5R1y4K!4!M)hC^ET)e_zh%2+&WBvoKdEKuB%!#tP(|MvkI=>#k(2la zhC@b~$F0v1P>c!em447#U)^YQX`lCg9p{W<DMv7=KHP<Lz9CXHx?u?~{zq;Vqylb3 z^O;hcW==Q99#rOsqwP3}c5WaDAYVc2K+L|1K-?+n!z!^Ss>&X^ur@a!b^$#CE}X&1 zj(HxVU-Jn$l>H-ejc|EyrFDqf?cm%fhN|@Gh^ZH4#v5kB<3mO}jet{1a1B+Bm7ZSm zbzFFPN&sQB^Tx_Be)OA><}EGVSIeK3NxFcEWq$~ryMkM3PW><nfWc8yK(-&~3+boX zr<P0(42oth<ReXTV(+(8Z_)iw0)zd|1VFGLNUPQEF0XficM4dPDgQ(kDaCqDn=Erw z(7GiGBwggrz7^MUm0cPpu$J{D<%X0FTJ^2!yKIjK7-bzqS}_z|&5%Gg6tba~fBli% zaUBtt#np!$v^)O8-k!LWVVYvvYO@JRED9>cZ=`vIkA(1>zt8sBEIw>ji>0AWS;)*y zWZoO07loOY64YdaJ$;*91X(3Q>-TvJhddhRY+9=zEdYp-x*!@HA3iMamL+FHZ97Jw zzXQ*L(1$gLC0<O;56FSH7cP3T^iUdemo<WZilmLnWk++??wV?yU~9DtGILUbm~S?c zU7az>(m^4usMbNm-H8E1-;3mM4o1|y3EXo;6@)>uP1cy^xS?oi96i9ou!tE`33@}> z(*B$WGd4U|a5!l(*(j>tqD=w{(GuIs4||?rOk1QI*`cm_2%7XdgZo~A_q3~#BF18m zcH9Llt%pE#<(O6ooAe>ax0G&?Wu*nTA#&BjQM~9S{>0MRh^A?ix^~+K1|PDE?=%qS z&@w?2;ZCq>pLytMr$66XoDi}6CfeyPso6cgt8M|AKM=8wh@wUxb)k9dU6EfW5&&5o zX}%$!HfBRU!ttQ(D}-TacmvUiAGN-<YZEM)G9#ai2@s?Z<m~GpxcqJbn>=yXJa1=u zTg0KjIBYc(2WTmE;~Hn@7Qf3IlhE0*QKp;GOgMvy=II#$Kr-uyr-z752~RK}__S@Q zO<37|6=R8}of~Q-Qiwy)WU)1ZT-*3d-NoilnXOCWDa>M-KYAwc%te4(SNpPclVVKa zRj<^Ye+PB^?n`fcePc8%{;|pCIowhnTv8Df3R8b8A7{+5qRwFF&qaF`sQ~5x;G+yb z>rLdFj@$*wwy?EbU*oWlKQ8dLdEIpj=tuRKf=}`EFB=0v;Ho-+hkRn2?kqQ2S#-MR z)BVO-)VRnZm!&QIhFBB1SG9p7MY-CBYWxxqCX*53Xi6$BjLP70!)ojv3_t#{fFJwA z$>nHk0eie5JT_!%R}0h4e(6CJB(*7j^1vAZ-MwYn(xmKJywYr$@Eu2OE+}rYrd8KS zD2Ckuu8g>I_t5LC$)57QLzikND1iGG;nzWp$D8KxQm+ce;vh@=H}3HbB}B4+|5rL= zAXd=g>1g^BcE`<i=f>g<(bzfZPx`gv^<dOH>!*bZAW$sh!x4g7(woF&F+JJwcIqAp zU+=Yx7@V<=AXr|28u`n8aS8i%SOb;Fyz}ntqOs$pcM}R16i<<c=ZYyyWTb<%<7t;G z<1-)C@kD0)pm?`40m=|gSyEvVFX-OTCThskubC2wC}zaMhQsPyBF)*X5g1cv0CV6( z=_H%BR#DsCDylm3H@|+2QAXifooE#x#zj7ReA}=(q#GN$`38ZO#(mXj`XScwx<Y)g zhM9B2JL#F>X3i0_q!E=A##w1d(|;Hf2j8?V!G~kRyDw-+m!6`4;!bE%EYo|&_489g zB_Q`FSn{~N#}}tbK_@4j1q0o+nwCa~H9ZWRNy|L6ROXzZyrI`XyA8R6<1!xg%m!|F z$4p7nyz1QqPi)3^O4696mY<#lwHA{2&d{*Q%7V7d!S+Pf{<XyR+Q&n&n;n$L0LyHI z0_?g`R8w2N;PBq&WrBr8=-b~M8D9F|QTp!cdtc$<t&+WI-LdgVd;=G5Yhe!?G?S1V z7@kjK+~v<|*KWNg?qHPlhB={c<2K^$Xgb_B@5W8r!F~Jb@hH7m37imCOpW7E_<mhR zfDL~(1fpD5Adoy!f>$jGZhL<Z(C=J!C@p$V=V`~CyH6*oa(2~fOdF_>sq7^p%^*ul z7efgflv%R`9bf@KqT@u241Zo|s~dKP_DVq17%Se-W2L8s2EV8=F^H+3)4|JE(i=rb zkQ6Pw#rA6>P%arQ@7;78BwZFaPB|V+UWz3swGyA|q;!Au<1U5ISj6HO3++Z97Dqk{ zJf^N6g+Wq$6-8T43R(<Wxtvba&BXjjXg@Du{`ax_3^nc;3unzyI&j9K<%oiOE+i>% zs`3kc{kjpZ0qqTh{+pI^O1X>y-0?wo%A4oT@ti@PNPn$_=hLunwu9P!QM?5bomI@| zJ-8ol{#;OeAJn|vkEJ#7Sko%l(`AdCO~JE3*j3l5X-NAwr2MTsuj`;@N(u^9L#Pcs zSf8y1;Ca2C{?`P4YH+_E7ov<mb1Y+}VJk<@xocR0T!GWtBi_=yGdr;89oF_@1|cLu ze$3|a1Ct9@px7=&pK<!=OrHUMQYT!)?lZ_*qh?>*y9=2=*@=Gi&I+eSX#WLI3ZgXg zuz-r!6y^P26|hIJUx=aIL*2hQ4kCiMIsfY1yQ>lSW0JfOPsXmMzP&nMN=~!^(d@X( z(peIPS&!J|&jhgzhjz#7OSxDHt3fWx7-MRUu!C7&rY`dj-Ph*^z|&V!^`D?anWKOa zLRXCk(O63md7QpiW;>1Nw2~PbwGgx+pc3{YwX1Z)MqL;ZAHXbf?SD8jr7z_KIj;U; zYM~#`ci=?+Lze-Kx{s+6l8^T+Wzxj7wgvYV9J<x!yK6T4g?~kT<{r}52Wu_?oY(mz zo8veF*YkegZt1Yf4$7`+o55d*MLC}v_BKkFcQ{sb$v74t$A=;wJYs?mzIo1R7X*5d z7LH6T&9EU^7^J7Dn~Jn*hsDDyLF;8v7dyDq+zH>9*38HcUM@cw^suU?sHcXsBz}35 zI#JoH{7pTEt{1rei!0nAA=wngOAkXQ+ha@<CoL@=dFzS0(<#mmO|9@xV&on-l?>zH z=W+fhWq)qi=rnhuwFGTq4HV;|JB5zZ;~8BJ+hmL}Y4oh--4J8Es9(A|FAf=@`J5#1 zGM!z*eka_}Mzqs$qlS^{UgS<MvTG`LrX%liFZiLHf{3ZTxoiE}Eq!CfgP1){V=csV z4*tu|(}!InC(=A8T<_HUkznv*3`gHnpZk|nS$?E+!tHe9ZFwtx6j1m?dj*}G)#z)F zc#ZvxXt4sBz(%|nZJ7{4wx`zLb$WSOymn{>UtYrBsiB&lr#=(%cH$-E@T&y0%F5h{ zHjfVjSvc&*HWDbzSGMsJK&ttPm`kspD1Ek512IW7J5D1o1PZ{wQsUk$7;x3&GHP!- zv<(@;;g)n@bL=aEv?PT3K}nhIg(Wqz`!Nzab#c$}$Zsb`RQNhX8__L%s?X<Su)c$6 z+w8=j-<?eIz1W!Z9Y~n-Tx>VI&Zt>?fe(8k3Bmlbxn8hkbM!00)wTd*t`tUnLDTiW z+5jTN2{$YBBw^q~vGh6iki6NjEj~$7!Oq()m5R602-|PUgPBGDX<&r|JFzPMfY(h0 z$D!9~M-UyCk-AB0f!?-SG0#=u+Kxywzm+?nv81gw3*x0u`Vfw|!3L}LgS|IO(7zJy zHpss?l|3mNKKv%Kf8dG#GUf0c`rgG_yqRD~K67UyY5hQ*Y}FHaUL@c?A3qG8^8v^) z=Bf50Coa0B<}`QcG;Z_X`J!Th#}s*l%SddW<GgYC;)7(d{xCfvW5wF1((S+dZpTH( zQR(N=y5lk6Hb3Eq`D-F7{f@tal}ez4L13&Knc5vCvvF6oml?Xm9Y1QPq#xa9j~l)y zlhr+BIUY1~VXA4s;84(4h%yvK1%ReU3zBz(OF`HvM2N@3>jATrnYK8Gs*u>e*kkV{ zfOntocpZD3g$j~kJ!VHt2SzdQh?jI3CX)C*f;}n5q_ovV)CPs*r+g;Uz9kQI)l&Vv z-hBQhqYC27r>z7s19GXd?jC5=D^>*+-lzNbJCo0Jl0fZ&v1n03RcKB{&qL&)ZaMuX zWi@<jPy)c|#fr9DEJz}p&GP_RtO7(AK!$PkOZZSh%IJHGsc`n`iz)1Tf4#2G3XDde zWreTXuc>>W;0EAbo#UElkC9RF7zldKUv4FzcHPPxz>a~v=NV{VSCDJ4(i<K~!w~9w zvz4@#A~laI=}hh<45%P>y7BCTMb?r@j3Yq(X1ti6T`UM)^=ROaI43>V=RtaZz%WK{ z+XJ@iD~R1Ox7j-gDuSdgU|8amG2+l>Vf@S6a(2r&4jle}1?UPF_0pfK5)U5T(Y=p1 zc>i(!4C!#m5Y}0T@`C~nEii3>MAr7Oye62<0lY}y@l|CJCgs;-;W5jwvN0Q*o3n7= zvbm^kOU2*MdIu(QUm#0pp_jMIi4mo2A4si~yuxoqC}6_qq^=%TBSui;WtEZ=^6XuF z3q<x%C{a?$-L+w-+ktuHrdZkj7Kg%3=>;Ct2c{$})*;7j*kX0E>ZX{f9z;*sng_OM z(P-zj4xy^ANs*UpWS3<)*fUnlnf!Y#_3Nd%(OH42?N=*UGBqZ^l%2rMkUI?+eG~rq z)<&%Ul)$_&Q{SJIzOQb^_$gy>?b#E7%EgE@tcQ?V+`Z*pFV}(<8Il{t9zLbS+!tTT z!BV#Dp4Gu9Wlu_2uov)E-VtvTu%lAj{fz-3TUchW@$2%ZyfOC1uir!B1+z_i>>7`o zr1JGzDrfL9&z7+{_M?9X$w?8+FoYWsFy~=S@UUlBE`O*a1~?Ld$3B6BgU2O*ZT{w% z@x@E?h2{marQmy~Q3K9K$p%bH=|FmV8y0>!lc!AII`dt?;lts1_4wmghhZhTC{s%J z;DQNTiEYqClS|R;all6n6eQ`-!4*~1`Yi+;7K|qMh2WTkpBRTIW0y+{I*v~Aa4=C6 z1{^Y)==^44Ii*el6eEpK$n*mk6h%urO6CNEbpYVcl}6H(fIkvJjVUD%dN%6e(OFU| zgRpm<1dB_sY#pmio%1`?6NW#s<Q*W{u2qe)gJpnZ1$X}P45YvXdF6woVClTJB4JD> zT6S%6#6h86_N~eX2E+`QSp3D(V|<0^vu301Gw?Jydp&Ndd%Ml<F){P3jS#zoMjtEC zzk9tQgRA%;L^@ENd3DR3cl_laG3gc=eLO!_?8jA!&Ci7wzSg$L52sI(+kcpk{9|Re zWaUeeT^N^6fZ3XX)62?n>KJk<I#Mt{w~6hX$`$&yS!-Z32g!J9bhxrT1u8L(62>k# zvrw?DEsd9*&nm13$o()v^E)csPQIXVL|O-5L8|KKw~|}KfM^&48i_sKUHsudsv7q? zD4?(QVIAWYK>xqj^>tnG)WR_G6d?07-1GDosNG$wJ(e<BFVxt9bIv&uXU!<!6{3oZ z7@;|B-+|ot`#o4ze6O(+611P-+G-zTbg=ukpL!#Os^D_W!N*Ng9@?;Wr8@y|?1gB3 zrDJ<B4h9@ge(J7UQ)PUJtzXbKE*5`qz@bE#6^x)LxeJ2RLjbW_D{LY+VoGK!8A-M> zvI=L6-ANSLsugL`XRGSSuk_ha%z-0jVEiWBxndUn_Qf1DGmx?Qv9cixqR)<uWETex zZ7T&8>uQLJ1<lAy?m8&-IRB>)W_SV}<j<!=n0*&M+}wdDmb{^@-er}zY+X%7Bb-@j z_|r{i0qtKQvT+Fyfd0_j<p1V_RqPtWEeMOL*pPhVvg<BA=PkW>B%HuSQTuaM;=v=j zFB)seF#nI$FO)x4I&*}w`?!d;7zxXQ50xykJ7v#qCDw8J@G2Bo{g|2F4%y@2YYuG0 z3T~ag9<#EW*?z}}5c6QJ2a83FNOt3taoaGK{<8mBM&-&eyU;@H;;~KRP)mQ$7+yo8 zAYp8p3#k(~BA@MK9y0MwgxPPB%psgGbps}{HUg$0;Mj-dR)a1`MMnb8$$09WkD*pK z1H-em&4U7AI8vOr|IVMI%xQ%D_RZRscIM<ml(zf72pSR*V-JLI7q;gttpD{N|K~RF zO21xJXEOSD=(Ny>4n}vdV8FuG{W7PMRnc3=6_}Dg`fbkB*`|hZigiRkPmMZshf!in zl-aW~3<${*XBO;+3??l|$UsBwAu8JX68eoq=Y~~5Tli+t%G9e}DRkosGU@*?eJ_d% zk7)=I10t%v5Jr!KiG~PyEfOM%FeI7#U>vHy1)@C*hEv|hXKf|;`rBPFTcdRwGG<O1 zfw_ewTdQtHc>N<<=0-Fgk~qNsInZF6ODTRBLe;2E`HAQ5W%-x>^^rvz!HXKYU*Z11 zqd(w?f`?ImnRW26oH5gx`{d=xPbW)l!(_`azQvg+$oL_oX`}o7u*VyOmEP`@kp($P z+2y$Bld#Vj07PV|*XXdv?ZK$+h82!zPd+v2=Q0pU*oGnv8N~tdLzRPvlsga7j9W>n z>^%>g;_GS16<qf?!WHk53zNgMHTxgj96EY|273s(uL2EeX9l0xJombVfB5y6F@O<_ zVIF-3M}>Z7Huf2^QPvS<9+u-L*|ML!BK_eUOXC#9JY3)QKt7}k-3|n7`Wg&XXBEOg z&czR{!sQ1Z=iqBKnt8C3J;pFPx+<@I2=d1h3YKiGKxzmy4#L6KaJwP-8&R8dM%#mH zr{4INd+%5i0~pa)tgE69)K!W7PD}tE<|zBfOSd@QzOCriiK)BJRE+uj0ZkGPR@8pz z`2WE?z|*p-+Pm(8*Lg^`-s>5LjsqBH0meuRL4g}vtv}uR>*syH{@|^bs^b776z8I- zeF2BG?^*2|V7mMf`N@ykzMMLJj%So@>nsz(LWETVc0a{!$OaD`132{cG6Jy<wswY> zX^Y0bWOnEnFq0N}or$CbU<lVBB--(%bluXkfA`T1YrbCIoB%Wu)ovu50BOK|=;!^5 zpVe&krX9CpOr|?OU92wPwWXp3ieMOmjiF;dL~Q6d5O%>=*3!$Mga|O|Ajlo4GtR4h zs^;uP=U=zz30G&kF9s}PL8ITIuYtNMiQ*k1v`kAh+Y$|$M&lo*KVLU@_9YXx-jHtg zl&YeW+!s6b!i;DFqPLI?3CqwibR4j&2Yn|ymJ}ejPE>smWe=%;0Bur9=X=eEKY8_? zFTU*cbVWfTl)yDfltDQl;79}>QXF`g;{F={@w*d_J1Vd0<RW{+3<E;!Nw!c$6OZb$ z9J02#>JV@Y9Ye?dL598=rmFHsnDFPOsM-$dVKEt1k<!g;yC!^o$K#*8v~$OH7rJ+3 z>VAde;u!-5jllv(EPzOTu#eam|87`8mi;#ujGsNX$aiE>l6#I#=t>cUfc^{zbg!Nk z20wDWf2a=d{P_2Y{!eu0@tsr$*++GN_c0hEHqds}e(pI@8}WVF-#Wj2&COuu0sZt< z-H$$DA8iQ(IH$j{?(4qy+28)PLDlyLWxJWPZ3Wl^zZ6&z6jQ==zRcBYn^TuR^+Cn5 zPrvxODTYae6TG6|DT4(K?1#PzeYh^M48#!kUW$FqoH{;b_LNci<4beKu)ICLc|{fW znoPdpmF;Gw?ln7nho&L2GIadVy@-BflqtT@&AMZj#EBZ45E1|!clV(!b1+B-Rgui7 zY3!=mysNhEwYNX2Men5|avX5PzmF{`9~5Zp4{*eTM=bl0VgMu-Orn3qm~&$vWV^rp z7&?ZI|F1`^lJB+oRvd81aWRZUOXUY0blhKs75a&Ni192V4lss*W9S$<4i0!E+U`?M z03dP#hM~l@vtIykpx}WRFc1>}NnfBb1RO)h&~b2pLrnk-iNHeLUzTyOfMXy4A|wEm zA<!5)hK}zZJk$h#4;V1;9Vo5Pha1!V&`0!suKW;i3>`zqfyX)e1CT^Op&m?SKiG$` z4=@=5j-g}dIQYPUeprS2T`2f>dF*S=%Mfr39Ye=~0SCTop!lIF?GR`T9Ye>#1&{CL c_+J4A0HBD}iN<JjL;wH)07*qoM6N<$f<_VDx&QzG literal 0 HcmV?d00001 diff --git a/app/design/frontend/magento_plushe/js/navigation-menu.js b/app/design/frontend/magento_plushe/js/navigation-menu.js index a91566ec9ce..20856c3df59 100644 --- a/app/design/frontend/magento_plushe/js/navigation-menu.js +++ b/app/design/frontend/magento_plushe/js/navigation-menu.js @@ -146,6 +146,10 @@ }, _checkToCollapseOrExpand: function() { + if ($("html").hasClass("lt-640") || $("html").hasClass("w-640")) { + return; + } + var navWidth = this.itemsContainer.width(), totalWidth = 0, startCollapseIndex = 0; @@ -248,6 +252,7 @@ .addClass(this.options.topLevelHoverClass); }, this)); } + $(menuItem) .data('opened', true); } else { @@ -357,19 +362,27 @@ this._showMenu(); } e.stopPropagation(); + this.mobileNav.scrollTop(0); + this._fixedBackLink(); }, this)) .on('click.hideMenu', this.options.pageWrapper, $.proxy(function() { if ($(this.element).data('opened')) { this._hideMenu(); + this.mobileNav.scrollTop(0); + this._fixedBackLink(); } }, this)) .on('click.showSubmenu', this.options.titleWithSubmenu, $.proxy(function(e) { this._showSubmenu(e); e.preventDefault(); + this.mobileNav.scrollTop(0); + this._fixedBackLink(); }, this)) .on('click.hideSubmenu', '.action.back', $.proxy(function(e) { this._hideSubmenu(e); + this.mobileNav.scrollTop(0); + this._fixedBackLink(); }, this)); this.eventsBound = true; @@ -378,12 +391,12 @@ _showMenu: function() { $(this.element).data('opened', true); - this.mainContainer.addClass(this.options.openedMenuClass); + this.mainContainer.add( "html" ).addClass(this.options.openedMenuClass); }, _hideMenu: function() { $(this.element).data('opened', false); - this.mainContainer.removeClass(this.options.openedMenuClass); + this.mainContainer.add( "html" ).removeClass(this.options.openedMenuClass); }, _showSubmenu: function(e) { @@ -407,6 +420,12 @@ submenu .closest('.navigation > ul') .removeAttr('style'); + } else { + submenu + .closest('.navigation > ul') + .css({ + height: submenu.closest('.submenu.opened').outerHeight(true) + }); } }, @@ -421,10 +440,10 @@ items.prepend(actions); - submenu - .css({ - height: $(window).outerHeight(true) - 1 - }); +// submenu +// .css({ +// height: $(window).outerHeight(true) - 1 +// }); }, this)); }, @@ -437,6 +456,13 @@ this.toggleAction.insertBefore(this.options.toggleActionPlaceholder); this.mobileNav = $(this.element).detach().clone(); this.mainContainer.prepend(this.mobileNav); + this.mobileNav.find('> ul').addClass('nav'); + this._insertExtraItems(); + this.mobileNav.scroll($.proxy( + function() { + this._fixedBackLink(); + }, this + )); this._renderSubmenuActions(); this._bindDocumentEvents(); @@ -454,6 +480,78 @@ .off('click.hideSubmenu', '.action.back'); this.eventsBound = false; + + this._applySubmenuStyles(); + }, + + _insertExtraItems: function() { + if ($('.header > .panel .switcher').length) { + var settings = $('.header > .panel') + .clone() + .addClass('settings'); + + this.mobileNav.prepend(settings); + + settings.wrapInner('<div class="content"></div>'); + settings.prepend('<div class="title">Settings</div>'); + + settings.find('> .title') + .dropdown({ + autoclose: false, + menu: '> .content' + }); + + settings.find('.switcher.language .options > strong') + .dropdown({ + autoclose: false, + menu: '.switcher.language .options > ul' + }); + + settings.find('.switcher.currency .options > strong') + .dropdown({ + autoclose: false, + menu: '.switcher.currency .options > ul' + }); + } + + if ($('.header > .content > .links li').length) { + var account = $('.header > .content > .links') + .clone() + .addClass('account'); + + this.mobileNav.prepend(account); + + account.find('.customer.welcome > .customer') + .dropdown({ + autoclose: false, + menu: '.customer.welcome > .menu' + }); + } + }, + + _fixedBackLink: function() { + var linksBack = this.mobileNav.find('.submenu .action.back'); + var linkBack = this.mobileNav.find('.submenu.opened > ul > .action.back').last(); + + linksBack.removeClass('fixed'); + + if(linkBack.length) { + var subMenu = linkBack.parent(), + navOffset = this.mobileNav.find('.nav').position().top, + linkBackHeight = linkBack.height(); + + if (navOffset <= 0) { + linkBack.addClass('fixed'); + subMenu.css({ + paddingTop: linkBackHeight + }) + } else { + linkBack.removeClass('fixed'); + subMenu.css({ + paddingTop: 0 + }) + } + } } }); })(window.jQuery); \ No newline at end of file diff --git a/app/design/frontend/magento_plushe/js/responsive.js b/app/design/frontend/magento_plushe/js/responsive.js new file mode 100644 index 00000000000..a85048b0ce3 --- /dev/null +++ b/app/design/frontend/magento_plushe/js/responsive.js @@ -0,0 +1,67 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +; +(function($) { + 'use strict'; + + $(document).ready(function(){ + mediaCheck({ + media: '(max-width: 640px)', + + // Switch to Mobile Version + entry: function() { + // minicart + $('.action.showcart').addClass('is-disabled'); + + $('.action.showcart').on( "click", function() { + if ($(this).hasClass('is-disabled')) { + window.location = $(this).attr("href"); + } + }); + + + $('.action.toggle.checkout.progress') + .on('click.gotoCheckoutProgress', function(e){ + var myWrapper = '#checkout-progress-wrapper'; + scrollTo(myWrapper + ' .title'); + $(myWrapper + ' .title').addClass('active'); + $(myWrapper + ' .content').show(); + }); + + $('body') + .on('click.checkoutProgress', '#checkout-progress-wrapper .title', function(e){ + $(this).toggleClass('active'); + $('#checkout-progress-wrapper .content').toggle(); + }); + + }, + + // Switch to Desktop Version + exit: function() { + // minicart + $('.action.showcart').removeClass('is-disabled'); + } + }); + }); +})(window.jQuery); diff --git a/app/design/frontend/magento_plushe/js/theme.js b/app/design/frontend/magento_plushe/js/theme.js index 81262c4b16f..3f59db28cde 100644 --- a/app/design/frontend/magento_plushe/js/theme.js +++ b/app/design/frontend/magento_plushe/js/theme.js @@ -106,10 +106,18 @@ } } - $('[role="navigation"]').navigationMenu({ - responsive: true, - submenuContiniumEffect: true - }); + if ($('[role="navigation"]').length) { + $('[role="navigation"]').navigationMenu({ + responsive: true, + submenuContiniumEffect: true + }); + } else { + $('<nav class="navigation" role="navigation"></nav>').navigationMenu({ + responsive: true, + submenuContiniumEffect: true + }); + } + }); })(window.jQuery); \ No newline at end of file diff --git a/app/design/frontend/magento_plushe/less/lib/navigation.less b/app/design/frontend/magento_plushe/less/lib/navigation.less index 5c1f1cbf41e..6b1bd5ccd97 100644 --- a/app/design/frontend/magento_plushe/less/lib/navigation.less +++ b/app/design/frontend/magento_plushe/less/lib/navigation.less @@ -243,6 +243,10 @@ z-index: 2; .clearfix(); + &:empty { + display: none; + } + > ul > .level-top { display: inline-block; line-height: 1.2; @@ -437,21 +441,22 @@ } @media only screen and (max-width: 640px) { - html { - height: 100%; - min-width: 0; + html.opened { overflow: hidden; } body { - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - position: relative; - height: 100%; - width: 100%; - overflow: hidden; &.opened { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + position: relative; + height: 100%; + width: 100%; + overflow: hidden; + .navigation { left: 0; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); } .page.wrapper { margin-right: -86%; @@ -529,10 +534,11 @@ left: -86%; height: 100%; background: @primary7; - overflow-x: hidden; + overflow: auto; border-right: #b6b8af 1px solid; .box-sizing(); .transition(left .3s ease-out 0); + ul { margin: 0; padding: 0; @@ -540,7 +546,8 @@ display: none; } } - & > ul { + + .nav { .transition(left .3s linear 0); position: relative; overflow: hidden; @@ -549,18 +556,21 @@ padding: 0; background: @primary7; .navigationLink(); + > a span { + color: @primary6; + } &.parent { &:after { display: none; } > a { position: relative; - .iconAfter(@content: @icon-arrow-right-thick, @size: 18px, @font: 'icons'); + .iconAfter(@content: @icon-arrow-right-thick, @size: 14px, @font: 'icons'); text-transform: none !important; &:after { position: absolute; width: 18px; - top: 12px; + top: 15px; right: 17px; left: auto; opacity: 1; @@ -573,86 +583,232 @@ } } + + .action.back { + a { + background: @primary6; + position: relative; + color: @primary7 !important; + border-bottom-color: transparent !important; + cursor: pointer; + .iconBefore(@icon-arrow-left-thick, 14px, 0, "icons"); + &:hover, + &:active, + &:visited { + color: @primary7 !important; + background: @primary6 !important; + } + &:before { + position: absolute; + top: 15px; + left: 3px; + } + span:before { + content: ""; + } + } + &.fixed { + position: fixed; + top: 0; + left: 0; + width: 86%; + z-index: 1; + -webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.6); + box-shadow: 0 1px 5px rgba(0,0,0,0.6); + } + } + + .parent { + &:after { + display: none; + } + > a { + position: relative; + .iconAfter(@icon-arrow-right-thick, 14px, 0, "icons"); + &:after { + position: absolute; + top: 15px; + right: 17px; + } + } + .submenu { + .navigationSubmenu(); + } + } } - .action.back { + + .account.links { + .resetList(); + > li > a { + background: @primary1; + padding: 10px 20px; + font-weight: 600; + } a { - background: @primary6; + text-transform: capitalize; position: relative; - color: @primary7 !important; - border-bottom-color: transparent; + display: block; + padding: 10px; cursor: pointer; - .iconBefore(@content: @icon-arrow-left-thick, @size: 18px, @font: 'icons'); + font-size: 18px; + border-bottom: 1px solid @primary2; + font-weight: 400; + color: @primary6; &:hover, - &:active, &:visited { - color: @primary7 !important; - background: @primary6 !important; + color: @primary6 !important; } - &:before { - position: absolute; - top: 12px; - left: 3px; - } - span:before { - content: ""; + &:active { + background: #dbdcd7 ; } } - } - .parent { - &:after { + .link.compare { display: none; } - > a { + .customer.welcome { + display: block !important; + background: @primary1; + padding: 0 10px; + border-bottom: 1px solid @primary2; + .customer.name { + position: relative; + display: block; + padding: 10px; + cursor: pointer; + font-size: 18px; + font-weight: 600; + .iconAfter(@icon-expand, 16px, 0, "icons"); + &:after { + position: absolute; + top: 10px; + right: 7px; + } + &.active:after { + content: "\e011"; + } + } + .menu { + margin: 0; + padding: 0; + display: none; + > ul { + margin: 0; + padding: 0; + position: relative; + float: none; + border: none; + background: @primary7; + li { + margin: 0; + } + } + } + &.active { + border-bottom-color: transparent; + .menu { + display: block; + } + } + } + } + + .settings.panel { + border-bottom: 1px solid @primary2; + background: @primary1; + > .title { + font-weight: 600; position: relative; - .iconAfter(@content: @icon-arrow-right-thick, @size: 18px, @font: 'icons'); + padding: 10px 20px; + cursor: pointer; + font-size: 18px; + .iconAfter(@icon-expand, 16px, 0, "icons"); &:after { position: absolute; - width: 18px; - top: 16px; + top: 10px; right: 17px; - left: auto; - opacity: 1; - z-index: auto; } } - .submenu { - .navigationSubmenu(); - } - } - } + > .content { + display: none; + margin: 0 10px 10px; + background: @primary7; + border-bottom: 1px solid @primary2; - .action.toggle.nav { - display: block; - margin-top: 19px; - position: absolute; - top: 0; - left: 20px; - font-size: 0; - .iconAfter(@content: @icon-menu, @size: 32px, @font: 'icons'); - .iconHideText(32px); - cursor: pointer; - &:before { - position: absolute; - width: 100%; - height: 100%; - left: -100%; - top: -20px; - padding: 20px 0; - content: ""; - } - .active-nav &:before { - position: fixed; - padding: 0; - left: 86%; - right: 0; - top: 0; - bottom: 0; - } - } + .switcher { + padding: 10px 10px 15px; + display: block; - .header { - padding: 0; - position: relative; - margin-bottom: 35px; + &:first-child { + padding-bottom: 0; + } + .label { + font-weight: 400; + color: @primary6; + font-size: 16px; + display: block; + padding-bottom: 5px; + } + .options { + display: block; + + strong { + color: @primary6; + display: block; + position: relative; + padding: 10px 40px 10px 20px; + cursor: pointer; + font-size: 16px; + .iconAfter(@icon-expand, 16px, 0, "icons"); + &:after { + position: absolute; + top: 10px; + right: 17px; + } + } + button { + display: none; + } + ul { + display: none; + position: static; + margin: 0 10px 10px; + padding: 0; + border: 0; + min-width: 0; + float: none; + background: none; + color: @primary6; + font-size: 16px; + + li { + margin: 0; + padding: 10px 20px; + border-bottom: 1px solid @primary2; + + a { + color: @primary6; + } + } + } + &.active { + ul { + display: block; + } + strong:after { + content: "\e011"; + } + } + } + } + } + &.active { + > .content { + display: block; + } + > .title:after { + content: "\e011"; + } + } + } } -} +} \ No newline at end of file diff --git a/app/design/frontend/magento_plushe/less/responsive/responsive.less b/app/design/frontend/magento_plushe/less/responsive/responsive.less new file mode 100644 index 00000000000..15ace45ff25 --- /dev/null +++ b/app/design/frontend/magento_plushe/less/responsive/responsive.less @@ -0,0 +1,2345 @@ +// /** +// * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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 design +// * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) +// * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +// */ + +@breakPoint1: 640px; + +.mobileAction { + .box-sizing(); + display: block; + margin: 0 auto 15px; + padding: 10px; + width: 100%; + max-width: 100%; + line-height: 1; + float: none; + text-align: center; + text-decoration: none; + text-transform: uppercase; + span { + font-size: 18px; + } +} + +.mobilePrimaryAction { + .mobileAction(); + background-color: @primaryActionBg; + color: @primaryActionColor; +} + +.mobileSecondaryAction { + .mobileAction(); + background-color: @secondaryActionBg; + color: @secondaryActionColor; +} + +///* Smartphones (portrait and landscape) ----------- */ +//@media only screen +//and (min-device-width : 320px) +//and (max-device-width : 480px) { +///* Styles */ +//} +// +///* Smartphones (landscape) ----------- */ +//@media only screen +//and (min-width : 321px) { +///* Styles */ +//} +// +///* Smartphones (portrait) ----------- */ +//@media only screen +//and (max-width : 320px) { +///* Styles */ +//} +// +///* iPads (portrait and landscape) ----------- */ +//@media only screen +//and (min-device-width : 768px) +//and (max-device-width : 1024px) { +///* Styles */ +//} +// +///* iPads (landscape) ----------- */ +//@media only screen +//and (min-device-width : 768px) +//and (max-device-width : 1024px) +//and (orientation : landscape) { +///* Styles */ +//} +// +///* iPads (portrait) ----------- */ +//@media only screen +//and (min-device-width : 768px) +//and (max-device-width : 1024px) +//and (orientation : portrait) { +///* Styles */ +//} +// +///* Desktops and laptops ----------- */ +//@media only screen +//and (min-width : 1224px) { +///* Styles */ +//} +// +///* Large screens ----------- */ +//@media only screen +//and (min-width : 1824px) { +///* Styles */ +//} +// +///* iPhone 4 ----------- */ +//@media +//only screen and (-webkit-min-device-pixel-ratio : 1.5), +//only screen and (min-device-pixel-ratio : 1.5) { +///* Styles */ +//} + +/* Smartphones (portrait) ----------- */ +@media only screen +and (max-width : @breakPoint1) { + html { + height: 100%; + } + + body { + padding-top: 0 !important; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + + html, + .columns, + .footer > .content, + .page.main > .page.title, + .page.messages { + min-width: 0; + } + + .columns, + .page.main > .page.title, + .page.messages { + padding-left: 20px; + padding-right: 20px; + } + + .column.main { + min-height: 0; + } + + .column.left { + padding-right: 0; + } + + .column.right { + padding-left: 0; + } + + .col1-layout .column.main { + float: none; + display: block; + } + + .col2-left-layout { + .column.main { + float: none !important; + width: 100%; + display: block; + } + .column.left { + float: none; + width: 100%; + display: block; + } + } + + .col2-right-layout { + .column.main { + float: none; + width: 100%; + display: block; + } + .column.right { + float: none; + width: 100%; + display: block; + } + } + + .col3-layout { + .column.main { + width: 100%; + float: none !important; + display: block !important; + } + .column.left { + float: none; + width: 100%; + display: block; + } + .column.right { + float: none !important; + display: block !important; + width: 100%; + } + } + + .column.main .block, + .sidebar .block { + > .title { + strong { + font-weight: 400; + font-size: 20px; + } + } + } + + .notice.global.site { + position: static; + } + + .outer.wrapper { + overflow: hidden; + position: relative; + } + + .active-nav { + height: 100%; + .outer.wrapper { + height: 100%; + width: 100%; + } + } + + .products.wrapper .products.list { + .item { + .product.actions { + opacity: 1; + visibility: visible; + .action.tocart, + .secondary { + visibility: visible; + width: 100%; + } + } + .secondary { + margin-left: 0; + border: none; + .box-sizing(); + position: static; + .action { + width: 100%; + padding: 10px 0; + display: block; + } + } + &:hover { + border: 1px solid transparent; + background: transparent; + } + } + } + + .search.results, + .category-view { + .toolbar { + .pager { + display: none; + .pages { + > ol { + line-height: 33px; + a, + strong { + padding: 0 5px; + } + } + } + } + .sorter, + .limiter { + select { + padding: 5px 10px 4px; + } + } + .modes { + float: right; + margin-right: 0; + margin-left: 0; + .mode { + span { + width: 18px; + &:after { + font-size: 18px; + width: 18px; + height: 18px; + line-height: 18px; + } + } + &.grid { + .iconAfter(@icon-grid, 18px, 0, "icons"); + .iconHideText(18px); + display: inline-block; + } + &.list { + .iconAfter(@icon-list, 18px, 0, "icons"); + .iconHideText(18px); + display: inline-block; + } + } + } + } + .toolbar.bottom .toolbar { + .pager { + display: block; + } + .settings { + display: none; + } + } + .products.wrapper.grid .products.list .item.product { + width: 50%; + .box-sizing(); + .secondary { + background: transparent; + .action.tocompare { + display: none; + } + } + } + .products.wrapper.list .products.list .item.product { + .product.photo { + float: none; + } + .product.details { + display: block; + padding: 15px 0 0; + text-align: center; + .product.name { + font-size: 18px; + } + .price-box { + font-size: 16px; + } + } + } + .product.photo { + .img.photo.container { + position: static !important; + width: auto !important; + height: auto !important; + img { + position: static !important; + width: auto !important; + height: auto !important; + } + } + } + } + + img { + max-width: 100%; + } + + .page.wrapper { + width: 100%; + float: right; + position: relative; + @tparams: margin .3s ease-out 0; + .transition(@tparams); + .active-nav & { + margin-right: -86%; + } + .navigation + .widget.static.block, + .breadcrumbs + .widget.static.block { + margin: 50px 0 0; + } + & + .widget.static.block { + display: none; + } + } + + // Header + .header { + padding: 0; + position: relative; + margin-bottom: 35px; + .switcher, + .links, + .panel { + display: none; + } + .content { + position: relative; + min-width: 0; + max-width: 100%; + padding: 0; + } + .logo { + float: none; + width: 100%; + text-align: center; + padding: 10px 0; + } + .block.search { + display: block; + height: 35px; + padding: 0; + margin: 15px 12px 0 0; + float: none; + text-align: left; + position: relative; + z-index: 13; + position: absolute; + top: 100%; + left: 0; + right: 65px; + .content { + padding-left: 65px; + } + .field { + float: none; + } + .label { + display: inline-block; + width: 32px; + height: 32px; + position: absolute; + top: 0; + left: 60px; + text-indent: -9999px; + z-index: 1; + } + .control { + width: auto; + float: none; + .input-text { + width: 0; + margin-right: 0; + height: 35px; + padding: 0; + margin-right: 32px; + border: 1px solid transparent; + box-sizing: content-box; + text-indent: 10px; + @tparams: all .3s linear 0; + .transition(@tparams); + &:focus { + margin-right: 0; + width: 100%; + padding: 0 65px 0 0; + border-color: @primary3; + } + } + } + .actions { + margin-left: -105px; + position: relative; + left: 65px; + .action.search { + background: none; + border: none; + span { + .iconAfter(@icon-magnifying-glass, 22px, 0, "icons"); + color: @primary6; + .iconHideText(22px); + &:after { + height: 24px; + line-height: 24px; + } + } + } + } + .search.autocomplete { + top: 35px !important; + width: 100% !important; + } + } + .minicart.wrapper { + position: absolute; + top: 100%; + right: 20px; + margin: 15px 0 0; + .action.showcart { + z-index: 1; + margin: 0; + color: @primary5; + } + .block.minicart { + display: none; + } + } + .widget.static.block { + display: none; + } + } + + // Toggle Nav + .action.toggle.nav { + display: block; + margin-top: 19px; + position: absolute; + top: 100%; + left: 20px; + font-size: 0; + z-index: 14; + .iconAfter(@icon-menu, 32px, 0, "icons"); + .iconHideText(32px); + cursor: pointer; + &:before { + position: absolute; + width: 100%; + height: 100%; + left: -100%; + top: -20px; + padding: 20px 0; + content: ""; + } + .active-nav &:before { + position: fixed; + padding: 0; + left: 86%; + right: 0; + top: 0; + bottom: 0; + } + } + + // Breadcrumbs + .breadcrumbs { + display: none; + } + + // Footer + .footer { + padding: 30px 0; + > .content { + padding: 0 20px; + } + .block.newsletter { + width: 100%; + float: none; + margin-bottom: 30px; + input[type="text"] { + height: 33px; + } + } + .links { + width: 45%; + margin: 0 5% 0 0; + float: left; + + & ul > li { + margin-bottom: 12px; + } + li { + display: block; + margin-bottom: 12px; + &:after { + content: ''; + } + a { + font-size: 16px; + } + } + & + .links li:first-child:before { + content: ''; + } + } + .copyright { + padding-top: 20px; + clear: both; + font-size: 12px; + color: @primary3; + } + } + + // * + // * Mage_Checkout + // * + // * Shopping Cart + // ----------------------------------------------------------------------------- */ + .checkout-cart-index { + .page.main > .page.title { + margin: 0 0 15px; + padding: 0; + h1 { + border-top: 2px solid @primary2; + display: block; + margin: 0 10px; + padding: 17px 0 0; + span { + font-size: 36px; + } + } + .checkout.methods.items { + display: block; + padding: 12px 10px; + } + } + .checkout.methods.items { + background: @primary1; + margin: 15px 0 0; + padding: 0; + text-align: center; + > .item { + background: @commonBg; + margin: 0; + padding: 0 10px 20px; + &:first-child { + padding-top: 20px; + } + } + .action { + float: none; + } + .checkout.paypal.after:after { + line-height: 1; + } + } + + // PayPal retina button + .paypal.checkout.paypal-logo { + background: @paypalRetinaButton no-repeat 50% 50%; + background-size: 100%; + max-width: 255px; + width: 100%; + input { + opacity: 0; + width: 100%; + } + } + + .action.checkout { + .mobilePrimaryAction(); + } + + // Cross-sell block + .block.crosssell { + border: 0; + padding: 0; + .content { + overflow-x: scroll; + } + .products.list.items.crosssell { + margin: 0; + white-space: nowrap; + .item.product { + display: inline-block; + float: none; + margin: 0 0 10px; + width: 43%; + .product { + white-space: normal; + .actions { + display: none; + } + } + .img.photo.container { + max-width: 100%; + } + } + } + } + } + + .cart { + // Main actions + &.main.actions { + .clearfix(); + .action { + &.update, + &.continue { + .mobileSecondaryAction(); + } + &.continue { + position: relative; + top: 0; + } + &.clear { + display: none; + } + } + } + + &.table.wrapper, + &.summary { + float: none; + width: auto; + } + + // Summary block + &.summary { + position: static; + display: block; + margin-left: -10px; + margin-right: -10px; + padding: 14px 10px; + .summary.title { + font-size: 22px; + padding-left: 12px; + } + .block { + font-size: 16px; + > .title { + padding: 10px 12px; + strong { + font-size: 18px; + &:after { + font-size: 26px; + } + } + } + .items.methods { + dd { + margin-bottom: 10px; + } + } + .fieldset { + font-size: 14px; + } + input, + select, + .action span { + font-size: 16px; + } + } + } + + &.table.wrapper.detailed + .cart.summary { + margin-top: 0; + } + + &.totals { + padding: 38px 10px 10px; + td, + th { + padding: 8px 0 8px 5px; + } + .mark { + padding-left: 9px; + } + .amount { + padding-right: 3px; + } + .mark, + .amount, + td:first-child strong { + font-size: 18px; + } + td:not(:first-child) strong { + font-size: 30px; + } + } + + // Cart products table + &.table.wrapper { + thead { + display: none; + } + .product.photo { + max-width: 60px; + position: absolute; + left: 0; + top: 25px; + span, + img { + max-width: 60px; + max-height: 60px; + } + } + + .col { + &.item { + display: block; + padding: 25px 80px 10px 70px; + position: relative; + min-height: 60px; + .product.name { + font-size: 18px; + margin: 0 0 2px; + } + dl { + margin: 0; + } + dd { + margin-bottom: 0; + } + } + + &.price, + &.subtotal { + display: block; + padding: 0 20px 5px 70px; + text-align: left; + &:before { + content: attr(data-label); + display: inline-block; + margin-right: 7px; + min-width: 65px; + } + span:before { + content: attr(data-label); + display: inline-block; + font-size: 12px; + margin-right: 7px; + } + } + + &.price.excl.tax + .col.price.incl.tax { + &:before { + visibility: hidden; + } + } + + &.subtotal.excl.tax + .col.subtotal.incl.tax { + &:before { + visibility: hidden; + } + } + + &.qty { + display: block; + position: absolute; + top: 15px; + right: 5px; + &:before { + content: attr(data-label); + display: inline-block; + font-size: 14px; + margin-bottom: 7px; + text-transform: uppercase; + } + + .col.subtotal { + padding-top: 8px; + padding-left: 70px; + } + input { + font-size: 16px; + } + } + } + + .item.info { + .clearfix(); + display: block; + position: relative; + font-size: 16px; + } + + .item.actions { + border-bottom: 1px solid @primary2; + td { + padding-bottom: 20px; + padding-top: 12px; + &:before { + display: none; + } + .action { + margin-left: 25px; + } + } + div.actions { + padding: 0; + } + .action.delete span:after { + margin-top: -2px; + } + } + + .items.data { + tbody:nth-child(2n) tr { + background: @commonBg; + } + } + } + } + + // * + // * Mage_Checkout + // * + // * One page Checkout + // ----------------------------------------------------------------------------- */ + + // Checkout progress block + .opc.wrapper { + float: none; + margin: 0 -18px; + width: auto; + + // Step title + > .opc .section { + > .step-title { + padding: 20px; + h2 { + font-size: 22px; + } + } + + &.allow > .step-title h2:after { + display: none; + } + } + + // Forms + .form:not(.login) { + font-size: 16px; + &:after { + display: none; + } + + .fieldset > .field { + display: block; + padding: 0; + width: 100%; + } + + input, + select, + textarea { + font-size: 16px; + } + + .field { + &.fullname + .field.company, + &.name-lastname + .field.company, + &.country, + &.taxvat { + margin: 0 0 10px; + } + .nested { + padding: 0; + .field { + margin-bottom: 0; + } + } + } + + .actions { + margin: 40px 0 10px; + position: relative; + text-align: center; + .action { + &.continue { + float: none; + padding: 18px 0 16px; + width: 90%; + span { + font-size: 24px; + line-height: 26px; + } + } + &.back span:before { + display: none; + } + } + .secondary { + clear: none; + float: none; + padding-top: 27px; + text-align: center; + } + } + + .choice input { + margin-top: 3px; + } + } + + // Gift messages + .gift.message { + dd { + margin-left: 0; + &.options.individual .product { + float: none; + } + } + } + + .gift-messages { + h3 { + font-size: 16px; + } + &-form { + ol, + ul { + list-style: none; + margin: 0; + padding: 0; + } + .item { + margin: 0 0 30px; + position: relative; + .details input, + .details textarea { + width: 100%; + } + .field:last-child { + margin-bottom: 10px; + } + } + .product-img-box { + position: absolute; + width: 60px; + left: 0; + top: 0; + p { + margin: 0 0 10px; + } + img { + max-height: 60px; + max-width: 60px; + } + } + .product-name { + font-size: 18px; + font-weight: 600; + margin: 0 0 10px; + } + .details { + padding-left: 70px; + } + } + } + + // Payment methods + .sp-methods { + dt { + font-weight: normal; + margin: 0 0 10px; + } + dd { + margin: 0; + padding: 0; + > ul { + list-style: none; + margin: 0; + padding: 5px 10px 15px 20px; + > li { + margin: 5px 0 0; + } + label { + display: block; + em { + display: none; + } + &.required:after { + color: @secondary1; + content: "*"; + } + } + .input-box > input, + .input-box > select { + width: 100%; + } + .v-fix { + display: inline-block; + } + } + } + } + + // Order review table + .order-review { + font-size: 16px; + .review.table.wrapper { + overflow-x: scroll; + margin-bottom: 10px; + } + .order.review.data { + th.col.item, + td:first-child { + padding-left: 0; + padding-right: 10px; + } + .items.data td { + padding: 10px 5px 5px; + } + } + th.col.item, + th.col.price, + th.col.subtotal { + white-space: nowrap; + } + th.col.price, + th.col.subtotal { + text-align: center; + } + th.excl.tax span, + th.col.incl.tax span { + font-size: 12px; + } + } + + .grand.total { + display: block; + .clearfix(); + .mark { + font-size: 16px; + white-space: nowrap; + } + .amount { + padding: 0; + } + } + + .checkout.submit.order .actions .primary { + float: none; + } + + .order-review .actions { + text-align: center; + .secondary { + float: none; + margin: 30px 0 0; + } + .action.checkout { + float: none; + padding: 18px 0 16px; + width: 90%; + span { + font-size: 24px; + line-height: 26px; + } + } + &.back span:before { + display: none; + } + } + + // Load indicator + .load.indicator { + left: 0; + position: absolute; + top: 10px; + width: 100%; + } + } + + // Your Checkout Progress block + .block.progress.onepage { + background: @primary1; + border-top: 1px solid @primary2; + border-bottom: 1px solid @primary2; + float: none; + margin: 35px -18px 0; + width: auto; + > .title { + margin: 0; + padding: 11px 22px; + position: relative; + cursor: pointer; + strong { + font-size: 18px; + font-weight: 600; + } + &:before { + content: @icon-expand; + font-family: "icons"; + font-weight: 400; + font-size: 20px; + position: absolute; + right: 20px; + top: 9px; + } + &.active:before { + content: "\e03a"; + } + } + > .content { + background: @commonBg; + display: none; + margin: 0 10px 10px; + padding: 10px; + } + dl { + margin: 0; + } + dt { + font-size: 20px; + font-weight: 200; + > a { + font-weight: 400; + margin-left: 20px; + text-decoration: underline; + } + } + dd { + font-size: 16px; + line-height: 1.4; + &:last-child { + margin: 0; + } + } + .separator { + display: none; + } + } + + // Header checkout progress button + .action.toggle.checkout.progress { + background: none; + cursor: pointer; + display: block; + float: right; + height: auto; + margin: -52px 18px 0 0; + padding: 0; + overflow: hidden; + width: auto; + } + + // Checkout login + .step.login.wrapper { + padding: 0 0 20px; + .block { + float: none; + font-size: 16px; + width: 100%; + &.guest { + margin: 0; + padding: 0; + &:before { + display: none; + } + .actions { + margin-left: 0; + } + } + } + .actions { + padding: 20px 0 0; + position: relative; + text-align: center; + width: 100%; + .secondary { + font-size: 14px; + margin: 15px 0 0; + } + .action { + &.login, + &.continue { + width: 100%; + span { + font-size: 18px; + } + } + } + } + } + +/* +Magento_Checkout +Multishipping +-------------------------------------- */ + + .multicheckout { + &.progress { + width: 100%; + float: none; + li { + display: block; + padding: 10px 20px; + text-decoration: none; + font-size: 20px; + font-weight: 600; + border-bottom: 1px solid @primary2; + color: @primary6; + &.active { + color: @secondary1; + } + } + + .form.address.edit { + float: none; + width: 100%; + } + } + &.form.address, + &.form.billing, + &.form.shipping, + &.form.overview, + &.success, + &.change.billing { + float: none; + width: 100%; + } + &.form.address { + .col.address select { + max-width: 100%; + } + .items.data { + display: block; + width: 100%; + thead { + display: none; + } + tbody { + display: block; + width: 100%; + } + tr, + td { + display: block; + width: 100%; + .box-sizing(); + } + .col.product { + .product.name { + font-size: 18px; + } + } + .col.delete { + border-bottom: 1px solid @primary2; + padding-bottom: 10px; + margin-bottom: 20px; + } + .col.qty { + text-align: left; + padding-top: 0; + } + } + } + .actions { + .action { + width: 100%; + display: block; + float: none; + text-align: center; + margin-bottom: 10px; + } + } + .title, + .subtitle { + .action { + .mobilePrimaryAction(); + } + } + > .block.shipping, + &.overview > .block.billing { + .box { + &.address { + float: none; + width: 100%; + } + &.method { + float: none; + width: 100%; + } + &.items { + overflow-x: scroll; + } + } + } + } + + // Login page + + .customer-account-login { + .page.title { + display: none; + } + } + + .login.container { + padding: 20px; + margin: 0 -20px; + .block { + float: none; + width: 100%; + > .title { + margin-bottom: 15px; + } + .actions { + position: static; + text-align: center; + bottom: 0; + width: 100%; + margin: 0; + padding: 0; + .secondary { + float: none; + margin: 15px 0 0; + } + } + &.login { + padding: 0; + .actions { + margin: 20px 0 0; + } + } + &.new { + padding: 0; + .actions { + margin: 20px 0 0; + } + } + } + .action.login, + .action.create { + .mobilePrimaryAction(); + } + } + + .form.login { + .fieldset.login { + .field { + .label { + padding: 0 0 5px 0; + display: block; + width: 100%; + float: none; + font-size: 16px; + text-align: left; + } + .control { + width: 100%; + } + } + } + } + + /* Registration */ + .form.send.friend, + .form.address.edit, + .form.edit.account, + .form.search.advanced, + .form.orders.search, + .form.contact, + .form.password.forget, + .form.create.account, + .form.wishlist.share, + .form.password.reset, + .form.add.tag, + .form.paypal.review { + .fieldset { + width: 100%; + padding: 20px; + margin: 0 -20px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + .legend { + margin: 0; + padding: 0 0 10px 0; + background: transparent; + } + > .field { + width: 100%; + display: block; + padding-right: 0; + } + } + .action.save, + .action.submit, + .action.add { + .mobilePrimaryAction(); + } + .actions { + width: 100%; + margin-top: 15px; + .primary { + float: none; + } + .secondary { + margin: 15px 0 0; + float: none; + text-align: center; + } + } + .fieldset.create.account { + &:after { + content: attr(data-hasrequired); + position: relative; + } + } + } + + .form.search.advanced, + .form.orders.search, + .form.contact { + padding: 20px; + margin: 0 -20px; + .actions { + padding-right: 0; + margin-top: 20px; + text-align: center; + } + .action { + .mobilePrimaryAction(); + } + .fields.range { + display: table; + width: 100%; + > .field { + display: table-cell; + width: 50%; + } + } + } + + .form.contact { + .fieldset { + .field { + &.comment { + width: 100%; + margin-left: 0; + } + } + } + } + + .form.send.friend { + .actions > .primary { + .action.submit { + float: none; + margin-left: 0; + } + float: none; + .action.add { + margin-top: 10px; + } + } + } + + /* + * Mage_Customer + * + * Account + ----------------------------------------------------------------------------- */ + .col2-left-layout.account { + .column.main { + display: block; + width: 100%; + float: none; + } + .column.left { + display: block; + width: 100%; + float: none; + } + } + + .my-account > .actions, + .billing-agreements > .actions, + .recurring-profiles .buttons-set, + .newsletter.manage > .actions { + text-align: center; + margin-bottom: 20px; + } + + // Account navigation + .block.account.nav { + .content { + margin: 0 -20px; + .items { + > li { + margin-bottom: 0; + a, + strong { + display: block; + padding: 10px 20px; + text-decoration: none; + font-size: 20px; + font-weight: 600; + border-bottom: 1px solid @primary2; + color: @primary6; + } + &.current strong { + color: @secondary1; + } + } + } + } + } + + // Toggle account navigation + .page.title { + .toggle.accountnav { + padding-top: 12px; + font-size: 16px; + background: transparent; + cursor: pointer; + } + > .action { + .mobilePrimaryAction(); + } + } + + .block.dashboard { + .box { + float: none; + width: 100%; + margin-bottom: 15px; + } + .recent.orders { + .col.shipping { + display: none; + } + } + &.orders { + overflow-x: scroll; + } + } + + .block.dashboard:not(.welcome):not(.orders) { + .content { + padding: 20px; + margin: 0 -20px; + } + .subtitle { + margin-bottom: 10px; + } + } + + .data.table.orders { + margin: 0 -8px; + td, + th { + padding: 10px 8px; + &.col.actions { + .action { + display: block; + &:last-child { + margin-right: 0; + } + } + } + } + .col.shipping { + display: none; + } + } + + /* Address book */ + + .block.addresses:not(.dashboard) { + .content { + padding: 20px; + margin: 0 -20px; + } + &.default { + float: none; + width: 100%; + } + &.list { + float: none; + width: 100%; + } + } + + .form.newsletter { + .action.save { + width: 100%; + } + } + + .my-account { + .tags.items.cloud { + .item { + font-size: 18px; + } + } + } + + /* + My Account -> Billing agreements + -------------------------------------- */ + .billing.agreements { + .form.new.agreement { + .formCols(100%); + .action.create { + width: 100%; + padding-top: 7px; + padding-bottom: 6px; + } + } + } + /* + My Account -> Downloadable products + -------------------------------------- */ + .downloadable-customer-products { + .my-account { + overflow-x: scroll; + } + } + + /* + My Account -> Wishlist + -------------------------------------- */ + .review-customer-index { + .my-account { + overflow-x: scroll; + } + } + + /* + My Account -> My Reviews + -------------------------------------- */ + .my-account { + .form.wishlist.items { + overflow-x: scroll; + .actions { + .primary { + float: none; + .action { + .mobilePrimaryAction(); + } + } + .secondary { + float: none; + .action { + .mobileSecondaryAction(); + } + } + } + } + } + + /* + * My Account -> My orders + * + ----------------------------------------------------------------------------- */ + .sales-order-history { + .my-account { + overflow-x: scroll; + } + } + + .order.details { + .order.toolbar { + clear: both; + float: none; + .action { + margin: 0 0 10px; + display: block; + font-size: 18px; + } + } + .block.order { + float: none; + width: 100%; + padding: 0; + .content { + padding: 20px; + margin: 0 -20px; + } + } + .order.info { + > dt { + margin-bottom: 15px; + } + > dd { + padding: 0; + background: @primary7; + margin: 0 -20px; + .items { + .item { + float: none; + margin-right: 0; + a, strong { + display: block; + padding: 10px 20px; + text-decoration: none; + font-size: 20px; + font-weight: 600; + border-bottom: 1px solid @primary2; + color: @primary6; + } + strong { + color: @secondary1; + } + } + } + } + } + .subtitle.caption { + margin-bottom: 20px; + } + .additional.details { + .order.comments { + padding: 20px; + margin: 0 -20px 20px; + } + } + > .actions { + text-align: center; + margin-bottom: 20px; + } + &.items { + overflow-x: scroll; + } + } + + // Widgets + .widget.static.block { + margin-bottom: 15px; + } + + /* Product Page */ + .col1-layout { + .columns { + padding-left: 18px; + padding-right: 18px; + } + .column.main { + float: none; + } + } + + .product.info.main, + .product.photo.main, + .product.media, + .product.data, + .box.tocart .field, + .box.tocart .actions, + .product.photo.thumbs { + float: none; + width: auto; + max-width: 100%; + } + + .product.photo.thumbs { + padding: 0; + overflow-x: auto; + white-space: nowrap; + -webkit-overflow-scrolling: touch; + .item.thumb { + display: inline-block; + margin-right: 5px; + position: relative; + vertical-align: bottom; + white-space: normal; + span { + height: auto !important; + width: 100% !important; + max-width: 100%; + img { + border: 2px solid transparent; + position: static; + height: auto !important; + width: 100% !important; + max-width: 100%; + } + } + .active { + img { + border: 2px solid #ff9600; + } + } + } + } + + .box.tocart .actions { + text-align: center; + } + + .product.data { + display: block; + > .item.content { + &:before { + display: none; + } + } + } + + .product.photo .notice { + display: none; + } + + .product.info.main { + .page.title.product { + margin-bottom: 10px; + } + .price-box { + border: none !important; + margin: 0; + } + .stock { + clear: right; + float: right; + } + .prices.tier { + clear: both; + } + .product.add.form { + clear: both; + .actions { + margin-right: 0; + .action.primary.customize, + .action.primary.tocart { + max-width: 400px; + padding: 18px 10px 14px; + width: 100%; + } + } + } + .type-configurable & { + select { + width: 99.5% !important; + } + } + .product.social.links { + border-top: 1px solid @primary2; + padding: 10px 0; + float: none; + text-align: right; + .action.mailto { + display: inline-block; + span { + .iconAfter(@icon-envelope, 24px, 0, "icons"); + .iconHideText(24px); + color: @primary3; + } + } + } + .actions.bundle { + clear: both; + text-align: center; + .action.primary.customize { + margin: 24px 0; + max-width: 400px; + padding: 18px 10px 14px; + width: 100%; + } + } + .price-box { + .price-excluding-tax, + .price-including-tax { + display: block; + } + } + .product.addto.links { + display: inline-block; + font-size: 18px; + border: none; + margin: 0; + padding: 10px; + position: absolute; + vertical-align: top; + .action.towishlist { + font-size: 16px; + } + .action.tocompare { + display: none; + } + } + + .table.data.grouped { + width: 100%; + clear: both; + } + } + + .product.media { + .img.photo.container { + height: auto !important; + width: auto !important; + > img { + position: static !important; + height: auto !important; + width: auto !important; + max-width: 100%; + } + } + &:before { + content: attr(data-title); + color: @primary5; + display: block; + font-size: 30px; + font-weight: 200; + line-height: 1.2; + margin-bottom: 30px; + } + } + + .product.info.detailed { + background: @primary1; + border-bottom: 1px solid @primary2; + margin: 0 -18px; + .product.data > .item.title { + float: none; + margin: 0; + position: relative; + .switch { + background: @primary1; + border: none; + border-top: 1px solid @primary2; + font-size: 18px; + color: @primary6; + border-radius: 0; + padding: 11px 18px; + position: static; + text-transform: none; + } + &:before { + content: @icon-expand; + display: block; + font-family: "icons"; + font-size: 15px; + position: absolute; + top: 11px; + right: 18px; + } + &.active { + .switch { + padding: 11px 18px !important; + } + &:before { + content: @icon-collapse; + } + } + } + .product.data > .item.content { + color: @primary6; + font-size: 18px; + float: none; + margin: 0 10px 10px; + padding: 10px 18px; + width: auto; + &.active { + background: #fff; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .1); + box-shadow: 0 1px 1px rgba(0, 0, 0, .1); + &+.item.title { + .switch { + border-top: none; + } + } + } + &:last-child { + border-bottom: 1px solid @primary2; + } + .product.attributes th { + font-size: 18px; + padding: 26px 10px 10px; + } + } + .block.add.review { + background: none; + .fieldset > .legend { + border: none; + margin: 0; + strong { + display: block; + font-size: 18px; + line-height: 1.2; + margin: 0; + } + } + .actions, + .field:not(.ratings) { + width: 100%; + } + .actions { + text-align: left; + } + } + } + + .block.add.review { + margin: 0; + padding: 0; + } + + .block.product.tags { + margin-bottom: 0; + .title { + display: none; + } + .field { + .note { + font-size: 12px; + padding-left: 0; + &:before { + display: none; + } + } + } + } + + .column.main .block.widget.viewed, + .column.main .block.crosssell, + .column.main .block.upsell, + .column.main .block.related, + .column.main .block.widget.new, + .column.main .block.widget.compared { + border: none; + padding: 0; + .item.product { + .product.photo { + span { + height: auto !important; + width: auto !important; + img { + position: static !important; + height: auto; + width: auto; + max-width: 100%; + } + } + } + .actions { + display: none; + } + &:hover { + .actions { + visibility: hidden; + } + } + } + .content { + overflow-x: auto; + margin: 0 -18px; + white-space: nowrap; + -webkit-overflow-scrolling: touch; + } + .products.list { + margin: 0; + .item.product { + white-space: normal; + .product.photo { + display: block; + float: none; + margin: 0 0 10px; + } + width: 40% !important; + } + } + } + + .block.related { + .actions { + display: none; + } + } + + .box.tocart { + .checkout.paypal { + display: block; + &.after { + &:before { + display: block; + } + } + &.before { + &:before { + display: block; + } + } + } + } + + .product.info.detailed + .block.upsell, + .product.info.detailed + .block.related { + margin-top: 30px; + clear: none; + float: none; + width: auto; + border-top: 0; + padding-top: 0; + padding-left: 0; + border-left: 0; + .products.list { + margin: 0; + .item.product { + display: inline-block; + width: 40%; + padding: 20px; + .product.photo { + float: none; + display: block; + margin: 0 0 10px; + } + } + } + } + + input[type="password"], + input[type="text"] { + font-size: 18px; + } + + .fieldset > .field > .label { + font-size: 18px; + font-weight: normal; + text-transform: none; + } + + .fieldset > .field .note { + padding-left: 0 !important; + margin: 5px; + &:before { + display: none; + } + } + + .bundle.options.container { + margin: 0; + padding: 0; + .product.add.form { + margin: 0 -18px; + padding: 20px 18px 280px; + } + .product.options.wrapper, + .product.options.bottom { + float: none; + width: auto; + } + .product.options.bottom { + .price-box { + display: none; + } + .action.back.customization { + color: @primary3; + .iconAfter(@icon-close-thick, 22px, 0, "icons"); + .iconHideText(22px); + top: 26px; + right: 18px; + } + } + p.required { + display: none; + } + } + + .block.bundle.summary { + background: @primary1; + margin: 0; + float: none; + position: absolute; + margin: -280px 0 0; + top: 100% !important; + width: 90%; + .content { + padding: 0; + } + .bundle.summary, + .photo, + .title, + .product.name, + .available, + .addto { + display: none !important; + } + .price-box { + .price-label { + display: block; + float: none; + margin-bottom: 5px; + } + .price-excluding-tax { + margin-right: 10px; + } + .full-product-price { + float: none; + } + } + .box.tocart { + padding-bottom: 0; + border: none; + .field, + .actions { + display: inline-block; + } + .control { + width: auto; + } + .field.qty { + .box-sizing(); + width: 18%; + } + input.qty { + height: 49px; + } + .actions { + width: 80%; + .action.primary.tocart { + padding: 18px 10px 14px; + width: 100%; + } + } + } + } + + .fieldset.bundle.options { + > .field { + margin: 0 0 20px; + .label { + display: inline-block; + font-size: 16px; + width: 90%; + } + > .label { + font-size: 22px; + } + } + } + + // * + // * Widgets + // * + // ----------------------------------------------------------------------------- */ + + // Recently Viewed + + .block.widget.viewed .content, + .block.crosssell .content, + .block.upsell .content, + .block.related .content, + .block.widget.new .content, + .block.widget.compared .content { + margin: 0; + } + + .block.widget.viewed, + .block.widget.new { + .minilist.products.items .item.product { + .product.details { + overflow: hidden; + padding: 0; + } + &:hover { + .product.actions { + visibility: hidden; + } + } + + } + } + + /* + Overlay popup + -------------------------------------- */ + .popup { + left: 0; + top: 5%; + margin: 0 auto; + width: 90%; + .actions { + .action.submit { + .mobilePrimaryAction(); + } + .action.cancel { + .mobileSecondaryAction(); + } + } + } + +} \ No newline at end of file diff --git a/app/design/frontend/magento_plushe/less/styles.less b/app/design/frontend/magento_plushe/less/styles.less index 81383e8041f..6fe0c23a23c 100644 --- a/app/design/frontend/magento_plushe/less/styles.less +++ b/app/design/frontend/magento_plushe/less/styles.less @@ -332,13 +332,11 @@ body { } @media only screen and (max-width: 640px) { - .navigation > ul { + .navigation > ul, + .navigation > ul > .level0 > .submenu > ul.level0 { min-width: 100%; max-width: 100%; } - .action.toggle.nav { - top: 100%; - } } /* @@ -438,6 +436,9 @@ body { font-weight: bold; } } + .switcher-store { + margin-bottom: 30px; + } } /* @@ -1021,6 +1022,10 @@ body { } } +.action.toggle.checkout.progress { + display: none; +} + .opc.loading .active { position: relative; z-index: 1; @@ -2094,6 +2099,9 @@ body { .action.multicheckout { text-decoration: underline; } + .page.title & { + display: none; + } } /* @@ -2283,8 +2291,6 @@ body { -------------------------------------- */ .minicart { @textColor: @primary6; - @optionsBg: rgba(0, 0, 0, .8); - @optionsColor: #fff; .product.options.wrapper { position: relative; display: inline; @@ -2749,7 +2755,7 @@ body { .legend { float: left; margin: 0 0 20px; - font-weight: 600; + font-weight: 200; } .legend + br { display: block; @@ -2771,6 +2777,58 @@ body { .resetList(); } +.widget.static.block { + .clearfix(); + .header &, + .footer & { + display: inline-block; + } +} + +.widget.link, +.widget.static.block { + .product.info.main + &, + .product.info.detailed + &, + .block.search + & { + clear: both; + } +} + +span.widget.link, +.widget.static.block { + .footer .links & { + margin-left: 3px; + white-space: normal; + &:before { + content: ' | '; + display: inline-block; + margin-right: 3px; + } + } +} + +.widget.link, +.widget.static.block { + .minicart.wrapper .block.minicart > .content & { + clear: right; + float: right; + margin: 0 -330px 15px 0; + text-align: left; + width: 310px; + } + .minicart.wrapper .block.minicart > .content .actions & { + margin-right: 0; + } +} + +.widget.link + .product.info.detailed { + margin-top: 20px; +} + +span.widget.link { + display: inline-block; +} + /* Magento_Catalog Compare @@ -3033,6 +3091,7 @@ body { .block.crosssell { .products.list.items.crosssell { + .clearfix(); margin: 0 -13px; .item.product { .column(2); @@ -3141,6 +3200,76 @@ body { } } +// Sidebar widgets +.sidebar .block.widget.viewed, +.sidebar .block.crosssell, +.sidebar .block.upsell, +.sidebar .block.related, +.sidebar .block.widget.new, +.sidebar .block.widget.compared { + border: 0; + padding-top: 0; +} + +// Images and names template +.sidebar .minilist.products.items { + margin: 0; + .item.product { + margin: 0 0 20px; + padding: 0; + position: relative; + width: 100%; + .product.actions { + visibility: hidden; + } + &:hover { + .product.actions { + visibility: visible; + } + } + } + .product.details { + overflow: hidden; + padding-bottom: 40px; + } + .product.photo { + float: left; + margin: 0 10px 10px 0; + } + .product.name { + overflow: hidden; + } + .actions { + bottom: 0; + left: 0; + position: absolute; + } + .action.tocart { + &:extend(.secondary.action all); + padding: 5px 11px; + display: inline-block; + } +} + +// Images only template +.block.widget.photos { + margin: 0 0 30px; + .items { + list-style: none; + .clearfix(); + margin: 0; + padding: 0; + } + .item { + float: left; + margin: 0 3px 3px 0; + padding: 0; + } + .product.photo { + margin-right: 0; + } +} + .product.info.detailed + .block.upsell, .product.info.detailed + .block.related { margin-top: 70px; @@ -3242,6 +3371,21 @@ body { } } +// Orders and returns +.find.orders { + .label { + display: block; + margin: 0 0 3px; + } + .control { + margin: 0 0 10px; + } + .action.submit { + &:extend(.secondary.action all); + padding: 5px 11px; + } +} + /* Magento_Catalog Layered Navigation @@ -3736,6 +3880,10 @@ body { margin-right: 15px; } } + .product.alert { + font-size: 12px; + margin: 5px 0; + } } .product.main.info { @@ -4332,6 +4480,19 @@ img[align="right"] { } } +.form.login, +.step.login { + .field.persistent { + .link.tip { + display: inline-block; + padding-top: 7px; + } + .checkbox { + margin-top: 10px; + } + } +} + .action.reload { .resetAction(); position: absolute; @@ -4359,7 +4520,8 @@ img[align="right"] { .form.create.account, .form.wishlist.share, .form.password.reset, -.form.paypal.review { +.form.paypal.review, +.form.send.confirmation { .fieldset { .box-sizing(); .formCols(); @@ -4408,17 +4570,22 @@ img[align="right"] { } .field.dob { .fields.group .field { + .box-sizing(); width: 33%; position: relative; z-index: 1; .label { position: absolute; - bottom: 0; + top: 10px; font-size: @baseFontSizeMiddle; line-height: 16px; } - input { - margin-bottom: 16px; + .control { + margin-left: 27px; + } + &:last-child { + padding-right: 0; + width: 34%; } } } @@ -4481,8 +4648,7 @@ img[align="right"] { float: right; text-align: right; .action.add { - &:extend(.secondary.action all) - ; + &:extend(.secondary.action all); } .limit { margin: 0; @@ -4524,9 +4690,9 @@ img[align="right"] { width: auto; padding-right: 30px; text-align: right; - } - .action { - &:extend(.primary.action all); + .action { + &:extend(.primary.action all); + } } .fields.range { .field:first-child { @@ -4716,7 +4882,7 @@ img[align="right"] { } } -.my-account { +.account { .pager { .amount, .limiter { @@ -4728,19 +4894,20 @@ img[align="right"] { margin: 0 0 30px; } } - > .actions, - .form > .actions, - .block > .actions { - .clearfix(); - margin: 30px 0 0; - > .primary { - float: right; - } - > .secondary { - float: left; + .column.main { + > .actions, + .form > .actions, + .block > .actions { + .clearfix(); + margin: 30px 0 0; + > .primary { + float: right; + } + > .secondary { + float: left; + } } } - .data.table { width: 100%; td, @@ -4752,6 +4919,10 @@ img[align="right"] { .action:last-child { margin-left: 20px; } + .action:first-child, + .action.details { + margin-left: 0; + } } em { font-style: normal; @@ -4951,70 +5122,9 @@ img[align="right"] { } .col.actions { width: 200px; - } - - .item-options { - background: @optionsBg; - color: @optionsColor; - display: none; - position: absolute; - border-radius: 5px; - padding: 10px; - right: 100%; - top: 50%; - margin-top: -20px; - margin-right: 15px; - max-width: 200px; - min-width: 100px; - > p { - margin-top: 0; - } - dl { - margin: 0; - dt { - display: inline; - float: left; - clear: left; - font-weight: 600; - &:after { - content: ':'; - margin-right: 5px; - } - } - dd { - margin: 0; - } - } - } - - .truncated { - .truncated_full_value { - position: relative; - &.show { - &:before { - content: ''; - border-left: 10px solid @optionsBg; - border-top: 10px solid transparent; - border-bottom: 10px solid transparent; - height: 0; - width: 0; - overflow: hidden; - display: block; - position: absolute; - top: 3px; - margin-top: 0; - left: -15px; - z-index: 2; - } - .item-options { - display: block; - } - } - } - .details { - font-size: @baseFontSizeMiddle; - border-bottom: 1px dotted @link; - cursor: help; + .price-excluding-tax, + .price-including-tax { + display: block; } } } @@ -5391,6 +5501,15 @@ img[align="right"] { } } +/* + My Account -> Send confirmation link +-------------------------------------- */ +.form.send.confirmation { + .action.send { + &:extend(.primary.action all); + } +} + /* Overlay popup -------------------------------------- */ @@ -5421,11 +5540,97 @@ img[align="right"] { &.active { display: block; } - .close span { + > .action.close span { .iconHideText(); + &:after { + content: ""; + } } .title { font-size: 18px; margin: 0 0 30px; + strong { + font-weight: 400; + } + } + .fieldset { + .action.close span { + line-height: inherit; + text-indent: 0; + width: auto; + &:after { + content: ""; + display: none; + } + } + } +} + +.truncated { + position: relative; + .truncated.full.value { + background: @optionsBg; + color: @optionsColor; + display: none; + position: absolute; + border-radius: 5px; + padding: 10px; + right: 100%; + top: 50%; + margin-top: -20px; + margin-right: 15px; + max-width: 200px; + min-width: 100px; + &.show { + display: block; + &:before { + content: ''; + border-left: 10px solid @optionsBg; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + height: 0; + width: 0; + overflow: hidden; + display: block; + position: absolute; + top: 12px; + margin-top: 0; + right: -10px; + z-index: 2; + } + } + > p { + margin-top: 0; + } + dl { + margin: 0; + dt { + display: inline; + font-weight: 600; + &:after { + content: ':'; + } + } + dd { + margin: 0; + white-space: normal; + } + } } + .action.details { + font-size: @baseFontSizeMiddle; + border-bottom: 1px dotted @link; + cursor: help; + } +} + +.map-popup { + background: @commonBg; + border: 1px solid @primary3; + position: absolute; + padding: 20px; + z-index: 10; } + + +@import "/responsive/responsive.less"; diff --git a/app/design/frontend/magento_plushe/less/styles/magento.less b/app/design/frontend/magento_plushe/less/styles/magento.less index 79fd72340b5..6c83cac0cf1 100644 --- a/app/design/frontend/magento_plushe/less/styles/magento.less +++ b/app/design/frontend/magento_plushe/less/styles/magento.less @@ -1276,7 +1276,7 @@ display: inline-block; padding: 20px; position: relative; - .close { + > .close { color: @primary4; cursor: pointer; position: absolute; diff --git a/app/design/frontend/magento_plushe/less/vars.less b/app/design/frontend/magento_plushe/less/vars.less index 6d3b1a25522..182f0c19104 100644 --- a/app/design/frontend/magento_plushe/less/vars.less +++ b/app/design/frontend/magento_plushe/less/vars.less @@ -50,6 +50,10 @@ @actionFont: 600 14px/16px; +// Tooltip +@optionsBg: rgba(0, 0, 0, .8); +@optionsColor: #fff; + // Layout @LayoutMaxWidth: 1025px; @LayoutMinWidth: 1025px; @@ -129,3 +133,5 @@ @messageNoticeColor: #926e00; @messageNoticeBg: #ffedb8; @messageNoticeIconBg: #ffc000; + +@paypalRetinaButton: url("@{baseDir}/images/express-checkout-retina.png"); diff --git a/app/etc/di.xml b/app/etc/di.xml index 82a9656a411..cbf5699e2b3 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -31,20 +31,20 @@ <preference for="Magento\App\FrontControllerInterface" type="Magento\App\FrontController" /> <preference for="Magento\Module\UpdaterInterface" type="Magento\Module\Updater" /> <preference for="Magento\Core\Model\AppInterface" type="Magento\Core\Model\App\Proxy" /> - <preference for="Magento\App\CacheInterface" type="Magento\Core\Model\Cache\Proxy" /> - <preference for="Magento\Core\Model\Cache\StateInterface" type="Magento\Core\Model\Cache\State" /> - <preference for="Magento\Core\Model\Cache\TypeListInterface" type="Magento\Core\Model\Cache\TypeList" /> + <preference for="Magento\App\CacheInterface" type="Magento\App\Cache\Proxy" /> + <preference for="Magento\App\Cache\StateInterface" type="Magento\App\Cache\State" /> + <preference for="Magento\App\Cache\TypeListInterface" type="Magento\App\Cache\TypeList" /> <preference for="Magento\Core\Model\Store\ConfigInterface" type="Magento\Core\Model\Store\Config" /> <preference for="Magento\Core\Model\StoreManagerInterface" type="Magento\Core\Model\StoreManager" /> <preference for="Magento\View\DesignInterface" type="Magento\Core\Model\View\Design" /> <preference for="Magento\View\Design\ThemeInterface" type="Magento\Core\Model\Theme" /> - <preference for="Magento\View\ConfigInterface" type="Magento\Core\Model\View\Config" /> + <preference for="Magento\View\ConfigInterface" type="Magento\View\Config" /> <preference for="Magento\Core\Model\LocaleInterface" type="Magento\Core\Model\Locale" /> <preference for="Magento\UrlInterface" type="Magento\Core\Model\Url" /> <preference for="Magento\Data\Collection\Db\FetchStrategyInterface" type="Magento\Data\Collection\Db\FetchStrategy\Query" /> <preference for="Magento\Config\ScopeInterface" type="Magento\Config\Scope" /> <preference for="Magento\Config\FileResolverInterface" type="Magento\Core\Model\Config\FileResolver" /> - <preference for="Magento\Config\CacheInterface" type="Magento\Core\Model\Cache\Type\Config" /> + <preference for="Magento\Config\CacheInterface" type="Magento\App\Cache\Type\Config" /> <preference for="Magento\Config\ValidationStateInterface" type="Magento\App\Config\ValidationState" /> <preference for="Magento\Module\ModuleListInterface" type="Magento\Module\ModuleList" /> <preference for="Magento\Event\ConfigInterface" type="Magento\Event\Config" /> @@ -53,11 +53,17 @@ <preference for="Magento\Event\ManagerInterface" type="Magento\Event\Manager\Proxy" /> <preference for="Magento\View\LayoutInterface" type="Magento\Core\Model\Layout" /> <preference for="Magento\View\Layout\ProcessorInterface" type="Magento\Core\Model\Layout\Merge" /> + <preference for="Magento\View\Url\ConfigInterface" type="Magento\Core\Model\View\Url\Config" /> <preference for="Magento\App\Route\ConfigInterface" type="Magento\App\Route\Config" /> <preference for="Magento\App\Resource\ConfigInterface" type="Magento\App\Resource\Config\Proxy" /> - <type name="Magento\View\Layout\Structure" shared="false" /> + <preference for="Magento\App\Cache\State\OptionsInterface" type="Magento\Core\Model\Resource\Cache" /> + <preference for="Magento\Oauth\OauthInterface" type="Magento\Oauth\Oauth"/> <type name="Magento\View\BlockPool" shared="false" /> <preference for="Magento\Error\HandlerInterface" type="Magento\App\Error\Handler" /> + <preference for="Magento\Module\Output\ConfigInterface" type="Magento\Core\Model\Module\Output\Config" /> + <preference for="Magento\View\Design\Theme\CustomizationInterface" type="Magento\View\Design\Theme\Customization" /> + <preference for="Magento\Image\Adapter\ConfigInterface" type="Magento\Core\Model\Image\Adapter\Config" /> + <preference for="Magento\View\Design\Theme\Image\PathInterface" type="Magento\Core\Model\Theme\Image\Path" /> <type name="Magento\App\State"> <param name="installDate"> <value type="argument">Magento\App\State::PARAM_INSTALL_DATE</value> @@ -68,7 +74,7 @@ </type> <type name="Magento\Module\FrontController\Plugin\Install"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Config" /> + <instance type="Magento\App\Cache\Type\Config" /> </param> </type> <type name="Magento\App\Config\ValidationState"> @@ -86,7 +92,7 @@ <value type="argument">Magento\Core\Model\App::PARAM_ALLOWED_MODULES</value> </param> </type> - <type name="Magento\Core\Model\Cache\Frontend\Factory"> + <type name="Magento\App\Cache\Frontend\Factory"> <param name="enforcedOptions"> <value type="argument">Magento\Core\Model\App::PARAM_CACHE_OPTIONS</value> </param> @@ -104,7 +110,7 @@ <instance type="Magento\App\Resource\Proxy" /> </param> </type> - <type name="Magento\Core\Model\Cache\State"> + <type name="Magento\App\Cache\State"> <param name="banAll"> <value type="argument">Magento\Core\Model\App::PARAM_BAN_CACHE</value> </param> @@ -119,7 +125,7 @@ </type> <type name="Magento\Core\Model\Translate"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Translate" /> + <instance type="Magento\App\Cache\Type\Translate" /> </param> </type> <type name="Magento\Install\Model\Installer"> @@ -149,27 +155,27 @@ <type name="Magento\Acl" shared="false" /> <type name="Magento\App\ObjectManager\ConfigLoader"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Config"/> + <instance type="Magento\App\Cache\Type\Config"/> </param> </type> <type name="Magento\App\ObjectManager\ConfigCache"> <param name="cacheFrontend"> - <instance type="Magento\Core\Model\Cache\Type\Config"/> + <instance type="Magento\App\Cache\Type\Config"/> </param> </type> - <type name="Magento\Core\Model\Cache\Config\Reader"> + <type name="Magento\Cache\Config\Reader"> <param name="fileName"> <value>cache.xml</value> </param> </type> - <type name="Magento\Core\Model\Cache\Config\Data"> + <type name="Magento\Cache\Config\Data"> <param name="cacheId"> <value>config_cache</value> </param> </type> <type name="Magento\Interception\Config\Config"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Config" /> + <instance type="Magento\App\Cache\Type\Config" /> </param> <param name="reader"> <instance type="Magento\ObjectManager\Config\Reader\Dom" /> @@ -180,7 +186,7 @@ </type> <type name="Magento\Interception\PluginList\PluginList"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Config" /> + <instance type="Magento\App\Cache\Type\Config" /> </param> <param name="reader"> <instance type="Magento\ObjectManager\Config\Reader\Dom" /> @@ -201,7 +207,7 @@ </type> <type name="Magento\App\Resource\Config"> <param name="cache"> - <instance type="Magento\Core\Model\Cache\Type\Config\Proxy" /> + <instance type="Magento\App\Cache\Type\Config\Proxy" /> </param> <param name="initialResources"> <value type="argument">Magento\App\Resource\Config::PARAM_INITIAL_RESOURCES</value> @@ -225,6 +231,28 @@ <instance type="Magento\Core\Model\Session\Proxy" /> </param> </type> + <type name="Magento\View\Url"> + <param name="fileUrlMap"> + <value> + <urlLib> + <key type="const">Magento\Core\Model\Store::URL_TYPE_LIB</key> + <value type="const">Magento\App\Dir::PUB_LIB</value> + </urlLib> + <urlMedia> + <key type="const">Magento\Core\Model\Store::URL_TYPE_MEDIA</key> + <value type="const">Magento\App\Dir::MEDIA</value> + </urlMedia> + <urlStatic> + <key type="const">Magento\Core\Model\Store::URL_TYPE_STATIC</key> + <value type="const">Magento\App\Dir::STATIC_VIEW</value> + </urlStatic> + <urlCache> + <key type="const">Magento\Core\Model\Store::URL_TYPE_CACHE</key> + <value type="const">Magento\App\Dir::PUB_VIEW_CACHE</value> + </urlCache> + </value> + </param> + </type> <type name="Magento\HTTP\PhpEnvironment\RemoteAddress"> <param name="alternativeHeaders"> <value/> diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index fe17d2760ea..c39dd300e0c 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -322,12 +322,12 @@ class Application $updater->updateData(); /* Enable configuration cache by default in order to improve tests performance */ - /** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ + /** @var $cacheState \Magento\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\Cache\StateInterface'); - $cacheState->setEnabled(\Magento\Core\Model\Cache\Type\Config::TYPE_IDENTIFIER, true); - $cacheState->setEnabled(\Magento\Core\Model\Cache\Type\Layout::TYPE_IDENTIFIER, true); - $cacheState->setEnabled(\Magento\Core\Model\Cache\Type\Translate::TYPE_IDENTIFIER, true); + ->get('Magento\App\Cache\StateInterface'); + $cacheState->setEnabled(\Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, true); + $cacheState->setEnabled(\Magento\App\Cache\Type\Layout::TYPE_IDENTIFIER, true); + $cacheState->setEnabled(\Magento\App\Cache\Type\Translate::TYPE_IDENTIFIER, true); $cacheState->setEnabled(\Magento\Eav\Model\Cache\Type::TYPE_IDENTIFIER, true); $cacheState->persist(); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php index d26ba641daa..111b86609c1 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php @@ -58,7 +58,7 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase null, $instanceConfig, array( 'Magento\App\Dir\Verification' => $verification, - 'Magento\Core\Model\Cache\Type\Config' => $cache, + 'Magento\App\Cache\Type\Config' => $cache, 'Magento\App\ObjectManager\ConfigLoader' => $configLoader, 'Magento\App\ObjectManager\ConfigCache' => $configCache, 'Magento\Config\ReaderInterface' => $this->getMock('Magento\Config\ReaderInterface'), diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/Controller/CacheTest.php b/dev/tests/integration/testsuite/Magento/Adminhtml/Controller/CacheTest.php index 95a70061a4a..19fd31bbbdf 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/Controller/CacheTest.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/Controller/CacheTest.php @@ -37,14 +37,14 @@ class CacheTest extends \Magento\Backend\Utility\Controller { $this->dispatch('backend/admin/cache/flushAll'); - /** @var $cache \Magento\Core\Model\Cache */ + /** @var $cache \Magento\App\Cache */ $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache'); - /** @var $cachePool \Magento\Core\Model\Cache\Frontend\Pool */ + ->create('Magento\App\Cache'); + /** @var $cachePool \Magento\App\Cache\Frontend\Pool */ $this->assertFalse($cache->load('APPLICATION_FIXTURE')); $cachePool = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\Frontend\Pool'); + ->create('Magento\App\Cache\Frontend\Pool'); /** @var $cacheFrontend \Magento\Cache\FrontendInterface */ foreach ($cachePool as $cacheFrontend) { $this->assertFalse($cacheFrontend->getBackend()->load('NON_APPLICATION_FIXTURE')); @@ -59,14 +59,14 @@ class CacheTest extends \Magento\Backend\Utility\Controller { $this->dispatch('backend/admin/cache/flushSystem'); - /** @var $cache \Magento\Core\Model\Cache */ + /** @var $cache \Magento\App\Cache */ $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache'); - /** @var $cachePool \Magento\Core\Model\Cache\Frontend\Pool */ + ->create('Magento\App\Cache'); + /** @var $cachePool \Magento\App\Cache\Frontend\Pool */ $this->assertFalse($cache->load('APPLICATION_FIXTURE')); $cachePool = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\Frontend\Pool'); + ->create('Magento\App\Cache\Frontend\Pool'); /** @var $cacheFrontend \Magento\Cache\FrontendInterface */ foreach ($cachePool as $cacheFrontend) { $this->assertSame('non-application cache data', @@ -84,13 +84,13 @@ class CacheTest extends \Magento\Backend\Utility\Controller $this->getRequest()->setParams(array('types' => $typesToEnable)); $this->dispatch('backend/admin/cache/massEnable'); - /** @var \Magento\Core\Model\Cache\TypeListInterface$cacheTypeList */ + /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ + /** @var $cacheState \Magento\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\StateInterface'); + ->create('Magento\App\Cache\StateInterface'); foreach ($types as $type) { if (in_array($type, $typesToEnable)) { $this->assertTrue($cacheState->isEnabled($type), "Type '$type' has not been enabled"); @@ -110,13 +110,13 @@ class CacheTest extends \Magento\Backend\Utility\Controller $this->getRequest()->setParams(array('types' => $typesToDisable)); $this->dispatch('backend/admin/cache/massDisable'); - /** @var \Magento\Core\Model\Cache\TypeListInterface$cacheTypeList */ + /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ + /** @var $cacheState \Magento\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\StateInterface'); + ->create('Magento\App\Cache\StateInterface'); foreach ($types as $type) { if (in_array($type, $typesToDisable)) { $this->assertFalse($cacheState->isEnabled($type), "Type '$type' has not been disabled"); @@ -136,9 +136,9 @@ class CacheTest extends \Magento\Backend\Utility\Controller $this->getRequest()->setParams(array('types' => $typesToRefresh)); $this->dispatch('backend/admin/cache/massRefresh'); - /** @var $cacheTypeList \Magento\Core\Model\Cache\TypeListInterface */ + /** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $invalidatedTypes = array_keys($cacheTypeList->getInvalidated()); $failed = array_intersect($typesToRefresh, $invalidatedTypes); $this->assertEmpty($failed, 'Could not refresh following cache types: ' . join(', ', $failed)); @@ -156,9 +156,9 @@ class CacheTest extends \Magento\Backend\Utility\Controller ), 'existing types' => array( array( - \Magento\Core\Model\Cache\Type\Config::TYPE_IDENTIFIER, - \Magento\Core\Model\Cache\Type\Layout::TYPE_IDENTIFIER, - \Magento\Core\Model\Cache\Type\Block::TYPE_IDENTIFIER, + \Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, + \Magento\App\Cache\Type\Layout::TYPE_IDENTIFIER, + \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER, ) ), ); diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_disabled.php b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_disabled.php index 31916d20594..78391a47044 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_disabled.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_disabled.php @@ -22,14 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cacheTypeList \Magento\Core\Model\Cache\TypeListInterface */ +/** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $types = array_keys($cacheTypeList->getTypes()); -/** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ +/** @var $cacheState \Magento\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\Cache\StateInterface'); + ->get('Magento\App\Cache\StateInterface'); foreach ($types as $type) { $cacheState->setEnabled($type, false); } diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_enabled.php b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_enabled.php index 16127643d45..2ac486c3e0c 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_enabled.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_enabled.php @@ -22,14 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cacheTypeList \Magento\Core\Model\Cache\TypeListInterface */ +/** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $types = array_keys($cacheTypeList->getTypes()); -/** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ +/** @var $cacheState \Magento\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\Cache\StateInterface'); + ->get('Magento\App\Cache\StateInterface'); foreach ($types as $type) { $cacheState->setEnabled($type, true); } diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_invalidated.php b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_invalidated.php index 6e974aa0fb6..707458bca8e 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_invalidated.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/all_types_invalidated.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cacheTypeList \Magento\Core\Model\Cache\TypeListInterface */ +/** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $cacheTypeList->invalidate(array_keys($cacheTypeList->getTypes())); diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/application_cache.php b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/application_cache.php index 89a0c040ea9..bca3a55d23c 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/application_cache.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/application_cache.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cache \Magento\Core\Model\Cache */ +/** @var $cache \Magento\App\Cache */ $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache'); + ->create('Magento\App\Cache'); $cache->save('application data', 'APPLICATION_FIXTURE'); diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/empty_storage.php b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/empty_storage.php index 20f7c379169..4e65efaa9c1 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/empty_storage.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/empty_storage.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cache \Magento\Core\Model\Cache */ +/** @var $cache \Magento\App\Cache */ $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache'); + ->create('Magento\App\Cache'); $cache->clean(); diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/non_application_cache.php b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/non_application_cache.php index 54a986df402..0b669c516fa 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/non_application_cache.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/controllers/_files/cache/non_application_cache.php @@ -22,9 +22,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cachePool \Magento\Core\Model\Cache\Frontend\Pool */ +/** @var $cachePool \Magento\App\Cache\Frontend\Pool */ $cachePool = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\Frontend\Pool'); + ->create('Magento\App\Cache\Frontend\Pool'); /** @var $cacheFrontend \Magento\Cache\FrontendInterface */ foreach ($cachePool as $cacheFrontend) { $cacheFrontend->getBackend()->save('non-application cache data', 'NON_APPLICATION_FIXTURE', array('SOME_TAG')); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Cache/Frontend/PoolTest.php b/dev/tests/integration/testsuite/Magento/App/Cache/Frontend/PoolTest.php similarity index 84% rename from dev/tests/integration/testsuite/Magento/Core/Model/Cache/Frontend/PoolTest.php rename to dev/tests/integration/testsuite/Magento/App/Cache/Frontend/PoolTest.php index db80a4bb5c2..b9d649dfa8b 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Cache/Frontend/PoolTest.php +++ b/dev/tests/integration/testsuite/Magento/App/Cache/Frontend/PoolTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Frontend; +namespace Magento\App\Cache\Frontend; class PoolTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Cache\Frontend\Pool + * @var \Magento\App\Cache\Frontend\Pool */ protected $_model; @@ -36,14 +36,14 @@ class PoolTest extends \PHPUnit_Framework_TestCase public function testGetCache($cacheBackendName) { $settings = array('backend' => $cacheBackendName); - $this->_model = new \Magento\Core\Model\Cache\Frontend\Pool( + $this->_model = new \Magento\App\Cache\Frontend\Pool( \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\Frontend\Factory'), + ->create('Magento\App\Cache\Frontend\Factory'), $settings ); - $cache = $this->_model->get(\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID); + $cache = $this->_model->get(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID); $this->assertInstanceOf('Magento\Cache\FrontendInterface', $cache); $this->assertInstanceOf('Zend_Cache_Backend_Interface', $cache->getBackend()); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php index a6edb1c751e..136949b2229 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php @@ -42,6 +42,26 @@ class FormTest extends \PHPUnit_Framework_TestCase */ protected $_formFactory; + /** + * @var \Magento\Backend\Model\Config\Structure\Element\Section + */ + protected $_section; + + /** + * @var \Magento\Backend\Model\Config\Structure\Element\Group + */ + protected $_group; + + /** + * @var \Magento\Backend\Model\Config\Structure\Element\Field + */ + protected $_field; + + /** + * @var array + */ + protected $_configData; + protected function setUp() { $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -70,34 +90,35 @@ class FormTest extends \PHPUnit_Framework_TestCase /** * @covers \Magento\Backend\Block\System\Config\Form::initFields - * @param $section \Magento\Backend\Model\Config\Structure\Element\Section - * @param $group \Magento\Backend\Model\Config\Structure\Element\Group - * @param $field \Magento\Backend\Model\Config\Structure\Element\Field - * @param array $configData + * @param bool $useConfigField uses the test_field_use_config field if true + * @param bool $isConfigDataEmpty if the config data array should be empty or not + * @param $configDataValue the value that the field path should be set to in the config data * @param bool $expectedUseDefault - * @dataProvider initFieldsInheritCheckboxDataProvider + * @dataProvider initFieldsUseDefaultCheckboxDataProvider */ - public function testInitFieldsUseDefaultCheckbox($section, $group, $field, array $configData, $expectedUseDefault) - { - $this->markTestIncomplete('MAGETWO-9058'); + public function testInitFieldsUseDefaultCheckbox($useConfigField, $isConfigDataEmpty, $configDataValue, + $expectedUseDefault + ) { + $this->_setupFieldsInheritCheckbox($useConfigField, $isConfigDataEmpty, $configDataValue); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Config\ScopeInterface') ->setCurrentScope(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); $form = $this->_formFactory->create(); - $fieldset = $form->addFieldset($section->getId() . '_' . $group->getId(), array()); + $fieldset = $form->addFieldset($this->_section->getId() . '_' . $this->_group->getId(), array()); /* @TODO Eliminate stub by proper mock / config fixture usage */ /** @var $block \Magento\Backend\Block\System\Config\FormStub */ $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') ->createBlock('Magento\Backend\Block\System\Config\FormStub'); $block->setScope(\Magento\Backend\Block\System\Config\Form::SCOPE_WEBSITES); - $block->setStubConfigData($configData); - $block->initFields($fieldset, $group, $section); + $block->setStubConfigData($this->_configData); + $block->initFields($fieldset, $this->_group, $this->_section); $fieldsetSel = 'fieldset'; - $valueSel = sprintf('input#%s_%s_%s', $section->getId(), $group->getId(), $field->getId()); + $valueSel = sprintf('input#%s_%s_%s', $this->_section->getId(), $this->_group->getId(), $this->_field->getId()); $valueDisabledSel = sprintf('%s[disabled="disabled"]', $valueSel); - $useDefaultSel = sprintf('input#%s_%s_%s_inherit.checkbox', $section->getId(), $group->getId(), - $field->getId()); + $useDefaultSel = sprintf('input#%s_%s_%s_inherit.checkbox', $this->_section->getId(), $this->_group->getId(), + $this->_field->getId()); $useDefaultCheckedSel = sprintf('%s[checked="checked"]', $useDefaultSel); $fieldsetHtml = $fieldset->getElementHtml(); @@ -119,36 +140,47 @@ class FormTest extends \PHPUnit_Framework_TestCase } } + /** + * @return array + */ + public static function initFieldsUseDefaultCheckboxDataProvider() + { + return array( + array(false, true, null, true), + array(false, false, null, false), + array(false, false, '', false), + array(false, false, 'value', false), + array(true, false, 'config value', false) + ); + } /** * @covers \Magento\Backend\Block\System\Config\Form::initFields - * @param $section \Magento\Backend\Model\Config\Structure\Element\Section - * @param $group \Magento\Backend\Model\Config\Structure\Element\Group - * @param $field \Magento\Backend\Model\Config\Structure\Element\Field - * @param array $configData - * @param bool $expectedUseDefault - * @dataProvider initFieldsInheritCheckboxDataProvider + * @param bool $useConfigField uses the test_field_use_config field if true + * @param bool $isConfigDataEmpty if the config data array should be empty or not + * @param $configDataValue the value that the field path should be set to in the config data + * @dataProvider initFieldsUseConfigPathDataProvider * @magentoConfigFixture default/test_config_section/test_group_config_node/test_field_value config value - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function testInitFieldsUseConfigPath($section, $group, $field, array $configData, $expectedUseDefault) + public function testInitFieldsUseConfigPath($useConfigField, $isConfigDataEmpty, $configDataValue) { - $this->markTestIncomplete('MAGETWO-9058'); + $this->_setupFieldsInheritCheckbox($useConfigField, $isConfigDataEmpty, $configDataValue); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Config\ScopeInterface') ->setCurrentScope(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); $form = $this->_formFactory->create(); - $fieldset = $form->addFieldset($section->getId() . '_' . $group->getId(), array()); + $fieldset = $form->addFieldset($this->_section->getId() . '_' . $this->_group->getId(), array()); /* @TODO Eliminate stub by proper mock / config fixture usage */ /** @var $block \Magento\Backend\Block\System\Config\FormStub */ $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') ->createBlock('Magento\Backend\Block\System\Config\FormStub'); $block->setScope(\Magento\Backend\Block\System\Config\Form::SCOPE_DEFAULT); - $block->setStubConfigData($configData); - $block->initFields($fieldset, $group, $section); + $block->setStubConfigData($this->_configData); + $block->initFields($fieldset, $this->_group, $this->_section); $fieldsetSel = 'fieldset'; - $valueSel = sprintf('input#%s_%s_%s', $section->getId(), $group->getId(), $field->getId()); + $valueSel = sprintf('input#%s_%s_%s', $this->_section->getId(), $this->_group->getId(), $this->_field->getId()); $fieldsetHtml = $fieldset->getElementHtml(); $this->assertSelectCount($fieldsetSel, true, $fieldsetHtml, 'Fieldset HTML is invalid'); @@ -156,10 +188,25 @@ class FormTest extends \PHPUnit_Framework_TestCase } /** - * @TODO data provider should be static * @return array */ - public function initFieldsInheritCheckboxDataProvider() + public static function initFieldsUseConfigPathDataProvider() + { + return array( + array(false, true, null), + array(false, false, null), + array(false, false, ''), + array(false, false, 'value'), + array(true, false, 'config value') + ); + } + + /** + * @param bool $useConfigField uses the test_field_use_config field if true + * @param bool $isConfigDataEmpty if the config data array should be empty or not + * @param $configDataValue the value that the field path should be set to in the config data + */ + protected function _setupFieldsInheritCheckbox($useConfigField, $isConfigDataEmpty, $configDataValue) { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(array( \Magento\Core\Model\App::PARAM_BAN_CACHE => true, @@ -173,43 +220,38 @@ class FormTest extends \PHPUnit_Framework_TestCase \Magento\Core\Model\App\Area::PART_CONFIG ); - $configMock = $this->getMock('Magento\Module\Dir\Reader', array(), array(), '', false, false); - $configMock->expects($this->any())->method('getConfigurationFiles') + $fileResolverMock = $this->getMockBuilder('Magento\Core\Model\Config\FileResolver') + ->disableOriginalConstructor() + ->getMock(); + $fileResolverMock->expects($this->any()) + ->method('get') ->will($this->returnValue(array(__DIR__ . '/_files/test_section_config.xml'))); - $configMock->expects($this->any())->method('getModuleDir') - ->will($this->returnValue(BP . '/app/code/Magento/Backend/etc')); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure(array( 'Magento\Backend\Model\Config\Structure\Reader' => array( - 'parameters' => array('moduleReader' => $configMock) + 'parameters' => array('fileResolver' => $fileResolverMock) ) )); /** @var \Magento\Backend\Model\Config\Structure $structure */ $structure = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Backend\Model\Config\Structure'); - /** @var \Magento\Backend\Model\Config\Structure\Element\Section $section */ - $section = $structure->getElement('test_section'); - - /** @var \Magento\Backend\Model\Config\Structure\Element\Group $group */ - $group = $structure->getElement('test_section/test_group'); - - /** @var \Magento\Backend\Model\Config\Structure\Element\Field $field */ - $field = $structure->getElement('test_section/test_group/test_field'); + $this->_section = $structure->getElement('test_section'); - $fieldPath = $field->getConfigPath(); + $this->_group = $structure->getElement('test_section/test_group'); - /** @var \Magento\Backend\Model\Config\Structure\Element\Field $field */ - $field2 = $structure->getElement('test_section/test_group/test_field_use_config'); + if ($useConfigField) { + $this->_field = $structure->getElement('test_section/test_group/test_field_use_config'); + } else { + $this->_field = $structure->getElement('test_section/test_group/test_field'); + } + $fieldPath = $this->_field->getConfigPath(); - $fieldPath2 = $field2->getConfigPath(); - return array( - array($section, $group, $field, array(), true), - array($section, $group, $field, array($fieldPath => null), false), - array($section, $group, $field, array($fieldPath => ''), false), - array($section, $group, $field, array($fieldPath => 'value'), false), - array($section, $group, $field2, array($fieldPath2 => 'config value'), true), - ); + if ($isConfigDataEmpty) { + $this->_configData = array(); + } else { + $this->_configData = array($fieldPath => $configDataValue); + } } public function testInitFormAddsFieldsets() diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Image/AdapterTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Image/AdapterTest.php index ec48e129ebf..4dbab4f1ae1 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Image/AdapterTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Image/AdapterTest.php @@ -58,6 +58,6 @@ class AdapterTest extends \PHPUnit_Framework_TestCase */ public function testCorrectSave() { - $this->_model->setValue(\Magento\Core\Model\Image\AdapterFactory::ADAPTER_GD2)->save(); + $this->_model->setValue(\Magento\Image\Adapter\AdapterInterface::ADAPTER_GD2)->save(); } } diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php index 7e6c86b00e2..e1bb835ef3b 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -80,8 +80,8 @@ class StorageTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $session = $objectManager->get('Magento\Backend\Model\Session'); $backendUrl = $objectManager->get('Magento\Backend\Model\Url'); - $imageFactory = $objectManager->get('Magento\Core\Model\Image\AdapterFactory'); - $viewUrl = $objectManager->get('Magento\Core\Model\View\Url'); + $imageFactory = $objectManager->get('Magento\Image\AdapterFactory'); + $viewUrl = $objectManager->get('Magento\View\Url'); $imageHelper = $objectManager->get('Magento\Cms\Helper\Wysiwyg\Images'); $coreFileStorageDb = $objectManager->get('Magento\Core\Helper\File\Storage\Database'); $dir = $objectManager->get('Magento\App\Dir'); diff --git a/dev/tests/integration/testsuite/Magento/Core/Block/AbstractBlockTest.php b/dev/tests/integration/testsuite/Magento/Core/Block/AbstractBlockTest.php index a1d815996c4..9a95efda719 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Block/AbstractBlockTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Block/AbstractBlockTest.php @@ -329,9 +329,9 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase public function testGetBlockHtml() { // Without layout - /** @var $blockFactory \Magento\Core\Model\BlockFactory */ + /** @var $blockFactory \Magento\View\Element\BlockFactory */ $blockFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\BlockFactory'); + ->get('Magento\View\Element\BlockFactory'); $block1 = $blockFactory->createBlock('Magento\Core\Block\Text'); $block1->setText('Block text'); $block1->setNameInLayout('block'); @@ -571,14 +571,16 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase public function testFormatDate() { - $helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Helper\Data'); - $this->assertEquals($helper->formatDate(), $this->_block->formatDate()); + $locale = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Core\Model\LocaleInterface'); + $this->assertEquals($locale->formatDate(), $this->_block->formatDate()); } public function testFormatTime() { - $helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Helper\Data'); - $this->assertEquals($helper->formatTime(), $this->_block->formatTime()); + $locale = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Core\Model\LocaleInterface'); + $this->assertEquals($locale->formatTime(), $this->_block->formatTime()); } public function testGetModuleName() diff --git a/dev/tests/integration/testsuite/Magento/Core/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Core/Helper/DataTest.php index 229ac663ec3..66ad646e708 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Helper/DataTest.php @@ -31,20 +31,16 @@ class DataTest extends \PHPUnit_Framework_TestCase { const DATE_TIMEZONE = 'America/Los_Angeles'; // hardcoded in the installation - const DATE_FORMAT_SHORT_ISO = 'M/d/yy'; // en_US - const DATE_FORMAT_SHORT = 'n/j/y'; - - const TIME_FORMAT_SHORT_ISO = 'h:mm a'; // en_US - const TIME_FORMAT_SHORT = 'g:i A'; // // but maybe "a" - - const DATETIME_FORMAT_SHORT_ISO = 'M/d/yy h:mm a'; - const DATETIME_FORMAT_SHORT = 'n/j/y g:i A'; - /** * @var \Magento\Core\Helper\Data */ protected $_helper = null; + /** + * @var \Magento\Core\Model\LocaleInterface + */ + protected $locale; + /** * @var \DateTime */ @@ -53,6 +49,8 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Helper\Data'); + $this->locale = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Core\Model\LocaleInterface'); $this->_dateTime = new \DateTime; $this->_dateTime->setTimezone(new \DateTimeZone(self::DATE_TIMEZONE)); } @@ -72,36 +70,6 @@ class DataTest extends \PHPUnit_Framework_TestCase $this->assertEquals($priceHtml, $this->_helper->formatPrice($price)); } - public function testFormatDate() - { - $this->assertEquals($this->_dateTime->format(self::DATE_FORMAT_SHORT), $this->_helper->formatDate()); - - $this->assertEquals( - $this->_dateTime->format(self::DATETIME_FORMAT_SHORT), $this->_helper->formatDate(null, 'short', true) - ); - - $zendDate = new \Zend_Date($this->_dateTime->format('U')); - $this->assertEquals( - $zendDate->toString(self::DATETIME_FORMAT_SHORT_ISO), - $this->_helper->formatTime($zendDate, 'short', true) - ); - } - - public function testFormatTime() - { - $this->assertEquals($this->_dateTime->format(self::TIME_FORMAT_SHORT), $this->_helper->formatTime()); - - $this->assertEquals( - $this->_dateTime->format(self::DATETIME_FORMAT_SHORT), $this->_helper->formatTime(null, 'short', true) - ); - - $zendDate = new \Zend_Date($this->_dateTime->format('U')); - $this->assertEquals( - $zendDate->toString(self::TIME_FORMAT_SHORT_ISO), - $this->_helper->formatTime($zendDate, 'short') - ); - } - /** * @magentoAppIsolation enabled */ @@ -140,83 +108,6 @@ class DataTest extends \PHPUnit_Framework_TestCase $this->assertFalse($this->_helper->isDevAllowed()); } - public function testCopyFieldset() - { - $fieldset = 'sales_copy_order'; - $aspect = 'to_edit'; - $data = array( - 'customer_email' => 'admin@example.com', - 'customer_group_id' => '1', - ); - $source = new \Magento\Object($data); - $target = new \Magento\Object(); - $expectedTarget = new \Magento\Object($data); - $expectedTarget->setDataChanges(true); // hack for assertion - - $this->assertNull($this->_helper->copyFieldsetToTarget($fieldset, $aspect, 'invalid_source', array())); - $this->assertNull($this->_helper->copyFieldsetToTarget($fieldset, $aspect, array(), 'invalid_target')); - $this->assertEquals( - $target, - $this->_helper->copyFieldsetToTarget('invalid_fieldset', $aspect, $source, $target) - ); - $this->assertSame($target, $this->_helper->copyFieldsetToTarget($fieldset, $aspect, $source, $target)); - $this->assertEquals($expectedTarget, $target); - } - - public function testCopyFieldsetArrayTarget() - { - $fieldset = 'sales_copy_order'; - $aspect = 'to_edit'; - $data = array( - 'customer_email' => 'admin@example.com', - 'customer_group_id' => '1', - ); - $source = new \Magento\Object($data); - $target = array(); - $expectedTarget = $data; - - $this->assertEquals( - $target, - $this->_helper->copyFieldsetToTarget('invalid_fieldset', $aspect, $source, $target) - ); - $this->assertEquals( - $expectedTarget, - $this->_helper->copyFieldsetToTarget($fieldset, $aspect, $source, $target)); - } - - public function testDecorateArray() - { - $original = array( - array('value' => 1), - array('value' => 2), - array('value' => 3), - ); - $decorated = array( - array('value' => 1, 'is_first' => true, 'is_odd' => true), - array('value' => 2, 'is_even' => true), - array('value' => 3, 'is_last' => true, 'is_odd' => true), - ); - - // arrays - $this->assertEquals($decorated, $this->_helper->decorateArray($original, '')); - - // \Magento\Object - $sample = array( - new \Magento\Object($original[0]), - new \Magento\Object($original[1]), - new \Magento\Object($original[2]), - ); - $decoratedVo = array( - new \Magento\Object($decorated[0]), - new \Magento\Object($decorated[1]), - new \Magento\Object($decorated[2]), - ); - foreach ($decoratedVo as $obj) { - $obj->setDataChanges(true); // hack for assertion - } - $this->assertEquals($decoratedVo, $this->_helper->decorateArray($sample, '')); - } - public function testJsonEncodeDecode() { $data = array('one' => 1, 'two' => 'two'); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Email/Template/FilterTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Email/Template/FilterTest.php index cbd600c1de5..6f6784cfdc8 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Email/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Email/Template/FilterTest.php @@ -124,7 +124,10 @@ class FilterTest extends \PHPUnit_Framework_TestCase ->create('Magento\Core\Model\Resource\Theme\Collection'); $themeId = $collection->getThemeByFullPath('frontend/test_default')->getId(); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\StoreManagerInterface') - ->getStore()->setConfig(\Magento\Core\Model\View\Design::XML_PATH_THEME_ID, $themeId); + ->getStore()->setConfig( + \Magento\Core\Model\View\Design::XML_PATH_THEME_ID, + $themeId + ); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Email/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Email/TemplateTest.php index d395696d08d..b48d790e519 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Email/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Email/TemplateTest.php @@ -52,8 +52,8 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\Core\Model\Registry'), $objectManager->get('Magento\Core\Model\App\Emulation'), $objectManager->create('Magento\Filesystem'), - $objectManager->create('Magento\Core\Model\View\Url'), - $objectManager->create('Magento\Core\Model\View\FileSystem'), + $objectManager->create('Magento\View\Url'), + $objectManager->create('Magento\View\FileSystem'), $objectManager->get('Magento\View\DesignInterface'), $objectManager->create('Magento\Core\Model\Store\Config'), $objectManager->create('Magento\Core\Model\Config'), @@ -71,7 +71,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase /** * Return a disposable \Zend_Mail instance * - * @return \PHPUnit_Framework_MockObject_MockObject|Zend_Mail + * @return \PHPUnit_Framework_MockObject_MockObject|\Zend_Mail */ public function getMail() { @@ -134,7 +134,10 @@ class TemplateTest extends \PHPUnit_Framework_TestCase ->create('Magento\View\Design\ThemeInterface'); $theme->load('magento_blank', 'theme_path'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\StoreManagerInterface') - ->getStore('fixturestore')->setConfig(\Magento\Core\Model\View\Design::XML_PATH_THEME_ID, $theme->getId()); + ->getStore('fixturestore')->setConfig( + \Magento\Core\Model\View\Design::XML_PATH_THEME_ID, + $theme->getId() + ); } /** @@ -230,7 +233,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException UnexpectedValueException + * @expectedException \UnexpectedValueException * @expectedExceptionMessage Email template 'wrong_id' is not defined */ public function testSendTransactionalWrongId() diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Image/Adapter/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Image/Adapter/ConfigTest.php new file mode 100644 index 00000000000..b11cb8b83ed --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Image/Adapter/ConfigTest.php @@ -0,0 +1,35 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Image\Adapter; + +class ConfigTest extends \PHPUnit_Framework_TestCase +{ + public function testGetAdapterName() + { + /** @var Config $config */ + $config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Core\Model\Image\Adapter\Config'); + $this->assertEquals(\Magento\Image\Adapter\AdapterInterface::ADAPTER_GD2, $config->getAdapterAlias()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php index 823044611bf..5f53d1b2ea7 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php @@ -46,8 +46,8 @@ class MergedTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $service \Magento\Core\Model\View\Service */ - $service = $objectManager->get('Magento\Core\Model\View\Service'); + /** @var $service \Magento\View\Service */ + $service = $objectManager->get('Magento\View\Service'); self::$_themePublicDir = $service->getPublicDir(); /** @var \Magento\App\Dir $dirs */ @@ -161,7 +161,7 @@ class MergedTest extends \PHPUnit_Framework_TestCase { return array( array( - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS, + \Magento\View\Publisher::CONTENT_TYPE_CSS, array( 'mage/calendar.css', 'css/file.css', @@ -182,7 +182,7 @@ class MergedTest extends \PHPUnit_Framework_TestCase ), ), array( - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS, + \Magento\View\Publisher::CONTENT_TYPE_JS, array( 'mage/calendar.js', 'scripts.js', diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php index b1628436752..a0f03563a78 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php @@ -65,11 +65,11 @@ class UpdateTest extends \PHPUnit_Framework_TestCase */ public function testSaveAfterClearCache() { - /** @var $appCache \Magento\Core\Model\Cache */ - $appCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cache'); - /** @var \Magento\Core\Model\Cache\Type\Layout $layoutCache */ + /** @var $appCache \Magento\App\Cache */ + $appCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache'); + /** @var \Magento\App\Cache\Type\Layout $layoutCache */ $layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\Cache\Type\Layout'); + ->get('Magento\App\Cache\Type\Layout'); $this->assertNotEmpty($appCache->load('APPLICATION_FIXTURE')); $this->assertNotEmpty($layoutCache->load('LAYOUT_CACHE_FIXTURE')); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Theme/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Theme/CollectionTest.php index 5b739d3f283..f44083d5198 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Theme/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Theme/CollectionTest.php @@ -27,6 +27,8 @@ namespace Magento\Core\Model\Resource\Theme; +use \Magento\View\Design\ThemeInterface; + class CollectionTest extends \PHPUnit_Framework_TestCase { public static function setUpBeforeClass() @@ -153,9 +155,9 @@ class CollectionTest extends \PHPUnit_Framework_TestCase public function addTypeFilterDataProvider() { return array( - array('themeType' => \Magento\Core\Model\Theme::TYPE_PHYSICAL, 'themeCount' => 1), - array('themeType' => \Magento\Core\Model\Theme::TYPE_VIRTUAL, 'themeCount' => 1), - array('themeType' => \Magento\Core\Model\Theme::TYPE_STAGING, 'themeCount' => 1), + array('themeType' => ThemeInterface::TYPE_PHYSICAL, 'themeCount' => 1), + array('themeType' => ThemeInterface::TYPE_VIRTUAL, 'themeCount' => 1), + array('themeType' => ThemeInterface::TYPE_STAGING, 'themeCount' => 1), array('themeType' => false, 'themeCount' => 3) ); } @@ -176,7 +178,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase foreach ($themeCollection as $theme) { $this->assertTrue(in_array( $theme->getType(), - array(\Magento\Core\Model\Theme::TYPE_PHYSICAL, \Magento\Core\Model\Theme::TYPE_VIRTUAL) + array(ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_VIRTUAL) )); } } @@ -267,7 +269,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test_default.jpg', 'is_featured' => '1', 'area' => 'test_area', - 'type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL, + 'type' => ThemeInterface::TYPE_PHYSICAL, ), array( 'parent_id' => '0', @@ -278,7 +280,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test_default.jpg', 'is_featured' => '1', 'area' => 'test_area2', - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL, + 'type' => ThemeInterface::TYPE_VIRTUAL, ), array( 'parent_id' => '0', @@ -289,7 +291,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test_default.jpg', 'is_featured' => '1', 'area' => 'test_area3', - 'type' => \Magento\Core\Model\Theme::TYPE_STAGING, + 'type' => ThemeInterface::TYPE_STAGING, ), array( 'parent_id' => '0', @@ -300,7 +302,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test_default.jpg', 'is_featured' => '1', 'area' => 'test_area3', - 'type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL, + 'type' => ThemeInterface::TYPE_PHYSICAL, ), array( 'parent_id' => '0', @@ -311,7 +313,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test_default.jpg', 'is_featured' => '1', 'area' => 'test_area3', - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL, + 'type' => ThemeInterface::TYPE_VIRTUAL, ) ); } @@ -331,7 +333,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test1_test1.jpg', 'is_featured' => '1', 'area' => 'area51', - 'type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL + 'type' => ThemeInterface::TYPE_PHYSICAL ), array( 'parent_id' => 'area51/test1/test1', @@ -342,7 +344,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test1_test2.jpg', 'is_featured' => '1', 'area' => 'area51', - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL + 'type' => ThemeInterface::TYPE_VIRTUAL ), array( 'parent_id' => 'area51/test1/test2', @@ -353,7 +355,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test1_test3.jpg', 'is_featured' => '1', 'area' => 'area51', - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL + 'type' => \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL ), array( 'parent_id' => 'area51/test1/test0', @@ -364,7 +366,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'preview_image' => 'test1_test4.jpg', 'is_featured' => '1', 'area' => 'area51', - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL + 'type' => \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL ), ); } @@ -384,7 +386,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase /** @var $theme \Magento\View\Design\ThemeInterface */ foreach ($collection as $theme) { $this->assertEquals(\Magento\Core\Model\App\Area::AREA_FRONTEND, $theme->getArea()); - $this->assertEquals(\Magento\Core\Model\Theme::TYPE_PHYSICAL, $theme->getType()); + $this->assertEquals(ThemeInterface::TYPE_PHYSICAL, $theme->getType()); } } @@ -400,7 +402,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase /** @var $theme \Magento\View\Design\ThemeInterface */ foreach ($collection as $theme) { $this->assertEquals(\Magento\Core\Model\App\Area::AREA_FRONTEND, $theme->getArea()); - $this->assertEquals(\Magento\Core\Model\Theme::TYPE_PHYSICAL, $theme->getType()); + $this->assertEquals(ThemeInterface::TYPE_PHYSICAL, $theme->getType()); } } } diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php index 455237b2ef0..84b745c48b2 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php @@ -54,7 +54,7 @@ class StoreTest extends \PHPUnit_Framework_TestCase 'coreFileStorageDatabase' => $objectManager->get('Magento\Core\Helper\File\Storage\Database'), 'context' => $objectManager->get('Magento\Core\Model\Context'), 'registry' => $objectManager->get('Magento\Core\Model\Registry'), - 'configCacheType' => $objectManager->get('Magento\Core\Model\Cache\Type\Config'), + 'configCacheType' => $objectManager->get('Magento\App\Cache\Type\Config'), 'url' => $objectManager->get('Magento\Core\Model\Url'), 'appState' => $objectManager->get('Magento\App\State'), 'request' => $objectManager->get('Magento\App\RequestInterface'), diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php index a200c71c846..c279a710a23 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php @@ -86,7 +86,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'theme_path' => 'magento_default', 'code' => 'magento_default', 'preview_image' => null, - 'type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL + 'type' => \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL ) ) ); @@ -112,7 +112,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'is_featured' => false, 'theme_path' => 'default_space', 'preview_image' => 'images/preview.png', - 'type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL + 'type' => \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL )); $this->_model->addDefaultPattern('*'); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php index 033c0269fd6..e77399f722d 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php @@ -27,6 +27,8 @@ namespace Magento\Core\Model\Theme\Domain; +use \Magento\View\Design\ThemeInterface; + class VirtualTest extends \PHPUnit_Framework_TestCase { /** @@ -39,7 +41,7 @@ class VirtualTest extends \PHPUnit_Framework_TestCase 'theme_version' => '1.0.0.0', 'theme_title' => 'Test physical theme', 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL + 'type' => ThemeInterface::TYPE_PHYSICAL ), 'virtual' => array( 'parent_id' => null, @@ -47,7 +49,7 @@ class VirtualTest extends \PHPUnit_Framework_TestCase 'theme_version' => '1.0.0.0', 'theme_title' => 'Test virtual theme', 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL + 'type' => ThemeInterface::TYPE_VIRTUAL ), 'staging' => array( 'parent_id' => null, @@ -55,7 +57,7 @@ class VirtualTest extends \PHPUnit_Framework_TestCase 'theme_version' => '1.0.0.0', 'theme_title' => 'Test staging theme', 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'type' => \Magento\Core\Model\Theme::TYPE_STAGING + 'type' => ThemeInterface::TYPE_STAGING ), ); @@ -105,7 +107,8 @@ class VirtualTest extends \PHPUnit_Framework_TestCase $this->assertEquals( $this->_physicalThemeId, - $virtualTheme->getDomainModel(\Magento\Core\Model\Theme::TYPE_VIRTUAL)->getPhysicalTheme()->getId() + $virtualTheme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) + ->getPhysicalTheme()->getId() ); } diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php index 2219338ebdf..dac00ffba61 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php @@ -72,7 +72,7 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase protected function _getTestTheme() { $theme = $this->_theme->getCollection()->getThemeByFullPath( - implode(\Magento\Core\Model\Theme::PATH_SEPARATOR, array('frontend', 'test_test_theme')) + implode(\Magento\View\Design\ThemeInterface::PATH_SEPARATOR, array('frontend', 'test_test_theme')) ); $this->assertNotEmpty($theme->getId()); return $theme; @@ -88,11 +88,12 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase $virtualTheme = clone $this->_theme; $virtualTheme->setData($theme->getData())->setId(null); - $virtualTheme->setType(\Magento\Core\Model\Theme::TYPE_VIRTUAL)->save(); + $virtualTheme->setType(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL)->save(); $subVirtualTheme = clone $this->_theme; $subVirtualTheme->setData($theme->getData())->setId(null); - $subVirtualTheme->setParentId($virtualTheme->getId())->setType(\Magento\Core\Model\Theme::TYPE_VIRTUAL)->save(); + $subVirtualTheme->setParentId($virtualTheme->getId()) + ->setType(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL)->save(); $this->registerThemes(); $parentId = $subVirtualTheme->getParentId(); @@ -110,10 +111,10 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase $testTheme = clone $this->_theme; $testTheme->setData($theme->getData())->setThemePath('empty')->setId(null); - $testTheme->setType(\Magento\Core\Model\Theme::TYPE_PHYSICAL)->save(); + $testTheme->setType(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL)->save(); $this->registerThemes(); $testTheme->load($testTheme->getId()); - $this->assertNotEquals((int)$testTheme->getType(), \Magento\Core\Model\Theme::TYPE_PHYSICAL); + $this->assertNotEquals((int)$testTheme->getType(), \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL); } } diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/ThemeTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/ThemeTest.php index 731b0bde9f4..060d2a0d8c0 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/ThemeTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/ThemeTest.php @@ -60,7 +60,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase 'is_featured' => false, 'theme_path' => 'default/space', 'preview_image' => 'images/preview.png', - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL + 'type' => \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL ); } @@ -72,7 +72,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase /** @var $theme \Magento\View\Design\ThemeInterface */ /** @var $currentTheme \Magento\View\Design\ThemeInterface */ $theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Design\ThemeInterface'); - $collection = $theme->getCollection()->addTypeFilter(\Magento\Core\Model\Theme::TYPE_VIRTUAL); + $collection = $theme->getCollection()->addTypeFilter(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL); foreach ($collection as $currentTheme) { $parentTheme = $currentTheme->getParentTheme(); if (!empty($parentTheme)) { diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/TranslateTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/TranslateTest.php index 7ce39fe88c1..f5c37ecbd70 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/TranslateTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/TranslateTest.php @@ -43,7 +43,7 @@ class TranslateTest extends \PHPUnit_Framework_TestCase protected $_designModel; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -51,7 +51,7 @@ class TranslateTest extends \PHPUnit_Framework_TestCase { $pathChunks = array(__DIR__, '_files', 'design', 'frontend', 'test_default', 'i18n', 'en_US.csv'); - $this->_viewFileSystem = $this->getMock('Magento\Core\Model\View\FileSystem', + $this->_viewFileSystem = $this->getMock('Magento\View\FileSystem', array('getFilename', 'getDesignTheme'), array(), '', false); $this->_viewFileSystem->expects($this->any()) @@ -77,7 +77,7 @@ class TranslateTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($theme)); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->addSharedInstance($this->_viewFileSystem, 'Magento\Core\Model\View\FileSystem'); + $objectManager->addSharedInstance($this->_viewFileSystem, 'Magento\View\FileSystem'); /** @var $moduleReader \Magento\Module\Dir\Reader */ $moduleReader = $objectManager->get('Magento\Module\Dir\Reader'); @@ -90,7 +90,7 @@ class TranslateTest extends \PHPUnit_Framework_TestCase array('getDesignTheme'), array( $objectManager->get('Magento\Core\Model\StoreManagerInterface'), - $objectManager->get('Magento\Core\Model\Theme\FlyweightFactory'), + $objectManager->get('Magento\View\Design\Theme\FlyweightFactory'), $objectManager->get('Magento\Core\Model\Config'), $objectManager->get('Magento\Core\Model\Store\Config'), $objectManager->get('Magento\Core\Model\ThemeFactory'), diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php index 884060e9ffb..6d367985a03 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php @@ -38,7 +38,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -48,7 +48,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase protected $_viewConfig; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -83,11 +83,11 @@ class DesignTest extends \PHPUnit_Framework_TestCase $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\View\DesignInterface'); $this->_viewFileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\FileSystem'); + ->create('Magento\View\FileSystem'); $this->_viewConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\View\ConfigInterface'); $this->_viewUrl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Url'); + ->create('Magento\View\Url'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); } @@ -110,11 +110,11 @@ class DesignTest extends \PHPUnit_Framework_TestCase ->setDesignTheme($themePath); $this->_viewFileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\FileSystem'); + ->create('Magento\View\FileSystem'); $this->_viewConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\View\ConfigInterface'); $this->_viewUrl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Url'); + ->create('Magento\View\Url'); } public function testSetGetArea() diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml index df59507faa6..73d468dae96 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml @@ -26,4 +26,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" parent="default"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml index 57302e555b5..73d468dae96 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml @@ -26,4 +26,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml index df59507faa6..73d468dae96 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml @@ -26,4 +26,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" parent="default"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml index 57302e555b5..73d468dae96 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml @@ -26,4 +26,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Core/Utility/Layout.php b/dev/tests/integration/testsuite/Magento/Core/Utility/Layout.php index e69deca32d5..5e23a948fbb 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Utility/Layout.php +++ b/dev/tests/integration/testsuite/Magento/Core/Utility/Layout.php @@ -94,14 +94,14 @@ class Layout { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); return array( - 'processorFactory' => $objectManager->get('Magento\View\Layout\ProcessorFactory'), + 'processorFactory' => $objectManager->get('Magento\View\Layout\ProcessorFactory'), 'themeFactory' => $objectManager->get('Magento\Core\Model\Resource\Theme\CollectionFactory'), 'logger' => $objectManager->get('Magento\Logger'), 'eventManager' => $objectManager->get('Magento\Event\ManagerInterface'), 'factoryHelper' => $objectManager->get('Magento\Core\Model\Factory\Helper'), 'coreData' => $objectManager->get('Magento\Core\Helper\Data'), 'design' => $objectManager->get('Magento\View\DesignInterface'), - 'blockFactory' => $objectManager->create('Magento\Core\Model\BlockFactory', array()), + 'blockFactory' => $objectManager->create('Magento\View\Element\BlockFactory', array()), 'structure' => $objectManager->create('Magento\Data\Structure', array()), 'argumentProcessor' => $objectManager->create('Magento\Core\Model\Layout\Argument\Processor', array()), 'scheduledStructure' => $objectManager->create('Magento\Core\Model\Layout\ScheduledStructure', array()), diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php b/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php index 42b6910b4f2..e7f6a3c90ee 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php @@ -22,6 +22,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var \Magento\Core\Model\Cache\Type\Config $layoutCache */ -$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cache\Type\Config'); +/** @var \Magento\App\Cache\Type\Config $layoutCache */ +$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache\Type\Config'); $layoutCache->save('fixture config cache data', 'CONFIG_CACHE_FIXTURE'); diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php b/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php index 01d1f0d23bd..bc9da3205c7 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cache \Magento\Core\Model\Cache */ +/** @var $cache \Magento\App\Cache */ $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache'); + ->create('Magento\App\Cache'); $cache->clean(array(\Magento\Core\Model\Design::CACHE_TAG)); diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php b/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php index 4bea1db7207..435cd58c2ab 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php @@ -22,6 +22,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var \Magento\Core\Model\Cache\Type\Layout $layoutCache */ -$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cache\Type\Layout'); +/** @var \Magento\App\Cache\Type\Layout $layoutCache */ +$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache\Type\Layout'); $layoutCache->save('fixture layout cache data', 'LAYOUT_CACHE_FIXTURE'); diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php b/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php index f5f5f650c2d..3912573f5fc 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php @@ -35,7 +35,7 @@ $theme->setThemePath('test/test') ->setThemeVersion('2.0.0.0') ->setArea('frontend') ->setThemeTitle('Test Theme') - ->setType(\Magento\Core\Model\Theme::TYPE_VIRTUAL) + ->setType(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) ->save(); /** @var $updateNotTemporary \Magento\Core\Model\Layout\Update */ diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php index 402423f5434..e37a23a6e9b 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php @@ -39,7 +39,7 @@ class AccountTest extends \Magento\TestFramework\TestCase\AbstractController ->create('Magento\Customer\Model\Session', array($logger)); $session->login('customer@example.com', 'password'); $this->dispatch('customer/account/index'); - $this->assertContains('<div class="my-account">', $this->getResponse()->getBody()); + $this->assertContains('<div class="block dashboard welcome">', $this->getResponse()->getBody()); } /** diff --git a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php index 1652de54494..c573659d85e 100644 --- a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php +++ b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php @@ -40,7 +40,7 @@ class QuickStylesTest extends \PHPUnit_Framework_TestCase protected $_design; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -53,7 +53,7 @@ class QuickStylesTest extends \PHPUnit_Framework_TestCase $this->_design = $objectManager->get('Magento\View\DesignInterface'); $objectManager->get('Magento\App\State')->setAreaCode(\Magento\View\DesignInterface::DEFAULT_AREA); $this->_design->setDesignTheme('vendor_test'); - $this->_viewFileSystem = $objectManager->get('Magento\Core\Model\View\FileSystem'); + $this->_viewFileSystem = $objectManager->get('Magento\View\FileSystem'); $quickStylesPath = $this->_viewFileSystem->getFilename('Magento_DesignEditor::controls/quick_styles.xml'); $this->assertFileExists($quickStylesPath); $this->_model = $objectManager->create( diff --git a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php index 9702190a028..a5d60320b88 100644 --- a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php @@ -53,13 +53,13 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $pageAssets = $page->getAssets(); $fixtureAssets = array( - array('name' => 'test_css', 'type' => \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS, + array('name' => 'test_css', 'type' => \Magento\View\Publisher::CONTENT_TYPE_CSS, 'params' => array()), - array('name' => 'test_css_vde', 'type' => \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS, + array('name' => 'test_css_vde', 'type' => \Magento\View\Publisher::CONTENT_TYPE_CSS, 'params' => array('flag_name' => 'vde_design_mode')), - array('name' => 'test_js', 'type' => \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS, + array('name' => 'test_js', 'type' => \Magento\View\Publisher::CONTENT_TYPE_JS, 'params' => array()), - array('name' => 'test_js_vde', 'type' => \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS, + array('name' => 'test_js_vde', 'type' => \Magento\View\Publisher::CONTENT_TYPE_JS, 'params' => array('flag_name' => 'vde_design_mode')), ); diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php new file mode 100644 index 00000000000..896c03040d5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php @@ -0,0 +1,234 @@ +<?php +/** + * Test for \Magento\Filesystem\Stream\Local + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\Directory; + +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Class ReadTest + * Test for Magento\Filesystem\Directory\Read class + * @package Magento\Filesystem\Directory + */ +class ReadTest extends \PHPUnit_Framework_TestCase +{ + /** + * Test instance of Read + */ + public function testInstance() + { + $dir = $this->getDirectoryInstance('foo'); + $this->assertTrue($dir instanceof ReadInterface); + } + + /** + * Test for getAbsolutePath method + */ + public function testGetAbsolutePath() + { + $dir = $this->getDirectoryInstance('foo'); + $this->assertContains( + '../_files/foo/bar', + $dir->getAbsolutePath('bar') + ); + } + + /** + * Test for read method + * + * @dataProvider readProvider + * @param string $dirPath + * @param string $readPath + * @param array $expectedResult + */ + public function testRead($dirPath, $readPath, $expectedResult) + { + $dir = $this->getDirectoryInstance($dirPath); + $result = $dir->read($readPath); + foreach ($expectedResult as $path) { + $this->assertTrue(in_array($path, $result)); + } + } + + /** + * Data provider for testRead + * + * @return array + */ + public function readProvider() + { + return array( + array('foo', null, array('bar', 'file_three.txt')), + array('foo/bar', null, array('baz', 'file_two.txt')), + array('foo', 'bar', array('bar/baz', 'bar/file_two.txt')) + ); + } + + /** + * Test for search method + * + * @dataProvider searchProvider + * @param string $dirPath + * @param string $pattern + * @param array $expectedResult + */ + public function testSearch($dirPath, $pattern, $expectedResult) + { + $dir = $this->getDirectoryInstance($dirPath); + $result = $dir->search($pattern); + foreach ($expectedResult as $path) { + $this->assertTrue(in_array($path, $result)); + } + } + + /** + * Data provider for testSearch + * + * @return array + */ + public function searchProvider() + { + return array( + array('foo', '/bar/', array('bar/baz/file_one.txt', 'bar/file_two.txt')), + array('foo', '/\.txt/', array('bar/baz/file_one.txt', 'bar/file_two.txt', 'file_three.txt')), + array('foo', '/notfound/', array()) + ); + } + + /** + * Test for isExist method + * + * @dataProvider existsProvider + * @param string $dirPath + * @param string $path + * @param bool $exists + */ + public function testIsExist($dirPath, $path, $exists) + { + $dir = $this->getDirectoryInstance($dirPath); + $this->assertEquals($exists, $dir->isExist($path)); + } + + /** + * Data provider for testIsExist + * + * @return array + */ + public function existsProvider() + { + return array( + array('foo', 'bar', true), + array('foo', 'bar/baz/', true), + array('foo', 'bar/notexists', false) + ); + } + + /** + * Test for stat method + * + * @dataProvider statProvider + * @param string $dirPath + * @param string $path + */ + public function testStat($dirPath, $path) + { + $dir = $this->getDirectoryInstance($dirPath); + $expectedInfo = array( + 'dev', 'ino', 'mode', 'nlink', 'uid', + 'gid', 'rdev', 'size', 'atime', + 'mtime', 'ctime', 'blksize', 'blocks' + ); + $result = $dir->stat($path); + foreach ($expectedInfo as $key) { + $this->assertTrue(array_key_exists($key, $result)); + } + } + + /** + * Data provider for testStat + * + * @return array + */ + public function statProvider() + { + return array( + array('foo', 'bar'), + array('foo', 'file_three.txt') + ); + } + + /** + * Test for isReadable method + * + * @dataProvider isReadbaleProvider + * @param string $dirPath + * @param string $path + * @param bool $readable + */ + public function testIsReadable($dirPath, $path, $readable) + { + $dir = $this->getDirectoryInstance($dirPath); + $this->assertEquals($readable, $dir->isReadable($path)); + } + + /** + * Data provider for testIsReadable + * + * @return array + */ + public function isReadbaleProvider() + { + return array( + array('foo', 'bar', true), + array('foo', 'file_three.txt', true) + ); + } + + /** + * Test for openFile method + */ + public function testOpenFile() + { + $file = $this->getDirectoryInstance('foo')->openFile('file_three.txt'); + $file->close(); + $this->assertTrue($file instanceof \Magento\Filesystem\File\ReadInterface); + } + + /** + * Get readable file instance + * Get full path for files located in _files directory + * + * @param string $path + * @return Read + */ + private function getDirectoryInstance($path) + { + $fullPath = __DIR__ . '/../_files/' . $path; + $readFactory = Bootstrap::getObjectManager()->create( + 'Magento\Filesystem\File\ReadFactory', array('path' => $fullPath) + ); + return new Read($fullPath, $readFactory); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php new file mode 100644 index 00000000000..526a9dd3fa9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php @@ -0,0 +1,392 @@ +<?php +/** + * Test for \Magento\Filesystem\Stream\Local + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\Directory; + +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Class ReadTest + * Test for Magento\Filesystem\Directory\Read class + * @package Magento\Filesystem\Directory + */ +class WriteTest extends \PHPUnit_Framework_TestCase +{ + /** + * Test data to be cleaned + * + * @var array + */ + private $testDirectories = array(); + + /** + * Test instance of Read + */ + public function testInstance() + { + $dir = $this->getDirectoryInstance('newDir1', 0777); + $this->assertTrue($dir instanceof ReadInterface); + $this->assertTrue($dir instanceof WriteInterface); + } + + /** + * Test for create method + * + * @dataProvider createProvider + * @param string $basePath + * @param int $permissions + * @param string $path + */ + public function testCreate($basePath, $permissions, $path) + { + $directory = $this->getDirectoryInstance($basePath, $permissions); + $this->assertTrue($directory->create($path)); + $this->assertTrue($directory->isExist($path)); + } + + /** + * Data provider for testCreate + * + * @return array + */ + public function createProvider() + { + return array( + array('newDir1', 0777, "newDir1"), + array('newDir1', 0777, "root_dir1/subdir1/subdir2"), + array('newDir2', 0777, "root_dir2/subdir") + ); + } + + /** + * Test for delete method + * + * @dataProvider deleteProvider + * @param string $path + */ + public function testDelete($path) + { + $directory = $this->getDirectoryInstance('newDir', 0777); + $directory->create($path); + $this->assertTrue($directory->isExist($path)); + $directory->delete($path); + $this->assertFalse($directory->isExist($path)); + } + + /** + * Data provider for testDelete + * + * @return array + */ + public function deleteProvider() + { + return array( + array('subdir'), + array('subdir/subsubdir') + ); + } + + /** + * Test for rename method (in scope of one directory instance) + * + * @dataProvider renameProvider + * @param string $basePath + * @param int $permissions + * @param string $name + * @param string $newName + */ + public function testRename($basePath, $permissions, $name, $newName) + { + $directory = $this->getDirectoryInstance($basePath, $permissions); + $directory->create($name); + $created = $directory->read(); + $directory->rename($name, $newName); + $renamed = $directory->read(); + $this->assertTrue(in_array($name, $created)); + $this->assertTrue(in_array($newName, $renamed)); + $this->assertFalse(in_array($name, $renamed)); + } + + + /** + * Data provider for testRename + * + * @return array + */ + public function renameProvider() + { + return array( + array('newDir1', 0777, 'first_name', 'second_name') + ); + } + + /** + * Test for rename method (moving to new directory instance) + * + * @dataProvider renameTargetDirProvider + * @param string $firstDir + * @param string $secondDir + * @param int $permission + * @param string $name + * @param string $newName + */ + public function testRenameTargetDir($firstDir, $secondDir, $permission, $name, $newName) + { + $dir1 = $this->getDirectoryInstance($firstDir, $permission); + $dir2 = $this->getDirectoryInstance($secondDir, $permission); + + $dir1->create($name); + $created = $dir1->read(); + $dir1->rename($name, $newName, $dir2); + $oldPlace = $dir1->read(); + $newPlace = $dir2->read(); + + $this->assertTrue(in_array($name, $created)); + $this->assertTrue(in_array($newName, $newPlace)); + $this->assertFalse(in_array($name, $oldPlace)); + } + + /** + * Data provider for testRenameTargetDir + * + * @return array + */ + public function renameTargetDirProvider() + { + return array( + array('dir1', 'dir2', 0777, 'first_name', 'second_name') + ); + } + + /** + * Test for copy method (copy in scope of one directory instance) + * + * @dataProvider renameProvider + * @param string $basePath + * @param int $permissions + * @param string $name + * @param string $newName + */ + public function testCopy($basePath, $permissions, $name, $newName) + { + $directory = $this->getDirectoryInstance($basePath, $permissions); + $file = $directory->openFile($name, 'w+'); + $file->close(); + $directory->copy($name, $newName); + $this->assertTrue($directory->isExist($name)); + $this->assertTrue($directory->isExist($newName)); + } + + /** + * Data provider for testCopy + * + * @return array + */ + public function copyProvider() + { + return array( + array('newDir1', 0777, 'first_name.txt', 'second_name.txt'), + array('newDir1', 0777, 'subdir/first_name.txt', 'subdir/second_name.txt') + ); + } + + /** + * Test for copy method (copy to another directory instance) + * + * @dataProvider copyTargetDirProvider + * @param string $firstDir + * @param string $secondDir + * @param int $permission + * @param string $name + * @param string $newName + */ + public function testCopyTargetDir($firstDir, $secondDir, $permission, $name, $newName) + { + $dir1 = $this->getDirectoryInstance($firstDir, $permission); + $dir2 = $this->getDirectoryInstance($secondDir, $permission); + + $file = $dir1->openFile($name, 'w+'); + $file->close(); + $dir1->copy($name, $newName, $dir2); + + $this->assertTrue($dir1->isExist($name)); + $this->assertTrue($dir2->isExist($newName)); + } + + /** + * Data provider for testCopyTargetDir + * + * @return array + */ + public function copyTargetDirProvider() + { + return array( + array('dir1', 'dir2', 0777, 'first_name.txt', 'second_name.txt'), + array('dir1', 'dir2', 0777, 'subdir/first_name.txt', 'subdir/second_name.txt') + ); + } + + /** + * Test for changePermissions method + */ + public function testChangePermissions() + { + $directory = $this->getDirectoryInstance('newDir1', 0777); + $directory->create('test_directory'); + $this->assertTrue($directory->changePermissions('test_directory', 0644)); + } + + /** + * Test for touch method + * + * @dataProvider touchProvider + * @param string $basePath + * @param int $permissions + * @param string $path + * @param int $time + */ + public function testTouch($basePath, $permissions, $path, $time) + { + $directory = $this->getDirectoryInstance($basePath, $permissions); + $directory->openFile($path); + $this->assertTrue($directory->touch($path, $time)); + $this->assertEquals($time, $directory->stat($path)['mtime']); + } + + /** + * Data provider for testTouch + * + * @return array + */ + public function touchProvider() + { + return array( + array('test_directory', 0777, 'touch_file.txt', time() - 3600), + array('test_directory', 0777, 'subdirectory/touch_file.txt', time() - 3600) + ); + } + + /** + * Test isWritable method + */ + public function testIsWritable() + { + $directory = $this->getDirectoryInstance('newDir1', 0777); + $directory->create('bar'); + $this->assertFalse($directory->isWritable('not_existing_dir')); + $this->assertTrue($directory->isWritable('bar')); + } + + /** + * Test for openFile method + * + * @dataProvider openFileProvider + * @param string $basePath + * @param int $permissions + * @param string $path + * @param string $mode + */ + public function testOpenFile($basePath, $permissions, $path, $mode) + { + $directory = $this->getDirectoryInstance($basePath, $permissions); + $file = $directory->openFile($path, $mode); + $this->assertTrue($file instanceof \Magento\Filesystem\File\WriteInterface); + $file->close(); + } + + /** + * Data provider for testOpenFile + * + * @return array + */ + public function openFileProvider() + { + return array( + array('newDir1', 0777, 'newFile.txt', 'w+'), + array('newDir1', 0777, 'subdirectory/newFile.txt', 'w+') + ); + } + + /** + * Test for writeFile method + * + * @dataProvider writeFileProvider + * @param string $basePath + * @param int $permissions + * @param string $path + * @param string $content + * @param int $mode + * @param int $bytes + */ + public function testWriteFile($basePath, $permissions, $path, $content, $mode, $bytes) + { + $directory = $this->getDirectoryInstance($basePath, $permissions); + $this->assertEquals($bytes, $directory->writeFile($path, $content, $mode)); + } + + /** + * Data provider for testWriteFile + * + * @return array + */ + public function writeFileProvider() + { + return array( + array('newDir1', 0777, 'newFile.txt', 'content', 0777, 7), + array('newDir1', 0777, 'subdirectory/newFile.txt', 'content', 0777, 7) + ); + } + + /** + * Tear down + */ + public function tearDown() + { + foreach ($this->testDirectories as $directory) { + if ($directory->isExist()) { + $directory->delete(); + } + } + } + + /** + * Get readable file instance + * Get full path for files located in _files directory + * + * @param string $path + * @param string $permissions + * @return Write + */ + private function getDirectoryInstance($path, $permissions) + { + $fullPath = __DIR__ . '/../_files/' . $path; + $writeFactory = Bootstrap::getObjectManager()->create( + 'Magento\Filesystem\File\WriteFactory', array('path' => $fullPath) + ); + $write = new Write($fullPath, $writeFactory, $permissions); + $this->testDirectories[] = $write; + return $write; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/File/ReadTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/File/ReadTest.php new file mode 100644 index 00000000000..5417e3a4d4d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Filesystem/File/ReadTest.php @@ -0,0 +1,244 @@ +<?php +/** + * Test for \Magento\Filesystem\Stream\Local + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\File; + +use Magento\TestFramework\Helper\Bootstrap; + +class ReadTest extends \PHPUnit_Framework_TestCase +{ + /** + * Test instance of Read + */ + public function testInstance() + { + $file = $this->getFileInstance('popup.csv'); + $this->assertTrue($file instanceof ReadInterface); + } + + /** + * Test for assertValid method + * Expected exception for file that does not exist and file without access + * + * @dataProvider providerNotValidFiles + * @param string $path + * @expectedException \Magento\Filesystem\FilesystemException + */ + public function testAssertValid($path) + { + $this->getFileInstance($path); + } + + /** + * Data provider for testAssertValid + * + * @return array + */ + public function providerNotValidFiles() + { + return array( + array('invalid.csv'), //File does not exist + ); + } + + /** + * Test for read method + * + * @dataProvider providerRead + * @param string $path + * @param int $length + * @param string $expectedResult + */ + public function testRead($path, $length, $expectedResult) + { + $file = $this->getFileInstance($path); + $result = $file->read($length); + $this->assertEquals($result, $expectedResult); + } + + /** + * Data provider for testRead + * + * @return array + */ + public function providerRead() + { + return array( + array('popup.csv', 10, 'var myData'), + array('popup.csv', 15, 'var myData = 5;') + ); + } + + /** + * Test for readCsv method + * + * @dataProvider providerCsv + * @param string $path + * @param int $length + * @param string $delimiter + * @param string $enclosure + * @param string $escape + * @param array $expectedRow1 + * @param array $expectedRow2 + */ + public function testReadCsv($path, $length, $delimiter, $enclosure, $escape, $expectedRow1, $expectedRow2) + { + $file = $this->getFileInstance($path); + $actualRow1 = $file->readCsv($length, $delimiter, $enclosure, $escape); + $actualRow2 = $file->readCsv($length, $delimiter, $enclosure, $escape); + $this->assertEquals($expectedRow1, $actualRow1); + $this->assertEquals($expectedRow2, $actualRow2); + } + + /** + * Data provider for testReadCsv + * + * @return array + */ + public function providerCsv() + { + return array( + array('data.csv', 0, ',', '"', '\\', array('field1', 'field2'), array('field3', 'field4')) + ); + } + + /** + * Test for tell method + * + * @dataProvider providerPosition + * @param string $path + * @param int $position + */ + public function testTell($path, $position) + { + $file = $this->getFileInstance($path); + $file->read($position); + $this->assertEquals($position, $file->tell()); + } + + /** + * Data provider for testTell + * + * @return array + */ + public function providerPosition() + { + return array( + array('popup.csv', 5), + array('popup.csv', 10) + ); + } + + /** + * Test for seek method + * + * @dataProvider providerSeek + * @param string $path + * @param int $position + * @param int $whence + * @param int $tell + */ + public function testSeek($path, $position, $whence, $tell) + { + $file = $this->getFileInstance($path); + $file->seek($position, $whence); + $this->assertEquals($tell, $file->tell()); + } + + /** + * Data provider for testSeek + * + * @return array + */ + public function providerSeek() + { + return array( + array('popup.csv', 5, SEEK_SET, 5), + array('popup.csv', 10, SEEK_CUR, 10), + array('popup.csv', -10, SEEK_END, 5) + ); + } + + /** + * Test for eof method + * + * @dataProvider providerEof + * @param string $path + * @param int $position + */ + public function testEofFalse($path, $position) + { + $file = $this->getFileInstance($path); + $file->seek($position); + $this->assertFalse($file->eof()); + } + + /** + * Data provider for testEofTrue + * + * @return array + */ + public function providerEof() + { + return array( + array('popup.csv', 5, false), + array('popup.csv', 10, false), + ); + } + + /** + * Test for eof method + */ + public function testEofTrue() + { + $file = $this->getFileInstance('popup.csv'); + $file->seek(0, SEEK_END); + $file->read(1); + $this->assertTrue($file->eof()); + } + + /** + * Test for close method + */ + public function testClose() + { + $file = $this->getFileInstance('popup.csv'); + $this->assertTrue($file->close()); + } + + /** + * Get readable file instance + * Get full path for files located in _files directory + * + * @param $path + * @return Read + */ + private function getFileInstance($path) + { + $fullPath = __DIR__ . DS . '..' . DS . '_files' . DS . $path; + return Bootstrap::getObjectManager() + ->create('Magento\Filesystem\File\Read', array('path' => $fullPath)); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/File/WriteTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/File/WriteTest.php new file mode 100644 index 00000000000..1172d840f5f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Filesystem/File/WriteTest.php @@ -0,0 +1,227 @@ +<?php +/** + * Test for \Magento\Filesystem\Stream\Local + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\File; + +use Magento\TestFramework\Helper\Bootstrap; + +class WriteTest extends \PHPUnit_Framework_TestCase +{ + /** + * Current file path + * + * @var string + */ + private $currentFilePath; + + /** + * Test instance of Write. + */ + public function testInstance() + { + $file = $this->getFileInstance('popup.csv', 'r'); + $this->assertTrue($file instanceof ReadInterface); + $this->assertTrue($file instanceof WriteInterface); + $file->close(); + } + + /** + * Test exceptions on attempt to open existing file with x mode + * + * @dataProvider fileExistProvider + * @param $path + * @param $mode + * @expectedException \Magento\Filesystem\FilesystemException + */ + public function testFileExistException($path, $mode) + { + $this->getFileInstance($path, $mode); + } + + /** + * Data provider for modeProvider + * + * @return array + */ + public function fileExistProvider() + { + return array( + array('popup.csv', 'x'), + array('popup.csv', 'x+') + ); + } + + /** + * Test for write method + * + * @dataProvider writeProvider + * @param string $path + * @param string $mode + * @param string $write + * @param string $expectedResult + */ + public function testWriteOnly($path, $mode, $write, $expectedResult) + { + $file = $this->getFileInstance($path, $mode); + $result = $file->write($write); + $file->close(); + $this->removeCurrentFile(); + $this->assertEquals($expectedResult, $result); + } + + /** + * Data provider for modeProvider + * + * @return array + */ + public function writeProvider() + { + return array( + array('new1.csv', 'w', 'write check', 11), + array('new3.csv', 'a', 'write check', 11), + array('new5.csv', 'x', 'write check', 11), + array('new7.csv', 'c', 'write check', 11) + ); + } + + /** + * Test for write method + * + * @dataProvider writeAndReadProvider + * @param string $path + * @param string $mode + * @param string $write + * @param string $expectedResult + */ + public function testWriteAndRead($path, $mode, $write, $expectedResult) + { + $file = $this->getFileInstance($path, $mode); + $result = $file->write($write); + $file->seek(0); + $read = $file->read($result); + $file->close(); + $this->removeCurrentFile(); + $this->assertEquals($expectedResult, $result); + $this->assertEquals($write, $read); + } + + /** + * Data provider for modeProvider + * + * @return array + */ + public function writeAndReadProvider() + { + return array( + array('new2.csv', 'w+', 'write check', 11), + array('new4.csv', 'a+', 'write check', 11), + array('new6.csv', 'x+', 'write check', 11), + array('new8.csv', 'c+', 'write check', 11) + ); + } + + /** + * Writes one CSV row to the file. + * + * @dataProvider csvProvider + * @param string $path + * @param array $data + * @param string $delimiter + * @param string $enclosure + */ + public function testWriteCsv($path, array $data, $delimiter = ',', $enclosure = '"') + { + $file = $this->getFileInstance($path, 'w+'); + $result = $file->writeCsv($data, $delimiter, $enclosure); + $file->seek(0); + $read = $file->readCsv($result, $delimiter, $enclosure); + $file->close(); + $this->removeCurrentFile(); + $this->assertEquals($data, $read); + } + + /** + * Data provider for testWriteCsv + * + * @return array + */ + public function csvProvider() + { + return array( + array( + 'newcsv1.csv', array('field1', 'field2'), ',', '"' + ), + array( + 'newcsv1.csv', array('field1', 'field2'), '%', '@' + ) + ); + } + + /** + * Test for lock and unlock functions + */ + public function testLockUnlock() + { + $file = $this->getFileInstance('locked.csv', 'w+'); + $this->assertTrue($file->lock()); + $this->assertTrue($file->unlock()); + $file->close(); + $this->removeCurrentFile(); + } + + /** + * Test for flush method + */ + public function testFlush() + { + $file = $this->getFileInstance('locked.csv', 'w+'); + $this->assertTrue($file->flush()); + $file->close(); + $this->removeCurrentFile(); + } + + /** + * Remove current file + */ + private function removeCurrentFile() + { + unlink($this->currentFilePath); + } + + /** + * Get readable file instance + * Get full path for files located in _files directory + * + * @param string $path + * @param string $mode + * @return Write + */ + private function getFileInstance($path, $mode) + { + $this->currentFilePath = __DIR__ . DS . '..' . DS . '_files' . DS . $path; + return Bootstrap::getObjectManager() + ->create('Magento\Filesystem\File\Write', array('path' => $this->currentFilePath, 'mode' => $mode)); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php b/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php index aab82d30da2..db01dbf4565 100644 --- a/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php +++ b/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php @@ -35,8 +35,8 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase * @var array */ protected $_adapters = array( - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_GD2, - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_IM + \Magento\Image\Adapter\AdapterInterface::ADAPTER_GD2, + \Magento\Image\Adapter\AdapterInterface::ADAPTER_IM ); /** @@ -133,7 +133,7 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase { try { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $adapter = $objectManager->get('Magento\Core\Model\Image\AdapterFactory')->create($adapterType); + $adapter = $objectManager->get('Magento\Image\AdapterFactory')->create($adapterType); return $adapter; } catch (\Exception $e) { $this->markTestSkipped($e->getMessage()); @@ -154,8 +154,8 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase public function adaptersDataProvider() { return array( - array(\Magento\Core\Model\Image\AdapterFactory::ADAPTER_GD2), - array(\Magento\Core\Model\Image\AdapterFactory::ADAPTER_IM), + array(\Magento\Image\Adapter\AdapterInterface::ADAPTER_GD2), + array(\Magento\Image\Adapter\AdapterInterface::ADAPTER_IM), ); } @@ -622,28 +622,28 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase 'expectedColor1' => array('red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0), array('x' => 0, 'y' => 15), 'expectedColor2' => array('red' => 255, 'green' => 255, 'blue' => 255, 'alpha' => 127), - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_GD2 + \Magento\Image\Adapter\AdapterInterface::ADAPTER_GD2 ), array( array('x' => 4, 'y' => 7), 'expectedColor1' => array('red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0), array('x' => 0, 'y' => 15), 'expectedColor2' => array('red' => 255, 'green' => 255, 'blue' => 255, 'alpha' => 127), - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_IM + \Magento\Image\Adapter\AdapterInterface::ADAPTER_IM ), array( array('x' => 1, 'y' => 14), 'expectedColor1' => array('red' => 255, 'green' => 255, 'blue' => 255, 'alpha' => 127), array('x' => 5, 'y' => 12), 'expectedColor2' => array('red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0), - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_GD2 + \Magento\Image\Adapter\AdapterInterface::ADAPTER_GD2 ), array( array('x' => 1, 'y' => 14), 'expectedColor1' => array('red' => 255, 'green' => 255, 'blue' => 255, 'alpha' => 127), array('x' => 4, 'y' => 10), 'expectedColor2' => array('red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0), - \Magento\Core\Model\Image\AdapterFactory::ADAPTER_IM + \Magento\Image\Adapter\AdapterInterface::ADAPTER_IM ), ); } @@ -651,7 +651,7 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase public function testValidateUploadFile() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $imageAdapter = $objectManager->get('Magento\Core\Model\Image\AdapterFactory')->create(); + $imageAdapter = $objectManager->get('Magento\Image\AdapterFactory')->create(); $this->assertTrue($imageAdapter->validateUploadFile($this->_getFixture('magento_thumbnail.jpg'))); } @@ -661,7 +661,7 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase public function testValidateUploadFileException() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $imageAdapter = $objectManager->get('Magento\Core\Model\Image\AdapterFactory')->create(); + $imageAdapter = $objectManager->get('Magento\Image\AdapterFactory')->create(); $imageAdapter->validateUploadFile(__FILE__); } } diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php index 14c3b3cfef2..c1d81ddbe4c 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php @@ -469,7 +469,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase array('init'), array( $objectManager->create('Magento\Core\Helper\File\Storage\Database'), $objectManager->create('Magento\Core\Helper\File\Storage'), - $objectManager->create('Magento\Core\Model\Image\AdapterFactory'), + $objectManager->create('Magento\Image\AdapterFactory'), $objectManager->create('Magento\Core\Model\File\Validator\NotProtectedExtension'), )); $this->_uploaderFactory->expects($this->any())->method('create')->will($this->returnValue($uploader)); diff --git a/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php index 5b7b4792205..cc82c080b8e 100644 --- a/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php @@ -40,14 +40,14 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cacheTypeList \Magento\Core\Model\Cache\TypeListInterface */ + /** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ + /** @var $cacheState \Magento\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\Cache\StateInterface'); + ->get('Magento\App\Cache\StateInterface'); foreach ($types as $type) { $cacheState->setEnabled($type, false); } diff --git a/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php b/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php index 74fabf9d118..6641592ae4c 100644 --- a/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php +++ b/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php @@ -175,13 +175,13 @@ class InstallerTest extends \PHPUnit_Framework_TestCase $this->_getModel(true)->finish(); - /** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ + /** @var $cacheState \Magento\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\StateInterface'); + ->create('Magento\App\Cache\StateInterface'); - /** @var \Magento\Core\Model\Cache\TypeListInterface $cacheTypeList */ + /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Cache\TypeListInterface'); + ->create('Magento\App\Cache\TypeListInterface'); $types = array_keys($cacheTypeList->getTypes()); foreach ($types as $type) { $this->assertTrue( diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php index 60c4b332401..453ab4b5b31 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php @@ -50,12 +50,13 @@ class QueueTest extends \PHPUnit_Framework_TestCase $app = $objectManager->get('Magento\Core\Model\App'); $app->loadArea(\Magento\Core\Model\App\Area::AREA_FRONTEND); - /** @var $collection \Magento\Core\Model\Resource\Theme\Collection */ $collection = $objectManager->create('Magento\Core\Model\Resource\Theme\Collection'); $themeId = $collection->getThemeByFullPath('frontend/magento_demo')->getId(); /** @var $storeManager \Magento\Core\Model\StoreManagerInterface */ $storeManager = $objectManager->get('Magento\Core\Model\StoreManagerInterface'); - $storeManager->getStore('fixturestore')->setConfig('design/theme/theme_id', $themeId); + $storeManager->getStore('fixturestore')->setConfig( + \Magento\Core\Model\View\Design::XML_PATH_THEME_ID, $themeId + ); $subscriberOne = $this->getMock('Zend_Mail', array('send', 'setBodyHTML'), array('utf-8')); $subscriberOne->expects($this->any())->method('send'); @@ -76,8 +77,8 @@ class QueueTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\Core\Model\Registry'), $appEmulation, $objectManager->get('Magento\Filesystem'), - $objectManager->get('Magento\Core\Model\View\Url'), - $objectManager->get('Magento\Core\Model\View\FileSystem'), + $objectManager->get('Magento\View\Url'), + $objectManager->get('Magento\View\FileSystem'), $design, $objectManager->get('Magento\Core\Model\Store\ConfigInterface'), $objectManager->get('Magento\Core\Model\ConfigInterface'), @@ -123,8 +124,8 @@ class QueueTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\Core\Model\Registry'), $objectManager->get('Magento\Core\Model\App\Emulation'), $objectManager->get('Magento\Filesystem'), - $objectManager->get('Magento\Core\Model\View\Url'), - $objectManager->get('Magento\Core\Model\View\FileSystem'), + $objectManager->get('Magento\View\Url'), + $objectManager->get('Magento\View\FileSystem'), $objectManager->get('Magento\Core\Model\View\Design'), $objectManager->get('Magento\Core\Model\Store\ConfigInterface'), $objectManager->get('Magento\Core\Model\ConfigInterface'), diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/ReaderTest.php similarity index 93% rename from dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/ReaderTest.php rename to dev/tests/integration/testsuite/Magento/Object/Copy/Config/ReaderTest.php index 4aa04730111..22482a4b2c2 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/ReaderTest.php @@ -1,6 +1,6 @@ <?php /** - * \Magento\Core\Model\Fieldset\Config\Reader + * \Magento\Object\Copy\Config\Reader * * Magento * @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset\Config; +namespace Magento\Object\Copy\Config; /** * @magentoDataFixture Magento/Adminhtml/controllers/_files/cache/all_types_disabled.php @@ -31,7 +31,7 @@ namespace Magento\Core\Model\Fieldset\Config; class ReaderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Fieldset\Config\Reader + * @var \Magento\Object\Copy\Config\Reader */ protected $_model; @@ -87,7 +87,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase ); $this->_model = $objectManager->create( - 'Magento\Core\Model\Fieldset\Config\Reader', array( + 'Magento\Object\Copy\Config\Reader', array( 'fileResolver' => $fileResolver, ) ); @@ -115,9 +115,9 @@ class ReaderTest extends \PHPUnit_Framework_TestCase ->with($this->equalTo('fieldset.xml'), $this->equalTo('global')) ->will($this->returnValue($fileList)); - /** @var \Magento\Core\Model\Fieldset\Config\Reader $model */ + /** @var \Magento\Object\Copy\Config\Reader $model */ $model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Core\Model\Fieldset\Config\Reader', array( + 'Magento\Object\Copy\Config\Reader', array( 'fileResolver' => $fileResolverMock, ) ); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/Magento/Test/etc/fieldset.xml b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/Magento/Test/etc/fieldset.xml similarity index 96% rename from dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/Magento/Test/etc/fieldset.xml rename to dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/Magento/Test/etc/fieldset.xml index 5a83d909e42..c51423ae088 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/Magento/Test/etc/fieldset.xml +++ b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/Magento/Test/etc/fieldset.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../app/code/Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="company"> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/Magento/Test/etc/module.xml b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/Magento/Test/etc/module.xml similarity index 100% rename from dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/Magento/Test/etc/module.xml rename to dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/Magento/Test/etc/module.xml diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/expectedArray.php b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/expectedArray.php similarity index 100% rename from dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/expectedArray.php rename to dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/expectedArray.php diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/partialFieldsetFirst.xml b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/partialFieldsetFirst.xml similarity index 96% rename from dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/partialFieldsetFirst.xml rename to dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/partialFieldsetFirst.xml index 4dfb3c9db80..98492b0c9db 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/partialFieldsetFirst.xml +++ b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/partialFieldsetFirst.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_item"> <field name="event_id"> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/partialFieldsetSecond.xml b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/partialFieldsetSecond.xml similarity index 96% rename from dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/partialFieldsetSecond.xml rename to dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/partialFieldsetSecond.xml index 6ec52d663b6..b3385b96f22 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Fieldset/Config/_files/partialFieldsetSecond.xml +++ b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/_files/partialFieldsetSecond.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Core/etc/fieldset_file.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/Object/etc/fieldset_file.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_item"> <field name="event_id"> diff --git a/dev/tests/integration/testsuite/Magento/Object/CopyTest.php b/dev/tests/integration/testsuite/Magento/Object/CopyTest.php new file mode 100644 index 00000000000..3f16e2473ec --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Object/CopyTest.php @@ -0,0 +1,85 @@ +<?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 Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Object; + +class CopyTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Object\Copy + */ + protected $_service; + + protected function setUp() + { + $this->_service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Object\Copy'); + } + + public function testCopyFieldset() + { + $fieldset = 'sales_copy_order'; + $aspect = 'to_edit'; + $data = array( + 'customer_email' => 'admin@example.com', + 'customer_group_id' => '1', + ); + $source = new \Magento\Object($data); + $target = new \Magento\Object(); + $expectedTarget = new \Magento\Object($data); + $expectedTarget->setDataChanges(true); // hack for assertion + + $this->assertNull($this->_service->copyFieldsetToTarget($fieldset, $aspect, 'invalid_source', array())); + $this->assertNull($this->_service->copyFieldsetToTarget($fieldset, $aspect, array(), 'invalid_target')); + $this->assertEquals( + $target, + $this->_service->copyFieldsetToTarget('invalid_fieldset', $aspect, $source, $target) + ); + $this->assertSame($target, $this->_service->copyFieldsetToTarget($fieldset, $aspect, $source, $target)); + $this->assertEquals($expectedTarget, $target); + } + + public function testCopyFieldsetArrayTarget() + { + $fieldset = 'sales_copy_order'; + $aspect = 'to_edit'; + $data = array( + 'customer_email' => 'admin@example.com', + 'customer_group_id' => '1', + ); + $source = new \Magento\Object($data); + $target = array(); + $expectedTarget = $data; + + $this->assertEquals( + $target, + $this->_service->copyFieldsetToTarget('invalid_fieldset', $aspect, $source, $target) + ); + $this->assertEquals( + $expectedTarget, + $this->_service->copyFieldsetToTarget($fieldset, $aspect, $source, $target)); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Page/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Page/Model/Config/ReaderTest.php index c23c7ea3f38..4219eaf5ed3 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Page/Model/Config/ReaderTest.php @@ -38,8 +38,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\Core\Model\Cache */ - $cache = $objectManager->create('Magento\Core\Model\Cache'); + /** @var $cache \Magento\App\Cache */ + $cache = $objectManager->create('Magento\App\Cache'); $cache->clean(); $this->_fileResolverMock = $this->getMockBuilder('Magento\Config\FileResolverInterface') ->disableOriginalConstructor() diff --git a/dev/tests/integration/testsuite/Magento/Page/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Page/Model/ConfigTest.php index 9b4f857acaf..20e828eff0f 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Page/Model/ConfigTest.php @@ -35,8 +35,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\Core\Model\Cache */ - $cache = $objectManager->create('Magento\Core\Model\Cache'); + /** @var $cache \Magento\App\Cache */ + $cache = $objectManager->create('Magento\App\Cache'); $cache->clean(); $fileResolverMock = $this->getMockBuilder('Magento\Config\FileResolverInterface') ->disableOriginalConstructor() diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php index ffe2504cfae..2606f365374 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php @@ -38,8 +38,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\Core\Model\Cache */ - $cache = $objectManager->create('Magento\Core\Model\Cache'); + /** @var $cache \Magento\App\Cache */ + $cache = $objectManager->create('Magento\App\Cache'); $cache->clean(); $this->_fileResolverMock = $this->getMockBuilder('Magento\Config\FileResolverInterface') ->disableOriginalConstructor() diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php index f26f2fa8475..4e542e661c0 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php @@ -38,8 +38,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\Core\Model\Cache */ - $cache = $objectManager->create('Magento\Core\Model\Cache'); + /** @var $cache \Magento\App\Cache */ + $cache = $objectManager->create('Magento\App\Cache'); $cache->clean(); $fileResolverMock = $this->getMockBuilder('Magento\Config\FileResolverInterface') ->disableOriginalConstructor() diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php index 31b429c6748..973117bb228 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php @@ -125,8 +125,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase function (\Magento\View\Design\ThemeInterface $theme) { $xml = $this->_composeXml($theme); - $xpath = '/layouts/*[' - . '@type="' . \Magento\Core\Model\Layout\Merge::TYPE_PAGE . '"]'; + $xpath = '/layouts/*[@design_abstraction]'; $handles = $xml->xpath($xpath) ?: array(); /** @var \Magento\View\Layout\Element $node */ diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php index b6a93cc5f16..bccf187f865 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php @@ -41,9 +41,9 @@ class MethodsTest extends \PHPUnit_Framework_TestCase */ public function testPaymentMethod($code, $methodClass) { - /** @var $blockFactory \Magento\Core\Model\BlockFactory */ + /** @var $blockFactory \Magento\View\Element\BlockFactory */ $blockFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\BlockFactory'); + ->get('Magento\View\Element\BlockFactory'); $storeId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Core\Model\StoreManagerInterface')->getStore()->getId(); /** @var $model \Magento\Payment\Model\Method\AbstractMethod */ diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/SkinFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/SkinFilesTest.php index 4a554107f33..3475d297259 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/SkinFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/SkinFilesTest.php @@ -35,7 +35,7 @@ class SkinFilesTest extends \PHPUnit_Framework_TestCase { $this->assertFileExists( \Magento\TestFramework\Helper\Bootstrap::getObjectmanager() - ->get('Magento\Core\Model\View\FileSystem')->getViewFile( + ->get('Magento\View\FileSystem')->getViewFile( $skinImage, array('area' => 'adminhtml') ) diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php index 15611f079d8..ad84621677f 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php @@ -43,9 +43,9 @@ class TemplateFilesTest extends \PHPUnit_Framework_TestCase */ public function testWidgetTemplates($class, $template) { - /** @var $blockFactory \Magento\Core\Model\BlockFactory */ + /** @var $blockFactory \Magento\View\Element\BlockFactory */ $blockFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\BlockFactory'); + ->get('Magento\View\Element\BlockFactory'); /** @var \Magento\Core\Block\Template $block */ $block = $blockFactory->createBlock($class); $this->assertInstanceOf('Magento\Core\Block\Template', $block); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CacheFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CacheFilesTest.php index 23f6c9bf67e..b8a772b7157 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CacheFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CacheFilesTest.php @@ -34,18 +34,13 @@ class CacheFilesTest extends \PHPUnit_Framework_TestCase $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface'); $validationStateMock->expects($this->any())->method('isValidated')->will($this->returnValue(true)); - /** @var \Magento\Module\Dir\Reader $moduleReader */ - $moduleReader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Module\Dir\Reader'); - $schema = $moduleReader->getModuleDir('etc', 'Magento_Core') . DIRECTORY_SEPARATOR . 'cache.xsd'; + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\Core\Model\Cache\Config\Reader $reader */ - $reader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Core\Model\Cache\Config\Reader', + /** @var \Magento\Cache\Config\Reader $reader */ + $reader = $objectManager->create( + 'Magento\Cache\Config\Reader', array( 'validationState' => $validationStateMock, - 'schema' => $schema, - 'perFileSchema' => $schema, ) ); try { diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php index 6846819b88f..ddd056af412 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php @@ -34,7 +34,7 @@ class FieldsetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractCo */ protected function _getReaderClassName() { - return 'Magento\Core\Model\Fieldset\Config\Reader'; + return 'Magento\Object\Copy\Config\Reader'; } /** @@ -56,6 +56,6 @@ class FieldsetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractCo */ protected function _getXsdPath() { - return '/Magento/Core/etc/fieldset_file.xsd'; + return '/../../lib/Magento/Object/etc/fieldset_file.xsd'; } } diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php index 38f274ad2a5..58e76f0c5c0 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php @@ -34,9 +34,9 @@ class SystemConfigFilesTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); // disable config caching to not pollute it - /** @var $cacheState \Magento\Core\Model\Cache\StateInterface */ - $cacheState = $objectManager->get('Magento\Core\Model\Cache\StateInterface'); - $cacheState->setEnabled(\Magento\Core\Model\Cache\Type\Config::TYPE_IDENTIFIER, false); + /** @var $cacheState \Magento\App\Cache\StateInterface */ + $cacheState = $objectManager->get('Magento\App\Cache\StateInterface'); + $cacheState->setEnabled(\Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, false); /** @var $dirs \Magento\App\Dir */ $dirs = $objectManager->get('Magento\App\Dir'); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php index d66217d7278..239dc1ca608 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php @@ -53,7 +53,7 @@ class TemplateFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrit 'module' => $module ); $file = \Magento\TestFramework\Helper\Bootstrap::getObjectmanager() - ->get('Magento\Core\Model\View\FileSystem') + ->get('Magento\View\FileSystem') ->getFilename($template, $params); $this->assertFileExists($file, "Block class: {$class}"); }, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php index b12cc636431..0d04dad19a4 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php @@ -44,7 +44,7 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity ->get('Magento\View\DesignInterface') ->setDefaultDesignTheme(); $result = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\View\FileSystem') + ->get('Magento\View\FileSystem') ->getViewFile($file); $this->assertFileExists($result); }, @@ -149,7 +149,7 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity ->get('Magento\View\DesignInterface') ->setDefaultDesignTheme(); $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Model\View\FileSystem'); + ->get('Magento\View\FileSystem'); $this->assertFileExists($filesystem->getViewFile($file)); }, $this->viewFilesFromModulesCodeDataProvider() diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php index 81587abdd3b..e054bba8adf 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php @@ -37,8 +37,6 @@ return array( 'Magento\Cms\Block\Adminhtml\Page', 'Magento\Cms\Block\Adminhtml\Page\Edit', 'Magento\Sales\Block\Adminhtml\Order', - 'Magento\Oauth\Block\Adminhtml\Oauth\Consumer', - 'Magento\Oauth\Block\Adminhtml\Oauth\Consumer\Grid', 'Magento\Paypal\Block\Adminhtml\Settlement\Report', 'Magento\Sales\Block\Adminhtml\Billing\Agreement\View', 'Magento\User\Block\Role\Tab\Edit', diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php index 52ea7983a68..3fb570f22d0 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php @@ -53,7 +53,7 @@ class TemplateFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrit ); try { $templateFilename = \Magento\TestFramework\Helper\Bootstrap::getObjectmanager() - ->get('Magento\Core\Model\View\FileSystem') + ->get('Magento\View\FileSystem') ->getFilename($file, $params); $this->assertFileExists($templateFilename); } catch (\PHPUnit_Framework_ExpectationFailedException $e) { diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php index eac70152e22..fb5e3c023b9 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php @@ -49,22 +49,22 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity try { $params = array('area' => $area, 'themeId' => $themeId); $viewFile = \Magento\TestFramework\Helper\Bootstrap::getObjectmanager() - ->get('Magento\Core\Model\View\FileSystem') + ->get('Magento\View\FileSystem') ->getViewFile($file, $params); $this->assertFileExists($viewFile); - $fileParts = explode(\Magento\Core\Model\View\Service::SCOPE_SEPARATOR, $file); + $fileParts = explode(\Magento\View\Service::SCOPE_SEPARATOR, $file); if (count($fileParts) > 1) { $params['module'] = $fileParts[0]; } if (pathinfo($file, PATHINFO_EXTENSION) == 'css') { $errors = array(); $content = file_get_contents($viewFile); - preg_match_all(\Magento\Core\Helper\Css::REGEX_CSS_RELATIVE_URLS, $content, $matches); + preg_match_all(\Magento\View\Url\CssResolver::REGEX_CSS_RELATIVE_URLS, $content, $matches); foreach ($matches[1] as $relativePath) { $path = $this->_addCssDirectory($relativePath, $file); $pathFile = \Magento\TestFramework\Helper\Bootstrap::getObjectmanager() - ->get('Magento\Core\Model\View\FileSystem') + ->get('Magento\View\FileSystem') ->getViewFile($path, $params); if (!is_file($pathFile)) { $errors[] = $relativePath; diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php index f55e8fe1dd1..72117d0b084 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php @@ -144,7 +144,7 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase */ public function testModularFallback($modularCall, array $usages, $area) { - list(, $file) = explode(\Magento\Core\Model\View\Service::SCOPE_SEPARATOR, $modularCall); + list(, $file) = explode(\Magento\View\Service::SCOPE_SEPARATOR, $modularCall); $wrongResolutions = array(); foreach (self::$_themeCollection as $theme) { @@ -204,7 +204,7 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase $modulePattern = '[A-Z][a-z]+_[A-Z][a-z]+'; $filePattern = '[[:alnum:]_/-]+\\.[[:alnum:]_./-]+'; $pattern = '#' . $modulePattern - . preg_quote(\Magento\Core\Model\View\Service::SCOPE_SEPARATOR) + . preg_quote(\Magento\View\Service::SCOPE_SEPARATOR) . $filePattern . '#S'; if (!preg_match_all($pattern, file_get_contents($file), $matches)) { continue; diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php index f399290a707..c85854f0888 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php @@ -48,7 +48,7 @@ class GeneralTest extends \PHPUnit_Framework_TestCase ->get('Magento\View\LayoutInterface'); $this->_theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\View\Design\ThemeInterface'); - $this->_theme->setType(\Magento\Core\Model\Theme::TYPE_VIRTUAL); + $this->_theme->setType(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL); $this->_block = $this->_layout ->createBlock('Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab\General'); } diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/View/Design/Theme/ValidatorTest.php similarity index 91% rename from dev/tests/integration/testsuite/Magento/Core/Model/Theme/ValidatorTest.php rename to dev/tests/integration/testsuite/Magento/View/Design/Theme/ValidatorTest.php index 87590dab8c6..54640533115 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/ValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Design/Theme/ValidatorTest.php @@ -28,7 +28,7 @@ /** * Test theme data validator */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; class ValidatorTest extends \PHPUnit_Framework_TestCase { @@ -37,9 +37,9 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase */ public function testValidateWithValidData() { - /** @var $validator \Magento\Core\Model\Theme\Validator */ + /** @var $validator \Magento\View\Design\Theme\Validator */ $validator = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Theme\Validator'); + ->create('Magento\View\Design\Theme\Validator'); $themeModel = $this->_getThemeModel(); $themeModel->setData($this->_getThemeValidData()); @@ -52,9 +52,9 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase */ public function testValidateWithInvalidData() { - /** @var $validator \Magento\Core\Model\Theme\Validator */ + /** @var $validator \Magento\View\Design\Theme\Validator */ $validator = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Theme\Validator'); + ->create('Magento\View\Design\Theme\Validator'); $themeModel = $this->_getThemeModel(); $themeModel->setData($this->_getThemeInvalidData()); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/View/FileSystemTest.php b/dev/tests/integration/testsuite/Magento/View/FileSystemTest.php similarity index 93% rename from dev/tests/integration/testsuite/Magento/Core/Model/View/FileSystemTest.php rename to dev/tests/integration/testsuite/Magento/View/FileSystemTest.php index 0603d9f4bf0..5f9979a1e30 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/View/FileSystemTest.php +++ b/dev/tests/integration/testsuite/Magento/View/FileSystemTest.php @@ -18,14 +18,12 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\View; +namespace Magento\View; /** * Tests for the view layer fallback mechanism @@ -34,7 +32,7 @@ namespace Magento\Core\Model\View; class FileSystemTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_model = null; @@ -42,12 +40,12 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(array( \Magento\App\Dir::PARAM_APP_DIRS => array( - \Magento\App\Dir::THEMES => dirname(__DIR__) . '/_files/design' + \Magento\App\Dir::THEMES => dirname(__DIR__) . '/Core/Model/_files/design' ) )); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\FileSystem'); + ->create('Magento\View\FileSystem'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\View\DesignInterface') ->setDesignTheme('test_default'); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/View/PublicationTest.php b/dev/tests/integration/testsuite/Magento/View/PublicationTest.php similarity index 95% rename from dev/tests/integration/testsuite/Magento/Core/Model/View/PublicationTest.php rename to dev/tests/integration/testsuite/Magento/View/PublicationTest.php index d2931f4e29b..2ed4704a4c9 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/View/PublicationTest.php +++ b/dev/tests/integration/testsuite/Magento/View/PublicationTest.php @@ -18,14 +18,12 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\View; +namespace Magento\View; class PublicationTest extends \PHPUnit_Framework_TestCase { @@ -35,17 +33,17 @@ class PublicationTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\Core\Model\View\Service + * @var \Magento\View\Service */ protected $_viewService; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_fileSystem; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $_viewUrl; @@ -53,11 +51,11 @@ class PublicationTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); $this->_viewService = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Service'); + ->create('Magento\View\Service'); $this->_fileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\FileSystem'); + ->create('Magento\View\FileSystem'); $this->_viewUrl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Url'); + ->create('Magento\View\Url'); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\View\DesignInterface'); } @@ -341,7 +339,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $actualCssContent = file_get_contents($expectedCssFile); $this->assertNotRegExp( - '/url\(.*?' . \Magento\Core\Model\View\Service::SCOPE_SEPARATOR . '.*?\)/', + '/url\(.*?' . \Magento\View\Service::SCOPE_SEPARATOR . '.*?\)/', $actualCssContent, 'Published CSS file must not contain scope separators in URLs.' ); @@ -451,11 +449,11 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $this->_model->setDesignTheme('test_default'); $this->_viewService = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Service'); + ->create('Magento\View\Service'); $this->_fileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\FileSystem'); + ->create('Magento\View\FileSystem'); $this->_viewUrl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Url'); + ->create('Magento\View\Url'); $themePath = $this->_model->getDesignTheme()->getFullPath(); $fixtureViewPath = "$appInstallDir/media_for_change/$themePath/"; @@ -542,11 +540,11 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $this->_model->setDesignTheme('test_default'); $this->_viewService = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Service'); + ->create('Magento\View\Service'); $this->_fileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\FileSystem'); + ->create('Magento\View\FileSystem'); $this->_viewUrl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Url'); + ->create('Magento\View\Url'); $themePath = $this->_model->getDesignTheme()->getFullPath(); $fixtureViewPath = "$appInstallDir/media_for_change/$themePath/"; @@ -580,7 +578,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(array( \Magento\App\Dir::PARAM_APP_DIRS => array( - \Magento\App\Dir::THEMES => dirname(__DIR__) . '/_files/design/' + \Magento\App\Dir::THEMES => dirname(__DIR__) . '/Core/Model/_files/design/' ) )); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); @@ -588,10 +586,10 @@ class PublicationTest extends \PHPUnit_Framework_TestCase if ($allowDuplication !== null) { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $publisher = $objectManager->create( - 'Magento\Core\Model\View\Publisher', - array('allowFilesDuplication' => $allowDuplication) + 'Magento\View\Publisher', + array('allowDuplication' => $allowDuplication) ); - $objectManager->addSharedInstance($publisher, 'Magento\Core\Model\View\Publisher'); + $objectManager->addSharedInstance($publisher, 'Magento\View\Publisher'); } // Reinit model with new directories @@ -600,11 +598,11 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $this->_model->setDesignTheme('test_default'); $this->_viewService = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Service'); + ->create('Magento\View\Service'); $this->_fileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\FileSystem'); + ->create('Magento\View\FileSystem'); $this->_viewUrl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\View\Url'); + ->create('Magento\View\Url'); } /** @@ -617,7 +615,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(array( \Magento\App\Dir::PARAM_APP_DIRS => array( - \Magento\App\Dir::THEMES => dirname(__DIR__) . '/_files/design/' + \Magento\App\Dir::THEMES => dirname(__DIR__) . '/Core/Model/_files/design/' ) )); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\App')->loadAreaPart( @@ -628,7 +626,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase /** @var $themeCollection \Magento\Core\Model\Theme\Collection */ $themeCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\Core\Model\Theme\Collection'); - $theme = $themeCollection->setBaseDir(dirname(__DIR__) . '/_files/design/') + $theme = $themeCollection->setBaseDir(dirname(__DIR__) . '/Core/Model/_files/design/') ->addTargetPattern(implode(DIRECTORY_SEPARATOR, array('frontend', 'vendor_default', 'theme.xml'))) ->getFirstItem() ->save(); @@ -680,8 +678,5 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $actualFile = $this->_viewUrl->getViewFilePublicPath($filePath); $this->assertFileEquals($expectedFile, $actualFile); - - // Nothing must have been published - $this->assertEmpty(glob($this->_viewService->getPublicDir() . '/*')); } } diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/AbstractFormTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/AbstractFormTest.php index 59c2f2a6cee..317a3b6af08 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/AbstractFormTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/AbstractFormTest.php @@ -59,7 +59,7 @@ abstract class AbstractFormTest extends \PHPUnit_Framework_TestCase protected $_layout; /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; @@ -71,7 +71,7 @@ abstract class AbstractFormTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); $this->_layout = $this->_objectManager->get('Magento\View\LayoutInterface'); - $this->_blockFactory = $this->_objectManager->get('Magento\Core\Model\BlockFactory'); + $this->_blockFactory = $this->_objectManager->get('Magento\View\Element\BlockFactory'); $this->_block = $this->_blockFactory->createBlock($this->_formClass, array( 'context' => \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Backend\Block\Template\Context', diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/MainTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/MainTest.php index c92ff00f884..9e97b0c57f1 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/MainTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/MainTest.php @@ -42,7 +42,7 @@ class MainTest extends \PHPUnit_Framework_TestCase protected $_layout; /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; @@ -57,7 +57,7 @@ class MainTest extends \PHPUnit_Framework_TestCase $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_layout = $this->_objectManager->get('Magento\View\LayoutInterface'); - $this->_blockFactory = $this->_objectManager->get('Magento\Core\Model\BlockFactory'); + $this->_blockFactory = $this->_objectManager->get('Magento\View\Element\BlockFactory'); $this->_block = $this->_blockFactory->createBlock('Magento\Webapi\Block\Adminhtml\Role\Edit\Tab\Main'); $this->_layout->addBlock($this->_block); } @@ -65,7 +65,7 @@ class MainTest extends \PHPUnit_Framework_TestCase protected function tearDown() { $this->_objectManager->removeSharedInstance('Magento\View\LayoutInterface'); - $this->_objectManager->removeSharedInstance('Magento\Core\Model\BlockFactory'); + $this->_objectManager->removeSharedInstance('Magento\View\Element\BlockFactory'); unset($this->_objectManager, $this->_layout, $this->_blockFactory, $this->_block); } diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/ResourceTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/ResourceTest.php index 99a304659b2..16abeaa6f28 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/ResourceTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/ResourceTest.php @@ -52,7 +52,7 @@ class ResourceTest extends \PHPUnit_Framework_TestCase protected $_ruleResource; /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; @@ -74,7 +74,7 @@ class ResourceTest extends \PHPUnit_Framework_TestCase $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_layout = $this->_objectManager->get('Magento\View\LayoutInterface'); - $this->_blockFactory = $this->_objectManager->get('Magento\Core\Model\BlockFactory'); + $this->_blockFactory = $this->_objectManager->get('Magento\View\Element\BlockFactory'); $this->_block = $this->_blockFactory->createBlock('Magento\Webapi\Block\Adminhtml\Role\Edit\Tab\Resource', array( 'resourceProvider' => $this->_resourceProvider, diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/Tab/MainTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/Tab/MainTest.php index a3d0dc61068..e7b1756fbc2 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/Tab/MainTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/Tab/MainTest.php @@ -42,7 +42,7 @@ class MainTest extends \PHPUnit_Framework_TestCase protected $_layout; /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $_blockFactory; @@ -57,7 +57,7 @@ class MainTest extends \PHPUnit_Framework_TestCase $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_layout = $this->_objectManager->get('Magento\View\LayoutInterface'); - $this->_blockFactory = $this->_objectManager->get('Magento\Core\Model\BlockFactory'); + $this->_blockFactory = $this->_objectManager->get('Magento\View\Element\BlockFactory'); $this->_block = $this->_blockFactory->createBlock('Magento\Webapi\Block\Adminhtml\User\Edit\Tab\Main'); $this->_layout->addBlock($this->_block); } diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php new file mode 100644 index 00000000000..a9e23b96f89 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php @@ -0,0 +1,85 @@ +<?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 Magento + * @package Magento_Widget + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser; + +/** + * @magentoAppArea adminhtml + */ +class DesignAbstractionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\DesignAbstraction| + * \PHPUnit_Framework_MockObject_MockObject + */ + protected $_block; + + protected function setUp() + { + parent::setUp(); + + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $layoutUtility = new \Magento\Core\Utility\Layout($this); + $appState = $objectManager->get('Magento\App\State'); + $appState->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); + $args = array( + 'context' => $objectManager->get('Magento\Core\Block\Template\Context'), + 'layoutProcessorFactory' => $this->getMock('Magento\View\Layout\ProcessorFactory', + array(), array(), '', false), + 'themesFactory' => $objectManager->get('Magento\Core\Model\Resource\Theme\CollectionFactory'), + 'appState' => $appState, + 'data' => array( + 'name' => 'design_abstractions', + 'id' => 'design_abstraction_select', + 'class' => 'design-abstraction-select', + 'title' => 'Design Abstraction Select', + ) + ); + $this->_block = $this->getMock( + 'Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\DesignAbstraction', + array('_getLayoutProcessor'), $args + ); + $this->_block + ->expects($this->any()) + ->method('_getLayoutProcessor') + ->will($this->returnCallback( + function () use ($layoutUtility) { + return $layoutUtility->getLayoutUpdateFromFixture(glob(__DIR__ . '/_files/layout/*.xml')); + } + )) + ; + } + + public function testToHtml() + { + $this->assertXmlStringEqualsXmlFile( + __DIR__ . '/_files/design-abstraction_select.html', + $this->_block->toHtml() + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php index 31f0b44c5d7..de00ff43ba8 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php @@ -43,35 +43,38 @@ class LayoutTest extends \PHPUnit_Framework_TestCase parent::setUp(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $layoutUtility = new \Magento\Core\Utility\Layout($this); - $appState = $objectManager->get('Magento\App\State'); - $appState->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); - $args = array( - 'context' => $objectManager->get('Magento\Core\Block\Template\Context'), - 'layoutProcessorFactory' => $this->getMock('Magento\View\Layout\ProcessorFactory', - array(), array(), '', false), - 'themesFactory' => $objectManager->get('Magento\Core\Model\Resource\Theme\CollectionFactory'), - 'appState' => $appState, - 'data' => array( + $config = $this->getMockBuilder('Magento\Core\Model\Layout\PageType\Config') + ->setMethods(array('getPageTypes')) + ->disableOriginalConstructor() + ->getMock(); + $pageTypeValues = array( + 'wishlist_index_index' => array( + 'label' => 'Customer My Account My Wish List', + 'id' => 'wishlist_index_index' + ), + 'cms_index_nocookies' => array( + 'label' => 'CMS No-Cookies Page', + 'id' => 'cms_index_nocookies' + ), + 'cms_index_defaultindex' => array( + 'label' => 'CMS Home Default Page', + 'id' => 'cms_index_defaultindex' + ), + ); + $config->expects($this->any()) + ->method('getPageTypes') + ->will($this->returnValue($pageTypeValues)); + + $this->_block = new \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Layout( + $objectManager->get('Magento\Core\Block\Template\Context'), + $config, + array( 'name' => 'page_type', 'id' => 'page_types_select', 'class' => 'page-types-select', 'title' => 'Page Types Select', ) ); - $this->_block = $this->getMock( - 'Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Layout', - array('_getLayoutProcessor'), $args - ); - $this->_block - ->expects($this->any()) - ->method('_getLayoutProcessor') - ->will($this->returnCallback( - function () use ($layoutUtility) { - return $layoutUtility->getLayoutUpdateFromFixture(glob(__DIR__ . '/_files/layout/*.xml')); - } - )) - ; } public function testToHtml() diff --git a/app/code/Magento/Oauth/etc/adminhtml/acl.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/design-abstraction_select.html similarity index 63% rename from app/code/Magento/Oauth/etc/adminhtml/acl.xml rename to dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/design-abstraction_select.html index 4b50e23ceed..87135d776ba 100644 --- a/app/code/Magento/Oauth/etc/adminhtml/acl.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/design-abstraction_select.html @@ -1,8 +1,5 @@ -<?xml version="1.0"?> <!-- /** - * ACL settings for oAuth module. - * * Magento * * NOTICE OF LICENSE @@ -21,20 +18,18 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * + * @category Magento + * @package Magento_Widget + * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config> - <acl> - <resources> - <resource id="Magento_Adminhtml::admin"> - <resource id="Magento_Adminhtml::system"> - <resource id="Magento_Webapi::webapi"> - <resource id="Magento_Oauth::oauth" title="Oauth Consumer" sortOrder="15" /> - </resource> - </resource> - </resource> - </resources> - </acl> -</config> +<select name="design_abstractions" id="design_abstraction_select" class="design-abstraction-select" title="Design Abstraction Select"> + <option value="">-- Please Select --</option> + <optgroup label="Custom Layouts"> + <option value="customer_account" >Customer My Account (All Pages)</option> + </optgroup> + <optgroup label="Page Layouts"> + <option value="page_empty" >All Empty Layout Pages</option> + </optgroup></select> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/catalogsearch_ajax_suggest.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/catalogsearch_ajax_suggest.xml index 9d2b1564038..6c60196129d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/catalogsearch_ajax_suggest.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/catalogsearch_ajax_suggest.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Catalog Quick Search Form Suggestions" type="page"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml index 6a9e09d4c58..6c60196129d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Child Page with Inherited Containers"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml index e6804e12867..6c60196129d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Child Page with Inherited Imported Containers"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml index fb150a481cc..f5462dc5b43 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Child Page with Own Containers"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <container name="container_three" label="Container Three"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml index f7009faad20..6c60196129d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Child Page without Containers"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/customer_account.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/customer_account.xml new file mode 100644 index 00000000000..1d6901edafe --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/customer_account.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout label="Customer My Account (All Pages)" design_abstraction="custom"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/page_empty.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/page_empty.xml new file mode 100644 index 00000000000..7a8abff5495 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/page_empty.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout label="All Empty Layout Pages" design_abstraction="page_layout"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml index 1a271ac56b1..f63a3835ffc 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Root Page with Imported Containers"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="non_page_handle_with_own_containers"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml index 3a9d33b849e..54c715a6ea6 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml @@ -26,6 +26,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Root Page with Own Containers"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <container name="container_two" label="Container Two"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml index 35766f22bdd..6c60196129d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Root Page without Containers"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml index 8282d1775ca..6c60196129d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="page" label="Root Page without Own Containers"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/page_types_select.html b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/page_types_select.html index b187a400c53..5389450b184 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/page_types_select.html +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/page_types_select.html @@ -27,17 +27,7 @@ --> <select name="page_type" id="page_types_select" class="page-types-select" title="Page Types Select"> <option value="">-- Please Select --</option> - <!-- alpha order, without page type hierarchy - <option value="child_page_with_own_containers">Child Page with Own Containers</option> - <option value="root_page_without_own_containers">Root Page without Own Containers</option> - --> - <option value="catalogsearch_ajax_suggest">Catalog Quick Search Form Suggestions</option> - <option value="child_page_with_inherited_containers" >Child Page with Inherited Containers</option> - <option value="child_page_with_inherited_imported_containers" >Child Page with Inherited Imported Containers</option> - <option value="child_page_with_own_containers" >Child Page with Own Containers</option> - <option value="child_page_without_containers" >Child Page without Containers</option> - <option value="root_page_with_imported_containers" >Root Page with Imported Containers</option> - <option value="root_page_with_own_containers" >Root Page with Own Containers</option> - <option value="root_page_without_containers" >Root Page without Containers</option> - <option value="root_page_without_own_containers" >Root Page without Own Containers</option> + <option value="cms_index_defaultindex" >CMS Home Default Page</option> + <option value="cms_index_nocookies" >CMS No-Cookies Page</option> + <option value="wishlist_index_index" >Customer My Account My Wish List</option> </select> diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php index 26a9b1a7a6d..6f38f51ecd7 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php @@ -45,6 +45,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\Catalog\Helper\Data'), $objectManager->get('Magento\Core\Helper\Data'), $objectManager->get('Magento\Core\Block\Template\Context'), + $objectManager->get('Magento\Math\Random'), $objectManager->get('Magento\Wishlist\Helper\Data'), $objectManager->get('Magento\Customer\Model\Session'), $objectManager->get('Magento\Catalog\Model\ProductFactory'), diff --git a/dev/tests/static/framework/Magento/TestFramework/Dependency/_files/tables_ce.php b/dev/tests/static/framework/Magento/TestFramework/Dependency/_files/tables_ce.php index b6403324ec6..b0d88ec53c5 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Dependency/_files/tables_ce.php +++ b/dev/tests/static/framework/Magento/TestFramework/Dependency/_files/tables_ce.php @@ -223,6 +223,7 @@ return array ( 'googleshopping_items' => 'Magento_GoogleShopping', 'googleshopping_types' => 'Magento_GoogleShopping', 'importexport_importdata' => 'Magento_ImportExport', + 'integration' => 'Magento_Integration', 'index_event' => 'Magento_Index', 'index_process' => 'Magento_Index', 'index_process_event' => 'Magento_Index', @@ -241,9 +242,9 @@ return array ( 'newsletter_queue_store_link' => 'Magento_Newsletter', 'newsletter_subscriber' => 'Magento_Newsletter', 'newsletter_template' => 'Magento_Newsletter', - 'oauth_consumer' => 'Magento_Oauth', - 'oauth_nonce' => 'Magento_Oauth', - 'oauth_token' => 'Magento_Oauth', + 'oauth_consumer' => 'Magento_Integration', + 'oauth_nonce' => 'Magento_Integration', + 'oauth_token' => 'Magento_Integration', 'paygate_authorizenet_debug' => 'Magento_Paygate', 'paypal_cert' => 'Magento_Paypal', 'paypal_payment_transaction' => 'Magento_Paypal', @@ -337,10 +338,6 @@ return array ( 'shipping_tablerate' => 'Magento_shipping', 'sitemap' => 'Magento_Sitemap', 'social_facebook_actions' => 'Social_Facebook', - 'tag_properties' => 'Magento_Tag', - 'tag_relation' => 'Magento_Tag', - 'tag_summary' => 'Magento_Tag', - 'tag' => 'Magento_Tag', 'sales_order_tax_item' => 'Magento_Tax', 'tax_calculation' => 'Magento_Tax', 'tax_calculation_rate' => 'Magento_Tax', diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php new file mode 100644 index 00000000000..dd8ec067197 --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php @@ -0,0 +1,72 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\TestFramework\Integrity\Library; + +use Zend\Code\Reflection\ClassReflection; +use Zend\Code\Reflection\FileReflection; +use Zend\Code\Reflection\ParameterReflection; + +/** + * @package Magento\TestFramework + */ +class Injectable +{ + /** + * @var \ReflectionException[] + */ + protected $dependencies = array(); + + /** + * @param FileReflection $fileReflection + * @return \ReflectionException[] + * @throws \ReflectionException + */ + public function getDependencies(FileReflection $fileReflection) + { + foreach ($fileReflection->getClasses() as $class) { + /** @var ClassReflection $class */ + foreach ($class->getMethods() as $method) { + /** @var \Zend\Code\Reflection\MethodReflection $method */ + foreach ($method->getParameters() as $parameter) { + try { + /** @var ParameterReflection $parameter */ + $dependency = $parameter->getClass(); + if ($dependency instanceof ClassReflection) { + $this->dependencies[] = $dependency->getName(); + } + } catch (\ReflectionException $e) { + if (preg_match('#^Class ([A-Za-z0-9_\\\\]+) does not exist$#', $e->getMessage(), $result)) { + $this->dependencies[] = $result[1]; + } else { + throw $e; + } + } + } + } + } + + return $this->dependencies; + } +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/DependenciesCollector.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/DependenciesCollector.php new file mode 100644 index 00000000000..bdc5a20bf3e --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/DependenciesCollector.php @@ -0,0 +1,41 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\TestFramework\Integrity\Library\PhpParser; + +/** + * Collect dependencies + * + * @package Magento\TestFramework + */ +interface DependenciesCollector +{ + /** + * Return list of dependencies + * + * @param Uses $uses + * @return string[] + */ + public function getDependencies(Uses $uses); +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Parser.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Parser.php new file mode 100644 index 00000000000..d1c4c961c7b --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Parser.php @@ -0,0 +1,41 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\TestFramework\Integrity\Library\PhpParser; + +/** + * Parser for each token type + * + * @package Magento\TestFramework + */ +interface Parser +{ + /** + * Parse specific token + * + * @param array|string $value + * @param int $key + */ + public function parse($value, $key); +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/ParserFactory.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/ParserFactory.php new file mode 100644 index 00000000000..d227a85ed57 --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/ParserFactory.php @@ -0,0 +1,107 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +namespace Magento\TestFramework\Integrity\Library\PhpParser; + +/** + * Class know how create any parser + * + * @package Magento\TestFramework + */ +class ParserFactory +{ + /** + * @var Parser[] + */ + protected $parsers = array(); + + /** + * @var Uses + */ + protected $uses; + + /** + * @var StaticCalls + */ + protected $staticCalls; + + /** + * @var Throws + */ + protected $throws; + + /** + * @var Tokens + */ + protected $tokens; + + /** + * Return all parsers + * + * @param Tokens $tokens + * @return Parser[] + */ + public function createParsers(Tokens $tokens) + { + if (empty($this->parsers)) { + $this->parsers = array( + $this->uses = new Uses(), + $this->staticCalls = new StaticCalls($tokens), + $this->throws = new Throws($tokens), + ); + } + return $this->parsers; + } + + /** + * Get uses + * + * @return Uses + */ + public function getUses() + { + return $this->uses; + } + + /** + * Get static calls + * + * @return StaticCalls + */ + public function getStaticCalls() + { + return $this->staticCalls; + } + + /** + * Get throws + * + * @return Throws + */ + public function getThrows() + { + return $this->throws; + } +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/StaticCalls.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/StaticCalls.php new file mode 100644 index 00000000000..41de9053bf4 --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/StaticCalls.php @@ -0,0 +1,120 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\TestFramework\Integrity\Library\PhpParser; + +/** + * Parse static calls and collect dependencies for it + * + * @package Magento\TestFramework + */ +class StaticCalls implements Parser, DependenciesCollector +{ + /** + * @var Tokens + */ + protected $tokens; + + /** + * Save static calls token key + * + * @var array + */ + protected $staticCalls = array(); + + /** + * Collect dependencies + * + * @var array + */ + protected $dependencies = array(); + + /** + * @param Tokens $tokens + */ + public function __construct(Tokens $tokens) + { + $this->tokens = $tokens; + } + + /** + * Check if it's foreign dependency + * + * @param array $token + * @return bool + */ + protected function isTokenClass($token) + { + return is_array($token) + && !(in_array($token[1], array('static', 'self', 'parent')) || preg_match('#^\$#', $token[1])); + } + + /** + * @inheritdoc + */ + public function parse($token, $key) + { + if (is_array($token) + && $token[0] == T_PAAMAYIM_NEKUDOTAYIM + && $this->isTokenClass($this->tokens->getPreviousToken($key)) + ) { + $this->staticCalls[] = $key; + } + } + + /** + * Return class name from token + * + * @param int $staticCall + * @return string + */ + protected function getClassByStaticCall($staticCall) + { + $step = 1; + $staticClassParts = array(); + while ($this->tokens->getTokenCodeByKey($staticCall-$step) == T_STRING + || $this->tokens->getTokenCodeByKey($staticCall-$step) == T_NS_SEPARATOR + ) { + $staticClassParts[] = $this->tokens->getTokenValueByKey($staticCall-$step); + $step++; + } + return implode(array_reverse($staticClassParts)); + } + + /** + * @inheritdoc + */ + public function getDependencies(Uses $uses) + { + foreach ($this->staticCalls as $staticCall) { + $class = $this->getClassByStaticCall($staticCall); + if ($uses->hasUses()) { + $class = $uses->getClassNameWithNamespace($class); + } + $this->dependencies[] = $class; + } + + return $this->dependencies; + } +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Throws.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Throws.php new file mode 100644 index 00000000000..4a2376a46c0 --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Throws.php @@ -0,0 +1,95 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\TestFramework\Integrity\Library\PhpParser; + +/** + * Parse throws and collect dependencies for it + * + * @package Magento\TestFramework + */ +class Throws implements Parser, DependenciesCollector +{ + /** + * @var Tokens + */ + protected $tokens; + + /** + * Collect dependencies + * + * @var array + */ + protected $dependencies = array(); + + /** + * Save throw token key + * + * @var array + */ + protected $throws = array(); + + /** + * @param Tokens $tokens + */ + public function __construct(Tokens $tokens) + { + $this->tokens = $tokens; + } + + /** + * @inheritdoc + */ + public function parse($token, $key) + { + if (is_array($token) && $token[0] == T_THROW) { + $this->throws[] = $key; + } + } + + /** + * @inheritdoc + */ + public function getDependencies(Uses $uses) + { + foreach ($this->throws as $throw) { + $class = ''; + if ($this->tokens->getTokenCodeByKey($throw + 2) == T_NEW) { + $step = 4; + while ($this->tokens->getTokenCodeByKey($throw+$step) == T_STRING + || $this->tokens->getTokenCodeByKey($throw+$step) == T_NS_SEPARATOR + ) { + $class .= trim($this->tokens->getTokenValueByKey($throw + $step)); + $step++; + } + if ($uses->hasUses()) { + $class = $uses->getClassNameWithNamespace($class); + } + $this->dependencies[] = $class; + } + } + + return $this->dependencies; + } +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Tokens.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Tokens.php new file mode 100644 index 00000000000..6efb0a8a65a --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Tokens.php @@ -0,0 +1,140 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\TestFramework\Integrity\Library\PhpParser; + +/** + * Parse php code and found dependencies + * + * @package Magento\TestFramework + */ +class Tokens +{ + /** + * Collect all tokens + * + * @var array + */ + protected $tokens = array(); + + /** + * Collect dependencies + * + * @var array + */ + protected $dependencies = array(); + + /** + * Collect all parsers + * + * @var Parser[] + */ + protected $parsers = array(); + + /** + * Parser factory for creating parsers + * + * @var ParserFactory + */ + protected $parserFactory; + + /** + * @param string $content + * @param ParserFactory $parserFactory + */ + public function __construct($content, ParserFactory $parserFactory) + { + $this->tokens = token_get_all($content); + $this->parserFactory = $parserFactory; + } + + /** + * Parse content + */ + public function parseContent() + { + foreach ($this->tokens as $k => $token) { + foreach ($this->getParsers() as $parser) { + $parser->parse($token, $k); + } + } + } + + /** + * Get all parsers + * + * @return Parser[] + */ + protected function getParsers() + { + return $this->parserFactory->createParsers($this); + } + + /** + * Get parsed dependencies + * + * @return array + */ + public function getDependencies() + { + return array_merge( + $this->parserFactory->getStaticCalls()->getDependencies($this->parserFactory->getUses()), + $this->parserFactory->getThrows()->getDependencies($this->parserFactory->getUses()) + ); + } + + /** + * Return previous token + * + * @param int $key + * @param int $step + * @return array + */ + public function getPreviousToken($key, $step = 1) + { + return $this->tokens[$key - $step]; + } + + /** + * Return token code by key + * + * @param $key + * @return null|int + */ + public function getTokenCodeByKey($key) + { + return is_array($this->tokens[$key]) ? $this->tokens[$key][0] : null; + } + + /** + * Return token value by key + * + * @param $key + * @return string + */ + public function getTokenValueByKey($key) + { + return is_array($this->tokens[$key]) ? $this->tokens[$key][1] : $this->tokens[$key]; + } +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Uses.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Uses.php new file mode 100644 index 00000000000..8a8dad50aab --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/PhpParser/Uses.php @@ -0,0 +1,155 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\TestFramework\Integrity\Library\PhpParser; + +/** + * Parse uses block + * + * @package Magento\TestFramework + */ +class Uses implements Parser +{ + /** + * Flag for parse use block + * + * @var bool + */ + protected $parseUse = false; + + /** + * Collect all uses + * + * @var array + */ + protected $uses = array(); + + /** + * Check if uses present in content + * + * @return bool + */ + public function hasUses() + { + return !empty($this->uses); + } + + /** + * Create empty uses in collection + */ + protected function createEmptyItem() + { + $this->uses[] = ''; + } + + /** + * Return class name with namespace + * + * @param string $class + * @return string + */ + public function getClassNameWithNamespace($class) + { + if (preg_match('#^\\\\#', $class)) { + return $class; + } + + preg_match('#^([A-Za-z0-9_]+)(.*)$#', $class, $match); + foreach ($this->uses as $use) { + if (preg_match('#^([A-Za-z0-9_\\\\]+)\s+as\s+(.*)$#', $use, $useMatch) && $useMatch[2] == $match[1]) { + $class = $useMatch[1] . $match[2]; + break; + } + $packages = explode('\\', $use); + end($packages); + $lastPackageKey = key($packages); + if ($packages[$lastPackageKey] == $match[1]) { + $class = $use . $match[2]; + } + } + return $class; + } + + /** + * Append part of uses into last item + * + * @param string $value + */ + protected function appendToLast($value) + { + end($this->uses); + $this->uses[key($this->uses)] = ltrim($this->uses[key($this->uses)] . $value); + } + + /** + * Check flag parse + * + * @return bool + */ + protected function isParseInProgress() + { + return $this->parseUse; + } + + /** + * Start parse + */ + protected function stopParse() + { + $this->parseUse = false; + } + + /** + * Stop parse + */ + protected function startParse() + { + $this->parseUse = true; + } + + /** + * @inheritdoc + */ + public function parse($token, $key) + { + if (is_array($token)) { + if ($this->isParseInProgress()) { + $this->appendToLast($token[1]); + } + if (T_USE == $token[0]) { + $this->startParse(); + $this->createEmptyItem(); + } + } else { + if ($this->isParseInProgress()) { + if ($token == ';') { + $this->stopParse(); + } + if ($token == ',') { + $this->createEmptyItem(); + } + } + } + } +} diff --git a/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php b/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php index 17ab0a22cf7..7afdea858ab 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php +++ b/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php @@ -225,7 +225,8 @@ class Files $this->getMainConfigFiles(), $this->getLayoutFiles(), $this->getConfigFiles(), - $this->getLayoutConfigFiles() + $this->getLayoutConfigFiles(), + $this->getPageTypeFiles() ); } @@ -379,6 +380,55 @@ class Files return self::$_cache[__METHOD__][$cacheKey]; } + /** + * Returns list of page_type files, used by Magento application modules + * + * An incoming array can contain the following items + * array ( + * 'namespace' => 'namespace_name', + * 'module' => 'module_name', + * 'area' => 'area_name', + * 'theme' => 'theme_name', + * ) + * + * @param array $incomingParams + * @param bool $asDataSet + * @return array + */ + public function getPageTypeFiles($incomingParams = array(), $asDataSet = true) + { + $params = array( + 'namespace' => '*', + 'module' => '*', + 'area' => '*', + 'theme' => '*', + ); + foreach (array_keys($params) as $key) { + if (isset($incomingParams[$key])) { + $params[$key] = $incomingParams[$key]; + } + } + $cacheKey = md5($this->_path . '|' . implode('|', $params)); + + if (!isset(self::$_cache[__METHOD__][$cacheKey])) { + $files = array(); + $files = self::getFiles( + array( + "{$this->_path}/app/code/{$params['namespace']}/{$params['module']}" + . "/etc/{$params['area']}" + ), + 'page_types.xml' + ); + + self::$_cache[__METHOD__][$cacheKey] = $files; + } + + if ($asDataSet) { + return self::composeDataSets(self::$_cache[__METHOD__][$cacheKey]); + } + return self::$_cache[__METHOD__][$cacheKey]; + } + /** * Returns list of Javascript files in Magento * diff --git a/dev/tests/static/framework/Magento/TestFramework/Utility/Validator.php b/dev/tests/static/framework/Magento/TestFramework/Utility/Validator.php new file mode 100644 index 00000000000..9224bda308f --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Utility/Validator.php @@ -0,0 +1,55 @@ +<?php +/** + * A helper to validate items such as xml against xsd + * + * 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 tests + * @package static + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\TestFramework\Utility; + +class Validator +{ + /** + * @param \DOMDocument $dom + * @param $schemaFileName + * @return array + */ + public static function validateXml(\DOMDocument $dom, $schemaFileName) + { + libxml_use_internal_errors(true); + $result = $dom->schemaValidate($schemaFileName); + $errors = array(); + if (!$result) { + $validationErrors = libxml_get_errors(); + if (count($validationErrors)) { + foreach ($validationErrors as $error) { + $errors[] = "{$error->message} Line: {$error->line}\n"; + } + } else { + $errors[] = 'Unknown validation error'; + } + } + libxml_use_internal_errors(false); + return $errors; + } +} \ No newline at end of file diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/InjectableTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/InjectableTest.php new file mode 100644 index 00000000000..d4fa065f414 --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/InjectableTest.php @@ -0,0 +1,152 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Test\Integrity\Library; + +use Magento\TestFramework\Integrity\Library\Injectable; + +/** + * @package Magento\Test + */ +class InjectableTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Injectable + */ + protected $injectable; + + /** + * @var \Zend\Code\Reflection\FileReflection + */ + protected $fileReflection; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $parameterReflection; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->injectable = new Injectable(); + $this->fileReflection = $this->getMockBuilder('Zend\Code\Reflection\FileReflection') + ->disableOriginalConstructor() + ->getMock(); + + $classReflection = $this->getMockBuilder('Zend\Code\Reflection\ClassReflection') + ->disableOriginalConstructor() + ->getMock(); + + $methodReflection = $this->getMockBuilder('Zend\Code\Reflection\MethodReflection') + ->disableOriginalConstructor() + ->getMock(); + + $this->parameterReflection = $this->getMockBuilder('Zend\Code\Reflection\ParameterReflection') + ->disableOriginalConstructor() + ->getMock(); + + $methodReflection->expects($this->once()) + ->method('getParameters') + ->will($this->returnValue(array($this->parameterReflection))); + + $classReflection->expects($this->once()) + ->method('getMethods') + ->will($this->returnValue(array($methodReflection))); + + $this->fileReflection->expects($this->once()) + ->method('getClasses') + ->will($this->returnValue(array($classReflection))); + } + + /** + * Covered getDependencies + * + * @test + */ + public function testGetDependencies() + { + $classReflection = $this->getMockBuilder('Zend\Code\Reflection\ClassReflection') + ->disableOriginalConstructor() + ->getMock(); + + $classReflection->expects($this->once()) + ->method('getName') + ->will($this->returnValue('Magento\Core\Model\Object')); + + $this->parameterReflection->expects($this->once()) + ->method('getClass') + ->will($this->returnValue($classReflection)); + + $this->assertEquals( + array('Magento\Core\Model\Object'), + $this->injectable->getDependencies($this->fileReflection) + ); + } + + /** + * Covered getDependencies + * + * @test + */ + public function testGetDependenciesWithException() + { + $this->parameterReflection->expects($this->once()) + ->method('getClass') + ->will( + $this->returnCallback( + function () { + throw new \ReflectionException('Class Magento\Core\Model\Object does not exist'); + } + ) + ); + + $this->assertEquals( + array('Magento\Core\Model\Object'), + $this->injectable->getDependencies($this->fileReflection) + ); + } + + /** + * Covered with some different exception method + * + * @test + * @expectedException \ReflectionException + */ + public function testGetDependenciesWithOtherException() + { + $this->parameterReflection->expects($this->once()) + ->method('getClass') + ->will( + $this->returnCallback( + function () { + throw new \ReflectionException('Some message'); + } + ) + ); + + $this->injectable->getDependencies($this->fileReflection); + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ParserFactoryTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ParserFactoryTest.php new file mode 100644 index 00000000000..19cb608c662 --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ParserFactoryTest.php @@ -0,0 +1,71 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Test\Integrity\Library\PhpParser; + +use Magento\TestFramework\Integrity\Library\PhpParser\ParserFactory; + +/** + * @package Magento\Test + */ +class ParserFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Integrity\Library\PhpParser\Tokens + */ + protected $tokens; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->tokens = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Tokens') + ->disableOriginalConstructor() + ->getMock(); + } + + /** + * Covered createParsers method + * + * @test + */ + public function testCreateParsers() + { + $parseFactory = new ParserFactory(); + $parseFactory->createParsers($this->tokens); + $this->assertInstanceOf( + 'Magento\TestFramework\Integrity\Library\PhpParser\Uses', + $parseFactory->getUses() + ); + $this->assertInstanceOf( + 'Magento\TestFramework\Integrity\Library\PhpParser\StaticCalls', + $parseFactory->getStaticCalls() + ); + $this->assertInstanceOf( + 'Magento\TestFramework\Integrity\Library\PhpParser\Throws', + $parseFactory->getThrows() + ); + } +} \ No newline at end of file diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/StaticCallsTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/StaticCallsTest.php new file mode 100644 index 00000000000..2c819182689 --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/StaticCallsTest.php @@ -0,0 +1,120 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Test\Integrity\Library\PhpParser; + +use Magento\TestFramework\Integrity\Library\PhpParser\StaticCalls; + +/** + * @package Magento\Test + */ +class StaticCallsTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var StaticCalls + */ + protected $staticCalls; + + /** + * @var \Magento\TestFramework\Integrity\Library\PhpParser\Tokens|\PHPUnit_Framework_MockObject_MockObject + */ + protected $tokens; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->tokens = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Tokens') + ->disableOriginalConstructor() + ->getMock(); + } + + /** + * Test get static call dependencies + * + * @test + */ + public function testGetDependencies() + { + $tokens = array( + 0 => array(T_WHITESPACE, ' '), + 1 => array(T_NS_SEPARATOR, '\\'), + 2 => array(T_STRING, 'Object'), + 3 => array(T_PAAMAYIM_NEKUDOTAYIM, '::'), + ); + + $this->tokens->expects($this->any()) + ->method('getPreviousToken') + ->will( + $this->returnCallback( + function ($k) use ($tokens) { + return $tokens[$k-1]; + } + ) + ); + + $this->tokens->expects($this->any()) + ->method('getTokenCodeByKey') + ->will( + $this->returnCallback( + function ($k) use ($tokens) { + return $tokens[$k][0]; + } + ) + ); + + $this->tokens->expects($this->any()) + ->method('getTokenValueByKey') + ->will( + $this->returnCallback( + function ($k) use ($tokens) { + return $tokens[$k][1]; + } + ) + ); + + $throws = new StaticCalls($this->tokens); + foreach ($tokens as $k => $token) { + $throws->parse($token, $k); + } + + $uses = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Uses') + ->disableOriginalConstructor() + ->getMock(); + + $uses->expects($this->once()) + ->method('hasUses') + ->will($this->returnValue(true)); + + $uses->expects($this->once()) + ->method('getClassNameWithNamespace') + ->will($this->returnValue('\Object')); + + $this->assertEquals( + array('\Object'), + $throws->getDependencies($uses) + ); + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ThrowsTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ThrowsTest.php new file mode 100644 index 00000000000..b43084ad634 --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/ThrowsTest.php @@ -0,0 +1,113 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Test\Integrity\Library\PhpParser; + +use Magento\TestFramework\Integrity\Library\PhpParser\Throws; + +/** + * @package Magento\Test + */ +class ThrowsTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Throws + */ + protected $throws; + + /** + * @var \Magento\TestFramework\Integrity\Library\PhpParser\Tokens|\PHPUnit_Framework_MockObject_MockObject + */ + protected $tokens; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->tokens = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Tokens') + ->disableOriginalConstructor() + ->getMock(); + } + + /** + * Test get throws dependencies + * + * @test + */ + public function testGetDependencies() + { + $tokens = array( + 0 => array(T_THROW, 'throw'), + 1 => array(T_WHITESPACE, ' '), + 2 => array(T_NEW, 'new'), + 3 => array(T_WHITESPACE, ' '), + 4 => array(T_NS_SEPARATOR, '\\'), + 5 => array(T_STRING, 'Exception'), + 6 => '(', + ); + + $this->tokens->expects($this->any()) + ->method('getTokenCodeByKey') + ->will( + $this->returnCallback( + function ($k) use ($tokens) { + return $tokens[$k][0]; + } + ) + ); + + $this->tokens->expects($this->any()) + ->method('getTokenValueByKey') + ->will( + $this->returnCallback( + function ($k) use ($tokens) { + return $tokens[$k][1]; + } + ) + ); + + $throws = new Throws($this->tokens); + foreach ($tokens as $k => $token) { + $throws->parse($token, $k); + } + + $uses = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Uses') + ->disableOriginalConstructor() + ->getMock(); + + $uses->expects($this->once()) + ->method('hasUses') + ->will($this->returnValue(true)); + + $uses->expects($this->once()) + ->method('getClassNameWithNamespace') + ->will($this->returnValue('\Exception')); + + $this->assertEquals( + array('\Exception'), + $throws->getDependencies($uses) + ); + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/TokensTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/TokensTest.php new file mode 100644 index 00000000000..152daccfc4a --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/TokensTest.php @@ -0,0 +1,166 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Test\Integrity\Library\PhpParser; + +use Magento\TestFramework\Integrity\Library\PhpParser\Tokens; + +/** + * @package Magento\Test + */ +class TokensTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Tokens + */ + protected $tokens; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\TestFramework\Integrity\Library\PhpParser\ParserFactory + */ + protected $parseFactory; + + /** + * Testable content + * + * @var string + */ + protected $content = '<?php echo "test";'; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->parseFactory = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\ParserFactory') + ->disableOriginalConstructor() + ->getMock(); + } + + /** + * Covered parse content + * + * @test + */ + public function testParseContent() + { + $parser = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Parser') + ->getMockForAbstractClass(); + + $this->parseFactory->expects($this->any()) + ->method('createParsers') + ->will($this->returnValue(array($parser))); + + $this->tokens = new Tokens($this->content, $this->parseFactory); + $this->tokens->parseContent(); + } + + /** + * Covered getDependencies method + * + * @test + */ + public function testGetDependencies() + { + $uses = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Uses') + ->disableOriginalConstructor() + ->getMock(); + + $this->parseFactory->expects($this->exactly(2)) + ->method('getUses') + ->will($this->returnValue($uses)); + + $staticCalls = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\StaticCalls') + ->disableOriginalConstructor() + ->getMock(); + + $staticCalls->expects($this->once()) + ->method('getDependencies') + ->will($this->returnValue(array('StaticDependency'))); + + $this->parseFactory->expects($this->once()) + ->method('getStaticCalls') + ->will($this->returnValue($staticCalls)); + + $throws = $this->getMockBuilder('Magento\TestFramework\Integrity\Library\PhpParser\Throws') + ->disableOriginalConstructor() + ->getMock(); + + $throws->expects($this->once()) + ->method('getDependencies') + ->will($this->returnValue(array('ThrowDependency'))); + + $this->parseFactory->expects($this->once()) + ->method('getThrows') + ->will($this->returnValue($throws)); + + $this->tokens = new Tokens($this->content, $this->parseFactory); + $this->assertEquals( + array('StaticDependency', 'ThrowDependency'), + $this->tokens->getDependencies() + ); + } + + /** + * Test code for get previous token from parameter "content" + * + * @test + */ + public function testGetPreviousToken() + { + $this->tokens = new Tokens($this->content, $this->parseFactory); + $this->assertEquals( + array(T_ECHO, 'echo', 1), + $this->tokens->getPreviousToken(2) + ); + } + + /** + * Covered getTokenCodeByKey + * + * @test + */ + public function testGetTokenCodeByKey() + { + $this->tokens = new Tokens($this->content, $this->parseFactory); + $this->assertEquals( + T_ECHO, + $this->tokens->getTokenCodeByKey(1) + ); + } + + /** + * Covered getTokenValueByKey + * + * @test + */ + public function testGetTokenValueByKey() + { + $this->tokens = new Tokens($this->content, $this->parseFactory); + $this->assertEquals( + 'echo', + $this->tokens->getTokenValueByKey(1) + ); + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php new file mode 100644 index 00000000000..d53927d497d --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php @@ -0,0 +1,205 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Test\Integrity\Library\PhpParser; + +use Magento\TestFramework\Integrity\Library\PhpParser\Uses; + +/** + * @package Magento\Test + */ +class UsesTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Uses + */ + protected $uses; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->uses = new Uses(); + } + + /** + * Covered hasUses method + * + * @dataProvider usesDataProvider + * @test + * + * @param array $tokens + */ + public function testHasUses($tokens) + { + foreach ($tokens as $k => $token) { + $this->uses->parse($token, $k); + } + $this->assertTrue($this->uses->hasUses()); + } + + /** + * Example tokenizer results + * + * @return array + */ + public function usesDataProvider() + { + return array( + 'simple' => array( + array( + 0 => array(T_USE, 'use '), + 1 => array(T_STRING, 'Magento'), + 2 => array(T_NS_SEPARATOR, '\\'), + 3 => array(T_STRING, 'Core'), + 4 => array(T_NS_SEPARATOR, '\\'), + 5 => array(T_STRING, 'Model'), + 6 => array(T_NS_SEPARATOR, '\\'), + 7 => array(T_STRING, 'Object'), + 8 => ';', + ), + ), + 'several_simple' => array( + array( + 0 => array(T_USE, 'use '), + 1 => array(T_STRING, 'Magento'), + 2 => array(T_NS_SEPARATOR, '\\'), + 3 => array(T_STRING, 'Core'), + 4 => array(T_NS_SEPARATOR, '\\'), + 5 => array(T_STRING, 'Model'), + 6 => array(T_NS_SEPARATOR, '\\'), + 7 => array(T_STRING, 'Object'), + 8 => ';', + 9 => array(T_USE, 'use '), + 10 => array(T_STRING, 'Magento'), + 11 => array(T_NS_SEPARATOR, '\\'), + 12 => array(T_STRING, 'Core'), + 13 => array(T_NS_SEPARATOR, '\\'), + 14 => array(T_STRING, 'Model'), + 15 => array(T_NS_SEPARATOR, '\\'), + 16 => array(T_STRING, 'Object2 '), + 17 => array(T_AS, 'as '), + 18 => array(T_STRING, 'OtherObject'), + 19 => ';', + ), + ), + 'several_with_comma_separate' => array( + array( + 0 => array(T_USE, 'use '), + 1 => array(T_STRING, 'Magento'), + 2 => array(T_NS_SEPARATOR, '\\'), + 3 => array(T_STRING, 'Core'), + 4 => array(T_NS_SEPARATOR, '\\'), + 5 => array(T_STRING, 'Model'), + 6 => array(T_NS_SEPARATOR, '\\'), + 7 => array(T_STRING, 'Object'), + 8 => ',', + 9 => array(T_STRING, 'Magento'), + 10 => array(T_NS_SEPARATOR, '\\'), + 11 => array(T_STRING, 'Core'), + 12 => array(T_NS_SEPARATOR, '\\'), + 13 => array(T_STRING, 'Model'), + 14 => array(T_NS_SEPARATOR, '\\'), + 15 => array(T_STRING, 'Object2 '), + 16 => array(T_AS, 'as '), + 17 => array(T_STRING, 'OtherObject'), + 18 => ';', + ), + ), + ); + } + + /** + * Covered getClassNameWithNamespace for global classes + * + * @test + */ + public function testGetClassNameWithNamespaceForGlobalClass() + { + $this->assertEquals( + '\Magento\Core\Model\Object2', + $this->uses->getClassNameWithNamespace('\Magento\Core\Model\Object2') + ); + } + + /** + * Covered getClassNameWithNamespace + * + * @test + * @dataProvider classNamesDataProvider + */ + public function testGetClassNameWithNamespace($className, $tokens) + { + foreach ($tokens as $k => $token) { + $this->uses->parse($token, $k); + } + + $this->assertEquals( + 'Magento\Core\Model\Object2', + $this->uses->getClassNameWithNamespace($className) + ); + } + + /** + * Return different uses token list and class name + * + * @return array + */ + public function classNamesDataProvider() + { + return array( + 'class_from_uses' => array( + 'Object2', + array( + 0 => array(T_USE, 'use '), + 1 => array(T_STRING, 'Magento'), + 2 => array(T_NS_SEPARATOR, '\\'), + 3 => array(T_STRING, 'Core'), + 4 => array(T_NS_SEPARATOR, '\\'), + 5 => array(T_STRING, 'Model'), + 6 => array(T_NS_SEPARATOR, '\\'), + 7 => array(T_STRING, 'Object2'), + 8 => ';', + ) + ), + 'class_from_uses_with_as' => array( + 'ObjectOther', + array( + 0 => array(T_USE, 'use '), + 1 => array(T_STRING, 'Magento'), + 2 => array(T_NS_SEPARATOR, '\\'), + 3 => array(T_STRING, 'Core'), + 4 => array(T_NS_SEPARATOR, '\\'), + 5 => array(T_STRING, 'Model'), + 6 => array(T_NS_SEPARATOR, '\\'), + 7 => array(T_STRING, 'Object2 '), + 8 => array(T_AS, 'as '), + 9 => array(T_STRING, 'ObjectOther'), + 10 => ';', + ) + ), + ); + } +} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/FilesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/FilesTest.php index a5f22aa37f2..238377c90b7 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/FilesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/FilesTest.php @@ -48,34 +48,10 @@ class FilesTest extends \PHPUnit_Framework_TestCase function ($layout) { $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($layout)); - $errors = $this->_validateDomDocument($dom, $this->_schemaFile); + $errors = \Magento\TestFramework\Utility\Validator::validateXml($dom, $this->_schemaFile); $this->assertTrue(empty($errors), print_r($errors, true)); }, \Magento\TestFramework\Utility\Files::init()->getLayoutFiles() ); } - - /** - * @param \DOMDocument $dom - * @param $schemaFileName - * @return array - */ - protected function _validateDomDocument(\DOMDocument $dom, $schemaFileName) - { - libxml_use_internal_errors(true); - $result = $dom->schemaValidate($schemaFileName); - $errors = array(); - if (!$result) { - $validationErrors = libxml_get_errors(); - if (count($validationErrors)) { - foreach ($validationErrors as $error) { - $errors[] = "{$error->message} Line: {$error->line}\n"; - } - } else { - $errors[] = 'Unknown validation error'; - } - } - libxml_use_internal_errors(false); - return $errors; - } } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php index 4807f52c5a7..205bc77c089 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/HandlesTest.php @@ -34,21 +34,22 @@ class HandlesTest extends \PHPUnit_Framework_TestCase { $invoker = new \Magento\TestFramework\Utility\AggregateInvoker($this); $invoker( - /** - * Test dependencies between handle attributes that is out of coverage by XSD - * - * @param string $layoutFile - */ + /** + * Test dependencies between handle attributes that is out of coverage by XSD + * + * @param string $layoutFile + */ function ($layoutFile) { $issues = array(); $node = simplexml_load_file($layoutFile); - $type = $node['type']; $label = $node['label']; - if (!$type) { - if ($label) { - $issues[] = 'Attribute "label" is defined, but "type" is not'; + $design_abstraction = $node['design_abstraction']; + if (!$label) { + if ($design_abstraction) { + $issues[] = 'Attribute "design_abstraction" is defined, but "label" is not'; } } + if ($issues) { $this->fail("Issues found in handle declaration:\n" . implode("\n", $issues) . "\n"); } @@ -70,7 +71,7 @@ class HandlesTest extends \PHPUnit_Framework_TestCase $issues = array(); $xml = simplexml_load_file($layoutFile); $containers = $xml->xpath('/layout//container') ?: array(); - /** @var SimpleXMLElement $node */ + /** @var \SimpleXMLElement $node */ foreach ($containers as $node) { if (!isset($node['htmlTag']) && (isset($node['htmlId']) || isset($node['htmlClass']))) { $issues[] = $node->asXML(); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php new file mode 100644 index 00000000000..b855f210f63 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php @@ -0,0 +1,147 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Test\Integrity\Library; + +use Magento\TestFramework\Integrity\Library\Injectable; +use Magento\TestFramework\Integrity\Library\PhpParser\ParserFactory; +use Magento\TestFramework\Integrity\Library\PhpParser\Tokens; +use Magento\TestFramework\Utility\Files; +use Zend\Code\Reflection\FileReflection; + +/** + * Test check if Magento library components contain incorrect dependencies to application layer + * + * @package Magento\Test + */ +class DependencyTest extends \PHPUnit_Framework_TestCase +{ + /** + * Collect errors + * + * @var array + */ + protected $errors = array(); + + /** + * Forbidden base namespaces + * + * @return array + */ + protected function getForbiddenNamespaces() + { + return array('Magento'); + } + + /** + * Test check dependencies in library from application + * + * @test + * @dataProvider libraryDataProvider + */ + public function testCheckDependencies($file) + { + $fileReflection = new FileReflection($file); + $tokens = new Tokens($fileReflection->getContents(), new ParserFactory()); + $tokens->parseContent(); + + $dependencies = array_merge( + (new Injectable())->getDependencies($fileReflection), + $tokens->getDependencies() + ); + + foreach ($dependencies as $dependency) { + if (preg_match('#^(\\\\|)' . implode('|', $this->getForbiddenNamespaces()) . '\\\\#', $dependency) + && !class_exists($dependency) + && !interface_exists($dependency) + ) { + $this->errors[$fileReflection->getFileName()][] = $dependency; + } + } + + if ($this->hasErrors()) { + $this->fail($this->getFailMessage()); + } + } + + /** + * Check if error not empty + * + * @return bool + */ + protected function hasErrors() + { + return !empty($this->errors); + } + + /** + * @inheritdoc + */ + public function tearDown() + { + $this->errors = array(); + } + + /** + * Prepare failed message + * + * @return string + */ + protected function getFailMessage() + { + $failMessage = ''; + foreach ($this->errors as $class => $dependencies) { + $failMessage .= $class . ' depends for non-library ' + . (count($dependencies) > 1 ? 'classes ' : 'class '); + foreach ($dependencies as $dependency) { + $failMessage .= $dependency . ' '; + } + $failMessage = trim($failMessage) . PHP_EOL; + } + return $failMessage; + } + + /** + * Contains all library files + * + * @return array + */ + public function libraryDataProvider() + { + // @TODO: remove this code when class Magento\Data\Collection will fixed + include_once BP . '/app/code/Magento/Core/Model/Option/ArrayInterface.php'; + $blackList = file(__DIR__ . DIRECTORY_SEPARATOR . '_files/blacklist.txt', FILE_IGNORE_NEW_LINES); + $dataProvider = Files::init()->getClassFiles(false, false, false, false, false, true, true); + + foreach ($dataProvider as $key => $data) { + $file = str_replace(BP . '/', '', $data[0]); + if (in_array($file, $blackList)) { + unset($dataProvider[$key]); + } else { + include_once $data[0]; + } + } + return $dataProvider; + } +} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt new file mode 100644 index 00000000000..df93f0a6bb3 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt @@ -0,0 +1,52 @@ +lib/Magento/Data/Collection/Filesystem.php +lib/Magento/Data/Collection/Db.php +lib/Magento/Data/Form/Element/Radio.php +lib/Magento/Data/Form/Element/Label.php +lib/Magento/Data/Form/Element/AbstractElement.php +lib/Magento/Data/Form/Element/File.php +lib/Magento/Data/Form/Element/Checkbox.php +lib/Magento/Data/Form/Element/Checkboxes.php +lib/Magento/Data/Form/Element/Password.php +lib/Magento/Data/Form/Element/Column.php +lib/Magento/Data/Form/Element/Gallery.php +lib/Magento/Data/Form/Element/Obscure.php +lib/Magento/Data/Form/Element/Data.php +lib/Magento/Data/Form/Element/Multiline.php +lib/Magento/Data/Form/Element/Radios.php +lib/Magento/Data/Form/Element/Submit.php +lib/Magento/Data/Form/Element/Note.php +lib/Magento/Data/Form/Element/Image.php +lib/Magento/Data/Form/Element/Text.php +lib/Magento/Data/Form/Element/Time.php +lib/Magento/Data/Form/Element/Button.php +lib/Magento/Data/Form/Element/Editor.php +lib/Magento/Data/Form/Element/Hidden.php +lib/Magento/Data/Form/Element/Reset.php +lib/Magento/Data/Form/Element/Link.php +lib/Magento/Data/Form/Element/Editablemultiselect.php +lib/Magento/Data/Form/Element/Multiselect.php +lib/Magento/Data/Form/Element/Fieldset.php +lib/Magento/Data/Form/Element/Select.php +lib/Magento/Data/Form/Element/Textarea.php +lib/Magento/Data/Form/Element/Imagefile.php +lib/Magento/Data/Form/Element/Imagefile.php +lib/Magento/Data/Form/Element/Date.php +lib/Magento/Data/Form/AbstractForm.php +lib/Magento/Data/Form/Factory.php +lib/Magento/Data/Collection.php +lib/Magento/Data/Form.php + +lib/Magento/Filter/Object/Grid.php +lib/Magento/Filter/Object.php + +lib/Magento/View/Context.php +lib/Magento/View/Service.php +lib/Magento/View/Config.php +lib/Magento/View/Layout/File/Source/Decorator/ModuleOutput.php + +lib/Magento/App/Module/ResourceResolver.php +lib/Magento/Event/Invoker/InvokerDefault.php +lib/Magento/Phrase/Renderer/Translate.php +lib/Magento/Backup/Snapshot.php +lib/Magento/Outbound/Authentication/Hmac.php +lib/Magento/Oauth/Exception.php diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php index 4a2e51e013d..d22a513554a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php @@ -38,7 +38,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($configFile)); $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() - . '/app/code/Magento/Core/etc/fieldset_file.xsd'; + . '/lib/Magento/Object/etc/fieldset_file.xsd'; $errors = \Magento\Config\Dom::validateDomDocument($dom, $schema); if ($errors) { $this->fail('XML-file ' . $configFile . ' has validation errors:' @@ -55,7 +55,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() - . '/app/code/Magento/Core/etc/fieldset.xsd'; + . '/lib/Magento/Object/etc/fieldset.xsd'; $errors = \Magento\Config\Dom::validateDomDocument($dom, $schema); if ($errors) { $this->fail('There is a problem with the schema. A known good XML file failed validation: ' @@ -69,7 +69,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() - . '/app/code/Magento/Core/etc/fieldset.xsd'; + . '/lib/Magento/Object/etc/fieldset.xsd'; $errors = \Magento\Config\Dom::validateDomDocument($dom, $schema); if (!$errors) { $this->fail('There is a problem with the schema. A known bad XML file passed validation'); @@ -82,7 +82,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() - . '/app/code/Magento/Core/etc/fieldset_file.xsd'; + . '/lib/Magento/Object/etc/fieldset_file.xsd'; $errors = \Magento\Config\Dom::validateDomDocument($dom, $schema); if ($errors) { $this->fail('There is a problem with the schema. A known good XML file failed validation: ' @@ -96,7 +96,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() - . '/app/code/Magento/Core/etc/fieldset_file.xsd'; + . '/lib/Magento/Object/etc/fieldset_file.xsd'; $errors = \Magento\Config\Dom::validateDomDocument($dom, $schema); if (!$errors) { $this->fail('There is a problem with the schema. A known bad XML file passed validation'); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml index 7e2ad32a911..b543570a910 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../app/code/Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_copy_order"> <field name="customer_email"> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml index 3f16ce510a3..4b1647512dd 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../app/code/Magento/Core/etc/fieldset_file.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/Magento/Object/etc/fieldset_file.xsd"> <scope id="global"> <fieldset id="sales_copy_order"> <field name="customer_email"> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/PageType/FilesTest.php similarity index 52% rename from dev/tests/integration/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php rename to dev/tests/static/testsuite/Magento/Test/Integrity/PageType/FilesTest.php index 86e444b06b5..643986f1cac 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/PageType/FilesTest.php @@ -20,37 +20,38 @@ * * @category Magento * @package Magento_Core - * @subpackage integration_tests + * @subpackage integrity_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Image; +namespace Magento\Test\Integrity\PageType; -/** - * Test class for \Magento\Core\Model\Image\AdapterFactory - * @magentoAppArea adminhtml - */ -class AdapterFactoryTest extends \PHPUnit_Framework_TestCase +class FilesTest extends \PHPUnit_Framework_TestCase { + /** + * @var string - xsd that will validate page_types.xml against + */ + protected $_schemaFile; + protected function setUp() { - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Image\AdapterFactory'); - $this->_config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Store\Config'); + $this->_schemaFile = \Magento\TestFramework\Utility\Files::init()->getModuleFile( + 'Magento', 'Core', 'etc' . DIRECTORY_SEPARATOR . 'page_types.xsd' + ); } - /** - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testCreate() + public function testPageType() { - $result = $this->_model->create(); - $this->assertInstanceOf('Magento\Image\Adapter\AbstractAdapter', $result); - $this->assertNotEmpty( - $this->_config->getConfig(\Magento\Core\Model\Image\AdapterFactory::XML_PATH_IMAGE_ADAPTER) + $invoker = new \Magento\TestFramework\Utility\AggregateInvoker($this); + $invoker( + function ($pageType) { + $dom = new \DOMDocument(); + $dom->loadXML(file_get_contents($pageType)); + $errors = \Magento\TestFramework\Utility\Validator::validateXml($dom, $this->_schemaFile); + $this->assertTrue(empty($errors), print_r($errors, true)); + }, + \Magento\TestFramework\Utility\Files::init()->getPageTypeFiles() ); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 6ef10a4a619..e6b008a1b25 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -1415,9 +1415,32 @@ return array( 'Magento\Adminhtml\Controller\Checkout\Agreement', 'Magento\Checkout\Controller\Adminhtml\Agreement' ), + array('Magento\Core\Model\View\PublicFilesManagerInterface', 'Magento\View\PublicFilesManagerInterface'), + array('Magento\Core\Model\View\DeployedFilesManager', 'Magento\View\DeployedFilesManager'), + array('Magento\Core\Model\View\Publisher', 'Magento\View\Publisher'), + array('Magento\Core\Model\View\FileSystem', 'Magento\View\FileSystem'), + array('Magento\Core\Model\View\Service', 'Magento\View\Service'), + array('Magento\Core\Model\View\Url', 'Magento\View\Url'), + array('Magento\Core\Model\View\Config', 'Magento\View\Config'), + array('Magento\Core\Model\Image\Factory', 'Magento\Image\Factory'), + array('Magento\Core\Model\Theme\Image', 'Magento\View\Design\Theme\Image'), + array('Magento\Core\Model\Theme\FlyweightFactory', 'Magento\View\Design\Theme\FlyweightFactory'), + array('Magento\Core\Model\Image\AdapterFactory', 'Magento\Image\AdapterFactory'), array('Magento\Core\Model\EntryPoint\Cron', 'Magento\App\Cron'), array('Magento\Log\Model\EntryPoint\Shell', 'Magento\Log\App\Shell'), array('Magento\Index\Model\EntryPoint\Shell', 'Magento\Index\App\Shell'), array('Magento\Index\Model\EntryPoint\Indexer', 'Magento\Index\App\Indexer'), array('\Magento\Core\Model\EntryPoint\Media', '\Magento\Core\App\Media'), + array('Magento\App\Cache\Config', 'Magento\Cache\Config'), + array('Magento\App\Cache\Config\Converter', 'Magento\Cache\Config\Converter'), + array('Magento\App\Cache\Config\Data', 'Magento\Cache\Config\Data'), + array('Magento\App\Cache\Config\Reader', 'Magento\Cache\Config\Reader'), + array('Magento\App\Cache\Config\SchemaLocator', 'Magento\Cache\Config\SchemaLocator'), + array('Magento\Core\Model\Fieldset\Config', 'Magento\Object\Copy\Config'), + array('Magento\Core\Model\Fieldset\Config\Converter', 'Magento\Object\Copy\Config\Converter'), + array('Magento\Core\Model\Fieldset\Config\Data', 'Magento\Object\Copy\Config\Data'), + array('Magento\Core\Model\Fieldset\Config\Reader', 'Magento\Object\Copy\Config\Reader'), + array('Magento\Core\Model\Fieldset\Config\SchemaLocator', 'Magento\Object\Copy\Config\SchemaLocator'), + array('Magento\Core\Model\EntryPoint\Media', '\Magento\Core\App\Media'), + array('Magento\Core\Model\ModuleManager', 'Magento\Module\Manager'), ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php index 45f7151375c..18297c73e2c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php @@ -349,6 +349,46 @@ return array( '\Magento\Core\Helper\Data', '\Magento\Adminhtml\Helper\Catalog::XML_PATH_PUBLIC_FILES_VALID_PATHS' ), + array( + 'TYPE_PHYSICAL', + '\Magento\Core\Model\Theme', + '\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL' + ), + array( + 'TYPE_VIRTUAL', + '\Magento\Core\Model\Theme', + '\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL' + ), + array( + 'TYPE_STAGING', + '\Magento\Core\Model\Theme', + '\Magento\View\Design\ThemeInterface::TYPE_STAGING' + ), + array( + 'PATH_SEPARATOR', + '\Magento\Core\Model\Theme', + '\Magento\View\Design\ThemeInterface::PATH_SEPARATOR' + ), + array( + 'CODE_SEPARATOR', + '\Magento\Core\Model\Theme', + '\Magento\View\Design\ThemeInterface::CODE_SEPARATOR' + ), + array( + 'XML_PATH_IMAGE_ADAPTER', + '\Magento\Core\Model\Image\AdapterFactory', + '\Magento\Core\Model\Image\Adapter\Config::XML_PATH_IMAGE_ADAPTER' + ), + array( + 'ADAPTER_IM', + '\Magento\Core\Model\Image\AdapterFactory', + '\Magento\Image\Adapter\AdapterInterface::ADAPTER_IM' + ), + array( + 'ADAPTER_GD2', + '\Magento\Core\Model\Image\AdapterFactory', + '\Magento\Image\Adapter\AdapterInterface::ADAPTER_GD2' + ), array('XML_PATH_IMAGE_TYPES', 'Magento\Adminhtml\Block\Catalog\Product\Frontend\Product\Watermark'), array('XML_PATH_WEBHOOK', 'Magento\Webhook\Model\Source\Hook'), array('XML_PATH_SUBSCRIPTIONS', 'Magento\Webhook\Model\Subscription\Config'), diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 3da69e71f11..504396a2aa6 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -98,7 +98,7 @@ return array( array('_getNumberFromToHtml', 'Magento\ImportExport\Block\Adminhtml\Export\Filter'), array('_getPathInScope', 'Magento\Core\Model\Config'), array('_getPriceFilter', 'Magento\Catalog\Block\Layer\View'), - array('_getProcessor', 'Magento\Core\Model\Cache'), + array('_getProcessor', 'Magento\App\Cache'), array('_getProductQtyForCheck', 'Magento\CatalogInventory\Model\Observer'), array('_getPublicFileUrl', 'Magento\Core\Model\Design\Package', 'Magento_Core_Model_View_Url::getPublicFileUrl'), array('_getRangeByType', 'Magento\Log\Model\Resource\Visitor\Collection'), @@ -283,6 +283,7 @@ return array( array('createDirIfNotExists', '', 'mkdir()'), array('createOrderItem', 'Magento\CatalogInventory\Model\Observer'), array('debugRequest', 'Magento\Paypal\Model\Api\Standard'), + array('decorateArray', 'Magento\Core\Helper\Data', 'Magento\Stdlib\ArrayUtils::decorateArray'), array('deleteAction', 'Magento\Catalog\Controller\Adminhtml\Product'), array('deleteConfig', 'Magento\Core\Model\Config'), array('deleteProductPrices', 'Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice'), @@ -299,8 +300,8 @@ return array( array('fetchItemsCount', 'Magento\Wishlist\Model\Resource\Wishlist'), array('fetchRuleRatesForCustomerTaxClass'), array('fetchUpdatesByHandle', 'Magento\Core\Model\Resource\Layout', 'Magento\Core\Model\Resource\Layout\Update'), - array('flush', 'Magento\Core\Model\Cache', 'Magento_Cache_FrontendInterface::clean()'), - array('flush', 'Magento\Core\Model\Cache\Proxy', 'Magento_Cache_FrontendInterface::clean()'), + array('flush', 'Magento\App\Cache', 'Magento_Cache_FrontendInterface::clean()'), + array('flush', 'Magento\App\Cache\Proxy', 'Magento_Cache_FrontendInterface::clean()'), array('flush', 'Magento\App\CacheInterface', 'Magento_Cache_FrontendInterface::clean()'), array('forsedSave'), array('generateBlocks', '', 'generateElements()'), @@ -343,8 +344,8 @@ return array( array('getDataForSave', 'Magento\Wishlist\Model\Item'), array('getDataMaxSize'), array('getDataMaxSizeInBytes', 'Magento\Adminhtml\Block\Media\Uploader', 'Magento_File_Size::getMaxFileSize()'), - array('getDbAdapter', 'Magento\Core\Model\Cache'), - array('getDbAdapter', 'Magento\Core\Model\Cache\Proxy'), + array('getDbAdapter', 'Magento\App\Cache'), + array('getDbAdapter', 'Magento\App\Cache\Proxy'), array('getDbAdapter', 'Magento\App\CacheInterface'), array( 'getDbVendorName', @@ -514,8 +515,8 @@ return array( array('getSuggestionsByQuery'), array('getSysTmpDir'), array('getTablePrefix', 'Magento\Core\Model\Config'), - array('getTagsByType', 'Magento\Core\Model\Cache', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), - array('getTagsByType', 'Magento\Core\Model\Cache\Proxy', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), + array('getTagsByType', 'Magento\App\Cache', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), + array('getTagsByType', 'Magento\App\Cache\Proxy', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), array('getTagsByType', 'Magento\App\CacheInterface', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), array('getTaxAmount', 'Magento\Sales\Model\Quote\Item\AbstractItem'), array('getTaxRatesByProductClass', '', '_getAllRatesByProductClass'), @@ -649,10 +650,10 @@ return array( array('preprocess', 'Magento\Newsletter\Model\Template'), array('processBeacon'), array('processBeforeVoid', 'Magento\Payment\Model\Method\AbstractMethod'), - array('processRequest', 'Magento\Core\Model\Cache'), + array('processRequest', 'Magento\App\Cache'), array('processSubst', 'Magento\Core\Model\Store'), array('productEventAggregate'), - array('publishRelatedViewFile', 'Magento\Core\Model\View\Publisher', '_publishRelatedViewFile'), + array('publishRelatedViewFile', 'Magento\View\Publisher', '_publishRelatedViewFile'), array('push', 'Magento\Catalog\Model\Product\Image'), array('rebuildCategoryLevels', 'Magento\Catalog\Model\Resource\Setup'), array('refundOrderItem', 'Magento\CatalogInventory\Model\Observer'), @@ -673,8 +674,8 @@ return array( array('salesOrderPaymentPlaceEnd'), array('saveCache', 'Magento\Core\Model\Config'), array('saveConfig', 'Magento\Core\Model\Config'), - array('saveOptions', 'Magento\Core\Model\Cache'), - array('saveOptions', 'Magento\Core\Model\Cache\Proxy'), + array('saveOptions', 'Magento\App\Cache'), + array('saveOptions', 'Magento\App\Cache\Proxy'), array('saveOptions', 'Magento\App\CacheInterface'), array('saveRow__OLD'), array('saveSegmentCustomersFromSelect'), @@ -937,4 +938,8 @@ return array( array('getServerAddr', '\Magento\Core\Helper\Http', 'Magento\HTTP\PhpEnvironment\ServerAddress::getServerAddress'), array('formatDate', 'Magento\Core\Model\Resource\AbstractResource', '\Magento\Stdlib\DateTime::formatDate'), array('mktime', 'Magento\Core\Model\Resource\AbstractResource', '\Magento\Stdlib\DateTime::toTimestamp'), + array('copyFieldsetToTarget', 'Magento\Core\Helper\Data', 'Magento\Object\Copy::copyFieldsetToTarget'), + array('formatDate', '\Magento\Core\Helper\Data', '\Magento\Core\Model\Locale::formatDate'), + array('formatTime', '\Magento\Core\Helper\Data', '\Magento\Core\Model\Locale::formatTime'), + array('_getConfigTimezone', '\Magento\Core\Model\Date', '\Magento\Core\Model\Locale::getConfigTimezone'), ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php index 921b76a3e71..5ec57ca9d26 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php @@ -115,4 +115,8 @@ return array( array('_backendFrontName', 'Magento\Backend\Helper\Data'), array('_app', 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Currency'), array('_enginePool', '\Magento\Core\Block\Template\Context', '_engineFactory'), + array('_allowedFormats', '\Magento\Core\Helper\Data', '\Magento\Core\Model\Locale'), + array('types', '\Magento\Core\Model\Theme'), + array('_collectionFactory', '\Magento\Install\Controller\Action', 'themeProvider'), + array('_collectionFactory', '\Magento\Theme\Model\Config\Customization', 'themeProvider'), ); diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index fe12bc4fcae..527a291185f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -34,11 +34,11 @@ Magento/Catalog/Model/Template Magento/Cms/Model Magento/GiftMessage/Model Magento/GoogleShopping/Model/Attribute -Magento/Oauth/Controller Magento/Sales/Block/Order Magento/Sales/Controller/Adminhtml/Order Magento/Sales/Model/Resource/Helper Magento/Sales/Model/Resource/Order +Magento/Catalog/Block/Product Magento/Catalog/Model/Resource/Product Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab Magento/Checkout/Block/Onepage diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml index 2703bb77be1..549695ed7c4 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml @@ -57,7 +57,6 @@ <!-- Naming Rules --> <rule ref="rulesets/naming.xml/ShortVariable" /> - <rule ref="rulesets/naming.xml/LongVariable" /> <rule ref="rulesets/naming.xml/ShortMethodName" /> <rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" /> <rule ref="rulesets/naming.xml/ConstantNamingConventions" /> diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt index aa62825238e..220d9dfec78 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt @@ -41,9 +41,7 @@ app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php app/code/Magento/Cms/Controller/Router.php app/code/Magento/Cms/Model/Template/FilterProvider.php app/code/Magento/Core/data -app/code/Magento/Core/Helper/Css.php app/code/Magento/Core/Model/Config -app/code/Magento/Core/Model/Cache app/code/Magento/Core/Model/DataService app/code/Magento/Core/Model/Design.php app/code/Magento/Core/Model/Email/Template/Config @@ -101,6 +99,7 @@ app/code/Magento/Index/Model/Indexer/ConfigInterface.php app/code/Magento/Index/Model/Indexer/Factory.php app/code/Magento/Index/Model/Indexer/AbstractIndexer.php app/code/Magento/Index/Model/Shell.php +app/code/Magento/Integration app/code/Magento/Log/Model/Resource/Helper.php app/code/Magento/Log/Model/Resource/Shell.php app/code/Magento/Log/Model/Shell.php diff --git a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php index c9c872acdb3..c543c0b9ed3 100644 --- a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php +++ b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php @@ -112,12 +112,12 @@ class Adminhtml extends \PHPUnit_Framework_TestCase $this->_storeConfigMock = $this->_makeMock('Magento\Core\Model\Store\Config'); $this->_storeManagerMock = $this->_makeMock('Magento\Core\Model\StoreManager'); $this->_helperFactoryMock = $this->_makeMock('Magento\Core\Model\Factory\Helper'); - $viewUrlMock = $this->_makeMock('Magento\Core\Model\View\Url'); + $viewUrlMock = $this->_makeMock('Magento\View\Url'); $viewConfigMock = $this->_makeMock('Magento\View\ConfigInterface'); - $viewFileSystemMock = $this->_makeMock('Magento\Core\Model\View\FileSystem'); + $viewFileSystemMock = $this->_makeMock('Magento\View\FileSystem'); $templateFactoryMock = $this->_makeMock('Magento\View\TemplateEngineFactory'); $authorizationMock = $this->_makeMock('Magento\AuthorizationInterface'); - $cacheStateMock = $this->_makeMock('Magento\Core\Model\Cache\StateInterface'); + $cacheStateMock = $this->_makeMock('Magento\App\Cache\StateInterface'); $appMock = $this->_makeMock('Magento\Core\Model\App'); $escaperMock = $this->_makeMock('Magento\Escaper'); $filterManagerMock = $this->_makeMock('Magento\Filter\FilterManager'); diff --git a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php index 7c5408da6d7..84350f8492a 100644 --- a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php +++ b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php @@ -53,7 +53,7 @@ class CacheOutdatedTest extends \PHPUnit_Framework_TestCase { $this->_authorizationMock = $this->getMock('Magento\AuthorizationInterface'); $this->_urlInterfaceMock = $this->getMock('Magento\UrlInterface'); - $this->_cacheTypeListMock = $this->getMock('Magento\Core\Model\Cache\TypeListInterface'); + $this->_cacheTypeListMock = $this->getMock('Magento\App\Cache\TypeListInterface'); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $arguments = array( diff --git a/dev/tests/unit/testsuite/Magento/Adminhtml/Controller/CacheTest.php b/dev/tests/unit/testsuite/Magento/Adminhtml/Controller/CacheTest.php index 920b1ebde62..42e75dd3d7c 100644 --- a/dev/tests/unit/testsuite/Magento/Adminhtml/Controller/CacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Adminhtml/Controller/CacheTest.php @@ -64,9 +64,9 @@ class CacheTest extends \PHPUnit_Framework_TestCase ->method('getHelper') ->will($this->returnValue($backendHelper)); - $cacheTypeListMock = $this->getMock('Magento\Core\Model\Cache\TypeListInterface'); - $cacheStateMock = $this->getMock('Magento\Core\Model\Cache\StateInterface'); - $cacheFrontendPool = $this->getMock('Magento\Core\Model\Cache\Frontend\Pool', array(), array(), '', false); + $cacheTypeListMock = $this->getMock('Magento\App\Cache\TypeListInterface'); + $cacheStateMock = $this->getMock('Magento\App\Cache\StateInterface'); + $cacheFrontendPool = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); $controller = new \Magento\Backend\Controller\Adminhtml\Cache( $context, diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/FactoryTest.php b/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest.php similarity index 92% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/FactoryTest.php rename to dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest.php index 1b73bf6e5fe..ccd85d7bd10 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/FactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Frontend; +namespace Magento\App\Cache\Frontend; class FactoryTest extends \PHPUnit_Framework_TestCase { @@ -131,14 +131,14 @@ class FactoryTest extends \PHPUnit_Framework_TestCase array(), array( array( - 'class' => 'Magento\Core\Model\Cache\Frontend\FactoryTest\CacheDecoratorDummy', + 'class' => 'Magento\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy', 'parameters' => array('param' => 'value') ) ) ); $result = $model->create(array('backend' => 'Zend_Cache_Backend_BlackHole')); - $this->assertInstanceOf('Magento\Core\Model\Cache\Frontend\FactoryTest\CacheDecoratorDummy', $result); + $this->assertInstanceOf('Magento\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy', $result); $params = $result->getParams(); $this->assertArrayHasKey('param', $params); @@ -150,7 +150,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase * * @param array $enforcedOptions * @param array $decorators - * @return \Magento\Core\Model\Cache\Frontend\Factory + * @return \Magento\App\Cache\Frontend\Factory */ protected function _buildModelForCreate($enforcedOptions = array(), $decorators = array()) { @@ -158,7 +158,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase switch ($class) { case 'Magento\Cache\Frontend\Adapter\Zend': return new $class($params['frontend']); - case 'Magento\Core\Model\Cache\Frontend\FactoryTest\CacheDecoratorDummy': + case 'Magento\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy': $frontend = $params['frontend']; unset($params['frontend']); return new $class($frontend, $params); @@ -191,7 +191,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase ->method('getDir') ->will($this->returnValueMap($map)); - $model = new \Magento\Core\Model\Cache\Frontend\Factory($objectManager, $filesystem, $dirs, $resource, + $model = new \Magento\App\Cache\Frontend\Factory($objectManager, $filesystem, $dirs, $resource, $enforcedOptions, $decorators); return $model; diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php b/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php similarity index 96% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php rename to dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php index d9a4194e264..1795601e35d 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php +++ b/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php @@ -25,7 +25,7 @@ /** * Dummy object to test creation of decorators for cache frontend */ -namespace Magento\Core\Model\Cache\Frontend\FactoryTest; +namespace Magento\App\Cache\Frontend\FactoryTest; class CacheDecoratorDummy extends \Magento\Cache\Frontend\Decorator\Bare { diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/PoolTest.php b/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/PoolTest.php similarity index 78% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/PoolTest.php rename to dev/tests/unit/testsuite/Magento/App/Cache/Frontend/PoolTest.php index cfbbb86d67d..2f5b3bfacb0 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Frontend/PoolTest.php +++ b/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/PoolTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Frontend; +namespace Magento\App\Cache\Frontend; class PoolTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Cache\Frontend\Pool + * @var \Magento\App\Cache\Frontend\Pool */ protected $_model; @@ -38,10 +38,10 @@ class PoolTest extends \PHPUnit_Framework_TestCase protected function setUp() { // Init frontend factory - $frontendFactory = $this->getMock('Magento\Core\Model\Cache\Frontend\Factory', array(), array(), '', false); + $frontendFactory = $this->getMock('Magento\App\Cache\Frontend\Factory', array(), array(), '', false); $this->_frontendInstances = array( - \Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID + \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID => $this->getMock('Magento\Cache\FrontendInterface'), 'resource1' => $this->getMock('Magento\Cache\FrontendInterface'), 'resource2' => $this->getMock('Magento\Cache\FrontendInterface'), @@ -52,7 +52,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase $this->returnValueMap(array( array( array('data1' => 'value1', 'data2' => 'value2'), - $this->_frontendInstances[\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID] + $this->_frontendInstances[\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID] ), array(array('r1d1' => 'value1', 'r1d2' => 'value2'), $this->_frontendInstances['resource1']), array(array('r2d1' => 'value1', 'r2d2' => 'value2'), $this->_frontendInstances['resource2']), @@ -69,7 +69,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase 'data2' => 'value2', ); // Create model - $this->_model = new \Magento\Core\Model\Cache\Frontend\Pool( + $this->_model = new \Magento\App\Cache\Frontend\Pool( $frontendFactory, $defaultOptions, $advancedOptions); } @@ -78,18 +78,18 @@ class PoolTest extends \PHPUnit_Framework_TestCase */ public function testConstructorNoInitialization() { - $frontendFactory = $this->getMock('Magento\Core\Model\Cache\Frontend\Factory', array(), array(), '', false); + $frontendFactory = $this->getMock('Magento\App\Cache\Frontend\Factory', array(), array(), '', false); $frontendFactory ->expects($this->never()) ->method('create') ; - new \Magento\Core\Model\Cache\Frontend\Pool($frontendFactory); + new \Magento\App\Cache\Frontend\Pool($frontendFactory); } public function testCurrent() { $this->assertEquals( - $this->_frontendInstances[\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID], + $this->_frontendInstances[\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID], $this->_model->current() ); } @@ -97,7 +97,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase public function testKey() { $this->assertEquals( - \Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, + \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, $this->_model->key() ); } @@ -105,7 +105,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase public function testNext() { $this->assertEquals( - \Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, + \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, $this->_model->key() ); @@ -138,13 +138,13 @@ class PoolTest extends \PHPUnit_Framework_TestCase { $this->_model->next(); $this->assertNotEquals( - \Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, + \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, $this->_model->key() ); $this->_model->rewind(); $this->assertEquals( - \Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, + \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID, $this->_model->key() ); } @@ -166,8 +166,8 @@ class PoolTest extends \PHPUnit_Framework_TestCase public function testGet() { - $this->assertSame($this->_frontendInstances[\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID], - $this->_model->get(\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID)); + $this->assertSame($this->_frontendInstances[\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID], + $this->_model->get(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID)); $this->assertSame($this->_frontendInstances['resource1'], $this->_model->get('resource1')); $this->assertSame($this->_frontendInstances['resource2'], $this->_model->get('resource2')); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/StateTest.php b/dev/tests/unit/testsuite/Magento/App/Cache/StateTest.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/StateTest.php rename to dev/tests/unit/testsuite/Magento/App/Cache/StateTest.php index 48b1146e69d..394838ffc72 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/App/Cache/StateTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\App\Cache; class StateTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ protected $_model; @@ -106,7 +106,7 @@ class StateTest extends \PHPUnit_Framework_TestCase * @param array|false $resourceTypeOptions * @param bool $appInstalled * @param bool $banAll - * @return \Magento\Core\Model\Cache\StateInterface + * @return \Magento\App\Cache\StateInterface */ protected function _buildModel( $cacheTypeOptions, @@ -117,14 +117,14 @@ class StateTest extends \PHPUnit_Framework_TestCase $this->_cacheFrontend = $this->getMock('Magento\Cache\FrontendInterface'); $this->_cacheFrontend->expects($this->any()) ->method('load') - ->with(\Magento\Core\Model\Cache\State::CACHE_ID) + ->with(\Magento\App\Cache\State::CACHE_ID) ->will($this->returnValue( $cacheTypeOptions === false ? false : serialize($cacheTypeOptions) )); - $cacheFrontendPool = $this->getMock('Magento\Core\Model\Cache\Frontend\Pool', array(), array(), '', false); + $cacheFrontendPool = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); $cacheFrontendPool->expects($this->any()) ->method('get') - ->with(\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) + ->with(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) ->will($this->returnValue($this->_cacheFrontend)); $this->_resource = $this->getMock('Magento\Core\Model\Resource\Cache', array(), array(), '', false); @@ -137,7 +137,7 @@ class StateTest extends \PHPUnit_Framework_TestCase ->method('isInstalled') ->will($this->returnValue($appInstalled)); - $this->_model = new \Magento\Core\Model\Cache\State($this->_resource, $cacheFrontendPool, $appState, $banAll); + $this->_model = new \Magento\App\Cache\State($this->_resource, $cacheFrontendPool, $appState, $banAll); return $this->_model; } @@ -175,7 +175,7 @@ class StateTest extends \PHPUnit_Framework_TestCase ->with($cacheTypes); $this->_cacheFrontend->expects($this->once()) ->method('remove') - ->with(\Magento\Core\Model\Cache\State::CACHE_ID); + ->with(\Magento\App\Cache\State::CACHE_ID); $model->persist(); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/AccessProxyTest.php b/dev/tests/unit/testsuite/Magento/App/Cache/Type/AccessProxyTest.php similarity index 92% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/AccessProxyTest.php rename to dev/tests/unit/testsuite/Magento/App/Cache/Type/AccessProxyTest.php index 48c54e95020..c17a0d13ca8 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/AccessProxyTest.php +++ b/dev/tests/unit/testsuite/Magento/App/Cache/Type/AccessProxyTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class AccessProxyTest extends \PHPUnit_Framework_TestCase { @@ -38,7 +38,7 @@ class AccessProxyTest extends \PHPUnit_Framework_TestCase $frontendMock = $this->getMock('Magento\Cache\FrontendInterface'); - $cacheEnabler = $this->getMock('Magento\Core\Model\Cache\StateInterface'); + $cacheEnabler = $this->getMock('Magento\App\Cache\StateInterface'); $cacheEnabler->expects($this->at(0)) ->method('isEnabled') ->with($identifier) @@ -48,7 +48,7 @@ class AccessProxyTest extends \PHPUnit_Framework_TestCase ->with($identifier) ->will($this->returnValue(true)); - $object = new \Magento\Core\Model\Cache\Type\AccessProxy($frontendMock, $cacheEnabler, $identifier); + $object = new \Magento\App\Cache\Type\AccessProxy($frontendMock, $cacheEnabler, $identifier); $helper = new \Magento\TestFramework\Helper\ProxyTesting(); // For the first call the cache is disabled - so fake default result is returned diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/FrontendPoolTest.php b/dev/tests/unit/testsuite/Magento/App/Cache/Type/FrontendPoolTest.php similarity index 77% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/FrontendPoolTest.php rename to dev/tests/unit/testsuite/Magento/App/Cache/Type/FrontendPoolTest.php index 0630c25f354..1b12094706b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/FrontendPoolTest.php +++ b/dev/tests/unit/testsuite/Magento/App/Cache/Type/FrontendPoolTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class FrontendPoolTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Cache\Type\FrontendPool + * @var \Magento\App\Cache\Type\FrontendPool */ protected $_model; @@ -36,15 +36,15 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\Core\Model\Cache\Frontend\Pool|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\App\Cache\Frontend\Pool|PHPUnit_Framework_MockObject_MockObject */ protected $_cachePool; protected function setUp() { $this->_objectManager = $this->getMock('Magento\ObjectManager', array(), array(), '', false); - $this->_cachePool = $this->getMock('Magento\Core\Model\Cache\Frontend\Pool', array(), array(), '', false); - $this->_model = new \Magento\Core\Model\Cache\Type\FrontendPool($this->_objectManager, $this->_cachePool); + $this->_cachePool = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); + $this->_model = new \Magento\App\Cache\Type\FrontendPool($this->_objectManager, $this->_cachePool); } public function testGet() @@ -55,10 +55,10 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase ->with('cache_type') ->will($this->returnValue($instanceMock)); - $accessMock = $this->getMock('Magento\Core\Model\Cache\Type\AccessProxy', array(), array(), '', false); + $accessMock = $this->getMock('Magento\App\Cache\Type\AccessProxy', array(), array(), '', false); $this->_objectManager->expects($this->once()) ->method('create') - ->with('Magento\Core\Model\Cache\Type\AccessProxy', + ->with('Magento\App\Cache\Type\AccessProxy', array('frontend' => $instanceMock, 'identifier' => 'cache_type')) ->will($this->returnValue($accessMock)); @@ -83,7 +83,7 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(null)); $this->_cachePool->expects($this->at(1)) ->method('get') - ->with(\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) + ->with(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) ->will($this->returnValue($defaultInstance)); $this->_cachePool->expects($this->at(2)) @@ -92,7 +92,7 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(null)); $this->_cachePool->expects($this->at(3)) ->method('get') - ->with(\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) + ->with(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) ->will($this->returnValue($defaultInstance)); /** @@ -100,17 +100,17 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase */ $this->_objectManager->expects($this->at(0)) ->method('create') - ->with('Magento\Core\Model\Cache\Type\AccessProxy', + ->with('Magento\App\Cache\Type\AccessProxy', array('frontend' => $defaultInstance, 'identifier' => 'cache_type')) ->will($this->returnValue( - $this->getMock('Magento\Core\Model\Cache\Type\AccessProxy', array(), array(), '', false) + $this->getMock('Magento\App\Cache\Type\AccessProxy', array(), array(), '', false) )); $this->_objectManager->expects($this->at(1)) ->method('create') - ->with('Magento\Core\Model\Cache\Type\AccessProxy', + ->with('Magento\App\Cache\Type\AccessProxy', array('frontend' => $defaultInstance, 'identifier' => 'another_cache_type')) ->will($this->returnValue( - $this->getMock('Magento\Core\Model\Cache\Type\AccessProxy', array(), array(), '', false) + $this->getMock('Magento\App\Cache\Type\AccessProxy', array(), array(), '', false) )); $cacheInstance = $this->_model->get('cache_type'); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/GenericTest.php b/dev/tests/unit/testsuite/Magento/App/Cache/Type/GenericTest.php similarity index 75% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/GenericTest.php rename to dev/tests/unit/testsuite/Magento/App/Cache/Type/GenericTest.php index 877be3b1829..9264eaaf322 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Type/GenericTest.php +++ b/dev/tests/unit/testsuite/Magento/App/Cache/Type/GenericTest.php @@ -23,9 +23,9 @@ */ /** - * The test covers \Magento\Core\Model\Cache_Type_* classes all at once, as all of them are similar + * The test covers \Magento\App\Cache_Type_* classes all at once, as all of them are similar */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class GenericTest extends \PHPUnit_Framework_TestCase { @@ -37,7 +37,7 @@ class GenericTest extends \PHPUnit_Framework_TestCase { $frontendMock = $this->getMock('Magento\Cache\FrontendInterface'); - $poolMock = $this->getMock('Magento\Core\Model\Cache\Type\FrontendPool', array(), array(), '', false); + $poolMock = $this->getMock('Magento\App\Cache\Type\FrontendPool', array(), array(), '', false); $poolMock->expects($this->atLeastOnce()) ->method('get') ->with($className::TYPE_IDENTIFIER) @@ -61,12 +61,12 @@ class GenericTest extends \PHPUnit_Framework_TestCase public static function constructorDataProvider() { return array( - array('Magento\Core\Model\Cache\Type\Block'), - array('Magento\Core\Model\Cache\Type\Collection'), - array('Magento\Core\Model\Cache\Type\Config'), - array('Magento\Core\Model\Cache\Type\Layout'), - array('Magento\Core\Model\Cache\Type\Translate'), - array('Magento\Core\Model\Cache\Type\Block'), + array('Magento\App\Cache\Type\Block'), + array('Magento\App\Cache\Type\Collection'), + array('Magento\App\Cache\Type\Config'), + array('Magento\App\Cache\Type\Layout'), + array('Magento\App\Cache\Type\Translate'), + array('Magento\App\Cache\Type\Block'), ); } } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/CacheTest.php b/dev/tests/unit/testsuite/Magento/App/CacheTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/Core/Model/CacheTest.php rename to dev/tests/unit/testsuite/Magento/App/CacheTest.php index 35c992c067c..57fbcd84359 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/CacheTest.php +++ b/dev/tests/unit/testsuite/Magento/App/CacheTest.php @@ -24,12 +24,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model; +namespace Magento\App; class CacheTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Cache + * @var \Magento\App\Cache */ protected $_model; @@ -51,7 +51,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase 'Magento\Cache\FrontendInterface', array(), '', true, true, true, array('clean') ); - $frontendPoolMock = $this->getMock('Magento\Core\Model\Cache\Frontend\Pool', array(), array(), '', false); + $frontendPoolMock = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); $frontendPoolMock ->expects($this->any()) ->method('valid') @@ -64,10 +64,10 @@ class CacheTest extends \PHPUnit_Framework_TestCase $frontendPoolMock ->expects($this->any()) ->method('get') - ->with(\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) + ->with(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID) ->will($this->returnValue($this->_cacheFrontendMock)); - $this->_model = new \Magento\Core\Model\Cache($frontendPoolMock); + $this->_model = new \Magento\App\Cache($frontendPoolMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigLoaderTest.php b/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigLoaderTest.php index bcba0ebeca6..903f3eaab9f 100644 --- a/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigLoaderTest.php +++ b/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigLoaderTest.php @@ -36,7 +36,7 @@ class ConfigLoaderTest extends \PHPUnit_Framework_TestCase protected $_readerMock; /** - * @var \Magento\Core\Model\Cache\Type\Config + * @var \Magento\App\Cache\Type\Config */ protected $_cacheMock; @@ -46,7 +46,7 @@ class ConfigLoaderTest extends \PHPUnit_Framework_TestCase array(), array(), '', false ); - $this->_cacheMock = $this->getMock('Magento\Core\Model\Cache\Type\Config', array(), array(), '', false); + $this->_cacheMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); $this->_model = new \Magento\App\ObjectManager\ConfigLoader($this->_cacheMock, $this->_readerMock); } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php index 67a3a59f84a..bb5adfeedc5 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php @@ -101,7 +101,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase array(), array(), '', false); $this->_cacheMock = $this->getMock( - 'Magento\Core\Model\Cache\Type\Layout', array(), array(), '', false + 'Magento\App\Cache\Type\Layout', array(), array(), '', false ); $configStructureMock->expects($this->any())->method('getElement') diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/FieldTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/FieldTest.php index 02680041877..0b586865b64 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/FieldTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/FieldTest.php @@ -94,7 +94,7 @@ class FieldTest extends \PHPUnit_Framework_TestCase 'Magento\Backend\Model\Config\CommentFactory', array(), array(), '', false ); $this->_blockFactoryMock = $this->getMock( - 'Magento\Core\Model\BlockFactory', array(), array(), '', false + 'Magento\View\Element\BlockFactory', array(), array(), '', false ); $this->_dsGraphMock = $this->getMock( 'Magento\Core\Model\DataService\Graph', array(), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php index 73adf6b5af4..133dd13b4df 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php @@ -77,7 +77,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_cacheInstanceMock = $this->getMock('Magento\Core\Model\Cache\Type\Config', array(), array(), + $this->_cacheInstanceMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); $this->_directorMock = $this->getMock('Magento\Backend\Model\Menu\AbstractDirector', array(), array(), diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Cache/Config/ConverterTest.php similarity index 90% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Cache/Config/ConverterTest.php index 3f30ad93dc3..1b2ffbc55f1 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Cache/Config/ConverterTest.php @@ -21,18 +21,18 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Config; +namespace Magento\Cache\Config; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Cache\Config\Converter + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Cache\Config\Converter */ protected $_model; protected function setUp() { - $this->_model = new \Magento\Core\Model\Cache\Config\Converter(); + $this->_model = new \Magento\Cache\Config\Converter; } public function testConvert() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/_files/cache_config.php b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/_files/cache_config.php rename to dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.php index 5769e929cf1..d8e09b44dbf 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/_files/cache_config.php +++ b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.php @@ -26,14 +26,14 @@ return array( 'config' => array( 'name' => 'config', 'translate' => 'label,description', - 'instance' => 'Magento\Core\Model\Cache\Type\Config', + 'instance' => 'Magento\App\Cache\Type\Config', 'label' => 'Configuration', 'description' => 'System(config.xml, local.xml) and modules configuration files(config.xml).' ), 'layout' => array( 'name' => 'layout', 'translate' => 'label,description', - 'instance' => 'Magento\Core\Model\Cache\Type\Layout', + 'instance' => 'Magento\App\Cache\Type\Layout', 'label' => 'Layouts', 'description' => 'Layout building instructions.' ), diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/_files/cache_config.xml b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.xml similarity index 94% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/_files/cache_config.xml rename to dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.xml index dbcb3c1762f..193d5553157 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/Config/_files/cache_config.xml +++ b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.xml @@ -24,11 +24,11 @@ */ --> <config> - <type name="config" translate="label,description" instance="Magento\Core\Model\Cache\Type\Config"> + <type name="config" translate="label,description" instance="Magento\App\Cache\Type\Config"> <label>Configuration</label> <description>System(config.xml, local.xml) and modules configuration files(config.xml).</description> </type> - <type name="layout" translate="label,description" instance="Magento\Core\Model\Cache\Type\Layout"> + <type name="layout" translate="label,description" instance="Magento\App\Cache\Type\Layout"> <label>Layouts</label> <description>Layout building instructions.</description> </type> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Cache/ConfigTest.php similarity index 80% rename from dev/tests/unit/testsuite/Magento/Core/Model/Cache/ConfigTest.php rename to dev/tests/unit/testsuite/Magento/Cache/ConfigTest.php index c10b9451af3..2d9ac918e1e 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Cache/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Cache/ConfigTest.php @@ -21,24 +21,24 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\Cache; class ConfigTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Cache\Config\Data|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Cache\Config\Data|\PHPUnit_Framework_MockObject_MockObject */ protected $_storage; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Cache\Config\Data + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Cache\Config */ protected $_model; protected function setUp() { - $this->_storage = $this->getMock('Magento\Core\Model\Cache\Config\Data', array('get'), array(), '', false); - $this->_model = new \Magento\Core\Model\Cache\Config($this->_storage); + $this->_storage = $this->getMock('Magento\Cache\Config\Data', array('get'), array(), '', false); + $this->_model = new \Magento\Cache\Config($this->_storage); } public function testGetTypes() diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php index 03c415af5d4..950a36dcbe6 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php @@ -63,7 +63,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase public function testToHtml() { - $moduleManager = $this->getMockBuilder('Magento\Core\Model\ModuleManager') + $moduleManager = $this->getMockBuilder('Magento\Module\Manager') ->disableOriginalConstructor() ->setMethods(array('isOutputEnabled')) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php index 606d3edbce0..8ce73129123 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php @@ -72,7 +72,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase ->getMock(); $helperFactory->expects($this->any())->method('get')->will($this->returnValue($helper)); - $moduleManager = $this->getMockBuilder('Magento\Core\Model\ModuleManager') + $moduleManager = $this->getMockBuilder('Magento\Module\Manager') ->disableOriginalConstructor() ->setMethods(array('isOutputEnabled')) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php index ff50a4d4c58..a0423f1b0ed 100644 --- a/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -102,9 +102,9 @@ class StorageTest extends \PHPUnit_Framework_TestCase { $this->_filesystemMock = $this->getMock('Magento\Filesystem', array(), array(), '', false); $this->_adapterFactoryMock = $this->getMock( - 'Magento\Core\Model\Image\AdapterFactory', array(), array(), '', false + 'Magento\Image\AdapterFactory', array(), array(), '', false ); - $this->_viewUrlMock = $this->getMock('Magento\Core\Model\View\Url', array(), array(), '', false); + $this->_viewUrlMock = $this->getMock('Magento\View\Url', array(), array(), '', false); $this->_imageHelperMock = $this->getMock('Magento\Cms\Helper\Wysiwyg\Images', array(), array(), '', false); $this->_resizeParameters = array('width' => 100, 'height' => 50); diff --git a/dev/tests/unit/testsuite/Magento/Core/Block/TemplateTest.php b/dev/tests/unit/testsuite/Magento/Core/Block/TemplateTest.php index 45ecad0fe63..9fb63811033 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Block/TemplateTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Block/TemplateTest.php @@ -45,7 +45,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase protected $_templateEngine; /** - * @var \Magento\Core\Model\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_viewFileSystem; @@ -58,7 +58,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $dirs = $this->getMock('Magento\App\Dir', array(), array(), '', false, false); $dirs->expects($this->any())->method('getDir')->will($this->returnValueMap($dirMap)); - $this->_viewFileSystem = $this->getMock('\Magento\Core\Model\View\FileSystem', array(), array(), '', false); + $this->_viewFileSystem = $this->getMock('\Magento\View\FileSystem', array(), array(), '', false); $this->_filesystem = $this->getMock('\Magento\Filesystem', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php index e9a920a07df..051698b63b4 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php @@ -61,7 +61,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase /** @var $context \Magento\Core\Helper\Context */ $context = $this->getMock('Magento\Core\Helper\Context', null, array(), '', false); - $fileSystem = $this->getMockBuilder('Magento\Core\Model\View\FileSystem')->disableOriginalConstructor() + $fileSystem = $this->getMockBuilder('Magento\View\FileSystem')->disableOriginalConstructor() ->getMock(); $helper = new \Magento\Core\Helper\Theme( @@ -477,12 +477,12 @@ class ThemeTest extends \PHPUnit_Framework_TestCase /** * @param array $map - * @return \Magento\Core\Model\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject + * @return \Magento\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ protected function _getFileSystem($map) { - /** @var $fileSystem \Magento\Core\Model\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ - $fileSystem = $this->getMockBuilder('Magento\Core\Model\View\FileSystem', array()) + /** @var $fileSystem \Magento\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ + $fileSystem = $this->getMockBuilder('Magento\View\FileSystem', array()) ->disableOriginalConstructor()->getMock(); $fileSystem->expects($this->any()) ->method('getViewFile') @@ -579,8 +579,8 @@ class ThemeTest extends \PHPUnit_Framework_TestCase /** @var $context \Magento\Core\Helper\Context */ $context = $this->getMock('Magento\Core\Helper\Context', null, array(), '', false); - /** @var $fileSystem \Magento\Core\Model\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ - $fileSystem = $this->getMockBuilder('Magento\Core\Model\View\FileSystem', array()) + /** @var $fileSystem \Magento\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ + $fileSystem = $this->getMockBuilder('Magento\View\FileSystem', array()) ->disableOriginalConstructor()->getMock(); /** @var $helper \Magento\Core\Helper\Theme|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Config/CacheTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Config/CacheTest.php index 282464aa9ce..5b86fd0719b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Config/CacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Config/CacheTest.php @@ -45,7 +45,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_cacheMock = $this->getMock('Magento\Core\Model\Cache\Type\Config', array(), array(), '', false, false); + $this->_cacheMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false, false); $this->_baseFactoryMock = $this->getMock('Magento\Core\Model\Config\BaseFactory', array(), array(), '', false, false); $this->_model = new \Magento\Core\Model\Config\Cache($this->_cacheMock, $this->_baseFactoryMock); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Config/InitialTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Config/InitialTest.php index 0474367dc15..24e6994a47d 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Config/InitialTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Config/InitialTest.php @@ -45,7 +45,7 @@ class InitialTest extends \PHPUnit_Framework_TestCase $this->_initialReaderMock = $this->getMock( 'Magento\Core\Model\Config\Initial\Reader', array(), array(), '', false ); - $this->_configCacheMock = $this->getMock('Magento\Core\Model\Cache\Type\Config', array(), array(), '', false); + $this->_configCacheMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); $serializedData = serialize(array( 'data' => array( 'default' => array( diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php deleted file mode 100644 index e0921316890..00000000000 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Image/AdapterFactoryTest.php +++ /dev/null @@ -1,139 +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 Magento - * @package Magento_Core - * @subpackage unit_tests - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Core\Model\Image; - -class AdapterFactoryTest extends \PHPUnit_Framework_TestCase -{ - /** - * Object Manager Helper - * - * @var \Magento\TestFramework\Helper\ObjectManager - */ - protected $_objectManagerHelper; - - protected function setUp() - { - $this->_objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - } - - /** - * @dataProvider createDataProvider - * @param string $adapter - * @param string $class - */ - public function testCreate($adapter, $class) - { - $imageAdapter = $this->getMock($class, array('checkDependencies'), array(), '', false); - $imageAdapter->expects($this->any()) - ->method('checkDependencies') - ->will($this->returnValue(null)); - $objectManagerMock = $this->getMock('Magento\ObjectManager'); - $objectManagerMock->expects($this->any()) - ->method('create') - ->will($this->returnValue($imageAdapter)); - $this->_getModel(array( - 'objectManager' => $objectManagerMock, - ))->create($adapter); - - $storeConfigMock = $this->getMock('Magento\Core\Model\Store\Config', array('getConfig'), array(), '', false); - $storeConfigMock->expects($this->any()) - ->method('getConfig') - ->will($this->returnValue($adapter)); - - $this->_getModel(array( - 'storeConfig' => $storeConfigMock, - 'objectManager' => $objectManagerMock, - ))->create(); - } - - /** - * @see self::testCreate() - * @return array - */ - public function createDataProvider() - { - return array( - array(\Magento\Core\Model\Image\AdapterFactory::ADAPTER_GD2, 'Magento\Image\Adapter\Gd2'), - array(\Magento\Core\Model\Image\AdapterFactory::ADAPTER_IM, 'Magento\Image\Adapter\ImageMagick'), - ); - } - - /** - * @covers \Magento\Core\Model\Image\AdapterFactory::create - * @dataProvider invalidArgumentExceptionDataProvider - * @expectedException \InvalidArgumentException - * @param string $adapter - */ - public function testInvalidArgumentException($adapter) - { - $this->_getModel()->create($adapter); - } - - /** - * @see self::testInvalidArgumentException() - * @return array - */ - public function invalidArgumentExceptionDataProvider() - { - return array( - array(''), - array('incorrect'), - ); - } - - /** - * @covers \Magento\Core\Model\Image\AdapterFactory::create - * @expectedException \Magento\Core\Exception - */ - public function testMageCoreException() - { - $objectManagerMock = $this->getMock('Magento\ObjectManager'); - $imageAdapter = $this->getMockForAbstractClass('Magento\Image\Adapter\AbstractAdapter'); - $imageAdapter->expects($this->any()) - ->method('checkDependencies') - ->will($this->throwException(new \Exception)); - $objectManagerMock->expects($this->any()) - ->method('create') - ->will($this->returnValue($imageAdapter)); - $this->_getModel(array( - 'objectManager' => $objectManagerMock, - ))->create(); - } - - /** - * @param array $mockObjects - * @return \Magento\Core\Model\Image\AdapterFactory - */ - protected function _getModel(array $mockObjects = array()) - { - return $this->_objectManagerHelper->getObject( - 'Magento\Core\Model\Image\AdapterFactory', - $mockObjects - ); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php index 53298aebc47..f0f1f26f227 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php @@ -165,7 +165,6 @@ class MergeTest extends \PHPUnit_Framework_TestCase { return array( 'non-existing handle' => array('non_existing_handle', false), - 'non page type handle' => array('not_a_page_type', false), 'existing page type' => array('default', true), ); } @@ -251,4 +250,22 @@ class MergeTest extends \PHPUnit_Framework_TestCase ); $this->assertEquals($expected, $this->_model->getContainers()); } + + public function testGetAllDesignAbstractions() + { + $expected = array( + 'customer_account' => array( + 'name' => 'customer_account', + 'label' => 'Customer My Account (All Pages)', + 'design_abstraction' => 'custom' + ), + 'page_empty' => array( + 'name' => 'page_empty', + 'label' => 'All Empty Layout Pages', + 'design_abstraction' => 'page_layout' + ) + ); + + $this->assertSame($expected, $this->_model->getAllDesignAbstractions()); + } } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml index 0d89580372c..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_default.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Catalog Category (Non-Anchor)" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml index 12ec004bb44..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_category_layered.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Catalog Category (Anchor)" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml index b9c1c3551df..8456c9eac79 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Catalog Product View (Any)" type="page"> +<layout> <container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint"/> </layout> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml index ca654ec8fc8..4e3abb394fd 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Catalog Product View (Configurable)" type="page"> +<layout> <container name="product.info.configurable.extra" as="product_type_data_extra" label="Configurable Product Extra Info"/> </layout> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_grouped.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_grouped.xml index 91e7aa59a2d..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_grouped.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_grouped.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Catalog Product View (Grouped)" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml index 5d6c257d001..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/catalog_product_view_type_simple.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Catalog Product View (Simple)" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml index 591d79b8237..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/checkout_onepage_index.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="One Page Checkout" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml new file mode 100644 index 00000000000..1d6901edafe --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/customer_account.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout label="Customer My Account (All Pages)" design_abstraction="custom"/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml index 430e665b099..b880e7b16ae 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/default.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="All Pages" type="page"> +<layout> <container name="content" as="content" label="Main Content Area"/> </layout> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml new file mode 100644 index 00000000000..7a8abff5495 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/page_empty.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout label="All Empty Layout Pages" design_abstraction="page_layout"/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml index 5739e45d3fc..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="All Pages (Print Version)" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml index 05482591e8f..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_guest_print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Sales Order Print View (Guest)" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml index bc0e1a10b1d..3668fc56853 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/sales_order_print.xml @@ -23,4 +23,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<layout label="Sales Order Print View" type="page"/> +<layout/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml index 9de751d0c92..8949e8f0d88 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml @@ -26,18 +26,19 @@ */ --> <layouts> - <handle id="catalog_category_default" label="Catalog Category (Non-Anchor)" type="page"/> - <handle id="catalog_category_layered" label="Catalog Category (Anchor)" type="page"/> - <handle id="catalog_product_view" label="Catalog Product View (Any)" type="page"> + <handle id="catalog_category_default"/> + <handle id="catalog_category_layered"/> + <handle id="catalog_product_view"> <container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint"/> </handle> - <handle id="catalog_product_view_type_configurable" label="Catalog Product View (Configurable)" type="page"> + <handle id="catalog_product_view_type_configurable"> <container name="product.info.configurable.extra" as="product_type_data_extra" label="Configurable Product Extra Info"/> </handle> - <handle id="catalog_product_view_type_grouped" label="Catalog Product View (Grouped)" type="page"/> - <handle id="catalog_product_view_type_simple" label="Catalog Product View (Simple)" type="page"/> - <handle id="checkout_onepage_index" label="One Page Checkout" type="page"/> - <handle id="default" label="All Pages" type="page"> + <handle id="catalog_product_view_type_grouped"/> + <handle id="catalog_product_view_type_simple"/> + <handle id="checkout_onepage_index"/> + <handle id="customer_account" label="Customer My Account (All Pages)" design_abstraction="custom"/> + <handle id="default"> <container name="content" as="content" label="Main Content Area"/> </handle> <handle id="fixture_handle_one"> @@ -47,7 +48,8 @@ <block class="Magento\Core\Block\Template" template="fixture_template_two.phtml"/> </handle> <handle id="not_a_page_type" label="Handle that Is Not a Page Type"/> - <handle id="print" label="All Pages (Print Version)" type="page"/> - <handle id="sales_guest_print" label="Sales Order Print View (Guest)" type="page"/> - <handle id="sales_order_print" label="Sales Order Print View" type="page"/> + <handle id="page_empty" label="All Empty Layout Pages" design_abstraction="page_layout"/> + <handle id="print"/> + <handle id="sales_guest_print"/> + <handle id="sales_order_print"/> </layouts> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/LocaleTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/LocaleTest.php new file mode 100644 index 00000000000..e164d4bed67 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Core/Model/LocaleTest.php @@ -0,0 +1,135 @@ +<?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 Magento + * @package Magento_Core + * @subpackage unit_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model; + +class LocaleTest extends \PHPUnit_Framework_TestCase +{ + const DEFAULT_TIME_ZONE = 'America/New_York'; + + const TIME_FORMAT_SHORT_ISO = 'h:mm a'; + + const DATETIME_FORMAT_SHORT = 'n/j/y g:i A'; + + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $_objectManager; + + /** + * @var \Magento\Core\Model\App + */ + protected $_app; + + /** + * @var \Magento\Core\Model\App + */ + protected $_storeManager; + + /** + * @var \DateTime + */ + protected $_dateTime; + + protected function setUp() + { + $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->_app = $this->getMock( + '\Magento\Core\Model\App', + array('getCache', 'getLowLevelFrontend', 'getStore'), + array(), + '', + false + ); + + $this->_storeManager = $this->getMock( + '\Magento\Core\Model\StoreManager', + array('getStore', 'getConfig'), + array(), + '', + false + ); + + $this->_dateTime = new \DateTime; + $this->_dateTime->setTimezone(new \DateTimeZone(self::DEFAULT_TIME_ZONE)); + } + + public function testFormatDate() + { + /** @var $locale \Magento\Core\Model\Locale */ + $locale = $this->_objectManager->getObject( + '\Magento\Core\Model\Locale', + $this->_getConstructArgsForDateFormatting() + ); + + $this->assertEquals( + $this->_dateTime->format(self::DATETIME_FORMAT_SHORT), + $locale->formatDate(null, 'short', true) + ); + } + + public function testFormatTime() + { + /** @var $locale \Magento\Core\Model\Locale */ + $locale = $this->_objectManager->getObject( + '\Magento\Core\Model\Locale', + $this->_getConstructArgsForDateFormatting() + ); + + $this->assertEquals( + $this->_dateTime->format(self::DATETIME_FORMAT_SHORT), $locale->formatTime(null, 'short', true) + ); + + $zendDate = new \Zend_Date($this->_dateTime->format('U')); + $this->assertEquals( + $zendDate->toString(self::TIME_FORMAT_SHORT_ISO), + $locale->formatTime($zendDate, 'short') + ); + } + + protected function _getConstructArgsForDateFormatting() + { + $this->_app->expects($this->once()) + ->method('getCache') + ->will($this->returnValue($this->_app)); + + $cache = $this->getMock('Zend_Cache_Core'); + $this->_app->expects($this->once()) + ->method('getLowLevelFrontend') + ->will($this->returnValue($cache)); + + $this->_storeManager->expects($this->once()) + ->method('getStore') + ->will($this->returnValue($this->_storeManager)); + + $this->_storeManager->expects($this->once()) + ->method('getConfig') + ->will($this->returnValue(self::DEFAULT_TIME_ZONE)); + + return array('app' => $this->_app, 'storeManager' => $this->_storeManager); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php index e11aab60515..dfe9433e28f 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php @@ -65,7 +65,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->_cacheFrontendMock = $this->getMockForAbstractClass('Magento\Cache\FrontendInterface'); $this->_frontendPoolMock = $this->getMock( - 'Magento\Core\Model\Cache\Frontend\Pool', + 'Magento\App\Cache\Frontend\Pool', array(), array(), '', @@ -83,13 +83,19 @@ class ObserverTest extends \PHPUnit_Framework_TestCase ; $this->_themeCustomization = $this->getMock( - 'Magento\Core\Model\Theme\Customization', + 'Magento\View\Design\Theme\Customization', array(), array(), '', false ); - $themeMock = $this->getMock('Magento\Core\Model\Theme', array('getCustomization'), array(), '', false); + $themeMock = $this->getMock( + 'Magento\Core\Model\Theme', + array('__wakeup', 'getCustomization'), + array(), + '', + false + ); $themeMock->expects($this->any())->method('getCustomization') ->will($this->returnValue($this->_themeCustomization)); @@ -151,7 +157,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase { $asset = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/test.css'); $file = $this->getMock('Magento\Core\Model\Theme\File', array(), array(), '', false); - $fileService = $this->getMock('Magento\Core\Model\Theme\Customization\File\Css', array(), array(), '', false); + $fileService = $this->getMock('Magento\View\Design\Theme\Customization\File\Css', array(), array(), '', false); $fileService->expects($this->atLeastOnce())->method('getContentType')->will($this->returnValue('css')); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeServiceTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeServiceTest.php index a9525819683..feca73ae398 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeServiceTest.php @@ -141,42 +141,42 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase return array( 'js production mode' => array( $jsAssets, - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS, + \Magento\View\Publisher::CONTENT_TYPE_JS, \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_JS_FILES, \Magento\App\State::MODE_PRODUCTION, 'Magento\Core\Model\Page\Asset\MergeStrategy\FileExists' ), 'css production mode' => array( $cssAssets, - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS, + \Magento\View\Publisher::CONTENT_TYPE_CSS, \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_CSS_FILES, \Magento\App\State::MODE_PRODUCTION, 'Magento\Core\Model\Page\Asset\MergeStrategy\FileExists' ), 'js default mode' => array( $jsAssets, - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS, + \Magento\View\Publisher::CONTENT_TYPE_JS, \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_JS_FILES, \Magento\App\State::MODE_DEFAULT, 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' ), 'css default mode' => array( $cssAssets, - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS, + \Magento\View\Publisher::CONTENT_TYPE_CSS, \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_CSS_FILES, \Magento\App\State::MODE_DEFAULT, 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' ), 'js developer mode' => array( $jsAssets, - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_JS, + \Magento\View\Publisher::CONTENT_TYPE_JS, \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_JS_FILES, \Magento\App\State::MODE_DEVELOPER, 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' ), 'css developer mode' => array( $cssAssets, - \Magento\Core\Model\View\Publisher::CONTENT_TYPE_CSS, + \Magento\View\Publisher::CONTENT_TYPE_CSS, \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_CSS_FILES, \Magento\App\State::MODE_DEVELOPER, 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/DirectTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/DirectTest.php index 5f235dd9b3b..b1454e518a0 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/DirectTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/DirectTest.php @@ -44,16 +44,16 @@ class DirectTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_cssHelper; + protected $_cssUrlResolver; protected function setUp() { - $this->_cssHelper = $this->getMock('Magento\Core\Helper\Css', array(), array(), '', false); + $this->_cssUrlResolver = $this->getMock('Magento\View\Url\CssResolver', array(), array(), '', false); $this->_filesystem = $this->getMock('Magento\Filesystem', array(), array(), '', false); $this->_dirs = $this->getMock('Magento\App\Dir', array(), array(), '', false); $this->_object = new \Magento\Core\Model\Page\Asset\MergeStrategy\Direct( - $this->_filesystem, $this->_dirs, $this->_cssHelper + $this->_filesystem, $this->_dirs, $this->_cssUrlResolver ); } @@ -71,7 +71,7 @@ class DirectTest extends \PHPUnit_Framework_TestCase */ public function testMergeFilesCss() { - $this->_cssHelper + $this->_cssUrlResolver ->expects($this->exactly(2)) ->method('replaceCssRelativeUrls') ->will($this->returnArgument(0)); @@ -83,7 +83,7 @@ class DirectTest extends \PHPUnit_Framework_TestCase */ public function testMergeFilesJs() { - $this->_cssHelper + $this->_cssUrlResolver ->expects($this->never()) ->method('replaceCssRelativeUrls'); $this->_testMergeFiles('js'); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifiedTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifiedTest.php index 69d22a86f5c..12e2f573576 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifiedTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifiedTest.php @@ -42,7 +42,7 @@ class MinifiedTest extends \PHPUnit_Framework_TestCase protected $_minifier; /** - * @var \Magento\Core\Model\View\Url|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Url|PHPUnit_Framework_MockObject_MockObject */ protected $_viewUrl; @@ -65,7 +65,7 @@ class MinifiedTest extends \PHPUnit_Framework_TestCase false ); $this->_minifier = $this->getMock('Magento\Code\Minifier', array('getMinifiedFile'), array(), '', false); - $this->_viewUrl = $this->getMock('Magento\Core\Model\View\Url', array(), array(), '', false); + $this->_viewUrl = $this->getMock('Magento\View\Url', array(), array(), '', false); $this->_logger = $this->getMock('Magento\Logger', array(), array(), '', false); $this->_model = new \Magento\Core\Model\Page\Asset\Minified($this->_asset, $this->_minifier, $this->_viewUrl, diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/PublicFileTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/PublicFileTest.php index ff478502195..da5dee940f6 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/PublicFileTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/PublicFileTest.php @@ -35,13 +35,13 @@ class PublicFileTest extends \PHPUnit_Framework_TestCase protected $_object; /** - * @var \Magento\Core\Model\View\Url|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Url|PHPUnit_Framework_MockObject_MockObject */ protected $_viewUrl; protected function setUp() { - $this->_viewUrl = $this->getMock('Magento\Core\Model\View\Url', array(), array(), '', false); + $this->_viewUrl = $this->getMock('Magento\View\Url', array(), array(), '', false); $this->_object = new \Magento\Core\Model\Page\Asset\PublicFile($this->_viewUrl, 'test/style.css', 'css'); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/ViewFileTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/ViewFileTest.php index c2d2be86e3d..597d88b17a2 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/ViewFileTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/ViewFileTest.php @@ -35,13 +35,13 @@ class ViewFileTest extends \PHPUnit_Framework_TestCase protected $_object; /** - * @var \Magento\Core\Model\View\Url|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Url|PHPUnit_Framework_MockObject_MockObject */ protected $_viewUrl; protected function setUp() { - $this->_viewUrl = $this->getMock('Magento\Core\Model\View\Url', array(), array(), '', false); + $this->_viewUrl = $this->getMock('Magento\View\Url', array(), array(), '', false); $this->_object = new \Magento\Core\Model\Page\Asset\ViewFile($this->_viewUrl, 'test/script.js', 'js'); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Decorator/DebugHintsTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Decorator/DebugHintsTest.php index 153c0ddf172..41d2b30b53c 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Decorator/DebugHintsTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Decorator/DebugHintsTest.php @@ -33,7 +33,7 @@ class DebugHintsTest extends \PHPUnit_Framework_TestCase public function testRender($showBlockHints) { $subject = $this->getMock('Magento\View\TemplateEngineInterface'); - $block = $this->getMock('Magento\Core\Block\Template', array(), array(), 'TestBlock', false); + $block = $this->getMock('Magento\View\Element\BlockInterface', array(), array(), 'TestBlock', false); $subject ->expects($this->once()) ->method('render') diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/CopyServiceTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/CopyServiceTest.php index 4940b63e823..3e95d10f6e5 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/CopyServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/CopyServiceTest.php @@ -96,52 +96,53 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $sourceFileOne = $this->getMock('Magento\Core\Model\Theme\File', array('delete'), array(), '', false); - $sourceFileOne->setData(array( - 'file_path' => 'fixture_file_path_one', - 'file_type' => 'fixture_file_type_one', - 'content' => 'fixture_content_one', - 'sort_order' => 10, - )); - $sourceFileTwo = $this->getMock('Magento\Core\Model\Theme\File', array('delete'), array(), '', false); - $sourceFileTwo->setData(array( - 'file_path' => 'fixture_file_path_two', - 'file_type' => 'fixture_file_type_two', - 'content' => 'fixture_content_two', - 'sort_order' => 20, - )); + $sourceFileOne = $this->getMock( + 'Magento\Core\Model\Theme\File', array('__wakeup', 'delete'), array(), '', false + ); + $sourceFileOne->setData( + array( + 'file_path' => 'fixture_file_path_one', + 'file_type' => 'fixture_file_type_one', + 'content' => 'fixture_content_one', + 'sort_order' => 10, + ) + ); + $sourceFileTwo = $this->getMock( + 'Magento\Core\Model\Theme\File', array('__wakeup', 'delete'), array(), '', false + ); + $sourceFileTwo->setData( + array( + 'file_path' => 'fixture_file_path_two', + 'file_type' => 'fixture_file_type_two', + 'content' => 'fixture_content_two', + 'sort_order' => 20, + ) + ); $this->_sourceFiles = array($sourceFileOne, $sourceFileTwo); $this->_sourceTheme = $this->getMock( - 'Magento\Core\Model\Theme', - array('getCustomization'), - array(), - '', - false + 'Magento\Core\Model\Theme', array('__wakeup', 'getCustomization'), array(), '', false ); $this->_targetFiles = array( - $this->getMock('Magento\Core\Model\Theme\File', array('delete'), array(), '', false), - $this->getMock('Magento\Core\Model\Theme\File', array('delete'), array(), '', false), + $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup', 'delete'), array(), '', false), + $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup', 'delete'), array(), '', false), ); $this->_targetTheme = $this->getMock( - 'Magento\Core\Model\Theme', - array('getCustomization'), - array(), - '', - false + 'Magento\Core\Model\Theme', array('__wakeup', 'getCustomization'), array(), '', false ); $this->_targetTheme->setId(123); - $this->_customizationPath = $this->getMock('Magento\Core\Model\Theme\Customization\Path', - array(), array(), '', false); - - $this->_fileFactory = $this->getMock( - 'Magento\Core\Model\Theme\FileFactory', - array('create'), + $this->_customizationPath = $this->getMock( + 'Magento\View\Design\Theme\Customization\Path', + array(), array(), '', false ); + + $this->_fileFactory = $this->getMock( + 'Magento\View\Design\Theme\FileFactory', array('create'), array(), '', false + ); $this->_filesystem = $this->getMock( 'Magento\Filesystem', array('isDirectory', 'searchKeys', 'copy', 'delete'), array($this->getMockForAbstractClass('Magento\Filesystem\AdapterInterface')) @@ -151,11 +152,7 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase $this->_updateFactory = $this->getMock('Magento\Core\Model\Layout\UpdateFactory', array('create'), array(), '', false); $this->_update = $this->getMock( - 'Magento\Core\Model\Layout\Update', - array('getCollection'), - array(), - '', - false + 'Magento\Core\Model\Layout\Update', array('__wakeup', 'getCollection'), array(), '', false ); $this->_updateFactory->expects($this->at(0))->method('create')->will($this->returnValue($this->_update)); $this->_updateCollection = $this->getMock('Magento\Core\Model\Resource\Layout\Collection', @@ -164,7 +161,9 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($this->_updateCollection)); /* Init Link an Link_Collection model */ - $this->_link = $this->getMock('Magento\Core\Model\Layout\Link', array('getCollection'), array(), '', false); + $this->_link = $this->getMock( + 'Magento\Core\Model\Layout\Link', array('__wakeup', 'getCollection'), array(), '', false + ); $this->_linkCollection = $this->getMock('Magento\Core\Model\Resource\Layout\Link\Collection', array('addThemeFilter', 'getIterator'), array(), '', false); $this->_link->expects($this->any())->method('getCollection')->will($this->returnValue($this->_linkCollection)); @@ -202,7 +201,7 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase public function testCopyLayoutUpdates() { $customization = $this->getMock( - 'Magento\Core\Model\Theme\Customization', + 'Magento\View\Design\Theme\Customization', array('getFiles'), array(), '', @@ -217,11 +216,21 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase $this->_updateCollection->expects($this->once())->method('delete'); $this->_linkCollection->expects($this->once())->method('addThemeFilter'); - $targetLinkOne = $this->getMock('Magento\Core\Model\Layout\Link', - array('setId', 'setThemeId', 'save', 'setLayoutUpdateId'), array(), '', false); + $targetLinkOne = $this->getMock( + 'Magento\Core\Model\Layout\Link', + array('__wakeup', 'setId', 'setThemeId', 'save', 'setLayoutUpdateId'), + array(), + '', + false + ); $targetLinkOne->setData(array('id' => 1, 'layout_update_id' => 1)); - $targetLinkTwo = $this->getMock('Magento\Core\Model\Layout\Link', - array('setId', 'setThemeId', 'save', 'setLayoutUpdateId'), array(), '', false); + $targetLinkTwo = $this->getMock( + 'Magento\Core\Model\Layout\Link', + array('__wakeup', 'setId', 'setThemeId', 'save', 'setLayoutUpdateId'), + array(), + '', + false + ); $targetLinkTwo->setData(array('id' => 2, 'layout_update_id' => 2)); $targetLinkOne->expects($this->at(0))->method('setThemeId')->with(123); @@ -237,11 +246,21 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase $linkReturnValues = $this->onConsecutiveCalls(new \ArrayIterator(array($targetLinkOne, $targetLinkTwo))); $this->_linkCollection->expects($this->any())->method('getIterator')->will($linkReturnValues); - $targetUpdateOne = $this->getMock('Magento\Core\Model\Layout\Update', array('setId', 'load', 'save'), - array(), '', false); + $targetUpdateOne = $this->getMock( + 'Magento\Core\Model\Layout\Update', + array('__wakeup', 'setId', 'load', 'save'), + array(), + '', + false + ); $targetUpdateOne->setData(array('id' => 1)); - $targetUpdateTwo = $this->getMock('Magento\Core\Model\Layout\Update', array('setId', 'load', 'save'), - array(), '', false); + $targetUpdateTwo = $this->getMock( + 'Magento\Core\Model\Layout\Update', + array('__wakeup', 'setId', 'load', 'save'), + array(), + '', + false + ); $targetUpdateTwo->setData(array('id' => 2)); $updateReturnValues = $this->onConsecutiveCalls($this->_update, $targetUpdateOne, $targetUpdateTwo); $this->_updateFactory->expects($this->any())->method('create')->will($updateReturnValues); @@ -255,7 +274,7 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase public function testCopyDatabaseCustomization() { $sourceCustom = $this->getMock( - 'Magento\Core\Model\Theme\Customization', + 'Magento\View\Design\Theme\Customization', array('getFiles'), array(), '', @@ -267,7 +286,7 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase $this->_sourceTheme->expects($this->once())->method('getCustomization') ->will($this->returnValue($sourceCustom)); $targetCustom = $this->getMock( - 'Magento\Core\Model\Theme\Customization', + 'Magento\View\Design\Theme\Customization', array('getFiles'), array(), '', @@ -288,8 +307,20 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase $targetFile->expects($this->once())->method('delete'); } - $newFileOne = $this->getMock('Magento\Core\Model\Theme\File', array('setData', 'save'), array(), '', false); - $newFileTwo = $this->getMock('Magento\Core\Model\Theme\File', array('setData', 'save'), array(), '', false); + $newFileOne = $this->getMock( + 'Magento\Core\Model\Theme\File', + array('__wakeup', 'setData', 'save'), + array(), + '', + false + ); + $newFileTwo = $this->getMock( + 'Magento\Core\Model\Theme\File', + array('__wakeup', 'setData', 'save'), + array(), + '', + false + ); $newFileOne->expects($this->at(0))->method('setData')->with(array( 'theme_id' => 123, 'file_path' => 'fixture_file_path_one', @@ -322,7 +353,7 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase public function testCopyFilesystemCustomization() { $customization = $this->getMock( - 'Magento\Core\Model\Theme\Customization', + 'Magento\View\Design\Theme\Customization', array('getFiles'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/FactoryTest.php index cb03d34c230..b457e3307b7 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/FactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/FactoryTest.php @@ -37,10 +37,10 @@ class FactoryTest extends \PHPUnit_Framework_TestCase */ public function testCreate() { - $themeMock = $this->getMock('Magento\Core\Model\Theme', array('getType'), array(), '', false); + $themeMock = $this->getMock('Magento\Core\Model\Theme', array('__wakeup', 'getType'), array(), '', false); $themeMock->expects($this->any()) ->method('getType') - ->will($this->returnValue(\Magento\Core\Model\Theme::TYPE_VIRTUAL)); + ->will($this->returnValue(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL)); $newThemeMock = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false); @@ -50,7 +50,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase ->with('Magento\Core\Model\Theme\Domain\Virtual', array('theme' => $themeMock)) ->will($this->returnValue($newThemeMock)); - $themeDomainFactory = new \Magento\Core\Model\Theme\Domain\Factory($objectManager); + $themeDomainFactory = new \Magento\View\Design\Theme\Domain\Factory($objectManager); $this->assertEquals($newThemeMock, $themeDomainFactory->create($themeMock)); } @@ -60,17 +60,17 @@ class FactoryTest extends \PHPUnit_Framework_TestCase public function testCreateWithWrongThemeType() { $wrongThemeType = 'wrong_theme_type'; - $themeMock = $this->getMock('Magento\Core\Model\Theme', array('getType'), array(), '', false); + $themeMock = $this->getMock('Magento\Core\Model\Theme', array('__wakeup', 'getType'), array(), '', false); $themeMock->expects($this->any()) ->method('getType') ->will($this->returnValue($wrongThemeType)); $objectManager = $this->getMock('Magento\ObjectManager', array(), array('create'), '', false); - $themeDomainFactory = new \Magento\Core\Model\Theme\Domain\Factory($objectManager); + $themeDomainFactory = new \Magento\View\Design\Theme\Domain\Factory($objectManager); $this->setExpectedException( - 'Magento\Core\Exception', + 'Magento\Exception', sprintf('Invalid type of theme domain model "%s"', $wrongThemeType) ); $themeDomainFactory->create($themeMock); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/PhysicalTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/PhysicalTest.php index 5f325c4074c..5887ab1c6d4 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/PhysicalTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/PhysicalTest.php @@ -34,7 +34,7 @@ class PhysicalTest extends \PHPUnit_Framework_TestCase { public function testCreateVirtualTheme() { - $physicalTheme = $this->getMock('Magento\Core\Model\Theme', null, array(), '', false, false); + $physicalTheme = $this->getMock('Magento\Core\Model\Theme', array('__wakeup'), array(), '', false, false); $physicalTheme->setData(array( 'parent_id' => 10, 'theme_title' => 'Test Theme' @@ -46,8 +46,12 @@ class PhysicalTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($copyService)); $virtualTheme = $this->getMock( - 'Magento\Core\Model\Theme', array('getThemeImage', 'createPreviewImageCopy', 'save'), - array(), '', false, false + 'Magento\Core\Model\Theme', + array('__wakeup', 'getThemeImage', 'createPreviewImageCopy', 'save'), + array(), + '', + false, + false ); $virtualTheme->expects($this->once()) ->method('getThemeImage') diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/StagingTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/StagingTest.php index a3d348f9a14..8e5f25f89b0 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/StagingTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/StagingTest.php @@ -39,7 +39,14 @@ class StagingTest extends \PHPUnit_Framework_TestCase { $parentTheme = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false, false); - $theme = $this->getMock('Magento\Core\Model\Theme', array('getParentTheme'), array(), '', false, false); + $theme = $this->getMock( + 'Magento\Core\Model\Theme', + array('__wakeup', 'getParentTheme'), + array(), + '', + false, + false + ); $theme->expects($this->once())->method('getParentTheme')->will($this->returnValue($parentTheme)); $themeCopyService = $this->getMock('Magento\Core\Model\Theme\CopyService', array('copy'), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php index ed175d02440..6c8fc48481a 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php @@ -41,7 +41,14 @@ class VirtualTest extends \PHPUnit_Framework_TestCase { $themeStaging = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false, false); - $theme = $this->getMock('Magento\Core\Model\Theme', array('getStagingVersion'), array(), '', false, false); + $theme = $this->getMock( + 'Magento\Core\Model\Theme', + array('__wakeup', 'getStagingVersion'), + array(), + '', + false, + false + ); $theme->expects($this->once())->method('getStagingVersion')->will($this->returnValue($themeStaging)); $themeFactory = $this->getMock('Magento\Core\Model\ThemeFactory', array('create'), array(), '', false); @@ -67,7 +74,14 @@ class VirtualTest extends \PHPUnit_Framework_TestCase */ public function testGetStagingThemeNew() { - $theme = $this->getMock('Magento\Core\Model\Theme', array('getStagingVersion'), array(), '', false, false); + $theme = $this->getMock( + 'Magento\Core\Model\Theme', + array('__wakeup', 'getStagingVersion'), + array(), + '', + false, + false + ); $theme->expects($this->once())->method('getStagingVersion')->will($this->returnValue(null)); $appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); $appState->expects($this->any())->method('getAreaCode')->will($this->returnValue('fixture_area')); @@ -80,11 +94,18 @@ class VirtualTest extends \PHPUnit_Framework_TestCase 'theme_title' => 'fixture_theme_title', 'preview_image' => 'fixture_preview_image', 'is_featured' => 'fixture_is_featured', - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL + 'type' => \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL )); $appStateProperty->setValue($theme, $appState); - $themeStaging = $this->getMock('Magento\Core\Model\Theme', array('setData', 'save'), array(), '', false, false); + $themeStaging = $this->getMock( + 'Magento\Core\Model\Theme', + array('__wakeup', 'setData', 'save'), + array(), + '', + false, + false + ); $themeStaging->expects($this->at(0))->method('setData')->with(array( 'parent_id' => 'fixture_theme_id', 'theme_path' => null, @@ -92,7 +113,7 @@ class VirtualTest extends \PHPUnit_Framework_TestCase 'theme_title' => 'fixture_theme_title - Staging', 'preview_image' => 'fixture_preview_image', 'is_featured' => 'fixture_is_featured', - 'type' => \Magento\Core\Model\Theme::TYPE_STAGING, + 'type' => \Magento\View\Design\ThemeInterface::TYPE_STAGING, )); $appStateProperty->setValue($themeStaging, $appState); $themeStaging->expects($this->at(1))->method('save'); @@ -123,8 +144,14 @@ class VirtualTest extends \PHPUnit_Framework_TestCase $customizationConfig = $this->getMock( 'Magento\Theme\Model\Config\Customization', array('isThemeAssignedToStore'), array(), '', false ); - $themeMock = $this->getMock('Magento\Core\Model\Theme', array('getCollection', 'getId'), array(), '', false, - false); + $themeMock = $this->getMock( + 'Magento\Core\Model\Theme', + array('__wakeup', 'getCollection', 'getId'), + array(), + '', + false, + false + ); $customizationConfig->expects($this->atLeastOnce())->method('isThemeAssignedToStore') ->with($themeMock) ->will($this->returnValue(true)); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php index f1a61dca10f..05ced049f63 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php @@ -33,7 +33,7 @@ namespace Magento\Core\Model\Theme\Image; class PathTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Theme\Image\Path|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Core\Model\Theme\Image\Path|\PHPUnit_Framework_MockObject_MockObject */ protected $_model; @@ -43,25 +43,25 @@ class PathTest extends \PHPUnit_Framework_TestCase protected $_dirMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\View\Url */ protected $_viewUrlMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\StoreManager */ protected $_storeManagerMock; protected function setUp() { $this->_dirMock = $this->getMock('Magento\App\Dir', array(), array(), '', false); - $this->_viewUrlMock = $this->getMock('Magento\Core\Model\View\Url', array(), array(), '', false); + $this->_viewUrlMock = $this->getMock('Magento\View\Url', array(), array(), '', false); $this->_storeManagerMock = $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false); $this->_dirMock->expects($this->any())->method('getDir')->with(\Magento\App\Dir::MEDIA) ->will($this->returnValue('/media')); - $this->_model = new \Magento\Core\Model\Theme\Image\Path( + $this->_model = new Path( $this->_dirMock, $this->_viewUrlMock, $this->_storeManagerMock @@ -89,7 +89,7 @@ class PathTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image\Path::getPreviewImageDefaultUrl + * @covers \Magento\Core\Model\Theme\Image\PathMagento\Core\Model\Theme\Image\Path::getPreviewImageDefaultUrl */ public function testDefaultPreviewImageUrlGetter() { diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/UploaderTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/UploaderTest.php index 70ea916120f..79b6bf623fc 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/UploaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/UploaderTest.php @@ -33,7 +33,7 @@ namespace Magento\Core\Model\Theme\Image; class UploaderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Theme\Image\Uploader|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Design\Theme\Image\Uploader|PHPUnit_Framework_MockObject_MockObject */ protected $_model; @@ -63,12 +63,17 @@ class UploaderTest extends \PHPUnit_Framework_TestCase $this->_transferAdapterMock = $this->getMock('Zend_File_Transfer_Adapter_Http', array(), array(), '', false); $this->_fileUploader = $this->getMock('Magento\File\Uploader', array(), array(), '', false); + $adapterFactory = $this->getMock('Magento\HTTP\Adapter\FileTransferFactory'); + $adapterFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->_transferAdapterMock)); + $uploaderFactory = $this->getMock('Magento\File\UploaderFactory', array('create'), array(), '', false); $uploaderFactory->expects($this->any())->method('create')->will($this->returnValue($this->_fileUploader)); - $this->_model = new \Magento\Core\Model\Theme\Image\Uploader( + $this->_model = new \Magento\View\Design\Theme\Image\Uploader( $this->_filesystemMock, - $this->_transferAdapterMock, + $adapterFactory, $uploaderFactory ); } @@ -80,18 +85,6 @@ class UploaderTest extends \PHPUnit_Framework_TestCase $this->_fileUploader = null; } - /** - * @covers \Magento\Core\Model\Theme\Image\Uploader::__construct - */ - public function testCunstructor() - { - $this->assertNotEmpty(new \Magento\Core\Model\Theme\Image\Uploader( - $this->getMock('Magento\Filesystem', array(), array(), '', false), - $this->getMock('Zend_File_Transfer_Adapter_Http', array(), array(), '', false), - $this->getMock('Magento\File\UploaderFactory', array('create'), array(), '', false) - )); - } - /** * @return array */ @@ -120,7 +113,7 @@ class UploaderTest extends \PHPUnit_Framework_TestCase 'checkAllowedExtension' => true, 'save' => true, 'result' => false, - 'exception' => 'Magento\Core\Exception' + 'exception' => 'Magento\Exception' ), array( 'isUploaded' => true, @@ -128,7 +121,7 @@ class UploaderTest extends \PHPUnit_Framework_TestCase 'checkAllowedExtension' => false, 'save' => true, 'result' => false, - 'exception' => 'Magento\Core\Exception' + 'exception' => 'Magento\Exception' ), array( 'isUploaded' => true, @@ -136,7 +129,7 @@ class UploaderTest extends \PHPUnit_Framework_TestCase 'checkAllowedExtension' => true, 'save' => false, 'result' => false, - 'exception' => 'Magento\Core\Exception' + 'exception' => 'Magento\Exception' ), ); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ThemeProviderTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ThemeProviderTest.php new file mode 100644 index 00000000000..3d41fa5f102 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ThemeProviderTest.php @@ -0,0 +1,70 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Core\Model\Theme; + +class ThemeProviderTest extends \PHPUnit_Framework_TestCase +{ + public function testGetByFullPath() + { + $path = 'frontend/magento_fixed_width'; + $collectionFactory = $this->getMock( + 'Magento\Core\Model\Resource\Theme\CollectionFactory', array('create'), array(), '', false + ); + $collectionMock = $this->getMock('Magento\Core\Model\Resource\Theme\Collection', array(), array(), '', false); + $theme = $this->getMock('Magento\View\Design\ThemeInterface', array(), array(), '', false); + $collectionMock->expects($this->once()) + ->method('getThemeByFullPath') + ->with($path) + ->will($this->returnValue($theme)); + $collectionFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($collectionMock)); + $themeFactory = $this->getMock('\Magento\Core\Model\ThemeFactory', array(), array(), '', false); + + $themeProvider = new ThemeProvider($collectionFactory, $themeFactory); + $this->assertSame($theme, $themeProvider->getThemeByFullPath($path)); + } + + public function testGetById() + { + $themeId = 755; + $collectionFactory = $this->getMock( + 'Magento\Core\Model\Resource\Theme\CollectionFactory', array(), array(), '', false + ); + $theme = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false); + $theme->expects($this->once()) + ->method('load') + ->with($themeId) + ->will($this->returnSelf()); + $themeFactory = $this->getMock('\Magento\Core\Model\ThemeFactory', array('create'), array(), '', false); + $themeFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($theme)); + + $themeProvider = new ThemeProvider($collectionFactory, $themeFactory); + $this->assertSame($theme, $themeProvider->getThemeById($themeId)); + } +} + \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php index 81d42c53b09..f8b1b0e5046 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php @@ -35,7 +35,7 @@ class ValidationTest extends \PHPUnit_Framework_TestCase /** * Test validator with valid data * - * @covers \Magento\Core\Model\Theme\Validator::validate + * @covers \Magento\View\Design\Theme\Validator::validate */ public function testValidateWithValidData() { @@ -43,9 +43,9 @@ class ValidationTest extends \PHPUnit_Framework_TestCase $themeMock = new \Magento\Object(); $themeMock->setData($this->_getThemeValidData()); - /** @var $validatorMock \Magento\Core\Model\Theme\Validator */ + /** @var $validatorMock \Magento\View\Design\Theme\Validator */ $validatorMock = $this->getMock( - 'Magento\Core\Model\Theme\Validator', array('_setThemeValidators'), array(), '', false + 'Magento\View\Design\Theme\Validator', array('_setThemeValidators'), array(), '', false ); $versionValidators = array( @@ -63,7 +63,7 @@ class ValidationTest extends \PHPUnit_Framework_TestCase /** * Test validator with invalid data * - * @covers \Magento\Core\Model\Theme\Validator::validate + * @covers \Magento\View\Design\Theme\Validator::validate */ public function testValidateWithInvalidData() { @@ -74,9 +74,9 @@ class ValidationTest extends \PHPUnit_Framework_TestCase /** @var $helper \Magento\Core\Helper\Data */ $helper = $this->getMockBuilder('Magento\Core\Helper\Data')->disableOriginalConstructor()->getMock(); - /** @var $validatorMock \Magento\Core\Model\Theme\Validator */ + /** @var $validatorMock \Magento\View\Design\Theme\Validator */ $validatorMock = $this->getMock( - 'Magento\Core\Model\Theme\Validator', array('_setThemeValidators'), array($helper), '', true + 'Magento\View\Design\Theme\Validator', array('_setThemeValidators'), array($helper), '', true ); $codeValidators = array( diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php index cb0a924ab03..32ee23dde2e 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php @@ -30,6 +30,8 @@ */ namespace Magento\Core\Model; +use \Magento\View\Design\ThemeInterface; + class ThemeTest extends \PHPUnit_Framework_TestCase { /** @@ -45,7 +47,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase protected function setUp() { $customizationConfig = $this->getMock('Magento\Theme\Model\Config\Customization', array(), array(), '', false); - $customizationFactory = $this->getMock('Magento\Core\Model\Theme\CustomizationFactory', + $customizationFactory = $this->getMock('Magento\View\Design\Theme\CustomizationFactory', array('create'), array(), '', false); $resourceCollection = $this->getMock( 'Magento\Core\Model\Resource\Theme\Collection', @@ -54,7 +56,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_imageFactory = $this->getMock('Magento\Core\Model\Theme\ImageFactory', + $this->_imageFactory = $this->getMock('Magento\View\Design\Theme\ImageFactory', array('create'), array(), '', false); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -102,9 +104,9 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function isVirtualDataProvider() { return array( - array('type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL, 'isVirtual' => true), - array('type' => \Magento\Core\Model\Theme::TYPE_STAGING, 'isVirtual' => false), - array('type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL, 'isVirtual' => false) + array('type' => ThemeInterface::TYPE_VIRTUAL, 'isVirtual' => true), + array('type' => ThemeInterface::TYPE_STAGING, 'isVirtual' => false), + array('type' => ThemeInterface::TYPE_PHYSICAL, 'isVirtual' => false) ); } @@ -128,9 +130,9 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function isPhysicalDataProvider() { return array( - array('type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL, 'isPhysical' => false), - array('type' => \Magento\Core\Model\Theme::TYPE_STAGING, 'isPhysical' => false), - array('type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL, 'isPhysical' => true) + array('type' => ThemeInterface::TYPE_VIRTUAL, 'isPhysical' => false), + array('type' => ThemeInterface::TYPE_STAGING, 'isPhysical' => false), + array('type' => ThemeInterface::TYPE_PHYSICAL, 'isPhysical' => true) ); } @@ -154,9 +156,9 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function isVisibleDataProvider() { return array( - array('type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL, 'isVisible' => true), - array('type' => \Magento\Core\Model\Theme::TYPE_STAGING, 'isVisible' => false), - array('type' => \Magento\Core\Model\Theme::TYPE_PHYSICAL, 'isVisible' => true) + array('type' => ThemeInterface::TYPE_VIRTUAL, 'isVisible' => true), + array('type' => ThemeInterface::TYPE_STAGING, 'isVisible' => false), + array('type' => ThemeInterface::TYPE_PHYSICAL, 'isVisible' => true) ); } @@ -184,9 +186,9 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function isDeletableDataProvider() { return array( - array(\Magento\Core\Model\Theme::TYPE_VIRTUAL, true), - array(\Magento\Core\Model\Theme::TYPE_STAGING, true), - array(\Magento\Core\Model\Theme::TYPE_PHYSICAL, false) + array(ThemeInterface::TYPE_VIRTUAL, true), + array(ThemeInterface::TYPE_STAGING, true), + array(ThemeInterface::TYPE_PHYSICAL, false) ); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php new file mode 100644 index 00000000000..c8883223670 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php @@ -0,0 +1,78 @@ +<?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 Magento + * @package Magento_Core + * @subpackage unit_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\View\Url; + +class ConfigTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Core\Model\View\Url\Config + */ + protected $_model; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Store\Config + */ + protected $_storeConfig; + + protected function setUp() + { + $this->_storeConfig = $this->getMockBuilder('Magento\Core\Model\Store\Config') + ->disableOriginalConstructor() + ->getMock(); + $this->_model = new \Magento\Core\Model\View\Url\Config($this->_storeConfig); + } + + /** + * @param $path + * @param $expectedValue + * + * @dataProvider getValueDataProvider + */ + public function testGetValue($path, $expectedValue) + { + $this->_storeConfig + ->expects($this->any()) + ->method('getConfig') + ->with($path) + ->will($this->returnValue($expectedValue)); + $actual = $this->_model->getValue($path); + $this->assertEquals($expectedValue, $actual); + } + + /** + * @return array + */ + public function getValueDataProvider() + { + return array( + array('some/valid/path1', 'someValue'), + array('some/valid/path2', 2), + array('some/valid/path3', false), + array('some/invalid/path3', null), + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/SaveTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/SaveTest.php index 2c9601dc93e..e5b6c2e309f 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/SaveTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/SaveTest.php @@ -124,7 +124,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase { return array( 'Physical theme' => array( - $this->_getThemeMock(\Magento\Core\Model\Theme::TYPE_PHYSICAL), + $this->_getThemeMock(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL), array( 'button' => array( 'event' => 'assign', @@ -138,7 +138,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase array() ), 'Virtual assigned theme' => array( - $this->_getThemeMock(\Magento\Core\Model\Theme::TYPE_VIRTUAL, true), + $this->_getThemeMock(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL, true), array( 'button' => array( 'event' => 'save', @@ -153,7 +153,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase array() ), 'Virtual unassigned theme' => array( - $this->_getThemeMock(\Magento\Core\Model\Theme::TYPE_VIRTUAL, false), + $this->_getThemeMock(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL, false), array( 'button' => array( 'event' => 'save', @@ -200,9 +200,12 @@ class SaveTest extends \PHPUnit_Framework_TestCase public function testInitStaging() { // 1. Get theme mock - $stagingTheme = $this->_getThemeMock(\Magento\Core\Model\Theme::TYPE_STAGING); - $this->_block->setTheme($stagingTheme); - $this->_block->init(); + $stagingTheme = $this->_getThemeMock(\Magento\View\Design\ThemeInterface::TYPE_STAGING); + + $block = $this->_block; + + $block->setTheme($stagingTheme); + $block->init(); } /** @@ -214,7 +217,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase { $themeId = 123; - if ($type == \Magento\Core\Model\Theme::TYPE_VIRTUAL) { + if ($type == \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) { $theme = $this->_getVirtualThemeMock($type, $isAssigned); } else { $theme = $this->getMock('Magento\Core\Model\Theme', array('__sleep', '__wakeup'), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php index a0aeaa2ce10..01924ffe60d 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php @@ -116,12 +116,12 @@ class CustomTest extends \PHPUnit_Framework_TestCase { $expectedContent = 'New file content'; - $customization = $this->getMock('Magento\Core\Model\Theme\Customization', array(), array(), '', false); + $customization = $this->getMock('Magento\View\Design\Theme\Customization', array(), array(), '', false); $this->_theme->expects($this->any())->method('getCustomization')->will($this->returnValue($customization)); - /** @var $cssFile \Magento\Core\Model\Theme\Customization\File\Css */ + /** @var $cssFile \Magento\View\Design\Theme\Customization\File\Css */ $cssFile = $this->getMock( - 'Magento\Core\Model\Theme\Customization\File', array('getContent'), array(), '', false + 'Magento\View\Design\Theme\Customization\File\Css', array('getContent'), array(), '', false ); $customization->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php index 0eea369a3fd..a07306dea0b 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php @@ -130,12 +130,12 @@ class JsTest extends \PHPUnit_Framework_TestCase */ public function testGetJsFiles() { - $customization = $this->getMock('Magento\Core\Model\Theme\Customization', array(), array(), '', false); + $customization = $this->getMock('Magento\View\Design\Theme\Customization', array(), array(), '', false); $this->_theme->expects($this->any())->method('getCustomization')->will($this->returnValue($customization)); $customization->expects($this->once()) ->method('getFilesByType') - ->with(\Magento\Core\Model\Theme\Customization\File\Js::TYPE) + ->with(\Magento\View\Design\Theme\Customization\File\Js::TYPE) ->will($this->returnValue(array())); $helperMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->_model->expects($this->once())->method('helper')->with('Magento\Core\Helper\Data') diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php index 012d50a7f48..5a1fac02b53 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php @@ -111,7 +111,7 @@ class EditorTest extends \PHPUnit_Framework_TestCase $themeCollectionMock->expects($this->once()) ->method('addTypeFilter') - ->with(\Magento\Core\Model\Theme::TYPE_VIRTUAL) + ->with(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) ->will($this->returnValue($themeCollectionMock)); $themeCollectionMock->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php index 5fe57a6e8f1..175e5dc6f72 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php @@ -68,17 +68,17 @@ class StateTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\Backend\Model\Session|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject */ protected $_backendSession; /** - * @var \Magento\Core\Model\Layout\Factory|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Core\Model\Layout\Factory|\PHPUnit_Framework_MockObject_MockObject */ protected $_layoutFactory; /** - * @var \Magento\DesignEditor\Model\Url\Factory|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\DesignEditor\Model\Url\Factory|\PHPUnit_Framework_MockObject_MockObject */ protected $_urlModelFactory; @@ -88,7 +88,7 @@ class StateTest extends \PHPUnit_Framework_TestCase protected $_cacheStateMock; /** - * @var \Magento\DesignEditor\Helper\Data|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\DesignEditor\Helper\Data|\PHPUnit_Framework_MockObject_MockObject */ protected $_dataHelper; @@ -98,7 +98,7 @@ class StateTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\Core\Model\App|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Core\Model\App|\PHPUnit_Framework_MockObject_MockObject */ protected $_application; @@ -129,7 +129,7 @@ class StateTest extends \PHPUnit_Framework_TestCase $this->_urlModelFactory = $this->getMock('Magento\DesignEditor\Model\Url\Factory', array('replaceClassName'), array(), '', false ); - $this->_cacheStateMock = $this->getMockBuilder('Magento\Core\Model\Cache\StateInterface') + $this->_cacheStateMock = $this->getMockBuilder('Magento\App\Cache\StateInterface') ->disableOriginalConstructor()->getMock(); $this->_dataHelper = $this->getMock('Magento\DesignEditor\Helper\Data', array('getDisabledCacheTypes'), @@ -142,7 +142,10 @@ class StateTest extends \PHPUnit_Framework_TestCase $storeManager = $this->getMock('Magento\Core\Model\StoreManager', array('setConfig'), array(), '', false); $storeManager->expects($this->any()) ->method('setConfig') - ->with($this->equalTo(\Magento\Core\Model\View\Design::XML_PATH_THEME_ID), $this->equalTo(self::THEME_ID)) + ->with( + $this->equalTo(\Magento\Core\Model\View\Design::XML_PATH_THEME_ID), + $this->equalTo(self::THEME_ID) + ) ->will($this->returnSelf()); $this->_application->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php index fd839b93ef8..c8c92420c87 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php @@ -97,7 +97,7 @@ class ContextTest extends \PHPUnit_Framework_TestCase $this->_theme->expects($this->any()) ->method('getType') - ->will($this->returnValue(\Magento\Core\Model\Theme::TYPE_PHYSICAL)); + ->will($this->returnValue(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL)); $this->assertEquals($this->_model, $this->_model->setEditableThemeById(self::THEME_ID)); } @@ -119,7 +119,7 @@ class ContextTest extends \PHPUnit_Framework_TestCase $this->_theme->expects($this->any()) ->method('getType') - ->will($this->returnValue(\Magento\Core\Model\Theme::TYPE_STAGING)); + ->will($this->returnValue(\Magento\View\Design\ThemeInterface::TYPE_STAGING)); $this->_model->setEditableThemeById(self::THEME_ID); } @@ -174,7 +174,7 @@ class ContextTest extends \PHPUnit_Framework_TestCase $this->_theme->expects($this->atLeastOnce()) ->method('getDomainModel') - ->with($this->equalTo(\Magento\Core\Model\Theme::TYPE_VIRTUAL)) + ->with($this->equalTo(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL)) ->will($this->returnValue($themeObj)); $this->assertEquals($themeObj, $this->_model->getStagingTheme()); diff --git a/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php index ce3ae5e03e7..83597e142cd 100644 --- a/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php @@ -56,7 +56,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $context = $this->getMock('Magento\Core\Helper\Context', array(), array(), '', false); - $configCacheType = $this->getMock('Magento\Core\Model\Cache\Type\Config', array(), array(), '', false); + $configCacheType = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); $this->_countryCollection = $this->getMock('Magento\Directory\Model\Resource\Country\Collection', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php index 78b27d160ef..6c32beb739d 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php @@ -60,7 +60,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->getMock('Magento\Catalog\Model\ProductFactory', array(), array(), '', false), $this->getMock('Magento\Downloadable\Model\Link\Purchased\ItemFactory', array(), array(), '', false), $this->getMock('Magento\Checkout\Model\Session', array(), array(), '', false), - $itemsFactory + $itemsFactory, + $this->getMock('\Magento\Object\Copy', array(), array(), '', false) ); } diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php index 773943fd472..9e18c097473 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php @@ -68,7 +68,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_entityType = $this->getMock('Magento\Eav\Model\Entity\Type', array(), array(), '', false); $this->_readerMock = $this->getMock('Magento\Eav\Model\Entity\Attribute\Config\Reader', array(), array(), '', false); - $this->_cacheMock = $this->getMock('Magento\Core\Model\Cache\Type\Config', array(), array(), '', false); + $this->_cacheMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); $this->_cacheId = 'eav_attributes'; $this->_cacheMock->expects($this->once()) ->method('load') diff --git a/dev/tests/unit/testsuite/Magento/Image/AdapterFactoryTest.php b/dev/tests/unit/testsuite/Magento/Image/AdapterFactoryTest.php new file mode 100644 index 00000000000..6d50d0031be --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Image/AdapterFactoryTest.php @@ -0,0 +1,163 @@ +<?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 Magento + * @package Magento_Core + * @subpackage unit_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Image; + +class AdapterFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Core\Model\Image\Adapter\Config|\PHPUnit_Framework_MockObject_MockObject + */ + protected $configMock; + + public function setUp() + { + $this->configMock = $this->getMock( + 'Magento\Image\Adapter\ConfigInterface', array('getAdapterAlias', 'getAdapters'), array(), '', false + ); + + $this->configMock->expects($this->once()) + ->method('getAdapters') + ->will($this->returnValue(array( + 'GD2' => array('class' => 'Magento\Image\Adapter\Gd2'), + 'IMAGEMAGICK' => array('class' => 'Magento\Image\Adapter\ImageMagick'), + 'wrongInstance' => array('class' => 'stdClass'), + 'test' => array(), + ))); + } + + /** + * @dataProvider createDataProvider + * @param string $alias + * @param string $class + */ + public function testCreate($alias, $class) + { + $objectManagerMock = $this->getMock('Magento\ObjectManager\ObjectManager', array('create'), array(), '', false); + $imageAdapterMock = $this->getMock($class, array('checkDependencies'), array(), '', false); + $imageAdapterMock->expects($this->once()) + ->method('checkDependencies'); + + $objectManagerMock->expects($this->once()) + ->method('create') + ->with($class) + ->will($this->returnValue($imageAdapterMock)); + + $adapterFactory = new AdapterFactory($objectManagerMock, $this->configMock); + $imageAdapter = $adapterFactory->create($alias); + $this->assertInstanceOf($class, $imageAdapter); + } + + /** + * @see self::testCreate() + * @return array + */ + public function createDataProvider() + { + return array( + array('GD2', 'Magento\Image\Adapter\Gd2'), + array('IMAGEMAGICK', 'Magento\Image\Adapter\ImageMagick'), + ); + } + + /** + * @covers \Magento\Image\AdapterFactory::create + */ + public function testCreateWithoutName() + { + $adapterAlias = 'IMAGEMAGICK'; + $adapterClass = 'Magento\Image\Adapter\ImageMagick'; + + $this->configMock->expects($this->once()) + ->method('getAdapterAlias') + ->will($this->returnValue($adapterAlias)); + + $objectManagerMock = $this->getMock('Magento\ObjectManager\ObjectManager', array('create'), array(), '', false); + $imageAdapterMock = $this->getMock($adapterClass, array('checkDependencies'), array(), '', false); + $imageAdapterMock->expects($this->once()) + ->method('checkDependencies'); + + $objectManagerMock->expects($this->once()) + ->method('create') + ->with($adapterClass) + ->will($this->returnValue($imageAdapterMock)); + + $adapterFactory = new AdapterFactory($objectManagerMock, $this->configMock); + $imageAdapter = $adapterFactory->create(); + $this->assertInstanceOf($adapterClass, $imageAdapter); + } + + /** + * @covers \Magento\Image\AdapterFactory::create + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Image adapter is not selected. + */ + public function testInvalidArgumentException() + { + $this->configMock->expects($this->once()) + ->method('getAdapterAlias') + ->will($this->returnValue('')); + $objectManagerMock = $this->getMock('Magento\ObjectManager\ObjectManager', array('create'), array(), '', false); + $adapterFactory = new AdapterFactory($objectManagerMock, $this->configMock); + $adapterFactory->create(); + } + + /** + * @covers \Magento\Image\AdapterFactory::create + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Image adapter for 'test' is not setup. + */ + public function testNonAdapterClass() + { + $alias = 'test'; + $objectManagerMock = $this->getMock('Magento\ObjectManager\ObjectManager', array('create'), array(), '', false); + + $adapterFactory = new AdapterFactory($objectManagerMock, $this->configMock); + $adapterFactory->create($alias); + } + + /** + * @covers \Magento\Image\AdapterFactory::create + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage stdClass is not instance of \Magento\Image\Adapter\AdapterInterface + */ + public function testWrongInstance() + { + $alias = 'wrongInstance'; + $class = 'stdClass'; + $objectManagerMock = $this->getMock('Magento\ObjectManager\ObjectManager', array('create'), array(), '', false); + $imageAdapterMock = $this->getMock($class, array('checkDependencies'), array(), '', false); + + $objectManagerMock->expects($this->once()) + ->method('create') + ->with($class) + ->will($this->returnValue($imageAdapterMock)); + + $adapterFactory = new AdapterFactory($objectManagerMock, $this->configMock); + $adapterFactory->create($alias); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php new file mode 100644 index 00000000000..4bada97cadc --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php @@ -0,0 +1,203 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Helper\Oauth; + +class ConsumerTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Core\Model\StoreManagerInterface */ + protected $_storeManagerMock; + + /** @var \Magento\Integration\Model\Oauth\Consumer\Factory */ + protected $_consumerFactory; + + /** @var \Magento\Integration\Model\Oauth\Consumer */ + protected $_consumerMock; + + /** @var \Magento\HTTP\ZendClient */ + protected $_httpClientMock; + + /** @var \Magento\Integration\Model\Oauth\Token\Factory */ + protected $_tokenFactory; + + /** @var \Magento\Integration\Model\Oauth\Token */ + protected $_tokenMock; + + /** @var \Magento\Core\Model\Store */ + protected $_storeMock; + + /** @var \Magento\Integration\Helper\Oauth\Data */ + protected $_dataHelper; + + /** @var \Magento\Integration\Helper\Oauth\Consumer */ + protected $_consumerHelper; + + /** @var \Magento\Logger */ + protected $_loggerMock; + + protected function setUp() + { + $this->_consumerFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\Consumer\Factory') + ->disableOriginalConstructor() + ->getMock(); + $this->_consumerMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Consumer') + ->disableOriginalConstructor() + ->getMock(); + $this->_consumerFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->_consumerMock)); + + $this->_tokenFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token\Factory') + ->disableOriginalConstructor() + ->getMock(); + $this->_tokenMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token') + ->disableOriginalConstructor() + ->getMock(); + $this->_tokenFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->_tokenMock)); + + $this->_storeManagerMock = $this->getMockBuilder('Magento\Core\Model\StoreManagerInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->_storeMock = $this->getMockBuilder('Magento\Core\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + $this->_storeManagerMock->expects($this->any()) + ->method('getStore') + ->will($this->returnValue($this->_storeMock)); + + $this->_dataHelper = $this->getMockBuilder('Magento\Integration\Helper\Oauth\Data') + ->disableOriginalConstructor() + ->getMock(); + $this->_httpClientMock = $this->getMockBuilder('Magento\HTTP\ZendClient') + ->disableOriginalConstructor() + ->getMock(); + $this->_loggerMock = $this->getMockBuilder('Magento\Logger') + ->disableOriginalConstructor() + ->setMethods(array('logException')) + ->getMock(); + + $this->_consumerHelper = new \Magento\Integration\Helper\Oauth\Consumer( + $this->_storeManagerMock, + $this->_consumerFactory, + $this->_tokenFactory, + $this->_dataHelper, + $this->_httpClientMock, + $this->_loggerMock + ); + } + + protected function tearDown() + { + unset($this->_storeManagerMock); + unset($this->_consumerFactory); + unset($this->_tokenFactory); + unset($this->_dataHelper); + unset($this->_httpClientMock); + unset($this->_loggerMock); + unset($this->_consumerHelper); + } + + public function testCreateConsumer() + { + $key = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY); + $secret = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_SECRET); + + $consumerData = array( + 'name' => 'Integration Name', + 'key' => $key, + 'secret' => $secret + ); + + $this->_consumerMock->expects($this->once()) + ->method('save') + ->will($this->returnSelf()); + $this->_consumerMock->expects($this->once()) + ->method('getData') + ->will($this->returnValue($consumerData)); + + $responseData = $this->_consumerHelper->createConsumer($consumerData); + + $this->assertEquals($key, $responseData['key'], 'Checking Oauth Consumer Key'); + $this->assertEquals($secret, $responseData['secret'], 'Checking Oauth Consumer Secret'); + } + + public function testPostToConsumer() + { + $consumerId = 1; + + $key = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY); + $secret = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_SECRET); + $oauthVerifier = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_VERIFIER); + + $consumerData = array( + 'entity_id' => $consumerId, + 'key' => $key, + 'secret' => $secret + ); + + $this->_consumerMock->expects($this->once()) + ->method('load') + ->with($this->equalTo($consumerId)) + ->will($this->returnSelf()); + $this->_consumerMock->expects($this->once()) + ->method('getId') + ->will($this->returnValue($consumerId)); + $this->_consumerMock->expects($this->once()) + ->method('getData') + ->will($this->returnValue($consumerData)); + $this->_httpClientMock->expects($this->once()) + ->method('setUri') + ->with('http://www.magento.com') + ->will($this->returnSelf()); + $this->_httpClientMock->expects($this->once()) + ->method('setParameterPost') + ->will($this->returnSelf()); + $this->_tokenMock->expects($this->once()) + ->method('createVerifierToken') + ->with($consumerId) + ->will($this->returnSelf()); + $this->_tokenMock->expects($this->any()) + ->method('getVerifier') + ->will($this->returnValue($oauthVerifier)); + $this->_dataHelper->expects($this->once()) + ->method('getConsumerPostMaxRedirects') + ->will($this->returnValue(5)); + $this->_dataHelper->expects($this->once()) + ->method('getConsumerPostTimeout') + ->will($this->returnValue(120)); + + $verifier = $this->_consumerHelper->postToConsumer($consumerId, 'http://www.magento.com'); + + $this->assertEquals($oauthVerifier, $verifier, 'Checking Oauth Verifier'); + } + + private function _generateRandomString($length) + { + return substr( + str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 5)), 0, $length + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php new file mode 100644 index 00000000000..13289b349bb --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php @@ -0,0 +1,111 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Helper\Oauth; + +class DataTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Core\Model\Store\Config */ + protected $_storeConfigMock; + + /** @var \Magento\Integration\Helper\Oauth\Data */ + protected $_dataHelper; + + protected function setUp() + { + $this->_storeConfigMock = $this->getMockBuilder('Magento\Core\Model\Store\Config') + ->disableOriginalConstructor() + ->getMock(); + + $this->_dataHelper = new \Magento\Integration\Helper\Oauth\Data($this->_storeConfigMock); + } + + protected function tearDown() + { + unset($this->_storeConfigMock); + unset($this->_dataHelper); + } + + public function testIsCleanupProbabilityZero() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(0)); + $this->assertFalse($this->_dataHelper->isCleanupProbability()); + } + + public function testIsCleanupProbabilityRandomOne() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(1)); + $this->assertTrue($this->_dataHelper->isCleanupProbability()); + } + + public function testGetCleanupExpirationPeriodZero() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(0)); + $this->assertEquals( + \Magento\Integration\Helper\Oauth\Data::CLEANUP_EXPIRATION_PERIOD_DEFAULT, + $this->_dataHelper->getCleanupExpirationPeriod() + ); + } + + public function testGetCleanupExpirationPeriodNonZero() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(10)); + $this->assertEquals(10, $this->_dataHelper->getCleanupExpirationPeriod()); + } + + public function testConsumerPostMaxRedirectsZero() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(0)); + $this->assertEquals(0, $this->_dataHelper->getConsumerPostMaxRedirects()); + } + + public function testConsumerPostMaxRedirectsNonZero() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(10)); + $this->assertEquals(10, $this->_dataHelper->getConsumerPostMaxRedirects()); + } + + public function testGetConsumerPostTimeoutZero() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(0)); + $this->assertEquals( + \Magento\Integration\Helper\Oauth\Data::CONSUMER_POST_TIMEOUT_DEFAULT, + $this->_dataHelper->getConsumerPostTimeout() + ); + } + + public function testGetConsumerPostTimeoutNonZero() + { + $this->_storeConfigMock->expects($this->once())->method('getConfig') + ->will($this->returnValue(10)); + $this->assertEquals(10, $this->_dataHelper->getConsumerPostTimeout()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/OauthTest.php b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/OauthTest.php new file mode 100644 index 00000000000..3aa94fe4833 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/OauthTest.php @@ -0,0 +1,70 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Integration\Helper\Oauth; + +class OauthTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Oauth\Helper\Oauth */ + protected $_oauthHelper; + + protected function setUp() + { + $this->_oauthHelper = new \Magento\Oauth\Helper\Oauth(new \Magento\Math\Random); + } + + protected function tearDown() + { + unset($this->_oauthHelper); + } + + public function testGenerateToken() + { + $token = $this->_oauthHelper->generateToken(); + $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Helper\Oauth::LENGTH_TOKEN); + } + + public function testGenerateTokenSecret() + { + $token = $this->_oauthHelper->generateTokenSecret(); + $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_SECRET); + } + + public function testGenerateVerifier() + { + $token = $this->_oauthHelper->generateVerifier(); + $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_VERIFIER); + } + + public function testGenerateConsumerKey() + { + $token = $this->_oauthHelper->generateConsumerKey(); + $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY); + } + + public function testGenerateConsumerSecret() + { + $token = $this->_oauthHelper->generateConsumerSecret(); + $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_SECRET); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Oauth/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/RequestTest.php similarity index 69% rename from dev/tests/unit/testsuite/Magento/Oauth/Helper/DataTest.php rename to dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/RequestTest.php index c2c0996e0e9..db6e02f72b9 100644 --- a/dev/tests/unit/testsuite/Magento/Oauth/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/RequestTest.php @@ -23,31 +23,20 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Oauth\Helper; +namespace Magento\Integration\Helper\Oauth; -class DataTest extends \PHPUnit_Framework_TestCase +class RequestTest extends \PHPUnit_Framework_TestCase { - /** @var \Magento\Core\Helper\Context */ - protected $_coreContextMock; - - /** @var \Magento\Oauth\Helper\Data */ + /** @var \Magento\Oauth\Helper\Request */ protected $_oauthHelper; protected function setUp() { - $this->_coreContextMock = $this->getMockBuilder('Magento\Core\Helper\Context') - ->disableOriginalConstructor() - ->getMock(); - - - $this->_oauthHelper = new \Magento\Oauth\Helper\Data( - $this->_coreContextMock - ); + $this->_oauthHelper = new \Magento\Oauth\Helper\Request(); } protected function tearDown() { - unset($this->_coreContextMock); unset($this->_oauthHelper); } @@ -66,29 +55,29 @@ class DataTest extends \PHPUnit_Framework_TestCase { return [ [ - new \Magento\Oauth\Exception('msg', \Magento\Oauth\Service\OauthV1Interface::ERR_VERSION_REJECTED), - new \Magento\App\Response\Http(), - ['version_rejected&message=msg', \Magento\Oauth\Helper\Data::HTTP_BAD_REQUEST] + new \Magento\Oauth\Exception('msg', \Magento\Oauth\OauthInterface::ERR_VERSION_REJECTED), + new \Zend_Controller_Response_Http(), + ['version_rejected&message=msg', \Magento\Oauth\Helper\Request::HTTP_BAD_REQUEST] ], [ new \Magento\Oauth\Exception('msg', 255), - new \Magento\App\Response\Http(), - ['unknown_problem&code=255&message=msg', \Magento\Oauth\Helper\Data::HTTP_INTERNAL_ERROR] + new \Zend_Controller_Response_Http(), + ['unknown_problem&code=255&message=msg', \Magento\Oauth\Helper\Request::HTTP_INTERNAL_ERROR] ], [ - new \Magento\Oauth\Exception('param', \Magento\Oauth\Service\OauthV1Interface::ERR_PARAMETER_ABSENT), - new \Magento\App\Response\Http(), - ['parameter_absent&oauth_parameters_absent=param', \Magento\Oauth\Helper\Data::HTTP_BAD_REQUEST] + new \Magento\Oauth\Exception('param', \Magento\Oauth\OauthInterface::ERR_PARAMETER_ABSENT), + new \Zend_Controller_Response_Http(), + ['parameter_absent&oauth_parameters_absent=param', \Magento\Oauth\Helper\Request::HTTP_BAD_REQUEST] ], [ new \Exception('msg'), - new \Magento\App\Response\Http(), - ['internal_error&message=msg', \Magento\Oauth\Helper\Data::HTTP_INTERNAL_ERROR] + new \Zend_Controller_Response_Http(), + ['internal_error&message=msg', \Magento\Oauth\Helper\Request::HTTP_INTERNAL_ERROR] ], [ new \Exception(), - new \Magento\App\Response\Http(), - ['internal_error&message=empty_message', \Magento\Oauth\Helper\Data::HTTP_INTERNAL_ERROR] + new \Zend_Controller_Response_Http(), + ['internal_error&message=empty_message', \Magento\Oauth\Helper\Request::HTTP_INTERNAL_ERROR] ], ]; } diff --git a/dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php b/dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php new file mode 100644 index 00000000000..1ab78a52ff6 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php @@ -0,0 +1,840 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Integration\Oauth; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class OauthTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Integration\Model\Oauth\Consumer\Factory */ + private $_consumerFactory; + + /** @var \Magento\Integration\Model\Oauth\Nonce\Factory */ + private $_nonceFactory; + + /** @var \Magento\Integration\Model\Oauth\Token\Factory */ + private $_tokenFactory; + + /** @var \Magento\Integration\Model\Oauth\Consumer */ + private $_consumerMock; + + /** @var \Magento\Integration\Model\Oauth\Token */ + private $_tokenMock; + + /** @var \Magento\Oauth\Helper\Oauth */ + private $_oauthHelperMock; + + /** @var \Magento\Integration\Helper\Oauth\Data */ + private $_dataHelperMock; + + /** @var \Magento\Oauth\Oauth */ + private $_oauth; + + /** @var \Zend_Oauth_Http_Utility */ + private $_httpUtilityMock; + + /** @var \Magento\Core\Model\Date */ + private $_dateMock; + + private $_oauthToken; + private $_oauthSecret; + private $_oauthVerifier; + + const CONSUMER_ID = 1; + const REQUEST_URL = 'http://magento.ll'; + + public function setUp() + { + $this->_consumerFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\Consumer\Factory') + ->disableOriginalConstructor() + ->getMock(); + $this->_consumerMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Consumer') + ->disableOriginalConstructor() + // Mocking magic getCreatedAt() + ->setMethods( + [ + 'getCreatedAt', + 'loadByKey', + 'load', + 'getId', + 'getSecret', + 'getCallbackUrl', + 'save', + 'getData', + '__wakeup' + ] + )->getMock(); + $this->_consumerFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->_consumerMock)); + + $this->_nonceFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\Nonce\Factory') + ->disableOriginalConstructor() + ->getMock(); + + $this->_tokenFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token\Factory') + ->disableOriginalConstructor() + ->getMock(); + $this->_tokenMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Token') + ->disableOriginalConstructor() + ->setMethods( + [ + 'getId', + 'load', + 'getType', + 'createRequestToken', + 'getToken', + 'getSecret', + 'createVerifierToken', + 'getVerifier', + 'getConsumerId', + 'convertToAccess', + 'getRevoked', + '__wakeup' + ] + )->getMock(); + $this->_tokenFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->_tokenMock)); + + $this->_oauthHelperMock = $this->getMockBuilder('Magento\Oauth\Helper\Oauth') + ->setConstructorArgs(array(new \Magento\Math\Random())) + ->getMock(); + + $this->_dataHelperMock = $this->getMockBuilder('Magento\Integration\Helper\Oauth\Data') + ->disableOriginalConstructor() + ->getMock(); + + $this->_httpUtilityMock = $this->getMockBuilder('Zend_Oauth_Http_Utility') + ->setMethods(array('sign')) + ->getMock(); + $this->_dateMock = $this->getMockBuilder('Magento\Core\Model\Date') + ->disableOriginalConstructor() + ->getMock(); + + $nonceGenerator = new \Magento\Integration\Model\Oauth\Nonce\Generator( + $this->_oauthHelperMock, + $this->_nonceFactory, + $this->_dateMock + ); + + $tokenProvider = new \Magento\Integration\Model\Oauth\Token\Provider( + $this->_consumerFactory, + $this->_tokenFactory, + $this->_dataHelperMock, + $this->_dateMock + ); + + $this->_oauth = new \Magento\Oauth\Oauth( + $this->_oauthHelperMock, + $nonceGenerator, + $tokenProvider, + $this->_httpUtilityMock + ); + + $this->_oauthToken = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN); + $this->_oauthSecret = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_SECRET); + $this->_oauthVerifier = $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_VERIFIER); + } + + public function tearDown() + { + unset($this->_consumerFactory); + unset($this->_nonceFactory); + unset($this->_tokenFactory); + unset($this->_oauthHelperMock); + unset($this->_dataHelperMock); + unset($this->_httpUtilityMock); + unset($this->_dateMock); + unset($this->_oauth); + } + + protected function _getRequestTokenParams($amendments = array()) + { + $requiredParams = [ + 'oauth_version' => '1.0', + 'oauth_consumer_key' => $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY), + 'oauth_nonce' => '', + 'oauth_timestamp' => time(), + 'oauth_signature_method' => \Magento\Oauth\OauthInterface::SIGNATURE_SHA1, + 'oauth_signature' => 'invalid_signature' + ]; + + return array_merge($requiredParams, $amendments); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_VERSION_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 1 + */ + public function testGetRequestTokenVersionRejected() + { + $this->_oauth->getRequestToken($this->_getRequestTokenParams(['oauth_version' => '2.0']), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_CONSUMER_KEY_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 8 + */ + public function testGetRequestTokenConsumerKeyRejected() + { + $this->_oauth->getRequestToken( + $this->_getRequestTokenParams(['oauth_consumer_key' => 'wrong_key_length']), self::REQUEST_URL + ); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_CONSUMER_KEY_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 8 + */ + public function testGetRequestTokenConsumerKeyNotFound() + { + $this->_consumerMock + ->expects($this->once()) + ->method('loadByKey') + ->will($this->returnValue(new \Magento\Object())); + + $this->_oauth->getRequestToken($this->_getRequestTokenParams(), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_CONSUMER_KEY_INVALID + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 17 + */ + public function testGetRequestTokenOutdatedConsumerKey() + { + $this->_setupConsumer(); + $this->_dateMock->expects($this->any())->method('timestamp')->will($this->returnValue(9999999999)); + $this->_dataHelperMock->expects($this->once()) + ->method('getConsumerExpirationPeriod')->will($this->returnValue(0)); + + $this->_oauth->getRequestToken($this->_getRequestTokenParams(), self::REQUEST_URL); + } + + protected function _setupConsumer($isLoadable = true) + { + $this->_consumerMock + ->expects($this->any()) + ->method('loadByKey') + ->will($this->returnSelf()); + + $this->_consumerMock + ->expects($this->any()) + ->method('getCreatedAt') + ->will($this->returnValue(date('c', strtotime('-1 day')))); + + if ($isLoadable) { + $this->_consumerMock->expects($this->any())->method('load')->will($this->returnSelf()); + } else { + $this->_consumerMock->expects($this->any())->method('load') + ->will($this->returnValue(new \Magento\Object())); + } + + $this->_consumerMock->expects($this->any())->method('getId')->will($this->returnValue(1)); + $this->_consumerMock->expects($this->any())->method('getSecret')->will($this->returnValue('consumer_secret')); + $this->_consumerMock->expects($this->any())->method('getCallbackUrl')->will($this->returnValue('callback_url')); + } + + protected function _makeValidExpirationPeriod() + { + $this->_dateMock->expects($this->any())->method('timestamp')->will($this->returnValue(0)); + $this->_dataHelperMock->expects($this->once()) + ->method('getConsumerExpirationPeriod')->will($this->returnValue(300)); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TIMESTAMP_REFUSED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 4 + * @dataProvider dataProviderForGetRequestTokenNonceTimestampRefusedTest + */ + public function testGetRequestTokenOauthTimestampRefused($timestamp) + { + $this->_setupConsumer(); + $this->_makeValidExpirationPeriod(); + + $this->_oauth->getRequestToken( + $this->_getRequestTokenParams(['oauth_timestamp' => $timestamp]), self::REQUEST_URL + ); + } + + public function dataProviderForGetRequestTokenNonceTimestampRefusedTest() + { + return [[0], [time() + \Magento\Integration\Model\Oauth\Nonce\Generator::TIME_DEVIATION * 2]]; + } + + protected function _setupNonce($isUsed = false, $timestamp = 0) + { + $nonceMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Nonce') + ->disableOriginalConstructor() + ->setMethods( + [ + 'loadByCompositeKey', + 'getNonce', + 'getTimestamp', + 'setNonce', + 'setConsumerId', + 'setTimestamp', + 'save', + '__wakeup' + ] + )->getMock(); + + $nonceMock->expects($this->any())->method('getNonce')->will($this->returnValue($isUsed)); + $nonceMock->expects($this->any())->method('loadByCompositeKey')->will($this->returnSelf()); + $nonceMock->expects($this->any())->method('getTimestamp')->will($this->returnValue($timestamp)); + $nonceMock->expects($this->any())->method('setNonce')->will($this->returnSelf()); + $nonceMock->expects($this->any())->method('setConsumerId')->will($this->returnSelf()); + $nonceMock->expects($this->any())->method('setTimestamp')->will($this->returnSelf()); + $nonceMock->expects($this->any())->method('save')->will($this->returnSelf()); + $this->_nonceFactory->expects($this->any())->method('create')->will($this->returnValue($nonceMock)); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_NONCE_USED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 5 + */ + public function testGetRequestTokenNonceAlreadyUsed() + { + $this->_setupConsumer(); + $this->_makeValidExpirationPeriod(); + $this->_setupNonce(true); + + $this->_oauth->getRequestToken($this->_getRequestTokenParams(), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_CONSUMER_KEY_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 8 + */ + public function testGetRequestTokenNoConsumer() + { + $this->_consumerMock + ->expects($this->any()) + ->method('loadByKey') + ->will($this->returnValue(new \Magento\Object)); + + $this->_oauth->getRequestToken($this->_getRequestTokenParams(), self::REQUEST_URL); + } + + protected function _setupToken( + $doesExist = true, + $type = \Magento\Integration\Model\Oauth\Token::TYPE_VERIFIER, + $consumerId = self::CONSUMER_ID, + $verifier = null, + $isRevoked = false + ) { + $this->_tokenMock + ->expects($this->any()) + ->method('getId') + ->will($this->returnValue($doesExist ? self::CONSUMER_ID : null)); + + $verifier = $verifier ? : $this->_oauthVerifier; + + $this->_tokenMock->expects($this->any())->method('load')->will($this->returnSelf()); + $this->_tokenMock->expects($this->any())->method('getType')->will($this->returnValue($type)); + $this->_tokenMock->expects($this->any())->method('createRequestToken')->will($this->returnSelf()); + $this->_tokenMock->expects($this->any())->method('getToken')->will($this->returnValue($this->_oauthToken)); + $this->_tokenMock->expects($this->any())->method('getSecret')->will($this->returnValue($this->_oauthSecret)); + $this->_tokenMock->expects($this->any())->method('getConsumerId')->will($this->returnValue($consumerId)); + $this->_tokenMock->expects($this->any())->method('getVerifier')->will($this->returnValue($verifier)); + $this->_tokenMock->expects($this->any())->method('convertToAccess')->will($this->returnSelf()); + $this->_tokenMock->expects($this->any())->method('getRevoked')->will($this->returnValue($isRevoked)); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testGetRequestTokenTokenRejected() + { + $this->_setupConsumer(); + $this->_makeValidExpirationPeriod(); + $this->_setupNonce(); + $this->_setupToken(false); + + $signature = 'valid_signature'; + $this->_httpUtilityMock->expects($this->any())->method('sign')->will($this->returnValue($signature)); + + $this->_oauth->getRequestToken( + $this->_getRequestTokenParams(['oauth_signature' => $signature]), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testGetRequestTokenTokenRejectedByType() + { + $this->_setupConsumer(); + $this->_makeValidExpirationPeriod(); + $this->_setupNonce(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_REQUEST); // wrong type + + $signature = 'valid_signature'; + $this->_httpUtilityMock->expects($this->any())->method('sign')->will($this->returnValue($signature)); + + $this->_oauth->getRequestToken( + $this->_getRequestTokenParams(['oauth_signature' => $signature]), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_SIGNATURE_METHOD_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 6 + */ + public function testGetRequestTokenSignatureMethodRejected() + { + $this->_setupConsumer(); + $this->_makeValidExpirationPeriod(); + $this->_setupNonce(); + $this->_setupToken(); + + $this->_oauth->getRequestToken( + $this->_getRequestTokenParams(['oauth_signature_method' => 'wrong_method']), self::REQUEST_URL + ); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_SIGNATURE_INVALID + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 7 + */ + public function testGetRequestTokenInvalidSignature() + { + $this->_setupConsumer(); + $this->_makeValidExpirationPeriod(); + $this->_setupNonce(); + $this->_setupToken(); + + $this->_oauth->getRequestToken( + $this->_getRequestTokenParams(['oauth_signature' => 'invalid_signature']), self::REQUEST_URL + ); + } + + public function testGetRequestToken() + { + $this->_setupConsumer(); + $this->_makeValidExpirationPeriod(); + $this->_setupNonce(); + $this->_setupToken(); + + $signature = 'valid_signature'; + $this->_httpUtilityMock->expects($this->any())->method('sign')->will($this->returnValue($signature)); + + $requestToken = $this->_oauth->getRequestToken( + $this->_getRequestTokenParams(['oauth_signature' => $signature]), self::REQUEST_URL + ); + + $this->assertEquals( + ['oauth_token' => $this->_oauthToken, 'oauth_token_secret' => $this->_oauthSecret], + $requestToken + ); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_VERSION_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 1 + */ + public function testGetAccessTokenVersionRejected() + { + $this->_oauth->getAccessToken( + $this->_getAccessTokenRequiredParams(['oauth_version' => '0.0']), self::REQUEST_URL + ); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_PARAMETER_ABSENT + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 2 + */ + public function testGetAccessTokenParameterAbsent() + { + $this->_oauth->getAccessToken( + [ + 'oauth_version' => '1.0', + 'oauth_consumer_key' => '', + 'oauth_signature' => '', + 'oauth_signature_method' => '', + 'oauth_nonce' => '', + 'oauth_timestamp' => '', + 'oauth_token' => '', + // oauth_verifier missing + ], + self::REQUEST_URL + ); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testGetAccessTokenTokenRejected() + { + $this->_oauth->getAccessToken( + $this->_getAccessTokenRequiredParams(['oauth_token' => 'invalid_token']), self::REQUEST_URL + ); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_SIGNATURE_METHOD_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 6 + */ + public function testGetAccessTokenSignatureMethodRejected() + { + $this->_oauth->getAccessToken( + $this->_getAccessTokenRequiredParams(['oauth_signature_method' => 'invalid_method']), self::REQUEST_URL + ); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_USED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 9 + */ + public function testGetAccessTokenTokenUsed() + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_VERIFIER); // Wrong type + + $this->_oauth->getAccessToken($this->_getAccessTokenRequiredParams(), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testGetAccessTokenConsumerIdDoesntMatch() + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_REQUEST, null); + + $this->_oauth->getAccessToken($this->_getAccessTokenRequiredParams(), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_VERIFIER_INVALID + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 13 + * @dataProvider dataProviderForGetAccessTokenVerifierInvalidTest + */ + public function testGetAccessTokenVerifierInvalid($verifier, $verifierFromToken) + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken( + true, \Magento\Integration\Model\Oauth\Token::TYPE_REQUEST, self::CONSUMER_ID, $verifierFromToken); + + $this->_oauth->getAccessToken( + $this->_getAccessTokenRequiredParams(['oauth_verifier' => $verifier]), self::REQUEST_URL + ); + } + + public function dataProviderForGetAccessTokenVerifierInvalidTest() + { + return [ + [3, 3], // Verifier is not a string + ['wrong_length', 'wrong_length'], + ['verifier', 'doesnt match'] + ]; + } + + public function testGetAccessToken() + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_REQUEST); + + $token = $this->_oauth->getAccessToken($this->_getAccessTokenRequiredParams(), self::REQUEST_URL); + $this->assertEquals(['oauth_token' => $this->_oauthToken, 'oauth_token_secret' => $this->_oauthSecret], $token); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testValidateAccessTokenRequestTokenRejected() + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_ACCESS, null); + + $this->_oauth->validateAccessTokenRequest($this->_getAccessTokenRequiredParams(), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testValidateAccessTokenRequestTokenRejectedByType() + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_REQUEST); + + $this->_oauth->validateAccessTokenRequest($this->_getAccessTokenRequiredParams(), self::REQUEST_URL); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REVOKED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 11 + */ + public function testValidateAccessTokenRequestTokenRevoked() + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken( + true, + \Magento\Integration\Model\Oauth\Token::TYPE_ACCESS, + self::CONSUMER_ID, + $this->_oauthVerifier, + true + ); + + $this->_oauth->validateAccessTokenRequest($this->_getAccessTokenRequiredParams(), self::REQUEST_URL); + } + + public function testValidateAccessTokenRequest() + { + $this->_setupConsumer(); + $this->_setupNonce(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_ACCESS); + $requiredParams = $this->_getAccessTokenRequiredParams(); + $this->assertTrue($this->_oauth->validateAccessTokenRequest($requiredParams, self::REQUEST_URL)); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testValidateAccessTokenRejectedByType() + { + $this->_setupConsumer(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_REQUEST); + + $this->_oauth->validateAccessToken($this->_oauthToken); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REVOKED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 11 + */ + public function testValidateAccessTokenRevoked() + { + $this->_setupConsumer(); + $this->_setupToken( + true, + \Magento\Integration\Model\Oauth\Token::TYPE_ACCESS, + self::CONSUMER_ID, + $this->_oauthVerifier, + true + ); + + $this->_oauth->validateAccessToken($this->_oauthToken); + } + + /** + * \Magento\Oauth\OauthInterface::ERR_TOKEN_REJECTED + * + * @expectedException \Magento\Oauth\Exception + * @expectedExceptionCode 12 + */ + public function testValidateAccessTokenNoConsumer() + { + $this->_setupConsumer(false); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_ACCESS); + + $this->_oauth->validateAccessToken($this->_oauthToken); + } + + public function testValidateAccessToken() + { + $this->_setupConsumer(); + $this->_setupToken(true, \Magento\Integration\Model\Oauth\Token::TYPE_ACCESS); + + $this->assertTrue($this->_oauth->validateAccessToken($this->_oauthToken)); + } + + public function testBuildAuthorizationHeader() + { + $signature = 'valid_signature'; + $this->_httpUtilityMock->expects($this->any())->method('sign')->will($this->returnValue($signature)); + + $this->_setupConsumer(false); + $this->_oauthHelperMock->expects($this->any()) + ->method('generateRandomString') + ->will($this->returnValue('tyukmnjhgfdcvxstyuioplkmnhtfvert')); + + $request = array( + 'oauth_consumer_key' => 'edf957ef88492f0a32eb7e1731e85da2', + 'oauth_consumer_secret' => 'asdawwewefrtyh2f0a32eb7e1731e85d', + 'oauth_token' => '7c0709f789e1f38a17aa4b9a28e1b06c', + 'oauth_token_secret' => 'a6agsfrsfgsrjjjjyy487939244ssggg', + 'custom_param1' => 'foo', + 'custom_param2' => 'bar' + ); + + $requestUrl = 'http://www.example.com/endpoint'; + $oauthHeader = $this->_oauth->buildAuthorizationHeader($request, $requestUrl); + + $expectedHeader = 'OAuth oauth_nonce="tyukmnjhgfdcvxstyuioplkmnhtfvert",' . + 'oauth_timestamp="",' . + 'oauth_version="1.0",oauth_consumer_key="edf957ef88492f0a32eb7e1731e85da2",' . + 'oauth_consumer_secret="asdawwewefrtyh2f0a32eb7e1731e85d",' . + 'oauth_token="7c0709f789e1f38a17aa4b9a28e1b06c",' . + 'oauth_token_secret="a6agsfrsfgsrjjjjyy487939244ssggg",' . + 'oauth_signature="valid_signature"'; + + $this->assertEquals($expectedHeader, $oauthHeader, 'Generated Oauth header is incorrect'); + } + + /** + * @dataProvider dataProviderMissingParamForBuildAuthorizationHeaderTest + */ + public function testMissingParamForBuildAuthorizationHeader($expectedMessage, $request) + { + $this->setExpectedException( + '\Magento\Oauth\Exception', + $expectedMessage, + \Magento\Oauth\OauthInterface::ERR_PARAMETER_ABSENT + ); + + $requestUrl = 'http://www.example.com/endpoint'; + $this->_oauth->buildAuthorizationHeader($request, $requestUrl); + } + + public function dataProviderMissingParamForBuildAuthorizationHeaderTest() + { + return [ + [ + 'oauth_consumer_key', + [ //'oauth_consumer_key' => 'edf957ef88492f0a32eb7e1731e85d', + 'oauth_consumer_secret' => 'asdawwewefrtyh2f0a32eb7e1731e85d', + 'oauth_token' => '7c0709f789e1f38a17aa4b9a28e1b06c', + 'oauth_token_secret' => 'a6agsfrsfgsrjjjjyy487939244ssggg', + 'custom_param1' => 'foo', + 'custom_param2' => 'bar' + ] + ], + [ + 'oauth_consumer_secret', + [ + 'oauth_consumer_key' => 'edf957ef88492f0a32eb7e1731e85d', + //'oauth_consumer_secret' => 'asdawwewefrtyh2f0a32eb7e1731e85d', + 'oauth_token' => '7c0709f789e1f38a17aa4b9a28e1b06c', + 'oauth_token_secret' => 'a6agsfrsfgsrjjjjyy487939244ssggg', + 'custom_param1' => 'foo', + 'custom_param2' => 'bar' + ] + ], + [ + 'oauth_token', + [ + 'oauth_consumer_key' => 'edf957ef88492f0a32eb7e1731e85d', + 'oauth_consumer_secret' => 'asdawwewefrtyh2f0a32eb7e1731e85d', + //'oauth_token' => '7c0709f789e1f38a17aa4b9a28e1b06c', + 'oauth_token_secret' => 'a6agsfrsfgsrjjjjyy487939244ssggg', + 'custom_param1' => 'foo', + 'custom_param2' => 'bar' + ] + ], + [ + 'oauth_token_secret', + [ + 'oauth_consumer_key' => 'edf957ef88492f0a32eb7e1731e85d', + 'oauth_consumer_secret' => 'asdawwewefrtyh2f0a32eb7e1731e85d', + 'oauth_token' => '7c0709f789e1f38a17aa4b9a28e1b06c', + //'oauth_token_secret' => 'a6agsfrsfgsrjjjjyy487939244ssggg', + 'custom_param1' => 'foo', + 'custom_param2' => 'bar' + ] + ] + ]; + } + + protected function _getAccessTokenRequiredParams($amendments = array()) + { + $requiredParams = [ + 'oauth_consumer_key' => $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_CONSUMER_KEY), + 'oauth_signature' => '', + 'oauth_signature_method' => \Magento\Oauth\OauthInterface::SIGNATURE_SHA1, + 'oauth_nonce' => '', + 'oauth_timestamp' => (string)time(), + 'oauth_token' => $this->_generateRandomString(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN), + 'oauth_verifier' => $this->_oauthVerifier + ]; + + return array_merge($requiredParams, $amendments); + } + + private function _generateRandomString($length) + { + return substr( + str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 5)), 0, $length + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/ModuleManagerTest.php b/dev/tests/unit/testsuite/Magento/Module/ManagerTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/Core/Model/ModuleManagerTest.php rename to dev/tests/unit/testsuite/Magento/Module/ManagerTest.php index 42969fe2e1a..2bf4cca6c41 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/ModuleManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Module/ManagerTest.php @@ -22,9 +22,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model; +namespace Magento\Module; -class ModuleManagerTest extends \PHPUnit_Framework_TestCase +class ManagerTest extends \PHPUnit_Framework_TestCase { /** * XPath in the configuration of a module output flag @@ -32,7 +32,7 @@ class ModuleManagerTest extends \PHPUnit_Framework_TestCase const XML_PATH_OUTPUT_ENABLED = 'custom/is_module_output_enabled'; /** - * @var \Magento\Core\Model\ModuleManager + * @var \Magento\Module\Manager */ private $_model; @@ -44,15 +44,15 @@ class ModuleManagerTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - private $_storeConfig; + private $_outputConfig; protected function setUp() { $this->_moduleList = $this->getMockForAbstractClass('Magento\Module\ModuleListInterface'); - $this->_storeConfig = $this->getMockForAbstractClass('Magento\Core\Model\Store\ConfigInterface'); - $this->_model = new \Magento\Core\Model\ModuleManager($this->_storeConfig, $this->_moduleList, array( + $this->_outputConfig = $this->getMockForAbstractClass('Magento\Module\Output\ConfigInterface'); + $this->_model = new \Magento\Module\Manager($this->_outputConfig, $this->_moduleList, array( 'Module_DisabledOutputOne' => self::XML_PATH_OUTPUT_ENABLED, - 'Module_DisabledOutputTwo' => 'Magento\Core\Model\ModuleManagerTest::XML_PATH_OUTPUT_ENABLED', + 'Module_DisabledOutputTwo' => 'Magento\Module\ManagerTest::XML_PATH_OUTPUT_ENABLED', )); } @@ -71,9 +71,9 @@ class ModuleManagerTest extends \PHPUnit_Framework_TestCase public function testIsOutputEnabledReturnsFalseForDisabledModule() { - $this->_storeConfig + $this->_outputConfig ->expects($this->any()) - ->method('getConfigFlag') + ->method('getFlag') ->will($this->returnValue(true)); $this->assertFalse($this->_model->isOutputEnabled('Nonexisting_Module')); } @@ -88,10 +88,10 @@ class ModuleManagerTest extends \PHPUnit_Framework_TestCase $this->_moduleList->expects($this->any())->method('getModule')->will( $this->returnValue(array('name' => 'Module_EnabledOne')) ); - $this->_storeConfig + $this->_outputConfig ->expects($this->once()) - ->method('getConfigFlag') - ->with('advanced/modules_disable_output/Module_EnabledOne') + ->method('isEnabled') + ->with('Module_EnabledOne') ->will($this->returnValue($configValue)) ; $this->assertEquals($expectedResult, $this->_model->isOutputEnabled('Module_EnabledOne')); @@ -116,9 +116,9 @@ class ModuleManagerTest extends \PHPUnit_Framework_TestCase $this->_moduleList->expects($this->any())->method('getModule')->will( $this->returnValue(array('name' => $moduleName)) ); - $this->_storeConfig + $this->_outputConfig ->expects($this->at(0)) - ->method('getConfigFlag') + ->method('getFlag') ->with(self::XML_PATH_OUTPUT_ENABLED) ->will($this->returnValue($configValue)) ; diff --git a/dev/tests/unit/testsuite/Magento/Oauth/Helper/ServiceTest.php b/dev/tests/unit/testsuite/Magento/Oauth/Helper/ServiceTest.php deleted file mode 100644 index de6606c6827..00000000000 --- a/dev/tests/unit/testsuite/Magento/Oauth/Helper/ServiceTest.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php -/** - * Test WebAPI authentication helper. - * - * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Oauth\Helper; - -class ServiceTest extends \PHPUnit_Framework_TestCase -{ - /** @var \Magento\Core\Helper\Context */ - protected $_coreContextMock; - - /** @var \Magento\Core\Model\Store\Config */ - protected $_storeConfigMock; - - /** @var \Magento\Oauth\Helper\Service */ - protected $_oauthHelper; - - protected function setUp() - { - $this->_coreContextMock = $this->getMockBuilder('Magento\Core\Helper\Context') - ->disableOriginalConstructor() - ->getMock(); - $this->_storeConfigMock = $this->getMockBuilder('Magento\Core\Model\Store\Config') - ->disableOriginalConstructor() - ->getMock(); - $this->_encryptorMock = $this->getMockBuilder('Magento\Encryption\Encryptor') - ->disableOriginalConstructor() - ->getMock(); - - $this->_coreHelper = new \Magento\Core\Helper\Data( - $this->_coreContextMock, - $this->getMockBuilder('Magento\Event\ManagerInterface')->disableOriginalConstructor()->getMock(), - $this->_storeConfigMock, - $this->getMockBuilder('Magento\Core\Model\StoreManager')->disableOriginalConstructor()->getMock(), - $this->getMockBuilder('Magento\Core\Model\Locale')->disableOriginalConstructor()->getMock(), - $this->getMockBuilder('Magento\Core\Model\Date')->disableOriginalConstructor()->getMock(), - $this->getMockBuilder('Magento\App\State')->disableOriginalConstructor()->getMock(), - $this->_encryptorMock - ); - - $this->_oauthHelper = new \Magento\Oauth\Helper\Service( - $this->_coreContextMock, - $this->_storeConfigMock, - new \Magento\Math\Random - ); - } - - protected function tearDown() - { - unset($this->_coreContextMock); - unset($this->_storeConfigMock); - unset($this->_oauthHelper); - } - - public function testGenerateToken() - { - $token = $this->_oauthHelper->generateToken(); - $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Model\Token::LENGTH_TOKEN); - } - - public function testGenerateTokenSecret() - { - $token = $this->_oauthHelper->generateTokenSecret(); - $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Model\Token::LENGTH_SECRET); - } - - public function testGenerateVerifier() - { - $token = $this->_oauthHelper->generateVerifier(); - $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Model\Token::LENGTH_VERIFIER); - } - - public function testGenerateConsumerKey() - { - $token = $this->_oauthHelper->generateConsumerKey(); - $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Model\Consumer::KEY_LENGTH); - } - - public function testGenerateConsumerSecret() - { - $token = $this->_oauthHelper->generateConsumerSecret(); - $this->assertTrue(is_string($token) && strlen($token) === \Magento\Oauth\Model\Consumer::SECRET_LENGTH); - } - - public function testIsCleanupProbabilityZero() - { - $this->_storeConfigMock->expects($this->once())->method('getConfig') - ->will($this->returnValue(0)); - $this->assertFalse($this->_oauthHelper->isCleanupProbability()); - } - - public function testIsCleanupProbabilityRandomOne() - { - $this->_storeConfigMock->expects($this->once())->method('getConfig') - ->will($this->returnValue(1)); - $this->assertTrue($this->_oauthHelper->isCleanupProbability()); - } - - public function testGetCleanupExpirationPeriodZero() - { - $this->_storeConfigMock->expects($this->once())->method('getConfig') - ->will($this->returnValue(0)); - $this->assertEquals( - \Magento\Oauth\Helper\Service::CLEANUP_EXPIRATION_PERIOD_DEFAULT, - $this->_oauthHelper->getCleanupExpirationPeriod() - ); - } - - public function testGetCleanupExpirationPeriodNonZero() - { - $this->_storeConfigMock->expects($this->once())->method('getConfig') - ->will($this->returnValue(10)); - $this->assertEquals(10, $this->_oauthHelper->getCleanupExpirationPeriod()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Oauth/Service/OauthV1Test.php b/dev/tests/unit/testsuite/Magento/Oauth/Service/OauthV1Test.php deleted file mode 100644 index 863384bef4d..00000000000 --- a/dev/tests/unit/testsuite/Magento/Oauth/Service/OauthV1Test.php +++ /dev/null @@ -1,758 +0,0 @@ -<?php -/** - * \Magento\Oauth\Service\OauthV1 - * - * 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. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Oauth\Service; - -class OauthV1Test extends \PHPUnit_Framework_TestCase -{ - /** @var \Magento\Oauth\Model\Consumer\Factory*/ - private $_consumerFactory; - - /** @var \Magento\Oauth\Model\Nonce\Factory */ - private $_nonceFactory; - - /** @var \Magento\Oauth\Model\Token\Factory */ - private $_tokenFactory; - - /** @var \Magento\Oauth\Model\Consumer */ - private $_consumerMock; - - /** @var \Magento\Oauth\Model\Token */ - private $_tokenMock; - - /** @var \Magento\Core\Model\StoreManagerInterface */ - private $_storeManagerMock; - - /** @var \Magento\HTTP\ZendClient */ - private $_httpClientMock; - - /** @var \Magento\Oauth\Service\OauthV1 */ - private $_service; - - /** @var \Zend_Oauth_Http_Utility */ - private $_httpUtilityMock; - - /** @var \Magento\Core\Model\Date */ - private $_dateMock; - - /** @var \Magento\Core\Model\Store */ - protected $_storeMock; - - private $_oauthToken; - private $_oauthSecret; - private $_oauthVerifier; - - const CONSUMER_ID = 1; - - public function setUp() - { - $this->_consumerFactory = $this->getMockBuilder('Magento\Oauth\Model\Consumer\Factory') - ->disableOriginalConstructor() - ->getMock(); - $this->_consumerMock = $this->getMockBuilder('Magento\Oauth\Model\Consumer') - ->disableOriginalConstructor() - // Mocking magic getCreatedAt() - ->setMethods([ - 'getCreatedAt', - 'loadByKey', - 'load', - 'getId', - 'getSecret', - 'getCallbackUrl', - 'save', - 'getData', - '__wakeup' - ])->getMock(); - $this->_consumerFactory->expects($this->any()) - ->method('create') - ->will($this->returnValue($this->_consumerMock)); - - $this->_nonceFactory = $this->getMockBuilder('Magento\Oauth\Model\Nonce\Factory') - ->disableOriginalConstructor() - ->getMock(); - - $this->_tokenFactory = $this->getMockBuilder('Magento\Oauth\Model\Token\Factory') - ->disableOriginalConstructor() - ->getMock(); - - $this->_tokenMock = $this->getMockBuilder('Magento\Oauth\Model\Token') - ->disableOriginalConstructor() - ->setMethods( - [ - 'getId', - 'load', - 'getType', - 'createRequestToken', - 'getToken', - 'getSecret', - 'createVerifierToken', - 'getVerifier', - 'getConsumerId', - 'convertToAccess', - 'getRevoked', - '__wakeup' - ] - )->getMock(); - - $this->_tokenFactory->expects($this->any()) - ->method('create') - ->will($this->returnValue($this->_tokenMock)); - - $this->_storeManagerMock = $this->getMockBuilder('Magento\Core\Model\StoreManagerInterface') - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->_storeMock = $this->getMockBuilder('Magento\Core\Model\Store') - ->disableOriginalConstructor() - ->getMock(); - $this->_storeManagerMock->expects($this->any()) - ->method('getStore') - ->will($this->returnValue($this->_storeMock)); - $this->_storeMock->expects($this->any()) - ->method('getBaseUrl') - ->will($this->returnValue('http://www.my-store.com/')); - - $this->_httpClientMock = $this->getMockBuilder('Magento\HTTP\ZendClient') - ->disableOriginalConstructor() - ->getMock(); - - $this->_httpUtilityMock = $this->getMock('Zend_Oauth_Http_Utility'); - - $this->_dateMock = $this->getMockBuilder('Magento\Core\Model\Date') - ->disableOriginalConstructor() - ->getMock(); - - $this->_service = new \Magento\Oauth\Service\OauthV1( - $this->_consumerFactory, - $this->_nonceFactory, - $this->_tokenFactory, - $this->_storeManagerMock, - $this->_httpClientMock, - $this->_httpUtilityMock, - $this->_dateMock - ); - - $this->_oauthToken = $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_TOKEN); - $this->_oauthSecret = $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_SECRET); - $this->_oauthVerifier = $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_VERIFIER); - } - - public function tearDown() - { - unset($this->_consumerFactory); - unset($this->_nonceFactory); - unset($this->_tokenFactory); - unset($this->_storeManagerMock); - unset($this->_storeMock); - unset($this->_httpClientMock); - unset($this->_dateMock); - unset($this->_service); - } - - public function testCreateConsumer() - { - $key = $this->_generateRandomString(\Magento\Oauth\Model\Consumer::KEY_LENGTH); - $secret = $this->_generateRandomString(\Magento\Oauth\Model\Consumer::SECRET_LENGTH); - - $consumerData = array( - 'name' => 'Add-On Name', 'key' => $key, 'secret' => $secret, 'http_post_url' => 'http://www.magento.com'); - - $this->_consumerMock->expects($this->once()) - ->method('save') - ->will($this->returnSelf()); - $this->_consumerMock->expects($this->once()) - ->method('getData') - ->will($this->returnValue($consumerData)); - - $responseData = $this->_service->createConsumer($consumerData); - - $this->assertEquals($key, $responseData['key'], 'Checking Oauth Consumer Key'); - $this->assertEquals($secret, $responseData['secret'], 'Checking Oauth Consumer Secret'); - } - - public function testPostToConsumer() - { - $consumerId = 1; - $requestData = array('consumer_id' => $consumerId); - - $key = $this->_generateRandomString(\Magento\Oauth\Model\Consumer::KEY_LENGTH); - $secret = $this->_generateRandomString(\Magento\Oauth\Model\Consumer::SECRET_LENGTH); - $oauthVerifier = $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_VERIFIER); - - $consumerData = array( - 'entity_id' => $consumerId, - 'key' => $key, - 'secret' => $secret, - 'http_post_url' => 'http://www.magento.com' - ); - - $this->_consumerMock->expects($this->once()) - ->method('load') - ->with($this->equalTo($consumerId)) - ->will($this->returnSelf()); - $this->_consumerMock->expects($this->once()) - ->method('getId') - ->will($this->returnValue($consumerId)); - $this->_consumerMock->expects($this->once()) - ->method('getData') - ->will($this->returnValue($consumerData)); - $this->_httpClientMock->expects($this->once()) - ->method('setUri') - ->with('http://www.magento.com') - ->will($this->returnSelf()); - $this->_httpClientMock->expects($this->once()) - ->method('setParameterPost') - ->will($this->returnSelf()); - $this->_tokenMock->expects($this->once()) - ->method('createVerifierToken') - ->with($consumerId) - ->will($this->returnSelf()); - $this->_tokenMock->expects($this->any()) - ->method('getVerifier') - ->will($this->returnValue($oauthVerifier)); - - $responseData = $this->_service->postToConsumer($requestData); - - $this->assertEquals($oauthVerifier, $responseData['oauth_verifier']); - } - - protected function _getRequestTokenParams($amendments = array()) - { - $requiredParams = [ - 'oauth_version' => '1.0', - 'oauth_consumer_key' => $this->_generateRandomString(\Magento\Oauth\Model\Consumer::KEY_LENGTH), - 'oauth_nonce' => '', - 'oauth_timestamp' => time(), - 'oauth_signature_method' => \Magento\Oauth\Service\OauthV1Interface::SIGNATURE_SHA1, - 'http_method' => '', - 'request_url' => 'http://magento.ll', - 'oauth_signature' => 'invalid_signature' - ]; - - return array_merge($requiredParams, $amendments); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_VERSION_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 1 - */ - public function testGetRequestTokenVersionRejected() - { - $this->_service->getRequestToken($this->_getRequestTokenParams(['oauth_version' => '2.0'])); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_CONSUMER_KEY_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 8 - */ - public function testGetRequestTokenConsumerKeyRejected() - { - $this->_service->getRequestToken($this->_getRequestTokenParams(['oauth_consumer_key' => 'wrong_key_length'])); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_CONSUMER_KEY_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 8 - */ - public function testGetRequestTokenConsumerKeyNotFound() - { - $this->_consumerMock - ->expects($this->once()) - ->method('loadByKey') - ->will($this->returnValue(new \Magento\Object())); - - $this->_service->getRequestToken($this->_getRequestTokenParams()); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_CONSUMER_KEY_INVALID - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 17 - */ - public function testGetRequestTokenOutdatedConsumerKey() - { - $this->_setupConsumer(); - $this->_dateMock->expects($this->any())->method('timestamp')->will($this->returnValue(9999999999)); - $this->_storeMock->expects($this->once())->method('getConfig')->will($this->returnValue(0)); - - $this->_service->getRequestToken($this->_getRequestTokenParams()); - } - - protected function _setupConsumer($isLoadable = true) - { - $this->_consumerMock - ->expects($this->any()) - ->method('loadByKey') - ->will($this->returnSelf()); - - $this->_consumerMock - ->expects($this->any()) - ->method('getCreatedAt') - ->will($this->returnValue(date('c', strtotime('-1 day')))); - - if ($isLoadable) { - $this->_consumerMock->expects($this->any())->method('load')->will($this->returnSelf()); - } else { - $this->_consumerMock->expects($this->any())->method('load') - ->will($this->returnValue(new \Magento\Object())); - } - - $this->_consumerMock->expects($this->any())->method('getId')->will($this->returnValue(1)); - $this->_consumerMock->expects($this->any())->method('getSecret')->will($this->returnValue('consumer_secret')); - $this->_consumerMock->expects($this->any())->method('getCallbackUrl')->will($this->returnValue('callback_url')); - } - - protected function _makeValidExpirationPeriod() - { - $this->_dateMock->expects($this->any())->method('timestamp')->will($this->returnValue(0)); - $this->_storeMock->expects($this->once())->method('getConfig')->will($this->returnValue(300)); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TIMESTAMP_REFUSED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 4 - * @dataProvider dataProviderForGetRequestTokenNonceTimestampRefusedTest - */ - public function testGetRequestTokenOauthTimestampRefused($timestamp) - { - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - - $this->_service->getRequestToken($this->_getRequestTokenParams(['oauth_timestamp' => $timestamp])); - } - - public function dataProviderForGetRequestTokenNonceTimestampRefusedTest() - { - return [[0], [time() + \Magento\Oauth\Service\OauthV1::TIME_DEVIATION * 2]]; - } - - protected function _setupNonce($isUsed = false, $timestamp = 0) - { - $nonceMock = $this->getMockBuilder('Magento\Oauth\Model\Nonce') - ->disableOriginalConstructor() - ->setMethods([ - 'getConsumerId', - 'loadByCompositeKey', - 'getTimestamp', - 'setNonce', - 'setConsumerId', - 'setTimestamp', - 'save', - '__wakeup' - ])->getMock(); - - $nonceMock->expects($this->any())->method('getConsumerId')->will($this->returnValue((int)$isUsed)); - $nonceMock->expects($this->any())->method('loadByCompositeKey')->will($this->returnSelf()); - $nonceMock->expects($this->any())->method('getTimestamp')->will($this->returnValue($timestamp)); - $nonceMock->expects($this->any())->method('setNonce')->will($this->returnSelf()); - $nonceMock->expects($this->any())->method('setConsumerId')->will($this->returnSelf()); - $nonceMock->expects($this->any())->method('setTimestamp')->will($this->returnSelf()); - $nonceMock->expects($this->any())->method('save')->will($this->returnSelf()); - $this->_nonceFactory->expects($this->any())->method('create')->will($this->returnValue($nonceMock)); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_NONCE_USED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 5 - */ - public function testGetRequestTokenNonceAlreadyUsed() - { - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(true); - - $this->_service->getRequestToken($this->_getRequestTokenParams()); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_PARAMETER_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 3 - */ - public function testGetRequestTokenNoConsumer() - { - $this->_setupConsumer(false); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(); - - $this->_service->getRequestToken($this->_getRequestTokenParams()); - } - - - /** - * \Magento\Oauth\Helper\Service::ERR_NONCE_USED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 5 - */ - public function testGetRequestTokenNonceTimestampAlreadyUsed() - { - $timestamp = time(); - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(false, $timestamp); - - $this->_service->getRequestToken($this->_getRequestTokenParams(['oauth_timestamp' => $timestamp])); - } - - protected function _setupToken( - $doesExist = true, - $type = \Magento\Oauth\Model\Token::TYPE_VERIFIER, - $consumerId = self::CONSUMER_ID, - $verifier = null, - $isRevoked = false - ) { - $this->_tokenMock - ->expects($this->any()) - ->method('getId') - ->will($this->returnValue($doesExist ? self::CONSUMER_ID : null)); - - $verifier = $verifier ?: $this->_oauthVerifier; - - $this->_tokenMock->expects($this->any())->method('load')->will($this->returnSelf()); - $this->_tokenMock->expects($this->any())->method('getType')->will($this->returnValue($type)); - $this->_tokenMock->expects($this->any())->method('createRequestToken')->will($this->returnSelf()); - $this->_tokenMock->expects($this->any())->method('getToken')->will($this->returnValue($this->_oauthToken)); - $this->_tokenMock->expects($this->any())->method('getSecret')->will($this->returnValue($this->_oauthSecret)); - $this->_tokenMock->expects($this->any())->method('getConsumerId')->will($this->returnValue($consumerId)); - $this->_tokenMock->expects($this->any())->method('getVerifier')->will($this->returnValue($verifier)); - $this->_tokenMock->expects($this->any())->method('convertToAccess')->will($this->returnSelf()); - $this->_tokenMock->expects($this->any())->method('getRevoked')->will($this->returnValue($isRevoked)); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 12 - */ - public function testGetRequestTokenTokenRejected() - { - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(); - $this->_setupToken(false); - - $this->_service->getRequestToken($this->_getRequestTokenParams()); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 12 - */ - public function testGetRequestTokenTokenRejectedByType() - { - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_REQUEST); // wrong type - - $this->_service->getRequestToken($this->_getRequestTokenParams()); - } - - - /** - * \Magento\Oauth\Helper\Service::ERR_SIGNATURE_METHOD_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 6 - */ - public function testGetRequestTokenSignatureMethodRejected() - { - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(); - $this->_setupToken(); - - $this->_service->getRequestToken($this->_getRequestTokenParams(['oauth_signature_method' => 'wrong_method'])); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_SIGNATURE_INVALID - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 7 - */ - public function testGetRequestTokenInvalidSignature() - { - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(); - $this->_setupToken(); - - $this->_service->getRequestToken($this->_getRequestTokenParams(['oauth_signature' => 'invalid_signature'])); - } - - public function testGetRequestToken() - { - $this->_setupConsumer(); - $this->_makeValidExpirationPeriod(); - $this->_setupNonce(); - $this->_setupToken(); - - $signature = 'valid_signature'; - $this->_httpUtilityMock->expects($this->any())->method('sign')->will($this->returnValue($signature)); - - $requestToken = $this->_service->getRequestToken( - $this->_getRequestTokenParams(['oauth_signature' => $signature]) - ); - - $this->assertEquals( - ['oauth_token' => $this->_oauthToken, 'oauth_token_secret' => $this->_oauthSecret], - $requestToken - ); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_VERSION_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 1 - */ - public function testGetAccessTokenVersionRejected() - { - $this->_service->getAccessToken($this->_getAccessTokenRequiredParams(['oauth_version' => '0.0'])); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_PARAMETER_ABSENT - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 2 - */ - public function testGetAccessTokenParameterAbsent() - { - $this->_service->getAccessToken([ - 'oauth_version' => '1.0', - 'oauth_consumer_key' => '', - 'oauth_signature' => '', - 'oauth_signature_method' => '', - 'oauth_nonce' => '', - 'oauth_timestamp' => '', - 'oauth_token' => '', - // oauth_verifier missing - ]); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 12 - */ - public function testGetAccessTokenTokenRejected() - { - $this->_service->getAccessToken($this->_getAccessTokenRequiredParams(['oauth_token' => 'invalid_token'])); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_SIGNATURE_METHOD_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 6 - */ - public function testGetAccessTokenSignatureMethodRejected() - { - $this->_service->getAccessToken( - $this->_getAccessTokenRequiredParams(['oauth_signature_method' => 'invalid_method']) - ); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_USED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 9 - */ - public function testGetAccessTokenTokenUsed() - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_VERIFIER); // Wrong type - - $this->_service->getAccessToken($this->_getAccessTokenRequiredParams()); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 12 - */ - public function testGetAccessTokenConsumerIdDoesntMatch() - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_REQUEST, null); // $token->getConsumerId() === null - - $this->_service->getAccessToken($this->_getAccessTokenRequiredParams()); - } - - /** - * \Magento\Oauth\Helper\Data::ERR_VERIFIER_INVALID - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 13 - * @dataProvider dataProviderForGetAccessTokenVerifierInvalidTest - */ - public function testGetAccessTokenVerifierInvalid($verifier, $verifierFromToken) - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_REQUEST, self::CONSUMER_ID, $verifierFromToken); - - $this->_service->getAccessToken($this->_getAccessTokenRequiredParams(['oauth_verifier' => $verifier])); - } - - public function dataProviderForGetAccessTokenVerifierInvalidTest() - { - return [ - [3, 3], // Verifier is not a string - ['wrong_length', 'wrong_length'], - ['verifier', 'doesnt match'] - ]; - } - - public function testGetAccessToken() - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_REQUEST); - - $token = $this->_service->getAccessToken($this->_getAccessTokenRequiredParams()); - $this->assertEquals(['oauth_token' => $this->_oauthToken, 'oauth_token_secret' => $this->_oauthSecret], $token); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 12 - */ - public function testValidateAccessTokenRequestTokenRejected() - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_ACCESS, null); // $token->getConsumerId() === null - - $this->_service->validateAccessTokenRequest($this->_getAccessTokenRequiredParams()); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 12 - */ - public function testValidateAccessTokenRequestTokenRejectedByType() - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_REQUEST); - - $this->_service->validateAccessTokenRequest($this->_getAccessTokenRequiredParams()); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REVOKED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 11 - */ - public function testValidateAccessTokenRequestTokenRevoked() - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, - \Magento\Oauth\Model\Token::TYPE_ACCESS, - self::CONSUMER_ID, - $this->_oauthVerifier, - true); - - $this->_service->validateAccessTokenRequest($this->_getAccessTokenRequiredParams()); - } - - public function testValidateAccessTokenRequest() - { - $this->_setupConsumer(); - $this->_setupNonce(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_ACCESS); - - $this->assertTrue($this->_service->validateAccessTokenRequest - ($this->_getAccessTokenRequiredParams())['isValid']); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REJECTED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 12 - */ - public function testValidateAccessTokenRejectedByType() - { - $this->_setupConsumer(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_REQUEST); - - $this->_service->validateAccessToken(['token' => $this->_oauthToken]); - } - - /** - * \Magento\Oauth\Helper\Service::ERR_TOKEN_REVOKED - * @expectedException \Magento\Oauth\Exception - * @expectedExceptionCode 11 - */ - public function testValidateAccessTokenRevoked() - { - $this->_setupConsumer(); - $this->_setupToken(true, - \Magento\Oauth\Model\Token::TYPE_ACCESS, - self::CONSUMER_ID, - $this->_oauthVerifier, - true); - - $this->_service->validateAccessToken(['token' => $this->_oauthToken]); - } - - public function testValidateAccessToken() - { - $this->_setupConsumer(); - $this->_setupToken(true, \Magento\Oauth\Model\Token::TYPE_ACCESS); - - $this->assertTrue($this->_service->validateAccessToken(array('token' => $this->_oauthToken))['isValid']); - } - - protected function _getAccessTokenRequiredParams($amendments = array()) - { - $requiredParams = [ - 'oauth_consumer_key' => $this->_generateRandomString(\Magento\Oauth\Model\Consumer::KEY_LENGTH), - 'oauth_signature' => '', - 'oauth_signature_method' => (string)\Magento\Oauth\Service\OauthV1Interface::SIGNATURE_SHA1, - 'oauth_nonce' => '', - 'oauth_timestamp' => (string)time(), - 'oauth_token' => $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_TOKEN), - 'oauth_verifier' => $this->_oauthVerifier, - 'request_url' => '', - 'http_method' => '', - ]; - - return array_merge($requiredParams, $amendments); - } - - private function _generateRandomString($length) - { - return substr(str_shuffle( - str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 5)), 0, $length); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Object/Copy/Config/ConverterTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Object/Copy/Config/ConverterTest.php index cd0baeab362..bca2d970c33 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Object/Copy/Config/ConverterTest.php @@ -1,6 +1,6 @@ <?php /** - * \Magento\Core\Model\Fieldset\Config\Converter + * \Magento\Object\Copy\Config\Converter * * Magento * @@ -23,18 +23,18 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset\Config; +namespace Magento\Object\Copy\Config; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Fieldset\Config\Converter + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Object\Copy\Config\Converter */ protected $_model; public function setUp() { - $this->_model = new \Magento\Core\Model\Fieldset\Config\Converter(); + $this->_model = new \Magento\Object\Copy\Config\Converter(); } public function testConvert() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/_files/fieldset.xml b/dev/tests/unit/testsuite/Magento/Object/Copy/Config/_files/fieldset.xml similarity index 93% rename from dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/_files/fieldset.xml rename to dev/tests/unit/testsuite/Magento/Object/Copy/Config/_files/fieldset.xml index d48a4536322..d166de23547 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/_files/fieldset.xml +++ b/dev/tests/unit/testsuite/Magento/Object/Copy/Config/_files/fieldset.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/Object/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="company"> @@ -39,4 +39,4 @@ </field> </fieldset> </scope> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/_files/fieldset_config.php b/dev/tests/unit/testsuite/Magento/Object/Copy/Config/_files/fieldset_config.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/Config/_files/fieldset_config.php rename to dev/tests/unit/testsuite/Magento/Object/Copy/Config/_files/fieldset_config.php diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Object/Copy/ConfigTest.php similarity index 86% rename from dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/ConfigTest.php rename to dev/tests/unit/testsuite/Magento/Object/Copy/ConfigTest.php index d618331b6b6..518149c3135 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Fieldset/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Object/Copy/ConfigTest.php @@ -1,6 +1,6 @@ <?php /** - * \Magento\Core\Model\Fieldset\Config + * \Magento\Object\Copy\Config * * Magento * @@ -23,31 +23,31 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset; +namespace Magento\Object\Copy; class ConfigTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Fieldset\Config\Data|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Object\Copy\Config\Data|PHPUnit_Framework_MockObject_MockObject */ protected $_storageMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Fieldset\Config + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Object\Copy\Config */ protected $_model; public function setUp() { $this->_storageMock = $this->getMock( - 'Magento\Core\Model\Fieldset\Config\Data', + 'Magento\Object\Copy\Config\Data', array('get'), array(), '', false ); - $this->_model = new \Magento\Core\Model\Fieldset\Config($this->_storageMock); + $this->_model = new \Magento\Object\Copy\Config($this->_storageMock); } public function testGetFieldsets() diff --git a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php index 507a614fe48..7c9714598fe 100644 --- a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php +++ b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php @@ -105,7 +105,7 @@ return array( 'customCacheInstance' => array( 'shared' => true, - 'type' => 'Magento\Core\Model\Cache', + 'type' => 'Magento\App\Cache', 'parameters' => array(), ), diff --git a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml index 2275c5209e9..77de8b9fb0e 100644 --- a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml +++ b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml @@ -101,6 +101,6 @@ <value type='string' pattern="[a-z\-]*">az-value</value> </param> </type> - <virtualType name="customCacheInstance" type="Magento\Core\Model\Cache" shared="true" /> + <virtualType name="customCacheInstance" type="Magento\App\Cache" shared="true" /> <virtualType name="customOverriddenInstance" shared="false" /> </config> diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php index 8bcc68eab18..deee526c326 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php @@ -160,23 +160,17 @@ class GridTest extends \PHPUnit_Framework_TestCase */ protected function _getContext() { - $helper = $this->getMockBuilder('Magento\Customer\Helper\Data') + $locale = $this->getMockBuilder('\Magento\Core\Model\LocaleInterface') ->disableOriginalConstructor() ->setMethods(array('formatDate')) - ->getMock(); - $helper->expects($this->once())->method('formatDate') + ->getMockForAbstractClass(); + $locale->expects($this->once())->method('formatDate') ->will($this->returnValue('11-11-1999')); - $helperFactory = $this->getMockBuilder('Magento\Core\Model\Factory\Helper') - ->disableOriginalConstructor() - ->setMethods(array('get')) - ->getMock(); - $helperFactory->expects($this->any())->method('get')->will($this->returnValue($helper)); - /** @var \Magento\Core\Block\Template\Context $context */ $context = $this->_objectManagerHelper->getObject( 'Magento\Core\Block\Template\Context', - array('helperFactory' => $helperFactory) + array('locale' => $locale) ); return $context; } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php index 3e48f0e2f90..2a78005ba63 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php @@ -160,14 +160,19 @@ class GridTest extends \PHPUnit_Framework_TestCase */ protected function _getContext() { + $locale = $this->getMockBuilder('\Magento\Core\Model\LocaleInterface') + ->disableOriginalConstructor() + ->setMethods(array('formatDate')) + ->getMockForAbstractClass(); + $locale->expects($this->once())->method('formatDate') + ->will($this->returnValue('11-11-1999')); + $helper = $this->getMockBuilder('Magento\Customer\Helper\Data') ->disableOriginalConstructor() - ->setMethods(array('formatCurrency', 'formatDate')) + ->setMethods(array('formatCurrency')) ->getMock(); $helper->expects($this->once())->method('formatCurrency') ->will($this->returnValue('10 USD')); - $helper->expects($this->once())->method('formatDate') - ->will($this->returnValue('11-11-1999')); $helperFactory = $this->getMockBuilder('Magento\Core\Model\Factory\Helper') ->disableOriginalConstructor() @@ -178,7 +183,10 @@ class GridTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Core\Block\Template\Context $context */ $context = $this->_objectManagerHelper->getObject( 'Magento\Core\Block\Template\Context', - array('helperFactory' => $helperFactory) + array( + 'helperFactory' => $helperFactory, + 'locale' => $locale + ) ); return $context; } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php index 73f40c2d77c..ef90a0511ff 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php @@ -44,7 +44,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $this->_readerMock = $this->getMockBuilder('Magento\Sales\Model\Config\Reader') ->disableOriginalConstructor() ->getMock(); - $this->_cacheMock = $this->getMockBuilder('Magento\Core\Model\Cache\Type\Config') + $this->_cacheMock = $this->getMockBuilder('Magento\App\Cache\Type\Config') ->disableOriginalConstructor() ->getMock(); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRendererTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRendererTest.php index 32e4f3aec79..6232ba3ea66 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRendererTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/RecurringProfile/FormRendererTest.php @@ -44,7 +44,7 @@ class FormRendererTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_blockFactoryMock = $this->getMock( - 'Magento\Core\Model\BlockFactory', array('createBlock'), array(), '', false + 'Magento\View\Element\BlockFactory', array('createBlock'), array(), '', false ); $this->_observerMock = $this->getMock('Magento\Event\Observer', array(), array(), '', false); $this->_model = new \Magento\Sales\Model\Observer\Backend\RecurringProfile\FormRenderer( diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php index 3e484c06628..33130276535 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php @@ -43,13 +43,13 @@ class AbstractTest extends \PHPUnit_Framework_TestCase // Setup most constructor dependencies $paymentData = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); - $coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $string = $this->getMock('Magento\Stdlib\String', array(), array(), '', false); $coreStoreConfig = $this->getMock('Magento\Core\Model\Store\Config', array(), array(), '', false); $translate = $this->getMock('Magento\Core\Model\Translate', array(), array(), '', false); $coreDir = $this->getMock('Magento\App\Dir', array(), array(), '', false); $shippingConfig = $this->getMock('Magento\Shipping\Model\Config', array(), array(), '', false); $pdfItemsFactory = $this->getMock('Magento\Sales\Model\Order\Pdf\ItemsFactory', array(), array(), '', false); + $localeMock = $this->getMock('Magento\Core\Model\LocaleInterface', array(), array(), '', false, false); // Setup config file totals $configTotals = array( @@ -106,10 +106,10 @@ class AbstractTest extends \PHPUnit_Framework_TestCase ->will($this->returnValueMap($valueMap)); // Test model - /** @var \Magento\Sales\Model\Order\Pdf\AbstractPdf|\PHPUnit_Framework_MockObject_MockObject $model */ + /** @var \Magento\Sales\Model\Order\Pdf\AbstractPdf $model */ $model = $this->getMockForAbstractClass('Magento\Sales\Model\Order\Pdf\AbstractPdf', - array($paymentData, $coreData, $string, $coreStoreConfig, $translate, $coreDir, $shippingConfig, - $pdfConfig, $pdfTotalFactory, $pdfItemsFactory), + array($paymentData, $string, $coreStoreConfig, $translate, $coreDir, $shippingConfig, + $pdfConfig, $pdfTotalFactory, $pdfItemsFactory, $localeMock), '', true, false, true, array('drawLineBlocks') ); $model->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php index 0e363af9765..fe1380ac6ee 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php @@ -39,7 +39,6 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase protected function setUp() { $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); - $coreHelperMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $stringMock = $this->getMock('Magento\Stdlib\String', array(), array(), '', false, false); $storeConfigMock = $this->getMock('Magento\Core\Model\Store\Config', array(), array(), '', false, false); $translateMock = $this->getMock('Magento\Core\Model\Translate', array(), array(), '', false, false); @@ -62,7 +61,6 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase $this->_model = new \Magento\Sales\Model\Order\Pdf\Invoice( $paymentDataMock, - $coreHelperMock, $stringMock, $storeConfigMock, $translateMock, diff --git a/dev/tests/unit/testsuite/Magento/Stdlib/ArrayUtilsTest.php b/dev/tests/unit/testsuite/Magento/Stdlib/ArrayUtilsTest.php index c5b7bf2e0e9..a308dd95fc8 100644 --- a/dev/tests/unit/testsuite/Magento/Stdlib/ArrayUtilsTest.php +++ b/dev/tests/unit/testsuite/Magento/Stdlib/ArrayUtilsTest.php @@ -65,4 +65,40 @@ class ArrayUtilsTest extends \PHPUnit_Framework_TestCase array(array('б' => 2, 'в' => 3, 'а' => 1), 'ru_RU'), ); } + + /** + * @covers \Magento\Stdlib\ArrayUtils::decorateArray + */ + public function testDecorateArray() + { + $original = array( + array('value' => 1), + array('value' => 2), + array('value' => 3), + ); + $decorated = array( + array('value' => 1, 'is_first' => true, 'is_odd' => true), + array('value' => 2, 'is_even' => true), + array('value' => 3, 'is_last' => true, 'is_odd' => true), + ); + + // arrays + $this->assertEquals($decorated, $this->_arrayUtils->decorateArray($original, '')); + + // \Magento\Object + $sample = array( + new \Magento\Object($original[0]), + new \Magento\Object($original[1]), + new \Magento\Object($original[2]), + ); + $decoratedVo = array( + new \Magento\Object($decorated[0]), + new \Magento\Object($decorated[1]), + new \Magento\Object($decorated[2]), + ); + foreach ($decoratedVo as $obj) { + $obj->setDataChanges(true); // hack for assertion + } + $this->assertEquals($decoratedVo, $this->_arrayUtils->decorateArray($sample, '')); + } } diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php index 3d9d639f409..e65e16fb69c 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php @@ -45,7 +45,7 @@ class PluginScannerTest extends \PHPUnit_Framework_TestCase { $actual = $this->_model->collectEntities($this->_testFiles); $expected = array( - 'Magento\Core\Model\Cache\TagPlugin', + 'Magento\App\Cache\TagPlugin', 'Magento\Core\Model\Action\Plugin', 'Custom_PageCache_Model_Action_Plugin', ); diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php index 9790de9e0d4..7b08ff4f302 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php @@ -55,7 +55,7 @@ class XmlInterceptorScannerTest extends \PHPUnit_Framework_TestCase { $actual = $this->_model->collectEntities($this->_testFiles); $expected = array( - 'Magento\Core\Model\Cache\Interceptor', + 'Magento\App\Cache\Interceptor', 'Magento\Core\Controller\Varien\Action\Context\Interceptor', ); $this->assertEquals($expected, $actual); diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml index 9721915a0a2..c15d7a1289c 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml @@ -26,9 +26,9 @@ <config> <preference for="Magento\Core\Model\AppInterface" type="Magento\Core\Model\App\Proxy" /> <preference for="Magento\Core\Model\Config\InvalidatorInterface" type="Magento\Core\Model\Config\Invalidator\Proxy" /> - <preference for="Magento\App\CacheInterface" type="Magento\Core\Model\Cache\Proxy" /> - <virtualType name="custom_cache_instance" type="Magento\Core\Model\Cache"> - <plugin name="tag" type="Magento\Core\Model\Cache\TagPlugin" /> + <preference for="Magento\App\CacheInterface" type="Magento\App\Cache\Proxy" /> + <virtualType name="custom_cache_instance" type="Magento\App\Cache"> + <plugin name="tag" type="Magento\App\Cache\TagPlugin" /> </virtualType> <type name="Magento\SomeModule\Model\Test"> <param name="proxy"> diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/config.xml b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/config.xml index 33ad1b1834c..bf3a181b3d5 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/config.xml +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/config.xml @@ -26,7 +26,7 @@ <config> <global> <di> - <Node1 type="Magento\Core\Model\Cache"> + <Node1 type="Magento\App\Cache"> <parameters> <storeManager> <instance>customStoreManagerProxy</instance> diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml index fe5054a1410..5f5c0af9d11 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml @@ -24,7 +24,7 @@ */ --> <config> - <type name="Magento\Core\Model\Cache"> + <type name="Magento\App\Cache"> <param name="storeManager"><instance type="customStoreManagerProxy" /></param> </type> <type name="Magento\Core\Controller\Varien\Action\Context"> diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php index 2754f7c3789..191386f8d1b 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php @@ -32,9 +32,9 @@ require_once realpath(__DIR__ . '/../../../../../../../../') class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Helper\Css + * @var \Magento\View\Url\CssResolver */ - protected $_cssHelper; + protected $_cssUrlResolver; /** * @var string @@ -45,7 +45,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase { $filesystem = new \Magento\Filesystem(new \Magento\Filesystem\Adapter\Local()); $dirs = new \Magento\App\Dir($filesystem->normalizePath(__DIR__ . '/../../../../../../')); - $this->_cssHelper = new \Magento\Core\Helper\Css($filesystem, $dirs); + $this->_cssUrlResolver = new \Magento\View\Url\CssResolver($filesystem, $dirs); $this->_tmpDir = TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . 'tool_theme_deployment'; mkdir($this->_tmpDir); } @@ -64,7 +64,12 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase public function testConstructorException($permitted, $forbidden, $exceptionMessage) { $this->setExpectedException('Magento\Exception', $exceptionMessage); - new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssHelper, $this->_tmpDir, $permitted, $forbidden); + new \Magento\Tools\View\Generator\ThemeDeployment( + $this->_cssUrlResolver, + $this->_tmpDir, + $permitted, + $forbidden + ); } public static function constructorExceptionDataProvider() @@ -97,7 +102,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase $forbidden = __DIR__ . '/_files/ThemeDeployment/run/forbidden.php'; $fixture = include __DIR__ . '/_files/ThemeDeployment/run/fixture.php'; - $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssHelper, $this->_tmpDir, $permitted, + $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssUrlResolver, $this->_tmpDir, $permitted, $forbidden); $object->run($fixture['copyRules']); @@ -154,7 +159,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase $forbidden = __DIR__ . '/_files/ThemeDeployment/run/forbidden.php'; $fixture = include __DIR__ . '/_files/ThemeDeployment/run/fixture.php'; - $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssHelper, $this->_tmpDir, $permitted, + $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssUrlResolver, $this->_tmpDir, $permitted, $forbidden, true); $object->run($fixture['copyRules']); @@ -173,7 +178,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase $forbidden = __DIR__ . '/_files/ThemeDeployment/run/forbidden_without_php.php'; $fixture = include __DIR__ . '/_files/ThemeDeployment/run/fixture.php'; - $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssHelper, $this->_tmpDir, $permitted, + $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssUrlResolver, $this->_tmpDir, $permitted, $forbidden, true); $object->run($fixture['copyRules']); } @@ -182,7 +187,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase { $permitted = __DIR__ . '/_files/ThemeDeployment/run/permitted_cased_js.php'; - $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssHelper, $this->_tmpDir, $permitted); + $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssUrlResolver, $this->_tmpDir, $permitted); $copyRules = array( array( 'source' => __DIR__ . '/_files/ThemeDeployment/run/source_cased_js', diff --git a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php index b841703596a..b25c05790e7 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php @@ -100,14 +100,14 @@ class ThemeTest extends \PHPUnit_Framework_TestCase $themeImage = $this->getMock('Magento\Core\Model\Theme\Image', array(), array(), '', false); $themeMock->expects($this->any())->method('getThemeImage')->will($this->returnValue($themeImage)); - $themeFactory = $this->getMock('Magento\Core\Model\Theme\FlyweightFactory', array('create'), array(), '', + $themeFactory = $this->getMock('Magento\View\Design\Theme\FlyweightFactory', array('create'), array(), '', false); $themeFactory->expects($this->once())->method('create')->will($this->returnValue($themeMock)); $this->_objectManagerMock ->expects($this->at(0)) ->method('get') - ->with('Magento\Core\Model\Theme\FlyweightFactory') + ->with('Magento\View\Design\Theme\FlyweightFactory') ->will($this->returnValue($themeFactory)); $this->_objectManagerMock diff --git a/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php b/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php index 6da9c82ede2..d8315a11c0f 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php @@ -42,7 +42,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase protected $_session; /** - * @var \Magento\Core\Model\Theme\FlyweightFactory|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Design\Theme\FlyweightFactory|PHPUnit_Framework_MockObject_MockObject */ protected $_themeFactory; @@ -69,7 +69,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase $this->_request = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); $this->_filesystem = $this->getMock('Magento\Filesystem', array(), array(), '', false); $this->_session = $this->getMock('Magento\Backend\Model\Session', array(), array(), '', false); - $this->_themeFactory = $this->getMock('Magento\Core\Model\Theme\FlyweightFactory', array('create'), array(), + $this->_themeFactory = $this->getMock('Magento\View\Design\Theme\FlyweightFactory', array('create'), array(), '', false); $this->_storageHelper = $this->getMock('Magento\Theme\Helper\Storage', @@ -158,7 +158,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase $themeModel = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false); $this->_themeFactory->expects($this->any())->method('create')->will($this->returnValue($themeModel)); $themeModel->expects($this->any())->method('getId')->will($this->returnValue($themeId)); - $customization = $this->getMock('Magento\Core\Model\Theme\Customization', array(), array(), '', false); + $customization = $this->getMock('Magento\View\Design\Theme\Customization', array(), array(), '', false); $themeModel->expects($this->any())->method('getCustomization')->will($this->returnValue($customization)); $customization->expects($this->any()) ->method('getCustomizationPath') diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/Config/CustomizationTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/Config/CustomizationTest.php index a7b6fe5b236..3a3713c08ef 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/Config/CustomizationTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Config/CustomizationTest.php @@ -52,6 +52,11 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase */ protected $_model; + /** + * @var \Magento\Core\Model\Theme\ThemeProvider|\PHPUnit_Framework_MockObject_MockBuilder + */ + protected $themeProviderMock; + protected function setUp() { $this->_storeManager = $this->getMockForAbstractClass( @@ -74,20 +79,21 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase ->method('create') ->will($this->returnValue($this->_themeCollection)); - $itemsProperty = new \ReflectionProperty($this->_themeCollection, '_items'); - $itemsProperty->setAccessible(true); - $itemsProperty->setValue( - $this->_themeCollection, array($this->_getAssignedTheme(), $this->_getUnassignedTheme()) + $this->themeProviderMock = $this->getMock( + '\Magento\Core\Model\Theme\ThemeProvider', + array('getThemeCustomizations', 'getThemeByFullPath'), + array( + $collectionFactory, + $this->getMock('\Magento\Core\Model\ThemeFactory', array(), array(), '', false), + ), + '', + false ); - $this->_designPackage->expects($this->once()) - ->method('getConfigurationDesignTheme') - ->will($this->returnValue($this->_getAssignedTheme()->getId())); - $this->_model = new \Magento\Theme\Model\Config\Customization( $this->_storeManager, $this->_designPackage, - $collectionFactory + $this->themeProviderMock ); } @@ -104,14 +110,19 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase */ public function testGetAssignedThemeCustomizations() { - $this->_themeCollection->expects($this->once())->method('load')->will( - $this->returnValue(array($this->_getAssignedTheme(), $this->_getUnassignedTheme())) - ); + $this->_designPackage->expects($this->once()) + ->method('getConfigurationDesignTheme') + ->will($this->returnValue($this->_getAssignedTheme()->getId())); $this->_storeManager->expects($this->once()) ->method('getStores') ->will($this->returnValue(array($this->_getStore()))); + $this->themeProviderMock->expects($this->once()) + ->method('getThemeCustomizations') + ->with(\Magento\Core\Model\App\Area::AREA_FRONTEND) + ->will($this->returnValue(array($this->_getAssignedTheme(), $this->_getUnassignedTheme()))); + $assignedThemes = $this->_model->getAssignedThemeCustomizations(); $this->assertArrayHasKey($this->_getAssignedTheme()->getId(), $assignedThemes); } @@ -121,14 +132,19 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase */ public function testGetUnassignedThemeCustomizations() { - $this->_themeCollection->expects($this->once())->method('load')->will( - $this->returnValue(array($this->_getAssignedTheme(), $this->_getUnassignedTheme())) - ); - $this->_storeManager->expects($this->once()) ->method('getStores') ->will($this->returnValue(array($this->_getStore()))); + $this->_designPackage->expects($this->once()) + ->method('getConfigurationDesignTheme') + ->will($this->returnValue($this->_getAssignedTheme()->getId())); + + $this->themeProviderMock->expects($this->once()) + ->method('getThemeCustomizations') + ->with(\Magento\Core\Model\App\Area::AREA_FRONTEND) + ->will($this->returnValue(array($this->_getAssignedTheme(), $this->_getUnassignedTheme()))); + $unassignedThemes = $this->_model->getUnassignedThemeCustomizations(); $this->assertArrayHasKey($this->_getUnassignedTheme()->getId(), $unassignedThemes); } @@ -142,6 +158,10 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase ->method('getStores') ->will($this->returnValue(array($this->_getStore()))); + $this->_designPackage->expects($this->once()) + ->method('getConfigurationDesignTheme') + ->will($this->returnValue($this->_getAssignedTheme()->getId())); + $stores = $this->_model->getStoresByThemes(); $this->assertArrayHasKey($this->_getAssignedTheme()->getId(), $stores); } @@ -151,14 +171,19 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase */ public function testIsThemeAssignedToDefaultStore() { - $this->_themeCollection->expects($this->once())->method('load')->will( - $this->returnValue(array($this->_getAssignedTheme(), $this->_getUnassignedTheme())) - ); - $this->_storeManager->expects($this->once()) ->method('getStores') ->will($this->returnValue(array($this->_getStore()))); + $this->_designPackage->expects($this->once()) + ->method('getConfigurationDesignTheme') + ->will($this->returnValue($this->_getAssignedTheme()->getId())); + + $this->themeProviderMock->expects($this->once()) + ->method('getThemeCustomizations') + ->with(\Magento\Core\Model\App\Area::AREA_FRONTEND) + ->will($this->returnValue(array($this->_getAssignedTheme(), $this->_getUnassignedTheme()))); + $themeAssigned = $this->_model->isThemeAssignedToStore($this->_getAssignedTheme()); $this->assertEquals(true, $themeAssigned); } @@ -168,6 +193,10 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase */ public function testIsThemeAssignedToConcreteStore() { + $this->_designPackage->expects($this->once()) + ->method('getConfigurationDesignTheme') + ->will($this->returnValue($this->_getAssignedTheme()->getId())); + $themeUnassigned = $this->_model->isThemeAssignedToStore($this->_getUnassignedTheme(), $this->_getStore()); $this->assertEquals(false, $themeUnassigned); } @@ -177,7 +206,7 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase */ protected function _getAssignedTheme() { - return new \Magento\Object(array('id' => 1)); + return new \Magento\Object(array('id' => 1, 'theme_path' => 'magento_demo')); } /** @@ -185,7 +214,7 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase */ protected function _getUnassignedTheme() { - return new \Magento\Object(array('id' => 2)); + return new \Magento\Object(array('id' => 2, 'theme_path' => 'magento_blank')); } /** diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php index 84c7611217e..ec910237090 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php @@ -76,7 +76,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase array('getStores', 'isSingleStoreMode') ); $this->_configData = $this->getMock( - 'Magento\Core\Model\Config\Value', array('getCollection', 'addFieldToFilter'), array(), '', false + 'Magento\Core\Model\Config\Value', + array('getCollection', 'addFieldToFilter', '__wakeup'), + array(), + '', + false ); $this->_configCacheMock = $this->getMockForAbstractClass('Magento\Cache\FrontendInterface'); $this->_layoutCacheMock = $this->getMockForAbstractClass('Magento\Cache\FrontendInterface'); @@ -114,6 +118,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ->method('isSingleStoreMode') ->will($this->returnValue(true)); + $themePath = 'magento_blank'; /** Unassign themes from store */ $configEntity = new \Magento\Object(array('value' => 6, 'scope_id' => 8)); @@ -134,6 +139,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_themeMock->expects($this->any()) ->method('getId') ->will($this->returnValue(6)); + $this->_themeMock->expects($this->any()) + ->method('getThemePath') + ->will($this->returnValue($themePath)); $this->_storeConfigWriter->expects($this->once()) ->method('delete'); @@ -153,6 +161,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ->method('isSingleStoreMode') ->will($this->returnValue(false)); + $themePath = 'magento_blank'; /** Unassign themes from store */ $configEntity = new \Magento\Object(array('value' => 6, 'scope_id' => 8)); @@ -173,6 +182,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_themeMock->expects($this->any()) ->method('getId') ->will($this->returnValue(6)); + $this->_themeMock->expects($this->any()) + ->method('getThemePath') + ->will($this->returnValue($themePath)); $this->_storeConfigWriter->expects($this->once()) ->method('delete'); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php index 159aeb66b82..0f56634d23f 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php @@ -37,7 +37,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase protected $_storageRoot; /** - * @var \Magento\Filesystem|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_filesystem; @@ -56,12 +56,17 @@ class StorageTest extends \PHPUnit_Framework_TestCase */ protected $_storageModel; + /** + * @var \Magento\Image\AdapterFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_imageFactory; + protected function setUp() { $this->_filesystem = $this->getMock('Magento\Filesystem', array(), array(), '', false); $this->_helperStorage = $this->getMock('Magento\Theme\Helper\Storage', array(), array(), '', false); $this->_objectManager = $this->getMock('Magento\ObjectManager', array(), array(), '', false); - $this->_imageFactory = $this->getMock('Magento\Core\Model\Image\AdapterFactory', array(), array(), '', false); + $this->_imageFactory = $this->getMock('Magento\Image\AdapterFactory', array(), array(), '', false); $this->_storageModel = new \Magento\Theme\Model\Wysiwyg\Storage( $this->_filesystem, diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/View/DeployedFilesManagerTest.php b/dev/tests/unit/testsuite/Magento/View/DeployedFilesManagerTest.php similarity index 74% rename from dev/tests/unit/testsuite/Magento/Core/Model/View/DeployedFilesManagerTest.php rename to dev/tests/unit/testsuite/Magento/View/DeployedFilesManagerTest.php index 30b6f6cd0db..364aa531b20 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/View/DeployedFilesManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/View/DeployedFilesManagerTest.php @@ -18,30 +18,27 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\View; +namespace Magento\View; class DeployedFilesManagerTest extends \PHPUnit_Framework_TestCase { /** * @param string $area * @param string $themePath - * @param string $locale * @param string $file * @param string $module * @param string $expected * @dataProvider buildDeployedFilePathDataProvider */ - public function testBuildDeployedFilePath($area, $themePath, $locale, $file, $module, $expected) + public function testBuildDeployedFilePath($area, $themePath, $file, $module, $expected) { - $actual = \Magento\Core\Model\View\DeployedFilesManager::buildDeployedFilePath( - $area, $themePath, $locale, $file, $module, $expected + $actual = \Magento\View\DeployedFilesManager::buildDeployedFilePath( + $area, $themePath, $file, $module, $expected ); $this->assertEquals($expected, $actual); } @@ -52,8 +49,8 @@ class DeployedFilesManagerTest extends \PHPUnit_Framework_TestCase public static function buildDeployedFilePathDataProvider() { return array( - 'no module' => array('a', 't', 'l', 'f', null, str_replace('/', DIRECTORY_SEPARATOR, 'a/t/f')), - 'with module' => array('a', 't', 'l', 'f', 'm', str_replace('/', DIRECTORY_SEPARATOR, 'a/t/m/f')), + 'no module' => array('a', 't', 'f', null, str_replace('/', DIRECTORY_SEPARATOR, 'a/t/f')), + 'with module' => array('a', 't', 'f', 'm', str_replace('/', DIRECTORY_SEPARATOR, 'a/t/m/f')), ); } } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Customization/AbstractFileTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/AbstractFileTest.php similarity index 81% rename from dev/tests/unit/testsuite/Magento/Core/Model/Theme/Customization/AbstractFileTest.php rename to dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/AbstractFileTest.php index bfa94b36c03..d1c70dc0360 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Customization/AbstractFileTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/AbstractFileTest.php @@ -28,7 +28,7 @@ /** * Test of file abstract service */ -namespace Magento\Core\Model\Theme\Customization; +namespace Magento\View\Design\Theme\Customization; class AbstractFileTest extends \PHPUnit_Framework_TestCase { @@ -54,10 +54,15 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_customizationPath = $this->getMock('Magento\Core\Model\Theme\Customization\Path', - array(), array(), '', false); + $this->_customizationPath = $this->getMock( + 'Magento\View\Design\Theme\Customization\Path', + array(), + array(), + '', + false + ); $this->_fileFactory = $this->getMock( - 'Magento\Core\Model\Theme\FileFactory', + 'Magento\View\Design\Theme\FileFactory', array('create'), array(), '', @@ -65,7 +70,7 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase ); $this->_filesystem = $this->getMock('Magento\Filesystem', array(), array(), '', false); - $this->_modelBuilder = $this->getMockBuilder('Magento\Core\Model\Theme\Customization\AbstractFile') + $this->_modelBuilder = $this->getMockBuilder('Magento\View\Design\Theme\Customization\AbstractFile') ->setMethods(array('getType', 'getContentType')) ->setConstructorArgs(array($this->_customizationPath, $this->_fileFactory, $this->_filesystem)); } @@ -79,8 +84,8 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::__construct - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::create + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::__construct + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::create */ public function testCreate() { @@ -88,12 +93,12 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase $file = $this->getMock('Magento\Core\Model\Theme\File', array(), array(), '', false); $file->expects($this->once())->method('setCustomizationService')->with($model); $this->_fileFactory->expects($this->once())->method('create')->will($this->returnValue($file)); - /** @var $model \Magento\Core\Model\Theme\Customization\AbstractFile */ + /** @var $model \Magento\View\Design\Theme\Customization\AbstractFile */ $this->assertEquals($file, $model->create()); } /** - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::getFullPath + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::getFullPath */ public function testGetFullPath() { @@ -107,16 +112,16 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase $this->_customizationPath->expects($this->once())->method('getCustomizationPath') ->will($this->returnValue('/path')); - /** @var $model \Magento\Core\Model\Theme\Customization\AbstractFile */ + /** @var $model \Magento\View\Design\Theme\Customization\AbstractFile */ /** @var $file \Magento\Core\Model\Theme\File */ $this->assertEquals('/path' . DIRECTORY_SEPARATOR . 'file.path', $model->getFullPath($file)); } /** - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::prepareFile - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::_prepareFileName - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::_prepareFilePath - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::_prepareSortOrder + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::prepareFile + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::_prepareFileName + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::_prepareFilePath + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::_prepareSortOrder * @dataProvider getTestContent */ public function testPrepareFile($type, $fileContent, $expectedContent, $existedFiles) @@ -127,22 +132,28 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase $files = array(); foreach ($existedFiles as $fileData) { - $file = $this->getMock('Magento\Core\Model\Theme\File', array('save'), array(), '', false); + $file = $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup', 'save'), array(), '', false); $file->setData($fileData); $files[] = $file; } - $customization = $this->getMock('Magento\Core\Model\Theme\Customization', array(), array(), '', false); + $customization = $this->getMock('Magento\View\Design\Theme\Customization', array(), array(), '', false); $customization->expects($this->atLeastOnce())->method('getFilesByType')->with($type) ->will($this->returnValue($files)); $theme = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false); $theme->expects($this->any())->method('getCustomization')->will($this->returnValue($customization)); - $file = $this->getMock('Magento\Core\Model\Theme\File', array('getTheme', 'save'), array(), '', false); + $file = $this->getMock( + 'Magento\Core\Model\Theme\File', + array('__wakeup', 'getTheme', 'save'), + array(), + '', + false + ); $file->expects($this->any())->method('getTheme')->will($this->returnValue($theme)); $file->setData($fileContent); - /** @var $model \Magento\Core\Model\Theme\Customization\AbstractFile */ + /** @var $model \Magento\View\Design\Theme\Customization\AbstractFile */ /** @var $file \Magento\Core\Model\Theme\File */ $model->prepareFile($file); $this->assertEquals($expectedContent, $file->getData()); @@ -229,14 +240,14 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::save - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::_saveFileContent + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::save + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::_saveFileContent */ public function testSave() { $model = $this->_modelBuilder->setMethods(array('getFullPath', 'getType', 'getContentType'))->getMock(); - $file = $this->getMock('Magento\Core\Model\Theme\File', null, array(), '', false); + $file = $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup'), array(), '', false); $file->setData(array( 'file_type' => 'js', 'file_name' => 'test_3.js', @@ -249,19 +260,19 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase $this->_filesystem->expects($this->once())->method('setIsAllowCreateDirectories')->with(true) ->will($this->returnSelf()); $this->_filesystem->expects($this->once())->method('write')->with('test_path', 'test content'); - /** @var $model \Magento\Core\Model\Theme\Customization\AbstractFile */ + /** @var $model \Magento\View\Design\Theme\Customization\AbstractFile */ /** @var $file \Magento\Core\Model\Theme\File */ $model->save($file); } /** - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::delete - * @covers \Magento\Core\Model\Theme\Customization\AbstractFile::_deleteFileContent + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::delete + * @covers \Magento\View\Design\Theme\Customization\AbstractFile::_deleteFileContent */ public function testDelete() { $model = $this->_modelBuilder->setMethods(array('getFullPath', 'getType', 'getContentType'))->getMock(); - $file = $this->getMock('Magento\Core\Model\Theme\File', null, array(), '', false); + $file = $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup'), array(), '', false); $file->setData(array( 'file_type' => 'js', 'file_name' => 'test_3.js', @@ -272,7 +283,7 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase $this->_filesystem->expects($this->once())->method('has')->with('test_path')->will($this->returnValue(true)); $this->_filesystem->expects($this->once())->method('delete')->with('test_path'); $model->expects($this->once())->method('getFullPath')->with($file)->will($this->returnValue('test_path')); - /** @var $model \Magento\Core\Model\Theme\Customization\AbstractFile */ + /** @var $model \Magento\View\Design\Theme\Customization\AbstractFile */ /** @var $file \Magento\Core\Model\Theme\File */ $model->delete($file); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Customization/PathTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/PathTest.php similarity index 83% rename from dev/tests/unit/testsuite/Magento/Core/Model/Theme/Customization/PathTest.php rename to dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/PathTest.php index 69de1bb17ca..cd100d33bec 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Customization/PathTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/PathTest.php @@ -28,12 +28,12 @@ /** * Test of customization path model */ -namespace Magento\Core\Model\Theme\Customization; +namespace Magento\View\Design\Theme\Customization; class PathTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Theme\Customization\Path + * @var \Magento\View\Design\Theme\Customization\Path */ protected $_model; @@ -54,13 +54,13 @@ class PathTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_theme = $this->getMock('Magento\Core\Model\Theme', null, array(), '', false); + $this->_theme = $this->getMock('Magento\Core\Model\Theme', array('__wakeup'), array(), '', false); $this->_appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); $appStateProperty = new \ReflectionProperty('\Magento\Core\Model\Theme', '_appState'); $appStateProperty->setAccessible(true); $appStateProperty->setValue($this->_theme, $this->_appState); $this->_dir = $this->getMock('Magento\App\Dir', array(), array(), '', false); - $this->_model = new \Magento\Core\Model\Theme\Customization\Path($this->_dir); + $this->_model = new \Magento\View\Design\Theme\Customization\Path($this->_dir); } protected function tearDown() @@ -71,8 +71,8 @@ class PathTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Customization\Path::__construct - * @covers \Magento\Core\Model\Theme\Customization\Path::getCustomizationPath + * @covers \Magento\View\Design\Theme\Customization\Path::__construct + * @covers \Magento\View\Design\Theme\Customization\Path::getCustomizationPath */ public function testGetCustomizationPath() { @@ -80,14 +80,14 @@ class PathTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue('/media_dir')); $expectedPath = implode( DIRECTORY_SEPARATOR, - array('/media_dir', \Magento\Core\Model\Theme\Customization\Path::DIR_NAME, '123') + array('/media_dir', \Magento\View\Design\Theme\Customization\Path::DIR_NAME, '123') ); $this->assertEquals($expectedPath, $this->_model->getCustomizationPath($this->_theme->setId(123))); $this->assertNull($this->_model->getCustomizationPath($this->_theme->setId(null))); } /** - * @covers \Magento\Core\Model\Theme\Customization\Path::getThemeFilesPath + * @covers \Magento\View\Design\Theme\Customization\Path::getThemeFilesPath */ public function testGetThemeFilesPath() { @@ -106,7 +106,7 @@ class PathTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Customization\Path::getCustomViewConfigPath + * @covers \Magento\View\Design\Theme\Customization\Path::getCustomViewConfigPath */ public function testGetCustomViewConfigPath() { @@ -114,7 +114,7 @@ class PathTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue('/media_dir')); $expectedPath = implode( DIRECTORY_SEPARATOR, - array('/media_dir', \Magento\Core\Model\Theme\Customization\Path::DIR_NAME, '123', + array('/media_dir', \Magento\View\Design\Theme\Customization\Path::DIR_NAME, '123', \Magento\Core\Model\Theme::FILENAME_VIEW_CONFIG) ); $this->assertEquals($expectedPath, $this->_model->getCustomViewConfigPath($this->_theme->setId(123))); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/CustomizationTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/CustomizationTest.php similarity index 53% rename from dev/tests/unit/testsuite/Magento/Core/Model/Theme/CustomizationTest.php rename to dev/tests/unit/testsuite/Magento/View/Design/Theme/CustomizationTest.php index ceb7307e7e0..b99e1c9c538 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/CustomizationTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/CustomizationTest.php @@ -28,121 +28,135 @@ /** * Test of theme customization model */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; class CustomizationTest extends \PHPUnit_Framework_TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockBuilder + * @var Customization */ - protected $_modelBuilder; + protected $model; /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_fileCollection; + protected $fileProvider; /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_customizationPath; + protected $customizationPath; /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_theme; + protected $theme; protected function setUp() { - $this->_fileCollection = $this->getMock('Magento\Core\Model\Resource\Theme\File\Collection', + $this->fileProvider = $this->getMock('Magento\View\Design\Theme\FileProviderInterface', array(), array(), '', false); $collectionFactory = $this->getMock('Magento\Core\Model\Resource\Theme\File\CollectionFactory', array('create'), array(), '', false); - $collectionFactory->expects($this->any())->method('create')->will($this->returnValue($this->_fileCollection)); - $this->_customizationPath = $this->getMock('Magento\Core\Model\Theme\Customization\Path', - array(), array(), '', false); - $this->_theme = $this->getMock('Magento\Core\Model\Theme', array('save', 'load'), array(), '', false); + $collectionFactory->expects($this->any())->method('create')->will($this->returnValue($this->fileProvider)); + $this->customizationPath = $this->getMock( + 'Magento\View\Design\Theme\Customization\Path', + array(), + array(), + '', + false + ); + $this->theme = $this->getMock( + 'Magento\Core\Model\Theme', + array('__wakeup', 'save', 'load'), + array(), + '', + false + ); - $this->_modelBuilder = $this->getMockBuilder('Magento\Core\Model\Theme\Customization') - ->setConstructorArgs(array($collectionFactory, $this->_customizationPath, $this->_theme)) - ->setMethods(null); + $this->model = new Customization($this->fileProvider, $this->customizationPath, $this->theme); } protected function tearDown() { - $this->_modelBuilder = null; - $this->_fileCollection = null; - $this->_customizationPath = null; - $this->_theme = null; + $this->model = null; + $this->fileProvider = null; + $this->customizationPath = null; + $this->theme = null; } /** - * @covers \Magento\Core\Model\Theme\Customization::getFiles - * @covers \Magento\Core\Model\Theme\Customization::__construct + * @covers \Magento\View\Design\Theme\Customization::getFiles + * @covers \Magento\View\Design\Theme\Customization::__construct */ public function testGetFiles() { - $this->_fileCollection->expects($this->once())->method('addThemeFilter')->with($this->_theme) - ->will($this->returnSelf()); - $this->_fileCollection->expects($this->once())->method('setDefaultOrder')->will($this->returnSelf()); - $this->_fileCollection->expects($this->once())->method('getItems')->will($this->returnValue(array())); - $this->assertEquals(array(), $this->_modelBuilder->getMock()->getFiles()); + $this->fileProvider->expects($this->once()) + ->method('getItems') + ->with($this->theme) + ->will($this->returnValue(array())); + $this->assertEquals(array(), $this->model->getFiles()); } /** - * @covers \Magento\Core\Model\Theme\Customization::getFilesByType + * @covers \Magento\View\Design\Theme\Customization::getFilesByType */ public function testGetFilesByType() { - $this->_fileCollection->expects($this->once())->method('addThemeFilter')->with($this->_theme) - ->will($this->returnSelf()); - $this->_fileCollection->expects($this->once())->method('setDefaultOrder')->will($this->returnSelf()); - $this->_fileCollection->expects($this->once())->method('addFieldToFilter')->with('file_type', 'sample-type') - ->will($this->returnSelf()); - $this->_fileCollection->expects($this->once())->method('getItems')->will($this->returnValue(array())); - $this->assertEquals(array(), $this->_modelBuilder->getMock()->getFilesByType('sample-type')); + $type = 'sample-type'; + $this->fileProvider->expects($this->once()) + ->method('getItems') + ->with($this->theme, array('file_type' => $type)) + ->will($this->returnValue(array())); + $this->assertEquals(array(), $this->model->getFilesByType($type)); } /** - * @covers \Magento\Core\Model\Theme\Customization::generateFileInfo + * @covers \Magento\View\Design\Theme\Customization::generateFileInfo */ public function testGenerationOfFileInfo() { - $file = $this->getMock('Magento\Core\Model\Theme\File', array('getFileInfo'), array(), '', false); - $file->expects($this->once())->method('getFileInfo')->will($this->returnValue(array('sample-generation'))); + $file = $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup', 'getFileInfo'), array(), '', false); + $file->expects($this->once()) + ->method('getFileInfo') + ->will($this->returnValue(array('sample-generation'))); $this->assertEquals( array(array('sample-generation')), - $this->_modelBuilder->getMock()->generateFileInfo(array($file)) + $this->model->generateFileInfo(array($file)) ); } /** - * @covers \Magento\Core\Model\Theme\Customization::getCustomizationPath + * @covers \Magento\View\Design\Theme\Customization::getCustomizationPath */ public function testGetCustomizationPath() { - $this->_customizationPath->expects($this->once())->method('getCustomizationPath')->with($this->_theme) + $this->customizationPath->expects($this->once()) + ->method('getCustomizationPath') + ->with($this->theme) ->will($this->returnValue('path')); - $this->assertEquals('path', $this->_modelBuilder->getMock()->getCustomizationPath()); + $this->assertEquals('path', $this->model->getCustomizationPath()); } /** - * @covers \Magento\Core\Model\Theme\Customization::getThemeFilesPath + * @covers \Magento\View\Design\Theme\Customization::getThemeFilesPath * @dataProvider getThemeFilesPathDataProvider * @param string $type * @param string $expectedMethod */ public function testGetThemeFilesPath($type, $expectedMethod) { - $this->_theme->setData(array( + $this->theme->setData(array( 'id' => 123, 'type' => $type, 'area' => 'area51', 'theme_path' => 'theme_path' )); - $this->_customizationPath->expects($this->once())->method($expectedMethod)->with($this->_theme) + $this->customizationPath->expects($this->once()) + ->method($expectedMethod) + ->with($this->theme) ->will($this->returnValue('path')); - $this->assertEquals('path', $this->_modelBuilder->getMock()->getThemeFilesPath()); + $this->assertEquals('path', $this->model->getThemeFilesPath()); } /** @@ -151,38 +165,47 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase public function getThemeFilesPathDataProvider() { return array( - 'physical' => array(\Magento\Core\Model\Theme::TYPE_PHYSICAL, 'getThemeFilesPath'), - 'virtual' => array(\Magento\Core\Model\Theme::TYPE_VIRTUAL, 'getCustomizationPath'), - 'staging' => array(\Magento\Core\Model\Theme::TYPE_STAGING, 'getCustomizationPath'), + 'physical' => array(\Magento\View\Design\ThemeInterface::TYPE_PHYSICAL, 'getThemeFilesPath'), + 'virtual' => array(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL, 'getCustomizationPath'), + 'staging' => array(\Magento\View\Design\ThemeInterface::TYPE_STAGING, 'getCustomizationPath'), ); } /** - * @covers \Magento\Core\Model\Theme\Customization::getCustomViewConfigPath + * @covers \Magento\View\Design\Theme\Customization::getCustomViewConfigPath */ public function testGetCustomViewConfigPath() { - $this->_customizationPath->expects($this->once())->method('getCustomViewConfigPath')->with($this->_theme) + $this->customizationPath->expects($this->once()) + ->method('getCustomViewConfigPath') + ->with($this->theme) ->will($this->returnValue('path')); - $this->assertEquals('path', $this->_modelBuilder->getMock()->getCustomViewConfigPath()); + $this->assertEquals('path', $this->model->getCustomViewConfigPath()); } /** - * @covers \Magento\Core\Model\Theme\Customization::reorder + * @covers \Magento\View\Design\Theme\Customization::reorder * @dataProvider customFileContent */ public function testReorder($sequence, $filesContent) { $files = array(); + $type = 'sample-type'; foreach ($filesContent as $fileContent) { - $file = $this->getMock('Magento\Core\Model\Theme\File', array('save'), array(), '', false); - $file->expects($fileContent['isCalled'])->method('save')->will($this->returnSelf()); + $file = $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup', 'save'), array(), '', false); + $file->expects($fileContent['isCalled']) + ->method('save') + ->will($this->returnSelf()); $file->setData($fileContent['content']); $files[] = $file; } - $model = $this->_modelBuilder->setMethods(array('getFilesByType'))->getMock(); - $model->expects($this->once())->method('getFilesByType')->with('sample-type')->will($this->returnValue($files)); - $model->reorder('sample-type', $sequence); + $this->fileProvider->expects($this->once()) + ->method('getItems') + ->with($this->theme, array('file_type' => $type)) + ->will($this->returnValue($files)); + $this->assertInstanceOf( + 'Magento\View\Design\Theme\CustomizationInterface', $this->model->reorder($type, $sequence) + ); } /** @@ -230,11 +253,11 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Customization::delete + * @covers \Magento\View\Design\Theme\Customization::delete */ public function testDelete() { - $file = $this->getMock('Magento\Core\Model\Theme\File', array('delete'), array(), '', false); + $file = $this->getMock('Magento\Core\Model\Theme\File', array('__wakeup', 'delete'), array(), '', false); $file->expects($this->once())->method('delete')->will($this->returnSelf()); $file->setData(array( 'id' => 1, @@ -243,9 +266,11 @@ class CustomizationTest extends \PHPUnit_Framework_TestCase 'content' => 'css content', 'sort_order' => 1 )); + $this->fileProvider->expects($this->once()) + ->method('getItems') + ->with($this->theme) + ->will($this->returnValue(array($file))); - $model = $this->_modelBuilder->setMethods(array('getFiles'))->getMock(); - $model->expects($this->once())->method('getFiles')->will($this->returnValue(array($file))); - $model->delete(array(1)); + $this->assertInstanceOf('Magento\View\Design\Theme\CustomizationInterface', $this->model->delete(array(1))); } } diff --git a/dev/tests/unit/testsuite/Magento/View/Design/Theme/FlyweightFactoryTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/FlyweightFactoryTest.php new file mode 100644 index 00000000000..b1af1fc37f4 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/FlyweightFactoryTest.php @@ -0,0 +1,115 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\View\Design\Theme; + +class FlyweightFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\View\Design\Theme\ThemeProviderInterface + */ + protected $themeProviderMock; + + /** + * @var FlyweightFactory + */ + protected $factory; + + protected function setUp() + { + $this->themeProviderMock = $this->getMock('Magento\View\Design\Theme\ThemeProviderInterface'); + $this->factory = new FlyweightFactory($this->themeProviderMock); + } + + /** + * @covers \Magento\View\Design\Theme\FlyweightFactory::createById + */ + public function testCreateById() + { + $themeId = 5; + $theme = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false); + $theme->expects($this->exactly(3)) + ->method('getId') + ->will($this->returnValue($themeId)); + + $theme->expects($this->once()) + ->method('getFullPath') + ->will($this->returnValue(null)); + + $this->themeProviderMock->expects($this->once()) + ->method('getThemeById') + ->with($themeId) + ->will($this->returnValue($theme)); + + $this->assertSame($theme, $this->factory->create($themeId)); + } + + /** + * @covers \Magento\View\Design\Theme\FlyweightFactory::createByPath + */ + public function testCreateByPath() + { + $path = 'frontend/magento_fixed_width'; + $themeId = 7; + $theme = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false); + $theme->expects($this->exactly(3)) + ->method('getId') + ->will($this->returnValue($themeId)); + + $theme->expects($this->once()) + ->method('getFullPath') + ->will($this->returnValue($path)); + + $this->themeProviderMock->expects($this->once()) + ->method('getThemeByFullPath') + ->with('frontend/frontend/magento_fixed_width') + ->will($this->returnValue($theme)); + + $this->assertSame($theme, $this->factory->create($path)); + } + + public function testCreateDummy() + { + $themeId = 0; + $theme = $this->getMock('Magento\Core\Model\Theme', array(), array(), '', false); + $theme->expects($this->once()) + ->method('getId') + ->will($this->returnValue($themeId)); + + $this->themeProviderMock->expects($this->once()) + ->method('getThemeById') + ->with($themeId) + ->will($this->returnValue($theme)); + + $this->assertNull($this->factory->create($themeId)); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Incorrect theme identification key + */ + public function testNegativeCreate() + { + $this->factory->create(null); + } +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ImageTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/ImageTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/Core/Model/Theme/ImageTest.php rename to dev/tests/unit/testsuite/Magento/View/Design/Theme/ImageTest.php index 603b03a6e01..b6fa90021a4 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ImageTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/ImageTest.php @@ -28,12 +28,12 @@ /** * Test theme image model */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; class ImageTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Theme\Image + * @var \Magento\View\Design\Theme\Image */ protected $_model; @@ -48,7 +48,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase protected $_imageMock; /** - * @var \Magento\Core\Model\Theme\Image\Uploader|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Design\Theme\Image\Uploader|PHPUnit_Framework_MockObject_MockObject */ protected $_uploaderMock; @@ -60,16 +60,22 @@ class ImageTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_filesystemMock = $this->getMock('Magento\Filesystem', array(), array(), '', false, false); - $imageFactory = $this->getMock('Magento\Core\Model\Image\Factory', array(), array(), '', false, false); + $imageFactory = $this->getMock('Magento\Image\Factory', array(), array(), '', false, false); $this->_imageMock = $this->getMock('Magento\Image', array(), array(), '', false, false); $imageFactory->expects($this->any())->method('create')->will($this->returnValue($this->_imageMock)); - $this->_themeMock = $this->getMock('Magento\Core\Model\Theme', null, array(), '', false, false); - $this->_uploaderMock = $this->getMock('Magento\Core\Model\Theme\Image\Uploader', - array(), array(), 'UploaderProxy', false, false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false, false); + $this->_themeMock = $this->getMock('Magento\Core\Model\Theme', array('__wakeup'), array(), '', false, false); + $this->_uploaderMock = $this->getMock( + 'Magento\View\Design\Theme\Image\Uploader', + array(), + array(), + 'UploaderProxy', + false, + false + ); - $this->_model = new \Magento\Core\Model\Theme\Image( + $this->_model = new Image( $this->_filesystemMock, $imageFactory, $this->_uploaderMock, @@ -120,18 +126,18 @@ class ImageTest extends \PHPUnit_Framework_TestCase 'theme_title' => 'Sample theme', 'preview_image' => 'images/preview.png', 'area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, - 'type' => \Magento\Core\Model\Theme::TYPE_VIRTUAL + 'type' => \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL ); } /** - * @covers \Magento\Core\Model\Theme\Image::__construct + * @covers \Magento\View\Design\Theme\Image::__construct */ public function testConstructor() { - $themeImage = new \Magento\Core\Model\Theme\Image( + $themeImage = new \Magento\View\Design\Theme\Image( $this->_filesystemMock, - $this->getMock('Magento\Core\Model\Image\Factory', array(), array(), '', false, false), + $this->getMock('Magento\Image\Factory', array(), array(), '', false, false), $this->_uploaderMock, $this->_getImagePathMock(), $this->getMock('Magento\Logger', array(), array(), '', false, false), @@ -141,7 +147,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image::createPreviewImage + * @covers \Magento\View\Design\Theme\Image::createPreviewImage */ public function testCreatePreviewImage() { @@ -153,7 +159,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image::createPreviewImageCopy + * @covers \Magento\View\Design\Theme\Image::createPreviewImageCopy */ public function testCreatePreviewImageCopy() { @@ -168,7 +174,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image::removePreviewImage + * @covers \Magento\View\Design\Theme\Image::removePreviewImage */ public function testRemovePreviewImage() { @@ -180,7 +186,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image::removePreviewImage + * @covers \Magento\View\Design\Theme\Image::removePreviewImage */ public function testRemoveEmptyPreviewImage() { @@ -192,7 +198,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image::uploadPreviewImage + * @covers \Magento\View\Design\Theme\Image::uploadPreviewImage */ public function testUploadPreviewImage() { @@ -208,7 +214,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image::getPreviewImageUrl + * @covers \Magento\View\Design\Theme\Image::getPreviewImageUrl */ public function testGetPreviewImageUrl() { @@ -218,7 +224,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\Core\Model\Theme\Image::getPreviewImageUrl + * @covers \Magento\View\Design\Theme\Image::getPreviewImageUrl */ public function testGetDefaultPreviewImageUrl() { diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/View/FileSystemTest.php b/dev/tests/unit/testsuite/Magento/View/FileSystemTest.php similarity index 90% rename from dev/tests/unit/testsuite/Magento/Core/Model/View/FileSystemTest.php rename to dev/tests/unit/testsuite/Magento/View/FileSystemTest.php index 463a3a3308d..6c51e6e7c97 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/View/FileSystemTest.php +++ b/dev/tests/unit/testsuite/Magento/View/FileSystemTest.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -28,12 +26,12 @@ /** * Test for view filesystem model */ -namespace Magento\Core\Model\View; +namespace Magento\View; class FileSystemTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\View\FileSystem|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\FileSystem|PHPUnit_Framework_MockObject_MockObject */ protected $_model; @@ -43,7 +41,7 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase protected $_strategyPool; /** - * @var \Magento\Core\Model\View\Service|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Service|PHPUnit_Framework_MockObject_MockObject */ protected $_viewService; @@ -53,11 +51,11 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase $this->_strategyPool = $this->getMock('Magento\View\Design\FileResolution\StrategyPool', array(), array(), '', false ); - $this->_viewService = $this->getMock('Magento\Core\Model\View\Service', + $this->_viewService = $this->getMock('Magento\View\Service', array('extractScope', 'updateDesignParams'), array(), '', false ); - $this->_model = new \Magento\Core\Model\View\FileSystem($this->_strategyPool, $this->_viewService); + $this->_model = new \Magento\View\FileSystem($this->_strategyPool, $this->_viewService); } public function testGetFilename() @@ -65,7 +63,7 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase $params = array( 'area' => 'some_area', 'themeModel' => $this->getMock('Magento\View\Design\ThemeInterface', array(), array(), '', false, false), - 'module' => 'Some_Module' //It should be set in \Magento\Core\Model\View\Service::extractScope + 'module' => 'Some_Module' //It should be set in \Magento\View\Service::extractScope // but PHPUnit has problems with passing arguments by reference ); $file = 'Some_Module::some_file.ext'; @@ -122,7 +120,7 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase 'area' => 'some_area', 'themeModel' => $this->getMock('Magento\View\Design\ThemeInterface', array(), array(), '', false, false), 'locale' => 'some_locale', - 'module' => 'Some_Module' //It should be set in \Magento\Core\Model\View\Service::extractScope + 'module' => 'Some_Module' //It should be set in \Magento\View\Service::extractScope // but PHPUnit has problems with passing arguments by reference ); $file = 'Some_Module::some_file.ext'; diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Decorator/ModuleOutputTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Decorator/ModuleOutputTest.php index 2d5f9fd36b9..ea8946c7ed5 100644 --- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Decorator/ModuleOutputTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Decorator/ModuleOutputTest.php @@ -44,7 +44,7 @@ class ModuleOutputTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_fileSource = $this->getMockForAbstractClass('Magento\View\Layout\File\SourceInterface'); - $this->_moduleManager = $this->getMock('Magento\Core\Model\ModuleManager', array(), array(), '', false); + $this->_moduleManager = $this->getMock('Magento\Module\Manager', array(), array(), '', false); $this->_moduleManager ->expects($this->any()) ->method('isOutputEnabled') diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php index 29a28309c5e..da30f6bf96d 100644 --- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php @@ -129,7 +129,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase { $filePath = 'design/area/theme_path/Module_One/layout/override/theme/parent_theme/1.xml'; $this->setExpectedException( - 'Magento\Core\Exception', + 'Magento\Exception', "Trying to override layout file '$filePath' for theme 'parent_theme'" . ", which is not ancestor of theme 'theme_path'" ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/CssTest.php b/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php similarity index 96% rename from dev/tests/unit/testsuite/Magento/Core/Helper/CssTest.php rename to dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php index 7d983d85acf..846473a7ced 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Helper/CssTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Helper; +namespace Magento\View\Url; -class CssTest extends \PHPUnit_Framework_TestCase +class CssResolverTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Helper\Css + * @var \Magento\View\Url\CssResolver */ protected $_object; @@ -35,7 +35,7 @@ class CssTest extends \PHPUnit_Framework_TestCase { $filesystem = new \Magento\Filesystem(new \Magento\Filesystem\Adapter\Local()); $dirs = new \Magento\App\Dir('/base_dir'); - $this->_object = new \Magento\Core\Helper\Css($filesystem, $dirs); + $this->_object = new \Magento\View\Url\CssResolver($filesystem, $dirs); } /** @@ -141,7 +141,7 @@ class CssTest extends \PHPUnit_Framework_TestCase /** * @param string $originalFile * @param string $newFile - * @expectedException \Magento\Core\Exception + * @expectedException \Magento\Exception * @expectedExceptionMessage Offset can be calculated for internal resources only. * @dataProvider replaceCssRelativeUrlsExceptionDataProvider */ diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/_files/result.css b/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css similarity index 100% rename from dev/tests/unit/testsuite/Magento/Core/Helper/_files/result.css rename to dev/tests/unit/testsuite/Magento/View/Url/_files/result.css diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/_files/source.css b/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css similarity index 100% rename from dev/tests/unit/testsuite/Magento/Core/Helper/_files/source.css rename to dev/tests/unit/testsuite/Magento/View/Url/_files/source.css diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/View/UrlTest.php b/dev/tests/unit/testsuite/Magento/View/UrlTest.php similarity index 76% rename from dev/tests/unit/testsuite/Magento/Core/Model/View/UrlTest.php rename to dev/tests/unit/testsuite/Magento/View/UrlTest.php index 8d0460a6f08..3c865493a52 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/View/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/View/UrlTest.php @@ -18,14 +18,12 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\View; +namespace Magento\View; class UrlTest extends \PHPUnit_Framework_TestCase { @@ -60,25 +58,21 @@ class UrlTest extends \PHPUnit_Framework_TestCase ->method('getDir') ->will($this->returnValue('some_dir')); - // 3. Get store model - $store = $this->getMock('Magento\Core\Model\Store', array(), array(), '', false); - $store->expects($this->any()) + // 3. Get url model + $urlBuilder = $this->getMockBuilder('Magento\UrlInterface')->getMockForAbstractClass(); + $urlBuilder->expects($this->any()) ->method('getBaseUrl') ->will($this->returnValue('http://example.com/')); - $store->expects($this->any()) - ->method('getConfig') - ->will($this->returnValue($isSigned)); - // 4. Get store manager - /** @var $storeManager \Magento\Core\Model\StoreManager|PHPUnit_Framework_MockObject_MockObject */ - $storeManager = $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false); - $storeManager->expects($this->any()) - ->method('getStore') - ->will($this->returnValue($store)); + // 4. Get urlConfig model + $urlConfig = $this->getMockBuilder('Magento\View\Url\ConfigInterface')->getMockForAbstractClass(); + $urlConfig->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($isSigned)); // 5. Get viewService model - /** @var $viewService \Magento\Core\Model\View\Service|PHPUnit_Framework_MockObject_MockObject */ - $viewService = $this->getMock('Magento\Core\Model\View\Service', + /** @var $viewService \Magento\View\Service|PHPUnit_Framework_MockObject_MockObject */ + $viewService = $this->getMock('Magento\View\Service', array('updateDesignParams', 'extractScope', 'isViewFileOperationAllowed'), array(), '', false ); $viewService->expects($this->any()) @@ -91,22 +85,25 @@ class UrlTest extends \PHPUnit_Framework_TestCase ->method('updateDesignParams'); // 6. Get publisher model - /** @var $publisher \Magento\Core\Model\View\Publisher|PHPUnit_Framework_MockObject_MockObject */ - $publisher = $this->getMock('Magento\Core\Model\View\Publisher', array(), array(), '', false); + /** @var $publisher \Magento\View\Publisher|PHPUnit_Framework_MockObject_MockObject */ + $publisher = $this->getMock('Magento\View\Publisher', array(), array(), '', false); $publisher->expects($this->any()) ->method('getPublicFilePath') ->will($this->returnValue(str_replace('/', DIRECTORY_SEPARATOR, 'some_dir/public_dir/a/t/m/file.js'))); // 7. Get deployed file manager - /** @var $dFManager \Magento\Core\Model\View\DeployedFilesManager|PHPUnit_Framework_MockObject_MockObject */ - $dFManager = $this->getMock('Magento\Core\Model\View\DeployedFilesManager', array(), array(), '', + /** @var $dFManager \Magento\View\DeployedFilesManager|PHPUnit_Framework_MockObject_MockObject */ + $dFManager = $this->getMock('Magento\View\DeployedFilesManager', array(), array(), '', false ); + // 8. Get default fake url map + $urlMap = array('fake' => array('key' => "some_key", 'value' => "some_value")); + // Create model to be tested - /** @var $model \Magento\Core\Model\View\Url|PHPUnit_Framework_MockObject_MockObject */ - $model = new \Magento\Core\Model\View\Url( - $filesystem, $dirs, $storeManager, $viewService, $publisher, $dFManager + /** @var $model \Magento\View\Url|PHPUnit_Framework_MockObject_MockObject */ + $model = new \Magento\View\Url( + $filesystem, $dirs, $urlBuilder, $urlConfig, $viewService, $publisher, $dFManager, $urlMap ); // Test diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php index 53c28f37b9e..0bd36e0d007 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php @@ -51,10 +51,10 @@ class RestTest extends \PHPUnit_Framework_TestCase /** @var \Magento\App\State */ protected $_appStateMock; - /** @var \Magento\Oauth\Service\OauthV1 */ + /** @var \Magento\Oauth\Oauth */ protected $_oauthServiceMock; - /** @var \Magento\Oauth\Helper\Data */ + /** @var \Magento\Oauth\Helper\Request */ protected $_oauthHelperMock; const SERVICE_METHOD = \Magento\Webapi\Model\Rest\Config::KEY_METHOD; @@ -95,11 +95,11 @@ class RestTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $this->_oauthServiceMock = $this->getMockBuilder('Magento\Oauth\Service\OauthV1') + $this->_oauthServiceMock = $this->getMockBuilder('Magento\Oauth\Oauth') ->disableOriginalConstructor() ->getMock(); - $this->_oauthHelperMock = $this->getMockBuilder('Magento\Oauth\Helper\Data') + $this->_oauthHelperMock = $this->getMockBuilder('Magento\Oauth\Helper\Request') ->disableOriginalConstructor() ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php index 4d5d4c790f6..12bd7cd10f5 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php @@ -51,12 +51,9 @@ class SoapTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Core\Model\App */ protected $_applicationMock; - /** @var \Magento\Oauth\Service\OauthV1 */ + /** @var \Magento\Oauth\Oauth */ protected $_oauthServiceMock; - /** @var \Magento\Oauth\Helper\Service */ - protected $_oauthHelperMock; - /** * Set up Controller object. */ @@ -101,11 +98,7 @@ class SoapTest extends \PHPUnit_Framework_TestCase $this->_applicationMock->expects($this->any())->method('getLocale')->will($this->returnValue($localeMock)); $this->_applicationMock->expects($this->any())->method('isDeveloperMode')->will($this->returnValue(false)); - $this->_oauthServiceMock = $this->getMockBuilder('Magento\Oauth\Service\OauthV1') - ->disableOriginalConstructor() - ->getMock(); - - $this->_oauthHelperMock = $this->getMockBuilder('Magento\Oauth\Helper\Service') + $this->_oauthServiceMock = $this->getMockBuilder('Magento\Oauth\Oauth') ->disableOriginalConstructor() ->getMock(); @@ -122,8 +115,7 @@ class SoapTest extends \PHPUnit_Framework_TestCase $this->_errorProcessorMock, $this->_appStateMock, $this->_applicationMock, - $this->_oauthServiceMock, - $this->_oauthHelperMock + $this->_oauthServiceMock ); } @@ -144,7 +136,6 @@ class SoapTest extends \PHPUnit_Framework_TestCase parent::tearDown(); } - /** * Test redirected to install page */ @@ -214,7 +205,7 @@ EXPECTED_MESSAGE; $_SERVER['HTTP_AUTHORIZATION'] = 'OAuth access_token'; $this->_oauthServiceMock->expects($this->once()) ->method('validateAccessToken') - ->will($this->returnValue(array('isValid' => true))); + ->will($this->returnValue(true)); $this->_soapController->dispatch($this->_requestMock); unset($_SERVER['HTTP_AUTHORIZATION']); @@ -265,6 +256,7 @@ EXPECTED_MESSAGE; /** * Mock getParam() of request object to return given value. * + * @param $param * @param $value */ protected function _mockGetParam($param, $value) @@ -274,5 +266,4 @@ EXPECTED_MESSAGE; ->with($param) ->will($this->returnValue($value)); } - } diff --git a/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php b/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php index df7bb69fefe..205b4e93e45 100644 --- a/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php +++ b/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php @@ -33,7 +33,7 @@ class InstanceTest extends \PHPUnit_Framework_TestCase protected $_widgetModelMock; /** - * @var \Magento\Core\Model\View\FileSystem|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\FileSystem|PHPUnit_Framework_MockObject_MockObject */ protected $_viewFileSystemMock; @@ -58,13 +58,13 @@ class InstanceTest extends \PHPUnit_Framework_TestCase $this->_widgetModelMock = $this->getMockBuilder('Magento\Widget\Model\Widget') ->disableOriginalConstructor() ->getMock(); - $this->_viewFileSystemMock = $this->getMockBuilder('Magento\Core\Model\View\FileSystem') + $this->_viewFileSystemMock = $this->getMockBuilder('Magento\View\FileSystem') ->disableOriginalConstructor() ->getMock(); $this->_namespaceResolver = $this->getMockBuilder('\Magento\Widget\Model\NamespaceResolver') ->disableOriginalConstructor() ->getMock(); - $this->_cacheTypesListMock = $this->getMock('Magento\Core\Model\Cache\TypeListInterface'); + $this->_cacheTypesListMock = $this->getMock('Magento\App\Cache\TypeListInterface'); $this->_readerMock = $this->getMockBuilder('Magento\Widget\Model\Config\Reader') ->disableOriginalConstructor() ->getMock(); diff --git a/dev/tools/Magento/Tools/Migration/Acl/log/AclXPathToAclId.log b/dev/tools/Magento/Tools/Migration/Acl/log/AclXPathToAclId.log index e2c48e5d133..0e63dbfbe53 100644 --- a/dev/tools/Magento/Tools/Migration/Acl/log/AclXPathToAclId.log +++ b/dev/tools/Magento/Tools/Migration/Acl/log/AclXPathToAclId.log @@ -1 +1 @@ -{"config\/acl\/resources\/admin\/cms\/magento_banner":"Magento_Banner::magento_banner","config\/acl\/resources\/admin\/catalog\/events":"Magento_CatalogEvent::events","config\/acl\/resources\/admin\/system\/config\/magento_catalogpermissions":"Magento_CatalogPermissions::magento_catalogpermissions","config\/acl\/resources\/admin\/catalog\/magento_catalogpermissions":"Magento_CatalogPermissions::catalog_magento_catalogpermissions","config\/acl\/resources\/admin\/sales\/magento_advancedcheckout":"Magento_AdvancedCheckout::magento_advancedcheckout","config\/acl\/resources\/admin\/sales\/magento_advancedcheckout\/view":"Magento_AdvancedCheckout::view","config\/acl\/resources\/admin\/sales\/magento_advancedcheckout\/update":"Magento_AdvancedCheckout::update","config\/acl\/resources\/admin\/cms\/page\/save_revision":"Magento_VersionsCms::save_revision","config\/acl\/resources\/admin\/cms\/page\/delete_revision":"Magento_VersionsCms::delete_revision","config\/acl\/resources\/admin\/cms\/page\/publish_revision":"Magento_VersionsCms::publish_revision","config\/acl\/resources\/admin\/cms\/hierarchy":"Magento_VersionsCms::hierarchy","config\/acl\/resources\/admin\/customer\/customersegment":"Magento_CustomerSegment::customersegment","config\/acl\/resources\/admin\/report\/customers\/segment":"Magento_CustomerSegment::segment","config\/acl\/resources\/admin\/customer\/attributes":"Magento_CustomerCustomAttributes::attributes","config\/acl\/resources\/admin\/customer\/attributes\/customer_attributes":"Magento_CustomerCustomAttributes::customer_attributes","config\/acl\/resources\/admin\/customer\/attributes\/customer_address_attributes":"Magento_CustomerCustomAttributes::customer_address_attributes","config\/acl\/resources\/admin\/system\/config\/giftcardaccount":"Magento_GiftCardAccount::giftcardaccount","config\/acl\/resources\/admin\/customer\/giftcardaccount":"Magento_GiftCardAccount::customer_giftcardaccount","config\/acl\/resources\/admin\/system\/config\/giftcard":"Magento_GiftCard::giftcard","config\/acl\/resources\/admin\/system\/config\/magento_giftregistry":"Magento_GiftRegistry::magento_giftregistry","config\/acl\/resources\/admin\/customer\/magento_giftregistry":"Magento_GiftRegistry::customer_magento_giftregistry","config\/acl\/resources\/admin\/sales\/magento_giftwrapping":"Magento_GiftWrapping::magento_giftwrapping","config\/acl\/resources\/admin\/system\/convert\/enterprise_scheduled_operation":"Magento_ScheduledImportExport::enterprise_scheduled_operation","config\/acl\/resources\/admin\/customer\/magento_invitation":"Magento_Invitation::magento_invitation","config\/acl\/resources\/admin\/report\/magento_invitation":"Magento_Invitation::report_magento_invitation","config\/acl\/resources\/admin\/report\/magento_invitation\/general":"Magento_Invitation::general","config\/acl\/resources\/admin\/report\/magento_invitation\/customer":"Magento_Invitation::magento_invitation_customer","config\/acl\/resources\/admin\/report\/magento_invitation\/order":"Magento_Invitation::order","config\/acl\/resources\/admin\/system\/config\/magento_invitation":"Magento_Invitation::config_magento_invitation","config\/acl\/resources\/admin\/system\/config\/logging":"Magento_Logging::logging","config\/acl\/resources\/admin\/system\/magento_logging":"Magento_Logging::magento_logging","config\/acl\/resources\/admin\/system\/magento_logging\/events":"Magento_Logging::magento_logging_events","config\/acl\/resources\/admin\/system\/magento_logging\/backups":"Magento_Logging::backups","config\/acl\/resources\/admin\/system\/crypt_key":"Magento_Pci::crypt_key","config\/acl\/resources\/admin\/system\/acl\/locks":"Magento_Pci::locks","config\/acl\/resources\/admin\/catalog\/products\/read_product_price":"Magento_PricePermissions::read_product_price","config\/acl\/resources\/admin\/catalog\/products\/read_product_price\/edit_product_price":"Magento_PricePermissions::edit_product_price","config\/acl\/resources\/admin\/catalog\/products\/edit_product_status":"Magento_PricePermissions::edit_product_status","config\/acl\/resources\/admin\/promo\/catalog\/edit":"Magento_PromotionPermissions::edit","config\/acl\/resources\/admin\/promo\/quote\/edit":"Magento_PromotionPermissions::quote_edit","config\/acl\/resources\/admin\/promo\/magento_reminder\/edit":"Magento_PromotionPermissions::magento_reminder_edit","config\/acl\/resources\/admin\/promo\/magento_reminder":"Magento_Reminder::magento_reminder","config\/acl\/resources\/admin\/system\/config\/promo":"Magento_SalesRule::config_promo","config\/acl\/resources\/admin\/customer\/manage\/reward_balance":"Magento_Reward::reward_balance","config\/acl\/resources\/admin\/sales\/order\/actions\/create\/reward_spend":"Magento_Reward::reward_spend","config\/acl\/resources\/admin\/customer\/rates":"Magento_Reward::rates","config\/acl\/resources\/admin\/system\/config\/magento_reward":"Magento_Reward::magento_reward","config\/acl\/resources\/admin\/sales\/magento_rma":"Magento_Rma::magento_rma","config\/acl\/resources\/admin\/sales\/magento_rma\/rma_manage":"Magento_Rma::rma_manage","config\/acl\/resources\/admin\/sales\/magento_rma\/rma_attribute":"Magento_Rma::rma_attribute","config\/acl\/resources\/admin\/sales\/archive":"Magento_SalesArchive::archive","config\/acl\/resources\/admin\/sales\/archive\/orders":"Magento_SalesArchive::orders","config\/acl\/resources\/admin\/sales\/archive\/orders\/add":"Magento_SalesArchive::add","config\/acl\/resources\/admin\/sales\/archive\/orders\/remove":"Magento_SalesArchive::remove","config\/acl\/resources\/admin\/sales\/archive\/invoices":"Magento_SalesArchive::invoices","config\/acl\/resources\/admin\/sales\/archive\/shipments":"Magento_SalesArchive::shipments","config\/acl\/resources\/admin\/sales\/archive\/creditmemos":"Magento_SalesArchive::creditmemos","config\/acl\/resources\/admin\/catalog\/targetrule":"Magento_TargetRule::targetrule","config\/acl\/resources\/admin\/report\/customers\/wishlist":"Magento_MultipleWishlist::wishlist","config\/acl\/resources\/admin\/system\/adminnotification":"Magento_AdminNotification::adminnotification","config\/acl\/resources\/admin\/system\/adminnotification\/show_toolbar":"Magento_AdminNotification::show_toolbar","config\/acl\/resources\/admin\/system\/adminnotification\/show_list":"Magento_AdminNotification::show_list","config\/acl\/resources\/admin\/system\/adminnotification\/mark_as_read":"Magento_AdminNotification::mark_as_read","config\/acl\/resources\/admin\/system\/adminnotification\/remove":"Magento_AdminNotification::adminnotification_remove","config\/acl\/resources\/all":"Magento_Adminhtml::all","config\/acl\/resources\/admin":"Magento_Adminhtml::admin","config\/acl\/resources\/admin\/dashboard":"Magento_Adminhtml::dashboard","config\/acl\/resources\/admin\/system":"Magento_Adminhtml::system","config\/acl\/resources\/admin\/system\/store":"Magento_Adminhtml::store","config\/acl\/resources\/admin\/system\/design":"Magento_Adminhtml::design","config\/acl\/resources\/admin\/system\/design\/schedule":"Magento_Adminhtml::schedule","config\/acl\/resources\/admin\/system\/config":"Magento_Adminhtml::config","config\/acl\/resources\/admin\/system\/config\/general":"Magento_Adminhtml::config_general","config\/acl\/resources\/admin\/system\/config\/web":"Magento_Adminhtml::web","config\/acl\/resources\/admin\/system\/config\/design":"Magento_Adminhtml::config_design","config\/acl\/resources\/admin\/system\/config\/system":"Magento_Adminhtml::config_system","config\/acl\/resources\/admin\/system\/config\/advanced":"Magento_Adminhtml::advanced","config\/acl\/resources\/admin\/system\/config\/trans_email":"Magento_Adminhtml::trans_email","config\/acl\/resources\/admin\/system\/config\/dev":"Magento_Adminhtml::dev","config\/acl\/resources\/admin\/system\/config\/currency":"Magento_Adminhtml::currency","config\/acl\/resources\/admin\/system\/config\/sendfriend":"Magento_Adminhtml::sendfriend","config\/acl\/resources\/admin\/system\/config\/admin":"Magento_Adminhtml::config_admin","config\/acl\/resources\/admin\/system\/currency":"Magento_CurrencySymbol::system_currency","config\/acl\/resources\/admin\/system\/email_template":"Magento_Adminhtml::email_template","config\/acl\/resources\/admin\/system\/variable":"Magento_Adminhtml::variable","config\/acl\/resources\/admin\/system\/myaccount":"Magento_Adminhtml::myaccount","config\/acl\/resources\/admin\/system\/tools":"Magento_Adminhtml::tools","config\/acl\/resources\/admin\/system\/convert":"Magento_Adminhtml::convert","config\/acl\/resources\/admin\/system\/cache":"Magento_Adminhtml::cache","config\/acl\/resources\/admin\/system\/extensions":"Magento_Adminhtml::extensions","config\/acl\/resources\/admin\/system\/extensions\/local":"Magento_Adminhtml::local","config\/acl\/resources\/admin\/system\/extensions\/custom":"Magento_Adminhtml::custom","config\/acl\/resources\/admin\/global_search":"Magento_Adminhtml::global_search","config\/acl\/resources\/admin\/system\/tools\/backup":"Magento_Backup::backup","config\/acl\/resources\/admin\/system\/tools\/backup\/rollback":"Magento_Backup::rollback","config\/acl\/resources\/admin\/system\/config\/cataloginventory":"Magento_CatalogInventory::cataloginventory","config\/acl\/resources\/admin\/promo":"Magento_CatalogRule::promo","config\/acl\/resources\/admin\/promo\/catalog":"Magento_CatalogRule::promo_catalog","config\/acl\/resources\/admin\/catalog\/search":"Magento_CatalogSearch::search","config\/acl\/resources\/admin\/system\/config\/catalog":"Magento_Catalog::config_catalog","config\/acl\/resources\/admin\/catalog":"Magento_Catalog::catalog","config\/acl\/resources\/admin\/catalog\/attributes":"Magento_Catalog::catalog_attributes","config\/acl\/resources\/admin\/catalog\/attributes\/attributes":"Magento_Catalog::attributes_attributes","config\/acl\/resources\/admin\/catalog\/attributes\/sets":"Magento_Catalog::sets","config\/acl\/resources\/admin\/catalog\/categories":"Magento_Catalog::categories","config\/acl\/resources\/admin\/catalog\/products":"Magento_Catalog::products","config\/acl\/resources\/admin\/catalog\/update_attributes":"Magento_Catalog::update_attributes","config\/acl\/resources\/admin\/catalog\/urlrewrite":"Magento_Catalog::urlrewrite","config\/acl\/resources\/admin\/sales\/checkoutagreement":"Magento_Checkout::checkoutagreement","config\/acl\/resources\/admin\/system\/config\/checkout":"Magento_Checkout::checkout","config\/acl\/resources\/admin\/cms":"Magento_Cms::cms","config\/acl\/resources\/admin\/cms\/block":"Magento_Cms::block","config\/acl\/resources\/admin\/cms\/page":"Magento_Cms::page","config\/acl\/resources\/admin\/cms\/page\/save":"Magento_Cms::save","config\/acl\/resources\/admin\/cms\/page\/delete":"Magento_Cms::page_delete","config\/acl\/resources\/admin\/cms\/media_gallery":"Magento_Cms::media_gallery","config\/acl\/resources\/admin\/system\/config\/cms":"Magento_Cms::config_cms","config\/acl\/resources\/admin\/system\/config\/contacts":"Magento_Contacts::contacts","config\/acl\/resources\/admin\/system\/currency\/rates":"Magento_CurrencySymbol::currency_rates","config\/acl\/resources\/admin\/system\/currency\/symbols":"Magento_CurrencySymbol::symbols","config\/acl\/resources\/admin\/customer":"Magento_Customer::customer","config\/acl\/resources\/admin\/customer\/group":"Magento_Customer::group","config\/acl\/resources\/admin\/customer\/manage":"Magento_Customer::manage","config\/acl\/resources\/admin\/customer\/online":"Magento_Customer::online","config\/acl\/resources\/admin\/system\/config\/customer":"Magento_Customer::config_customer","config\/acl\/resources\/admin\/system\/design\/editor":"Magento_DesignEditor::editor","config\/acl\/resources\/admin\/system\/config\/downloadable":"Magento_Downloadable::downloadable","config\/acl\/resources\/admin\/system\/config\/google":"Magento_GoogleCheckout::google","config\/acl\/resources\/admin\/catalog\/googleshopping":"Magento_GoogleShopping::googleshopping","config\/acl\/resources\/admin\/catalog\/googleshopping\/types":"Magento_GoogleShopping::types","config\/acl\/resources\/admin\/catalog\/googleshopping\/items":"Magento_GoogleShopping::items","config\/acl\/resources\/admin\/system\/convert\/import":"Magento_ImportExport::import","config\/acl\/resources\/admin\/system\/convert\/export":"Magento_ImportExport::export","config\/acl\/resources\/admin\/system\/index":"Magento_Index::index","config\/acl\/resources\/admin\/system\/config\/newsletter":"Magento_Newsletter::newsletter","config\/acl\/resources\/admin\/newsletter":"Magento_Newsletter::admin_newsletter","config\/acl\/resources\/admin\/newsletter\/problem":"Magento_Newsletter::problem","config\/acl\/resources\/admin\/newsletter\/queue":"Magento_Newsletter::queue","config\/acl\/resources\/admin\/newsletter\/subscriber":"Magento_Newsletter::subscriber","config\/acl\/resources\/admin\/newsletter\/template":"Magento_Newsletter::template","config\/acl\/resources\/admin\/system\/config\/oauth":"Magento_Oauth::oauth","config\/acl\/resources\/admin\/page_cache":"Magento_PageCache::page_cache","config\/acl\/resources\/admin\/system\/config\/payment":"Magento_Payment::payment","config\/acl\/resources\/admin\/system\/config\/payment_services":"Magento_Payment::payment_services","config\/acl\/resources\/admin\/system\/config\/paypal":"Magento_Paypal::paypal","config\/acl\/resources\/admin\/report\/salesroot\/paypal_settlement_reports":"Magento_Paypal::paypal_settlement_reports","config\/acl\/resources\/admin\/report\/salesroot\/paypal_settlement_reports\/view":"Magento_Paypal::paypal_settlement_reports_view","config\/acl\/resources\/admin\/report\/salesroot\/paypal_settlement_reports\/fetch":"Magento_Paypal::fetch","config\/acl\/resources\/admin\/system\/config\/persistent":"Magento_Persistent::persistent","config\/acl\/resources\/admin\/cms\/poll":"Magento_Poll::poll","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/ratings":"Magento_Rating::ratings","config\/acl\/resources\/admin\/report":"Magento_Reports::report","config\/acl\/resources\/admin\/report\/salesroot":"Magento_Reports::salesroot","config\/acl\/resources\/admin\/report\/salesroot\/sales":"Magento_Reports::salesroot_sales","config\/acl\/resources\/admin\/report\/salesroot\/tax":"Magento_Reports::tax","config\/acl\/resources\/admin\/report\/salesroot\/shipping":"Magento_Reports::shipping","config\/acl\/resources\/admin\/report\/salesroot\/invoiced":"Magento_Reports::invoiced","config\/acl\/resources\/admin\/report\/salesroot\/refunded":"Magento_Reports::refunded","config\/acl\/resources\/admin\/report\/salesroot\/coupons":"Magento_Reports::coupons","config\/acl\/resources\/admin\/report\/shopcart":"Magento_Reports::shopcart","config\/acl\/resources\/admin\/report\/shopcart\/product":"Magento_Reports::product","config\/acl\/resources\/admin\/report\/shopcart\/abandoned":"Magento_Reports::abandoned","config\/acl\/resources\/admin\/report\/products":"Magento_Reports::report_products","config\/acl\/resources\/admin\/report\/products\/bestsellers":"Magento_Reports::bestsellers","config\/acl\/resources\/admin\/report\/products\/sold":"Magento_Reports::sold","config\/acl\/resources\/admin\/report\/products\/viewed":"Magento_Reports::viewed","config\/acl\/resources\/admin\/report\/products\/lowstock":"Magento_Reports::lowstock","config\/acl\/resources\/admin\/report\/products\/downloads":"Magento_Reports::downloads","config\/acl\/resources\/admin\/report\/customers":"Magento_Reports::customers","config\/acl\/resources\/admin\/report\/customers\/accounts":"Magento_Reports::accounts","config\/acl\/resources\/admin\/report\/customers\/totals":"Magento_Reports::totals","config\/acl\/resources\/admin\/report\/customers\/orders":"Magento_Reports::customers_orders","config\/acl\/resources\/admin\/report\/review":"Magento_Reports::review","config\/acl\/resources\/admin\/report\/review\/customer":"Magento_Reports::review_customer","config\/acl\/resources\/admin\/report\/review\/product":"Magento_Reports::review_product","config\/acl\/resources\/admin\/report\/tags":"Magento_Reports::tags","config\/acl\/resources\/admin\/report\/tags\/customer":"Magento_Reports::tags_customer","config\/acl\/resources\/admin\/report\/tags\/popular":"Magento_Reports::popular","config\/acl\/resources\/admin\/report\/tags\/product":"Magento_Reports::tags_product","config\/acl\/resources\/admin\/report\/search":"Magento_Reports::report_search","config\/acl\/resources\/admin\/report\/statistics":"Magento_Reports::statistics","config\/acl\/resources\/admin\/system\/config\/reports":"Magento_Reports::reports","config\/acl\/resources\/admin\/catalog\/reviews_ratings":"Magento_Review::reviews_ratings","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/reviews":"Magento_Review::reviews","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/reviews\/all":"Magento_Review::reviews_all","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/reviews\/pending":"Magento_Review::pending","config\/acl\/resources\/admin\/system\/config\/rss":"Magento_Rss::rss","config\/acl\/resources\/admin\/promo\/quote":"Magento_SalesRule::quote","config\/acl\/resources\/admin\/sales":"Magento_Sales::sales","config\/acl\/resources\/admin\/sales\/order":"Magento_Sales::sales_order","config\/acl\/resources\/admin\/sales\/order\/actions":"Magento_Sales::actions","config\/acl\/resources\/admin\/sales\/order\/actions\/create":"Magento_Sales::create","config\/acl\/resources\/admin\/sales\/order\/actions\/view":"Magento_Sales::actions_view","config\/acl\/resources\/admin\/sales\/order\/actions\/email":"Magento_Sales::email","config\/acl\/resources\/admin\/sales\/order\/actions\/reorder":"Magento_Sales::reorder","config\/acl\/resources\/admin\/sales\/order\/actions\/edit":"Magento_Sales::actions_edit","config\/acl\/resources\/admin\/sales\/order\/actions\/cancel":"Magento_Sales::cancel","config\/acl\/resources\/admin\/sales\/order\/actions\/review_payment":"Magento_Sales::review_payment","config\/acl\/resources\/admin\/sales\/order\/actions\/capture":"Magento_Sales::capture","config\/acl\/resources\/admin\/sales\/order\/actions\/invoice":"Magento_Sales::invoice","config\/acl\/resources\/admin\/sales\/order\/actions\/creditmemo":"Magento_Sales::creditmemo","config\/acl\/resources\/admin\/sales\/order\/actions\/hold":"Magento_Sales::hold","config\/acl\/resources\/admin\/sales\/order\/actions\/unhold":"Magento_Sales::unhold","config\/acl\/resources\/admin\/sales\/order\/actions\/ship":"Magento_Sales::ship","config\/acl\/resources\/admin\/sales\/order\/actions\/comment":"Magento_Sales::comment","config\/acl\/resources\/admin\/sales\/order\/actions\/emails":"Magento_Sales::emails","config\/acl\/resources\/admin\/sales\/invoice":"Magento_Sales::sales_invoice","config\/acl\/resources\/admin\/sales\/shipment":"Magento_Sales::shipment","config\/acl\/resources\/admin\/sales\/creditmemo":"Magento_Sales::sales_creditmemo","config\/acl\/resources\/admin\/sales\/transactions":"Magento_Sales::transactions","config\/acl\/resources\/admin\/sales\/transactions\/fetch":"Magento_Sales::transactions_fetch","config\/acl\/resources\/admin\/sales\/recurring_profile":"Magento_Sales::recurring_profile","config\/acl\/resources\/admin\/sales\/billing_agreement":"Magento_Sales::billing_agreement","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions":"Magento_Sales::billing_agreement_actions","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions\/view":"Magento_Sales::billing_agreement_actions_view","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions\/manage":"Magento_Sales::actions_manage","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions\/use":"Magento_Sales::use","config\/acl\/resources\/admin\/system\/order_statuses":"Magento_Sales::order_statuses","config\/acl\/resources\/admin\/system\/config\/sales":"Magento_Sales::config_sales","config\/acl\/resources\/admin\/system\/config\/sales_email":"Magento_Sales::sales_email","config\/acl\/resources\/admin\/system\/config\/sales_pdf":"Magento_Sales::sales_pdf","config\/acl\/resources\/admin\/system\/config\/shipping":"Magento_Shipping::config_shipping","config\/acl\/resources\/admin\/system\/config\/carriers":"Magento_Shipping::carriers","config\/acl\/resources\/admin\/catalog\/sitemap":"Magento_Sitemap::sitemap","config\/acl\/resources\/admin\/system\/config\/sitemap":"Magento_Sitemap::config_sitemap","config\/acl\/resources\/admin\/sales\/tax":"Magento_Tax::sales_tax","config\/acl\/resources\/admin\/sales\/tax\/classes_customer":"Magento_Tax::classes_customer","config\/acl\/resources\/admin\/sales\/tax\/classes_product":"Magento_Tax::classes_product","config\/acl\/resources\/admin\/sales\/tax\/import_export":"Magento_Tax::import_export","config\/acl\/resources\/admin\/sales\/tax\/rates":"Magento_Tax::tax_rates","config\/acl\/resources\/admin\/sales\/tax\/rules":"Magento_Tax::rules","config\/acl\/resources\/admin\/system\/config\/tax":"Magento_Tax::config_tax","config\/acl\/resources\/admin\/system\/acl":"Magento_User::acl","config\/acl\/resources\/admin\/system\/acl\/roles":"Magento_User::acl_roles","config\/acl\/resources\/admin\/system\/acl\/users":"Magento_User::acl_users","config\/acl\/resources\/admin\/cms\/widget_instance":"Magento_Widget::widget_instance","config\/acl\/resources\/admin\/system\/config\/wishlist":"Magento_Wishlist::config_wishlist"} +{"config\/acl\/resources\/admin\/cms\/magento_banner":"Magento_Banner::magento_banner","config\/acl\/resources\/admin\/catalog\/events":"Magento_CatalogEvent::events","config\/acl\/resources\/admin\/system\/config\/magento_catalogpermissions":"Magento_CatalogPermissions::magento_catalogpermissions","config\/acl\/resources\/admin\/catalog\/magento_catalogpermissions":"Magento_CatalogPermissions::catalog_magento_catalogpermissions","config\/acl\/resources\/admin\/sales\/magento_advancedcheckout":"Magento_AdvancedCheckout::magento_advancedcheckout","config\/acl\/resources\/admin\/sales\/magento_advancedcheckout\/view":"Magento_AdvancedCheckout::view","config\/acl\/resources\/admin\/sales\/magento_advancedcheckout\/update":"Magento_AdvancedCheckout::update","config\/acl\/resources\/admin\/cms\/page\/save_revision":"Magento_VersionsCms::save_revision","config\/acl\/resources\/admin\/cms\/page\/delete_revision":"Magento_VersionsCms::delete_revision","config\/acl\/resources\/admin\/cms\/page\/publish_revision":"Magento_VersionsCms::publish_revision","config\/acl\/resources\/admin\/cms\/hierarchy":"Magento_VersionsCms::hierarchy","config\/acl\/resources\/admin\/customer\/customersegment":"Magento_CustomerSegment::customersegment","config\/acl\/resources\/admin\/report\/customers\/segment":"Magento_CustomerSegment::segment","config\/acl\/resources\/admin\/customer\/attributes":"Magento_CustomerCustomAttributes::attributes","config\/acl\/resources\/admin\/customer\/attributes\/customer_attributes":"Magento_CustomerCustomAttributes::customer_attributes","config\/acl\/resources\/admin\/customer\/attributes\/customer_address_attributes":"Magento_CustomerCustomAttributes::customer_address_attributes","config\/acl\/resources\/admin\/system\/config\/giftcardaccount":"Magento_GiftCardAccount::giftcardaccount","config\/acl\/resources\/admin\/customer\/giftcardaccount":"Magento_GiftCardAccount::customer_giftcardaccount","config\/acl\/resources\/admin\/system\/config\/giftcard":"Magento_GiftCard::giftcard","config\/acl\/resources\/admin\/system\/config\/magento_giftregistry":"Magento_GiftRegistry::magento_giftregistry","config\/acl\/resources\/admin\/customer\/magento_giftregistry":"Magento_GiftRegistry::customer_magento_giftregistry","config\/acl\/resources\/admin\/sales\/magento_giftwrapping":"Magento_GiftWrapping::magento_giftwrapping","config\/acl\/resources\/admin\/system\/convert\/enterprise_scheduled_operation":"Magento_ScheduledImportExport::enterprise_scheduled_operation","config\/acl\/resources\/admin\/customer\/magento_invitation":"Magento_Invitation::magento_invitation","config\/acl\/resources\/admin\/report\/magento_invitation":"Magento_Invitation::report_magento_invitation","config\/acl\/resources\/admin\/report\/magento_invitation\/general":"Magento_Invitation::general","config\/acl\/resources\/admin\/report\/magento_invitation\/customer":"Magento_Invitation::magento_invitation_customer","config\/acl\/resources\/admin\/report\/magento_invitation\/order":"Magento_Invitation::order","config\/acl\/resources\/admin\/system\/config\/magento_invitation":"Magento_Invitation::config_magento_invitation","config\/acl\/resources\/admin\/system\/config\/logging":"Magento_Logging::logging","config\/acl\/resources\/admin\/system\/magento_logging":"Magento_Logging::magento_logging","config\/acl\/resources\/admin\/system\/magento_logging\/events":"Magento_Logging::magento_logging_events","config\/acl\/resources\/admin\/system\/magento_logging\/backups":"Magento_Logging::backups","config\/acl\/resources\/admin\/system\/crypt_key":"Magento_Pci::crypt_key","config\/acl\/resources\/admin\/system\/acl\/locks":"Magento_Pci::locks","config\/acl\/resources\/admin\/catalog\/products\/read_product_price":"Magento_PricePermissions::read_product_price","config\/acl\/resources\/admin\/catalog\/products\/read_product_price\/edit_product_price":"Magento_PricePermissions::edit_product_price","config\/acl\/resources\/admin\/catalog\/products\/edit_product_status":"Magento_PricePermissions::edit_product_status","config\/acl\/resources\/admin\/promo\/catalog\/edit":"Magento_PromotionPermissions::edit","config\/acl\/resources\/admin\/promo\/quote\/edit":"Magento_PromotionPermissions::quote_edit","config\/acl\/resources\/admin\/promo\/magento_reminder\/edit":"Magento_PromotionPermissions::magento_reminder_edit","config\/acl\/resources\/admin\/promo\/magento_reminder":"Magento_Reminder::magento_reminder","config\/acl\/resources\/admin\/system\/config\/promo":"Magento_SalesRule::config_promo","config\/acl\/resources\/admin\/customer\/manage\/reward_balance":"Magento_Reward::reward_balance","config\/acl\/resources\/admin\/sales\/order\/actions\/create\/reward_spend":"Magento_Reward::reward_spend","config\/acl\/resources\/admin\/customer\/rates":"Magento_Reward::rates","config\/acl\/resources\/admin\/system\/config\/magento_reward":"Magento_Reward::magento_reward","config\/acl\/resources\/admin\/sales\/magento_rma":"Magento_Rma::magento_rma","config\/acl\/resources\/admin\/sales\/magento_rma\/rma_manage":"Magento_Rma::rma_manage","config\/acl\/resources\/admin\/sales\/magento_rma\/rma_attribute":"Magento_Rma::rma_attribute","config\/acl\/resources\/admin\/sales\/archive":"Magento_SalesArchive::archive","config\/acl\/resources\/admin\/sales\/archive\/orders":"Magento_SalesArchive::orders","config\/acl\/resources\/admin\/sales\/archive\/orders\/add":"Magento_SalesArchive::add","config\/acl\/resources\/admin\/sales\/archive\/orders\/remove":"Magento_SalesArchive::remove","config\/acl\/resources\/admin\/sales\/archive\/invoices":"Magento_SalesArchive::invoices","config\/acl\/resources\/admin\/sales\/archive\/shipments":"Magento_SalesArchive::shipments","config\/acl\/resources\/admin\/sales\/archive\/creditmemos":"Magento_SalesArchive::creditmemos","config\/acl\/resources\/admin\/catalog\/targetrule":"Magento_TargetRule::targetrule","config\/acl\/resources\/admin\/report\/customers\/wishlist":"Magento_MultipleWishlist::wishlist","config\/acl\/resources\/admin\/system\/adminnotification":"Magento_AdminNotification::adminnotification","config\/acl\/resources\/admin\/system\/adminnotification\/show_toolbar":"Magento_AdminNotification::show_toolbar","config\/acl\/resources\/admin\/system\/adminnotification\/show_list":"Magento_AdminNotification::show_list","config\/acl\/resources\/admin\/system\/adminnotification\/mark_as_read":"Magento_AdminNotification::mark_as_read","config\/acl\/resources\/admin\/system\/adminnotification\/remove":"Magento_AdminNotification::adminnotification_remove","config\/acl\/resources\/all":"Magento_Adminhtml::all","config\/acl\/resources\/admin":"Magento_Adminhtml::admin","config\/acl\/resources\/admin\/dashboard":"Magento_Adminhtml::dashboard","config\/acl\/resources\/admin\/system":"Magento_Adminhtml::system","config\/acl\/resources\/admin\/system\/store":"Magento_Adminhtml::store","config\/acl\/resources\/admin\/system\/design":"Magento_Adminhtml::design","config\/acl\/resources\/admin\/system\/design\/schedule":"Magento_Adminhtml::schedule","config\/acl\/resources\/admin\/system\/config":"Magento_Adminhtml::config","config\/acl\/resources\/admin\/system\/config\/general":"Magento_Adminhtml::config_general","config\/acl\/resources\/admin\/system\/config\/web":"Magento_Adminhtml::web","config\/acl\/resources\/admin\/system\/config\/design":"Magento_Adminhtml::config_design","config\/acl\/resources\/admin\/system\/config\/system":"Magento_Adminhtml::config_system","config\/acl\/resources\/admin\/system\/config\/advanced":"Magento_Adminhtml::advanced","config\/acl\/resources\/admin\/system\/config\/trans_email":"Magento_Adminhtml::trans_email","config\/acl\/resources\/admin\/system\/config\/dev":"Magento_Adminhtml::dev","config\/acl\/resources\/admin\/system\/config\/currency":"Magento_Adminhtml::currency","config\/acl\/resources\/admin\/system\/config\/sendfriend":"Magento_Adminhtml::sendfriend","config\/acl\/resources\/admin\/system\/config\/admin":"Magento_Adminhtml::config_admin","config\/acl\/resources\/admin\/system\/currency":"Magento_CurrencySymbol::system_currency","config\/acl\/resources\/admin\/system\/email_template":"Magento_Adminhtml::email_template","config\/acl\/resources\/admin\/system\/variable":"Magento_Adminhtml::variable","config\/acl\/resources\/admin\/system\/myaccount":"Magento_Adminhtml::myaccount","config\/acl\/resources\/admin\/system\/tools":"Magento_Adminhtml::tools","config\/acl\/resources\/admin\/system\/convert":"Magento_Adminhtml::convert","config\/acl\/resources\/admin\/system\/cache":"Magento_Adminhtml::cache","config\/acl\/resources\/admin\/system\/extensions":"Magento_Adminhtml::extensions","config\/acl\/resources\/admin\/system\/extensions\/local":"Magento_Adminhtml::local","config\/acl\/resources\/admin\/system\/extensions\/custom":"Magento_Adminhtml::custom","config\/acl\/resources\/admin\/global_search":"Magento_Adminhtml::global_search","config\/acl\/resources\/admin\/system\/tools\/backup":"Magento_Backup::backup","config\/acl\/resources\/admin\/system\/tools\/backup\/rollback":"Magento_Backup::rollback","config\/acl\/resources\/admin\/system\/config\/cataloginventory":"Magento_CatalogInventory::cataloginventory","config\/acl\/resources\/admin\/promo":"Magento_CatalogRule::promo","config\/acl\/resources\/admin\/promo\/catalog":"Magento_CatalogRule::promo_catalog","config\/acl\/resources\/admin\/catalog\/search":"Magento_CatalogSearch::search","config\/acl\/resources\/admin\/system\/config\/catalog":"Magento_Catalog::config_catalog","config\/acl\/resources\/admin\/catalog":"Magento_Catalog::catalog","config\/acl\/resources\/admin\/catalog\/attributes":"Magento_Catalog::catalog_attributes","config\/acl\/resources\/admin\/catalog\/attributes\/attributes":"Magento_Catalog::attributes_attributes","config\/acl\/resources\/admin\/catalog\/attributes\/sets":"Magento_Catalog::sets","config\/acl\/resources\/admin\/catalog\/categories":"Magento_Catalog::categories","config\/acl\/resources\/admin\/catalog\/products":"Magento_Catalog::products","config\/acl\/resources\/admin\/catalog\/update_attributes":"Magento_Catalog::update_attributes","config\/acl\/resources\/admin\/catalog\/urlrewrite":"Magento_Catalog::urlrewrite","config\/acl\/resources\/admin\/sales\/checkoutagreement":"Magento_Checkout::checkoutagreement","config\/acl\/resources\/admin\/system\/config\/checkout":"Magento_Checkout::checkout","config\/acl\/resources\/admin\/cms":"Magento_Cms::cms","config\/acl\/resources\/admin\/cms\/block":"Magento_Cms::block","config\/acl\/resources\/admin\/cms\/page":"Magento_Cms::page","config\/acl\/resources\/admin\/cms\/page\/save":"Magento_Cms::save","config\/acl\/resources\/admin\/cms\/page\/delete":"Magento_Cms::page_delete","config\/acl\/resources\/admin\/cms\/media_gallery":"Magento_Cms::media_gallery","config\/acl\/resources\/admin\/system\/config\/cms":"Magento_Cms::config_cms","config\/acl\/resources\/admin\/system\/config\/contacts":"Magento_Contacts::contacts","config\/acl\/resources\/admin\/system\/currency\/rates":"Magento_CurrencySymbol::currency_rates","config\/acl\/resources\/admin\/system\/currency\/symbols":"Magento_CurrencySymbol::symbols","config\/acl\/resources\/admin\/customer":"Magento_Customer::customer","config\/acl\/resources\/admin\/customer\/group":"Magento_Customer::group","config\/acl\/resources\/admin\/customer\/manage":"Magento_Customer::manage","config\/acl\/resources\/admin\/customer\/online":"Magento_Customer::online","config\/acl\/resources\/admin\/system\/config\/customer":"Magento_Customer::config_customer","config\/acl\/resources\/admin\/system\/design\/editor":"Magento_DesignEditor::editor","config\/acl\/resources\/admin\/system\/config\/downloadable":"Magento_Downloadable::downloadable","config\/acl\/resources\/admin\/system\/config\/google":"Magento_GoogleCheckout::google","config\/acl\/resources\/admin\/catalog\/googleshopping":"Magento_GoogleShopping::googleshopping","config\/acl\/resources\/admin\/catalog\/googleshopping\/types":"Magento_GoogleShopping::types","config\/acl\/resources\/admin\/catalog\/googleshopping\/items":"Magento_GoogleShopping::items","config\/acl\/resources\/admin\/system\/convert\/import":"Magento_ImportExport::import","config\/acl\/resources\/admin\/system\/convert\/export":"Magento_ImportExport::export","config\/acl\/resources\/admin\/system\/index":"Magento_Index::index","config\/acl\/resources\/admin\/system\/config\/newsletter":"Magento_Newsletter::newsletter","config\/acl\/resources\/admin\/newsletter":"Magento_Newsletter::admin_newsletter","config\/acl\/resources\/admin\/newsletter\/problem":"Magento_Newsletter::problem","config\/acl\/resources\/admin\/newsletter\/queue":"Magento_Newsletter::queue","config\/acl\/resources\/admin\/newsletter\/subscriber":"Magento_Newsletter::subscriber","config\/acl\/resources\/admin\/newsletter\/template":"Magento_Newsletter::template","config\/acl\/resources\/admin\/page_cache":"Magento_PageCache::page_cache","config\/acl\/resources\/admin\/system\/config\/payment":"Magento_Payment::payment","config\/acl\/resources\/admin\/system\/config\/payment_services":"Magento_Payment::payment_services","config\/acl\/resources\/admin\/system\/config\/paypal":"Magento_Paypal::paypal","config\/acl\/resources\/admin\/report\/salesroot\/paypal_settlement_reports":"Magento_Paypal::paypal_settlement_reports","config\/acl\/resources\/admin\/report\/salesroot\/paypal_settlement_reports\/view":"Magento_Paypal::paypal_settlement_reports_view","config\/acl\/resources\/admin\/report\/salesroot\/paypal_settlement_reports\/fetch":"Magento_Paypal::fetch","config\/acl\/resources\/admin\/system\/config\/persistent":"Magento_Persistent::persistent","config\/acl\/resources\/admin\/cms\/poll":"Magento_Poll::poll","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/ratings":"Magento_Rating::ratings","config\/acl\/resources\/admin\/report":"Magento_Reports::report","config\/acl\/resources\/admin\/report\/salesroot":"Magento_Reports::salesroot","config\/acl\/resources\/admin\/report\/salesroot\/sales":"Magento_Reports::salesroot_sales","config\/acl\/resources\/admin\/report\/salesroot\/tax":"Magento_Reports::tax","config\/acl\/resources\/admin\/report\/salesroot\/shipping":"Magento_Reports::shipping","config\/acl\/resources\/admin\/report\/salesroot\/invoiced":"Magento_Reports::invoiced","config\/acl\/resources\/admin\/report\/salesroot\/refunded":"Magento_Reports::refunded","config\/acl\/resources\/admin\/report\/salesroot\/coupons":"Magento_Reports::coupons","config\/acl\/resources\/admin\/report\/shopcart":"Magento_Reports::shopcart","config\/acl\/resources\/admin\/report\/shopcart\/product":"Magento_Reports::product","config\/acl\/resources\/admin\/report\/shopcart\/abandoned":"Magento_Reports::abandoned","config\/acl\/resources\/admin\/report\/products":"Magento_Reports::report_products","config\/acl\/resources\/admin\/report\/products\/bestsellers":"Magento_Reports::bestsellers","config\/acl\/resources\/admin\/report\/products\/sold":"Magento_Reports::sold","config\/acl\/resources\/admin\/report\/products\/viewed":"Magento_Reports::viewed","config\/acl\/resources\/admin\/report\/products\/lowstock":"Magento_Reports::lowstock","config\/acl\/resources\/admin\/report\/products\/downloads":"Magento_Reports::downloads","config\/acl\/resources\/admin\/report\/customers":"Magento_Reports::customers","config\/acl\/resources\/admin\/report\/customers\/accounts":"Magento_Reports::accounts","config\/acl\/resources\/admin\/report\/customers\/totals":"Magento_Reports::totals","config\/acl\/resources\/admin\/report\/customers\/orders":"Magento_Reports::customers_orders","config\/acl\/resources\/admin\/report\/review":"Magento_Reports::review","config\/acl\/resources\/admin\/report\/review\/customer":"Magento_Reports::review_customer","config\/acl\/resources\/admin\/report\/review\/product":"Magento_Reports::review_product","config\/acl\/resources\/admin\/report\/tags":"Magento_Reports::tags","config\/acl\/resources\/admin\/report\/tags\/customer":"Magento_Reports::tags_customer","config\/acl\/resources\/admin\/report\/tags\/popular":"Magento_Reports::popular","config\/acl\/resources\/admin\/report\/tags\/product":"Magento_Reports::tags_product","config\/acl\/resources\/admin\/report\/search":"Magento_Reports::report_search","config\/acl\/resources\/admin\/report\/statistics":"Magento_Reports::statistics","config\/acl\/resources\/admin\/system\/config\/reports":"Magento_Reports::reports","config\/acl\/resources\/admin\/catalog\/reviews_ratings":"Magento_Review::reviews_ratings","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/reviews":"Magento_Review::reviews","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/reviews\/all":"Magento_Review::reviews_all","config\/acl\/resources\/admin\/catalog\/reviews_ratings\/reviews\/pending":"Magento_Review::pending","config\/acl\/resources\/admin\/system\/config\/rss":"Magento_Rss::rss","config\/acl\/resources\/admin\/promo\/quote":"Magento_SalesRule::quote","config\/acl\/resources\/admin\/sales":"Magento_Sales::sales","config\/acl\/resources\/admin\/sales\/order":"Magento_Sales::sales_order","config\/acl\/resources\/admin\/sales\/order\/actions":"Magento_Sales::actions","config\/acl\/resources\/admin\/sales\/order\/actions\/create":"Magento_Sales::create","config\/acl\/resources\/admin\/sales\/order\/actions\/view":"Magento_Sales::actions_view","config\/acl\/resources\/admin\/sales\/order\/actions\/email":"Magento_Sales::email","config\/acl\/resources\/admin\/sales\/order\/actions\/reorder":"Magento_Sales::reorder","config\/acl\/resources\/admin\/sales\/order\/actions\/edit":"Magento_Sales::actions_edit","config\/acl\/resources\/admin\/sales\/order\/actions\/cancel":"Magento_Sales::cancel","config\/acl\/resources\/admin\/sales\/order\/actions\/review_payment":"Magento_Sales::review_payment","config\/acl\/resources\/admin\/sales\/order\/actions\/capture":"Magento_Sales::capture","config\/acl\/resources\/admin\/sales\/order\/actions\/invoice":"Magento_Sales::invoice","config\/acl\/resources\/admin\/sales\/order\/actions\/creditmemo":"Magento_Sales::creditmemo","config\/acl\/resources\/admin\/sales\/order\/actions\/hold":"Magento_Sales::hold","config\/acl\/resources\/admin\/sales\/order\/actions\/unhold":"Magento_Sales::unhold","config\/acl\/resources\/admin\/sales\/order\/actions\/ship":"Magento_Sales::ship","config\/acl\/resources\/admin\/sales\/order\/actions\/comment":"Magento_Sales::comment","config\/acl\/resources\/admin\/sales\/order\/actions\/emails":"Magento_Sales::emails","config\/acl\/resources\/admin\/sales\/invoice":"Magento_Sales::sales_invoice","config\/acl\/resources\/admin\/sales\/shipment":"Magento_Sales::shipment","config\/acl\/resources\/admin\/sales\/creditmemo":"Magento_Sales::sales_creditmemo","config\/acl\/resources\/admin\/sales\/transactions":"Magento_Sales::transactions","config\/acl\/resources\/admin\/sales\/transactions\/fetch":"Magento_Sales::transactions_fetch","config\/acl\/resources\/admin\/sales\/recurring_profile":"Magento_Sales::recurring_profile","config\/acl\/resources\/admin\/sales\/billing_agreement":"Magento_Sales::billing_agreement","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions":"Magento_Sales::billing_agreement_actions","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions\/view":"Magento_Sales::billing_agreement_actions_view","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions\/manage":"Magento_Sales::actions_manage","config\/acl\/resources\/admin\/sales\/billing_agreement\/actions\/use":"Magento_Sales::use","config\/acl\/resources\/admin\/system\/order_statuses":"Magento_Sales::order_statuses","config\/acl\/resources\/admin\/system\/config\/sales":"Magento_Sales::config_sales","config\/acl\/resources\/admin\/system\/config\/sales_email":"Magento_Sales::sales_email","config\/acl\/resources\/admin\/system\/config\/sales_pdf":"Magento_Sales::sales_pdf","config\/acl\/resources\/admin\/system\/config\/shipping":"Magento_Shipping::config_shipping","config\/acl\/resources\/admin\/system\/config\/carriers":"Magento_Shipping::carriers","config\/acl\/resources\/admin\/catalog\/sitemap":"Magento_Sitemap::sitemap","config\/acl\/resources\/admin\/system\/config\/sitemap":"Magento_Sitemap::config_sitemap","config\/acl\/resources\/admin\/sales\/tax":"Magento_Tax::sales_tax","config\/acl\/resources\/admin\/sales\/tax\/classes_customer":"Magento_Tax::classes_customer","config\/acl\/resources\/admin\/sales\/tax\/classes_product":"Magento_Tax::classes_product","config\/acl\/resources\/admin\/sales\/tax\/import_export":"Magento_Tax::import_export","config\/acl\/resources\/admin\/sales\/tax\/rates":"Magento_Tax::tax_rates","config\/acl\/resources\/admin\/sales\/tax\/rules":"Magento_Tax::rules","config\/acl\/resources\/admin\/system\/config\/tax":"Magento_Tax::config_tax","config\/acl\/resources\/admin\/system\/acl":"Magento_User::acl","config\/acl\/resources\/admin\/system\/acl\/roles":"Magento_User::acl_roles","config\/acl\/resources\/admin\/system\/acl\/users":"Magento_User::acl_users","config\/acl\/resources\/admin\/cms\/widget_instance":"Magento_Widget::widget_instance","config\/acl\/resources\/admin\/system\/config\/wishlist":"Magento_Wishlist::config_wishlist"} diff --git a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php b/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php index 2bafbbe7471..97db6e7df38 100644 --- a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php +++ b/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php @@ -384,11 +384,6 @@ return array( 'shipping/tablerate' => 'shipping_tablerate', 'sitemap/sitemap' => 'sitemap', 'strikeiron/tax_rate' => 'strikeiron_tax_rate', - 'tag/properties' => 'tag_properties', - 'tag/relation' => 'tag_relation', - 'tag/summary' => 'tag_summary', - 'tag/tag' => 'tag', - 'tag/tag_relation' => 'tag_relation', 'tax/sales_order_tax' => 'sales_order_tax', 'tax/sales_order_tax_item' => 'sales_order_tax_item', 'tax/tax_calculation' => 'tax_calculation', diff --git a/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php b/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php index da437aac991..86657a32342 100644 --- a/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php +++ b/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php @@ -34,9 +34,9 @@ class ThemeDeployment /** * Helper to process CSS content and fix urls * - * @var \Magento\Core\Helper\Css + * @var \Magento\View\Url\CssResolver */ - private $_cssHelper; + private $_cssUrlResolver; /** * Destination dir, where files will be copied to @@ -71,7 +71,7 @@ class ThemeDeployment /** * Constructor * - * @param \Magento\Core\Helper\Css $cssHelper + * @param \Magento\View\Url\CssResolver $cssUrlResolver * @param string $destinationHomeDir * @param string $configPermitted * @param string|null $configForbidden @@ -79,13 +79,13 @@ class ThemeDeployment * @throws \Magento\Exception */ public function __construct( - \Magento\Core\Helper\Css $cssHelper, + \Magento\View\Url\CssResolver $cssUrlResolver, $destinationHomeDir, $configPermitted, $configForbidden = null, $isDryRun = false ) { - $this->_cssHelper = $cssHelper; + $this->_cssUrlResolver = $cssUrlResolver; $this->_destinationHomeDir = $destinationHomeDir; $this->_isDryRun = $isDryRun; $this->_permitted = $this->_loadConfig($configPermitted); @@ -133,10 +133,9 @@ class ThemeDeployment 'destinationContext' => $destinationContext, ); - $destDir = \Magento\Core\Model\View\DeployedFilesManager::buildDeployedFilePath( + $destDir = \Magento\View\DeployedFilesManager::buildDeployedFilePath( $destinationContext['area'], $destinationContext['themePath'], - $destinationContext['locale'], '', $destinationContext['module'] ); @@ -209,15 +208,14 @@ class ThemeDeployment $destContext = $context['destinationContext']; $destHomeDir = $this->_destinationHomeDir; $callback = function ($relativeUrl) use ($destContext, $destFileDir, $destHomeDir) { - $parts = explode(\Magento\Core\Model\View\Service::SCOPE_SEPARATOR, $relativeUrl); + $parts = explode(\Magento\View\Service::SCOPE_SEPARATOR, $relativeUrl); if (count($parts) == 2) { list($module, $file) = $parts; if (!strlen($module) || !strlen($file)) { throw new \Magento\Exception("Wrong module url: {$relativeUrl}"); } - $relPath = \Magento\Core\Model\View\DeployedFilesManager::buildDeployedFilePath( - $destContext['area'], $destContext['themePath'], $destContext['locale'], - $file, $module + $relPath = \Magento\View\DeployedFilesManager::buildDeployedFilePath( + $destContext['area'], $destContext['themePath'], $file, $module ); $result = $destHomeDir . '/' . $relPath; @@ -229,7 +227,13 @@ class ThemeDeployment // Replace relative urls and write the modified content (if not dry run) $content = file_get_contents($fileSource); - $content = $this->_cssHelper->replaceCssRelativeUrls($content, $fileSource, $fileDestination, $callback); + $content = $this->_cssUrlResolver->replaceCssRelativeUrls( + $content, + $fileSource, + $fileDestination, + $callback + ); + if (!$this->_isDryRun) { file_put_contents($fileDestination, $content); } diff --git a/dev/tools/Magento/Tools/View/Generator/ThemeLight.php b/dev/tools/Magento/Tools/View/Generator/ThemeLight.php index 6dcf3ae8e51..0e3f89c101a 100644 --- a/dev/tools/Magento/Tools/View/Generator/ThemeLight.php +++ b/dev/tools/Magento/Tools/View/Generator/ThemeLight.php @@ -52,7 +52,7 @@ class ThemeLight extends \Magento\Object implements \Magento\View\Design\ThemeIn */ public function getFullPath() { - return $this->getArea() . \Magento\Core\Model\Theme::PATH_SEPARATOR . $this->getThemePath(); + return $this->getArea() . \Magento\View\Design\ThemeInterface::PATH_SEPARATOR . $this->getThemePath(); } /** diff --git a/dev/tools/Magento/Tools/View/generator.php b/dev/tools/Magento/Tools/View/generator.php index 438ca4c0177..296d130b414 100644 --- a/dev/tools/Magento/Tools/View/generator.php +++ b/dev/tools/Magento/Tools/View/generator.php @@ -77,9 +77,9 @@ try { $fallbackFactory->createViewFileRule()); $copyRules = $generator->getCopyRules(); - $cssHelper = new \Magento\Core\Helper\Css($filesystem, $dirs); + $cssUrlResolver = new \Magento\View\Url\CssResolver($filesystem, $dirs); $deployment = new \Magento\Tools\View\Generator\ThemeDeployment( - $cssHelper, + $cssUrlResolver, $config->getDestinationDir(), __DIR__ . '/config/permitted.php', __DIR__ . '/config/forbidden.php', diff --git a/app/code/Magento/Core/Model/Cache.php b/lib/Magento/App/Cache.php similarity index 89% rename from app/code/Magento/Core/Model/Cache.php rename to lib/Magento/App/Cache.php index 3b323bd6351..9ea02998024 100644 --- a/app/code/Magento/Core/Model/Cache.php +++ b/lib/Magento/App/Cache.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Core + * @package Magento_App * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,17 +29,17 @@ * support id and tags preffix support, */ -namespace Magento\Core\Model; +namespace Magento\App; class Cache implements \Magento\App\CacheInterface { /** * @var string */ - protected $_frontendIdentifier = \Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID; + protected $_frontendIdentifier = \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID; /** - * @var \Magento\Core\Model\Cache\Frontend\Pool + * @var \Magento\App\Cache\Frontend\Pool */ protected $_frontendPool; @@ -51,9 +51,9 @@ class Cache implements \Magento\App\CacheInterface protected $_frontend; /** - * @param \Magento\Core\Model\Cache\Frontend\Pool $frontendPool + * @param \Magento\App\Cache\Frontend\Pool $frontendPool */ - public function __construct(\Magento\Core\Model\Cache\Frontend\Pool $frontendPool) + public function __construct(\Magento\App\Cache\Frontend\Pool $frontendPool) { $this->_frontendPool = $frontendPool; $this->_frontend = $frontendPool->get($this->_frontendIdentifier); diff --git a/app/code/Magento/Core/Model/Cache/Frontend/Factory.php b/lib/Magento/App/Cache/Frontend/Factory.php similarity index 99% rename from app/code/Magento/Core/Model/Cache/Frontend/Factory.php rename to lib/Magento/App/Cache/Frontend/Factory.php index a3dbdb8f8eb..f580e8cdbba 100644 --- a/app/code/Magento/Core/Model/Cache/Frontend/Factory.php +++ b/lib/Magento/App/Cache/Frontend/Factory.php @@ -27,7 +27,7 @@ /** * Factory that creates cache frontend instances based on options */ -namespace Magento\Core\Model\Cache\Frontend; +namespace Magento\App\Cache\Frontend; class Factory { diff --git a/app/code/Magento/Core/Model/Cache/Frontend/Pool.php b/lib/Magento/App/Cache/Frontend/Pool.php similarity index 94% rename from app/code/Magento/Core/Model/Cache/Frontend/Pool.php rename to lib/Magento/App/Cache/Frontend/Pool.php index 4401d5ccd60..7866b0336e9 100644 --- a/app/code/Magento/Core/Model/Cache/Frontend/Pool.php +++ b/lib/Magento/App/Cache/Frontend/Pool.php @@ -27,7 +27,7 @@ /** * In-memory readonly pool of cache front-end instances, specified in the configuration */ -namespace Magento\Core\Model\Cache\Frontend; +namespace Magento\App\Cache\Frontend; class Pool implements \Iterator { @@ -37,7 +37,7 @@ class Pool implements \Iterator const DEFAULT_FRONTEND_ID = 'generic'; /** - * @var \Magento\Core\Model\Cache\Frontend\Factory + * @var \Magento\App\Cache\Frontend\Factory */ private $_factory; @@ -61,12 +61,12 @@ class Pool implements \Iterator private $_defaultSettings; /** - * @param \Magento\Core\Model\Cache\Frontend\Factory $frontendFactory + * @param \Magento\App\Cache\Frontend\Factory $frontendFactory * @param array $defaultSettings * @param array $advancedSettings */ public function __construct( - \Magento\Core\Model\Cache\Frontend\Factory $frontendFactory, + \Magento\App\Cache\Frontend\Factory $frontendFactory, array $defaultSettings = array(), array $advancedSettings = array() ) { diff --git a/app/code/Magento/Core/Model/Cache/InstanceFactory.php b/lib/Magento/App/Cache/InstanceFactory.php similarity index 97% rename from app/code/Magento/Core/Model/Cache/InstanceFactory.php rename to lib/Magento/App/Cache/InstanceFactory.php index ee200a86003..008c123bb6b 100644 --- a/app/code/Magento/Core/Model/Cache/InstanceFactory.php +++ b/lib/Magento/App/Cache/InstanceFactory.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\App\Cache; class InstanceFactory { diff --git a/app/code/Magento/Core/Model/Cache/Proxy.php b/lib/Magento/App/Cache/Proxy.php similarity index 98% rename from app/code/Magento/Core/Model/Cache/Proxy.php rename to lib/Magento/App/Cache/Proxy.php index 7e8d0336d30..11e8691910c 100644 --- a/app/code/Magento/Core/Model/Cache/Proxy.php +++ b/lib/Magento/App/Cache/Proxy.php @@ -27,7 +27,7 @@ /** * System cache proxy model */ -namespace Magento\Core\Model\Cache; +namespace Magento\App\Cache; class Proxy implements \Magento\App\CacheInterface { @@ -57,7 +57,7 @@ class Proxy implements \Magento\App\CacheInterface protected function _getCache() { if (null == $this->_cache) { - $this->_cache = $this->_objectManager->get('Magento\Core\Model\Cache'); + $this->_cache = $this->_objectManager->get('Magento\App\Cache'); } return $this->_cache; } diff --git a/app/code/Magento/Core/Model/Cache/State.php b/lib/Magento/App/Cache/State.php similarity index 84% rename from app/code/Magento/Core/Model/Cache/State.php rename to lib/Magento/App/Cache/State.php index 6827d417cea..c960058be47 100644 --- a/app/code/Magento/Core/Model/Cache/State.php +++ b/lib/Magento/App/Cache/State.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\App\Cache; -class State implements \Magento\Core\Model\Cache\StateInterface +class State implements \Magento\App\Cache\StateInterface { /** * Cache identifier used to store cache type statuses @@ -35,9 +35,9 @@ class State implements \Magento\Core\Model\Cache\StateInterface /** * Persistent storage of cache type statuses * - * @var \Magento\Core\Model\Resource\Cache + * @var State\OptionsInterface */ - private $_resource; + private $_options; /** * Cache frontend to delegate actual cache operations to @@ -54,19 +54,19 @@ class State implements \Magento\Core\Model\Cache\StateInterface private $_typeStatuses = array(); /** - * @param \Magento\Core\Model\Resource\Cache $resource - * @param \Magento\Core\Model\Cache\Frontend\Pool $cacheFrontendPool + * @param State\OptionsInterface $options + * @param \Magento\App\Cache\Frontend\Pool $cacheFrontendPool * @param \Magento\App\State $appState * @param bool $banAll Whether all cache types are forced to be disabled */ public function __construct( - \Magento\Core\Model\Resource\Cache $resource, - \Magento\Core\Model\Cache\Frontend\Pool $cacheFrontendPool, + State\OptionsInterface $options, + \Magento\App\Cache\Frontend\Pool $cacheFrontendPool, \Magento\App\State $appState, $banAll = false ) { - $this->_resource = $resource; - $this->_cacheFrontend = $cacheFrontendPool->get(\Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID); + $this->_options = $options; + $this->_cacheFrontend = $cacheFrontendPool->get(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID); if ($appState->isInstalled()) { $this->_loadTypeStatuses($banAll); } @@ -83,7 +83,7 @@ class State implements \Magento\Core\Model\Cache\StateInterface if ($typeOptions !== false) { $typeOptions = unserialize($typeOptions); } else { - $typeOptions = $this->_resource->getAllOptions(); + $typeOptions = $this->_options->getAllOptions(); if ($typeOptions !== false) { $this->_cacheFrontend->save(serialize($typeOptions), self::CACHE_ID); } @@ -122,7 +122,7 @@ class State implements \Magento\Core\Model\Cache\StateInterface */ public function persist() { - $this->_resource->saveAllOptions($this->_typeStatuses); + $this->_options->saveAllOptions($this->_typeStatuses); $this->_cacheFrontend->remove(self::CACHE_ID); } } diff --git a/lib/Magento/App/Cache/State/OptionsInterface.php b/lib/Magento/App/Cache/State/OptionsInterface.php new file mode 100644 index 00000000000..c18a13138ab --- /dev/null +++ b/lib/Magento/App/Cache/State/OptionsInterface.php @@ -0,0 +1,41 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\App\Cache\State; + +interface OptionsInterface +{ + /** + * Get all cache options + * + * @return array|bool + */ + public function getAllOptions(); + + /** + * Save all options to option table + * + * @param array $options + */ + public function saveAllOptions($options); +} diff --git a/app/code/Magento/Core/Model/Cache/StateInterface.php b/lib/Magento/App/Cache/StateInterface.php similarity index 97% rename from app/code/Magento/Core/Model/Cache/StateInterface.php rename to lib/Magento/App/Cache/StateInterface.php index 9f55dfa66cc..cb25a249277 100644 --- a/app/code/Magento/Core/Model/Cache/StateInterface.php +++ b/lib/Magento/App/Cache/StateInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\App\Cache; interface StateInterface { diff --git a/app/code/Magento/Core/Model/Cache/Type/AccessProxy.php b/lib/Magento/App/Cache/Type/AccessProxy.php similarity index 93% rename from app/code/Magento/Core/Model/Cache/Type/AccessProxy.php rename to lib/Magento/App/Cache/Type/AccessProxy.php index 00298fe0965..f003757d255 100644 --- a/app/code/Magento/Core/Model/Cache/Type/AccessProxy.php +++ b/lib/Magento/App/Cache/Type/AccessProxy.php @@ -29,14 +29,14 @@ * It's typical for "access proxies" to have a decorator-like implementation, the difference is logical - * controlling access rather than attaching additional responsibility to a subject. */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class AccessProxy extends \Magento\Cache\Frontend\Decorator\Bare { /** * Cache types manager * - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ private $_cacheState; @@ -49,12 +49,12 @@ class AccessProxy extends \Magento\Cache\Frontend\Decorator\Bare /** * @param \Magento\Cache\FrontendInterface $frontend - * @param \Magento\Core\Model\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\StateInterface $cacheState * @param string $identifier Cache type identifier */ public function __construct( \Magento\Cache\FrontendInterface $frontend, - \Magento\Core\Model\Cache\StateInterface $cacheState, + \Magento\App\Cache\StateInterface $cacheState, $identifier ) { parent::__construct($frontend); diff --git a/app/code/Magento/Core/Model/Cache/Type/Block.php b/lib/Magento/App/Cache/Type/Block.php similarity index 87% rename from app/code/Magento/Core/Model/Cache/Type/Block.php rename to lib/Magento/App/Cache/Type/Block.php index a135c02ab6e..ccab5b1ef32 100644 --- a/app/code/Magento/Core/Model/Cache/Type/Block.php +++ b/lib/Magento/App/Cache/Type/Block.php @@ -29,7 +29,7 @@ * * @todo utilize the class for all manipulations with the cache type */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class Block extends \Magento\Cache\Frontend\Decorator\TagScope { @@ -44,9 +44,9 @@ class Block extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'BLOCK_HTML'; /** - * @param \Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Core/Model/Cache/Type/Collection.php b/lib/Magento/App/Cache/Type/Collection.php similarity index 87% rename from app/code/Magento/Core/Model/Cache/Type/Collection.php rename to lib/Magento/App/Cache/Type/Collection.php index e466161cbaf..4321ecd9cd6 100644 --- a/app/code/Magento/Core/Model/Cache/Type/Collection.php +++ b/lib/Magento/App/Cache/Type/Collection.php @@ -27,7 +27,7 @@ /** * System / Cache Management / Cache type "Collections Data" */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class Collection extends \Magento\Cache\Frontend\Decorator\TagScope { @@ -42,9 +42,9 @@ class Collection extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'COLLECTION_DATA'; /** - * @param \Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Core/Model/Cache/Type/Config.php b/lib/Magento/App/Cache/Type/Config.php similarity index 87% rename from app/code/Magento/Core/Model/Cache/Type/Config.php rename to lib/Magento/App/Cache/Type/Config.php index 4471baa569e..2bc17b40a95 100644 --- a/app/code/Magento/Core/Model/Cache/Type/Config.php +++ b/lib/Magento/App/Cache/Type/Config.php @@ -27,7 +27,7 @@ /** * System / Cache Management / Cache type "Configuration" */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class Config extends \Magento\Cache\Frontend\Decorator\TagScope implements \Magento\Config\CacheInterface @@ -43,9 +43,9 @@ class Config extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'CONFIG'; /** - * @param \Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Core/Model/Cache/Type/FrontendPool.php b/lib/Magento/App/Cache/Type/FrontendPool.php similarity index 84% rename from app/code/Magento/Core/Model/Cache/Type/FrontendPool.php rename to lib/Magento/App/Cache/Type/FrontendPool.php index db035340a07..6c809245055 100644 --- a/app/code/Magento/Core/Model/Cache/Type/FrontendPool.php +++ b/lib/Magento/App/Cache/Type/FrontendPool.php @@ -27,7 +27,7 @@ /** * In-memory readonly pool of cache front-ends with enforced access control, specific to cache types */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class FrontendPool { @@ -37,7 +37,7 @@ class FrontendPool private $_objectManager; /** - * @var \Magento\Core\Model\Cache\Frontend\Pool + * @var \Magento\App\Cache\Frontend\Pool */ private $_frontendPool; @@ -48,11 +48,11 @@ class FrontendPool /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Cache\Frontend\Pool $frontendPool + * @param \Magento\App\Cache\Frontend\Pool $frontendPool */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Cache\Frontend\Pool $frontendPool + \Magento\App\Cache\Frontend\Pool $frontendPool ) { $this->_objectManager = $objectManager; $this->_frontendPool = $frontendPool; @@ -70,12 +70,12 @@ class FrontendPool $frontendInstance = $this->_frontendPool->get($identifier); if (!$frontendInstance) { $frontendInstance = $this->_frontendPool->get( - \Magento\Core\Model\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID + \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID ); } - /** @var $frontendInstance \Magento\Core\Model\Cache\Type\AccessProxy */ + /** @var $frontendInstance \Magento\App\Cache\Type\AccessProxy */ $frontendInstance = $this->_objectManager->create( - 'Magento\Core\Model\Cache\Type\AccessProxy', array( + 'Magento\App\Cache\Type\AccessProxy', array( 'frontend' => $frontendInstance, 'identifier' => $identifier, ) diff --git a/app/code/Magento/Core/Model/Cache/Type/Layout.php b/lib/Magento/App/Cache/Type/Layout.php similarity index 87% rename from app/code/Magento/Core/Model/Cache/Type/Layout.php rename to lib/Magento/App/Cache/Type/Layout.php index 1165966b582..ab3df113f0e 100644 --- a/app/code/Magento/Core/Model/Cache/Type/Layout.php +++ b/lib/Magento/App/Cache/Type/Layout.php @@ -27,7 +27,7 @@ /** * System / Cache Management / Cache type "Layouts" */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class Layout extends \Magento\Cache\Frontend\Decorator\TagScope { @@ -42,9 +42,9 @@ class Layout extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'LAYOUT_GENERAL_CACHE_TAG'; /** - * @param \Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Core/Model/Cache/Type/Translate.php b/lib/Magento/App/Cache/Type/Translate.php similarity index 87% rename from app/code/Magento/Core/Model/Cache/Type/Translate.php rename to lib/Magento/App/Cache/Type/Translate.php index f267834bd03..5ec9266a622 100644 --- a/app/code/Magento/Core/Model/Cache/Type/Translate.php +++ b/lib/Magento/App/Cache/Type/Translate.php @@ -27,7 +27,7 @@ /** * System / Cache Management / Cache type "Translations" */ -namespace Magento\Core\Model\Cache\Type; +namespace Magento\App\Cache\Type; class Translate extends \Magento\Cache\Frontend\Decorator\TagScope { @@ -42,9 +42,9 @@ class Translate extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'TRANSLATE'; /** - * @param \Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\Core\Model\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Core/Model/Cache/TypeList.php b/lib/Magento/App/Cache/TypeList.php similarity index 88% rename from app/code/Magento/Core/Model/Cache/TypeList.php rename to lib/Magento/App/Cache/TypeList.php index fdf796d51ba..da82fa181d8 100644 --- a/app/code/Magento/Core/Model/Cache/TypeList.php +++ b/lib/Magento/App/Cache/TypeList.php @@ -21,24 +21,24 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\App\Cache; -class TypeList implements \Magento\Core\Model\Cache\TypeListInterface +class TypeList implements \Magento\App\Cache\TypeListInterface { const INVALIDATED_TYPES = 'core_cache_invalidate'; /** - * @var \Magento\Core\Model\Cache\Config + * @var \Magento\Cache\ConfigInterface */ protected $_config; /** - * @var \Magento\Core\Model\Cache\InstanceFactory + * @var \Magento\App\Cache\InstanceFactory */ protected $_factory; /** - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ protected $_cacheState; @@ -48,15 +48,15 @@ class TypeList implements \Magento\Core\Model\Cache\TypeListInterface protected $_cache; /** - * @param \Magento\Core\Model\Cache\Config $config - * @param \Magento\Core\Model\Cache\StateInterface $cacheState - * @param \Magento\Core\Model\Cache\InstanceFactory $factory + * @param \Magento\Cache\ConfigInterface $config + * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\App\Cache\InstanceFactory $factory * @param \Magento\App\CacheInterface $cache */ public function __construct( - \Magento\Core\Model\Cache\Config $config, - \Magento\Core\Model\Cache\StateInterface $cacheState, - \Magento\Core\Model\Cache\InstanceFactory $factory, + \Magento\Cache\ConfigInterface $config, + \Magento\App\Cache\StateInterface $cacheState, + \Magento\App\Cache\InstanceFactory $factory, \Magento\App\CacheInterface $cache ) { $this->_config = $config; diff --git a/app/code/Magento/Core/Model/Cache/TypeListInterface.php b/lib/Magento/App/Cache/TypeListInterface.php similarity index 97% rename from app/code/Magento/Core/Model/Cache/TypeListInterface.php rename to lib/Magento/App/Cache/TypeListInterface.php index 89bc90b17cc..49ac32be293 100644 --- a/app/code/Magento/Core/Model/Cache/TypeListInterface.php +++ b/lib/Magento/App/Cache/TypeListInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\App\Cache; interface TypeListInterface { diff --git a/app/code/Magento/Core/Model/Cache/Config.php b/lib/Magento/Cache/Config.php similarity index 76% rename from app/code/Magento/Core/Model/Cache/Config.php rename to lib/Magento/Cache/Config.php index c94118a6bda..e1249d0b1c7 100644 --- a/app/code/Magento/Core/Model/Cache/Config.php +++ b/lib/Magento/Cache/Config.php @@ -23,27 +23,25 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache; +namespace Magento\Cache; -class Config +class Config implements ConfigInterface { /** - * @var \Magento\Core\Model\Cache\Config\Data + * @var \Magento\Cache\Config\Data */ protected $_dataStorage; /** - * @param \Magento\Core\Model\Cache\Config\Data $dataStorage + * @param \Magento\Cache\Config\Data $dataStorage */ - public function __construct(\Magento\Core\Model\Cache\Config\Data $dataStorage) + public function __construct(\Magento\Cache\Config\Data $dataStorage) { $this->_dataStorage = $dataStorage; } /** - * Get configuration of all cache types - * - * @return array + * {inheritdoc} */ public function getTypes() { @@ -51,10 +49,7 @@ class Config } /** - * Get configuration of specified cache type - * - * @param string $type - * @return array + * {inheritdoc} */ public function getType($type) { diff --git a/app/code/Magento/Core/Model/Cache/Config/Converter.php b/lib/Magento/Cache/Config/Converter.php similarity index 98% rename from app/code/Magento/Core/Model/Cache/Config/Converter.php rename to lib/Magento/Cache/Config/Converter.php index bd3ece4d5dd..866e5bf143a 100644 --- a/app/code/Magento/Core/Model/Cache/Config/Converter.php +++ b/lib/Magento/Cache/Config/Converter.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Config; +namespace Magento\Cache\Config; class Converter implements \Magento\Config\ConverterInterface { diff --git a/app/code/Magento/Core/Model/Cache/Config/Data.php b/lib/Magento/Cache/Config/Data.php similarity index 90% rename from app/code/Magento/Core/Model/Cache/Config/Data.php rename to lib/Magento/Cache/Config/Data.php index ff6d447ca26..7e7f1f04269 100644 --- a/app/code/Magento/Core/Model/Cache/Config/Data.php +++ b/lib/Magento/Cache/Config/Data.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Config; +namespace Magento\Cache\Config; class Data extends \Magento\Config\Data\Scoped { @@ -35,13 +35,13 @@ class Data extends \Magento\Config\Data\Scoped protected $_scopePriorityScheme = array('global'); /** - * @param \Magento\Core\Model\Cache\Config\Reader $reader + * @param \Magento\Cache\Config\Reader $reader * @param \Magento\Config\ScopeInterface $configScope * @param \Magento\Config\CacheInterface $cache * @param string $cacheId */ public function __construct( - \Magento\Core\Model\Cache\Config\Reader $reader, + \Magento\Cache\Config\Reader $reader, \Magento\Config\ScopeInterface $configScope, \Magento\Config\CacheInterface $cache, $cacheId diff --git a/app/code/Magento/Core/Model/Cache/Config/Reader.php b/lib/Magento/Cache/Config/Reader.php similarity index 85% rename from app/code/Magento/Core/Model/Cache/Config/Reader.php rename to lib/Magento/Cache/Config/Reader.php index f9e5bd5457a..3689256ef0e 100644 --- a/app/code/Magento/Core/Model/Cache/Config/Reader.php +++ b/lib/Magento/Cache/Config/Reader.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Config; +namespace Magento\Cache\Config; class Reader extends \Magento\Config\Reader\Filesystem { @@ -36,8 +36,8 @@ class Reader extends \Magento\Config\Reader\Filesystem /** * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Core\Model\Cache\Config\Converter $converter - * @param \Magento\Core\Model\Cache\Config\SchemaLocator $schemeLocator + * @param \Magento\Cache\Config\Converter $converter + * @param \Magento\Cache\Config\SchemaLocator $schemeLocator * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes @@ -45,8 +45,8 @@ class Reader extends \Magento\Config\Reader\Filesystem */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, - \Magento\Core\Model\Cache\Config\Converter $converter, - \Magento\Core\Model\Cache\Config\SchemaLocator $schemeLocator, + \Magento\Cache\Config\Converter $converter, + \Magento\Cache\Config\SchemaLocator $schemeLocator, \Magento\Config\ValidationStateInterface $validationState, $fileName = 'cache.xml', $idAttributes = array(), diff --git a/app/code/Magento/Core/Model/Cache/Config/SchemaLocator.php b/lib/Magento/Cache/Config/SchemaLocator.php similarity index 81% rename from app/code/Magento/Core/Model/Cache/Config/SchemaLocator.php rename to lib/Magento/Cache/Config/SchemaLocator.php index ae426495130..0eaa20a01cf 100644 --- a/app/code/Magento/Core/Model/Cache/Config/SchemaLocator.php +++ b/lib/Magento/Cache/Config/SchemaLocator.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Cache\Config; +namespace Magento\Cache\Config; class SchemaLocator implements \Magento\Config\SchemaLocatorInterface { @@ -32,21 +32,18 @@ class SchemaLocator implements \Magento\Config\SchemaLocatorInterface * * @var string */ - protected $_schema = null; + protected $_schema; /** * Path to corresponding XSD file with validation rules for separate config files * * @var string */ - protected $_perFileSchema = null; + protected $_perFileSchema; - /** - * @param \Magento\Module\Dir\Reader $moduleReader - */ - public function __construct(\Magento\Module\Dir\Reader $moduleReader) + public function __construct() { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Core') . DIRECTORY_SEPARATOR . 'cache.xsd'; + $this->_schema = realpath(__DIR__ . '/../etc/cache.xsd'); } /** diff --git a/lib/Magento/Cache/ConfigInterface.php b/lib/Magento/Cache/ConfigInterface.php new file mode 100644 index 00000000000..fc32ceba05c --- /dev/null +++ b/lib/Magento/Cache/ConfigInterface.php @@ -0,0 +1,44 @@ +<?php +/** + * Cache configuration model. Provides cache configuration data to the application + * + * 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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Cache; + +interface ConfigInterface +{ + /** + * Get configuration of all cache types + * + * @return array + */ + public function getTypes(); + + /** + * Get configuration of specified cache type + * + * @param string $type + * @return array + */ + public function getType($type); +} diff --git a/app/code/Magento/Core/etc/cache.xsd b/lib/Magento/Cache/etc/cache.xsd similarity index 100% rename from app/code/Magento/Core/etc/cache.xsd rename to lib/Magento/Cache/etc/cache.xsd diff --git a/app/code/Magento/Core/Model/BlockFactory.php b/lib/Magento/File/UploaderFactory.php similarity index 75% rename from app/code/Magento/Core/Model/BlockFactory.php rename to lib/Magento/File/UploaderFactory.php index a25aa923375..c9b9f8d151a 100644 --- a/app/code/Magento/Core/Model/BlockFactory.php +++ b/lib/Magento/File/UploaderFactory.php @@ -17,21 +17,20 @@ * 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 Magento - * @package Magento_Core + * * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\File; -namespace Magento\Core\Model; - -class BlockFactory +class UploaderFactory { /** + * Object manager + * * @var \Magento\ObjectManager */ - protected $_objectManager; + private $_objectManager; /** * @param \Magento\ObjectManager $objectManager @@ -42,12 +41,13 @@ class BlockFactory } /** - * @param string $blockName - * @param array $arguments - * @return \Magento\Core\Block\AbstractBlock + * Create new uploader instance + * + * @param array $data + * @return Uploader */ - public function createBlock($blockName, array $arguments = array()) + public function create(array $data = array()) { - return $this->_objectManager->create($blockName, $arguments); + return $this->_objectManager->create('Magento\File\Uploader', $data); } -} +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/Directory/Read.php b/lib/Magento/Filesystem/Directory/Read.php new file mode 100644 index 00000000000..2a25785a916 --- /dev/null +++ b/lib/Magento/Filesystem/Directory/Read.php @@ -0,0 +1,200 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Filesystem\Directory; + +use Magento\Filesystem\FilesystemException; + +class Read implements ReadInterface +{ + /** + * @var string + */ + protected $path; + + /** + * @var \Magento\Filesystem\File\ReadFactory + */ + protected $fileFactory; + + /** + * @param string $path + * @param \Magento\Filesystem\File\ReadFactory $fileFactory + */ + public function __construct($path, \Magento\Filesystem\File\ReadFactory $fileFactory) + { + $this->path = rtrim($path, '/') . '/'; + $this->fileFactory = $fileFactory; + } + + /** + * @param string $path + * @return string + */ + public function getAbsolutePath($path) + { + return $this->path . ltrim($path, '/'); + } + + /** + * @param string $path + * @return string + */ + protected function getRelativePath($path) + { + if (strpos($path, $this->path) === 0) { + $result = substr($path, strlen($this->path)); + } else { + $result = $path; + } + return $result; + } + + /** + * Validate of path existence + * + * @param string $path + * @throws FilesystemException + */ + protected function assertExist($path) + { + if ($this->isExist($path) === false) { + throw new FilesystemException(sprintf('The path "%s" doesn\'t exist', $this->getAbsolutePath($path))); + } + } + + /** + * Retrieve list of all entities in given path + * + * @param string|null $path + * @return array + */ + public function read($path = null) + { + $this->assertExist($path); + + $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; + $iterator = new \FilesystemIterator($this->getAbsolutePath($path), $flags); + $result = array(); + /** @var \FilesystemIterator $file */ + foreach ($iterator as $file) { + $result[] = $this->getRelativePath($file->getPathname()); + } + return $result; + } + + /** + * Search all entries for given regex pattern + * + * @param string $pattern + * @return array + */ + public function search($pattern) + { + clearstatcache(); + + $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; + $iterator = new \RegexIterator( + new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($this->path, $flags) + ), + $pattern + ); + $result = array(); + /** @var \FilesystemIterator $file */ + foreach ($iterator as $file) { + $result[] = $this->getRelativePath($file->getPathname()); + } + return $result; + } + + /** + * Check a file or directory exists + * + * @param string|null $path + * @return bool + */ + public function isExist($path = null) + { + clearstatcache(); + + return file_exists($this->getAbsolutePath($path)); + } + + /** + * Gathers the statistics of the given path + * + * @param string $path + * @return array + */ + public function stat($path) + { + $this->assertExist($path); + + return stat($this->getAbsolutePath($path)); + } + + /** + * Check permissions for reading file or directory + * + * @param string $path + * @return bool + */ + public function isReadable($path) + { + clearstatcache(); + + return is_readable($this->getAbsolutePath($path)); + } + + /** + * Open file in read mode + * + * @param string $path + * @return \Magento\Filesystem\File\ReadInterface + */ + public function openFile($path) + { + return $this->fileFactory->create($this->getAbsolutePath($path)); + } + + /** + * Retrieve file contents from given path + * + * @param string $path + * @return string + * @throws FilesystemException + */ + public function readFile($path) + { + $absolutePath = $this->getAbsolutePath($path); + clearstatcache(); + if (is_file($absolutePath) === false) { + throw new FilesystemException( + sprintf('The file "%s" either doesn\'t exist or not a file', $absolutePath) + ); + } + return file_get_contents($absolutePath); + } +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/Directory/ReadInterface.php b/lib/Magento/Filesystem/Directory/ReadInterface.php new file mode 100644 index 00000000000..b663a30390c --- /dev/null +++ b/lib/Magento/Filesystem/Directory/ReadInterface.php @@ -0,0 +1,92 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\Directory; + +interface ReadInterface +{ + /** + * Get absolute path + * + * @param string $path + * @return string mixed + */ + public function getAbsolutePath($path); + + /** + * Retrieve list of all entities in given path + * + * @param string $path + * @return array + */ + public function read($path); + + /** + * Search all entries for given regex pattern + * + * @param string $pattern + * @return array + */ + public function search($pattern); + + /** + * Check a file or directory exists + * + * @param string $path + * @return bool + */ + public function isExist($path); + + /** + * Gathers the statistics of the given path + * + * @param string $path + * @return array + */ + public function stat($path); + + /** + * Check permissions for reading file or directory + * + * @param string $path + * @return bool + */ + public function isReadable($path); + + /** + * Open file in read mode + * + * @param string $path + * @return \Magento\Filesystem\File\ReadInterface + */ + public function openFile($path); + + /** + * Retrieve file contents from given path + * + * @param string $path + * @return string + * @throws \Magento\Filesystem\FilesystemException + */ + public function readFile($path); +} diff --git a/lib/Magento/Filesystem/Directory/Write.php b/lib/Magento/Filesystem/Directory/Write.php new file mode 100644 index 00000000000..3ff27809ea1 --- /dev/null +++ b/lib/Magento/Filesystem/Directory/Write.php @@ -0,0 +1,294 @@ +<?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 Magento + * @package Magento + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Filesystem\Directory; + +use Magento\Filesystem\FilesystemException; + +class Write extends Read implements WriteInterface +{ + /** + * @var int + */ + protected $permissions; + + /** + * @param string $path + * @param \Magento\Filesystem\File\WriteFactory $fileFactory + * @param $permissions + */ + public function __construct($path, \Magento\Filesystem\File\WriteFactory $fileFactory, $permissions) + { + $this->path = rtrim($path, '/') . '/'; + $this->fileFactory = $fileFactory; + $this->permissions = $permissions; + } + + /** + * Check it directory is writable + * + * @throws \Magento\Filesystem\FilesystemException + */ + protected function assertWritable($path) + { + clearstatcache(); + $absolutePath = $this->getAbsolutePath($path); + if (is_writable($absolutePath) === false) { + throw new FilesystemException(sprintf('The path "%s" is not writable', $absolutePath)); + } + } + + /** + * Recursively asserts parent folder are either not exists or exists and have write permissions + * + * @param string $absolutePath + * @throws \Magento\Filesystem\FilesystemException + */ + protected function assertParentsWritable($absolutePath) + { + clearstatcache(); + if (!is_writable($absolutePath)) { + if (file_exists($absolutePath)) { + throw new FilesystemException(sprintf('The path "%s" is not writable', $absolutePath)); + } else { + $this->assertParentsWritable(dirname($absolutePath)); + } + } + } + + /** + * Create directory if it does not exists + * + * @param string $path + * @return bool + * @throws FilesystemException + */ + public function create($path) + { + clearstatcache(); + $absolutePath = $this->getAbsolutePath($path); + if (is_dir($absolutePath)) { + return true; + } elseif (is_file($absolutePath)) { + throw new FilesystemException(sprintf('The "%s" file already exists', $absolutePath)); + } + $this->assertParentsWritable($absolutePath); + + $result = mkdir($absolutePath, $this->permissions, true); + if ($result === false) { + throw new FilesystemException(sprintf('Directory "%s" cannot be created', $absolutePath)); + } + return $result; + } + + /** + * Renames a source to into new name + * + * @param string $path + * @param string $newPath + * @param WriteInterface $targetDirectory + * @return bool + * @throws FilesystemException + */ + public function rename($path, $newPath, WriteInterface $targetDirectory = null) + { + $this->assertExist($path); + + $targetDirectory = $targetDirectory ? : $this; + if (!$targetDirectory->isExist(dirname($newPath))) { + $targetDirectory->create(dirname($newPath)); + } + + $absolutePath = $this->getAbsolutePath($path); + $absoluteNewPath = $targetDirectory->getAbsolutePath($newPath); + + $result = rename($absolutePath, $absoluteNewPath); + if ($result === null) { + throw new FilesystemException( + sprintf('The "%s" path cannot be renamed into "%s"', $absolutePath, $absoluteNewPath) + ); + } + return $result; + } + + /** + * Copy a source to into destination + * + * @param string $path + * @param string $destination + * @param WriteInterface $targetDirectory + * @return bool + * @throws FilesystemException + */ + public function copy($path, $destination, WriteInterface $targetDirectory = null) + { + $this->assertExist($path); + + $targetDirectory = $targetDirectory ? : $this; + if (!$targetDirectory->isExist(dirname($destination))) { + $targetDirectory->create(dirname($destination)); + } + + $absolutePath = $this->getAbsolutePath($path); + $absoluteDestinationPath = $targetDirectory->getAbsolutePath($destination); + + $result = copy($absolutePath, $absoluteDestinationPath); + if ($result === null) { + throw new FilesystemException( + sprintf('The "%s" path cannot be renamed into "%s"', $absolutePath, $absoluteDestinationPath) + ); + } + return $result; + } + + /** + * Delete given path + * + * @param string $path + * @return bool + * @throws FilesystemException + */ + public function delete($path = null) + { + $this->assertExist($path); + + $absolutePath = $this->getAbsolutePath($path); + if (is_file($absolutePath)) { + $result = unlink($this->getAbsolutePath($path)); + } else { + foreach ($this->read($path) as $subPath) { + $this->delete($subPath); + } + $result = rmdir($absolutePath); + } + if ($result === false) { + throw new FilesystemException(sprintf('The file or directory "%s" cannot be deleted', $absolutePath)); + } + return $result; + } + + /** + * Change permissions of given path + * + * @param string $path + * @param int $permissions + * @return bool + * @throws FilesystemException + */ + public function changePermissions($path, $permissions) + { + $this->assertExist($path); + + $absolutePath = $this->getAbsolutePath($path); + $result = chmod($absolutePath, $permissions); + if ($result === false) { + throw new FilesystemException(sprintf('Cannot change permissions for "%s" path', $absolutePath)); + } + return $result; + } + + /** + * Sets access and modification time of file. + * + * @param string $path + * @param int|null $modificationTime + * @return bool + * @throws FilesystemException + */ + public function touch($path, $modificationTime = null) + { + $absolutePath = $this->getAbsolutePath($path); + + $folder = dirname($path); + $this->create($folder); + $this->assertWritable($folder); + + if ($modificationTime === null) { + $result = touch($absolutePath); + } else { + $result = touch($absolutePath, $modificationTime); + } + if ($result === false) { + throw new FilesystemException(sprintf('The file or directory "%s" cannot be touched', $absolutePath)); + } + return $result; + } + + /** + * Check if given path is writable + * + * @param string|null $path + * @return bool + */ + public function isWritable($path = null) + { + clearstatcache(); + + return is_writable($this->getAbsolutePath($path)); + } + + /** + * Open file in given mode + * + * @param string $path + * @param string $mode + * @return \Magento\Filesystem\File\WriteInterface + */ + public function openFile($path, $mode = 'w') + { + $absolutePath = $this->getAbsolutePath($path); + + $folder = dirname($path); + $this->create($folder); + $this->assertWritable($folder); + + return $this->fileFactory->create($absolutePath, $mode); + } + + /** + * Open file in given path + * + * @param string $path + * @param string $content + * @param string|null $mode + * @return int The number of bytes that were written. + * @throws FilesystemException + */ + public function writeFile($path, $content, $mode = null) + { + $absolutePath = $this->getAbsolutePath($path); + + $folder = dirname($path); + $this->create($folder); + $this->assertWritable($folder); + + $result = file_put_contents($absolutePath, $content, $mode); + if ($result === null) { + throw new FilesystemException(sprintf('The specified "%s" file could not be written', $absolutePath)); + } + return $result; + } +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/Directory/WriteInterface.php b/lib/Magento/Filesystem/Directory/WriteInterface.php new file mode 100644 index 00000000000..a40eaca25fa --- /dev/null +++ b/lib/Magento/Filesystem/Directory/WriteInterface.php @@ -0,0 +1,115 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\Directory; + +interface WriteInterface extends ReadInterface +{ + /** + * Create directory if it does not exists + * + * @param string $path + * @return bool + * @throws \Magento\Filesystem\FilesystemException + */ + public function create($path); + + /** + * Renames a source to into new name + * + * @param string $path + * @param string $newPath + * @param WriteInterface $targetDirectory + * @return bool + * @throws \Magento\Filesystem\FilesystemException + */ + public function rename($path, $newPath, WriteInterface $targetDirectory = null); + + /** + * Copy a file + * + * @param string $path + * @param string $destination + * @param WriteInterface $targetDirectory + * @return bool + * @throws \Magento\Filesystem\FilesystemException + */ + public function copy($path, $destination, WriteInterface $targetDirectory = null); + + /** + * Delete given path + * + * @param string $path + * @return bool + * @throws \Magento\Filesystem\FilesystemException + */ + public function delete($path); + + /** + * Change permissions of given path + * + * @param string $path + * @param int $permissions + * @return bool + * @throws \Magento\Filesystem\FilesystemException + */ + public function changePermissions($path, $permissions); + + /** + * Sets access and modification time of file. + * + * @param string $path + * @param int|null $modificationTime + * @return bool + * @throws \Magento\Filesystem\FilesystemException + */ + public function touch($path, $modificationTime = null); + + /** + * Check if given path is writable + * + * @param string $path + * @return bool + */ + public function isWritable($path); + + /** + * Open file in given mode + * + * @param string $path + * @param string|null $mode + * @return \Magento\Filesystem\File\WriteInterface + */ + public function openFile($path, $mode = 'w'); + + /** + * Open file in given path + * + * @param string $path + * @param string $content + * @param string|null $mode + * @return int The number of bytes that were written. + * @throws \Magento\Filesystem\FilesystemException + */ + public function writeFile($path, $content, $mode = null); +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/File/Read.php b/lib/Magento/Filesystem/File/Read.php new file mode 100644 index 00000000000..d6e740233c8 --- /dev/null +++ b/lib/Magento/Filesystem/File/Read.php @@ -0,0 +1,155 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Filesystem\File; + +use Magento\Filesystem\FilesystemException; + +class Read implements ReadInterface +{ + /** + * Full path to file + * + * @var string + */ + protected $path; + + /** + * Mode to open the file + * + * @var string + */ + protected $mode = 'r'; + + /** + * Opened file resource + * + * @var resource + */ + protected $resource; + + /** + * @param string $path + */ + public function __construct($path) + { + $this->path = $path; + $this->open(); + } + + /** + * Open file + * + * @throws FilesystemException + */ + protected function open() + { + $this->assertValid(); + $this->resource = fopen($this->path, $this->mode); + if ($this->resource === false) { + throw new FilesystemException(sprintf('The file "%s" cannot be opened', $this->path)); + } + } + + /** + * Assert file existence + * + * @throws FilesystemException + */ + protected function assertValid() + { + clearstatcache(); + + if (!file_exists($this->path)) { + throw new FilesystemException(sprintf('The file "%s" doesn\'t exist', $this->path)); + } + } + + /** + * Reads the specified number of bytes from the current position. + * + * @param int $length The number of bytes to read + * @return string + */ + public function read($length) + { + return fread($this->resource, $length); + } + + /** + * Reads one CSV row from the file + * + * @param int $length [optional] + * @param string $delimiter [optional] + * @param string $enclosure [optional] + * @param string $escape [optional] + * @return array|bool|null + */ + public function readCsv($length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\') + { + return fgetcsv($this->resource, $length, $delimiter, $enclosure, $escape); + } + + /** + * Returns the current position + * + * @return int + */ + public function tell() + { + return ftell($this->resource); + } + + /** + * Seeks to the specified offset + * + * @param int $offset + * @param int $whence + * @return int + */ + public function seek($offset, $whence = SEEK_SET) + { + return fseek($this->resource, $offset, $whence); + } + + /** + * Checks if the current position is the end-of-file + * + * @return bool + */ + public function eof() + { + return feof($this->resource); + } + + /** + * Closes the file. + * + * @return bool + */ + public function close() + { + return fclose($this->resource); + } +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/File/ReadFactory.php b/lib/Magento/Filesystem/File/ReadFactory.php new file mode 100644 index 00000000000..22994093207 --- /dev/null +++ b/lib/Magento/Filesystem/File/ReadFactory.php @@ -0,0 +1,52 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Filesystem\File; + +class ReadFactory +{ + /** + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(\Magento\ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create a readable file + * + * @param string $path + * @return \Magento\Filesystem\File\ReadInterface + */ + public function create($path) + { + return $this->objectManager->create('Magento\Filesystem\File\Read', array('path' => $path)); + } +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/File/ReadInterface.php b/lib/Magento/Filesystem/File/ReadInterface.php new file mode 100644 index 00000000000..a8b02a5dc17 --- /dev/null +++ b/lib/Magento/Filesystem/File/ReadInterface.php @@ -0,0 +1,76 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\File; + +interface ReadInterface +{ + /** + * Reads the specified number of bytes from the current position. + * + * @param int $length The number of bytes to read + * @return string + */ + public function read($length); + + /** + * Reads one CSV row from the file + * + * @param int $length [optional] <p> + * @param string $delimiter [optional] + * @param string $enclosure [optional] + * @param string $escape [optional] + * @return array|bool false on end of file + */ + public function readCsv($length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\'); + + /** + * Returns the current position + * + * @return int + */ + public function tell(); + + /** + * Seeks to the specified offset + * + * @param int $length + * @param int $whence + * @return int + */ + public function seek($length, $whence = SEEK_SET); + + /** + * Checks if the current position is the end-of-file + * + * @return bool + */ + public function eof(); + + /** + * Closes the file. + * + * @return bool + */ + public function close(); +} diff --git a/lib/Magento/Filesystem/File/Write.php b/lib/Magento/Filesystem/File/Write.php new file mode 100644 index 00000000000..4a62f815dfa --- /dev/null +++ b/lib/Magento/Filesystem/File/Write.php @@ -0,0 +1,143 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Filesystem\File; + +use Magento\Filesystem\FilesystemException; + +class Write extends Read implements WriteInterface +{ + /** + * @param string $path + * @param string $mode + */ + public function __construct($path, $mode) + { + $this->mode = $mode; + parent::__construct($path); + } + + /** + * Assert file existence for proper mode + * + * @throws \Magento\Filesystem\FilesystemException + */ + protected function assertValid() + { + clearstatcache(); + + $fileExists = file_exists($this->path); + if (!$fileExists && preg_match('/r/', $this->mode)) { + throw new FilesystemException(sprintf('The file "%s" doesn\'t exist', $this->path)); + } elseif ($fileExists && preg_match('/x/', $this->mode)) { + throw new FilesystemException(sprintf('The file "%s" already exists', $this->path)); + } + } + + /** + * Writes the data to file. + * + * @param string $data + * @return int + * @throws FilesystemException + */ + public function write($data) + { + $result = fwrite($this->resource, $data); + if ($result === false) { + throw new FilesystemException(sprintf('Cannot write to the "%s" file', $this->path)); + } + return $result; + } + + /** + * Writes one CSV row to the file. + * + * @param array $data + * @param string $delimiter + * @param string $enclosure + * @return int + * @throws FilesystemException + */ + public function writeCsv(array $data, $delimiter = ',', $enclosure = '"') + { + $result = fputcsv($this->resource, $data, $delimiter, $enclosure); + if ($result === false) { + throw new FilesystemException(sprintf('Cannot write to the "%s" file', $this->path)); + } + return $result; + } + + /** + * Flushes the output. + * + * @return bool + * @throws FilesystemException + */ + public function flush() + { + $result = fflush($this->resource); + if ($result === false) { + throw new FilesystemException(sprintf('Cannot flush the "%s" file', $this->path)); + } + return $result; + } + + /** + * Portable advisory file locking + * + * @param bool $exclusive + * @return bool + */ + public function lock($exclusive = true) + { + $lock = $exclusive ? LOCK_EX : LOCK_SH; + return flock($this->resource, $lock); + } + + /** + * File unlocking + * + * @return bool + */ + public function unlock() + { + return flock($this->resource, LOCK_UN); + } + + /** + * Closes the file. + * + * @return bool + * @throws FilesystemException + */ + public function close() + { + $result = fclose($this->resource); + if ($result === false) { + throw new FilesystemException(sprintf('Cannot close the "%s" file', $this->path)); + } + return $result; + } +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/File/WriteFactory.php b/lib/Magento/Filesystem/File/WriteFactory.php new file mode 100644 index 00000000000..7635fcd064a --- /dev/null +++ b/lib/Magento/Filesystem/File/WriteFactory.php @@ -0,0 +1,53 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Filesystem\File; + +class WriteFactory +{ + /** + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(\Magento\ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create a readable file + * + * @param string $path + * @param string $mode + * @return \Magento\Filesystem\File\WriteInterface + */ + public function create($path, $mode) + { + return $this->objectManager->create('Magento\Filesystem\File\Write', array('path' => $path, 'mode' => $mode)); + } +} \ No newline at end of file diff --git a/lib/Magento/Filesystem/File/WriteInterface.php b/lib/Magento/Filesystem/File/WriteInterface.php new file mode 100644 index 00000000000..1ae2728eb20 --- /dev/null +++ b/lib/Magento/Filesystem/File/WriteInterface.php @@ -0,0 +1,70 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Filesystem\File; + +interface WriteInterface extends ReadInterface +{ + /** + * Writes the data to file. + * + * @param string $data + * @return int + * @throws \Magento\Filesystem\FilesystemException + */ + public function write($data); + + /** + * Writes one CSV row to the file. + * + * @param array $data + * @param string $delimiter + * @param string $enclosure + * @return int + * @throws \Magento\Filesystem\FilesystemException + */ + public function writeCsv(array $data, $delimiter = ',', $enclosure = '"'); + + /** + * Flushes the output. + * + * @return bool + * @throws \Magento\Filesystem\FilesystemException + */ + public function flush(); + + /** + * Portable advisory file locking + * + * @param bool $exclusive + * @return bool + */ + public function lock($exclusive = true); + + /** + * File unlocking + * + * @return bool + */ + public function unlock(); +} \ No newline at end of file diff --git a/app/code/Magento/ImportExport/Model/HttpAdapterFactory.php b/lib/Magento/HTTP/Adapter/FileTransferFactory.php similarity index 94% rename from app/code/Magento/ImportExport/Model/HttpAdapterFactory.php rename to lib/Magento/HTTP/Adapter/FileTransferFactory.php index 11eb9370105..373e273dbeb 100644 --- a/app/code/Magento/ImportExport/Model/HttpAdapterFactory.php +++ b/lib/Magento/HTTP/Adapter/FileTransferFactory.php @@ -21,9 +21,9 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\ImportExport\Model; +namespace Magento\HTTP\Adapter; -class HttpAdapterFactory +class FileTransferFactory { /** * Create HTTP adapter diff --git a/lib/Magento/Image.php b/lib/Magento/Image.php index 1e928cb45c4..d403825bfe8 100644 --- a/lib/Magento/Image.php +++ b/lib/Magento/Image.php @@ -35,22 +35,27 @@ namespace Magento; class Image { + /** + * @var Image\Adapter\AdapterInterface + */ protected $_adapter; + /** + * @var null|string + */ protected $_fileName; /** * Constructor * - * @param \Magento\Image\Adapter\AbstractAdapter $adapter. Default value is GD2 - * @param string $fileName - * @return void + * @param Image\Adapter\AdapterInterface $adapter + * @param string|null $fileName */ - function __construct(\Magento\Image\Adapter\AbstractAdapter $adapter, $fileName = null) + public function __construct(\Magento\Image\Adapter\AdapterInterface $adapter, $fileName = null) { $this->_adapter = $adapter; $this->_fileName = $fileName; - if( isset($fileName) ) { + if (isset($fileName)) { $this->open(); } } diff --git a/lib/Magento/Image/Adapter/AbstractAdapter.php b/lib/Magento/Image/Adapter/AbstractAdapter.php index 20fd1e04c83..299f64eda89 100644 --- a/lib/Magento/Image/Adapter/AbstractAdapter.php +++ b/lib/Magento/Image/Adapter/AbstractAdapter.php @@ -31,7 +31,7 @@ namespace Magento\Image\Adapter; -abstract class AbstractAdapter +abstract class AbstractAdapter implements AdapterInterface { /** * Background color diff --git a/lib/Magento/Image/Adapter/AdapterInterface.php b/lib/Magento/Image/Adapter/AdapterInterface.php new file mode 100644 index 00000000000..bc3bbcec5eb --- /dev/null +++ b/lib/Magento/Image/Adapter/AdapterInterface.php @@ -0,0 +1,123 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Image\Adapter; + +interface AdapterInterface +{ + /** + * Adapter type + */ + const ADAPTER_GD2 = 'GD2'; + const ADAPTER_IM = 'IMAGEMAGICK'; + + /** + * Returns rgba array of the specified pixel + * + * @param int $x + * @param int $y + * @return array + */ + public function getColorAt($x, $y); + + /** + * @see \Magento\Image\Adapter\AbstractAdapter::getImage + * @return string + */ + public function getImage(); + + /** + * Add watermark to image + * + * @param string $imagePath + * @param int $positionX + * @param int $positionY + * @param int $opacity + * @param bool $tile + */ + public function watermark($imagePath, $positionX = 0, $positionY = 0, $opacity = 30, $tile = false); + + /** + * Reassign image dimensions + */ + public function refreshImageDimensions(); + + /** + * Checks required dependencies + * + * @throws \Exception if some of dependencies are missing + */ + public function checkDependencies(); + + /** + * Create Image from string + * + * @param string $text + * @param string $font + * @return \Magento\Image\Adapter\AbstractAdapter + */ + public function createPngFromString($text, $font = ''); + + /** + * Open image for processing + * + * @param string $filename + */ + public function open($filename); + + /** + * Change the image size + * + * @param int $frameWidth + * @param int $frameHeight + */ + public function resize($frameWidth = null, $frameHeight = null); + + /** + * Crop image + * + * @param int $top + * @param int $left + * @param int $right + * @param int $bottom + * @return bool + */ + public function crop($top = 0, $left = 0, $right = 0, $bottom = 0); + + /** + * Save image to specific path. + * If some folders of path does not exist they will be created + * + * @throws \Exception if destination path is not writable + * @param string $destination + * @param string $newName + */ + public function save($destination = null, $newName = null); + + /** + * Rotate image on specific angle + * + * @param int $angle + */ + public function rotate($angle); +} \ No newline at end of file diff --git a/lib/Magento/Image/Adapter/ConfigInterface.php b/lib/Magento/Image/Adapter/ConfigInterface.php new file mode 100644 index 00000000000..84f719cda2e --- /dev/null +++ b/lib/Magento/Image/Adapter/ConfigInterface.php @@ -0,0 +1,37 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Image\Adapter; + +interface ConfigInterface +{ + /** + * @return string + */ + public function getAdapterAlias(); + + /** + * @return array + */ + public function getAdapters(); +} diff --git a/lib/Magento/Image/AdapterFactory.php b/lib/Magento/Image/AdapterFactory.php new file mode 100644 index 00000000000..53062d15e0e --- /dev/null +++ b/lib/Magento/Image/AdapterFactory.php @@ -0,0 +1,87 @@ +<?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 Magento + * @package Magento_Core + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Image; + +class AdapterFactory +{ + /** + * @var Adapter\ConfigInterface + */ + protected $config; + + /** + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * @var array + */ + protected $adapterMap; + + /** + * @param \Magento\ObjectManager $objectManager + * @param Adapter\ConfigInterface $config + * @param array $adapterMap + */ + public function __construct( + \Magento\ObjectManager $objectManager, + \Magento\Image\Adapter\ConfigInterface $config, + array $adapterMap = array() + ) { + $this->objectManager = $objectManager; + $this->config = $config; + $this->adapterMap = array_merge($config->getAdapters(), $adapterMap); + } + + /** + * Return specified image adapter + * + * @param string $adapterAlias + * @return \Magento\Image\Adapter\AdapterInterface + * @throws \InvalidArgumentException + */ + public function create($adapterAlias = null) + { + $adapterAlias = !empty($adapterAlias) ? $adapterAlias : $this->config->getAdapterAlias(); + if (empty($adapterAlias)) { + throw new \InvalidArgumentException('Image adapter is not selected.'); + } + if (empty($this->adapterMap[$adapterAlias]['class'])) { + throw new \InvalidArgumentException("Image adapter for '{$adapterAlias}' is not setup."); + } + $imageAdapter = $this->objectManager->create($this->adapterMap[$adapterAlias]['class']); + if (!$imageAdapter instanceof Adapter\AdapterInterface) { + throw new \InvalidArgumentException( + $this->adapterMap[$adapterAlias]['class'] + . ' is not instance of \Magento\Image\Adapter\AdapterInterface' + ); + } + $imageAdapter->checkDependencies(); + return $imageAdapter; + } +} diff --git a/lib/Magento/Image/Factory.php b/lib/Magento/Image/Factory.php new file mode 100644 index 00000000000..46eb85df2dd --- /dev/null +++ b/lib/Magento/Image/Factory.php @@ -0,0 +1,65 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Image; + +use Magento\ObjectManager; + +class Factory +{ + /** + * @var ObjectManager + */ + protected $objectManager; + + /** + * @var AdapterFactory + */ + protected $adapterFactory; + + /** + * @param ObjectManager $objectManager + * @param AdapterFactory $adapterFactory + */ + public function __construct( + ObjectManager $objectManager, + AdapterFactory $adapterFactory + ) { + $this->objectManager = $objectManager; + $this->adapterFactory = $adapterFactory; + } + + /** + * Create instance of \Magento\Image + * + * @param string|null $fileName + * @param string|null $adapterName + * @return \Magento\Image + */ + public function create($fileName = null, $adapterName = null) + { + $adapter = $this->adapterFactory->create($adapterName); + return $this->objectManager->create('Magento\Image', array('adapter' => $adapter, 'fileName' => $fileName)); + } +} diff --git a/app/code/Magento/Core/Model/ModuleManager.php b/lib/Magento/Module/Manager.php similarity index 79% rename from app/code/Magento/Core/Model/ModuleManager.php rename to lib/Magento/Module/Manager.php index 1d81c896cda..533d9fe12cf 100644 --- a/app/code/Magento/Core/Model/ModuleManager.php +++ b/lib/Magento/Module/Manager.php @@ -25,19 +25,14 @@ /** * Module statuses manager */ -namespace Magento\Core\Model; +namespace Magento\Module; -class ModuleManager +class Manager { /** - * XPath in the configuration where module statuses are stored + * @var \Magento\Module\Output\ConfigInterface */ - const XML_PATH_MODULE_OUTPUT_STATUS = 'advanced/modules_disable_output/%s'; - - /** - * @var \Magento\Core\Model\Store\ConfigInterface - */ - private $_storeConfig; + private $_outputConfig; /** * @var \Magento\Module\ModuleListInterface @@ -50,16 +45,16 @@ class ModuleManager private $_outputConfigPaths; /** - * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig - * @param \Magento\Module\ModuleListInterface $moduleList + * @param Output\ConfigInterface $outputConfig + * @param ModuleListInterface $moduleList * @param array $outputConfigPaths */ public function __construct( - \Magento\Core\Model\Store\ConfigInterface $storeConfig, + \Magento\Module\Output\ConfigInterface $outputConfig, \Magento\Module\ModuleListInterface $moduleList, array $outputConfigPaths = array() ) { - $this->_storeConfig = $storeConfig; + $this->_outputConfig = $outputConfig; $this->_moduleList = $moduleList; $this->_outputConfigPaths = $outputConfigPaths; } @@ -89,7 +84,7 @@ class ModuleManager if (!$this->_isCustomOutputConfigEnabled($moduleName)) { return false; } - if ($this->_storeConfig->getConfigFlag(sprintf(self::XML_PATH_MODULE_OUTPUT_STATUS, $moduleName))) { + if ($this->_outputConfig->isEnabled($moduleName)) { return false; } return true; @@ -108,7 +103,7 @@ class ModuleManager if (defined($configPath)) { $configPath = constant($configPath); } - return $this->_storeConfig->getConfigFlag($configPath); + return $this->_outputConfig->getFlag($configPath); } return true; } diff --git a/lib/Magento/Module/Output/ConfigInterface.php b/lib/Magento/Module/Output/ConfigInterface.php new file mode 100644 index 00000000000..738fc05f476 --- /dev/null +++ b/lib/Magento/Module/Output/ConfigInterface.php @@ -0,0 +1,44 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Module\Output; + + +interface ConfigInterface +{ + /** + * Whether a module is enabled in the configuration or not + * + * @param string $moduleName Fully-qualified module name + * @return boolean + */ + public function isEnabled($moduleName); + + /** + * Retrieve module enabled specific path + * + * @param string $path Fully-qualified config path + * @return boolean + */ + public function getFlag($path); +} diff --git a/lib/Magento/Oauth/ConsumerInterface.php b/lib/Magento/Oauth/ConsumerInterface.php new file mode 100644 index 00000000000..abb0688cb20 --- /dev/null +++ b/lib/Magento/Oauth/ConsumerInterface.php @@ -0,0 +1,78 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Oauth; + +/** + * Interface ConsumerInterface + * + * This interface exposes minimal consumer functionality needed by the Oauth library. + * + * @package Magento\Oauth + */ +interface ConsumerInterface +{ + /** + * Validate consumer data (e.g. Key and Secret length). + * + * @return bool - True if the consumer data is valid. + * @throws \Magento\Core\Exception|\Exception - Throws exception for validation errors. + */ + public function validate(); + + /** + * Get the consumer Id. + * + * @return int + */ + public function getId(); + + /** + * Get consumer key. + * + * @return string + */ + public function getKey(); + + /** + * Get consumer secret. + * + * @return string + */ + public function getSecret(); + + /** + * Get consumer callback Url. + * + * @return string + */ + public function getCallbackUrl(); + + /** + * Get when the consumer was created. + * + * @return string + */ + public function getCreatedAt(); +} diff --git a/app/code/Magento/Oauth/Exception.php b/lib/Magento/Oauth/Exception.php similarity index 100% rename from app/code/Magento/Oauth/Exception.php rename to lib/Magento/Oauth/Exception.php diff --git a/app/code/Magento/Oauth/Helper/Service.php b/lib/Magento/Oauth/Helper/Oauth.php similarity index 55% rename from app/code/Magento/Oauth/Helper/Service.php rename to lib/Magento/Oauth/Helper/Oauth.php index c2af696b56f..5dcd2c2980f 100644 --- a/app/code/Magento/Oauth/Helper/Service.php +++ b/lib/Magento/Oauth/Helper/Oauth.php @@ -22,29 +22,29 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * OAuth Service Helper - */ namespace Magento\Oauth\Helper; -class Service extends \Magento\Core\Helper\AbstractHelper +class Oauth { /**#@+ - * Cleanup xpath config settings + * Lengths of token fields */ - const XML_PATH_CLEANUP_PROBABILITY = 'oauth/cleanup/cleanup_probability'; - const XML_PATH_CLEANUP_EXPIRATION_PERIOD = 'oauth/cleanup/expiration_period'; - /**#@-*/ + const LENGTH_TOKEN = 32; + const LENGTH_TOKEN_SECRET = 32; + const LENGTH_TOKEN_VERIFIER = 32; + /**#@- */ - /** - * Cleanup expiration period in minutes + /**#@+ + * Lengths of consumer fields */ - const CLEANUP_EXPIRATION_PERIOD_DEFAULT = 120; + const LENGTH_CONSUMER_KEY = 32; + const LENGTH_CONSUMER_SECRET = 32; + /**#@- */ /** - * Query parameter as a sign that user rejects + * Nonce length */ - const QUERY_PARAM_REJECTED = 'rejected'; + const LENGTH_NONCE = 32; /** * Value of callback URL when it is established or if the client is unable to receive callbacks @@ -53,28 +53,18 @@ class Service extends \Magento\Core\Helper\AbstractHelper */ const CALLBACK_ESTABLISHED = 'oob'; - /** @var \Magento\Core\Model\Store\Config */ - protected $_storeConfig; - /** * @var \Magento\Math\Random */ - protected $mathRandom; + protected $_mathRandom; /** - * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\Math\Random $mathRandom * @internal param \Magento\Core\Helper\Data $coreData */ - public function __construct( - \Magento\Core\Helper\Context $context, - \Magento\Core\Model\Store\Config $storeConfig, - \Magento\Math\Random $mathRandom - ) { - parent::__construct($context); - $this->_storeConfig = $storeConfig; - $this->mathRandom = $mathRandom; + public function __construct(\Magento\Math\Random $mathRandom) + { + $this->_mathRandom = $mathRandom; } /** @@ -83,7 +73,7 @@ class Service extends \Magento\Core\Helper\AbstractHelper * @param int $length String length * @return string */ - protected function _generateRandomString($length) + public function generateRandomString($length) { if (function_exists('openssl_random_pseudo_bytes')) { // use openssl lib if it is install. It provides a better randomness. @@ -92,7 +82,7 @@ class Service extends \Magento\Core\Helper\AbstractHelper $randomString = substr($hex, 0, $length); // truncate at most 1 char if length parameter is an odd number } else { // fallback to mt_rand() if openssl is not installed - $randomString = $this->mathRandom->getRandomString( + $randomString = $this->_mathRandom->getRandomString( $length, \Magento\Math\Random::CHARS_DIGITS . \Magento\Math\Random::CHARS_LOWERS ); @@ -108,7 +98,7 @@ class Service extends \Magento\Core\Helper\AbstractHelper */ public function generateToken() { - return $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_TOKEN); + return $this->generateRandomString(self::LENGTH_TOKEN); } /** @@ -118,7 +108,7 @@ class Service extends \Magento\Core\Helper\AbstractHelper */ public function generateTokenSecret() { - return $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_SECRET); + return $this->generateRandomString(self::LENGTH_TOKEN_SECRET); } /** @@ -128,7 +118,7 @@ class Service extends \Magento\Core\Helper\AbstractHelper */ public function generateVerifier() { - return $this->_generateRandomString(\Magento\Oauth\Model\Token::LENGTH_VERIFIER); + return $this->generateRandomString(self::LENGTH_TOKEN_VERIFIER); } /** @@ -138,7 +128,7 @@ class Service extends \Magento\Core\Helper\AbstractHelper */ public function generateConsumerKey() { - return $this->_generateRandomString(\Magento\Oauth\Model\Consumer::KEY_LENGTH); + return $this->generateRandomString(self::LENGTH_CONSUMER_KEY); } /** @@ -148,29 +138,6 @@ class Service extends \Magento\Core\Helper\AbstractHelper */ public function generateConsumerSecret() { - return $this->_generateRandomString(\Magento\Oauth\Model\Consumer::SECRET_LENGTH); - } - - /** - * Calculate cleanup possibility for data with lifetime property - * - * @return bool - */ - public function isCleanupProbability() - { - // Safe get cleanup probability value from system configuration - $configValue = (int) $this->_storeConfig->getConfig(self::XML_PATH_CLEANUP_PROBABILITY); - return $configValue > 0 ? 1 == mt_rand(1, $configValue) : false; - } - - /** - * Get cleanup expiration period value from system configuration in minutes - * - * @return int - */ - public function getCleanupExpirationPeriod() - { - $minutes = (int) $this->_storeConfig->getConfig(self::XML_PATH_CLEANUP_EXPIRATION_PERIOD); - return $minutes > 0 ? $minutes : self::CLEANUP_EXPIRATION_PERIOD_DEFAULT; + return $this->generateRandomString(self::LENGTH_CONSUMER_SECRET); } } diff --git a/app/code/Magento/Oauth/Helper/Data.php b/lib/Magento/Oauth/Helper/Request.php similarity index 61% rename from app/code/Magento/Oauth/Helper/Data.php rename to lib/Magento/Oauth/Helper/Request.php index cc60e4f4059..52c4baba84e 100644 --- a/app/code/Magento/Oauth/Helper/Data.php +++ b/lib/Magento/Oauth/Helper/Request.php @@ -22,14 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * OAuth View Helper for Controllers - */ namespace Magento\Oauth\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper -{ +use \Magento\Oauth\OauthInterface; +class Request +{ /**#@+ * HTTP Response Codes */ @@ -46,23 +44,23 @@ class Data extends \Magento\Core\Helper\AbstractHelper * @var array */ protected $_errors = array( - \Magento\Oauth\Service\OauthV1Interface::ERR_VERSION_REJECTED => 'version_rejected', - \Magento\Oauth\Service\OauthV1Interface::ERR_PARAMETER_ABSENT => 'parameter_absent', - \Magento\Oauth\Service\OauthV1Interface::ERR_PARAMETER_REJECTED => 'parameter_rejected', - \Magento\Oauth\Service\OauthV1Interface::ERR_TIMESTAMP_REFUSED => 'timestamp_refused', - \Magento\Oauth\Service\OauthV1Interface::ERR_NONCE_USED => 'nonce_used', - \Magento\Oauth\Service\OauthV1Interface::ERR_SIGNATURE_METHOD_REJECTED => 'signature_method_rejected', - \Magento\Oauth\Service\OauthV1Interface::ERR_SIGNATURE_INVALID => 'signature_invalid', - \Magento\Oauth\Service\OauthV1Interface::ERR_CONSUMER_KEY_REJECTED => 'consumer_key_rejected', - \Magento\Oauth\Service\OauthV1Interface::ERR_CONSUMER_KEY_INVALID => 'consumer_key_invalid', - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_USED => 'token_used', - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_EXPIRED => 'token_expired', - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_REVOKED => 'token_revoked', - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_REJECTED => 'token_rejected', - \Magento\Oauth\Service\OauthV1Interface::ERR_VERIFIER_INVALID => 'verifier_invalid', - \Magento\Oauth\Service\OauthV1Interface::ERR_PERMISSION_UNKNOWN => 'permission_unknown', - \Magento\Oauth\Service\OauthV1Interface::ERR_PERMISSION_DENIED => 'permission_denied', - \Magento\Oauth\Service\OauthV1Interface::ERR_METHOD_NOT_ALLOWED => 'method_not_allowed' + OauthInterface::ERR_VERSION_REJECTED => 'version_rejected', + OauthInterface::ERR_PARAMETER_ABSENT => 'parameter_absent', + OauthInterface::ERR_PARAMETER_REJECTED => 'parameter_rejected', + OauthInterface::ERR_TIMESTAMP_REFUSED => 'timestamp_refused', + OauthInterface::ERR_NONCE_USED => 'nonce_used', + OauthInterface::ERR_SIGNATURE_METHOD_REJECTED => 'signature_method_rejected', + OauthInterface::ERR_SIGNATURE_INVALID => 'signature_invalid', + OauthInterface::ERR_CONSUMER_KEY_REJECTED => 'consumer_key_rejected', + OauthInterface::ERR_CONSUMER_KEY_INVALID => 'consumer_key_invalid', + OauthInterface::ERR_TOKEN_USED => 'token_used', + OauthInterface::ERR_TOKEN_EXPIRED => 'token_expired', + OauthInterface::ERR_TOKEN_REVOKED => 'token_revoked', + OauthInterface::ERR_TOKEN_REJECTED => 'token_rejected', + OauthInterface::ERR_VERIFIER_INVALID => 'verifier_invalid', + OauthInterface::ERR_PERMISSION_UNKNOWN => 'permission_unknown', + OauthInterface::ERR_PERMISSION_DENIED => 'permission_denied', + OauthInterface::ERR_METHOD_NOT_ALLOWED => 'method_not_allowed' ); /** @@ -71,60 +69,55 @@ class Data extends \Magento\Core\Helper\AbstractHelper * @var array */ protected $_errorsToHttpCode = array( - \Magento\Oauth\Service\OauthV1Interface::ERR_VERSION_REJECTED => self::HTTP_BAD_REQUEST, - \Magento\Oauth\Service\OauthV1Interface::ERR_PARAMETER_ABSENT => self::HTTP_BAD_REQUEST, - \Magento\Oauth\Service\OauthV1Interface::ERR_PARAMETER_REJECTED => self::HTTP_BAD_REQUEST, - \Magento\Oauth\Service\OauthV1Interface::ERR_TIMESTAMP_REFUSED => self::HTTP_BAD_REQUEST, - \Magento\Oauth\Service\OauthV1Interface::ERR_NONCE_USED => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_SIGNATURE_METHOD_REJECTED => self::HTTP_BAD_REQUEST, - \Magento\Oauth\Service\OauthV1Interface::ERR_SIGNATURE_INVALID => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_CONSUMER_KEY_REJECTED => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_CONSUMER_KEY_INVALID => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_USED => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_EXPIRED => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_REVOKED => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_TOKEN_REJECTED => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_VERIFIER_INVALID => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_PERMISSION_UNKNOWN => self::HTTP_UNAUTHORIZED, - \Magento\Oauth\Service\OauthV1Interface::ERR_PERMISSION_DENIED => self::HTTP_UNAUTHORIZED + OauthInterface::ERR_VERSION_REJECTED => self::HTTP_BAD_REQUEST, + OauthInterface::ERR_PARAMETER_ABSENT => self::HTTP_BAD_REQUEST, + OauthInterface::ERR_PARAMETER_REJECTED => self::HTTP_BAD_REQUEST, + OauthInterface::ERR_TIMESTAMP_REFUSED => self::HTTP_BAD_REQUEST, + OauthInterface::ERR_NONCE_USED => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_SIGNATURE_METHOD_REJECTED => self::HTTP_BAD_REQUEST, + OauthInterface::ERR_SIGNATURE_INVALID => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_CONSUMER_KEY_REJECTED => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_CONSUMER_KEY_INVALID => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_TOKEN_USED => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_TOKEN_EXPIRED => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_TOKEN_REVOKED => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_TOKEN_REJECTED => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_VERIFIER_INVALID => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_PERMISSION_UNKNOWN => self::HTTP_UNAUTHORIZED, + OauthInterface::ERR_PERMISSION_DENIED => self::HTTP_UNAUTHORIZED ); - - /** - * @param \Magento\Core\Helper\Context $context - */ - public function __construct( - \Magento\Core\Helper\Context $context - ) { - parent::__construct($context); - } - - /** * Process HTTP request object and prepare for token validation * - * @param \Magento\App\RequestInterface $httpRequest + * @param \Zend_Controller_Request_Http $httpRequest + * @param string $requestUrl The request Url * @param array $bodyParams array of key value body parameters * @return array */ - public function prepareServiceRequest($httpRequest, $bodyParams = array()) + public function prepareRequest($httpRequest, $requestUrl, $bodyParams = array()) { - //TODO: Fix needed for $this->getRequest()->getHttpHost(). Hosts with port are not covered - $requestUrl = $httpRequest->getScheme() . '://' . $httpRequest->getHttpHost() . - $httpRequest->getRequestUri(); - - $serviceRequest = array(); - $serviceRequest['request_url'] = $requestUrl; - $serviceRequest['http_method'] = $httpRequest->getMethod(); - $oauthParams = $this->_processRequest($httpRequest->getHeader('Authorization'), - $httpRequest->getHeader(\Zend_Http_Client::CONTENT_TYPE), - $httpRequest->getRawBody(), - $requestUrl); - //Use body parameters only for POST and PUT + $httpRequest->getHeader(\Zend_Http_Client::CONTENT_TYPE), + $httpRequest->getRawBody(), + $requestUrl); + // Use body parameters only for POST and PUT $bodyParams = is_array($bodyParams) && ($httpRequest->getMethod() == 'POST' || $httpRequest->getMethod() == 'PUT') ? $bodyParams : array(); - return array_merge($serviceRequest, $oauthParams, $bodyParams); + return array_merge($oauthParams, $bodyParams); + } + + /** + * Compute the request Url from the Http request + * + * @param \Zend_Controller_Request_Http $httpRequest + * @return string + */ + public function getRequestUrl($httpRequest) + { + // TODO: Fix needed for $this->getRequest()->getHttpHost(). Hosts with port are not covered. + return $httpRequest->getScheme() . '://' . $httpRequest->getHttpHost() . + $httpRequest->getRequestUri(); } /** @@ -143,9 +136,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper * 'oauth_nonce' => 'rI7PSWxTZRHWU3R', * 'oauth_timestamp' => '1377183099', * 'oauth_consumer_key' => 'a6aa81cc3e65e2960a4879392445e718', - * 'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D'', - * 'request_url' => 'http://magento.ll/oauth/token/access', - * 'http_method' => 'POST' + * 'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D' * ) * </pre> */ @@ -250,17 +241,16 @@ class Data extends \Magento\Core\Helper\AbstractHelper } } - /** * Create response string for problem during request and set HTTP error code * * @param \Exception $exception - * @param \Magento\App\ResponseInterface $response OPTIONAL If NULL - will use internal getter + * @param \Zend_Controller_Response_Http $response OPTIONAL If NULL - will use internal getter * @return string */ public function prepareErrorResponse( \Exception $exception, - \Magento\App\ResponseInterface $response = null + \Zend_Controller_Response_Http $response = null ) { $errorMap = $this->_errors; $errorsToHttpCode = $this->_errorsToHttpCode; @@ -277,7 +267,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper $errorMsg = 'unknown_problem&code=' . $eCode; $responseCode = self::HTTP_INTERNAL_ERROR; } - if (\Magento\Oauth\Service\OauthV1Interface::ERR_PARAMETER_ABSENT == $eCode) { + if (OauthInterface::ERR_PARAMETER_ABSENT == $eCode) { $errorMsg .= '&oauth_parameters_absent=' . $eMsg; } elseif ($eMsg) { $errorMsg .= '&message=' . $eMsg; @@ -290,4 +280,4 @@ class Data extends \Magento\Core\Helper\AbstractHelper $response->setHttpResponseCode($responseCode); return array('oauth_problem' => $errorMsg); } -} +} \ No newline at end of file diff --git a/lib/Magento/Oauth/NonceGeneratorInterface.php b/lib/Magento/Oauth/NonceGeneratorInterface.php new file mode 100644 index 00000000000..a20a07d0adc --- /dev/null +++ b/lib/Magento/Oauth/NonceGeneratorInterface.php @@ -0,0 +1,64 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Oauth; + +/** + * Interface NonceGeneratorInterface + * + * This interface provides methods for generating a nonce for a consumer and validating a nonce to ensure that it + * is not already used by an existing consumer. Validation will persist the nonce if validation succeeds. A method + * for generating a current timestamp is also provided by this interface. + * + * @package Magento\Oauth + */ +interface NonceGeneratorInterface +{ + /** + * Generate a new nonce for the consumer (if consumer is specified). + * + * @param ConsumerInterface $consumer + * @return string - The generated nonce value. + */ + public function generateNonce(ConsumerInterface $consumer = null); + + /** + * Generate a current timestamp. + * + * @return int + */ + public function generateTimestamp(); + + /** + * Validate the specified nonce, which ensures that it can only be used by a single consumer and persist it + * with the specified consumer and timestamp. This method effectively saves the nonce and marks it as used + * by the specified consumer. + * + * @param ConsumerInterface $consumer + * @param string $nonce - The nonce value. + * @param int $timestamp - The 'oauth_timestamp' value. + * @throws \Magento\Oauth\Exception - Exceptions are thrown for validation errors. + */ + public function validateNonce(ConsumerInterface $consumer, $nonce, $timestamp); +} diff --git a/lib/Magento/Oauth/Oauth.php b/lib/Magento/Oauth/Oauth.php new file mode 100644 index 00000000000..59633b2b5c5 --- /dev/null +++ b/lib/Magento/Oauth/Oauth.php @@ -0,0 +1,302 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Oauth; + +class Oauth implements OauthInterface +{ + /** @var \Magento\Oauth\Helper\Oauth */ + protected $_oauthHelper; + + /** @var \Zend_Oauth_Http_Utility */ + protected $_httpUtility; + + /** @var \Magento\Oauth\NonceGeneratorInterface */ + protected $_nonceGenerator; + + /** @var \Magento\Oauth\TokenProviderInterface */ + protected $_tokenProvider; + + /** + * @param Helper\Oauth $oauthHelper + * @param NonceGeneratorInterface $nonceGenerator + * @param TokenProviderInterface $tokenProvider + * @param \Zend_Oauth_Http_Utility $httpUtility + */ + public function __construct( + Helper\Oauth $oauthHelper, + NonceGeneratorInterface $nonceGenerator, + TokenProviderInterface $tokenProvider, + \Zend_Oauth_Http_Utility $httpUtility + ) { + $this->_oauthHelper = $oauthHelper; + $this->_nonceGenerator = $nonceGenerator; + $this->_tokenProvider = $tokenProvider; + $this->_httpUtility = $httpUtility; + } + + /** + * Retrieve array of supported signature methods. + * + * @return array - Supported HMAC-SHA1 and HMAC-SHA256 signature methods. + */ + public static function getSupportedSignatureMethods() + { + return array(self::SIGNATURE_SHA1, self::SIGNATURE_SHA256); + } + + /** + * {@inheritdoc} + */ + public function getRequestToken($params, $requestUrl, $httpMethod = 'POST') + { + $this->_validateVersionParam($params['oauth_version']); + $consumer = $this->_tokenProvider->getConsumerByKey($params['oauth_consumer_key']); + $this->_tokenProvider->validateConsumer($consumer); + $this->_nonceGenerator->validateNonce($consumer, $params['oauth_nonce'], $params['oauth_timestamp']); + + $this->_validateSignature( + $params, + $consumer->getSecret(), + $httpMethod, + $requestUrl + ); + + return $this->_tokenProvider->createRequestToken($consumer); + } + + /** + * {@inheritdoc} + */ + public function getAccessToken($params, $requestUrl, $httpMethod = 'POST') + { + $required = array( + 'oauth_consumer_key', + 'oauth_signature', + 'oauth_signature_method', + 'oauth_nonce', + 'oauth_timestamp', + 'oauth_token', + 'oauth_verifier' + ); + + $this->_validateProtocolParams($params, $required); + $consumer = $this->_tokenProvider->getConsumerByKey($params['oauth_consumer_key']); + $tokenSecret = $this->_tokenProvider + ->validateRequestToken($params['oauth_token'], $consumer, $params['oauth_verifier']); + + $this->_validateSignature( + $params, + $consumer->getSecret(), + $httpMethod, + $requestUrl, + $tokenSecret + ); + + return $this->_tokenProvider->getAccessToken($consumer); + } + + /** + * {@inheritdoc} + */ + public function validateAccessTokenRequest($params, $requestUrl, $httpMethod = 'POST') + { + $required = array( + 'oauth_consumer_key', + 'oauth_signature', + 'oauth_signature_method', + 'oauth_nonce', + 'oauth_timestamp', + 'oauth_token' + ); + + $this->_validateProtocolParams($params, $required); + $consumer = $this->_tokenProvider->getConsumerByKey($params['oauth_consumer_key']); + $tokenSecret = $this->_tokenProvider->validateAccessTokenRequest($params['oauth_token'], $consumer); + + $this->_validateSignature( + $params, + $consumer->getSecret(), + $httpMethod, + $requestUrl, + $tokenSecret + ); + + return true; + } + + /** + * {@inheritdoc} + */ + public function validateAccessToken($accessToken) + { + return $this->_tokenProvider->validateAccessToken($accessToken); + } + + /** + * {@inheritdoc} + */ + public function buildAuthorizationHeader( + $params, $requestUrl, $signatureMethod = self::SIGNATURE_SHA1, $httpMethod = 'POST' + ) { + $required = array( + "oauth_consumer_key", + "oauth_consumer_secret", + "oauth_token", + "oauth_token_secret" + ); + $this->_checkRequiredParams($params, $required); + $consumer = $this->_tokenProvider->getConsumerByKey($params['oauth_consumer_key']); + $headerParameters = array( + 'oauth_nonce' => $this->_nonceGenerator->generateNonce($consumer), + 'oauth_timestamp' => $this->_nonceGenerator->generateTimestamp(), + 'oauth_version' => '1.0', + ); + $headerParameters = array_merge($headerParameters, $params); + $headerParameters['oauth_signature'] = $this->_httpUtility->sign( + $params, + $signatureMethod, + $headerParameters['oauth_consumer_secret'], + $headerParameters['oauth_token_secret'], + $httpMethod, + $requestUrl + ); + $authorizationHeader = $this->_httpUtility->toAuthorizationHeader($headerParameters); + // toAuthorizationHeader adds an optional realm="" which is not required for now. + // http://tools.ietf.org/html/rfc2617#section-1.2 + return str_replace('realm="",', '', $authorizationHeader); + } + + /** + * Validate signature based on the signature method used. + * + * @param array $params + * @param string $consumerSecret + * @param string $httpMethod + * @param string $requestUrl + * @param string $tokenSecret + * @throws \Magento\Oauth\Exception + */ + protected function _validateSignature($params, $consumerSecret, $httpMethod, $requestUrl, $tokenSecret = null) + { + if (!in_array($params['oauth_signature_method'], self::getSupportedSignatureMethods())) { + throw new Exception( + __('Signature method %1 is not supported', $params['oauth_signature_method']), + self::ERR_SIGNATURE_METHOD_REJECTED + ); + } + + $allowedSignParams = $params; + unset($allowedSignParams['oauth_signature']); + + $calculatedSign = $this->_httpUtility->sign( + $allowedSignParams, + $params['oauth_signature_method'], + $consumerSecret, + $tokenSecret, + $httpMethod, + $requestUrl + ); + + if ($calculatedSign != $params['oauth_signature']) { + throw new Exception(__('Invalid signature'), self::ERR_SIGNATURE_INVALID); + } + } + + /** + * Validate oauth version. + * + * @param string $version + * @throws \Magento\Oauth\Exception + */ + protected function _validateVersionParam($version) + { + // validate version if specified + if ('1.0' != $version) { + throw new Exception(__('OAuth version %1 is not supported', $version), self::ERR_VERSION_REJECTED); + } + } + + /** + * Validate request and header parameters. + * + * @param array $protocolParams + * @param array $requiredParams + * @throws \Magento\Oauth\Exception + */ + protected function _validateProtocolParams($protocolParams, $requiredParams) + { + // validate version if specified. + if (isset($protocolParams['oauth_version'])) { + $this->_validateVersionParam($protocolParams['oauth_version']); + } + + // Required parameters validation. Default to minimum required params if not provided. + if (empty($requiredParams)) { + $requiredParams = array( + "oauth_consumer_key", + "oauth_signature", + "oauth_signature_method", + "oauth_nonce", + "oauth_timestamp" + ); + } + $this->_checkRequiredParams($protocolParams, $requiredParams); + + if (isset($protocolParams['oauth_token']) && + !$this->_tokenProvider->validateOauthToken($protocolParams['oauth_token']) + ) { + throw new Exception(__('Token is not the correct length'), self::ERR_TOKEN_REJECTED); + } + + // Validate signature method. + if (!in_array($protocolParams['oauth_signature_method'], self::getSupportedSignatureMethods())) { + throw new Exception( + __('Signature method %1 is not supported', $protocolParams['oauth_signature_method']), + self::ERR_SIGNATURE_METHOD_REJECTED + ); + } + + $consumer = $this->_tokenProvider->getConsumerByKey($protocolParams['oauth_consumer_key']); + $this->_nonceGenerator->validateNonce( + $consumer, $protocolParams['oauth_nonce'], $protocolParams['oauth_timestamp'] + ); + } + + /** + * Check if mandatory OAuth parameters are present. + * + * @param array $protocolParams + * @param array $requiredParams + * @throws \Magento\Oauth\Exception + */ + protected function _checkRequiredParams($protocolParams, $requiredParams) + { + foreach ($requiredParams as $param) { + if (!isset($protocolParams[$param])) { + throw new Exception($param, self::ERR_PARAMETER_ABSENT); + } + } + } +} diff --git a/app/code/Magento/Oauth/Service/OauthV1Interface.php b/lib/Magento/Oauth/OauthInterface.php similarity index 51% rename from app/code/Magento/Oauth/Service/OauthV1Interface.php rename to lib/Magento/Oauth/OauthInterface.php index 6cbc387bc34..e03806eef2b 100644 --- a/app/code/Magento/Oauth/Service/OauthV1Interface.php +++ b/lib/Magento/Oauth/OauthInterface.php @@ -1,7 +1,5 @@ <?php /** - * Web API Oauth Service. - * * Magento * * NOTICE OF LICENSE @@ -23,11 +21,20 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Oauth\Service; -interface OauthV1Interface -{ +namespace Magento\Oauth; +/** + * Interface OauthInterface + * + * This interface provides methods consistent with implementing a 2-legged OAuth authentication mechanism. Methods + * include creating a request token, getting an access token, and performing certain validations on tokens and + * token requests. A method is also included for generating an OAuth header that can be used in an HTTP request. + * + * @package Magento\Oauth + */ +interface OauthInterface +{ /**#@+ * OAuth result statuses */ @@ -59,40 +66,9 @@ interface OauthV1Interface /**#@-*/ /** - * Create a new consumer account when an Add-On is installed. - * - * @param array $consumerData - Information provided by an Add-On when the Add-On is installed. - * <pre> - * array( - * 'name' => 'Add-On Name', - * 'key' => 'a6aa81cc3e65e2960a4879392445e718', - * 'secret' => 'b7bb92dd4f76f3a71b598a4a3556f829', - * 'http_post_url' => 'http://www.my-add-on.com' - * ) - * </pre> - * @return array - The Add-On (consumer) data. - * @throws \Magento\Core\Exception - * @throws \Magento\Oauth\Exception - */ - public function createConsumer($consumerData); - - /** - * Execute post to Add-On (consumer) HTTP Post URL. Generate and return oauth_verifier. + * Issue a pre-authorization request token to the caller. * - * @param array $request - The request data that includes the consumer Id. - * <pre> - * array('consumer_id' => 1) - * </pre> - * @return array - The oauth_verifier. - * @throws \Magento\Core\Exception - * @throws \Magento\Oauth\Exception - */ - public function postToConsumer($request); - - /** - * Issue a pre-authorization request token to the caller - * - * @param array $request array containing parameters necessary for requesting Request Token + * @param array $params - Array containing parameters necessary for requesting Request Token. * <pre> * array ( * 'oauth_version' => '1.0', @@ -100,20 +76,26 @@ interface OauthV1Interface * 'oauth_nonce' => 'rI7PSWxTZRHWU3R', * 'oauth_timestamp' => '1377183099', * 'oauth_consumer_key' => 'a6aa81cc3e65e2960a4879392445e718', - * 'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D'', - * 'request_url' => 'http://magento.ll/oauth/token/access', - * 'http_method' => 'POST' + * 'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D' * ) * </pre> + * @param string $requestUrl - The request Url. + * @param string $httpMethod - (default: 'POST') * @return array - The request token/secret pair. - * @throws \Magento\Oauth\Exception + * <pre> + * array ( + * 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf', + * 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf' + * ) + * </pre> + * @throws \Magento\Oauth\Exception - Validation errors. */ - public function getRequestToken($request); + public function getRequestToken($params, $requestUrl, $httpMethod = 'POST'); /** - * Get access token for a pre-authorized request token + * Get access token for a pre-authorized request token. * - * @param array $request array containing parameters necessary for requesting Access Token + * @param array $params - Array containing parameters necessary for requesting Access Token. * <pre> * array ( * 'oauth_version' => '1.0', @@ -123,20 +105,26 @@ interface OauthV1Interface * 'oauth_timestamp' => '1377183099', * 'oauth_consumer_key' => 'a6aa81cc3e65e2960a4879392445e718', * 'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D', - * 'oauth_verifier' => 'a6aa81cc3e65e2960a487939244vvvvv', - * 'request_url' => 'http://magento.ll/oauth/token/access', - * 'http_method' => 'POST' + * 'oauth_verifier' => 'a6aa81cc3e65e2960a487939244vvvvv' * ) * </pre> + * @param string $requestUrl - The request Url. + * @param string $httpMethod - (default: 'POST') * @return array - The access token/secret pair. + * <pre> + * array ( + * 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf', + * 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf' + * ) + * </pre> * @throws \Magento\Oauth\Exception */ - public function getAccessToken($request); + public function getAccessToken($params, $requestUrl, $httpMethod = 'POST'); /** - * Validate an access token request + * Validate an access token request. * - * @param array $request containing parameters necessary for validating Access Token + * @param array $params - Array containing parameters necessary for validating Access Token. * <pre> * array ( * 'oauth_version' => '1.0', @@ -145,27 +133,51 @@ interface OauthV1Interface * 'oauth_nonce' => 'rI7PSWxTZRHWU3R', * 'oauth_timestamp' => '1377183099', * 'oauth_consumer_key' => 'a6aa81cc3e65e2960a4879392445e718', - * 'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D'', - * 'request_url' => 'http://magento.ll/oauth/token/access', - * 'http_method' => 'POST' + * 'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D' * ) * </pre> - * @return boolean true if access token request is valid - * @throws \Magento\Oauth\Exception + * @param string $requestUrl - The request Url. + * @param string $httpMethod - (default: 'POST') + * @return bool - True if the access token request is valid. + * @throws \Magento\Oauth\Exception - Validation errors. */ - public function validateAccessTokenRequest($request); + public function validateAccessTokenRequest($params, $requestUrl, $httpMethod = 'POST'); /** * Validate an access token string. * - * @param array $request containing valid access token + * @param string $accessToken - The access token. + * @return bool - True if the access token is valid. + * @throws \Magento\Oauth\Exception - Validation errors. + */ + public function validateAccessToken($accessToken); + + /** + * Build the Oauth authorization header for an authenticated API request + * + * @param array $params - Array containing parameters to build the Oauth HTTP Authorization header * <pre> * array ( - * 'token' => 'a6aa81cc3e65e2960a4879392445e718' - * ) + * 'oauth_consumer_key' => 'edf957ef88492f0a32eb7e1731e85d', + * 'oauth_consumer_secret' => 'asdawwewefrtyh2f0a32eb7e1731e85d', + * 'oauth_token' => '7c0709f789e1f38a17aa4b9a28e1b06c', + * 'oauth_secret' => 'a6agsfrsfgsrjjjjyy487939244ssggg', + * 'custom_param1' => 'foo', + * 'custom_param2' => 'bar' + * ); * </pre> - * @return boolean true if requested access token exists, is associated with a consumer and is valid + * @param string $requestUrl e.g 'http://www.example.com/endpoint' + * @param string $signatureMethod (default: 'HMAC-SHA1') + * @param string $httpMethod (default: 'POST') + * @return string + * <pre> + * OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_nonce="5X1aWR2qzf2uFm1", + * oauth_timestamp="1381930661", oauth_consumer_key="34edf957ef88492f0a32eb7e1731e85d", + * oauth_token="7c0709f789e1f38a17aa4b9a28e1b06c", oauth_signature="agVxK0epXOOeQK4%2Bc7UAqUXoAok%3D" + * <pre> * @throws \Magento\Oauth\Exception */ - public function validateAccessToken($request); + public function buildAuthorizationHeader( + $params, $requestUrl, $signatureMethod = self::SIGNATURE_SHA1, $httpMethod = 'POST' + ); } diff --git a/lib/Magento/Oauth/TokenProviderInterface.php b/lib/Magento/Oauth/TokenProviderInterface.php new file mode 100644 index 00000000000..e7639832682 --- /dev/null +++ b/lib/Magento/Oauth/TokenProviderInterface.php @@ -0,0 +1,123 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Oauth; + +/** + * Interface TokenProviderInterface + * + * This interface provides token manipulation, such as creating a request token and getting an access token as well + * as methods for performing certain validations on tokens and token requests. Consumer methods are also provided to + * help clients manipulating tokens validate and acquire the associated token consumer. + * + * @package Magento\Oauth + */ +interface TokenProviderInterface +{ + /** + * Validate the consumer. + * + * @param ConsumerInterface $consumer - The consumer. + * @return bool - True if the consumer is valid. + * @throws \Magento\Oauth\Exception - Validation errors. + */ + public function validateConsumer($consumer); + + /** + * Create a request token for the specified consumer. + * + * @param ConsumerInterface $consumer + * @return array - The request token and secret. + * <pre> + * array( + * 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf, + * 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf' + * ) + * </pre> + * @throws \Magento\Oauth\Exception - Validation errors. + */ + public function createRequestToken($consumer); + + /** + * Validates the request token and verifier. Verifies the request token is associated with the consumer. + * + * @param string $requestToken - The 'oauth_token' request token value. + * @param ConsumerInterface $consumer - The consumer given the 'oauth_consumer_key'. + * @param string $oauthVerifier - The 'oauth_verifier' value. + * @return string - The request token secret (i.e. 'oauth_token_secret'). + * @throws \Magento\Oauth\Exception - Validation errors. + */ + public function validateRequestToken($requestToken, $consumer, $oauthVerifier); + + /** + * Retrieve access token for the specified consumer given the consumer key. + * + * @param ConsumerInterface $consumer - The consumer given the 'oauth_consumer_key'. + * @return array - The access token and secret. + * <pre> + * array( + * 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf, + * 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf' + * ) + * </pre> + * @throws \Magento\Oauth\Exception - Validation errors. + */ + public function getAccessToken($consumer); + + /** + * Validates the Oauth token type and verifies that it's associated with the consumer. + * + * @param string $accessToken - The 'oauth_token' access token value. + * @param ConsumerInterface $consumer - The consumer given the 'oauth_consumer_key'. + * @return string - The access token secret. + * @throws \Magento\Oauth\Exception - Validation errors. + */ + public function validateAccessTokenRequest($accessToken, $consumer); + + /** + * Validate an access token string. + * + * @param string - The 'oauth_token' access token string. + * @return bool - True if the access token is valid. + * @throws \Magento\Oauth\Exception - Validation errors. + */ + public function validateAccessToken($accessToken); + + /** + * Perform basic validation of an Oauth token, of any type (e.g. request, access, etc.). + * + * @param string $oauthToken - The token string. + * @return bool - True if the Oauth token passes basic validation. + */ + public function validateOauthToken($oauthToken); + + /** + * Retrieve a consumer given the consumer's key. + * + * @param string $consumerKey - The 'oauth_consumer_key' value. + * @return ConsumerInterface + * @throws \Magento\Oauth\Exception + */ + public function getConsumerByKey($consumerKey); +} diff --git a/lib/Magento/Object/Copy.php b/lib/Magento/Object/Copy.php new file mode 100644 index 00000000000..ea225b44562 --- /dev/null +++ b/lib/Magento/Object/Copy.php @@ -0,0 +1,139 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Utility class for copying data sets between objects + */ +namespace Magento\Object; + +class Copy +{ + /** + * @var \Magento\Object\Copy\Config + */ + protected $_fieldsetConfig; + + /** + * Core event manager proxy + * + * @var \Magento\Event\ManagerInterface + */ + protected $_eventManager = null; + + /** + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Object\Copy\Config $fieldsetConfig + */ + public function __construct( + \Magento\Event\ManagerInterface $eventManager, + \Magento\Object\Copy\Config $fieldsetConfig + ) { + $this->_eventManager = $eventManager; + $this->_fieldsetConfig = $fieldsetConfig; + } + + /** + * Copy data from object|array to object|array containing fields from fieldset matching an aspect. + * + * Contents of $aspect are a field name in target object or array. + * If targetField attribute is not provided - will be used the same name as in the source object or array. + * + * @param string $fieldset + * @param string $aspect + * @param array|\Magento\Object $source + * @param array|\Magento\Object $target + * @param string $root + * @return array|\Magento\Object|null the value of $target + */ + public function copyFieldsetToTarget($fieldset, $aspect, $source, $target, $root = 'global') + { + if (!$this->_isFieldsetInputValid($source, $target)) { + return null; + } + $fields = $this->_fieldsetConfig->getFieldset($fieldset, $root); + if (is_null($fields)) { + return $target; + } + $targetIsArray = is_array($target); + + foreach ($fields as $code => $node) { + if (empty($node[$aspect])) { + continue; + } + + $value = $this->_getFieldsetFieldValue($source, $code); + + $targetCode = (string)$node[$aspect]; + $targetCode = $targetCode == '*' ? $code : $targetCode; + + if ($targetIsArray) { + $target[$targetCode] = $value; + } else { + $target->setDataUsingMethod($targetCode, $value); + } + } + + $eventName = sprintf('core_copy_fieldset_%s_%s', $fieldset, $aspect); + $this->_eventManager->dispatch($eventName, array( + 'target' => $target, + 'source' => $source, + 'root' => $root + )); + + return $target; + } + + /** + * Check if source and target are valid input for converting using fieldset + * + * @param array|\Magento\Object $source + * @param array|\Magento\Object $target + * @return bool + */ + protected function _isFieldsetInputValid($source, $target) + { + return (is_array($source) || $source instanceof \Magento\Object) + && (is_array($target) || $target instanceof \Magento\Object); + } + + /** + * Get value of source by code + * + * @param \Magento\Object|array $source + * @param string $code + * @return mixed + * @throws \InvalidArgumentException + */ + protected function _getFieldsetFieldValue($source, $code) + { + if (is_array($source)) { + $value = isset($source[$code]) ? $source[$code] : null; + } elseif ($source instanceof \Magento\Object) { + $value = $source->getDataUsingMethod($code); + } else { + throw new \InvalidArgumentException('Source should be array or Magento Object'); + } + return $value; + } +} diff --git a/app/code/Magento/Core/Model/Fieldset/Config.php b/lib/Magento/Object/Copy/Config.php similarity index 84% rename from app/code/Magento/Core/Model/Fieldset/Config.php rename to lib/Magento/Object/Copy/Config.php index 4c60de4828c..c49878fb4d1 100644 --- a/app/code/Magento/Core/Model/Fieldset/Config.php +++ b/lib/Magento/Object/Copy/Config.php @@ -18,24 +18,22 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset; +namespace Magento\Object\Copy; class Config { /** - * @var \Magento\Core\Model\Fieldset\Config\Data + * @var \Magento\Object\Copy\Config\Data */ protected $_dataStorage; /** - * @param \Magento\Core\Model\Fieldset\Config\Data $dataStorage + * @param \Magento\Object\Copy\Config\Data $dataStorage */ - public function __construct(\Magento\Core\Model\Fieldset\Config\Data $dataStorage) + public function __construct(\Magento\Object\Copy\Config\Data $dataStorage) { $this->_dataStorage = $dataStorage; } diff --git a/app/code/Magento/Core/Model/Fieldset/Config/Converter.php b/lib/Magento/Object/Copy/Config/Converter.php similarity index 92% rename from app/code/Magento/Core/Model/Fieldset/Config/Converter.php rename to lib/Magento/Object/Copy/Config/Converter.php index 1592ead6a3c..c3e8b971f40 100644 --- a/app/code/Magento/Core/Model/Fieldset/Config/Converter.php +++ b/lib/Magento/Object/Copy/Config/Converter.php @@ -1,7 +1,5 @@ <?php /** - * Fieldset Configuration Converter - * * Magento * * NOTICE OF LICENSE @@ -20,10 +18,10 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset\Config; +namespace Magento\Object\Copy\Config; class Converter implements \Magento\Config\ConverterInterface { diff --git a/app/code/Magento/Core/Model/Fieldset/Config/Data.php b/lib/Magento/Object/Copy/Config/Data.php similarity index 95% rename from app/code/Magento/Core/Model/Fieldset/Config/Data.php rename to lib/Magento/Object/Copy/Config/Data.php index e1a230e4a0a..69004e603bd 100644 --- a/app/code/Magento/Core/Model/Fieldset/Config/Data.php +++ b/lib/Magento/Object/Copy/Config/Data.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset\Config; +namespace Magento\Object\Copy\Config; class Data extends \Magento\Config\Data { diff --git a/app/code/Magento/Core/Model/Fieldset/Config/Reader.php b/lib/Magento/Object/Copy/Config/Reader.php similarity index 92% rename from app/code/Magento/Core/Model/Fieldset/Config/Reader.php rename to lib/Magento/Object/Copy/Config/Reader.php index 79f639b6cd4..9b8f1c3ba0b 100644 --- a/app/code/Magento/Core/Model/Fieldset/Config/Reader.php +++ b/lib/Magento/Object/Copy/Config/Reader.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset\Config; +namespace Magento\Object\Copy\Config; class Reader extends \Magento\Config\Reader\Filesystem { @@ -41,7 +41,7 @@ class Reader extends \Magento\Config\Reader\Filesystem /** * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Core\Model\Fieldset\Config\Converter $converter + * @param \Magento\Object\Copy\Config\Converter $converter * @param \Magento\Config\SchemaLocatorInterface $schemaLocator * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName @@ -50,7 +50,7 @@ class Reader extends \Magento\Config\Reader\Filesystem */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, - \Magento\Core\Model\Fieldset\Config\Converter $converter, + \Magento\Object\Copy\Config\Converter $converter, \Magento\Config\SchemaLocatorInterface $schemaLocator, \Magento\Config\ValidationStateInterface $validationState, $fileName = 'fieldset.xml', diff --git a/app/code/Magento/Core/Model/Fieldset/Config/SchemaLocator.php b/lib/Magento/Object/Copy/Config/SchemaLocator.php similarity index 78% rename from app/code/Magento/Core/Model/Fieldset/Config/SchemaLocator.php rename to lib/Magento/Object/Copy/Config/SchemaLocator.php index a53b76838c3..2eb60fc7b83 100644 --- a/app/code/Magento/Core/Model/Fieldset/Config/SchemaLocator.php +++ b/lib/Magento/Object/Copy/Config/SchemaLocator.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Fieldset\Config; +namespace Magento\Object\Copy\Config; class SchemaLocator implements \Magento\Config\SchemaLocatorInterface { @@ -32,22 +32,24 @@ class SchemaLocator implements \Magento\Config\SchemaLocatorInterface * * @var string */ - protected $_schema = null; + protected $_schema; /** * Path to corresponding XSD file with validation rules for separate config files * * @var string */ - protected $_perFileSchema = null; + protected $_perFileSchema; /** - * @param \Magento\Module\Dir\Reader $moduleReader + * @param \Magento\App\Dir $dirs + * @param string $schema + * @param string $perFileSchema */ - public function __construct(\Magento\Module\Dir\Reader $moduleReader) + public function __construct(\Magento\App\Dir $dirs, $schema, $perFileSchema) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Core') . '/fieldset.xsd'; - $this->_perFileSchemaschema = $moduleReader->getModuleDir('etc', 'Magento_Core') . '/fieldset_file.xsd'; + $this->_schema = $dirs->getDir() . DS . $schema; + $this->_perFileSchemaschema = $dirs->getDir() . DS . $perFileSchema; } /** diff --git a/app/code/Magento/Core/etc/fieldset.xsd b/lib/Magento/Object/etc/fieldset.xsd similarity index 100% rename from app/code/Magento/Core/etc/fieldset.xsd rename to lib/Magento/Object/etc/fieldset.xsd diff --git a/app/code/Magento/Core/etc/fieldset_file.xsd b/lib/Magento/Object/etc/fieldset_file.xsd similarity index 99% rename from app/code/Magento/Core/etc/fieldset_file.xsd rename to lib/Magento/Object/etc/fieldset_file.xsd index 4d062dd26f6..b86a1d92bf1 100644 --- a/app/code/Magento/Core/etc/fieldset_file.xsd +++ b/lib/Magento/Object/etc/fieldset_file.xsd @@ -84,4 +84,4 @@ <xs:attribute name="targetField" type="xs:token" use="optional"/> </xs:complexType> -</xs:schema> \ No newline at end of file +</xs:schema> diff --git a/lib/Magento/Stdlib/ArrayUtils.php b/lib/Magento/Stdlib/ArrayUtils.php index bebda10afae..974e101935d 100644 --- a/lib/Magento/Stdlib/ArrayUtils.php +++ b/lib/Magento/Stdlib/ArrayUtils.php @@ -58,4 +58,82 @@ class ArrayUtils return $sort; } + + /** + * Decorate a plain array of arrays or objects + * The array actually can be an object with Iterator interface + * + * Keys with prefix_* will be set: + * *_is_first - if the element is first + * *_is_odd / *_is_even - for odd/even elements + * *_is_last - if the element is last + * + * The respective key/attribute will be set to element, depending on object it is or array. + * \Magento\Object is supported. + * + * $forceSetAll true will cause to set all possible values for all elements. + * When false (default), only non-empty values will be set. + * + * @param mixed $array + * @param string $prefix + * @param bool $forceSetAll + * @return mixed + */ + public function decorateArray($array, $prefix = 'decorated_', $forceSetAll = false) + { + // check if array or an object to be iterated given + if (!(is_array($array) || is_object($array))) { + return $array; + } + + $keyIsFirst = "{$prefix}is_first"; + $keyIsOdd = "{$prefix}is_odd"; + $keyIsEven = "{$prefix}is_even"; + $keyIsLast = "{$prefix}is_last"; + + $count = count($array); // this will force Iterator to load + $index = 0; + $isEven = false; + foreach ($array as $key => $element) { + if (is_object($element)) { + $this->_decorateArrayObject($element, $keyIsFirst, (0 === $index), $forceSetAll || (0 === $index)); + $this->_decorateArrayObject($element, $keyIsOdd, !$isEven, $forceSetAll || !$isEven); + $this->_decorateArrayObject($element, $keyIsEven, $isEven, $forceSetAll || $isEven); + $isEven = !$isEven; + $index++; + $this->_decorateArrayObject($element, $keyIsLast, ($index === $count), $forceSetAll || ($index === $count)); + } elseif (is_array($element)) { + if ($forceSetAll || (0 === $index)) { + $array[$key][$keyIsFirst] = (0 === $index); + } + if ($forceSetAll || !$isEven) { + $array[$key][$keyIsOdd] = !$isEven; + } + if ($forceSetAll || $isEven) { + $array[$key][$keyIsEven] = $isEven; + } + $isEven = !$isEven; + $index++; + if ($forceSetAll || ($index === $count)) { + $array[$key][$keyIsLast] = ($index === $count); + } + } + } + return $array; + } + + /** + * Mark passed object with specified flag and appropriate value. + * + * @param \Magento\Object $element + * @param string $key + * @param mixed $value + * @param bool $isSkipped + */ + private function _decorateArrayObject($element, $key, $value, $isSkipped) + { + if ($isSkipped && $element instanceof \Magento\Object) { + $element->setData($key, $value); + } + } } diff --git a/lib/Magento/View/BlockPool.php b/lib/Magento/View/BlockPool.php index 585444e31d1..0e0378f6930 100644 --- a/lib/Magento/View/BlockPool.php +++ b/lib/Magento/View/BlockPool.php @@ -26,13 +26,13 @@ namespace Magento\View; use Magento\View\Layout; use Magento\View\Element\BlockInterface; -use Magento\Core\Model\BlockFactory; +use Magento\View\Element\BlockFactory; use Magento\ObjectManager; class BlockPool { /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $blockFactory; diff --git a/app/code/Magento/Core/Model/View/Config.php b/lib/Magento/View/Config.php similarity index 86% rename from app/code/Magento/Core/Model/View/Config.php rename to lib/Magento/View/Config.php index f847aed013c..ad425b53fab 100644 --- a/app/code/Magento/Core/Model/View/Config.php +++ b/lib/Magento/View/Config.php @@ -27,7 +27,7 @@ /** * Handles theme view.xml files */ -namespace Magento\Core\Model\View; +namespace Magento\View; class Config implements \Magento\View\ConfigInterface { @@ -51,35 +51,43 @@ class Config implements \Magento\View\ConfigInterface protected $_filesystem; /** - * @var \Magento\Core\Model\View\Service + * @var \Magento\View\Service */ protected $_viewService; /** * View file system model * - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; + /** + * @var string + */ + protected $filename; + /** * View config model * * @param \Magento\Module\Dir\Reader $moduleReader * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\View\Service $viewService - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param Service $viewService + * @param FileSystem $viewFileSystem + * @param string $filename */ public function __construct( \Magento\Module\Dir\Reader $moduleReader, \Magento\Filesystem $filesystem, - \Magento\Core\Model\View\Service $viewService, - \Magento\Core\Model\View\FileSystem $viewFileSystem + \Magento\View\Service $viewService, + \Magento\View\FileSystem $viewFileSystem, + $filename = self::CONFIG_FILE_NAME ) { $this->_moduleReader = $moduleReader; $this->_filesystem = $filesystem; $this->_viewService = $viewService; $this->_viewFileSystem = $viewFileSystem; + $this->filename = $filename; } /** @@ -98,11 +106,11 @@ class Config implements \Magento\View\ConfigInterface return $this->_viewConfigs[$key]; } - $configFiles = $this->_moduleReader->getConfigurationFiles(\Magento\Core\Model\Theme::FILENAME_VIEW_CONFIG); + $configFiles = $this->_moduleReader->getConfigurationFiles($this->filename); $themeConfigFile = $currentTheme->getCustomization()->getCustomViewConfigPath(); if (empty($themeConfigFile) || !$this->_filesystem->has($themeConfigFile)) { $themeConfigFile = $this->_viewFileSystem->getFilename( - \Magento\Core\Model\Theme::FILENAME_VIEW_CONFIG, $params + $this->filename, $params ); } if ($themeConfigFile && $this->_filesystem->has($themeConfigFile)) { diff --git a/lib/Magento/View/ConfigInterface.php b/lib/Magento/View/ConfigInterface.php index 59ffb9b33fd..a542b120fbc 100644 --- a/lib/Magento/View/ConfigInterface.php +++ b/lib/Magento/View/ConfigInterface.php @@ -31,6 +31,11 @@ namespace Magento\View; */ interface ConfigInterface { + /** + * Filename of view configuration + */ + const CONFIG_FILE_NAME = 'view.xml'; + /** * Render view config object for current package and theme * diff --git a/lib/Magento/View/Context.php b/lib/Magento/View/Context.php index 23cce2d4ab3..45b4e32cef6 100644 --- a/lib/Magento/View/Context.php +++ b/lib/Magento/View/Context.php @@ -32,7 +32,7 @@ use Magento\App\FrontControllerInterface; use Magento\Core\Model\Translate; use Magento\Core\Model\Store\Config as StoreConfig; use Magento\Core\Model\Factory\Helper as FactoryHelper; -use Magento\Core\Model\View\Url as ViewUrl; +use Magento\View\Url as ViewUrl; use Magento\View\ConfigInterface as ViewConfig; use Magento\Logger; use Magento\Core\Model\App; @@ -40,7 +40,7 @@ use Magento\App\State as AppState; use Magento\Core\Model\Session\AbstractSession; use Magento\App\CacheInterface as Cache; -use Magento\Core\Model\Cache\StateInterface as CacheState; +use Magento\App\Cache\StateInterface as CacheState; use Magento\UrlInterface; use Magento\Event\ManagerInterface; @@ -104,7 +104,7 @@ class Context protected $helperFactory; /** - * @var \Magento\Core\Model\View\Url + * @var \Magento\View\Url */ protected $viewUrl; @@ -116,12 +116,12 @@ class Context /** * View config model * - * @var \Magento\Core\Model\View\Config + * @var \Magento\View\Config */ protected $viewConfig; /** - * @var \Magento\Core\Model\Cache\StateInterface + * @var \Magento\App\Cache\StateInterface */ protected $cacheState; @@ -286,7 +286,7 @@ class Context } /** - * @return \Magento\Core\Model\View\Url + * @return \Magento\View\Url */ public function getViewUrl() { @@ -302,7 +302,7 @@ class Context } /** - * @return \Magento\Core\Model\Cache\StateInterface + * @return \Magento\App\Cache\StateInterface */ public function getCacheState() { diff --git a/lib/Magento/View/DataSourcePool.php b/lib/Magento/View/DataSourcePool.php index e28205a73f6..3fe679235f9 100644 --- a/lib/Magento/View/DataSourcePool.php +++ b/lib/Magento/View/DataSourcePool.php @@ -24,12 +24,12 @@ namespace Magento\View; -use Magento\Core\Model\BlockFactory; +use Magento\View\Element\BlockFactory; class DataSourcePool { /** - * @var \Magento\Core\Model\BlockFactory + * @var \Magento\View\Element\BlockFactory */ protected $blockFactory; @@ -44,7 +44,7 @@ class DataSourcePool protected $assignments = array(); /** - * @param BlockFactory $blockFactory + * @param \Magento\View\Element\BlockFactory $blockFactory */ public function __construct(BlockFactory $blockFactory) { diff --git a/app/code/Magento/Core/Model/View/DeployedFilesManager.php b/lib/Magento/View/DeployedFilesManager.php similarity index 83% rename from app/code/Magento/Core/Model/View/DeployedFilesManager.php rename to lib/Magento/View/DeployedFilesManager.php index 6fb6a5e1ef9..8ab5be9172a 100644 --- a/app/code/Magento/Core/Model/View/DeployedFilesManager.php +++ b/lib/Magento/View/DeployedFilesManager.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,21 +26,21 @@ /** * Builds path for files deployed into public directory in advance */ -namespace Magento\Core\Model\View; +namespace Magento\View; -class DeployedFilesManager implements \Magento\Core\Model\View\PublicFilesManagerInterface +class DeployedFilesManager implements \Magento\View\PublicFilesManagerInterface { /** - * @var \Magento\Core\Model\View\Service + * @var \Magento\View\Service */ protected $_viewService; /** * Deployed view files manager * - * @param \Magento\Core\Model\View\Service $viewService + * @param \Magento\View\Service $viewService */ - public function __construct(\Magento\Core\Model\View\Service $viewService) + public function __construct(\Magento\View\Service $viewService) { $this->_viewService = $viewService; } @@ -63,12 +61,11 @@ class DeployedFilesManager implements \Magento\Core\Model\View\PublicFilesManage * * @param string $area * @param string $themePath - * @param string $locale * @param string $file * @param string|null $module * @return string */ - public static function buildDeployedFilePath($area, $themePath, $locale, $file, $module = null) + public static function buildDeployedFilePath($area, $themePath, $file, $module = null) { return $area . DIRECTORY_SEPARATOR . $themePath . DIRECTORY_SEPARATOR . ($module ? $module . DIRECTORY_SEPARATOR : '') . $file; @@ -91,7 +88,7 @@ class DeployedFilesManager implements \Magento\Core\Model\View\PublicFilesManage $themeModel = $themeModel->getParentTheme(); } $subPath = self::buildDeployedFilePath( - $params['area'], $themePath, $params['locale'], $filePath, $params['module'] + $params['area'], $themePath, $filePath, $params['module'] ); $deployedFilePath = $this->_viewService->getPublicDir() . DIRECTORY_SEPARATOR . $subPath; diff --git a/lib/Magento/View/Design/FileResolution/StrategyPool.php b/lib/Magento/View/Design/FileResolution/StrategyPool.php index f2617876ded..5853140dc14 100644 --- a/lib/Magento/View/Design/FileResolution/StrategyPool.php +++ b/lib/Magento/View/Design/FileResolution/StrategyPool.php @@ -29,7 +29,7 @@ */ namespace Magento\View\Design\FileResolution; -use Magento\Core\Exception; +use Magento\Exception; use Magento\App\State; use Magento\App\Dir; use Magento\Filesystem; diff --git a/app/code/Magento/Core/Model/Theme/Customization.php b/lib/Magento/View/Design/Theme/Customization.php similarity index 57% rename from app/code/Magento/Core/Model/Theme/Customization.php rename to lib/Magento/View/Design/Theme/Customization.php index e0bd1b786a0..69a50b6684d 100644 --- a/app/code/Magento/Core/Model/Theme/Customization.php +++ b/lib/Magento/View/Design/Theme/Customization.php @@ -27,95 +27,91 @@ /** * Theme customizations manager */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; -class Customization implements \Magento\Core\Model\Theme\CustomizationInterface +class Customization implements CustomizationInterface { /** - * @var \Magento\Core\Model\Resource\Theme\File\CollectionFactory + * @var \Magento\View\Design\Theme\FileProviderInterface */ - protected $_fileFactory; + protected $fileProvider; /** - * @var \Magento\Core\Model\Theme\Customization\Path + * @var \Magento\View\Design\Theme\Customization\Path */ - protected $_customizationPath; + protected $customizationPath; /** - * @var \Magento\Core\Model\Theme + * @var \Magento\View\Design\ThemeInterface */ - protected $_theme; + protected $theme; /** * @var \Magento\Core\Model\Resource\Theme\File\Collection */ - protected $_themeFiles; + protected $themeFiles; /** * @var \Magento\Core\Model\Resource\Theme\File\Collection[] */ - protected $_themeFilesByType = array(); + protected $themeFilesByType = array(); /** - * @param \Magento\Core\Model\Resource\Theme\File\CollectionFactory $fileFactory - * @param \Magento\Core\Model\Theme\Customization\Path $customizationPath + * @param \Magento\View\Design\Theme\FileProviderInterface $fileProvider + * @param \Magento\View\Design\Theme\Customization\Path $customizationPath * @param \Magento\View\Design\ThemeInterface $theme */ public function __construct( - \Magento\Core\Model\Resource\Theme\File\CollectionFactory $fileFactory, - \Magento\Core\Model\Theme\Customization\Path $customizationPath, + \Magento\View\Design\Theme\FileProviderInterface $fileProvider, + \Magento\View\Design\Theme\Customization\Path $customizationPath, \Magento\View\Design\ThemeInterface $theme = null ) { - $this->_fileFactory = $fileFactory; - $this->_customizationPath = $customizationPath; - $this->_theme = $theme; + $this->fileProvider = $fileProvider; + $this->customizationPath = $customizationPath; + $this->theme = $theme; } /** * Retrieve list of files which belong to a theme * - * @return \Magento\Core\Model\Theme\FileInterface[] + * @return \Magento\View\Design\Theme\FileInterface[] */ public function getFiles() { - if (!$this->_themeFiles) { - $this->_themeFiles = $this->_fileFactory->create(); - $this->_themeFiles->addThemeFilter($this->_theme); - $this->_themeFiles->setDefaultOrder(); + if (!$this->themeFiles) { + $this->themeFiles = $this->fileProvider->getItems($this->theme); } - return $this->_themeFiles->getItems(); + return $this->themeFiles; } /** * Retrieve list of files which belong to a theme only by type * * @param string $type - * @return \Magento\Core\Model\Theme\FileInterface[] + * @return \Magento\View\Design\Theme\FileInterface[] */ public function getFilesByType($type) { - if (!isset($this->_themeFilesByType[$type])) { - $themeFiles = $this->_fileFactory->create(); - $themeFiles->addThemeFilter($this->_theme); - $themeFiles->addFieldToFilter('file_type', $type); - $themeFiles->setDefaultOrder(); - $this->_themeFilesByType[$type] = $themeFiles; + if (!isset($this->themeFilesByType[$type])) { + $this->themeFilesByType[$type] = $this->fileProvider->getItems( + $this->theme, array('file_type' => $type) + ); } - return $this->_themeFilesByType[$type]->getItems(); + return $this->themeFilesByType[$type]; } /** * Get short file information * - * @param \Magento\Core\Model\Theme\FileInterface[] $files + * @param \Magento\View\Design\Theme\FileInterface[] $files * @return array */ public function generateFileInfo(array $files) { $filesInfo = array(); - /** @var $file \Magento\Core\Model\Theme\FileInterface */ + /** @var $file \Magento\View\Design\Theme\FileInterface */ foreach ($files as $file) { - if ($file instanceof \Magento\Core\Model\Theme\FileInterface) { + if ($file instanceof \Magento\View\Design\Theme\FileInterface) { $filesInfo[] = $file->getFileInfo(); } } @@ -127,7 +123,7 @@ class Customization implements \Magento\Core\Model\Theme\CustomizationInterface */ public function getCustomizationPath() { - return $this->_customizationPath->getCustomizationPath($this->_theme); + return $this->customizationPath->getCustomizationPath($this->theme); } /** @@ -135,9 +131,9 @@ class Customization implements \Magento\Core\Model\Theme\CustomizationInterface */ public function getThemeFilesPath() { - return $this->_theme->isPhysical() - ? $this->_customizationPath->getThemeFilesPath($this->_theme) - : $this->_customizationPath->getCustomizationPath($this->_theme); + return $this->theme->isPhysical() + ? $this->customizationPath->getThemeFilesPath($this->theme) + : $this->customizationPath->getCustomizationPath($this->theme); } /** @@ -145,20 +141,16 @@ class Customization implements \Magento\Core\Model\Theme\CustomizationInterface */ public function getCustomViewConfigPath() { - return $this->_customizationPath->getCustomViewConfigPath($this->_theme); + return $this->customizationPath->getCustomViewConfigPath($this->theme); } /** - * Reorder files positions - * - * @param string $type - * @param array $sequence - * @return $this + * {@inheritdoc} */ public function reorder($type, array $sequence) { $sortOrderSequence = array_flip(array_values($sequence)); - /** @var $file \Magento\Core\Model\Theme\FileInterface */ + /** @var $file \Magento\View\Design\Theme\FileInterface */ foreach ($this->getFilesByType($type) as $file) { if (isset($sortOrderSequence[$file->getId()])) { $prevSortOrder = $file->getData('sort_order'); @@ -180,7 +172,7 @@ class Customization implements \Magento\Core\Model\Theme\CustomizationInterface */ public function delete(array $fileIds) { - /** @var $file \Magento\Core\Model\Theme\FileInterface */ + /** @var $file \Magento\View\Design\Theme\FileInterface */ foreach ($this->getFiles() as $file) { if (in_array($file->getId(), $fileIds)) { $file->delete(); diff --git a/app/code/Magento/Core/Model/Theme/Customization/AbstractFile.php b/lib/Magento/View/Design/Theme/Customization/AbstractFile.php similarity index 76% rename from app/code/Magento/Core/Model/Theme/Customization/AbstractFile.php rename to lib/Magento/View/Design/Theme/Customization/AbstractFile.php index 6e40095f102..352d99e3ba0 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/AbstractFile.php +++ b/lib/Magento/View/Design/Theme/Customization/AbstractFile.php @@ -27,19 +27,19 @@ /** * Theme file service abstract class */ -namespace Magento\Core\Model\Theme\Customization; +namespace Magento\View\Design\Theme\Customization; abstract class AbstractFile - implements \Magento\Core\Model\Theme\Customization\FileInterface, - \Magento\Core\Model\Theme\Customization\FileAssetInterface + implements \Magento\View\Design\Theme\Customization\FileInterface, + \Magento\View\Design\Theme\Customization\FileAssetInterface { /** - * @var \Magento\Core\Model\Theme\Customization\Path + * @var \Magento\View\Design\Theme\Customization\Path */ protected $_customizationPath; /** - * @var \Magento\Core\Model\Theme\FileFactory + * @var \Magento\View\Design\Theme\FileFactory */ protected $_fileFactory; @@ -49,13 +49,13 @@ abstract class AbstractFile protected $_filesystem; /** - * @param \Magento\Core\Model\Theme\Customization\Path $customizationPath - * @param \Magento\Core\Model\Theme\FileFactory $fileFactory + * @param \Magento\View\Design\Theme\Customization\Path $customizationPath + * @param \Magento\View\Design\Theme\FileFactory $fileFactory * @param \Magento\Filesystem $filesystem */ public function __construct( - \Magento\Core\Model\Theme\Customization\Path $customizationPath, - \Magento\Core\Model\Theme\FileFactory $fileFactory, + \Magento\View\Design\Theme\Customization\Path $customizationPath, + \Magento\View\Design\Theme\FileFactory $fileFactory, \Magento\Filesystem $filesystem ) { $this->_customizationPath = $customizationPath; @@ -76,7 +76,7 @@ abstract class AbstractFile /** * {@inheritdoc} */ - public function getFullPath(\Magento\Core\Model\Theme\FileInterface $file) + public function getFullPath(\Magento\View\Design\Theme\FileInterface $file) { $customizationPath = $this->_customizationPath->getCustomizationPath($file->getTheme()); return $customizationPath . DIRECTORY_SEPARATOR . $file->getData('file_path'); @@ -85,7 +85,7 @@ abstract class AbstractFile /** * {@inheritdoc} */ - public function prepareFile(\Magento\Core\Model\Theme\FileInterface $file) + public function prepareFile(\Magento\View\Design\Theme\FileInterface $file) { $file->setData('file_type', $this->getType()); if (!$file->getId()) { @@ -99,7 +99,7 @@ abstract class AbstractFile /** * {@inheritdoc} */ - public function save(\Magento\Core\Model\Theme\FileInterface $file) + public function save(\Magento\View\Design\Theme\FileInterface $file) { $this->_saveFileContent($this->getFullPath($file), $file->getContent()); return $this; @@ -108,7 +108,7 @@ abstract class AbstractFile /** * {@inheritdoc} */ - public function delete(\Magento\Core\Model\Theme\FileInterface $file) + public function delete(\Magento\View\Design\Theme\FileInterface $file) { $this->_deleteFileContent($this->getFullPath($file)); return $this; @@ -117,16 +117,16 @@ abstract class AbstractFile /** * Prepares filename of file * - * @param \Magento\Core\Model\Theme\FileInterface $file + * @param \Magento\View\Design\Theme\FileInterface $file */ - protected function _prepareFileName(\Magento\Core\Model\Theme\FileInterface $file) + protected function _prepareFileName(\Magento\View\Design\Theme\FileInterface $file) { $customFiles = $file->getTheme()->getCustomization()->getFilesByType($this->getType()); $fileName = $file->getFileName(); $fileInfo = pathinfo($fileName); $fileIndex = 0; - /** @var $customFile \Magento\Core\Model\Theme\FileInterface */ + /** @var $customFile \Magento\View\Design\Theme\FileInterface */ foreach ($customFiles as $customFile) { if ($fileName === $customFile->getFileName()) { $fileName = sprintf('%s_%d.%s', $fileInfo['filename'], ++$fileIndex, $fileInfo['extension']); @@ -138,9 +138,9 @@ abstract class AbstractFile /** * Prepares relative path of file * - * @param \Magento\Core\Model\Theme\FileInterface $file + * @param \Magento\View\Design\Theme\FileInterface $file */ - protected function _prepareFilePath(\Magento\Core\Model\Theme\FileInterface $file) + protected function _prepareFilePath(\Magento\View\Design\Theme\FileInterface $file) { $file->setData('file_path', $this->getContentType() . '/' . $file->getFileName()); } @@ -148,9 +148,9 @@ abstract class AbstractFile /** * Prepares sort order of custom file * - * @param \Magento\Core\Model\Theme\FileInterface $file + * @param \Magento\View\Design\Theme\FileInterface $file */ - protected function _prepareSortOrder(\Magento\Core\Model\Theme\FileInterface $file) + protected function _prepareSortOrder(\Magento\View\Design\Theme\FileInterface $file) { $customFiles = $file->getTheme()->getCustomization()->getFilesByType($this->getType()); $sortOrderIndex = (int)$file->getData('sort_order'); diff --git a/lib/Magento/View/Design/Theme/Customization/ConfigInterface.php b/lib/Magento/View/Design/Theme/Customization/ConfigInterface.php new file mode 100644 index 00000000000..48ff3b3b8de --- /dev/null +++ b/lib/Magento/View/Design/Theme/Customization/ConfigInterface.php @@ -0,0 +1,38 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Theme customization configuration interface + */ +namespace Magento\View\Design\Theme\Customization; + +interface ConfigInterface +{ + /** + * Get customization file types + * + * @return array Mappings of customization file types to its classes + */ + public function getFileTypes(); +} diff --git a/app/code/Magento/Core/Model/Theme/Customization/File/Css.php b/lib/Magento/View/Design/Theme/Customization/File/Css.php similarity index 91% rename from app/code/Magento/Core/Model/Theme/Customization/File/Css.php rename to lib/Magento/View/Design/Theme/Customization/File/Css.php index 983caa03bf1..e68cfc8e670 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/File/Css.php +++ b/lib/Magento/View/Design/Theme/Customization/File/Css.php @@ -27,9 +27,9 @@ /** * Theme css file service class */ -namespace Magento\Core\Model\Theme\Customization\File; +namespace Magento\View\Design\Theme\Customization\File; -class Css extends \Magento\Core\Model\Theme\Customization\AbstractFile +class Css extends \Magento\View\Design\Theme\Customization\AbstractFile { /**#@+ * CSS file customization types diff --git a/app/code/Magento/Core/Model/Theme/Customization/File/Js.php b/lib/Magento/View/Design/Theme/Customization/File/Js.php similarity index 91% rename from app/code/Magento/Core/Model/Theme/Customization/File/Js.php rename to lib/Magento/View/Design/Theme/Customization/File/Js.php index 7839a3bb510..418ae907a54 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/File/Js.php +++ b/lib/Magento/View/Design/Theme/Customization/File/Js.php @@ -27,9 +27,9 @@ /** * Theme js file service class */ -namespace Magento\Core\Model\Theme\Customization\File; +namespace Magento\View\Design\Theme\Customization\File; -class Js extends \Magento\Core\Model\Theme\Customization\AbstractFile +class Js extends \Magento\View\Design\Theme\Customization\AbstractFile { /**#@+ * File type customization diff --git a/app/code/Magento/Core/Model/Theme/Customization/FileAssetInterface.php b/lib/Magento/View/Design/Theme/Customization/FileAssetInterface.php similarity index 95% rename from app/code/Magento/Core/Model/Theme/Customization/FileAssetInterface.php rename to lib/Magento/View/Design/Theme/Customization/FileAssetInterface.php index 3d067871c39..87b6fdfe5fa 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/FileAssetInterface.php +++ b/lib/Magento/View/Design/Theme/Customization/FileAssetInterface.php @@ -27,7 +27,7 @@ /** * Theme asset file interface */ -namespace Magento\Core\Model\Theme\Customization; +namespace Magento\View\Design\Theme\Customization; interface FileAssetInterface { diff --git a/app/code/Magento/Core/Model/Theme/Customization/FileInterface.php b/lib/Magento/View/Design/Theme/Customization/FileInterface.php similarity index 70% rename from app/code/Magento/Core/Model/Theme/Customization/FileInterface.php rename to lib/Magento/View/Design/Theme/Customization/FileInterface.php index 5305c6f4029..8205720d01c 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/FileInterface.php +++ b/lib/Magento/View/Design/Theme/Customization/FileInterface.php @@ -27,7 +27,7 @@ /** * Theme service file interface */ -namespace Magento\Core\Model\Theme\Customization; +namespace Magento\View\Design\Theme\Customization; interface FileInterface { @@ -41,39 +41,39 @@ interface FileInterface /** * Gets absolute path to a custom file * - * @param \Magento\Core\Model\Theme\FileInterface $file + * @param \Magento\View\Design\Theme\FileInterface $file * @return string */ - public function getFullPath(\Magento\Core\Model\Theme\FileInterface $file); + public function getFullPath(\Magento\View\Design\Theme\FileInterface $file); /** * Creates new custom file and binds to concrete service model * - * @return \Magento\Core\Model\Theme\FileInterface + * @return \Magento\View\Design\Theme\FileInterface */ public function create(); /** * Saves related data to custom file * - * @param \Magento\Core\Model\Theme\FileInterface $file + * @param \Magento\View\Design\Theme\FileInterface $file * @return $this */ - public function save(\Magento\Core\Model\Theme\FileInterface $file); + public function save(\Magento\View\Design\Theme\FileInterface $file); /** * Deletes related data to custom file * - * @param \Magento\Core\Model\Theme\FileInterface $file + * @param \Magento\View\Design\Theme\FileInterface $file * @return $this */ - public function delete(\Magento\Core\Model\Theme\FileInterface $file); + public function delete(\Magento\View\Design\Theme\FileInterface $file); /** * Prepare file content before it will be saved * - * @param \Magento\Core\Model\Theme\FileInterface $file + * @param \Magento\View\Design\Theme\FileInterface $file * @return $this */ - public function prepareFile(\Magento\Core\Model\Theme\FileInterface $file); + public function prepareFile(\Magento\View\Design\Theme\FileInterface $file); } diff --git a/app/code/Magento/Core/Model/Theme/Customization/FileServiceFactory.php b/lib/Magento/View/Design/Theme/Customization/FileServiceFactory.php similarity index 68% rename from app/code/Magento/Core/Model/Theme/Customization/FileServiceFactory.php rename to lib/Magento/View/Design/Theme/Customization/FileServiceFactory.php index 16c84d6cfa4..a2ae236779f 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/FileServiceFactory.php +++ b/lib/Magento/View/Design/Theme/Customization/FileServiceFactory.php @@ -27,45 +27,23 @@ /** * Theme customization files factory */ -namespace Magento\Core\Model\Theme\Customization; +namespace Magento\View\Design\Theme\Customization; class FileServiceFactory { - /** - * XML path to definitions of customization services - */ - const XML_PATH_CUSTOM_FILES = 'theme/customization'; - /** * @var \Magento\ObjectManager */ protected $_objectManager; - /** - * @var \Magento\Core\Model\Config - */ - protected $_config; - - /** - * @var array - */ - protected $_types = array(); - /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Config $config + * @param \Magento\View\Design\Theme\Customization\ConfigInterface $config */ - public function __construct(\Magento\ObjectManager $objectManager, \Magento\Core\Model\Config $config) + public function __construct(\Magento\ObjectManager $objectManager, ConfigInterface $config) { $this->_objectManager = $objectManager; - $this->_config = $config; - - $convertNode = $config->getValue(self::XML_PATH_CUSTOM_FILES, 'default'); - if ($convertNode) { - foreach ($convertNode as $name => $value) { - $this->_types[$name] = $value; - } - } + $this->_types = $config->getFileTypes(); } /** @@ -73,7 +51,7 @@ class FileServiceFactory * * @param $type * @param array $data - * @return \Magento\Core\Model\Theme\Customization\FileInterface + * @return \Magento\View\Design\Theme\Customization\FileInterface * @throws \InvalidArgumentException */ public function create($type, array $data = array()) @@ -82,7 +60,7 @@ class FileServiceFactory throw new \InvalidArgumentException('Unsupported file type'); } $fileService = $this->_objectManager->get($this->_types[$type], array($data)); - if (!$fileService instanceof \Magento\Core\Model\Theme\Customization\FileInterface) { + if (!$fileService instanceof \Magento\View\Design\Theme\Customization\FileInterface) { throw new \InvalidArgumentException('Service don\'t implement interface'); } return $fileService; diff --git a/app/code/Magento/Core/Model/Theme/Customization/Path.php b/lib/Magento/View/Design/Theme/Customization/Path.php similarity index 89% rename from app/code/Magento/Core/Model/Theme/Customization/Path.php rename to lib/Magento/View/Design/Theme/Customization/Path.php index 0addfb608d3..d7367ea2cee 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/Path.php +++ b/lib/Magento/View/Design/Theme/Customization/Path.php @@ -27,7 +27,7 @@ /** * Theme Customization Path */ -namespace Magento\Core\Model\Theme\Customization; +namespace Magento\View\Design\Theme\Customization; class Path { @@ -41,14 +41,21 @@ class Path */ protected $_dir; + /** + * @var string + */ + protected $filename; + /** * Initialize dependencies * * @param \Magento\App\Dir $dir + * @param $filename */ - public function __construct(\Magento\App\Dir $dir) + public function __construct(\Magento\App\Dir $dir, $filename = \Magento\View\ConfigInterface::CONFIG_FILE_NAME) { $this->_dir = $dir; + $this->filename = $filename; } /** @@ -94,8 +101,7 @@ class Path { $path = null; if ($theme->getId()) { - $path = $this->getCustomizationPath($theme) . DIRECTORY_SEPARATOR - . \Magento\Core\Model\Theme::FILENAME_VIEW_CONFIG; + $path = $this->getCustomizationPath($theme) . DIRECTORY_SEPARATOR . $this->filename; } return $path; } diff --git a/app/code/Magento/Core/Model/Theme/CustomizationInterface.php b/lib/Magento/View/Design/Theme/CustomizationInterface.php similarity index 90% rename from app/code/Magento/Core/Model/Theme/CustomizationInterface.php rename to lib/Magento/View/Design/Theme/CustomizationInterface.php index 6e130d23d3f..63412d743a8 100644 --- a/app/code/Magento/Core/Model/Theme/CustomizationInterface.php +++ b/lib/Magento/View/Design/Theme/CustomizationInterface.php @@ -27,14 +27,14 @@ /** * Theme customization interface */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; interface CustomizationInterface { /** * Retrieve list of files which belong to a theme * - * @return \Magento\Core\Model\Theme\Customization\FileInterface[] + * @return \Magento\View\Design\Theme\Customization\FileInterface[] */ public function getFiles(); @@ -42,7 +42,7 @@ interface CustomizationInterface * Retrieve list of files which belong to a theme only by type * * @param string $type - * @return \Magento\Core\Model\Theme\Customization\FileInterface[] + * @return \Magento\View\Design\Theme\Customization\FileInterface[] */ public function getFilesByType($type); @@ -72,7 +72,7 @@ interface CustomizationInterface * * @param string $type * @param array $sequence - * @return $this + * @return CustomizationInterface */ public function reorder($type, array $sequence); diff --git a/app/code/Magento/Core/Model/Theme/Domain/Factory.php b/lib/Magento/View/Design/Theme/Domain/Factory.php similarity index 76% rename from app/code/Magento/Core/Model/Theme/Domain/Factory.php rename to lib/Magento/View/Design/Theme/Domain/Factory.php index 6353cc6a7d9..5f01ba2ed85 100644 --- a/app/code/Magento/Core/Model/Theme/Domain/Factory.php +++ b/lib/Magento/View/Design/Theme/Domain/Factory.php @@ -27,7 +27,9 @@ /** * Theme domain model class */ -namespace Magento\Core\Model\Theme\Domain; +namespace Magento\View\Design\Theme\Domain; + +use \Magento\View\Design\ThemeInterface; class Factory { @@ -40,9 +42,9 @@ class Factory * @var array */ protected $_types = array( - \Magento\Core\Model\Theme::TYPE_PHYSICAL => 'Magento\Core\Model\Theme\Domain\Physical', - \Magento\Core\Model\Theme::TYPE_VIRTUAL => 'Magento\Core\Model\Theme\Domain\Virtual', - \Magento\Core\Model\Theme::TYPE_STAGING => 'Magento\Core\Model\Theme\Domain\Staging', + ThemeInterface::TYPE_PHYSICAL => 'Magento\Core\Model\Theme\Domain\Physical', + ThemeInterface::TYPE_VIRTUAL => 'Magento\Core\Model\Theme\Domain\Virtual', + ThemeInterface::TYPE_STAGING => 'Magento\Core\Model\Theme\Domain\Staging', ); /** @@ -58,12 +60,12 @@ class Factory * * @param \Magento\View\Design\ThemeInterface $theme * @return \Magento\Core\Model\Theme\Domain\Virtual|\Magento\Core\Model\Theme\Domain\Staging - * @throws \Magento\Core\Exception + * @throws \Magento\Exception */ - public function create(\Magento\View\Design\ThemeInterface $theme) + public function create(ThemeInterface $theme) { if (!isset($this->_types[$theme->getType()])) { - throw new \Magento\Core\Exception(sprintf('Invalid type of theme domain model "%s"', $theme->getType())); + throw new \Magento\Exception(sprintf('Invalid type of theme domain model "%s"', $theme->getType())); } $class = $this->_types[$theme->getType()]; return $this->_objectManager->create($class, array('theme' => $theme)); diff --git a/lib/Magento/View/Design/Theme/File/CollectionInterface.php b/lib/Magento/View/Design/Theme/File/CollectionInterface.php new file mode 100644 index 00000000000..135f817cfd2 --- /dev/null +++ b/lib/Magento/View/Design/Theme/File/CollectionInterface.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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\View\Design\Theme\File; + +interface CollectionInterface +{ + /** + * @return \Magento\View\Design\Theme\FileInterface[] + */ + public function getItems(); + + /** + * Filter out files that do not belong to a theme + * + * @param \Magento\View\Design\ThemeInterface $theme + * @return CollectionInterface + */ + public function addThemeFilter(\Magento\View\Design\ThemeInterface $theme); + + /** + * Set default order + * + * @param string $direction + * @return CollectionInterface + */ + public function setDefaultOrder($direction = 'ASC'); + + /** + * Add field filter to collection + * + * @param string|array $field + * @param null|string|array $condition + * @return CollectionInterface + */ + public function addFieldToFilter($field, $condition = null); +} \ No newline at end of file diff --git a/app/code/Magento/Core/Model/Theme/FileFactory.php b/lib/Magento/View/Design/Theme/FileFactory.php similarity index 92% rename from app/code/Magento/Core/Model/Theme/FileFactory.php rename to lib/Magento/View/Design/Theme/FileFactory.php index 8b9fd6e1a62..b44af3dae25 100644 --- a/app/code/Magento/Core/Model/Theme/FileFactory.php +++ b/lib/Magento/View/Design/Theme/FileFactory.php @@ -27,7 +27,7 @@ /** * Factory for \Magento\Core\Model\Theme\File */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; class FileFactory { @@ -56,6 +56,6 @@ class FileFactory */ public function create(array $data = array()) { - return $this->_objectManager->create('Magento\Core\Model\Theme\File', $data); + return $this->_objectManager->create('Magento\View\Design\Theme\FileInterface', $data); } } diff --git a/app/code/Magento/Core/Model/Theme/FileInterface.php b/lib/Magento/View/Design/Theme/FileInterface.php similarity index 89% rename from app/code/Magento/Core/Model/Theme/FileInterface.php rename to lib/Magento/View/Design/Theme/FileInterface.php index 71de934f586..7609976454c 100644 --- a/app/code/Magento/Core/Model/Theme/FileInterface.php +++ b/lib/Magento/View/Design/Theme/FileInterface.php @@ -27,22 +27,22 @@ /** * Theme file interface */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; interface FileInterface { /** * Set customization service model * - * @param \Magento\Core\Model\Theme\Customization\FileInterface $service + * @param \Magento\View\Design\Theme\Customization\FileInterface $service * @return $this */ - public function setCustomizationService(\Magento\Core\Model\Theme\Customization\FileInterface $service); + public function setCustomizationService(Customization\FileInterface $service); /** * Get customization service model * - * @return \Magento\Core\Model\Theme\Customization\FileInterface + * @return \Magento\View\Design\Theme\Customization\FileInterface */ public function getCustomizationService(); diff --git a/lib/Magento/View/Design/Theme/FileProviderInterface.php b/lib/Magento/View/Design/Theme/FileProviderInterface.php new file mode 100644 index 00000000000..a72132590d7 --- /dev/null +++ b/lib/Magento/View/Design/Theme/FileProviderInterface.php @@ -0,0 +1,34 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\View\Design\Theme; + +interface FileProviderInterface +{ + /** + * @param \Magento\View\Design\ThemeInterface $theme + * @param array $filters + * @return \Magento\View\Design\Theme\FileInterface[] + */ + public function getItems(\Magento\View\Design\ThemeInterface $theme, array $filters = array()); +} \ No newline at end of file diff --git a/app/code/Magento/Core/Model/Theme/FlyweightFactory.php b/lib/Magento/View/Design/Theme/FlyweightFactory.php similarity index 63% rename from app/code/Magento/Core/Model/Theme/FlyweightFactory.php rename to lib/Magento/View/Design/Theme/FlyweightFactory.php index 7c5ec567b8a..b249995e746 100644 --- a/app/code/Magento/Core/Model/Theme/FlyweightFactory.php +++ b/lib/Magento/View/Design/Theme/FlyweightFactory.php @@ -27,41 +27,40 @@ /** * Theme factory */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; class FlyweightFactory { /** - * Object Manager - * - * @var \Magento\ObjectManager + * @var ThemeProviderInterface */ - protected $_objectManager; + protected $themeProvider; /** - * @var \Magento\Core\Model\Theme[] + * @var \Magento\View\Design\ThemeInterface[] */ - protected $_themes = array(); + protected $themes = array(); /** - * @var \Magento\Core\Model\Theme[] + * @var \Magento\View\Design\ThemeInterface[] */ - protected $_themesByPath = array(); + protected $themesByPath = array(); /** - * @param \Magento\ObjectManager $objectManager + * @param ThemeProviderInterface $themeProvider */ - public function __construct(\Magento\ObjectManager $objectManager) - { - $this->_objectManager = $objectManager; + public function __construct( + ThemeProviderInterface $themeProvider + ) { + $this->themeProvider = $themeProvider; } /** * Creates or returns a shared model of theme * - * @param string|int $themeKey + * @param string $themeKey * @param string $area - * @return \Magento\Core\Model\Theme|null + * @return \Magento\View\Design\ThemeInterface|null * @throws \InvalidArgumentException */ public function create($themeKey, $area = \Magento\View\DesignInterface::DEFAULT_AREA) @@ -84,18 +83,15 @@ class FlyweightFactory * Load theme by id * * @param int $themeId - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ protected function _loadById($themeId) { - if (isset($this->_themes[$themeId])) { - return $this->_themes[$themeId]; + if (isset($this->themes[$themeId])) { + return $this->themes[$themeId]; } - /** @var $themeModel \Magento\View\Design\ThemeInterface */ - $themeModel = $this->_objectManager->create('Magento\View\Design\ThemeInterface'); - $themeModel->load($themeId); - return $themeModel; + return $this->themeProvider->getThemeById($themeId); } /** @@ -103,34 +99,31 @@ class FlyweightFactory * * @param string $themePath * @param string $area - * @return \Magento\Core\Model\Theme + * @return \Magento\View\Design\ThemeInterface */ protected function _loadByPath($themePath, $area) { $fullPath = $area . \Magento\View\Design\ThemeInterface::PATH_SEPARATOR . $themePath; - if (isset($this->_themesByPath[$fullPath])) { - return $this->_themesByPath[$fullPath]; + if (isset($this->themesByPath[$fullPath])) { + return $this->themesByPath[$fullPath]; } - /** @var $themeCollection \Magento\Core\Model\Resource\Theme\Collection */ - $themeCollection = $this->_objectManager->create('Magento\Core\Model\Resource\Theme\Collection'); - $themeModel = $themeCollection->getThemeByFullPath($fullPath); - return $themeModel; + return $this->themeProvider->getThemeByFullPath($fullPath); } /** * Add theme to shared collection * * @param \Magento\View\Design\ThemeInterface $themeModel - * @return $this + * @return FlyweightFactory */ protected function _addTheme(\Magento\View\Design\ThemeInterface $themeModel) { if ($themeModel->getId()) { - $this->_themes[$themeModel->getId()] = $themeModel; + $this->themes[$themeModel->getId()] = $themeModel; $themePath = $themeModel->getFullPath(); if ($themePath) { - $this->_themesByPath[$themePath] = $themeModel; + $this->themesByPath[$themePath] = $themeModel; } } return $this; diff --git a/app/code/Magento/Core/Model/Theme/Image.php b/lib/Magento/View/Design/Theme/Image.php similarity index 88% rename from app/code/Magento/Core/Model/Theme/Image.php rename to lib/Magento/View/Design/Theme/Image.php index 648093074d6..cef4e546e64 100644 --- a/app/code/Magento/Core/Model/Theme/Image.php +++ b/lib/Magento/View/Design/Theme/Image.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +25,7 @@ /** * Theme Image model class */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; class Image { @@ -47,17 +45,17 @@ class Image protected $_filesystem; /** - * @var \Magento\Core\Model\Image\Factory + * @var \Magento\Image\Factory */ protected $_imageFactory; /** - * @var \Magento\Core\Model\Theme\Image\Uploader + * @var Image\Uploader */ protected $_uploader; /** - * @var \Magento\Core\Model\Theme\Image\Path + * @var Image\PathInterface */ protected $_themeImagePath; @@ -67,7 +65,7 @@ class Image protected $_logger; /** - * @var \Magento\Core\Model\Theme + * @var \Magento\View\Design\ThemeInterface */ protected $_theme; @@ -75,17 +73,17 @@ class Image * Initialize dependencies * * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\Image\Factory $imageFactory - * @param \Magento\Core\Model\Theme\Image\Uploader $uploader - * @param \Magento\Core\Model\Theme\Image\Path $themeImagePath + * @param \Magento\Image\Factory $imageFactory + * @param Image\Uploader $uploader + * @param Image\PathInterface $themeImagePath * @param \Magento\Logger $logger * @param \Magento\View\Design\ThemeInterface $theme */ public function __construct( \Magento\Filesystem $filesystem, - \Magento\Core\Model\Image\Factory $imageFactory, - \Magento\Core\Model\Theme\Image\Uploader $uploader, - \Magento\Core\Model\Theme\Image\Path $themeImagePath, + \Magento\Image\Factory $imageFactory, + Image\Uploader $uploader, + Image\PathInterface $themeImagePath, \Magento\Logger $logger, \Magento\View\Design\ThemeInterface $theme = null ) { @@ -101,7 +99,7 @@ class Image * Create preview image * * @param string $imagePath - * @return $this + * @return Image */ public function createPreviewImage($imagePath) { @@ -168,7 +166,7 @@ class Image * Upload and create preview image * * @param string $scope the request key for file - * @return $this + * @return Image */ public function uploadPreviewImage($scope) { diff --git a/lib/Magento/View/Design/Theme/Image/PathInterface.php b/lib/Magento/View/Design/Theme/Image/PathInterface.php new file mode 100644 index 00000000000..a0e725a356c --- /dev/null +++ b/lib/Magento/View/Design/Theme/Image/PathInterface.php @@ -0,0 +1,64 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Theme Image Path + */ +namespace Magento\View\Design\Theme\Image; + +interface PathInterface +{ + /** + * Image preview path + */ + const PREVIEW_DIRECTORY_PATH = 'theme/preview'; + + /** + * Get preview image directory url + * + * @return string + */ + public function getPreviewImageDirectoryUrl(); + + /** + * Return default themes preview image url + * + * @return string + */ + public function getPreviewImageDefaultUrl(); + + /** + * Get directory path for preview image + * + * @return string + */ + public function getImagePreviewDirectory(); + + /** + * Temporary directory path to store images + * + * @return string + */ + public function getTemporaryDirectory(); +} diff --git a/app/code/Magento/Core/Model/Theme/Image/Uploader.php b/lib/Magento/View/Design/Theme/Image/Uploader.php similarity index 82% rename from app/code/Magento/Core/Model/Theme/Image/Uploader.php rename to lib/Magento/View/Design/Theme/Image/Uploader.php index 0c017ccb561..492983b84d9 100644 --- a/app/code/Magento/Core/Model/Theme/Image/Uploader.php +++ b/lib/Magento/View/Design/Theme/Image/Uploader.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +25,7 @@ /** * Theme Image Uploader */ -namespace Magento\Core\Model\Theme\Image; +namespace Magento\View\Design\Theme\Image; class Uploader { @@ -55,19 +53,17 @@ class Uploader /** - * Initialize dependencies - * * @param \Magento\Filesystem $filesystem - * @param \Zend_File_Transfer_Adapter_Http $transferAdapter + * @param \Magento\HTTP\Adapter\FileTransferFactory $adapterFactory * @param \Magento\File\UploaderFactory $uploaderFactory */ public function __construct( \Magento\Filesystem $filesystem, - \Zend_File_Transfer_Adapter_Http $transferAdapter, + \Magento\HTTP\Adapter\FileTransferFactory $adapterFactory, \Magento\File\UploaderFactory $uploaderFactory ) { $this->_filesystem = $filesystem; - $this->_transferAdapter = $transferAdapter; + $this->_transferAdapter = $adapterFactory->create(); $this->_uploaderFactory = $uploaderFactory; } @@ -77,7 +73,7 @@ class Uploader * @param string $scope the request key for file * @param string $destinationPath path to upload directory * @return bool - * @throws \Magento\Core\Exception + * @throws \Magento\Exception */ public function uploadPreviewImage($scope, $destinationPath) { @@ -85,7 +81,7 @@ class Uploader return false; } if (!$this->_transferAdapter->isValid($scope)) { - throw new \Magento\Core\Exception(__('Uploaded image is not valid')); + throw new \Magento\Exception(__('Uploaded image is not valid')); } $upload = $this->_uploaderFactory->create(array('fileId' => $scope)); $upload->setAllowCreateFolders(true); @@ -94,10 +90,10 @@ class Uploader $upload->setFilesDispersion(false); if (!$upload->checkAllowedExtension($upload->getFileExtension())) { - throw new \Magento\Core\Exception(__('Invalid image file type.')); + throw new \Magento\Exception(__('Invalid image file type.')); } if (!$upload->save($destinationPath)) { - throw new \Magento\Core\Exception(__('Image can not be saved.')); + throw new \Magento\Exception(__('Image can not be saved.')); } return $destinationPath . DIRECTORY_SEPARATOR . $upload->getUploadedFileName(); } diff --git a/lib/Magento/View/Design/Theme/ImageFactory.php b/lib/Magento/View/Design/Theme/ImageFactory.php new file mode 100644 index 00000000000..b336ce60d61 --- /dev/null +++ b/lib/Magento/View/Design/Theme/ImageFactory.php @@ -0,0 +1,69 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\View\Design\Theme; + +/** + * Factory class for \Magento\View\Design\Theme\Image + */ +class ImageFactory +{ + /** + * Object Manager instance + * + * @var \Magento\ObjectManager + */ + protected $_objectManager = null; + + /** + * Instance name to create + * + * @var string + */ + protected $_instanceName = null; + + /** + * Factory constructor + * + * @param \Magento\ObjectManager $objectManager + * @param string $instanceName + */ + public function __construct( + \Magento\ObjectManager $objectManager, + $instanceName = 'Magento\View\Design\Theme\Image' + ) { + $this->_objectManager = $objectManager; + $this->_instanceName = $instanceName; + } + + /** + * Create class instance with specified parameters + * + * @param array $data + * @return Image + */ + public function create(array $data = array()) + { + return $this->_objectManager->create($this->_instanceName, $data); + } +} diff --git a/lib/Magento/View/Design/Theme/ThemeProviderInterface.php b/lib/Magento/View/Design/Theme/ThemeProviderInterface.php new file mode 100644 index 00000000000..810f81d57d5 --- /dev/null +++ b/lib/Magento/View/Design/Theme/ThemeProviderInterface.php @@ -0,0 +1,50 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\View\Design\Theme; + +interface ThemeProviderInterface +{ + /** + * Get theme from DB by area and theme_path + * + * @param string $fullPath + * @return \Magento\View\Design\ThemeInterface + */ + public function getThemeByFullPath($fullPath); + + /** + * Filter theme customization + * + * @param string $area + * @param int $type + * @return array + */ + public function getThemeCustomizations($area, $type = \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL); + + /** + * @param int $themeId + * @return \Magento\View\Design\ThemeInterface + */ + public function getThemeById($themeId); +} diff --git a/app/code/Magento/Core/Model/Theme/Validator.php b/lib/Magento/View/Design/Theme/Validator.php similarity index 92% rename from app/code/Magento/Core/Model/Theme/Validator.php rename to lib/Magento/View/Design/Theme/Validator.php index cc5bf42d8cd..ca2b6c1b18b 100644 --- a/app/code/Magento/Core/Model/Theme/Validator.php +++ b/lib/Magento/View/Design/Theme/Validator.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Theme; +namespace Magento\View\Design\Theme; class Validator { @@ -58,7 +58,7 @@ class Validator /** * Set version validators * - * @return \Magento\Core\Model\Theme\Validator + * @return Validator */ protected function _setVersionValidators() { @@ -78,7 +78,7 @@ class Validator /** * Set title validators * - * @return $this + * @return Validator */ protected function _setTitleValidators() { @@ -99,7 +99,7 @@ class Validator /** * Set theme type validators * - * @return \Magento\Core\Model\Theme\Validator + * @return Validator */ protected function _setTypeValidators() { @@ -115,7 +115,13 @@ class Validator 'name' => 'available', 'class' => 'Zend_Validate_InArray', 'break' => true, - 'options' => array('haystack' => \Magento\Core\Model\Theme::$types), + 'options' => array( + 'haystack' => array( + \Magento\View\Design\ThemeInterface::TYPE_PHYSICAL, + \Magento\View\Design\ThemeInterface::TYPE_VIRTUAL, + \Magento\View\Design\ThemeInterface::TYPE_STAGING, + ) + ), 'message' => __('Theme type is invalid') ) ); @@ -130,7 +136,7 @@ class Validator * * @param string $dataKey * @param array $validators - * @return \Magento\Core\Model\Theme\Validator + * @return Validator */ public function addDataValidators($dataKey, $validators) { @@ -161,7 +167,7 @@ class Validator * Instantiate class validator * * @param array $validators - * @return \Magento\Core\Model\Theme\Validator + * @return Validator */ protected function _instantiateValidators(array &$validators) { diff --git a/lib/Magento/View/Design/ThemeInterface.php b/lib/Magento/View/Design/ThemeInterface.php index 5097da60462..5dd1112c82b 100644 --- a/lib/Magento/View/Design/ThemeInterface.php +++ b/lib/Magento/View/Design/ThemeInterface.php @@ -41,6 +41,21 @@ interface ThemeInterface */ const CODE_SEPARATOR = '/'; + /** + * Physical theme type + */ + const TYPE_PHYSICAL = 0; + + /** + * Virtual theme type + */ + const TYPE_VIRTUAL = 1; + + /** + * Staging theme type + */ + const TYPE_STAGING = 2; + /** * Retrieve code of an area a theme belongs to * diff --git a/lib/Magento/View/DesignInterface.php b/lib/Magento/View/DesignInterface.php index bf2fc4ab291..ed1d090b6f6 100644 --- a/lib/Magento/View/DesignInterface.php +++ b/lib/Magento/View/DesignInterface.php @@ -67,7 +67,7 @@ interface DesignInterface * * @param string $area * @param array $params - * @return string|int + * @return string */ public function getConfigurationDesignTheme($area = null, array $params = array()); diff --git a/lib/Magento/View/Element/BlockFactory.php b/lib/Magento/View/Element/BlockFactory.php new file mode 100644 index 00000000000..208994af1a4 --- /dev/null +++ b/lib/Magento/View/Element/BlockFactory.php @@ -0,0 +1,60 @@ +<?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 Magento + * @package Magento_Core + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\View\Element; + +use Magento\ObjectManager; + +class BlockFactory +{ + /** + * @var ObjectManager + */ + protected $objectManager; + + /** + * @param ObjectManager $objectManager + */ + public function __construct(ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * @param $blockName + * @param array $arguments + * @return mixed + * @throws \LogicException + */ + public function createBlock($blockName, array $arguments = array()) + { + $block = $this->objectManager->create($blockName, $arguments); + if (!$block instanceof BlockInterface) { + throw new \LogicException($blockName . ' does not implemented BlockInterface'); + } + return $block; + } +} diff --git a/app/code/Magento/Core/Model/View/FileSystem.php b/lib/Magento/View/FileSystem.php similarity index 94% rename from app/code/Magento/Core/Model/View/FileSystem.php rename to lib/Magento/View/FileSystem.php index 2985cfdbb15..cc412a56f0b 100644 --- a/app/code/Magento/Core/Model/View/FileSystem.php +++ b/lib/Magento/View/FileSystem.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +25,7 @@ /** * Model that finds file paths by their fileId */ -namespace Magento\Core\Model\View; +namespace Magento\View; class FileSystem { @@ -39,7 +37,7 @@ class FileSystem protected $_resolutionPool = null; /** - * @var \Magento\Core\Model\View\Service + * @var \Magento\View\Service */ protected $_viewService; @@ -47,11 +45,11 @@ class FileSystem * View files system model * * @param \Magento\View\Design\FileResolution\StrategyPool $resolutionPool - * @param \Magento\Core\Model\View\Service $viewService + * @param \Magento\View\Service $viewService */ public function __construct( \Magento\View\Design\FileResolution\StrategyPool $resolutionPool, - \Magento\Core\Model\View\Service $viewService + \Magento\View\Service $viewService ) { $this->_resolutionPool = $resolutionPool; $this->_viewService = $viewService; diff --git a/lib/Magento/View/Layout/File/Source/Decorator/ModuleOutput.php b/lib/Magento/View/Layout/File/Source/Decorator/ModuleOutput.php index 8e24a4b4737..7d42953c23e 100644 --- a/lib/Magento/View/Layout/File/Source/Decorator/ModuleOutput.php +++ b/lib/Magento/View/Layout/File/Source/Decorator/ModuleOutput.php @@ -28,7 +28,7 @@ namespace Magento\View\Layout\File\Source\Decorator; use Magento\View\Layout\File\SourceInterface; use Magento\View\Layout\File; -use Magento\Core\Model\ModuleManager; +use Magento\Module\Manager; use Magento\View\Design\ThemeInterface; class ModuleOutput implements SourceInterface @@ -39,17 +39,17 @@ class ModuleOutput implements SourceInterface private $subject; /** - * @var \Magento\Core\Model\ModuleManager + * @var \Magento\Module\Manager */ private $moduleManager; /** * @param SourceInterface $subject - * @param ModuleManager $moduleManager + * @param Manager $moduleManager */ public function __construct( SourceInterface $subject, - ModuleManager $moduleManager + Manager $moduleManager ) { $this->subject = $subject; $this->moduleManager = $moduleManager; diff --git a/lib/Magento/View/Layout/File/Source/Override/Theme.php b/lib/Magento/View/Layout/File/Source/Override/Theme.php index 7927f9e3091..a31bdb93857 100644 --- a/lib/Magento/View/Layout/File/Source/Override/Theme.php +++ b/lib/Magento/View/Layout/File/Source/Override/Theme.php @@ -31,7 +31,7 @@ use Magento\View\Design\ThemeInterface; use Magento\App\Dir; use Magento\Filesystem; use Magento\View\Layout\File\Factory; -use Magento\Core\Exception; +use Magento\Exception; class Theme implements SourceInterface { diff --git a/lib/Magento/View/Layout/ProcessorInterface.php b/lib/Magento/View/Layout/ProcessorInterface.php index a50a7da89f7..d8f903d0602 100644 --- a/lib/Magento/View/Layout/ProcessorInterface.php +++ b/lib/Magento/View/Layout/ProcessorInterface.php @@ -84,21 +84,21 @@ interface ProcessorInterface public function addPageHandles(array $handlesToTry); /** - * Retrieve all page and fragment types that exist in the system. + * Retrieve all design abstractions that exist in the system. * * Result format: * array( * 'handle_name_1' => array( * 'name' => 'handle_name_1', * 'label' => 'Handle Name 1', - * 'type' => self::TYPE_PAGE, + * 'design_abstraction' => self::DESIGN_ABSTRACTION_PAGE_LAYOUT or self::DESIGN_ABSTRACTION_CUSTOM * ), * // ... * ) * * @return array */ - public function getAllPageHandles(); + public function getAllDesignAbstractions(); /** * Load layout updates by handles diff --git a/lib/Magento/View/LayoutInterface.php b/lib/Magento/View/LayoutInterface.php index 113cd4d7fd2..8874fbe398b 100644 --- a/lib/Magento/View/LayoutInterface.php +++ b/lib/Magento/View/LayoutInterface.php @@ -270,7 +270,7 @@ interface LayoutInterface /** * Retrieve block factory * - * @return \Magento\Core\Model\BlockFactory + * @return \Magento\View\Element\BlockFactory */ public function getBlockFactory(); diff --git a/app/code/Magento/Core/Model/View/PublicFilesManagerInterface.php b/lib/Magento/View/PublicFilesManagerInterface.php similarity index 93% rename from app/code/Magento/Core/Model/View/PublicFilesManagerInterface.php rename to lib/Magento/View/PublicFilesManagerInterface.php index d5d533704be..03e620bfb5d 100644 --- a/app/code/Magento/Core/Model/View/PublicFilesManagerInterface.php +++ b/lib/Magento/View/PublicFilesManagerInterface.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +25,7 @@ /** * FileSystem Interface */ -namespace Magento\Core\Model\View; +namespace Magento\View; interface PublicFilesManagerInterface { diff --git a/app/code/Magento/Core/Model/View/Publisher.php b/lib/Magento/View/Publisher.php similarity index 91% rename from app/code/Magento/Core/Model/View/Publisher.php rename to lib/Magento/View/Publisher.php index 9bfa48b2abd..f65244f9040 100644 --- a/app/code/Magento/Core/Model/View/Publisher.php +++ b/lib/Magento/View/Publisher.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,9 +25,9 @@ /** * Handles file publication */ -namespace Magento\Core\Model\View; +namespace Magento\View; -class Publisher implements \Magento\Core\Model\View\PublicFilesManagerInterface +class Publisher implements \Magento\View\PublicFilesManagerInterface { /**#@+ * Extensions group for static files @@ -62,17 +60,17 @@ class Publisher implements \Magento\Core\Model\View\PublicFilesManagerInterface /** * Helper to process css content * - * @var \Magento\Core\Helper\Css + * @var \Magento\View\Url\CssResolver */ - protected $_cssHelper; + protected $_cssUrlResolver; /** - * @var \Magento\Core\Model\View\Service + * @var \Magento\View\Service */ protected $_viewService; /** - * @var \Magento\Core\Model\View\FileSystem + * @var \Magento\View\FileSystem */ protected $_viewFileSystem; @@ -86,7 +84,7 @@ class Publisher implements \Magento\Core\Model\View\PublicFilesManagerInterface * * @var bool */ - protected $_allowFilesDuplication; + protected $_allowDuplication; /** * @var \Magento\App\Dir @@ -103,31 +101,31 @@ class Publisher implements \Magento\Core\Model\View\PublicFilesManagerInterface * * @param \Magento\Logger $logger * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Helper\Css $cssHelper - * @param \Magento\Core\Model\View\Service $viewService - * @param \Magento\Core\Model\View\FileSystem $viewFileSystem + * @param \Magento\View\Url\CssResolver $cssUrlResolver + * @param Service $viewService + * @param FileSystem $viewFileSystem * @param \Magento\App\Dir $dir * @param \Magento\Module\Dir\Reader $modulesReader - * @param $allowFilesDuplication + * @param $allowDuplication */ public function __construct( \Magento\Logger $logger, \Magento\Filesystem $filesystem, - \Magento\Core\Helper\Css $cssHelper, - \Magento\Core\Model\View\Service $viewService, - \Magento\Core\Model\View\FileSystem $viewFileSystem, + \Magento\View\Url\CssResolver $cssUrlResolver, + \Magento\View\Service $viewService, + \Magento\View\FileSystem $viewFileSystem, \Magento\App\Dir $dir, \Magento\Module\Dir\Reader $modulesReader, - $allowFilesDuplication + $allowDuplication ) { $this->_filesystem = $filesystem; - $this->_cssHelper = $cssHelper; + $this->_cssUrlResolver = $cssUrlResolver; $this->_viewService = $viewService; $this->_viewFileSystem = $viewFileSystem; $this->_dir = $dir; $this->_modulesReader = $modulesReader; $this->_logger = $logger; - $this->_allowFilesDuplication = $allowFilesDuplication; + $this->_allowDuplication = $allowDuplication; } /** @@ -232,7 +230,7 @@ class Publisher implements \Magento\Core\Model\View\PublicFilesManagerInterface protected function _buildPublishedFilePath($filePath, $params, $sourcePath) { $isCssFile = $this->_getExtension($filePath) == self::CONTENT_TYPE_CSS; - if ($this->_allowFilesDuplication || $isCssFile) { + if ($this->_allowDuplication || $isCssFile) { $targetPath = $this->_buildPublicViewRedundantFilename($filePath, $params); } else { $targetPath = $this->_buildPublicViewSufficientFilename($sourcePath, $params); @@ -355,7 +353,7 @@ class Publisher implements \Magento\Core\Model\View\PublicFilesManagerInterface return $relatedPathPublic; }; try { - $content = $this->_cssHelper->replaceCssRelativeUrls($content, $sourcePath, $publicPath, $callback); + $content = $this->_cssUrlResolver->replaceCssRelativeUrls($content, $sourcePath, $publicPath, $callback); } catch (\Magento\Exception $e) { $this->_logger->logException($e); } @@ -384,7 +382,7 @@ class Publisher implements \Magento\Core\Model\View\PublicFilesManagerInterface */ protected function _getRelatedViewFile($fileId, $parentFilePath, $parentFileName, &$params) { - if (strpos($fileId, \Magento\Core\Model\View\Service::SCOPE_SEPARATOR)) { + if (strpos($fileId, \Magento\View\Service::SCOPE_SEPARATOR)) { $filePath = $this->_viewService->extractScope($fileId, $params); } else { /* Check if module file overridden on theme level based on _module property and file path */ diff --git a/app/code/Magento/Core/Model/View/Service.php b/lib/Magento/View/Service.php similarity index 91% rename from app/code/Magento/Core/Model/View/Service.php rename to lib/Magento/View/Service.php index bbf4b542a6c..edfe2720cb0 100644 --- a/app/code/Magento/Core/Model/View/Service.php +++ b/lib/Magento/View/Service.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +25,7 @@ /** * Design service model */ -namespace Magento\Core\Model\View; +namespace Magento\View; class Service { @@ -47,9 +45,9 @@ class Service private $_design; /** - * @var \Magento\Core\Model\Theme\FlyweightFactory + * @var \Magento\View\Design\Theme\FlyweightFactory */ - protected $_themeFactory; + protected $themeFactory; /** * @var \Magento\App\Dir @@ -59,19 +57,19 @@ class Service /** * @param \Magento\App\State $appState * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Theme\FlyweightFactory $themeFactory + * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory * @param \Magento\App\Dir $dir */ public function __construct( \Magento\App\State $appState, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Theme\FlyweightFactory $themeFactory, + \Magento\View\Design\Theme\FlyweightFactory $themeFactory, \Magento\App\Dir $dir ) { $this->_appState = $appState; $this->_design = $design; - $this->_themeFactory = $themeFactory; $this->_dir = $dir; + $this->themeFactory = $themeFactory; } /** @@ -138,6 +136,8 @@ class Service * * @param array $params * @return $this + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function updateDesignParams(array &$params) { @@ -160,7 +160,7 @@ class Service } if ($theme) { - $params['themeModel'] = $this->_themeFactory->create($theme, $area); + $params['themeModel'] = $this->themeFactory->create($theme, $area); } elseif (empty($params['themeModel'])) { $params['themeModel'] = $defaults['themeModel']; } diff --git a/lib/Magento/View/TemplateEngine/Php.php b/lib/Magento/View/TemplateEngine/Php.php index 3e4891796b3..58382300fe9 100644 --- a/lib/Magento/View/TemplateEngine/Php.php +++ b/lib/Magento/View/TemplateEngine/Php.php @@ -27,12 +27,12 @@ namespace Magento\View\TemplateEngine; use Magento\View\TemplateEngineInterface; -use Magento\Core\Block\Template; +use Magento\View\Element\BlockInterface; class Php implements TemplateEngineInterface { /** - * @var \Magento\Core\Block\Template + * @var BlockInterface */ protected $_currentBlock; @@ -40,14 +40,14 @@ class Php implements TemplateEngineInterface * Include the named PHTML template using the given block as the $this * reference, though only public methods will be accessible. * - * @param \Magento\Core\Block\Template $block + * @param BlockInterface $block * @param string $fileName * @param array $dictionary * * @return string * @throws \Exception any exception that the template may throw */ - public function render(Template $block, $fileName, array $dictionary = array()) + public function render(BlockInterface $block, $fileName, array $dictionary = array()) { ob_start(); try { diff --git a/lib/Magento/View/TemplateEngineInterface.php b/lib/Magento/View/TemplateEngineInterface.php index cbce33bc87f..48714d8bb1f 100644 --- a/lib/Magento/View/TemplateEngineInterface.php +++ b/lib/Magento/View/TemplateEngineInterface.php @@ -32,10 +32,10 @@ interface TemplateEngineInterface * Render the named template in the context of a particular block and with * the data provided in $vars. * - * @param \Magento\Core\Block\Template $block + * @param \Magento\View\Element\BlockInterface $block * @param $templateFile * @param array $dictionary * @return string rendered template */ - public function render(\Magento\Core\Block\Template $block, $templateFile, array $dictionary = array()); + public function render(\Magento\View\Element\BlockInterface $block, $templateFile, array $dictionary = array()); } \ No newline at end of file diff --git a/app/code/Magento/Core/Model/View/Url.php b/lib/Magento/View/Url.php similarity index 72% rename from app/code/Magento/Core/Model/View/Url.php rename to lib/Magento/View/Url.php index c89537d232f..6419f022d13 100644 --- a/app/code/Magento/Core/Model/View/Url.php +++ b/lib/Magento/View/Url.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +25,7 @@ /** * Builds URLs for publicly accessible files */ -namespace Magento\Core\Model\View; +namespace Magento\View; class Url { @@ -47,50 +45,67 @@ class Url protected $_dirs; /** - * @var \Magento\Core\Model\View\Service + * @var \Magento\View\Service */ protected $_viewService; /** - * @var \Magento\Core\Model\View\Publisher + * @var \Magento\View\Publisher */ protected $_publisher; /** - * @var \Magento\Core\Model\View\DeployedFilesManager + * @var \Magento\View\DeployedFilesManager */ protected $_deployedFileManager; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\UrlInterface */ - protected $_storeManager; + protected $_urlBuilder; + /** + * @var \Magento\View\Url\ConfigInterface + */ + protected $_config; + + /** + * Map urls to app dirs + * + * @var array + */ + protected $_fileUrlMap; /** * View files URL model * * @param \Magento\Filesystem $filesystem * @param \Magento\App\Dir $dirs - * @param \Magento\Core\Model\StoreManager $storeManager - * @param \Magento\Core\Model\View\Service $viewService - * @param \Magento\Core\Model\View\Publisher $publisher - * @param \Magento\Core\Model\View\DeployedFilesManager $deployedFileManager + * @param \Magento\UrlInterface $urlBuilder + * @param Url\ConfigInterface $config + * @param Service $viewService + * @param Publisher $publisher + * @param DeployedFilesManager $deployedFileManager + * @param array $fileUrlMap */ public function __construct( \Magento\Filesystem $filesystem, \Magento\App\Dir $dirs, - \Magento\Core\Model\StoreManager $storeManager, - \Magento\Core\Model\View\Service $viewService, - \Magento\Core\Model\View\Publisher $publisher, - \Magento\Core\Model\View\DeployedFilesManager $deployedFileManager + \Magento\UrlInterface $urlBuilder, + \Magento\View\Url\ConfigInterface $config, + \Magento\View\Service $viewService, + \Magento\View\Publisher $publisher, + \Magento\View\DeployedFilesManager $deployedFileManager, + array $fileUrlMap = array() ) { $this->_filesystem = $filesystem; $this->_dirs = $dirs; - $this->_storeManager = $storeManager; + $this->_urlBuilder = $urlBuilder; + $this->_config = $config; $this->_viewService = $viewService; $this->_publisher = $publisher; $this->_deployedFileManager = $deployedFileManager; + $this->_fileUrlMap = $fileUrlMap; } /** @@ -139,18 +154,17 @@ class Url */ public function getPublicFileUrl($publicFilePath, $isSecure = null) { - foreach (array( - \Magento\Core\Model\Store::URL_TYPE_LIB => \Magento\App\Dir::PUB_LIB, - \Magento\Core\Model\Store::URL_TYPE_MEDIA => \Magento\App\Dir::MEDIA, - \Magento\Core\Model\Store::URL_TYPE_STATIC => \Magento\App\Dir::STATIC_VIEW, - \Magento\Core\Model\Store::URL_TYPE_CACHE => \Magento\App\Dir::PUB_VIEW_CACHE, - ) as $urlType => $dirType - ) { - $dir = $this->_dirs->getDir($dirType); + foreach ($this->_fileUrlMap as $urlMap) { + $dir = $this->_dirs->getDir($urlMap['value']); if (strpos($publicFilePath, $dir) === 0) { $relativePath = ltrim(substr($publicFilePath, strlen($dir)), '\\/'); $relativePath = str_replace(DIRECTORY_SEPARATOR, '/', $relativePath); - $url = $this->_storeManager->getStore()->getBaseUrl($urlType, $isSecure) . $relativePath; + $url = $this->_urlBuilder->getBaseUrl( + array( + '_type' => $urlMap['key'], + '_secure' => $isSecure + ) + ) . $relativePath; if ($this->_isStaticFilesSigned() && $this->_viewService->isViewFileOperationAllowed()) { $fileMTime = $this->_filesystem->getMTime($publicFilePath); @@ -171,13 +185,13 @@ class Url */ protected function _isStaticFilesSigned() { - return (bool)$this->_storeManager->getStore()->getConfig(self::XML_PATH_STATIC_FILE_SIGNATURE); + return (bool)$this->_config->getValue(self::XML_PATH_STATIC_FILE_SIGNATURE); } /** * Get files manager that is able to return file public path * - * @return \Magento\Core\Model\View\PublicFilesManagerInterface + * @return \Magento\View\PublicFilesManagerInterface */ protected function _getFilesManager() { diff --git a/lib/Magento/View/Url/ConfigInterface.php b/lib/Magento/View/Url/ConfigInterface.php new file mode 100644 index 00000000000..31ffceac312 --- /dev/null +++ b/lib/Magento/View/Url/ConfigInterface.php @@ -0,0 +1,39 @@ +<?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. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Url Config Interface + */ +namespace Magento\View\Url; + +interface ConfigInterface +{ + /** + * Get url config value by path + * + * @param string $path + * @return mixed + */ + public function getValue($path); +} diff --git a/app/code/Magento/Core/Helper/Css.php b/lib/Magento/View/Url/CssResolver.php similarity index 96% rename from app/code/Magento/Core/Helper/Css.php rename to lib/Magento/View/Url/CssResolver.php index a5e2dc2bd34..82689aaa934 100644 --- a/app/code/Magento/Core/Helper/Css.php +++ b/lib/Magento/View/Url/CssResolver.php @@ -24,9 +24,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Helper; +namespace Magento\View\Url; -class Css +class CssResolver { /** * PCRE that matches non-absolute URLs in CSS content @@ -108,7 +108,7 @@ class Css * @param string $file Normalized absolute path to the file, which references $referencedFile * @param string $referencedFile Normalized absolute path to the referenced file * @return string - * @throws \Magento\Core\Exception + * @throws \Magento\Exception */ protected function _getFileRelativePath($file, $referencedFile) { @@ -121,7 +121,7 @@ class Css $topDir = $this->_dirs->getDir(\Magento\App\Dir::ROOT); $topDir = $this->_filesystem->normalizePath($topDir); if (strpos($file, $topDir) !== 0 || strpos($referencedFile, $topDir) !== 0) { - throw new \Magento\Core\Exception('Offset can be calculated for internal resources only.'); + throw new \Magento\Exception('Offset can be calculated for internal resources only.'); } $offset = ''; -- GitLab