diff --git a/CHANGELOG.md b/CHANGELOG.md index b00766c9f50f1d4cb4f80b22a3e4ecd30424749f..d601a36f590673902bee6c20349e61ab359012a9 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 f262f7e640820b4ec111479c55bd5e4f63808d99..53e5ffec1e231e34d48e17fc0312411d7f14908b 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 4bb0f7e83267ddc22eb7bc819e14e7996678f17c..e2b72f17e51fb8ae71eca5d99cbd8aa7165f3dfa 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 c3fa4d3d403845041b9070bd20200730a5f57ea8..d4a999e0e2e315d56f71e7986607e32017352e14 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 1b6f2901ab577fcc718a52793d7afbc3651d0c47..5e27124f3b68a2bc5841eef6a7fd083b2bb4c065 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 506d9596eb7b5ea9de812f2b4a6974c58775932b..1ed1af94ffb713307059959ce0632ce8d7f6d926 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 104276a3d600d434580accba99bd6e0bb8e8cc1f..39bf86f8596da9f76f82b5b81bed70cff76de6e9 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 6872e3e5626f75c136889ab71a17b9b9d88a0c87..ec17ff90df4278634173b0229ac0f41d0dbe3936 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 44a0f6bba18196e22d5231079056c0998c062e0c..635f28d6f23516b294ed4570316960976a6aae8d 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 aab8b3160a8064099f189ec625856046ba13d023..35173c1d8e309ffb5404640b9b9a0a108a1fa75d 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 0000000000000000000000000000000000000000..1a3da4ccef5ded5305f3c11367ec3b15c86965f3 --- /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 a6f7da163760b4271d01c4cfe504871a03cd9561..e2550beb272e1ea088134bd3511d197f82c665bf 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 31ad3f320f735f229ac1f5582afd72741fd2bb2c..e2550beb272e1ea088134bd3511d197f82c665bf 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 9ebf8a92659cddd37e135a9e5872650258978f41..23b3247368dabdc2abc0bece362796062f9a4e49 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 5cefccfe4795e0e1e99eac032204afb07262196c..244de9a48b925d75916af7b0242a820212abd253 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 153d2ca483bc8011b70a50c3623e955d79601b8f..910711f08d45e6798ee4cec9545c5a073e9b7152 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 4f15d4831ee77d6b0b95d20d7b9b8cd6d8e2f9b6..0ef867226f9ea62ced10c9bc125a4858cb797586 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 05c8ae2024a641ee533621e59f54cc07503c2f90..003fedf1b47914717355910cb036f0a3d64c2064 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 c575120a4691d664a00382b5c0d1ec941590be01..2879f6c73fd6219dbdaebffede4ff612bb5ffae9 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 f8d1c270e459a63d6c84a65c554cae2746da5683..b8f0a758abe318967e859a2df566620e32bddd94 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 391689ae5fc9e63ba0a903e349ef881c27679f8e..d232dac346e3d51a06df50470749b8a06a621c86 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 78a93d985f222ad4392cd0982981a9a3dd3ee11a..c378d6b8096ad34460dd16dfc195e181d7f94a71 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 c70bc383478e664ca2e8a35b4badef6883c016f2..93d8f6ab4292370ab09984d3ab70ca4b7627a421 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 910eedbd188a06a5a5c37ec0a49bc5f3f32f5ca3..1d341a1fed250bbe1853a45c9724aaefdd1115d3 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 72aa9894c29b513c44a1668151ad8363c31ff858..7baf77350a4a79e5c7945a7d81dcd8a62054588c 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 382172d1a1a8df1cedecee681cb46c8209df615d..99a48e2c74d1d9b7bb62b58840c6f58c43baf056 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 e90b230df4f9043fbed7ac05f829e7592f28eb72..25664e99eeb63af391b56e733f5ee599ded6bb31 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 43b284bf4ace3dede6027e559b69e6acafdc10c6..5b6ed97a00791ce5e5f1ed49aae827913fdcffac 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 d7c4bebf953cf902e23e16a22aac1b6370dba948..daf6c5259ebe93d63361e02979e4492e1cbccc90 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 1effb7cfc2ce1186203c1338b4a456a5f37db8f4..25230f881f9a74f717e9117b83e8f95005e1007a 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 ad993575d845903f387e1c19f46cedd4b67a665a..a03ce759c0406fd47423a096f20d437df79b65b8 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 d29d52fcbcd149331ccfbb7c6c85cf0026d3cc02..927fd0ad1fd8de95e69d48a386c32d73b1c85262 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 7e85b1b14d0950f559b458c80437073a31c8cce4..9a4b3614acbf3d94b120a013c54485508940c8af 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 61b91a3a66abbd78313433c0afd53b858272511d..15fbec6ea4d11e25aea4e3a67c556a1bade86391 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 a493118796a7b9218c86428326b172c9a3f4995f..bd8db974b257f224dfb653193bae19c13902363e 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 bfd6603ff7c9bda828b2bb68d7730c42ebc5ef92..9fea3750b23a97f0b4490e19bbf04815690f3d03 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 56a759b99e4ca13256ea5ebac5dee7a9e59f5676..83752c4c834c591ed98e8e26c2c08ce9ca35ba3e 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 3f97cfe62201c2a2dde4d4ea8af4651ac1992d14..7bd6a6e3cc4ece42301332f41c3d777d1d061d42 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 f5915bbd1ae104e473024ae19286646d905354bb..0c42c40f4d7c840f71b3ec215bea06c3d06b5110 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 408a08f51d245ca64562181ee44b18e5654b1a28..86746491042cd6a584b1cb563e281e83333f9607 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 b29dba9838d9dd00a9cd981ce0028d6e9d7547f8..38d67235675855dc8dbfb6499abe87e0800a4744 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 5fef291ca25c04488ed612c3cf8f817e851e738f..ec2a88a14add8a0e5aff52fc069aa8e604e32ba3 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 bd7154a7fa433f57e6ae4499642f613811fb96be..8a497d5df2d2cedb6e7a0aeb6f8328a43e7d9aad 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 5b5085ccabc6e530b25c43fe391d0995abe30aed..c61719c3ff9463904a2e4795e11c8583da01d643 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 2c8271f2188cfa9d930e017c776d852e9d31105c..95dff1a4b3fe4992fcd3d5ae1dd74882e7631e42 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 eeac9b35bfced4420dd6817428790235efa650c6..22481c85d91399ce4684b9df03b83a559788427d 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 69df4e66967c2cc3618749a53d729969414a9981..57dd6fe48ba3c41dafebcca53f22f9caa4e37e14 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 0f2efca739db768e15599b81952f34cb7a908287..28dce9b62ca08ed1c5da8debe885b12c8ed46e0a 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 8cfff2a92cca8af67dbea1050eef0dad242a9d75..bf01e61be60d4c2e86a760168950c3700f108ec8 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 ed2f1ccaf89f321ca5931e2cf3b991e60a3abdfe..5cf07ba9f17a058576eb61286e9bc1eb39fd7609 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 53ff63544207c49b85fc916b311dc36d348f753c..fea4805604a3926dbee86501fead407dbec00d55 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 e4438667f09d834892b55d3f9adfaf3f14de2f7c..091d98690afa5c2b5388331f411fcb67431afbf1 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 2c969295854b51679c3cb8b92b28b51370e50a34..88b192da14b21beb3792f7f6fed774fbfd998cd6 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 b03b0237c46f8d79731fa1ad83faf729dbcf9ff7..71097bd8b7caec8641cc5f3d5a933cd7e638e00e 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 f4a43063069f46958ee1573f4c8bae3cbfde0da0..51a99f2d9738b55cc10c3f01d1062a1585e1288d 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 6435f8c000ed634a239f8703e4047fbe5e3d92ff..8d0ee404e5f131e34118674f790e582f570f7615 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 29bf67281f886c5ac59d3887b18b772b7ffed347..f8a15b1914511d1a7a3d51de0076d89dd41e683c 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 f3716680d3dc582e6b30b45f76f978f284be097c..c86c541b6b5ba875fc6dadb36fce9283f632b1d0 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 1f3cbbde28f037dddf19b8c850ba558a1ea8f5a8..8323b9cc02db7423e95731bd772ae19d179a839a 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 8387ff6d5566d16117aeb55a779e6bb76cf77c8b..7543e612f480cca7be78554a86570c14516c087e 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 619a64d8a9adc46a38267f9740a1ab8300579630..a31b562e3f3352dd5b535cd9031d8edf141fd66d 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 640ac71cad9fd912a15942cc9f1a9da66925999a..47ce73a86ce0e337552a820d7f2e98c17c0e330b 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 864e85c0d84720d51a782076ebee4cfbe36139ba..ea9b0fd8b929815cb1a07f2589261a452cb74dcb 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 761b13c72876d8e4021eee70d1356c388fda18f7..d11173db0b1a75074095a116939410f644eee15f 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 35799827b193e4cce92ef3180470b40f45993738..4c183bbff418a9207f9edaf31e4e3f05fb86c78b 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 4077aca5d1a1046be9c4042aab9fb7a95065e727..b860ee226293cf8a091695a6271c4398818b99cf 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 96a8ff13077fa2a0ac71e399c7b71fbc8d0dff35..521011731dfa12bf768c39fe0d9fe70c6917abf2 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 c8d15e5eee40b0fa193486787529ff9746288b60..046644f74ac21aaf8018eeafa5fa0bcab3ee2778 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 02e9b137d21f58f1e90d3c3c5e48077072981e6d..c7f84b5d594c5f8a5945a81381cb7ec4d89eed0a 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 f78dcd79a142147d8bea56bbb530610badb2f44e..9b2d2e4c1c2a38b2f5b5f6e43900dc0b27c82f79 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 a97ffeec5ad6de59b701db626f6f7a58199cec91..1bf37d9d6c7af67182d8d1c0b61d1fde37750076 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 0000000000000000000000000000000000000000..a77d42557bb7217a74aca0d7544df0f6ffd0114b --- /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 b0ed1178c64b155c49be2dd2f659ad37ba7ce457..9e0d895c6de3213f7fc63fbc5f7c866115a3a38b 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 fd474b138e1fa7c56b5a56251b5dfed79d85c524..510fb90590b20a28467e8ffa12adf624fcbf207f 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 0ec9847e783a7f17827bce8a420f98fa29974615..0c0ab92140c3dab9af74ebf84b4facd839f4f4cd 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 bb87f9a9785b97e86cc9c569859d73bceedfcc7a..b155ed90be56da3f2418b6bfb63da2bcdf7a682f 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 111d382fc00a52228c97fc5b19cbb1cef6d04b64..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 d5fa23488055a72e2f5a4b5538ec0eed91af3a7b..c33e2e17ba9d11a484d6cff6a4efd4ebc0024d30 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 12dc103d248ddd41a42ade476d5fed157aca0e5b..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 dc997ea0fc8f916ddff0c0d23f529d44732be208..6bc838546534494beebaeae317df39e5655abe97 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 d283fc501a3b35d4b62c264ad859415c47ba0bdd..d1a830005852a3ad428673a4bc906df5f585dba5 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 1eb77704550b5182e0e6b2513f067db640869cb2..48129b08946e61a02156a9c644a8bb7a8af39287 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 ca9becdfdc79cbb70956c3c8ae8645a0f6c4333f..2bad362d01d06d4c53b90df177e8e4fea3b3e12b 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 c4479ef8e4a723441bcaef58d8253033e195fec7..af3c5a23e151a19efc0e68973f7d71fbe5a06e03 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 46cb9990cf5d3096c01e6285cf8eeebf7aa38f09..27a22feac4f7eae2b6867d571f05d5c89c02a58e 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 2f79465ff4dc3ec06c41548071c81105887275e1..635b713c307ada10eada7361903d5a4e9505fffa 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 f2aa00d6c1b1e76e600ba7007301c3670027c17e..c68ec30f67b8de8db03638a2748dfd6180a27ace 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 a1de168746e1e7744a7f34d5b9ee2d96e9072c5c..35bc493c91eeb9e0fc8aa9b3c1ddf9364432a6bf 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 d8f6dd02982c29bb8accf95d3ca38b2453cb8cfb..29c8cb0469d1c1bcc4a9d17bdc3d7c42235a52d3 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 cfde98c6cabf9147ba8ef4e109217221f6cf8f50..ef7dcb5db6db637c1259984f58ceb95473f0c7de 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 dd0de9c0310a86e2619e7c0d9af3118dfa5d5ec3..ee424b617e06d912877afd960f32910b115edb5f 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 38f1090f2164914fe531c22e58aa5faa2280ce8e..e944cf25824e61b4b0839cf11bcdbd6cf925e474 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 ad4bbde5a6fd9d5030e9ccf60b4bc58c0ba5442a..c6928607953a9ad32e9ac984f03eeef32a3d15e0 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 0000000000000000000000000000000000000000..9afa67f55083d82007d80a9e201dd0a47968c6ea --- /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 4b440e65a02c7475b16bae6a063a48b1b01852c5..6027719a58da0751da4030d117a47fc649f061c9 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 4abd838ba8b072563c60d34f7588193ec6491390..39879244cb2eadd13589a96c5b3cde8dc5d3a498 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 0634b0ae444504ca708224ddcd09b5ba6835a988..728685daebd58c4962e46e3a8452bdc2176cb09d 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 1513bfb4690edce50fe71f29484eff21e86e04ed..4f59da57d67dd0fc0e5e569f5cdc9f13de318826 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 0d3329a313155d72baa3d1d54589dc85f692b972..4eb92eddb8b84cc16717582ea681722a602fba2d 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 1044747da68eb567274ad941e273b3247f981e24..7d1e9736b88421b3d9cd3226d8c5041c3cd42adc 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 7a3bc0dd937e429a9853f9b60e5d5da4f7d7c82e..597cdeddc2feeab19a7ce2f738a98c43a67c9684 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 c6461a2106e26ce2006db86304d31792d1401e51..ec77a89541abf9eef56144d41bd879913df70de9 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 92f7121381fb39e2d5cfd172ec11768d42217a1d..d71b70adf7be3f8623064ab1bf7d901641fbf465 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 f38638bf22701a052e9efa1f334970897f12d91a..d06a8dab64033298ec465e639482ed575e9faece 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 2ac3edc463441c448e522b9641e116b132dac930..7c9f0e46a8ec135ffb18e865f4c0e3136a6a0d36 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 5618dcc162f832dfe2eaa8b3df62e7402b2188ea..113a0ea8e7a2ac38895788399de4e345cdcc1cfc 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 87813182b7f685fb9b49ed27ab9e67769d6cd738..d6886091e36ed305ce4638634ef89e2e91be2b76 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 0384042495e42e636d8e62946720e319903d97fc..4b5fd891d5786917f11ca5d865c0c532dd8a2170 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 51983d1d05357a6598456672f8923515b4e372de..177430215ae3626f8496c04c7ef18bb2ae4dc567 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 0000000000000000000000000000000000000000..05048704ff868b61869f66b822d7e5e0d26bfa9f --- /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 ab88c16ef539accd2fb495d2e45fc4cd3c35abd7..edb922b5c54b2fd2e4aaef04b1b82e294cdd1a23 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 294fdeb843282a344ce7f1df50f03a7e3ac8e981..2f306b55b6e658561b294f426183f258d4730015 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 24d2eb57566258aff326e6366baaa27e14aec13f..7ff60b04ca055b8db85bcfad8ef4bf2dcd3c2c90 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 11b2ce0248afd7af75fca4ec7567078b80e69c39..72685dcf9048c5ec6f9ee0d2b271d5100ed56c67 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 31b449b274fb94402238c65ed2ecae0068ea6b8c..6992a9165dc27dc8a182b4adb75c970e33642878 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 15998cc52efa8fb11eddce78f779c5a873907d7d..01155fca00b61a3a223960aeccda1a52c0f05ed8 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 796fb88cd3cac69deadacc934783a8a30b31418b..01155fca00b61a3a223960aeccda1a52c0f05ed8 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 25d5a6c7b28814a9b704474d1904b06967d0f9f9..01155fca00b61a3a223960aeccda1a52c0f05ed8 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 0762e7332c2345f47f7f478c6c7b9c26e844895d..01155fca00b61a3a223960aeccda1a52c0f05ed8 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 064edc3dcfabd371b2cac957577a699880819559..01155fca00b61a3a223960aeccda1a52c0f05ed8 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 3aafd119cc239c38852936c57be78a61238d7a55..8476c3644e26d46eed734f111f6d07ebce62d9bf 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 35b1c6f0075fc6e4ce9a5e7f468ef1f3d424fec6..edbe6ce92e8a5de9ea4e21341d9db672b9eca134 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 6175c3397f4fd15e4066038830b4245e5f775a64..cb8f206e7354716af5da1032b29bac04c2b7baad 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 c1d420f5d0c8d6b3951f5972529eb9a719cf90dd..727670fe7b56bd7281e08ff961b94cadf5be183d 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 dbb444e2c8f14e2a6a199edd88cd2caa70a7fce8..8e46496c74a4abeae1308d37ec5d2d8b73abe645 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 eb4a8ecfe025063ee24bd05cd90adf11a797b328..db128f00b8c2ad1e461a633f235a29cccbe556cf 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 4849cdb84951c0b505593b23ad206ee60d92ad7c..6fae4733fab34f677ddb6b62c02f9f764b3bc604 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 648b74594f952ee6cbe69f772610ed40ff0fca45..a3a49fd46d2637a2eef662f5a9765381d02ff1ff 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 2d0133bafe9b3c5ee1891eb27abdf24f778f6c8b..09e49208bc08b01f172ffa7f34981237f598f9ef 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 8e0419a596486d4a1de1045248fb46bcd1b699bf..6e453eef56b5c4d07809923cc7659816b670f26f 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 d77f3489ac45333a752202e1567a190bb6aeabdc..fa508817825c5823e9f48ef086cec96b34cd79ec 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 59e213fa734982d588ca56211371baa5020ed89a..d50608564d235a2e7ded059555e01d0e1432b887 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 8a9230c4df9fa72318ea34a31a29d766fab5499e..25a577d24d14df99f07b1f58a672146bddd8273b 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 1db04c0ed12211f85e0954271b81127348a0e383..d2f3c9f0fee390d987a91659c9a7c0967fea0345 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 d00f291336fca2a64817352dea95bf1f8191d4b2..01ea8488482668aeabb14ff500c89c79d8e79dd4 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 11bccea76e18e115861c91504fd2022e0638813a..ac8dc93f7f630c463afce9e137e14508e72e515c 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 c2462939da24daa6e632b7b19b73b252b24753cd..259357e1c772433b2fc57183f0755fc9338b6ec1 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 34f89faad0101d76a97a06dac8e17649976945e6..578ee2c164f3388ae29fd0e9f11ffb8074e160eb 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 868c2dd6c2f708c0d369b5d2f9a36f296dfdb3f7..2c7ce7d3388561144268227d9aa3db98e14ff195 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 92c3eeb22b7907e66108c164e8d716093ad4c830..f4de19c544295a50dd848318ae0033555bfe92e1 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 4bb2ef5729529eb85dd0b6d1846b59cef2382904..4297b91e4c00fab9671d0e136ad2cbd647b917d1 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 0000000000000000000000000000000000000000..457cab1fd77e66d733455f8eecea2db5b99a31cf --- /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 d31d02e0cf0f76f4aad17b79a9e6d43b7c3d604f..97933cab584e1a591f71519146ea0a51641e0fc5 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 ce767032b8be2f48de38becf0b2024d5e58e8882..60768622749dba53dc848f8bdb804a181d7fc0b1 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 78fe6c293365c09cb158e0e91c8df97641f69f81..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 1d9f85fc7a8d9234c4a862f5c7e96e2692e75c76..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 be6695ade5bfbb926caf5c8925516b715cd45203..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 0b7d0143e8b7d597d49aea114c078fc4c09ffc56..c2f6546fbf28d1ca81c3b72867e90b65ea4ae5c3 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 0f111de96925111bd9f6772f34ee94f18058d617..1c82d5f68bfb599d59614ed385b4cc975dbc09a1 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 9b07da7c130303574c4c1ce52b636a0f8dacd06d..4b19c2f8fc611e87208b5c76cc80106c8ff5bcd2 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 660b62b74f43a38c5d2ce5a0aa79e746b96ee9db..a566e8327a6e1ea0170125fd600eddc03e006f1f 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 a88f05e557dae7292ef26ea7743584081354248f..6079d7243cc5105289f1137a5c5717a81fc251fb 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 bd9d74ed8fa900361eb4084fdb2ad2efcda0de39..cf7e77b9350ed34a586040b75fc362e58c0b1a5d 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 5302aff7c4ab5049325a9fea1d0ab75eb04d5f1d..3784bf13b727f88f397d92592c564ba59f676016 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 96ae28dd03466a2ce92fe3e506367d10d1072215..16894e9908fd6631b26efe6ecda9a94c00b11803 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 5c8565fe2de21cbcb9dfb281d41f34d034a7970b..4df26e902500822cb15a08e2d3247e9425a6257c 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 8d92cf3a721494d835d858c302b28d99f2327655..dfcf474a3dd465b7a368c9a90866fefd24bfe5ac 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 e76f4ed68ad074983690f8e31d5d0d5c7d5fa985..3243698fbf75de1c3f8eb6c2bbeae19ef4025983 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 3952405aa7d5c13cef33869254c4b7031dc910f0..d4bf3321ff0aae73af1f74dce54fa68d6d69fe5e 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 f7d892d63450133adb26ffb35a8681300d0ceec2..2bf8893976392dac27c48ec6fa197c3cd13a2527 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 e7d9ef9eada0f11eaa167ba3893c999c00cc4729..0ca295bb0016a2dcbbabdc15a9875731c7af3252 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 502d6e924bab4d9aa1782b2ec6f4e797bffb9f6c..76032fd153d4611c690602ae28cd8e7bf23ca231 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 8f21ca882daca038087c9393d1b94709ba69e2d5..81c1c0cfecec8cdd170b3ed89067caa154bf9c14 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 a0db48540af50ca1f480da1ca0e205990db8586d..a204e7e9c3ddc6fce435fbc5fbf484074fdcfd8d 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 f2b8dbf315601a7d9cc0b92d8fd1f5d1076c919e..3b56af02c0084c3bd0ff43395e46019fab8956a9 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 4ddf2235be436dcf2fa7f3278c5d467754542baa..42f93299fece510037aa9e2f2cfafb5c2813ee9d 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 1c01ec699fb56c56f64d9ad17daa49061f61016e..99fa5a0537631bb9c2be0528427b485972783444 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 65ecdaa684acaf93eb0ce0169a95a1ba18747b65..1933ef6a2d879fbdb7235366d57a976fe2ff67cb 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 61bb9e353039bd65e0118e0a437a661554420e92..b4bebc8c152574cb954b7abeb58baad7aef40c2f 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 43aeee2868dbe8f35cc921de166474ff339006d9..3c458bbbab44bccb1fb341c267bc9a4e8bc6fba2 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 0000000000000000000000000000000000000000..9ac6f5b3d5bfe76a610c962de6e01cdd61111724 --- /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 d319fce7ea8a844aed34860293dff6d0c6ba10d0..0000000000000000000000000000000000000000 --- 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 6cbfd64d3b6489b77c9bb9f3a3a9e387b5d745e5..82dc52564df0ae595c8ed7b8944d1310e15f1c8b 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 3e10044911220bd0b38fd1d90c72a78186364ebf..9ee6813d4b50f6f31f56f0d81c6646937bccfa1c 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 0000000000000000000000000000000000000000..46a662136ffd0c19a98246dc042880ea7140b49f --- /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 0000000000000000000000000000000000000000..bab50adc1d126e9735af694a475ce3b0c301fbe4 --- /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 0000000000000000000000000000000000000000..35666fa4e461daab6c878c2eabaf453eeb6b2e58 --- /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 0000000000000000000000000000000000000000..798f1280e94fe15950b545dfbb4ce6e58163b326 --- /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 99e4e097abdfbb253ed8ad7a92c12fe972eb180f..62850f29a572170bf7f59ec4527ca9cf683372d9 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 8965efa8d1aa7e57f27aa1ed71b3df1f3e812755..d1e262aa627b7d0fda9bba7ebeaafd3ac647bd74 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 0000000000000000000000000000000000000000..872498c9641e48def4822195c2bf2ca8b2f92e5d --- /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 0f27862cc22d2393e20f20b59579d5f8f61b8a73..e7e23ab3da2fc477b5c187b778be0b8b64a54901 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 30731ab0bbe90ec1ebb21f668268a6c86310c531..8a533ab9e6732e7c48b269b94f9191c6a64a5b7a 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 3361279a13ff6206796b36893e6ec6f4dfea059b..e1e7ae0090691278ecd594f65d962b96aa3ee490 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 038c2ac108cc92d4e84eedba766987d73066e0a5..74ec58aa2d76e63f51c167d4184d2a2d9c05f91d 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 026509dee35093390e82dd10d98765fdcb495547..5ecf6500c675883d1237aff6813049ffcf31487b 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 4cd43c6b5b47559c41a54e543cce88f5a01dea5a..1b57e71a3ff69ad7ed7a5768cb6f03f6630079ad 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 46b26a24c38fcb65a4bc67736132d9f4172496e8..bad70b2088b099f12db674c2729ca1a6b6f45de8 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 9b69e996c0f66f340434deb5e836cac875ebc4b2..4f2a3ace42c8d03b260255679d63f9cb0d55f6b4 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 cbc6de8ddbbbff5dc8526b28264172af886da08f..6c9a3825825c9a6d576196caf691889c384e1ef2 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 fef96aefcfd4aa24fc5aee9c1a24aef9267cd9f7..f8b50a4ca6ad3903ffac54c9613163740ed67bdf 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 17546d991bcc1fec32ef2a6ca48bedad1ac56a70..d01cbe248a83d44acce935b9f7c684fc63ef5b67 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 2bd65ac51513b3e84d26d2910bfe2bacd2501ffa..b34409f06e9e81e06c77a302498ba72bd847bf3e 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 0308169d70928e00a844a80b5ddb358f7f4bb511..1212e36c63524d4c80301b574021b5994db3da07 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 8af315c0e13b7c81ae01adb8346460dfb83283b6..8f09b2ed3dcfdc8ccb34c6df44350d406dd8d53a 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 0000000000000000000000000000000000000000..156e1fad325a72529130c5068effa436634e4f70 --- /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 3cd5363558317f475ad0726bb00c6997fe02fb89..35b30986a68ab8002191834f8ff32eb3eeddbcc7 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 f1302a2d0ce932876a34ba8133bb1b993b3c90a3..9007f0b74b3a02da88eeb005c67b793c40193ff9 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 bf1579275a30a749d0558d15db066d9216cac231..96d784364a26655b34f627a21bb680cd2c72bb7a 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 c7fb466d569e29c3e1f050039183970dc4d7b42c..379d9c7864de964afb8a151d418f603adb735f7f 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 0000000000000000000000000000000000000000..dca04802da3e56fd83f126b831eed2d4dbd86bf2 --- /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 9fc553dd6a7973d6a73808ab556b6a93d1bc4ae5..7eba34128bad8f69ecaa7d51a249d495060b6f3d 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 c985b9bc41ce0d5a549b93d912b252893fc6fe1d..c94d7363b300b21ab0e2d35bb8ea64e0f437d762 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 2e0d0a8a5653c4a5843bc336c3ea5b290002d5bc..7905c2ca54137d25145e9ecbe5d12b80e2f984ce 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 0000000000000000000000000000000000000000..8c64bba1e422ff017fcf06d27e4f7e2b61474bb2 --- /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 d83df445b104b0330da393b669be5bf9d49e1df6..321f3fbaf363d4ef87db0a90aac10368430435e5 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 71cd6f8a3ff1b4b3cd530696ac2716f1b65d6cc1..e4d202dd4953fbb4bfee2a36d771ceffc45b0f6b 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 7f924d65fb4ad1095a1bc63271745b014aeee54b..fd682ebdb28452b1e39d701be0c61d5dc7125b81 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 62aeec8e5cf212f2f617828f5575387cb8602739..b469b555358f275aff1cdbc626dec0652956c3d6 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 6282084b476f2a902fd04535d7b273bb670483b2..5e2c8c4b27e46ef05bff7ae1b07beffde271311b 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 1480b547a490abdacd20a1b4e5a9c99a6a2578e9..6fc59f6961313a7c966036c5be17aec95b5a089b 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 f79a59e106164106a5053a017069e88db799c2ad..d21b1f20af450d1e09630e16e022cf696f615dae 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 2d9f468fa862b0bed83426390c3b8e625b00babf..ea8699421ba05dcf1b17a6fde29269d786a9fdf0 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 4a7a5d954c5d9ff7b34f95d681e82424f3fa8589..09794115fa593b6f168d4d68a7db8e00573055d1 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 0000000000000000000000000000000000000000..5ffa93cde4c579cf6f189c96dc91e4651b9dea47 --- /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 414c06f31f16ad92f3ca9ec216944f4653cd85a0..799be90d5f0747f5d8d60e35d3ef05553ed43ae2 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 7cc457a3342a38feb4854adcf058006cf267a7c8..5d4d665703f62b95416bc334504b71fb08ccb8c8 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 aaf3d5da1f8fa7188a2320bc30c94388ed7c7359..bb5ff34e22b52c6681167ebd1995bbdd13f5d734 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 713dc37aa9bd706de6729989115a2129838060b1..068335dafe17c3b051ac795da06e93bb81579ebb 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 d2fed16e56dda9ac5063e7a3b5fd0bd138d843d2..4ffb6c7c98945ee696af15dde5254ac403588a43 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 7292a69437b69670b011034711eda4627e4fad67..40ef4a7fcddea5300afe898678b7d48e9269d1cd 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 a35462a3158f4068fd85cb588df441cbc68e80a3..93309fc83499ccc4e3b9b77781c524491d1a0f4d 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 3e6573f1a878a84fd1ce498a5b8ead5b0beab5c8..f578d61c89341ca8ddd1664cab052085eccb90e1 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 0b7d88e7234f0af706434618b5ccc22cd2fadeb1..7ef094fe85ebf1446b6e791304d43a2fe1c5ddd7 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 0000000000000000000000000000000000000000..5fd4f6e7f7d9d2423f9f513155d4f7263469d6ef --- /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 2e4329b4fe353c01807c5e8cf468e3030f159df6..b0c420fc344ee5dae4864954c75837c728f5c227 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 04a590f7ec594f3c6c7743a4aa641f4c97389e48..29e0f6bbfe238e8368740f982169c4746214139c 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 f9297800293e53deed6485c8cf00e9f9f19fb764..9c5c531fbc445e6582af3998bfb3f83272182832 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 3e2076b14dae836ce288b7956e00a04af20eae46..f983ab287d73e89f786c8ce0bf3d36ce3b194a60 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 3211833fdb5c0c0a2b3b46af035a4aa1c92638bc..4c32d5168570839dadcf6d99dcda2f42ff761a63 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 ccfa6b6e5fb50e311dea01b8b9503c6dd7f51805..55fe8c9995735af64b333196dffdbccae2914062 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 7cf5a8cafe8ee9e75d24b3895bc70613a2ed3d5f..7d4f76c99af3802f311ff47396596e23f845921b 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 e726d3a6e2a349afce484757e32ea2254bc37bf3..9910b6b783cfaa4506f5061fddf7c27f02a78aba 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 8f8f0863f14fde438a77e2d45838b4f5e63d0cfc..1956b26aa8c7bdbb64565cc1ebca33f623f5ed5a 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 1eb2db90e04864d921bf5467a80fc72a437d8db5..2aa77595ea1a62f5e667a44538783088c595e3a1 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 0be49d25afd4575c397faf2cb7359e52aab94a8c..48cd1f7dee4491c8bbac58c39ae150c1d01ec404 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 b65a21e4d5093272715acc90d5a1718acc7dc7db..374fc86688ef327812eef17a6f61ae601ea118bd 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 ea4a329d870b3baecb86f95bfe8adde264bd108d..f5c1b69824522ceb50fabbddab71cfe95ab1f24d 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 be9f177523015c3acfcee2bbf2b8f4df8e5edfe7..23feacec27fa4a7287d50819b7580ab3c39fe69c 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 33643a7501c7bcd6cec2534575cdfe948b099360..3188cc44612bb1b2d959ebb7785d27f5319cc531 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 6ceee87de257bd86be087a2bcb2a9fba0dd3aa27..ca526741059c7e92b330f0ae112c26a373a66f7b 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 7713da2330f884eedc6a3a18162505b1485177d0..60fa97c0f6bfefa813fb70d06e6523697a0d21ad 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 215203399e6e940a43a4873784dfa75e65db5186..cd4704141b459d9c8420d2134c3ea2bab6c56be7 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 804c22a1843d3a5d4dc2a685cc62fa581eae94e9..370d80d775427333e74b1d47b3b54878bc820c0c 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 23ed447c98dddd5236b9331ca2d7974264157096..8b16db6de66da634c4c9b9b949e3cea750f015fd 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 a8debcfed93bb8197ed00f7d28fe1416b8e59fb4..0d523b544db406b1c00af07177889ed70af384f8 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 503459ec40eb01906414833bf33d5ef91f43bb4a..4fbb35b432397ce9e40a467c7cd1f75d6dead8b3 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 42532503f04353dc0f7aab3871d00adfefc26a1b..6cafab88bd48b8028dc5549a51cedcc13107c059 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 90ea6202ed895b91bf08ecd06a9fa7e4b37800b6..1834231f22adf379401b12195deaf845f2aac06e 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 13d538470a21e2926c0eba6573a6ce2740f51367..c4faa5b6d62f2bc88d93fe0fcbe8e346c18a9258 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 560c899a7cdf244ccd7b904a477c0664d386c886..95942cd1a7cfb8bf85356d9d55e005c3f93063d7 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 d7959ecc7d400f703034663ae1bfe559db6ca947..24bd4bf8911f1ffe6cafca9eea1f9dde493fd6b7 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 52620acc2d5c4acd76b36c76e077c1812ce47e8b..35b49e96c943f0b7e7618d8d57f3cd2b2520146c 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 6da24c4ee36460b7a085d0a1dbc32cce28577a94..0668242b9573dcfa9dbdde4d683e47c12aa87c7c 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 fe8a9909b6967ba2eb8af7e5b57974870285b7f5..13010e23213abd949a564f745802ab0ebae807e3 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 7b907ef099d48a9e1711090e9467c5bcebda429b..50336258ed3c2b561609d2e6480cc87d9b17e2b4 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 4ae3ef6e291a72ad3e5436750ed0b801ce46b371..2d9417178bb2daa5a43ff78a93426eb710a8aecb 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 f721b50884983de4dc827a77fc58836f6aedd131..5a2f534c3eb5f43eae7139c5bdd6a8b68e8f1ee5 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 4e0c8fe98236bf4ada0a9336500e6eb2fbd37fe7..90866a7e8797c0594295643724b4ec295abe1d09 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 df05cf2a656bf8aa8ae7bb5607ad34e9fa90b548..d0be1f282344de27798efbc9ad5b50b93256d8c0 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 f4de40686263103fb13aff5bdfdaeb6681706d84..f4420557e5a6fdf6ee09bc4f1edd29882d3a1292 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 19fdb2007d32fdf6b14d06b6dd589ae7d3517d88..79dc781bb0aecd3b7cf0af29be3d1a8ba9370e6c 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 28ce76acf9defd959de72e35c1af41b6a29210c3..1da6b44c4a1d65dc9ab9377897bd7b8678df6253 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 7ef1c94d7a8e119723dbf3c940e0871e3977c09b..efb288cb10e29fa597b622b0782d7a94e6e884c9 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 adcbb59ffd57c31375ceab801cd3248a54ac6b3d..51081a97d5212ce5a9eacce2ec7731dfa4af4231 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 dc0b8bd1fa751b0463e81da00ad554993066aef9..c98c55ecb9e72843863a9a014f5694d224561e2d 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 0846bd1ceb39e700379655c677b39aecd144f0c3..8ef0caaf8c778b5b21b766d00bec941ff42efff3 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 a6ccce8b4ab16c76cf3af38df389d09238d754e8..01bf250cdf412a3c22db44069c84f4fc325dee64 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 42fa1fd0235ec26e3942b4c4a90a1170e73ec8dc..7e19fb1ab1ecc0fbf42047db39c570ca3e798b8b 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 13933ef70c8736d6b4a06211eba8877b24c2f5cc..ddff3a25299b41b6449de9af1fb9c77d3840f4f7 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 4220a747c9dad9bd649cef8948fee4688727d741..f6f6d8fedcc4954ba5138af8a587c7cc84492437 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 5dec751941e9d762280c40492cd83a4d676fa37c..375d3e2320127897236822b5670a53531160c638 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 055c17f5ff39438a2b9a66eb4e39b42b1bd46324..a772c1bc47aa880f7edfba4b748220a4f76397c4 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 4d501423052933e04970ba9eacac891d4e7ccc40..0fa6e68fe81fb45332bc2e3af351e8d76ea2b66d 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 a9b5612b21979e0914acc5d553137e48ac90a366..1c26d3d58ae463f6e99b4be137ad4fc3a6c6d8ca 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 a5b223b8e4ff8150fb91032a83564750136711d8..5d11450ed14aed9cb52993611cad51d7508ec1d7 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 d4d70ebe0f4fc053336268e2db63f4a896945a52..a4616435e4e40613cd17abf9fa42abcbe0d28019 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 36e37c02ea9ad22d63d8d7534550b03e62a1d045..e6bcf28897ac1353209fae7bf4fa9995222c8ed8 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 0d898463de45cb78eadf8029f495d9e6eba20e46..6c95518915f69360635f6e6f96eb8926eb9e6bfb 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 665038955ccd0f4abab86d66eee6a24f1a7b2273..8ac53fd55c653cedff3685b6d438180b3c6b1f01 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 0000000000000000000000000000000000000000..bf5d44842036fa757bcee76570e4192d542ac5ca --- /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 146a9d6b7f29ccaea3cea889f7424444bff7b024..c0089e2ee15a199166d60f5e71ad7d2a64d89e09 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 1edcb6dc8abb75d1eb27651c904b8cf7e7e28e94..d0f0e8f8e9d4a2c5d55e1b32d1da760bdc6b21d4 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 b6b8620e1e1c678d62dce577e3d8dcfc21e8f40c..5464fe6ec42e1e397bfde160c1a004e08c034f8e 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 82743bd4ee9a8db6f9d24f13d3fb24b112e1b8fb..f8eb4a9e97d05dcc911f908b10945f56791a33c5 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 208b96f10b20489b9877dc0a41f5fc9ea320b848..7eabca0122d5046660379762ae267b0108c03488 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 0a57e7066f4b50ed37480ddaaf1d36fea6141043..6c62e0aecd362779a78774b55c5ca2b9c721aa88 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 20f8e0db71c06db497c4462179b7b50ce193b0d4..fca33f531d1a49f4b813b535b64ab36c9c762621 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 f295f4415fddbf7cbdc4ff94ab17a5632b4a5d2d..38db0f5153ba518cd69a0230d3780cab73efcdbb 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 21493db48e161796d454921136b5f17bab850d15..457cd8a66c2e53e4cf99aa616975aaebe83533af 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 a2ec2aa9681d615ad0d2128e3a282f7ef1843860..1280eca8bfa944c76bead0c0640b1b90ccd84445 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 c2a4ed0d3faa356204576e1d86b4bfeaccf1cea1..2b5e77ee31edbeff958a98e3d573d94fa562455b 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 c5538659a790a9c3de286efd279394f8a349cbc7..8ce7183187705fadc44b2f38b41e2cde3eb1cf31 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 0000000000000000000000000000000000000000..70cd70b5516cc99841612ab5dd01315104376c1a --- /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 0000000000000000000000000000000000000000..2d597e85172acda61003a152d0f60bdbbe31f6f0 --- /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 ff5f86953bc08e370f5fa42162b0e3468256a075..bd4eb4424a5e9d74461072703a45c9573c68add8 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 8dc8a0cab646d425f9666cfffa162173fccf8d00..b0e1214e4f60947773c0659150576dccb4523958 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 958bfb9380d292dc247db5ba0ff79234950b56a7..262479304b43f46aad5b789ded752f6a7834dbe1 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 2e4e285401eec2730215a94bf186ab3f75ff3c34..8a9c70c2f031cd9352bd114bec5122ce12cd6f35 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 e00915646032222a3ab7115a1322faa851700316..5acac9c6598c25d6b3fb7d480c0f23bee04708df 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 a6e1a032d1a6b05f2e7944642871bc4a82e7fc12..15fcf0d959ba26c4d824087961ba9a00ff722959 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 9addea0dbc381ce273b1d7b1fcc75c0bb795dc3a..460663040f7731f9f7a0d3418b294de4d37999b3 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 0000000000000000000000000000000000000000..03174d2952454cb3cfaf4c6d6c89dbc18142dc47 --- /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 5239c3bfe57c4cc4cc342110672de4bdc3633b48..d5cbe354c0119b8b2dcdc19e052a5a2ad863943d 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 b9f3f0e5aa18ea5495a773df82a4d070ac9870b6..b237a46cfa29a02fbc22407bb3ef7b1e1e77d0bd 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 0000000000000000000000000000000000000000..c493b8542177bb874f9e4f99696fd0efbbe304d6 --- /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 65f2fa75337d29f822619b5b799d1bb3866d959e..9f6671a1b72d7bc0f3f95553d6a20a7deb97c372 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 d410bcf614a66984e61ee2b735ed8bc149d1094c..21a4937a9d461f3e83b111aa3a2b597ed9db80d9 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 95abc53d5f0912df81d61191f5ecb601504d41fb..f10b6eadae1be72c2640c0df2141d2a2d241923e 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 33fc9f2dc2f87368119d8089033fa41329cda166..4562eb2163014c44498b810f474d53ae21ec4c67 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 a170730d618f57362451017f8fc483a9df388d7a..f688ef6cd0a499ae2893d0f3972ca2af693bca40 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 d7d55e33a24ba838180cbd0330521704c0a95796..9495ab1e796aeb7e15db64475c572659afe76f37 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 94c2ba88f741307edeaf6f2178d292394ee52918..fa63547007bfdd9f013aa4b241ff9c41a2021eb9 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 747cae315161319777c6592785fc05ba313a1e42..83d9a2f3b30a2e084b5ef9facb5faaa41430503e 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 a42cd98b1d77075a8ccd7b25512aeb2029b1e76f..ce1056cfd661dcb045d1637582424ba42e8e52ac 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 74336eeea7cd1a8a12580c4dc76a0e77ff5fcdae..15c3df5d0ffc507701a707f804a979a1ac81842c 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 6afeb512d3041cc946be3e564f5849cf50ffb346..db1d9d21a97ff06991116fd72b975e8d093c7491 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 59c2b02907984899459c1dfb7a9e084502bc0da5..a064c18a09c5f070116a3ea17937748f50e2bc7e 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 61e93facc48d3f9f8003b463ffbe63f86c4bf5d0..5159af92dee65cca925fddaa44b942810b6a3bdd 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 0000000000000000000000000000000000000000..65ae89fad49c8a52768619a8743fff0215c24097 --- /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 9a30093906b542961f415ae59ac21115076febf5..fcd852ac5f705f52d259368f4ab6cb9ac116227f 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 8b568d45f27d7208bb25920fc5ce69517d09c278..49b19a5d883e6cf14c5007518c37794597605c76 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 c09f08e78d6c65fe3cc024d7889fd10d9d3d45b1..c3e4533928135c4cea858b5f0c785aff77c16706 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 1dd23ca9f5b10fd62b846431e146e329bf76fccf..0000000000000000000000000000000000000000 --- 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 bb1bdd437286d9e67720ae1d274b57bfd4f4f3c9..0000000000000000000000000000000000000000 --- 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 d37f368ee772630eaf1fbe811036121139a8ffe0..0000000000000000000000000000000000000000 --- 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 1ad491a445b1850fae4ef5792e0fd25028dc5937..0000000000000000000000000000000000000000 --- 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 95f032508e13d376b8f06597d48769869dd2e896..0000000000000000000000000000000000000000 --- 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 b41a7ede1c6d2cad81cf4a63727e163961da8fd8..0000000000000000000000000000000000000000 --- 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 1968d302e4a09e7905247c3e5ab650485a15ccd2..0000000000000000000000000000000000000000 --- 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 62886e5b155dd0319dfc98298834d85620d46f40..0000000000000000000000000000000000000000 --- 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 44005096b88ebe0ca1e088cbdea61d7a9935e94a..0000000000000000000000000000000000000000 --- 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 c795ca474dc95546723401a0d10e45386ab765a1..0000000000000000000000000000000000000000 --- 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 0127f813837aefb28d9b6abad015eae35d7ddca5..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..a87b1e8476dc58306c92d894861efff80ba26b96 --- /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 869871ab8d58dc5ae81e985c31bb89b76938ca7e..5ae97bedfd201ce1c5663e2e79b45ed8358a30c4 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 17f0118b461b0325d3e1758a7fbcf658802f9535..2a9ae971609649b65ed310eae476b4de1cb6492c 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 9a920200f54bf674c7ffb61db6bbaabb3fc5b34d..2ca8136a90ab209b0bd85257460aeb5e8c94b108 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 230728ed87af9befb94e82224c1097173eb071af..ab64703aa454a85496f07fb2483e48dcc590938f 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 b70b8d8e3fa5db60b4733211ca2aaf8281d14805..0e9f99f13fd0ca0b776161392db3155873e061ff 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 92dd2af573b66b867333b2e88ed54fdc4261bf11..6c8e30a5106f24a2a15974abeae157cb8513a606 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 8ab698c3416e7ef55f9a16ee42210be7ca4df1a2..d51c07bf5832f56a31bdf138560bc4496078d927 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 d5b79afb517f95de12a5f9ce282e1986eb3d20c5..89f053986364d9268ff16415c24c028c0a2529b4 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 c96f684a0cf56d2c3ac822ca6937c37135d6b394..50a3a64967221ff363f567be6b8bd4770b3462b8 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 4b87500e5c265ebc2dbd6c403d8571ea2f2425b2..c5e2fa8df9a2a778550e76f57217aa07c7e14cd1 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 cf2775f7e9e8bdb0c1b2411ddce455fdbb9c4d01..6d44c2cacfbc2f2920f58327258eecb0f1060e18 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 0000000000000000000000000000000000000000..9f2418eb54ebc3dd3d3db15ff9a7483525f421b5 --- /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 469865bb9f1f7fe5e02bfecde07c2da99988914e..1573f1b5d66c6a3898c9b5451d593f6c862e9e8c 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 747454accd3f1ceaaec06a1aafe06f13c40a383f..14c3a8c96eb0eeaeb9b55037302ee41c2a157ece 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 a1edaed6518f1e48e4394fe99c76ddaa664279c8..b3ecd97bb8f5a00cc1e4d13e85be599da61d1ee6 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 14703c9c3bc56bb4e8c3f7cab2d7b603c981c755..648d8e67dcfc9cc53f1fa1fbc12528127cee6009 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 dfa9dd0b38aebd3e50192cbda71f4e93a095f25f..5439877833c7d7c2657021c972668109d74d18a3 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 d7e9f322dac02e966fd0dd5736e15d8f4175e2c2..4875c5e1d60b725244dceaa1d36a1aaad47fdbdf 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 5b2d6f4f17c3fa2b57526b31f19b753b6366c56a..b199d400573ab1263808a1b4a9b3e67f9934f618 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 befe0f664c0a54ff17f6ff28b4b079599a66b159..c8cf050b3716296bd6b9036b16c7f8705667f7e0 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 b2cfc58945d8f2737ccf9937697756df3e9f17a4..09cf7c396405d94b2093a3976db86ebb7b294d62 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 8f7006b44d35f89bb10e9312c5236431f594645f..6d012f7bf1489f538845869f98fa088a1d11931f 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 3cfa27be14f216782dd8595691d2db411632e6e4..6218800cdadc2d7cf45d845c4a9e25c38b66e1b2 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 0b0f3291b61d0c876c13712d6657909dcc6b105b..abb958687d2a75ca186c5d946f7c732384cb87be 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 0000000000000000000000000000000000000000..ca6658ae826ee604d501121828092fa8f36e14ea --- /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 42ba54058d0a771d886225fa94e930207a31bff7..c6a192834249bc650f4d108e7b421b9871da8547 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 e40967effa8e0758ecd7ae1e10d4198021135015..41cc25c05ebbe25c4e61cdf0494a1364c465dfa4 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 68f8ce811fab1983e335fc5fd18f1c378e43bc5a..3a4fd7a2ee371c4fd4d857107cc24fd63985be0c 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 ff64b403b62829908c33776bd5b298772941b8de..0c2999b4b3d17c52a940d8212f503f5ad83a5f16 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 c8a429aa448eab83aff3421ce3808f755770fdc3..3a4fd7a2ee371c4fd4d857107cc24fd63985be0c 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 a72eb037793f521f0a276bfa5ac1c7045a15e534..0abd43d662ea1d558d56f22a9667184114aacc28 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 c1d41e2be0ff6de32d0547186c4e3de5ee74032b..e846ef8b4f442fec17616ecaff36f2d9f018f6d5 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 dc3bb8c003233785125f6f0fef8618e68728d108..0abd43d662ea1d558d56f22a9667184114aacc28 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 0000000000000000000000000000000000000000..5106ef04c815e1374587de0e53be2b3d433424d4 --- /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 9cab13fe4b8cb8a7e36f3d56f730ea36f5554590..684f1f5dca5397a843d84300be8510572b1c8df3 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 76b1b7f94eb9ec2a4378528698c93b15c7894931..2db218eee5695d0a2f3ff5c5f09f6dc3aa7471f4 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 242d0d90cf37bdbe33cc1fc5e7410eaa6ee6cb18..8d7d92ccedf1b869a95a882cc99cf1b6b0cea894 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 165c4887a9c53b19424f738625995d5a2cfef120..d812ed31ae1b7c8202e06e72c37c58f12e56f32c 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 d6fe4809f2be3de48fb7ad941a606711df037d2e..447255c73b56c1ff6aadefc011b8ecd6f45c912e 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 3a7af3478c36dfdad0a1cfabfb3e3392d38e844e..1147945ddc759eac1c57bddfb5c538af48916e40 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 d750cd77df5dec3f6d33e7104426469c98cfcfde..8ac15eae415574b4ed80050985c33df2cbf52e11 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 82366aead37eca150f30ae4bd9301b0ed9392f3b..8ac15eae415574b4ed80050985c33df2cbf52e11 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 2e04ae6ee6cf224dcb4aca0d063b9756ef8206b5..f4c0050bc231ed6ad0074afe978dd2b3d4045fb0 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 ec0bfa722f7514afede25d4205e34d9730a119b7..8cede9c8332dded8c15b15c7ec39da9554088e63 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 8bb7fc4eac60804cfff4939931c0aae12cbece0c..8cefb973f327a517674ce61388d039faba2c2c83 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 58a16bc4fa20378eb5452e34b618752d77dc9e6c..34b572a637b90f5d5e3e76a0900b6263d58a305c 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 c84f26c042054946e32c1566224510cc8759fca2..299c6e6fe246ebbfe5e43658ba344988876bfd96 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 b51304a8eb8259cb9b6381a66aa40246d2c8809c..f74dd4dbe7d653ccb17b8e5defee4758eda897b7 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 e4dc918d78b4a6cefe0c065330b3c140b2f6633b..202c7b2d1c7b420b268c6c9f51ee6be999b1ff77 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 12bd746b4c93c6cf88df53a245551ea8c73fedc6..0ec548d4e41b9e043341395059f1906223d9b85e 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 5161b07ebe05ed1e9c3564478c354666b784a22a..c73de9efaee0e53f32f18a6fb44791883cfad19f 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 9a4836e1c936fe7facea81f98e49c409b0f85347..5dafcd48a6cddc47e403aa44f77c7e38f8b13f02 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 129d2c250272b01b5856cad9e2e1bdb82de7b45a..adf3e77ad674e428d4d39ac1eb72f11e70a05c14 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 bf8c40301555f75b5833737a0560399ec3d6c6e4..36e9ab9f4a591f2ab20d6326f7d07262c0a7b812 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 0000000000000000000000000000000000000000..5b71c4fef72e202e6ff1ce3b99c80f9af42bd3bb --- /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 8df4eb25e23563404d0fdc521d1a52ac85b12a81..3b00a259d15ec992bd206ef9ed9ab0eccc469c0d 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 93c414fd9df692798bcec8cce1bd26e165062c97..8ed5d67e712fa7672649bd528433991f00e64843 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 fa0935bb3e2c3cbcc901f2fb6b6fb27db506aca8..dfbf58c9e7afc022b80a88f6ac7e40b5c1bff644 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 a8d3ceb6279552f2b5391d790c6aa1106978172b..ee06566961a1dfd6d1f521e000676fb8a7d1fd35 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 ec04beb47275d9a65740a8d2662478694dba3163..c41c7ffd4adc0f54e4f48f2c942cf8055279fc5e 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 ded3ea37a8bfcba04d3737acaf45bd9e2cba9277..7c9f7dfa3940be742b77700de57fe8820adc7ae3 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 34e034e0220b6eb947d1183b309887d1c607ac05..e1ceb53671716a989ce5e32ae8eb6b8c395dc283 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 0000000000000000000000000000000000000000..4a7e38c3a501e91052eadcc0b5b03e3346c45e03 --- /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 7102a6805b516613e763c9d4586dfc8e59813f60..c7321bf029fb5eb86abf02d07c4b881eb6de1c88 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 b99a41229d135b918ff091d0a46c537a1689cd2a..83e1e8782e0ea8f6cd1035373cd32c2cfd06eae5 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 abd79c793bb539a47effbf6a56468f2302c6cae9..abdb49f38e5af05c4a5550aeca5a745cb4279d19 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 7e36121993a1534f4f8e29029b00a049c98e7cbc..0385f0bc402d4810e681e8f5a4d6858ed4fb1c93 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 0e7f37f036281efa6f0a49a3706afafef9301175..afe3628f88709b102e33f4be8bb9e213d8d42300 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 bfab978fab17d36eb1b7dd21ef1ad33592f2d5ce..12d4b2466a307af6eb4575b308f2ec8b0740927b 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 7224aa1439d380763042c1638f58b44de157ff74..59ca335157a6e96e8dbf32c1fe0f9cebab194aa4 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 4fd2608d92f74480ca1f54fab25e438fca69720b..20cd583b0855b742dfe33f15102c4a70f90ecf26 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 e965e1b281f18642e70e6070ab6856294386682f..83b462597d300e14ca958a7cfc4303b8a4e6e875 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 b4c6b93c35001ab49b1570f87223d0721028e077..5e59d7df117e480944e8a0da0021356761de9d15 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 900a724e08c42cf54729e2c5db90b6676803e1b5..6d26213988ca3c9c832e559827f62cd9a6805255 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 3a43e6854407350bde4bc3e04dbf74db54f4f93f..3f6fa04683c76bc44e495dc44d6b6aa0270e8af2 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 6131f9f04469c0621e5e8975dcf99124b2a62b21..2fc9c35e22448f10802e23eecb0c71ec706278f5 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 749293f3d3b7d44b99f4296a4010dfd52df26691..7c3e7d82dbb705aa98b8b6ac4f100ce107281fc6 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 2f0187ea7dd61975498ac37fa6e34594ac694e42..ea1a2c210995e172339663420e73749fa384e985 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 58f28d107750c8724a6c8da4002c7cb323bf5125..88f998d1d21fa377e4070ffec951a84b27135321 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 763f210043ce04f6ac5789caed6b39e353f6d0ac..4fbf0a095698aac6c48359b4d7a950e14f862e81 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 cfa2c04f78b3091bd43ffa3f7de7c1d8c7be5752..ff892f85f5917d16f58a26dc64733cc0d0075e96 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 ce738275119a5458b24ad29ecf7dec57aecf062f..d2a2f60c3e0775e87d6c48a53e93ebdb11480166 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 e135af8641e0e3a6d7bdfb0cb07e5f403d70f0b0..e1c4359dbf6f11443aeac2d58f3a6aa197ec7b20 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 79774eb30875dcdefdfd44df6dd5fca530d2dd9b..66d5cbffd2bdf63eac923f0b4c122e531b5d3f1c 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 9096e98fddcdf3ef4cbcc38dc1691eda7f22884e..d3dfe268480795d96bc0fa4aa632f6450aabb892 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 d82a1daebe57c9dcf68524bbbe3741f3f82a754c..697c4ce88015a0a8862eaa70642f57b16dffc3fb 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 0edca3ce0b9fe8706ae815d89647888e70d9648c..348c48029df21802ef688b07c5af8f59ddb66601 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 13a50a9c432cc1808149070f36c83331b575d44a..e09e442f1f7c10b6416ac75f8c83a85376e5a57a 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 61fe7a91ef9bb58bb89a80eb58bd792f324de405..f1cd3e161a57e724bd2a982c62fff2c9edf09d56 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 168c4ddb79516e048a717febe548520cef790733..e2bd1b296517db342f5072ad727a80066d810ea3 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 a12cb9ec3b357dc889025194474ccf420d6127b2..59b14f98c35e676fc1d4d83a67c96d87ae4ca4ec 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 0000000000000000000000000000000000000000..5f1fa0ef8b5956f7cb2ca0b2770c6321a2a9b618 --- /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 91e9c147b139b334e3251c20582503e3efd36583..d5dbb3841b02a3f70082af867e52d420581d54fb 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 36d3eae0f0f7547fd41198b7d63e364908357419..28082a107b49ee1f55b50429c7e536c5919d4bed 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 20442ea314081d6d18fd0cf68120cdda61902566..15f9ef2d9e5390f75e5d4f95a080bf2abc9cbd47 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 0eb79578e40dda86d79ce69b24bdcdc6a5477ebe..086f470878203344fa6adc213305bea7ef02949d 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 9093b37040432a5f1e3cd3d22cebfe85bccb816a..0b65274f462afb2c74ad1c6c758c6117961ea0c1 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 3d735d4fecf96abdd5993f492503730d534bdcaf..ee81d2f1fd547c629f4a78bf2bb32c00e7a519c2 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 11ff51bae7fe63f2454ec245f4baf29766c91873..460f70256dfb681ca6e5d564943e14b75b4a0ae4 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 125e058b82fc27fc4447f82cae252fa6a0cc867e..be51800c3cca78b3504f251a7c995d88c1d137e4 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 948e627b4521ada5e0b10900e5053ef3c80eca8e..4832ea1604f857e4fe6584e04b6b73fb8d2595b3 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 8b875fec3c2c76d0218f5850f925ff7b64875d1d..e526965c14bad8479f9e6dceafb179600c4493cd 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 fd9731b7a372939eb914e145052a463f91957784..8d41209b1003eddd40f92d0873436fd6e5bd4767 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 ff12ccdb39d353d22acf199ed0e3eb90621be02c..baae67bfea353238746db75edd274aef86b5dccd 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 028083d2091527498cc4a784066443c09fc51a5e..a133df2e9a7f0f1fd4af0885b4466d71ca4f8e14 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 a8af83e39661e72de29916c833637f2683e76517..e1d9c827e9320c3f29b8b01377e80eb25d356ac4 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 74c99bc2b021b6239c7176d234e3a6fc7cb8f908..e7d01f355a0ed7e8c3e91ac0810db1679103034c 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 c9b3c3dd228cbd70fac75fda701215cb474e6c09..89fe6aa71f0b8893a8717617a266352c5ea6accd 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 a5a1d6d97dace30c74d0fd485036d238a64a6452..fb11d85006ebd504dfe6bd4105d07cc86de01bd1 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 1ca20c876af1d340481a7edbe91a9e0a3540408d..0fb69339a3ed25a15537ff617c651626fb90e229 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 bef1f64cc68f5bae00b4321f1791c30335695605..ad6d71da074aa4601481e100a732edb56c37821f 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 206d1e853b3e729f3b77be78756b2212dde3094e..65eca5ac25feace77cc45565e5a7aa9c3f0c1a57 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 244db3b4843aa0fba88f2589b8748c5d12c07ff4..7cef22b6c457f6e78d480a0270be89b8b875f38c 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 bc422dd897fd49c6469d3ab32fc8555f2774f454..483fcf55d56ee7617f63269fad47aa5d65b5de45 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 0ca941a869e5f8e00d3b7a8e701d298de57e95b7..26800320ee74c86a0a1c6afb1026e760e66712b5 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 2c3df77fc7e80036e64dcdbc9f321f81fa2b2de2..ff1495acf1f69f9b30b3b199688a20987b0628bb 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 7df3af5060791495745d06e4230611804bddd6b0..9ec6691978c4e51895bbee2902ebd8e602c3a7de 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 e9f1682cde31252255bc09deea316384eb7ba9f7..4804aed2ab7a308241a26499eb675219d026176d 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 c246af7a129c66b2d47fb61682e13827214f9985..4ab3b665ee1af5ffbd2262c04904bc0a8bd60928 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 b48bbb83697af06818a259a61e65e76c55400a0d..e3d20d51e694cc2bb4572a29737a4f3687f0dfe0 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 ddde2494e29e6215ce6d34aeddbaa3cbe153bf6a..3bdaf1b391c3da5f0f20cff727e8dcef1e36281f 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 57be56d1936123bc9b044d5f2aad1b43353f0879..fa41d0ee6117062f1a8a849a4032b264fc3698c2 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 f4266eab8eda9d34668edfdaff8623e16ed0dcc2..2b51b67e6a33e165809cf5301bddf88faa401078 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 816ad80e9be791cb87978598184ca5bbb75e858b..d9775f02ef3a5593595e72288092fa0e8400dbd7 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 6900e63f006aedf5b39b851e89890cffb2072fb6..691930054943edea3cb448631a1dce8620e221fd 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 0f3314c01b1d4f3802b2925f782394c9a0b453c1..4cec475d06e6d1588b25148de7b656d7c6e7cead 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 63b6b58d0c3a85e22751b7efb1d6df2fa52c8bdb..8c8c7142889c43c554db78cb1ed3df01b589afeb 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 0000000000000000000000000000000000000000..30c616b056b74cf26fa096f7fd05897f0ec6434e --- /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 27dce03336e00c8d525e7449f4bbed37a3629e87..6f44077195efa39ff3fe651bea3135114f422b56 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 0000000000000000000000000000000000000000..8bc03ece9af7f01d9dff127d95e23f5f6ee3a44e --- /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 75df863046af48ca937d5793fa839ab6410de6bf..9d08f3e45c1bebd96ccd96e34c4c910b926e15ea 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 b23a66184522176ff7e43db1aea15ac09571790d..bc96a6d62a2f3e3f6dadad905fed4fd0d1ab6e04 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 61a16e2a6c02c0679db5ac999f42c67885d294e0..8329c8fef99e78ac89c1521d0bbc6a0d44bea20a 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 cc6c7279f2d909dc1599bd54e0ba7f1f4830d492..e1ce4bb991a05ef22c53cd54de6d8c093ca020f2 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 0652e5fc5b17b7cb73076dbbac002adb1149a8ee..4dbc9e72d5a7d71e1a486906eef6a72a3cb0d3a1 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 6644a2b938a91b11038e338ded1fb9de34fc30f5..10aeb0df0e3fad48272ab40ae1b7735c537e6a21 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 1a9b5b3d97187c646097d9236c47fa710d53e38e..67ec4f52584d0b8e2a0456a84aba2a049d906f3d 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 45d9a961678079bcb36c7b74f6561bc1335dbffc..171aa7b00dda7d9efb5a3fb33379c79283f46c78 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 e86ad5868cbe4a9b2a864ef02292a2824ae0745a..58dce11ff25ee77c8edd3a1e289bc289d58fcf8d 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 fb815405984721287bc3f4b44315c36c3637a8fa..1be19d8656e938610734feed5941f5cd4ee76982 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 7fba79bb64486dbe0bd02d593846fd40e35f7bc9..e93a2c3658693f43090f04fb6633347429b52c9f 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 7929bdb736c32b8bc5a1e5928aef5d459acbd28a..a6cebc9def5376ba3365f4e7dabb514230c15bba 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 6972c90799a839032d667037db7d4657fb906f20..e0d6c92995b1bfa924416b3ec561a544a0e0a1b4 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 e2ce5fa841df49f2b71376e70b9afda2a5ebe436..37694a8ad230d836c10c589bdec80ad5b04f0ba9 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 0000000000000000000000000000000000000000..b1d01f3ede90e77ad060e93efcfeb6e2ccf52bef --- /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 2d9ce41279962ec9d6fcde97caaca73841f18e04..99ad2b98d253203fff48af116f4d8624b144b872 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 6092263c4820ef175ad8a386e6d55086ba7c4c31..ab2be5435ad97716e750ee3affcfb5950da337d8 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 2d689a2a65cf7cff5e3e7d35de9783451916b464..b326d47dc3a3222f4ac1e3727d5faea75f447dd0 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 386746ad9ec38f301132d5c3210f6bb378217dae..a988190ece65ebb5501278ca6d8cdcc91116f400 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 39937c74840af7e06ce6c249602035f0923c120c..142afb7de443793b1e0a8537b31e2b3d59258e49 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 162236a6cafcd361f58a89b2b58b19087b11de5c..7b611066e3f277f3f4aa9fabe5a5b8c3caf6db79 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 f87023a891c784b951d7c1c0f9c4482d73e71b97..0387cedd83dc9a1582d74ad4a64a5ec4a6a982da 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 eb2e6b5fd1e1dec24e17f1a8b095b9e3fc9afc34..51b4048d2ac8836dc487e0ab7b4ad1b6190e7ed5 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 a24b37e1a857b65148453e22ec8bbeceaedef7f9..570c2f364ad5eef13581ceba211d70bc2f148c03 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 debcaee5f782a03581ebfbe89fa176a932bab76e..72812182fb47cecdcb56cb886f3df7c45f94d591 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 b8a9d8f80bb62b2dd857ce6a34ac5117c623dd23..6e6e1aee7033a04158e2d7279168ae1e6561e660 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 0000000000000000000000000000000000000000..b9f93409d72bd44e1769265c0417a408f1f70c1e --- /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 b97da01e738bd9c91501fcfe66ead332c8d2e8e2..f8be6127628eec359e603b9009483f1eac255956 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 7762d5fe86ad445ccea95ec7e18885dc2d560144..1a6ffddf0f3be41c10d8f5ca137afee40dcfdadf 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 c21947dd5ba38b7b6b19a7b7ad0ad896ecc8a143..8db19daa41726f1f828be03cea2f5f6414659d3e 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 d05254c5799af6bf499895b43a6dcf846ee1b4e4..dbabbcd5dc276d3dc95d6ebaa98e32e241776e1c 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 d4d85e5208df5491885efc47bb02780716683f9c..3f773c1da5d6fbdffa9162ab83d154f319282767 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 39ec5567ab51a990ccbc46023cef8b72ab319721..2d0aa22e2337d4addde374e0145edc857854143e 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 9bdee8c52103346e3407c181fb15fb41edee6ad5..1f6cd54e6d790b5f112b33512b3a1cf55689ad62 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 106ec277361b608a19125ffb86cf6e409e7064df..0a51ab94b1e4faf52c48c5bd580a714cee26adf6 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 dae3c2899b983ab69c61822d909a89594e2f123b..0ffbbd94aec03d39b9ab9725e1f046cfe04489f6 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 45ba766ba590aff8b00cbce7e63946fe395d0183..514bc462ac886318540f5f62f75961ce55805a48 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 e914e73f8a6a8b80e689e71318bcbf012401ebd8..f692b972451526c5eff553384558d95629b8b9e3 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 d6192ce289e2cff92497586233c7791bdb0eb827..e728403ddd5fd8d97f8927c1395edce0cbda76c2 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 8e04f804ec8f1c11961e2c2be991e55550d73c4c..f55648e3aeea32a1b55dfde24c2f09b6a0d9c10e 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 1c36cb247ad7f93c5a78294018909b34ce9faef2..e52b8e8429ac567f8842644aadf00fc9993d290a 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 360ef83ef08319ca6aa0520d6db20a45ac350f6e..ad4eca6deac5ff45278ebb693809ed8075f1c2ba 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 9fe0ef8cf3037ee6b7a02ea4d5b9e9f0183adf81..a0674c1a492540aeaa9ac99cb3096f2aa46ec1f3 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 bd539d435e586ae75f37d296cc490bb401c3ba9f..a52552ff97bf9c824cb8240087286ee32c8c7bb8 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 5039cad7d0a94b8c1aa700b8a6488c56b8542235..52a7d61f4c43fde2c9b0ca67659ecd01c4279742 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 8b473e23c75658a73b4acc8c460a1315f34f8255..5d5bd9f71e73307287b9b6df648d328085526e39 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 be0038f57e5ff87e98c51f4dbcc582f91067c060..d638f0bb903284f53d86395db5d9d7c4818ef18a 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 4401a16baae10c97714c1b138173e32d1e420f7e..2947bb6f689b192082e0eb1528916eba00095137 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 02d24b18ac8afbd9104bcf4d551cc1941304f024..f44987f63d3aaa72c25c713a51c59de4a6517546 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 cdd7ba090c9c2ff1d112472074615c2f53d29f36..0acbe76248f4b3216ebfc7be575ee0c7c7947788 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 e3f3630fa507b08e5d4fde72919c86749acd9f21..59ae5684536062d18d21aa4674a1de5c34a6593c 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 a0016fef01abf5bbc73b1e5236ec533864021723..7965073a56fb1d54b3b2a2329ff6cd60b5cc2aea 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 e6afc097fcb43650c6b2077bc61291ad6c23fdda..baf5f2d8391c7f9ec80d56ee3fc1253a5ee57811 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 91c6bd25a01e0b1c23bc16a7cb8ad88a788a010b..e86dc99138ff6bf2203603a5a1ec70282997479e 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 5511ff2db5d60f8ded85ce921f5a9b1e07b8fca1..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 c1262ad6aed67db5f006b5aab388dbbe03aa301a..b0dd14215ba2afa73d6111e3aa5e72c67a1f08bf 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 ffda63b67f3bccb9922b6ba5077e3e0f1c48541c..538aa8db1f503db6a72b425969bc8685569d9d7d 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 7ed767417f843769f74d4fdd4f87dd54a09b9876..5514a660d280a55ddd2245e809b8a829c01d47bf 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 62a51932241a3295ec2c3462e4fc3ffe2182bd15..ab7451657753f0deb093234b318a74e29243bb2b 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 617a7193877bc6f2b25ee0709b1ba1f4d7cb452e..db300cc8c67f27dd56d4b3b2f5ab5e1ea3d4f3d9 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 c120000ba683903e425e86911fe345ad2f1f4267..fcd359088d1d5a61b0e6b8f310f244b419b26136 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 6f190c773c9129f07cb67258af9fc91266808938..2d3ab568ec3e72fe69b31a18db3b53fa43238102 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 0568968baf01dca5fb377acb5e62105ccc675403..b0b5ac85af5dedb303460e2540d56db78c50e0b4 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 99e2f17b763c0eafa58d93bf63ff6f1f3faa3992..426803cf14f815ffcd0c707448061d3c02a0780c 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 6e819be1005d944f3bbdad270f91efc9cdc54bb0..b91458225084173b1dd3e4c52a1ef9d0816d2759 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 dd6ef9edd81b5c94c59c88535642286c1cc33bb1..2f43f664a69f475e715b57f3ecb390bad1bd9cce 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 0000000000000000000000000000000000000000..88467e786b48442399d9ca00f7425484b8c12702 --- /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 0000000000000000000000000000000000000000..6084f7595ea6f5570dd918c4cea67d10e7261af9 --- /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 95dff1a4b3fe4992fcd3d5ae1dd74882e7631e42..de3980ceb3694fda74505879d9564ac4aaa607ac 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 8a497d5df2d2cedb6e7a0aeb6f8328a43e7d9aad..99cb001b740245071b13216dce1bf2e0d7eb7f42 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 c61719c3ff9463904a2e4795e11c8583da01d643..c9abccaf0506db1018eb74ebd7484f1b484760c6 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 0000000000000000000000000000000000000000..160e8839ec5271084368be2d7c99c73e404a7225 --- /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 42e01875c09660b5c5fa27b333345083914ee6ec..3ecfd263a3848028c0541637e14327a5e3632617 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 f3dd8107d6d077b833f7f1ed555a4a4f28c7f463..71bdc537d385bf52d31ba14d04b9d92b50b4b75e 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 0000000000000000000000000000000000000000..c43dbb709ed1706cdb772612512253091cb251ac --- /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 9b7e5c54053daeffab8322373784be68fc50f505..ac1e45a25aa2fda40d32853c52ae199ecd690f2e 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 0000000000000000000000000000000000000000..919b2556f1d1333525fe0c1cdc5031c698b5f3a2 --- /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 7e1de16116fe304560fdc0655f1bb87be44c8fc3..acbb68584c9032e9ae708aa22521ece5e6b679ac 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 f983ab287d73e89f786c8ce0bf3d36ce3b194a60..5dd122210dc5841cce88dce129f9d9802910c9da 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 cb0c609ef628afcf7cbe8f9fc7d8d2f16d7d12b7..9fe95fd9470434a2921cc428a5f1d0a7506e92b7 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 0000000000000000000000000000000000000000..5e63a788204c5750ea95cf74676f3c0bfe00fa23 --- /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 25591391f211e8f339126acc918e9c14236b8ea5..9587b2ff326b7abd75bd7eb78e7c57a19f49019b 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 0000000000000000000000000000000000000000..b119c1ce8ecf6cfd19bb40c93d4efde115406584 --- /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 b2493aded84f2086e6e4165411f4cf184050ec82..c74bf1efc2961f98b7c5b0790192fe2df3a7865a 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 cfbc85f772e79d3a2a2fa0072fb96123824f8d72..2fa29d65b4ccfd8fb6c3888923f974c64dcc3ac4 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 1db177a0da5c317600159110a5adfcf2e0ec2903..9bcabcd4004216fb7ef8fb871d083d011cb6204e 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 fe98d887a66028503ae0b29d8e8849da8dc49039..1e4ff4df641c451350cab11672d1bb0800c9c498 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 e1c81f393e71d7e270e642f3a17924eb6db819f7..415eecd38d18eb3c4865291e18e52a1c2bc8afc5 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 0000000000000000000000000000000000000000..211c497882b6a103265227b1469f3e751588148f --- /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 0000000000000000000000000000000000000000..c59d80ba863146550dca6b8a4c3dcae1b760422f --- /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 0000000000000000000000000000000000000000..fa3b3e4e670e89d4b0cd7833483bcc65df87d2b3 --- /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 9618af49ce0060e193ddab3a56e4cc2f717e3ed9..be42c0ce0c8a076fc9e50f755e505ece55fca905 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 cd4a812be3748e189544cfd1bbb1437d36bb441e..0c51597d8a3d7c06ff0d6b9dcadc149e152c0984 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 0000000000000000000000000000000000000000..3b5e2c03ae27c2ed7c5d9fa335fc7414feddc038 --- /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 5cb725070f61c446a4158ee947c31773c8b4ea28..470eafe25a241246de16e2562c57575efb1aaa4a 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 0000000000000000000000000000000000000000..b95e8ce5013350959945c3cce0abce0894311879 --- /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 0000000000000000000000000000000000000000..7fa2bdb7b5933cabeb45ada49586f87f0c3827ab --- /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 0000000000000000000000000000000000000000..0b74bb3978f2da11efe1ad284343a3f813314eda --- /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 f44b4fa9e819863ccef78e1b7c30cfb15c9011af..0ef9e4c454e3f71ca668447de014ce5e358cc159 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 0000000000000000000000000000000000000000..e0ac7ce426e7c10aef87781e9b9c5bbb078a8475 --- /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 0082acde99e91d935ac01cbc868c4270f99bc422..0afcc479a7717fbadfc3c3f9bd57bdbf9fe487b5 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 d91fa6040c3817a11a816be8a3916d3134013fd4..7edcb2693b7336a7da93feb41688dda5047d3b5a 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 0000000000000000000000000000000000000000..b360dfb9e65c091f64656d27c81b1489a1f10c19 --- /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 e661706b1e726355efcdf17732841f9cbbfcac42..79c1494f7cc4f5d4a89c82771d98e6c648a64730 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 d8484e97dfc093ba05ffa5f779be4ae73c710fa9..05c3a7da0e2d411967f82590051f5c7a9d66e98a 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 0000000000000000000000000000000000000000..25b2a9eab9025da98c873747b6070f2c0c2549f6 --- /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 adf75d91c8efb942e071d5308af563ae22ae9a8b..a5e18be842269f7a6355522e5bca612d99cb8619 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 0000000000000000000000000000000000000000..716f6953c985f1f86f0f3f0141e5394eaa4b26f4 --- /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 29e0f6bbfe238e8368740f982169c4746214139c..5cdd57b3d0ced88ceddaf017053cda68b3029731 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 0000000000000000000000000000000000000000..8f4404c5ac1da73e23fec45182e0dcb87fbef5f7 --- /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 0000000000000000000000000000000000000000..3ace2f5a707183a3e573b1ba800eb26dbf6dde6e --- /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 13010e23213abd949a564f745802ab0ebae807e3..9ea8f5f6d42f01b65eda158c15c868e8859ba944 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 cc30b8872c90bd9f813a3ea4f7ca1b13c40e1263..a96c443bb399127666db24b9090c45e145e1f3f8 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 57fc40a725d6f5995ed2b9c4cb2e8d6eea368483..94af916168c4d6417f590498cf8840e4a1cff418 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 0000000000000000000000000000000000000000..11f782c741666d3a45aa6339853d9047f0b31681 --- /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 fcd852ac5f705f52d259368f4ab6cb9ac116227f..67b7a5379ddc395bd75160abc01e85e9e494576c 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 3b7c0b011b566a534b9cc62a78f9860098c7dc6d..13c77ee6f034795bbf3bb7765d3c7846f79a7702 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 0000000000000000000000000000000000000000..dd738941884275154164e284b1504b7ef4196d0f --- /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 0000000000000000000000000000000000000000..b58a97130dd0e8b35e06aefb3fe1134842ce95d7 --- /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 1abdcc25f338f44cc37a8c83a0e1ae2d972948f5..efdf4a64b8ed8217301e8375002945eae451bcab 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 e40967effa8e0758ecd7ae1e10d4198021135015..41cc25c05ebbe25c4e61cdf0494a1364c465dfa4 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 2d6206809a423847fde23e6a8489c8b9c4e2d253..679ab1fc53927fc426fc0abf6490183a3a9cab1b 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 c8a142b6b66a4d33ef84c219d549ff5968e1fbfc..5bd6aff888accf2c980ef4fbb0487028114e5708 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 2dbd4cc55ec90c1d6e5ee9273cf9941744cba78c..679ab1fc53927fc426fc0abf6490183a3a9cab1b 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 b0bd45e752744e4b7acf0a6df0e5240c162ecf50..5cced7b711b40a37b67995b6ee6af789d5561778 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 5f48316a8c43a165446fb5309b4dc50853bf167a..0a7d40e6e3983d4495b37ac19386ccce8b0fa342 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 69c7a612956cfff45ec076d8b8695b44d902a13a..5cced7b711b40a37b67995b6ee6af789d5561778 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 b71402b7c930e8171bb0f08e4fcd12935813b4bb..8f74e4d8ddea3c6c18d234235276f98dfb50bf82 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 1147945ddc759eac1c57bddfb5c538af48916e40..3a7af3478c36dfdad0a1cfabfb3e3392d38e844e 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 8ac15eae415574b4ed80050985c33df2cbf52e11..d750cd77df5dec3f6d33e7104426469c98cfcfde 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 8ac15eae415574b4ed80050985c33df2cbf52e11..82366aead37eca150f30ae4bd9301b0ed9392f3b 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 0000000000000000000000000000000000000000..2e04ae6ee6cf224dcb4aca0d063b9756ef8206b5 --- /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 9ce5ee378a6d39640307573ad4cf5136544f2008..ec0bfa722f7514afede25d4205e34d9730a119b7 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 100a5cee1c5023a3c9d05d41c5088f55fe7699d5..8bb7fc4eac60804cfff4939931c0aae12cbece0c 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 0000000000000000000000000000000000000000..58a16bc4fa20378eb5452e34b618752d77dc9e6c --- /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 0000000000000000000000000000000000000000..c84f26c042054946e32c1566224510cc8759fca2 --- /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 0000000000000000000000000000000000000000..b51304a8eb8259cb9b6381a66aa40246d2c8809c --- /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 0000000000000000000000000000000000000000..e4dc918d78b4a6cefe0c065330b3c140b2f6633b --- /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 ac9b3b3ed59b79d70554a3c41885a3998b75aedd..a2a84f9f112d6f533f4468ed411c9da173b613b7 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 0eb79578e40dda86d79ce69b24bdcdc6a5477ebe..086f470878203344fa6adc213305bea7ef02949d 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 9093b37040432a5f1e3cd3d22cebfe85bccb816a..0b65274f462afb2c74ad1c6c758c6117961ea0c1 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 7350fc373ea1d504851aa71e857c4b213a8d3d7f..7ea035f98dab8cd75f5f710878d945587450c48a 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 93e1dfe0713aff6d51ffcf50dc752a86b7fb790c..4e00ef875dcb99e4a97094bd9aee2a0001aa5a0c 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 ec42d71fb15148e50b6c2857d1b15d04b45aa9aa..af7fc72ac5426984214a3badbe5d8e3f23b1fa7a 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 948e627b4521ada5e0b10900e5053ef3c80eca8e..4832ea1604f857e4fe6584e04b6b73fb8d2595b3 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 70dc1029c0a6c1d6757998abd4f028aa9b4b45ad..c50c9379fff5c396d5d9080690264124566bc2da 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 fd9731b7a372939eb914e145052a463f91957784..8d41209b1003eddd40f92d0873436fd6e5bd4767 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 c2fb543c5533042eed500fefc750cb765e92190a..e4ccd347f3281d959c79ede56480ad6a3df54f19 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 76c4e6475afd879b53f738005ea59799e0086ec0..d7fc7d72bf8497d9eab7ede58b2a9104484d9b0d 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 489ba2241c64d248e4b75cf981e6bc7092abb0c8..b5ec83caafc810cdedd1b1b550ea4a7f06b99fc0 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 818d84ca64a1e268a61e1822b462eb500ca3648b..66526bbbd786e77bfd0830bc5eb1e716e43fb7b1 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 c9b3c3dd228cbd70fac75fda701215cb474e6c09..89fe6aa71f0b8893a8717617a266352c5ea6accd 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 a5a1d6d97dace30c74d0fd485036d238a64a6452..fb11d85006ebd504dfe6bd4105d07cc86de01bd1 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 1ca20c876af1d340481a7edbe91a9e0a3540408d..0fb69339a3ed25a15537ff617c651626fb90e229 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 42d410a682ab6f9a8f8a22b0a2a12012ddb5cb4a..1b244284c3b745a5a957563fc446834cdf83bd8e 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 a5148446939ecc81f8af09033fb94882c0e10772..33570010113211f035655fe5c9aa01b87ea89f03 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 244db3b4843aa0fba88f2589b8748c5d12c07ff4..7cef22b6c457f6e78d480a0270be89b8b875f38c 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 247e96bd3b79366edd503e0f8148dbf1b9e901d3..cdac844a115cd9603c2f8ce723003241f58ef770 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 335d82932301cdd628f2b62273f255b8587256e7..4621652be32ad439a569a18035680a6fc8cf5b83 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 6b30b48bda54d19c82da87fecc17d31450671ee7..f6b60f60528790da927697886668781885c96f78 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 e9f1682cde31252255bc09deea316384eb7ba9f7..4804aed2ab7a308241a26499eb675219d026176d 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 c246af7a129c66b2d47fb61682e13827214f9985..4ab3b665ee1af5ffbd2262c04904bc0a8bd60928 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 b48bbb83697af06818a259a61e65e76c55400a0d..e3d20d51e694cc2bb4572a29737a4f3687f0dfe0 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 4d1d1ab35bf2537b7baad57192274d2d768b2b74..aa583d3e525b87557d5e995ba45eb41645d65a1e 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 57be56d1936123bc9b044d5f2aad1b43353f0879..fa41d0ee6117062f1a8a849a4032b264fc3698c2 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 f4266eab8eda9d34668edfdaff8623e16ed0dcc2..2b51b67e6a33e165809cf5301bddf88faa401078 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 816ad80e9be791cb87978598184ca5bbb75e858b..d9775f02ef3a5593595e72288092fa0e8400dbd7 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 6900e63f006aedf5b39b851e89890cffb2072fb6..da3289c27bad1c608378f6300e5466e4be0d173a 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 0b79afbd5dec1e917e14c0ff1ec587f98ac6aa1c..08efe39a154472bef40990e2063bdf2c3e026b92 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 e242ea902160775ecc1f903c76246eb018009165..57bd7abb51ee061c69b67c0d1b8947423ac5bc9d 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 1a5b92add28f624575b9263e906538773f468ca0..8cca098f602e49304ecfd4344d54ac1233c62b1d 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 0000000000000000000000000000000000000000..4b3d8c79abefaa4b8617f4193d791d026f6b2cab --- /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 0000000000000000000000000000000000000000..35ca825cc58f6750d9edaf8845887d3ed9c8c15f --- /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 a5681f4bdf3a54b4c2b8cc8c8fea2cbb2ac802a9..fca1301056150f34c953c531809fe6b5ad77d466 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 5d5bd9f71e73307287b9b6df648d328085526e39..b501eb0d40bcf09d4e074a05a024fe352ddad184 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 275b996e650b2592f0a918e5f351a5a360dada6f..30c2d1b749d1a64d6739645aa02028bdf88edef1 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 91dcd50b456663fb4730eabc2024b1b06ff92cd0..9ffc7c89a1f409313d1b0b2432da128ef0a4f5f5 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 0b0f085bbc76224d3649ec02365b5130592d5548..62648935ae2427011ed4ed20726acab73a549242 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 96d64947ea1e0b22f09c675a6dee6fae459d0202..bf5a7dc7ccb8062eb6a8d776f4868465738d50f3 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 0000000000000000000000000000000000000000..1c90f128567cec12404d77cca32640c0a39e4b3c --- /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 0000000000000000000000000000000000000000..b7d812993a088dbb126b5a0d458a74a495873876 --- /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 0000000000000000000000000000000000000000..7d7127d1ab09e8fea47ab9ff3df1521e2e6b7040 --- /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 47a46f034395668b0efdef5c814b8dc29a78924a..38984fd880687ec918e672e8bc7a96760533d6e7 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 6324d2fa14bd7a48d740976f6d830001bbf086f4..417ae117e714cd2da5fd3721bf9a6a0b42af62e1 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 f2e28217a517b8b91de1a1df4d5aa70ca9d42675..83752c4c834c591ed98e8e26c2c08ce9ca35ba3e 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 afd8ebcc819c6b71535339bd57eafdcd90e63129..2bad362d01d06d4c53b90df177e8e4fea3b3e12b 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 1659d4b3e0f30b7abec01af28a82e8c10b5ecaa8..c596eec47d5bd966050034d30d807d0888a90c50 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 6c60196129d6c92ce012ad36ab5a4e7194de6ea6..23daddbc2fcfacaf607d46c47ab9d07156735cd3 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 04d7e457913c8e68733d5ff33ffd5f289d014d6e..83fe9d8cc4fa3b922bdd17bdeda48a2b5f663902 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 47a46f034395668b0efdef5c814b8dc29a78924a..a5d2536a2a912098ebc1f227f1a878151c021d27 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 bfa717b7ee2e5d58e1af98ac14ab356d5acdc005..5514a660d280a55ddd2245e809b8a829c01d47bf 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 0000000000000000000000000000000000000000..680c0e6079fc9133e42def081b20df642bb395e2 --- /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 b34eb32e3229b876303e89d00aa3deb1bb8e7968..7f21d63b3f844b9dc832b01b3cefbcc08f6b5a7e --- 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 0000000000000000000000000000000000000000..760bdecc9fe09bee363a205afa8691be3e426d56 --- /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 0000000000000000000000000000000000000000..010547daeb93b5d51e36a5c6d3654a9fd3c7f3ef --- /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 0000000000000000000000000000000000000000..4b8bde4e6c0d7c21a815b21541589d06833fe1c5 --- /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 0000000000000000000000000000000000000000..c421eff73394afa6b5b830709b9347a64ad6b8b7 --- /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 0000000000000000000000000000000000000000..2e84cde15eef566722b5d0544c56d2d89e35db3e --- /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 0000000000000000000000000000000000000000..ca2f8f10112b1d59852f1956344c2f98bce2febd --- /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 0000000000000000000000000000000000000000..757fc80231c159752e6fbc880c570de28a52b3f6 --- /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 f11c5e3a2f0a02af713a09e5fd22ec4e829b77f2..d09c2cb900e446ed50a700fb7e80d092bcc28f92 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 79d22f571cc4b02c351ec7ab020eacb1b6f60da5..3e1666e39a95774fe8b6a5c4e4fc16545ec16e62 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 7c9d351bfaf57b150357cc895e30eddcf5f59b09..0000000000000000000000000000000000000000 --- 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 86dfd2318b84db908601285d1ad49aa4cd062b47..0000000000000000000000000000000000000000 --- 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 a8b8f19123398744624b2a06ed1550b9ad511469..250c158981569b9d1426cacf402245d1c6bfe64c 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 0ec154a4b9371cab8be4d337434a6b98f0e036d4..dabf708b5197530a931ff98058c199254e7b04ac 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 5731b6ad280ffd567aa61091edad38d3ae5d3d4c..5d2abe78c9cd96130fb772d5b48c3e203daea27b 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 bb59f78241377e19bf6ba97308520f29c6d6743f..41d6a853f6edfc6a3609ee9253c8b41c623d69ab 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 09cfc4854efcc435d0b03d1021d3848f3edade4c..20f6f77bc02f1fa2ca3103f48a1edcfe2d3be478 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 3909d574507f63f9ddc215c7f9d5bb8967fcef99..baf5f2d8391c7f9ec80d56ee3fc1253a5ee57811 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 04c859c9771f9e62c119898d2e75a6339176a0cb..e86dc99138ff6bf2203603a5a1ec70282997479e 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 3ab144a1bf3ea7b20be7669ac7b3eecf0a57f254..b39d1f7329a16135cf1bc5a0edc0b5f52e88f111 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 75d9277f3a12424fcbd218793646cd837c413136..3f0089174f9d47eef86e7c920efd94dc8c635805 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 b79c02ce4ace65ab181d2383d57e349743fb1d6f..44339ee0148a5d26be8c5a22504079f712452e2d 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 96aa074aa1bcceede2ac085734592ff8cb63d91a..17bbc40bf1d81e95aa1ea6a06dabce21dc9b651d 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 7163b9c1b51e02a225acf2f18a56f749c1c7f2f1..174a4f5bd9e76b47d429c4af8e5f74479cd27151 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 6dcffd213fa2636ce00f268108be0e9723a1e209..0accf0cd9171cc67ab6a2a84e5282410c208dd8c 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 192c4ebd6b69b3b4448e326dff86a83d08467299..0a77675d28078b1ffc33f5f162087ba74bfcb6b9 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 2acfe7312705b281c83377a44509b1c0c9d59d06..36db150feda85c8734bada17ca0e9407a4ab9e62 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 5b2daa464c75eb5aaf54a8c2eba051a75033a18c..189b3da3dbfad3045aa6c793310ea26f58ed2cfb 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 64a1a2d348e62c69b837c9bfe4dd7eaaf94f8747..f4a491f3acb67bdb34dcee15a4be63af559fbeb0 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 0c87238d37a1394aac5c0ac411e38e3114c8a49d..eaefcb0bbd858fb01b5047bade94ce5fbe3c3474 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 a0878de06ad209e0f83b87c349f0c4246940e136..65a3aea343b758204154d4afec64798e1566d69d 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 b0c420fc344ee5dae4864954c75837c728f5c227..0000000000000000000000000000000000000000 --- 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 c9a1d6f15fdb2685d5021b5471041aa977781ba6..0000000000000000000000000000000000000000 --- 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 797ef9838b46d2e5576498c60f91f4e131054acc..0000000000000000000000000000000000000000 --- 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 560d23a119d4a44d4d28a2af02a76cbb4fc2423e..0000000000000000000000000000000000000000 --- 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 756af607ee28c46609ff280e2e5fa5bdde552633..0000000000000000000000000000000000000000 --- 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 6f95865e86918211c5d4b343e9329c45b06d9d11..0000000000000000000000000000000000000000 --- 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 8e253400da2f12de9e841a8045c50cbc9c2182d6..0000000000000000000000000000000000000000 --- 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 2c6b40d8dbb09c4e4b87ea55eb819aca7e1e966f..0000000000000000000000000000000000000000 --- 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 be555e0be84ba14fcfcc4f65e83f26ee6005e662..0000000000000000000000000000000000000000 --- 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 c8cdb22c4514aadbe4f35f6701aefe1b5cc392bd..e8fc444df24a708e6667fc38d6db5982d1ec93a1 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 f5b2935893167f9cd65e1b4375b9764173b6d0d7..0000000000000000000000000000000000000000 --- 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 8bede142247742f0d8546cc035ff2dec87cdcc62..0000000000000000000000000000000000000000 --- 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 0f7f15fe927157fffc5210b2564e3e9382dfee9a..a476967ac50ac4df74a44a09e50911f14850455c 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 c3e4533928135c4cea858b5f0c785aff77c16706..0000000000000000000000000000000000000000 --- 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 e686483e6ccb3d77d3de06f2d9d0ea78de4b16be..37a8bf5c911561546cd97a2a4dabdea728be6fb1 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 cac967d5d0149af5c615861b59ba8870c147fb11..8fca208b2b1a9adc8402c569e8de37c2498451db 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 bb5f0b8f425790693ab9bc1bd5ca3925d2d7d36b..0000000000000000000000000000000000000000 --- 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 70da9af4b1c3fea338e94717c50d5bb86f3ffba7..0000000000000000000000000000000000000000 --- 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 0925ab152d4cd5116af8dac5b67d6eb41b147c42..0000000000000000000000000000000000000000 --- 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 dc803e1dc10f5be4bda0bf6dde14f752063cbd72..0000000000000000000000000000000000000000 --- 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 593148c2520715b83daca4b458a3d0fb83d17bdd..fde4119c9a92dea4de4d9692a1cc2f5bdfdf456d 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 Binary files /dev/null and b/app/design/frontend/magento_plushe/images/express-checkout-retina.png differ diff --git a/app/design/frontend/magento_plushe/js/navigation-menu.js b/app/design/frontend/magento_plushe/js/navigation-menu.js index a91566ec9ce03ddebbc242fc86b86cfaf1c6dd3c..20856c3df592fb312b21de70c9ab1075f0b6ba36 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 0000000000000000000000000000000000000000..a85048b0ce3bf3e09e9aa42cbbdd0f721e7167e2 --- /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 81262c4b16fb6292f382f2bbdd31b5c6cef5d27b..3f59db28cde149c7781126813e9ec771c7078d6d 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 5c1f1cbf41e933193e012e8417b9a65fb71788e3..6b1bd5ccd974fca15f1c944cdf79127590238d24 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 0000000000000000000000000000000000000000..15ace45ff259c0e77650145665bae869ee9fa4a0 --- /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 81383e8041fef5d4cfa0df8f9e4e6511339866f2..6fe0c23a23ca671211b407acdaf776b0d5534ca4 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 79fd72340b53ce292cbf2182980a74fa77f79409..6c83cac0cf1813954f44d372cc8792982f01143f 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 6d3b1a25522019ac07d21c44734bd5a1fed0250d..182f0c19104b986ab96c6a2eba9a89ccee13c73c 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 82a9656a41199225d934415c3c375f38982a0a24..cbf5699e2b332b7e3f1a8066dbf1cf771f09313f 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 fe17d2760ea4c467d5d97ab4d5962d9d39e9e054..c39dd300e0c8f29ccf68849074b468f153a6d790 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 d26ba641daadd8bbd097daf5ab17abbe877f752f..111b86609c1fa22903d58b34b26850b1c6af4b04 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 95a70061a4ad7a65a73555e11488b15c27946cee..19fd31bbbdfd9552302c276e3c201814f24041a0 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 31916d2059421559ea201c8058f442c905b18c9a..78391a470446d3246e398fb3a8cd9e2ddeb0cf09 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 16127643d4577294c766d54741252260d6fd0624..2ac486c3e0c9a35a6abdf4470bf27fcc1610d78c 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 6e974aa0fb6d6d0389343313b55a25f7959ba3d8..707458bca8ebd07564fc4b1d6e056d29d1fb5879 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 89a0c040ea9780dd55971274ea9a8ba64b92c7f6..bca3a55d23cdaae94b8d6becd284a9538886fd78 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 20f7c379169b2fdb68b663aeb42e84f98b71bf8e..4e65efaa9c11cd16d1422c9a249bf9b6a9b41c0e 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 54a986df4026bda077557f06051b08a8abf5a200..0b669c516fade01b4e36e167cdb5961c2c6d9989 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 db80a4bb5c23e268230445df2a3f8ddb7cf44479..b9d649dfa8bce89fb099ced439d8af147ce39e02 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 a6edb1c751e439a645842d292d7be8b68d0331a6..136949b222917dc717515b76e0742cde8966af89 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 ec48e129ebf516136d67d250439273c2abf7ca07..4dbab4f1ae1c0ce79807ff23487a9c4c65c00cde 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 7e6c86b00e20298cdca636e1dacd84b5833c46dc..e1bb835ef3b7b16c5e37be8b615f6c93271342ed 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 a1d815996c4da0a990f06c376bfd28e3584d3714..9a95efda719b768caf3d748d02719a9d570edb18 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 229ac663ec3278063127e846930e383d5ce71bdd..66ad646e7089f517bfe7e6c1e1970a41b76e9064 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 cbd600c1de59cc5a532c3c8ca92f3e3188233621..6f6784cfdc8f5c570591fc00bc5c7619ddd495f7 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 d395696d08d2d57d971c0fe7df05ebf1322e29f9..b48d790e5197b3dbb80b05147569fbf85f3ed768 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 0000000000000000000000000000000000000000..b11cb8b83ed714e9030fcf87915c1dd19e8cbff3 --- /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 823044611bfd5db78e97ca1390116c45fcfdde99..5f53d1b2ea779ae3c015202a55f251f136b0955d 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 b162843675203175a4bf49fd2d4d87705de942a8..a0f03563a78b91f4ed2a9b47673e222b18bf0c71 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 5b739d3f283f35647935c02b716d0a9cc0ebe2f5..f44083d5198300e8db14477eb5f5c31615e2fae6 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 455237b2ef01063f3434920db7a588e134505b1b..84b745c48b2b69c099ffcf6d222b0d39fce3d2c6 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 a200c71c846850c8a763fe747361ca86152d90ee..c279a710a235180d1c307fcfc3f75af26e9282a8 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 033c0269fd6f2fbe4f9690b6a41e9e6f540dc5f7..e77399f722dd4f575f25a192fe523dc9f52a6c66 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 2219338ebdf32b826db44d8b6fd5f7ee064bf727..dac00ffba61a55a3a938fcbfe91028483ba33734 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 731b0bde9f449f4c2238032aa8a9f615b78adbd1..060d2a0d8c0c7a2d83bdfcb991d5f5041b6bf45e 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 7ce39fe88c10c7ce5f10ea1c471df346179eb8ba..f5c37ecbd7098e732c68949179e3f6890fd82f8a 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 884060e9ffb9139797dbe8620689553ec4e8ca95..6d367985a03a99037be72e988d5f9485bf33f1c0 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 df59507faa63a5f3c3f54a5234c360410b635cfc..73d468dae96675fac7663f50591f149456e33c0a 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 57302e555b5fdf114b08a3c3f9355c69976d6d33..73d468dae96675fac7663f50591f149456e33c0a 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 df59507faa63a5f3c3f54a5234c360410b635cfc..73d468dae96675fac7663f50591f149456e33c0a 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 57302e555b5fdf114b08a3c3f9355c69976d6d33..73d468dae96675fac7663f50591f149456e33c0a 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 e69deca32d5b49c660608774cc9beabda9442126..5e23a948fbb9ab22b0637ff60c3f6ff20225a1da 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 42b6910b4f277bf663af8c4cd732e6c993e7a014..e7f6a3c90ee08127d5493a402e4a387aad922fb4 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 01d1f0d23bd45e6518dc457daecefd5983f39c41..bc9da3205c760d63d53f1e2075aa106ab1b76536 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 4bea1db72071bbac6fcc0d5ee1b3511383f600e2..435cd58c2ab65c554a75ceca1ed12d4da1e447bc 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 f5f5f650c2dbe8eb8af9d4ce68ce401bc0bb3861..3912573f5fc0fac2cbeaf151183207bcdfbb4d52 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 402423f54349b2d0d06754ed861eb5ee4828d20c..e37a23a6e9bc0b0f4d7d060ca6d76da0609ccb55 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 1652de5449417e9bc5f57a3b29545f8d1fd97420..c573659d85e59d7f9918451f352b64d984c23e21 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 9702190a028da85af521965afa10fd17ce2bc9fc..a5d60320b88821d989d639912ce4a3c35cb100c0 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 0000000000000000000000000000000000000000..896c03040d5d83f984d6f16d002bca1545c53e25 --- /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 0000000000000000000000000000000000000000..526a9dd3fa9d16ba4a1366e3b2664266587b394d --- /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 0000000000000000000000000000000000000000..5417e3a4d4dac6303a1a2868e601de62b320adfc --- /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 0000000000000000000000000000000000000000..1172d840f5f705f87a308d82253840088850c3f2 --- /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 aab82d30da2a1488d0a951c86a7c6fce40cf2d7d..db01dbf4565b861080b335e34b880040b2286f38 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 14c3b3cfef25ff8308a5b436a7c700fc9fd6de75..c1d81ddbe4c9c34b761f764c4b8c7a7c906f7d5a 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 5b7b47922050a998a1243cc21230e9a2b55dd5d2..cc82c080b8ed18fdc11372f635d7ee4f8d32cd59 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 74fabf9d1186a27c65b8f451e8f1af9631152881..6641592ae4c55b49ef816ddbee41168de5bfb6a5 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 60c4b332401f74bad00b89b5aad2a016e967a2b0..453ab4b5b3180df3dc5f68798c51fa4f17d1ed46 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 4aa04730111a1741a93abe38de2cfd1955ec03d0..22482a4b2c20cd7413d08c1782b765655ebf2c14 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 5a83d909e425cce9112068579b909eb106f8710d..c51423ae0884e8d7a1925af7685d1346d5ff1640 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 4dfb3c9db80fb611af0a9826d846ab40426f1f18..98492b0c9db1de7eb22705ee224a992048255597 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 6ec52d663b6205f1cce62a33af7ce5a425e8458f..b3385b96f22bf917ab867b87e0cce5717869443d 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 0000000000000000000000000000000000000000..3f16e2473ec14d5b08bd093707fa0da1acdf6b60 --- /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 c23c7ea3f387d2aef3c38a9408b648aac1cd3148..4219eaf5ed33e3bee5f58ece51f99f4fc73b9ec2 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 9b4f857acafe81be44822b0a477c587117166426..20e828eff0fb3703f444d9760629b477c6ff8e4a 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 ffe2504cfaee86bbfddd5064c04994b2765bf5e8..2606f36537489ef0d58d3ace183d49e800ac50d5 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 f26f2fa847564648e18e553b6527b8bade4ee550..4e542e661c0e7fd8ca5ff62c03eef6f05fb62511 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 31b429c674859d3dabf75cbfe2b2005e4f0f4103..973117bb228495002d6f44d3468037201adddc4b 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 b6a93cc5f16c23de0d35d3e8044592b7d9210937..bccf187f865f0548ce661aaa5ecdd4a58634d679 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 4a554107f33f55b13b2ceb44e9c46906eeacde2f..3475d297259b4af24ed0fd549d085eec6f6012a6 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 15611f079d80f2dc770d208e5fe551dbe8e602b1..ad84621677f98d0d9c0eb9feae1b6dae07fafb01 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 23f6c9bf67e25a4f5cf8c2f2755a1c8633e68196..b8a772b7157dd6316ac2c7b53b7256f95a6f9e45 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 6846819b88f987ca4ae8c00f934e019e205bf4a9..ddd056af4123f656949e6819a3e2fea32ca818a7 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 38f274ad2a5da03848f9f7862b13437bc5a5bba2..58e76f0c5c0ddb293aba29b55be106f2d471803d 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 d66217d727868f8ff7cee5c665072d94838ffca5..239dc1ca608b3cfceff3adbbe29f872122a3f966 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 b12cc636431c54acb04418e1afe74685cf290758..0d04dad19a48893863f3713a4f7677cae03d282d 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 81587abdd3b63060f14072e0a330f0c96ba27e78..e054bba8adfdbd7087fccca8d17cd304372ddb6b 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 52ea7983a681b5a2379a04e0449f7560011d1d3a..3fb570f22d0c26f110e4d22f6b734e6fd2ba6119 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 eac70152e228982832ac1fcee54eb29e25709f69..fb5e3c023b9100132859847aa75f5b84c27527c7 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 f55e8fe1dd116cd5cce8c958d7f3b16d635ee7cc..72117d0b08412c9d062704e49c241ae83b832772 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 f399290a707762b4b8764af0c011b82d6a887d69..c85854f0888779713306276206eb2cffd5f410c8 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 87590dab8c6ac9e56ef21746a1b48e4bb1f3b922..546405331157769600c357565321506d5bee44e9 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 0603d9f4bf0bbd9fad0f7e7d2036dc8dd1343397..5f9979a1e303ecd2397625fbd7dd68930703de45 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 d2931f4e29b4ea55378951bd1880f64ae2bc7077..2ed4704a4c9935ff5e970fec7517420aa45cc0b3 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 59c2f2a6ceeef6e29859db58c212a4d381fbb506..317a3b6af08eab84881c4a2bf0dabf4175c3857e 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 c92ff00f884c7aca11a794cffa97bf9be186c2c3..9e97b0c57f10131166f20bcaf79893edd935f8c2 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 99a304659b24c718633b157e03927d0f0d48e51b..16abeaa6f28fe40c9901f87464bb2606df44f261 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 a3d0dc610687fa47612db99daddd190268193743..e7b1756fbc2d85a704e26d97229ba9c88dcd2b68 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 0000000000000000000000000000000000000000..a9e23b96f898da0a29437112f37d4f5b5799cec3 --- /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 31f0b44c5d72717028ce1d5c1c7ec29af58f5379..de00ff43ba8df1958fbb191146f0301064584180 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 4b50e23ceedab76d98e7cbb6d9e7605ed881f2aa..87135d776ba6f4379d76f335ee08bdb36d8a9e6b 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 9d2b1564038fd4c3601d664e90b125ef6c19f031..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 6a9e09d4c58ddc9594eb2d0d53c3169e897674e2..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 e6804e128675ac2a5100fc7a74371d220064aa8c..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 fb150a481cc81e6a13418786a033e0871cf1ff34..f5462dc5b43825646c645a838bbe0bbcf586c74d 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 f7009faad200d995a2656bcf0e0e9344724ba56a..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 0000000000000000000000000000000000000000..1d6901edafe91f604159fb10284585de1df20fd3 --- /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 0000000000000000000000000000000000000000..7a8abff5495dfdfcf1dc114ecf5940e8c0d470f9 --- /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 1a271ac56b1d0a00087d28ccae0a6994ea5b6b75..f63a3835ffcec666a5e27cc982921ad81eda764f 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 3a9d33b849e73b94e052f24a91b5ff9a0190de71..54c715a6ea6e9d34b41b5ecc57d1272e2d43c437 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 35766f22bddb3baa696a9e615985bd64df4f1d61..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 8282d1775ca5cefa810eaadaafb18ddf2a566709..6c60196129d6c92ce012ad36ab5a4e7194de6ea6 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 b187a400c53fee3f6cfd1337efdd25a4317b1e42..5389450b1846cd7ed732285b671c89cee1fa757f 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 26a9b1a7a6d6e465d73da81889fcb96f3010bc67..6f38f51ecd7d5573a3731e2a81c0c3e04b5c8b83 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 b6403324ec69bc1e5062fbb7253a76caab9f2fc6..b0d88ec53c54e3a00696c201f01c403a7b06569f 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 0000000000000000000000000000000000000000..dd8ec067197f2c4ff01dba7dbaf5c31afd2388a1 --- /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 0000000000000000000000000000000000000000..bdc5a20bf3e5994fce713f30a1e6b03df6617bd0 --- /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 0000000000000000000000000000000000000000..d1c4c961c7beeb952a7fd63f9c9d477889c939ca --- /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 0000000000000000000000000000000000000000..d227a85ed57f9a8f45dfbecac780b6341976a98d --- /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 0000000000000000000000000000000000000000..41de9053bf426d78af8f7c2f1388d112bd338035 --- /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 0000000000000000000000000000000000000000..4a2376a46c0d3544c06c945649f9f73171b3cfe7 --- /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 0000000000000000000000000000000000000000..6efb0a8a65a358a23c44c58250d87704d3e3a4b3 --- /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 0000000000000000000000000000000000000000..8a8dad50aab179bace1b786c96f35c8943e06b49 --- /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 17ab0a22cf728a6f7ce68ae1a569f7c412624de2..7afdea858abacd9b928f03765598e56bf70619cc 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 0000000000000000000000000000000000000000..9224bda308fc66c22625f009e6e9b9bb03494468 --- /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 0000000000000000000000000000000000000000..d4fa065f414ff3831298c5155340129c73fd4c4e --- /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 0000000000000000000000000000000000000000..19cb608c6628e69d7dea229fc006bc7b87d91129 --- /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 0000000000000000000000000000000000000000..2c81918268988cccb7719991d08a168de17041bf --- /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 0000000000000000000000000000000000000000..b43084ad6348694eaa4d9f9d02165ba72cb2d76e --- /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 0000000000000000000000000000000000000000..152daccfc4a1a62616bcbc2d53087133ac70926c --- /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 0000000000000000000000000000000000000000..d53927d497d1bcea79c00558bb98f0206225e6de --- /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 a5f22aa37f245960e70afd95552815400902bd22..238377c90b75f4516ba1dd411e828e1d4068bfdf 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 4807f52c5a7ad4a620215f0b0126bdc065e763ba..205bc77c08920c4231c69df5366920bda5a5aa96 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 0000000000000000000000000000000000000000..b855f210f6332c0f2160d2d207b7b5af125e5b93 --- /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 0000000000000000000000000000000000000000..df93f0a6bb3b5528091aa7cb3512259d1cbb3904 --- /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 4a2e51e013d6e1fd2cdce762dc6373a30b1a1298..d22a513554a6566db34f9b5fce1a58644446ab22 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 7e2ad32a911c74430e51c368db30660ca56d0bb9..b543570a910beb98d462f085952ddc4e43d369a7 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 3f16ce510a379be49d8bf1d6a5502c5535f22ebf..4b1647512dda92d166c33a46c8fd48eb331aa924 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 86e444b06b5b06d1be378d5619c234345f6f6958..643986f1cac8c09098efc9f57f5a0079a4d61081 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 6ef10a4a6195901f80b6e8c680a0cc8266b39ce8..e6b008a1b25de230274a196b86e4e85f864fc572 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 45f7151375c608542c23c416fd4ed6eb2643c9d1..18297c73e2c2f319b94bf0c6fdba0203d985332d 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 3da69e71f1122153843559b57b3cc203bf38e167..504396a2aa61b1a25d747f4678d7f7d7124267da 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 921b76a3e7171711807e82e1d93729c12fb16295..5ec57ca9d261b069a8f1d5009a586931da863c34 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 fe12bc4fcaeac25319e8bbb134e30fce1091e054..527a291185fe59bbc0ea9fde2b74b65c84b7ab67 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 2703bb77be112f85a48c68f7f65314973b4021ae..549695ed7c4846701324e9125ae1f3a387018f33 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 aa62825238e5573ae9943086fa7e03e233cf5277..220d9dfec78939457023e4491abc1f131c435d02 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 c9c872acdb3b6b1eab60328d5c566532c69c0568..c543c0b9ed37fa395abcc772b37d8728f544004d 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 7c5408da6d7713d47c77ea538289e7bbc4cd258c..84350f8492ab6b6ef9f96b6b08412b661360584b 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 920b1ebde6212607be8c0f62ddbba428e0439c69..42e75dd3d7c3ff7e4bc6d23f2052757c9b71a1c2 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 1b73bf6e5fe7a4c3c5a21ea408028f7b4654be41..ccd85d7bd10b0c78e4623313613658f6c3b50a29 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 d9a4194e2646b078d882a4959ad812b07f28323c..1795601e35df218292104ca0b6d9d128d89222dc 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 cfbbb86d67dedbe3f42be2644633128cfc81b1e7..2f5b3bfacb005468fe10306b87297df5e5e399d9 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 48b1146e69de076fa52429fae5751e68f329d457..394838ffc7206f49c979b217d74f1c1d994dc93e 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 48c54e9502037a6e92f84ff2abc2a98cb37b3ebf..c17a0d13ca87bdecca31c4105876c7ad12c0cc79 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 0630c25f3543b55c74427b01c7b1fbbd05cd5d2c..1b12094706b6908efa29888ec5f43ba89bee3a0f 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 877be3b18290190ce25dccbd650e13912273c231..9264eaaf322109d652cfcc03c4bf3dadea88ab24 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 35c992c067caf7f60d2879f78966557b096b4014..57fbcd84359f38161e5d0a39f919d461426f2d52 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 bcba0ebeca6d17c42e8ec99e2993f041e3f1ed68..903f3eaab9f490320ac9150e4a2ecca446372bf0 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 67a3a59f84aa163b39f592574156c6c69b71c9e3..bb5adfeedc5cc7549c1ee2332182781cf1922e81 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 02680041877313190624f3c676acd6209abf4fdd..0b586865b641ae4517530c0bd7b2bb72c1d32528 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 73adf6b5af40432cd7f58cdd2c85628119639c79..133dd13b4dfe6f539400a24bd12b73ae6ae8a197 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 3f30ad93dc355f93e77e864e10517bb33b2ffdf4..1b2ffbc55f165145a56c3ad36d843039dc49f700 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 5769e929cf17ba7fe0d70025b516a1d4b78a772e..d8e09b44dbfecf8bf02da3c75f9b6eb9a64da202 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 dbcb3c1762f498ee2b41e1da04f0c4d81ff69e99..193d555315794e30229aa453d2112c3ac59ec4b9 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 c10b9451af3ff63292dde92beaed3d3784d59e8f..2d9ac918e1ee562323c99a2961e25821b1bd1bd9 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 03c415af5d4e2cf1ff9712e6cfe7e3780cfd661e..950a36dcbe6abd7bfe742638219b02082343e549 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 606d3edbce0bdecdaaac6d6cc38af7142aaca71f..8ce731291235df057ecdbd7e6fbaf34f0f08e2fc 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 ff50a4d4c581383899b3f2244789da08f4599b73..a0423f1b0ed827d2fb7662b34aea532353144914 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 45ecad0fe63c19dcfba0e4b53dac65abed09e77c..9fb63811033e0a763cd0aa2f518f4f630bd056c4 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 e9a920a07dfa4af51c6590d8e2199bfc46d79868..051698b63b4ce54fa430e8e5679b9f9417473e87 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 282464aa9ced947fd627f3871cb6f7cedfc6ec16..5b86fd0719b4349acbefed1513e7b345e109990f 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 0474367dc15dacc6400d12913ed039adc3a71a47..24e6994a47ddc61f7a301c15392ff0ab0d97823e 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 e0921316890175f54598a7eeac6fa984399be5e9..0000000000000000000000000000000000000000 --- 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 53298aebc47aed534f76dd790fa59d9959d76292..f0f1f26f227b1071c0ed7db9f2e1e7ff99992e5c 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 0d89580372c7414e90344df9d4add3856a8b468e..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 12ec004bb443891968de612dbe42ff3ee7b637a4..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 b9c1c3551df8fca5db03abddccd0aef41c406adc..8456c9eac79ab72feb4b5eaa48610ceecc926002 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 ca654ec8fc89dd9dd8348410ba6373865b1484f5..4e3abb394fd7526c7d1f07543511dcda9cf61112 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 91e7aa59a2deb98c8989ed0fe7ea94af8a2c7eb4..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 5d6c257d001ca4c818fca6658d0c57f5c0333849..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 591d79b82376ef8919b57d15c5c67e084e66c578..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 0000000000000000000000000000000000000000..1d6901edafe91f604159fb10284585de1df20fd3 --- /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 430e665b09914068b4e9ad5497a29d6f4dfe7407..b880e7b16ae72684943486f498728df1e5c363ef 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 0000000000000000000000000000000000000000..7a8abff5495dfdfcf1dc114ecf5940e8c0d470f9 --- /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 5739e45d3fc2c21e776bd774962302766d6a50b4..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 05482591e8fbe5bb486f569256f4c1ff261a5de3..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 bc0e1a10b1ddd5a0ba7c1e23e0e25e10ec4a28ec..3668fc568539aaf86da053b9eecf38bd3d1a1cf3 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 9de751d0c9233af9de982b89002342abb6431dc4..8949e8f0d88d50f7404b311f95e38d53ef7db890 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 0000000000000000000000000000000000000000..e164d4bed6738a2989428edc0afde706609f53d5 --- /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 e11aab605151262bbfd60672ad91c695af079c51..dfe9433e28fd8d0f03aa98f799e6bebb553f13a7 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 a9525819683fe143a6fe46c524418a7721f23ae8..feca73ae398020934729f62ebddd8012b54feb99 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 5f235dd9b3bae9aa522af867dc1fbe7556c6dadd..b1454e518a021dd8cd94eefca1c5b3a91aa5ca07 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 69d22a86f5cda897841aa951a44b25d19e3d32bc..12e2f573576efd16ccd763bdde27bb3914cc3b57 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 ff4785021957f402e4043227c747ce60d354dff3..da5dee940f6af4a6bf54b9d8d27afd8d7921d278 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 c2d2be86e3dbfeca1fce177fa489093b1f9e289c..597d88b17a29dcf016b7b72e41eddf50d07a96b4 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 153c0ddf1729520dba1de3de702543303029f0eb..41d2b30b53cddfee43629c810ea9b48c59e05491 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 4940b63e82352ed2705d20e489fada338ddead9f..3e95d10f6e56d8749b3f4fc7e6c0b58bc58c668b 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 cb03d34c230289f845d2b2b2644e130c47a11931..b457e3307b731300fc3bf685d300d3fa92100d42 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 5f325c4074ce4c16a80a0ded4bf386d530a3f6e9..5887ab1c6d431388e8c646592335874b70d880e9 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 a3d348f9a14200b613625af16c7af01ae9cfb8cd..8e5f25f89b001df156c8dd9a95b3ba79b52a2a7a 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 ed175d0244068f3fda52edf0d9a9652bb5b1e9a6..6c8fc48481aa67ebfbc14438d892d981666a8e63 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 f1a61dca10ff5101315a5c12f7cc1c89a0c2d559..05ced049f637b1be1edd423b64d36cf5cee1a5b9 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 70ea916120ff95cde0402efd2e0eba85c4fb28f4..79b6bf623fc81dd20a67864a6b38caf8b5c1dba7 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 0000000000000000000000000000000000000000..3d41fa5f102c7c4c33bff54a9f1683fb08067657 --- /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 81d42c53b098c6a30fdc07df637f864cc2e14b03..f8b1b0e504664723faaa6236f785e72276926156 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 cb0a924ab03e9e2148a52ebbb856c4629921f5cc..32ee23dde2e33173f579971c06a1b6e077180152 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 0000000000000000000000000000000000000000..c8883223670ffe0eb72698d8e7889cd3bbc11622 --- /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 2c9601dc93eccf81ca67154696a426c8ef660a01..e5b6c2e309fee208f721fcc11c95fbb0edc33a27 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 a0aeaa2ce10ed9187b29687c0ccf94af9fff100c..01924ffe60dae3036c2a8cfa17cf7bbc0859cea2 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 0eea369a3fd6e5b890d3474de887c80c86e5cc4e..a07306dea0b32686c1c6a92b2b690546b9e93397 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 012d50a7f487a0d91c6732b902b07a6ad6b186d4..5a1fac02b531377631ef92d612b64fb25b53b0ad 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 5fe57a6e8f1869b8b38bfee15df7f18a01bdf337..175e5dc6f723c252fd41c7af967b58592a8e9f24 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 fd839b93ef8f4fc1a7fd3bac88c156d73c477b18..c8c92420c873e846f84486b4d5a737936cfbf138 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 ce3ae5e03e7f71b96df1c54396349b97448bf3c5..83597e142cde727125d3a6ef8bf43bc0d22c423e 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 78b27d160eff1a3fd83ff7adaacc78081e14d94e..6c32beb739d04f3373eddfaf9e2bf63a20e0b4c6 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 773943fd472c217db09c31c34c7cf42b4bf251f6..9e18c097473e35f86cfba1f790c4ff359c59abfe 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 0000000000000000000000000000000000000000..6d50d0031beb04416d942ffe3eba329dff62525a --- /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 0000000000000000000000000000000000000000..4bada97cadc2f681eb586c9dd7b60b0285f8b645 --- /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 0000000000000000000000000000000000000000..13289b349bb91a0f44d1621e0a2b5a04247a0464 --- /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 0000000000000000000000000000000000000000..3aa94fe4833543701b889fa43715119a7db0b117 --- /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 c2c0996e0e9d8a47ba284fb7e0b65ad3f2b38e30..db6e02f72b9e042f426fc3dafb9baf03bd0978a0 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 0000000000000000000000000000000000000000..1ab78a52ff67f6172c73c431350550b591d1684f --- /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 42969fe2e1aa7dd915b8b3017e4b8d8aab432776..2bf4cca6c418150cdd05bbac65b67c8dcfa450d1 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 de6606c68273a98ec326ba19b3b07eb0af94063a..0000000000000000000000000000000000000000 --- 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 863384bef4d74d53ff04939c78a6b0b1d8188e52..0000000000000000000000000000000000000000 --- 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 cd0baeab3625c4222981188c5ca515770ce8b0bb..bca2d970c33c90fb6628846846d745f73aab22c6 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 d48a453632297cb99354f14fadf4757ab071140b..d166de23547be8528e7794d516b63c905f3f9753 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 d618331b6b6e22195349dfb72eee7b60a211a638..518149c3135c00070e03b1a05a5919f1ddd63bc6 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 507a614fe48009a141e260fa15589cef1b894435..7c9714598fef437fdbb3903b773f59037e36dd34 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 2275c5209e96b8e112e6fb304ad24ec33e51b7df..77de8b9fb0e6c0174131b72b074bf6e756144b60 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 8bcc68eab186b53c9c9a4255616f81d7088a4ae5..deee526c326d98d8c8d9bfd44ddee858dea70c70 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 3e48f0e2f90d96318bb295317c69d8fc9a62addd..2a78005ba632164bc62e3a00f398192e176d13c7 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 73f40c2d77c048fdcfce2ee1b5843c41223aebac..ef90a0511ff87fb285616525b4773b0ce1879276 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 32e4f3aec79e3a2c705b6f132827b8ce7656bce5..6232ba3ea66f4a347314e4b5513f59620529a1e5 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 3e484c06628f7ba1038db3a7fe7eaef8d15dc091..33130276535bc2f0344b808596c202d44a96d8cc 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 0e363af9765f8ee3e855d965f1da6002d74a0eb0..fe1380ac6eebfa647a550f8b06067c01dd772283 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 c5b7bf2e0e950aa1fcecfed55a022a5d1fffde1d..a308dd95fc89fe625eb2540ce2771c734f5af30a 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 3d9d639f409c6b1fe8138a88bcb2398d5316ad6f..e65e16fb69cbfa011ec100d84c75fd928940a77d 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 9790de9e0d4777f6f56d2c3385fac4d7f772ac9e..7b08ff4f30252687a37ea6130546f3cdc49cfa0c 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 9721915a0a23badf1ca4444f7b5d0df4224c4947..c15d7a1289cfc72c05726d27cd030ccca50670e3 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 33ad1b1834c843e0ead2d52b3d8522081257b6b5..bf3a181b3d51fcc3c0607e281dc9e4d1fea13761 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 fe5054a1410f174da68bdb97cc01eb530de26734..5f5c0af9d11844b99b01def1c98af3bf2f47c21b 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 2754f7c37894b3ba1745a8cdeaca4c1388617b3c..191386f8d1b6472b4b54429ce8cc4568e01aa4ce 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 b841703596ad34ea03edb4791f3310245b21c79e..b25c05790e7bde63b98b2a0f2411c833c299aeb6 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 6da9c82ede2ba4823976bc6e7e9ef0d0b260ff84..d8315a11c0f90ec1a8a39df6c9aab95df36ab413 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 a7b6fe5b236f883b0ab7256b3f3985f963863941..3a3713c08ef241a369348ae51c9b83e29c260cb8 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 84c7611217eed2e956167a7dc5961fd9c3f06f4f..ec9102370906fc3ab0e24c577efbe3b03e3afff6 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 159aeb66b82f43d1d3defdbecbd093ffd49521be..0f56634d23f19f6e9f8fa33d620c81b4fd0408c1 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 30b6f6cd0dbbcbe763eee02c2f876a5ab2d949e3..364aa531b203dd8407e3fc3c895c5ce659d73675 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 bfa94b36c03b757b542ad3b8f6123ad6f82f1d87..d1c70dc03607e9746fcdc1db71824177b622e8f4 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 69de1bb17ca3e2dbe7dc94931b295621e40e9cc5..cd100d33beca5975512e43daa15b3f3dbdfce31d 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 ceb7307e7e07c5b2e66e8911b2d640866f3b1dad..b99e1c9c5386b961ec61f36133cf0d35520de2d1 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 0000000000000000000000000000000000000000..b1af1fc37f42d9bab0218cdf36e073ebaa48d4d0 --- /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 603b03a6e015cbd95d3a081d40f7676e28308e46..b6fa90021a48aab67782f07d36994affa6009a2e 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 463a3a3308daadd9b9a2bf9cb12059a4f6ec4f82..6c51e6e7c97e3ac5bacfba21697bc57421775b8c 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 2d5f9fd36b91e9386190a470247278b5c4d97e89..ea8946c7ed5df0d3e69aeba7755637e6cda783a0 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 29a28309c5e7a22df79af3f4619b845e9bf01cc3..da30f6bf96d8c0e7a4c3bdd59d1822b1b5d7f4b7 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 7d983d85acf4beed0b02876e8a68c7d47d062f7d..846473a7ceda6a392c44425096e9748c11882915 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 8d0460a6f0807fda64f700f74e41178b99c618c1..3c865493a52ae3f322c544b4ba2e648480985429 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 53c28f37b9e78e80dc46158dbd7de42e170c0cc8..0bd36e0d0075f248c3292f3bee2c6c8a985596a5 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 4d5d4c790f63418cc5ef10e2f6cfdda8c8ff5e98..12bd7cd10f509be58bc115a7443bc4383dee952c 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 df7bb69fefe52b912d64c7ce916a6f908e5d4542..205b4e93e45c1138290ed6aa3477533d33614801 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 e2c48e5d1336dafd2f9a3ff1d890a975b36f4d4f..0e63dbfbe530e1d0859a829e3041bec9fa79cf7d 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 2bafbbe7471d475fcea388986e23b46c94495e00..97db6e7df3849d051fdc6b08d9e2c71bb0025094 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 da437aac9914a078fae42889c046c57893e1e62b..86657a32342cf98fa751624af42d816caadd4f69 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 6dcf3ae8e5132156b665e50522c40c1cc11a4d75..0e3f89c101a6e5e59385a26526da228aca7b7488 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 438ca4c0177b65e440ac65d59cb2a6f2c16817f1..296d130b414cbcded0ad9fd2e3a3e5523dc5f021 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 3b323bd6351a26d32e29823a577d4af46e3b8c5c..9ea029980244456f3844e6a7d70f94a3834c31cc 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 a3dbdb8f8eb758b8605cc5d2a8edb2bc734c62c8..f580e8cdbba707b78f57dd2b9c391632372d2aa6 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 4401d5ccd60bd2ed291ec6b7df2b6db6100e95bb..7866b0336e99e73f81a4af13b35db1d105bd6aa0 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 ee200a8600338cae07baa1be8835589f59c4b915..008c123bb6b7bf86426af652b7dd33214c435062 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 7e8d0336d3055de8c3d9a9f3e5d167c65dc616d9..11e8691910c634cda90a03e02d76167b61331993 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 6827d417cea7d3ede196af3cb85b0bb73b802cd4..c960058be47ed68e26d56066a07fc9a472dc8b90 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 0000000000000000000000000000000000000000..c18a13138abe87a4bb9a0023020d08e47bc3f580 --- /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 9f55dfa66cc1df09056742bb559831d5e2342833..cb25a249277bb9c40d39fac4b90a5b873f4cad67 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 00298fe096545b5a99bb31b551c9b78498b97b0e..f003757d2550c736c3b675151824c8457c51360e 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 a135c02ab6e899f4b835cec3e5eeb3cee3613cf9..ccab5b1ef32e2551b0491fa47d5339cde71f9383 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 e466161cbaf8bc2d4c33262dce2666dda521fbb9..4321ecd9cd633c10b7aa4e69603ba95fc301c939 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 4471baa569eef15f47694787ae93d272f8929896..2bc17b40a95868542fa2073e206f5a26644777de 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 db035340a07455d6efdef5a6d24a15937819cbf0..6c8092450555135b3b7d80fff8271f5040c1806b 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 1165966b5828a5dbeb23875d65f1dead66322265..ab3df113f0e066c27649537508b92e45cd34eb37 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 f267834bd035eaece1229c0c8f0f989b7a320cf0..5ec9266a622810b462980ab9b99d04118fd76051 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 fdf796d51ba556fad98685d911e2ff4db054a425..da82fa181d83c9df4c8a51eaa1d12e713e359f56 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 89bc90b17ccdb496c3ad7c2e30b17a57492617f5..49ac32be293806d99653c6c35c7fa0d2799e0546 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 c94118a6bda70fbfcf0ae6313855be827a3cebb8..e1249d0b1c7d6160a58e8346041ae4b97dd72ec5 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 bd3ece4d5dd078fd39347e44034b4442887af99b..866e5bf143abb1ec148b6fcced8e2c648a786fe2 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 ff6d447ca26ed6c47b9e54c96787c51b4c413547..7e7f1f04269087e166fd1ba1d293900f00676f99 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 f9e5bd5457af06ebae62bc3d86d3deeb882fa682..3689256ef0edf40b88f63e507b0aeace36d7d50b 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 ae4264951307b554ac297598061a5e5947aa128d..0eaa20a01cfd07e179806ca7ef19a9b55c04f4d4 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 0000000000000000000000000000000000000000..fc32ceba05c31f0567204cb0bcac86f87ad84603 --- /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 a25aa9233756dbb2cd3a72becb9eb67c93124ae7..c9b9f8d151a1e2929e31221f08caed6e23e9c62d 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 0000000000000000000000000000000000000000..2a25785a916e353a16640b42574f08ec4a592758 --- /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 0000000000000000000000000000000000000000..b663a30390c4455058a8b93b6c44748a169ee34b --- /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 0000000000000000000000000000000000000000..3ff27809ea1001da9e98863655f24d55a98ccdbe --- /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 0000000000000000000000000000000000000000..a40eaca25faba5966e33c45abbf88ca875d38878 --- /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 0000000000000000000000000000000000000000..d6e740233c82ee6062e924b3b08e4764584ab568 --- /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 0000000000000000000000000000000000000000..22994093207250e02dcbcf6b7be904e7bb39cfe2 --- /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 0000000000000000000000000000000000000000..a8b02a5dc17c1b725c79906c3901466fa80c5eb0 --- /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 0000000000000000000000000000000000000000..4a62f815dfa83952d23c100b5757a25a4d2cd2f7 --- /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 0000000000000000000000000000000000000000..7635fcd064a9b43da044801d6e542bdd6b7cf117 --- /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 0000000000000000000000000000000000000000..1ae2728eb20f548248a4a7ddbda515d2d153e2fc --- /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 11eb9370105cac341b83e07831316b0f38a843c9..373e273dbeb1ec5c3cf21458c74f1960081cf33a 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 1e928cb45c42b7955945526c3a7718133d4aee96..d403825bfe863e7d1a91917fcb70099322a636f8 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 20fd1e04c834f4b1b4463d4beed9171ca4c45f00..299f64eda892ed19c82620fd2de540e91b60f65d 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 0000000000000000000000000000000000000000..bc3bbcec5ebca9f9dd6717966ad59006fe0f88c7 --- /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 0000000000000000000000000000000000000000..84f719cda2ec87e05829dba80b6b3bc46a70be5b --- /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 0000000000000000000000000000000000000000..53062d15e0eb6ea5284fed5b8ab8e00a944242f0 --- /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 0000000000000000000000000000000000000000..46eb85df2dd22707bdb230974ef9833d94951628 --- /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 1d81c896cda0756448015fb4e6119d6444a9bcbd..533d9fe12cf87ee42d2115070686c6b3fc44031a 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 0000000000000000000000000000000000000000..738fc05f476208f178dcfc99510f971f524a96de --- /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 0000000000000000000000000000000000000000..abb0688cb204a887cdb5686e9367d060b7466d7a --- /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 c2af696b56ff74f65e879ad67a1f3f115e5c9433..5dcd2c2980f8250168d07ccd0c691360a71e1c1d 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 cc60e4f40592a611a13aa1f5cb57526418c267c8..52c4baba84e89b49ef016a8005106c775171c185 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 0000000000000000000000000000000000000000..a20a07d0adcb788824860438c63bf7209abf549e --- /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 0000000000000000000000000000000000000000..59633b2b5c56fb9a1e2837a1b493edbe0552f628 --- /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 6cbc387bc34a360b23b2805dc7b8dd1659560581..e03806eef2b297bae05c7b4191fe6d21ea751db5 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 0000000000000000000000000000000000000000..e7639832682ddde75e9c0b989508fab5ba50518a --- /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 0000000000000000000000000000000000000000..ea225b44562ab6d7efdda07c0ca1da8f7262f804 --- /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 4c60de4828cc4c9e566f0498e245df53f47208e6..c49878fb4d1d0f96f1e46be2c6e87ce2e6df5f34 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 1592ead6a3c6a105c83a92935ccdc4948068ce74..c3e8b971f405b6f234bb2a63f77fb33a84e83119 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 e1a230e4a0adaea2b951ec668c2d5b1e264f1e59..69004e603bd0205189d96a6cb2e2384713ecc1c8 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 79f639b6cd4b5dd0fa020fa00a7f21f0f0af097e..9b8f1c3ba0baf1378f25bdff933668e5ba9aca0d 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 a53b76838c30086668694f82a1527e671e430b80..2eb60fc7b83e0b7df5f9746c60d5e763f892e361 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 4d062dd26f6a203e2fd915d43b62ae9c887e148e..b86a1d92bf107f06fa69660836afd10a4f900e97 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 bebda10afae745ce590629e5583ced071a2a0af7..974e101935d47c4ee570d49f151aa9906ba9426e 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 585444e31d1cf3be11b28e86a48bd86abafa03ce..0e0378f6930a88656313f204a11a11806387e9ac 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 f847aed013cccee96e9a1b72ef2dcd0e4b5d106e..ad425b53fab8d6499ce5fec3d730518e20ced335 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 59ffb9b33fd158b9c837ba3fe5ad8cf3cd81d784..a542b120fbc2029e4cb7a208f6d4a736d6318974 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 23cce2d4ab3e4ff7cd72539179da196c1de25319..45b4e32cef609b8a65d5893cd81a371aed99c660 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 e28205a73f660d2b3e06191aa7f8a2e6c63767e7..3fe679235f9fe1dc6c478fcca501ced66d8bebcd 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 6fb6a5e1ef9656508347f1b2b9f21101e7b6b0c4..8ab5be9172a7aea6f2cf335df5fbaf1e24a1dbe8 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 f2617876dedf85c6364eb91c32c00f6669c340f2..5853140dc144e082913ca6cd1024216f878bb882 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 e0bd1b786a013dd842eebefbc290a4ef627946bd..69a50b6684d309c65825564ff4af04b96d003e0f 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 6e40095f10253e726bbbf6b84532622b1cabc4e0..352d99e3ba0c1950757c864a05e52e1910bb9f7a 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 0000000000000000000000000000000000000000..48ff3b3b8de11baceb6a0b2bdc39047b5ec7980e --- /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 983caa03bf1eda29da4406568746fe2b079e05c0..e68cfc8e670bf2f0e75a257dfb9455b8f4819296 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 7839a3bb5101e6f4b68cbdd9bfbd17147b15919f..418ae907a54822c48036cac11c1284f8697abf09 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 3d067871c391f5c6b199ccde21304802daae4826..87b6fdfe5fa5db6d06005c600a2b1099859e085e 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 5305c6f40290aec926b83915a36ada7d5ea09ac9..8205720d01cb38f306675d6280ecd9fb2ceb95bf 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 16c84d6cfa4a570093d2975d5e03b849487b8db7..a2ae236779f81bd8a9f3d0a944d8564370fd4033 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 0addfb608d317efe9ff3429a6f2f82347995ad56..d7367ea2ceea977091383d2126a13dffc77697cf 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 6e130d23d3f841413210476217c1bbd67fbc3670..63412d743a80eb4cb2f0a4e917a5f3006c22d7c1 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 6353cc6a7d951c79b420ecc1981de111883f37f7..5f01ba2ed8514cb2d6381ebcc7e1b4446d629113 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 0000000000000000000000000000000000000000..135f817cfd217796232a7a6edf10aa3cc0618479 --- /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 8b9fd6e1a6202ce500aae7f3970ef22ff7704fa3..b44af3dae2576818eeb4c6a95adbd3d23c34238c 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 71de934f586b72c56b0aa038bbd32ba6bfa0c057..7609976454c83fa6990d6ba4215cac1fc1c225e8 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 0000000000000000000000000000000000000000..a72132590d7ae30202ce27c269a9be6aa2ac8d6b --- /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 7c5ec567b8af83cd890678167b9a532b78d0aef0..b249995e746ed3df2649235924430eb76e55ef8c 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 648093074d6fa087fafc6b641e5ac46d9a942f8b..cef4e546e64561f005995f234f3f1e767dcc5b3e 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 0000000000000000000000000000000000000000..a0e725a356ca464cad51eca42f35ab4e28bd169e --- /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 0c017ccb5614d8c9c243fc40070c6ee74c35b859..492983b84d93fccc3bc966d12dcebd09f3b7e020 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 0000000000000000000000000000000000000000..b336ce60d6179988ee9b8d6edcda512b9eb80b10 --- /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 0000000000000000000000000000000000000000..810f81d57d5899459f554c2eca37dd776d7674a2 --- /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 cc5bf42d8cdc74857fccfc2ae3335ad80ff6e021..ca2b6c1b18b4a631b499534940164a2b8083a8dd 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 5097da6046215d4d65f291301a8a7271201e0bf1..5dd1112c82b2670876cfc34479fb666ee238f3c2 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 bf2fc4ab2916bd6cf7ff99837b936427964f1c2b..ed1d090b6f6946733b26d78bd26510efa27193ab 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 0000000000000000000000000000000000000000..208994af1a43e90435b563e9b03b5ac69deff9af --- /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 2985cfdbb1513e187896379aa16ab106bcf3c04b..cc412a56f0ba558d7e0c955f9032719a6a5d3c60 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 8e24a4b47374d061e44a1d910a5cf0e2c240f7a0..7d42953c23e3a408067cdd95a53078ef51b649e2 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 7927f9e30918e666e20c8252bd33355372872974..a31bdb938575314c86e9f977fbb4f78e2dfe2a02 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 a50a7da89f75964de04005a9e46b6a2f0075c616..d8f903d060211f29e0555fb6a2798070079256bc 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 113cd4d7fd2fd6afe8e12addf0593067e1cb3bb9..8874fbe398be0ff8a75f9319740501ca492c8faf 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 d5d533704bef7e0df23ee4b67683d134640acfcc..03e620bfb5d34c67db3cb5277368196d5bcd9ec9 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 9bfa48b2abd4e4e70a4cfca27c6fe742a9ab278c..f65244f90406c2d55ef64e93f020cf0e46b240e0 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 bbf4b542a6c2a0500d4e6593f75bbf0b39d95cc8..edfe2720cb0a1f06ec605ec89e4bec1109ba0216 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 3e4891796b35e5f78d775d135bb79e4e6c9d2343..58382300fe99b63df6ac88a11bfea36cd6d4ca52 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 cbce33bc87f6d4e79344179c67157b7654b075bb..48714d8bb1fb1d025929a228711e71ba445ddcf1 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 c89537d232f410ee7f49741e918b76e6b62a28b1..6419f022d134ae26a183dc0c39062b13fdd968c8 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 0000000000000000000000000000000000000000..31ffceac31270e25e2a38f1c474cf16d6dad4e11 --- /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 a5e2dc2bd3475e07c57ec5d0aed26ca9e2cbc6ae..82689aaa934ea1c843fa0e3248be742253cc7fda 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 = '';