diff --git a/CHANGELOG.md b/CHANGELOG.md index d601a36f59067..974e9df22c295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +2.0.0.0-dev53 +============= +* Moved general action-related functionality to \Magento\App\Action\Action in the library. Removed Magento\Core\Controller\Varien\Action and related logic from the Magento_Core module +* Moved view-related methods from action interface to \Magento\App\ViewInterface with corresponding implementation +* Moved redirect creation logic from the action interface to \Magento\App\Response\RedirectInterface +* Moved Magento\Core common blocks to the library +* Added reading of etc/integration/config.xml and etc/integration/api.xml files for API Integrations +* Various improvements: + * Email-related logic from the Core and Adminhtml modules consolidated in the new Email module +* GitHub requests: + * [#238](https://github.com/magento/magento2/pull/238) -- Improve escaping HTML entities in URL + * [#199](https://github.com/magento/magento2/pull/199) -- Replaced function calls to array_push with adding the elements directly + * [#182](https://github.com/magento/magento2/pull/182) -- By default use collection _idFieldName for toOption* methods. + * [#233](https://github.com/magento/magento2/pull/233) -- Google Rich Snippet Code + * [#339](https://github.com/magento/magento2/pull/339) -- Correcting 'cahce' typo in documentation. + * [#232](https://github.com/magento/magento2/pull/232) -- Update app/code/core/Mage/Checkout/controllers/CartController.php (fix issue #27632) +* Fixed bugs: + * Fixed JavaScript error when printing orders from the frontend + * Fixed Captcha problems on various forms when Captcha is enabled on the frontend + * Fixed "Page not found" on category page if setting "Add Store Code to Urls" to "Yes" in the backend config + * Fixed Fatal error when creating shipping label for returns + 2.0.0.0-dev52 ============= * Better Navigation menu rendering due to improved Caching of Categories @@ -53,7 +75,7 @@ * Moved the String Helper to the Magento\Filter, Magento\Stdlib\String, Magento\Stdlib\ArrayUtils libraries * Moved the Data Helper to the Magento\Math, Magento\Filter, Magento\Convert, Magento\Encryption, Magento\Filesystem libraries and to Magento\Customer\Helper\Data libraries * Moved the Http Magento Helper to the Magento\HTTP library - * The Hint Magento Helper, Http Magento Helper helpers were removed from the Magento\Core module + * The Hint Magento Helper, Http Magento Helper helpers were removed from the Magento\Core module * Implemented SOAP faults declaration in WSDL * Web API config reader was refactored to use Magento\Config\Reader\Filesystem * Created integrations module. Added 'Integrations Grid' and 'New/Edit' Integration pages in the admin diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index 29c4a227b7916..44e74e36cdeed 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -53,7 +53,7 @@ public function render(\Magento\Object $row) $this->getUrl('*/*/remove/', array( '_current'=>true, 'id' => $row->getId(), - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $encodedUrl) + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $encodedUrl) ), __('Are you sure?'), __('Remove') diff --git a/app/code/Magento/AdminNotification/Block/System/Messages.php b/app/code/Magento/AdminNotification/Block/System/Messages.php index af0ab84636270..ce984ccf27820 100644 --- a/app/code/Magento/AdminNotification/Block/System/Messages.php +++ b/app/code/Magento/AdminNotification/Block/System/Messages.php @@ -32,19 +32,19 @@ class Messages extends \Magento\Backend\Block\Template */ protected $_messages; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_messages = $messages; } diff --git a/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php b/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php index 2c509af6e2de5..95635f6103cdd 100644 --- a/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php +++ b/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php @@ -42,19 +42,19 @@ class UnreadMessagePopup extends \Magento\Backend\Block\Template */ protected $_messages; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_messages = $messages; } diff --git a/app/code/Magento/AdminNotification/Block/ToolbarEntry.php b/app/code/Magento/AdminNotification/Block/ToolbarEntry.php index 9df8fec4cc45a..3ad43a591176a 100644 --- a/app/code/Magento/AdminNotification/Block/ToolbarEntry.php +++ b/app/code/Magento/AdminNotification/Block/ToolbarEntry.php @@ -42,19 +42,19 @@ class ToolbarEntry extends \Magento\Backend\Block\Template */ protected $_notificationList; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_notificationList = $notificationList; } diff --git a/app/code/Magento/AdminNotification/Block/Window.php b/app/code/Magento/AdminNotification/Block/Window.php index 5f2ee757ddf42..a2116a9fb027f 100644 --- a/app/code/Magento/AdminNotification/Block/Window.php +++ b/app/code/Magento/AdminNotification/Block/Window.php @@ -60,21 +60,21 @@ class Window extends \Magento\Backend\Block\Template */ protected $_latestItem; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_authSession = $authSession; $this->_criticalCollection = $criticalCollection; } diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php index dc3c1078de4a2..e79c4a49bd58b 100644 --- a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php +++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php @@ -27,18 +27,19 @@ */ namespace Magento\AdminNotification\Controller\Adminhtml; -class Notification extends \Magento\Backend\Controller\AbstractAction +class Notification extends \Magento\Backend\App\AbstractAction { public function indexAction() { - $this->_title(__('Notifications')); + $this->_title->add(__('Notifications')); - $this->loadLayout() - ->_setActiveMenu('Magento_AdminNotification::system_adminnotification') + $this->_view->loadLayout(); + $this->_setActiveMenu('Magento_AdminNotification::system_adminnotification') ->_addBreadcrumb( __('Messages Inbox'), __('Messages Inbox') - )->renderLayout(); + ); + $this->_view->renderLayout(); } public function markAsReadAction() @@ -59,7 +60,7 @@ public function markAsReadAction() ); } - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); return; } $this->_redirect('adminhtml/*/'); @@ -174,7 +175,7 @@ public function massRemoveAction() __("We couldn't remove the messages because of an error.")); } } - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); } protected function _isAllowed() diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/Survey.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/Survey.php index f8d688ac87370..d66c585ef138e 100644 --- a/app/code/Magento/AdminNotification/Controller/Adminhtml/Survey.php +++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/Survey.php @@ -34,7 +34,7 @@ */ namespace Magento\AdminNotification\Controller\Adminhtml; -class Survey extends \Magento\Backend\Controller\Adminhtml\Action +class Survey extends \Magento\Backend\App\Action { /** * Index Action diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message.php index 17e26203ef0ac..49532c93c820f 100644 --- a/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message.php +++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message.php @@ -24,7 +24,7 @@ namespace Magento\AdminNotification\Controller\Adminhtml\System; -class Message extends \Magento\Backend\Controller\AbstractAction +class Message extends \Magento\Backend\App\AbstractAction { public function listAction() { diff --git a/app/code/Magento/AdminNotification/Helper/Data.php b/app/code/Magento/AdminNotification/Helper/Data.php index 24b0512350b5c..f117a74a51258 100644 --- a/app/code/Magento/AdminNotification/Helper/Data.php +++ b/app/code/Magento/AdminNotification/Helper/Data.php @@ -34,7 +34,7 @@ */ namespace Magento\AdminNotification\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { const XML_PATH_POPUP_URL = 'system/adminnotification/popup_url'; @@ -77,7 +77,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_inboxFactory; public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\AdminNotification\Model\InboxFactory $inboxFactory ) { diff --git a/app/code/Magento/AdminNotification/Model/Feed.php b/app/code/Magento/AdminNotification/Model/Feed.php index a0f94bf5ec8d5..4477bb68e9db7 100644 --- a/app/code/Magento/AdminNotification/Model/Feed.php +++ b/app/code/Magento/AdminNotification/Model/Feed.php @@ -58,17 +58,11 @@ class Feed extends \Magento\Core\Model\AbstractModel */ protected $_inboxFactory; - /** - * @var \Magento\App\CacheInterface - */ - protected $_cache; - /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory - * @param \Magento\App\CacheInterface $cache * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -78,7 +72,6 @@ public function __construct( \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\AdminNotification\Model\InboxFactory $inboxFactory, - \Magento\App\CacheInterface $cache, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -86,7 +79,6 @@ public function __construct( parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_coreStoreConfig = $coreStoreConfig; $this->_inboxFactory = $inboxFactory; - $this->_cache = $cache; } /** @@ -94,7 +86,9 @@ public function __construct( * */ protected function _construct() - {} + { + + } /** * Retrieve feed url @@ -174,7 +168,7 @@ public function getFrequency() */ public function getLastUpdate() { - return $this->_cache->load('admin_notifications_lastcheck'); + return $this->_cacheManager->load('admin_notifications_lastcheck'); } /** @@ -184,7 +178,7 @@ public function getLastUpdate() */ public function setLastUpdate() { - $this->_cache->save(time(), 'admin_notifications_lastcheck'); + $this->_cacheManager->save(time(), 'admin_notifications_lastcheck'); return $this; } diff --git a/app/code/Magento/Adminhtml/Block/Backup/Dialogs.php b/app/code/Magento/Adminhtml/Block/Backup/Dialogs.php index 673f91627b6bb..fc3499afd7885 100644 --- a/app/code/Magento/Adminhtml/Block/Backup/Dialogs.php +++ b/app/code/Magento/Adminhtml/Block/Backup/Dialogs.php @@ -45,7 +45,7 @@ class Dialogs extends \Magento\Adminhtml\Block\Template /** * Include backup.js file in page before rendering * - * @see \Magento\Core\Block\AbstractBlock::_prepareLayout() + * @see \Magento\View\Block\AbstractBlock::_prepareLayout() */ protected function _prepareLayout() { diff --git a/app/code/Magento/Adminhtml/Block/Denied.php b/app/code/Magento/Adminhtml/Block/Denied.php index d9c6b272f616a..96c0fa78b55a9 100644 --- a/app/code/Magento/Adminhtml/Block/Denied.php +++ b/app/code/Magento/Adminhtml/Block/Denied.php @@ -33,20 +33,20 @@ class Denied extends \Magento\Adminhtml\Block\Template */ protected $_authSession; - /** - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param array $data */ - public function __construct( - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Auth\Session $authSession, + array $data = array() + ) { $this->_authSession = $authSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function hasAvailableResources() diff --git a/app/code/Magento/Adminhtml/Block/Html/Date.php b/app/code/Magento/Adminhtml/Block/Html/Date.php index 3d67e24be1ec6..b66f44d120cbd 100644 --- a/app/code/Magento/Adminhtml/Block/Html/Date.php +++ b/app/code/Magento/Adminhtml/Block/Html/Date.php @@ -33,6 +33,6 @@ */ namespace Magento\Adminhtml\Block\Html; -class Date extends \Magento\Core\Block\Html\Date +class Date extends \Magento\View\Block\Html\Date { } diff --git a/app/code/Magento/Adminhtml/Block/Html/Select.php b/app/code/Magento/Adminhtml/Block/Html/Select.php index d3387a83f1c28..ace827710884f 100644 --- a/app/code/Magento/Adminhtml/Block/Html/Select.php +++ b/app/code/Magento/Adminhtml/Block/Html/Select.php @@ -33,6 +33,6 @@ */ namespace Magento\Adminhtml\Block\Html; -class Select extends \Magento\Core\Block\Html\Select +class Select extends \Magento\View\Block\Html\Select { } diff --git a/app/code/Magento/Adminhtml/Block/Media/Uploader.php b/app/code/Magento/Adminhtml/Block/Media/Uploader.php index e2b72f17e51fb..0cb0c9c6973d0 100644 --- a/app/code/Magento/Adminhtml/Block/Media/Uploader.php +++ b/app/code/Magento/Adminhtml/Block/Media/Uploader.php @@ -41,33 +41,25 @@ class Uploader extends \Magento\Adminhtml\Block\Widget */ protected $_template = 'Magento_Adminhtml::media/uploader.phtml'; - /** - * @var \Magento\View\Url - */ - protected $_viewUrl; - /** * @var \Magento\File\Size */ protected $_fileSizeService; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\View\Url $viewUrl - * @param \Magento\File\Size $fileSize - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\File\Size $fileSize + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\View\Url $viewUrl, - \Magento\File\Size $fileSize, - array $data = array() - ) { - $this->_viewUrl = $viewUrl; + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\File\Size $fileSize, + array $data = array() + ) { $this->_fileSizeService = $fileSize; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Messages.php b/app/code/Magento/Adminhtml/Block/Messages.php index e17a7284a32ee..93896f840b8b7 100644 --- a/app/code/Magento/Adminhtml/Block/Messages.php +++ b/app/code/Magento/Adminhtml/Block/Messages.php @@ -34,6 +34,6 @@ */ namespace Magento\Adminhtml\Block; -class Messages extends \Magento\Core\Block\Messages +class Messages extends \Magento\View\Block\Messages { } diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Problem.php b/app/code/Magento/Adminhtml/Block/Newsletter/Problem.php index c139adb9e5b50..7a9af30931af3 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Problem.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Problem.php @@ -43,20 +43,20 @@ class Problem extends \Magento\Adminhtml\Block\Template */ protected $_problemCollection; - /** - * @param \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection + * @param array $data */ - public function __construct( - \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection, + array $data = array() + ) { $this->_problemCollection = $problemCollection; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit.php b/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit.php index ffcd6e1866a8f..7dac9990abcdf 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit.php @@ -45,23 +45,23 @@ class Edit extends \Magento\Adminhtml\Block\Template */ protected $_wysiwygConfig; - /** - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit/Form.php index 40ce922592ad1..58a32c9340802 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Edit/Form.php @@ -51,30 +51,30 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_queueFactory; - /** - * @param \Magento\Newsletter\Model\QueueFactory $queueFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Newsletter\Model\QueueFactory $queueFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Newsletter\Model\QueueFactory $queueFactory, - \Magento\Core\Model\System\Store $systemStore, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Newsletter\Model\QueueFactory $queueFactory, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; $this->_systemStore = $systemStore; $this->_queueFactory = $queueFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Preview.php b/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Preview.php index 406e1e218fd48..e42e83e22f2b0 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Preview.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Queue/Preview.php @@ -50,26 +50,26 @@ class Preview extends \Magento\Adminhtml\Block\Widget */ protected $_subscriberFactory; - /** - * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory - * @param \Magento\Newsletter\Model\QueueFactory $queueFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory + * @param \Magento\Newsletter\Model\QueueFactory $queueFactory + * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param array $data */ - public function __construct( - \Magento\Newsletter\Model\TemplateFactory $templateFactory, - \Magento\Newsletter\Model\QueueFactory $queueFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Newsletter\Model\TemplateFactory $templateFactory, + \Magento\Newsletter\Model\QueueFactory $queueFactory, + \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + array $data = array() + ) { $this->_templateFactory = $templateFactory; $this->_queueFactory = $queueFactory; $this->_subscriberFactory = $subscriberFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _toHtml() diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber.php b/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber.php index f13d5c91f220a..77983dbce8d05 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber.php @@ -50,20 +50,20 @@ class Subscriber extends \Magento\Adminhtml\Block\Template */ protected $_collectionFactory; - /** - * @param \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid.php b/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid.php index 196316360e444..58d5307b946a5 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Backend\Block\Widget\Grid */ protected $_queueFactory; - /** - * @param \Magento\Newsletter\Model\QueueFactory $queueFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Newsletter\Model\QueueFactory $queueFactory + * @param array $data */ - public function __construct( - \Magento\Newsletter\Model\QueueFactory $queueFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Newsletter\Model\QueueFactory $queueFactory, + array $data = array() + ) { $this->_queueFactory = $queueFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php b/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php index 832de5c9ab655..69b889266f143 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php @@ -51,22 +51,22 @@ class Website */ protected $_websitesFactory; - /** - * @param \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\Resource\Helper $resourceHelper - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Core\Model\Resource\Helper $resourceHelper + * @param \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\Resource\Helper $resourceHelper, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Core\Model\Resource\Helper $resourceHelper, + \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_storeManager = $storeManager; $this->_websitesFactory = $websitesFactory; diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit.php b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit.php index 2c00dd1438285..e5e39f2044038 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit.php @@ -54,23 +54,23 @@ class Edit extends \Magento\Adminhtml\Block\Widget */ protected $_wysiwygConfig; - /** - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit/Form.php index e4739860bab80..aca73a4d27877 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Edit/Form.php @@ -41,24 +41,24 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_wysiwygConfig; - /** - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Grid.php b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Grid.php index 9c2f5ef483e3b..e065b186a583f 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_templateCollection; - /** - * @param \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection + * @param array $data */ - public function __construct( - \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection, + array $data = array() + ) { $this->_templateCollection = $templateCollection; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); $this->setEmptyText(__('No Templates Found')); } diff --git a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Preview.php b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Preview.php index 304eca2cb6d83..f60823e8bcd46 100644 --- a/app/code/Magento/Adminhtml/Block/Newsletter/Template/Preview.php +++ b/app/code/Magento/Adminhtml/Block/Newsletter/Template/Preview.php @@ -45,23 +45,23 @@ class Preview extends \Magento\Adminhtml\Block\Widget */ protected $_subscriberFactory; - /** - * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory + * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param array $data */ - public function __construct( - \Magento\Newsletter\Model\TemplateFactory $templateFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Newsletter\Model\TemplateFactory $templateFactory, + \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + array $data = array() + ) { $this->_templateFactory = $templateFactory; $this->_subscriberFactory = $subscriberFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _toHtml() diff --git a/app/code/Magento/Adminhtml/Block/Page.php b/app/code/Magento/Adminhtml/Block/Page.php index a1622bac45b68..db5845b304fa1 100644 --- a/app/code/Magento/Adminhtml/Block/Page.php +++ b/app/code/Magento/Adminhtml/Block/Page.php @@ -35,30 +35,8 @@ class Page extends \Magento\Backend\Block\Template { - protected $_template = 'admin/page.phtml'; - /** - * @var \Magento\Core\Model\App - */ - protected $_application; - - /** - * @param \Magento\Core\Model\App $application - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data - */ - public function __construct( - \Magento\Core\Model\App $application, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { - $this->_application = $application; - parent::__construct($coreData, $context, $data); - } - /** * Class constructor * @@ -67,10 +45,7 @@ protected function _construct() { parent::_construct(); - $action = $this->_application->getFrontController()->getAction(); - if ($action) { - $this->addBodyClass($action->getFullActionName('-')); - } + $this->addBodyClass($this->_request->getFullActionName('-')); } /** diff --git a/app/code/Magento/Adminhtml/Block/Page/Head.php b/app/code/Magento/Adminhtml/Block/Page/Head.php index f8b7a0a6d2ae8..f0c549d8ccb50 100644 --- a/app/code/Magento/Adminhtml/Block/Page/Head.php +++ b/app/code/Magento/Adminhtml/Block/Page/Head.php @@ -41,42 +41,42 @@ class Head extends \Magento\Page\Block\Html\Head protected $_template = 'page/head.phtml'; /** - * @var \Magento\Core\Model\Session + * @var \Magento\App\Action\Title */ - protected $_session; + protected $_titles; /** - * @param \Magento\Core\Model\Session $session - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\App\Dir $dir - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase * @param \Magento\ObjectManager $objectManager * @param \Magento\Core\Model\Page $page * @param \Magento\Core\Model\Page\Asset\MergeService $assetMergeService * @param \Magento\Core\Model\Page\Asset\MinifyService $assetMinifyService + * @param \Magento\App\Action\Title $titles * @param array $data */ public function __construct( - \Magento\Core\Model\Session $session, - \Magento\Core\Model\LocaleInterface $locale, - \Magento\App\Dir $dir, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase, \Magento\ObjectManager $objectManager, \Magento\Core\Model\Page $page, \Magento\Core\Model\Page\Asset\MergeService $assetMergeService, \Magento\Core\Model\Page\Asset\MinifyService $assetMinifyService, + \Magento\App\Action\Title $titles, array $data = array() ) { - $this->_session = $session; + $this->_titles = $titles; parent::__construct( - $locale, $dir, $storeManager, $fileStorageDatabase, $coreData, $context, $objectManager, $page, - $assetMergeService, $assetMinifyService, $data + $context, + $coreData, + $fileStorageDatabase, + $objectManager, + $page, + $assetMergeService, + $assetMinifyService, + $data ); } @@ -89,4 +89,22 @@ public function getFormKey() { return $this->_session->getFormKey(); } + + /** + * @return array|string + */ + public function getTitle() + { + /** Get default title */ + $title = parent::getTitle(); + + /** Add default title */ + $this->_titles->add($title, true); + + /** Set title list */ + $this->setTitle(array_reverse($this->_titles->get())); + + /** Render titles */ + return parent::getTitle(); + } } diff --git a/app/code/Magento/Adminhtml/Block/Page/Header.php b/app/code/Magento/Adminhtml/Block/Page/Header.php index 4c80e37bc1b85..88d99b1e169c6 100644 --- a/app/code/Magento/Adminhtml/Block/Page/Header.php +++ b/app/code/Magento/Adminhtml/Block/Page/Header.php @@ -49,23 +49,23 @@ class Header extends \Magento\Adminhtml\Block\Template */ protected $_authSession; - /** - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Backend\Helper\Data $backendData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Backend\Helper\Data $backendData + * @param array $data */ - public function __construct( - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Backend\Helper\Data $backendData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Backend\Helper\Data $backendData, + array $data = array() + ) { $this->_backendData = $backendData; $this->_authSession = $authSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getHomeLink() diff --git a/app/code/Magento/Adminhtml/Block/Page/System/Config/Robots/Reset.php b/app/code/Magento/Adminhtml/Block/Page/System/Config/Robots/Reset.php index 9334fab0c6c0e..481945d922f4b 100644 --- a/app/code/Magento/Adminhtml/Block/Page/System/Config/Robots/Reset.php +++ b/app/code/Magento/Adminhtml/Block/Page/System/Config/Robots/Reset.php @@ -42,22 +42,20 @@ class Reset extends \Magento\Backend\Block\System\Config\Form\Field */ protected $_pageRobots = null; - /** - * @param \Magento\Page\Helper\Robots $pageRobots - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Page\Helper\Robots $pageRobots + * @param array $data */ - public function __construct( - \Magento\Page\Helper\Robots $pageRobots, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Page\Helper\Robots $pageRobots, + array $data = array() + ) { $this->_pageRobots = $pageRobots; - parent::__construct($coreData, $context, $application, $data); + parent::__construct($context, $coreData, $data); } /* diff --git a/app/code/Magento/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php b/app/code/Magento/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php index fdf5086eb0c80..d5fdeb3b6d2f8 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php +++ b/app/code/Magento/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php @@ -35,31 +35,6 @@ class YtdStart extends \Magento\Backend\Block\System\Config\Form\Field { - /** - * Locale - * - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param array $data - */ - public function __construct( - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - array $data = array() - ) { - $this->_locale = $locale; - parent::__construct($coreData, $context, $application, $data); - } - protected function _getElementHtml(\Magento\Data\Form\Element\AbstractElement $element) { $_months = array(); diff --git a/app/code/Magento/Adminhtml/Block/Report/Grid/AbstractGrid.php b/app/code/Magento/Adminhtml/Block/Report/Grid/AbstractGrid.php index a91ef21a32b3e..2d729bcff5724 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Grid/AbstractGrid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Grid/AbstractGrid.php @@ -55,30 +55,28 @@ class AbstractGrid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_resourceFactory; - /** - * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory - * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory - * @param \Magento\Reports\Helper\Data $reportsData - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory + * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory + * @param \Magento\Reports\Helper\Data $reportsData + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory, - \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory, - \Magento\Reports\Helper\Data $reportsData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory, + \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory, + \Magento\Reports\Helper\Data $reportsData, + array $data = array() + ) { $this->_resourceFactory = $resourceFactory; $this->_collectionFactory = $collectionFactory; $this->_reportsData = $reportsData; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Product/Downloads/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Product/Downloads/Grid.php index 4cb3ae35647aa..92839062b4071 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Product/Downloads/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Product/Downloads/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_downloadsFactory; - /** - * @param \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory, + array $data = array() + ) { $this->_downloadsFactory = $downloadsFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Product/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Product/Grid.php index e760cd4082e3c..e5b71fae7b322 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Product/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Product/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_collectionFactory; - /** - * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Product/Lowstock/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Product/Lowstock/Grid.php index eb236302e84fd..5f415544878d0 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Product/Lowstock/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Product/Lowstock/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Backend\Block\Widget\Grid */ protected $_lowstocksFactory; - /** - * @param \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory, + array $data = array() + ) { $this->_lowstocksFactory = $lowstocksFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Report/Review/Detail.php b/app/code/Magento/Adminhtml/Block/Report/Review/Detail.php index 2164a5c577852..49fa91e3e2994 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Review/Detail.php +++ b/app/code/Magento/Adminhtml/Block/Report/Review/Detail.php @@ -41,20 +41,20 @@ class Detail extends \Magento\Adminhtml\Block\Widget\Grid\Container */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Review/Detail/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Review/Detail/Grid.php index 5ee344a390d3a..c8032a5ff018b 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Review/Detail/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Review/Detail/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_reviewsFactory; - /** - * @param \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory, + array $data = array() + ) { $this->_reviewsFactory = $reviewsFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Sales/Tax/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Sales/Tax/Grid.php index c0fd6e58ff293..cb23cc1d3b2b9 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Sales/Tax/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Sales/Tax/Grid.php @@ -42,32 +42,28 @@ class Grid extends \Magento\Adminhtml\Block\Report\Grid\AbstractGrid */ protected $_configFactory; - /** - * @param \Magento\Sales\Model\Order\ConfigFactory $configFactory - * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory - * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory - * @param \Magento\Reports\Helper\Data $reportsData - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory + * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory + * @param \Magento\Reports\Helper\Data $reportsData + * @param \Magento\Sales\Model\Order\ConfigFactory $configFactory + * @param array $data */ - public function __construct( - \Magento\Sales\Model\Order\ConfigFactory $configFactory, - \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory, - \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory, - \Magento\Reports\Helper\Data $reportsData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory, + \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory, + \Magento\Reports\Helper\Data $reportsData, + \Magento\Sales\Model\Order\ConfigFactory $configFactory, + array $data = array() + ) { $this->_configFactory = $configFactory; - parent::__construct( - $resourceFactory, $collectionFactory, $reportsData, $coreData, $context, $storeManager, $urlModel, $data - ); + parent::__construct($context, $coreData, $urlModel, $resourceFactory, $collectionFactory, $reportsData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php index 89335c849104a..cc77533f1d48e 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Adminhtml\Block\Report\Grid\Shopcart */ protected $_quotesFactory; - /** - * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, + array $data = array() + ) { $this->_quotesFactory = $quotesFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Shopcart/Customer/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Shopcart/Customer/Grid.php index 19d583493b8d6..d167a0e66d989 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Shopcart/Customer/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Shopcart/Customer/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Adminhtml\Block\Report\Grid\Shopcart */ protected $_customersFactory; - /** - * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory, + array $data = array() + ) { $this->_customersFactory = $customersFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Shopcart/Product/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Shopcart/Product/Grid.php index b755b3e65c64b..fb98870a7e1ba 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Shopcart/Product/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Shopcart/Product/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Adminhtml\Block\Report\Grid\Shopcart */ protected $_quotesFactory; - /** - * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, + array $data = array() + ) { $this->_quotesFactory = $quotesFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Report/Wishlist.php b/app/code/Magento/Adminhtml/Block/Report/Wishlist.php index a70d709edca0b..bb013103362c1 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Wishlist.php +++ b/app/code/Magento/Adminhtml/Block/Report/Wishlist.php @@ -52,20 +52,20 @@ class Wishlist extends \Magento\Backend\Block\Template */ protected $_wishlistFactory; - /** - * @param \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory, + array $data = array() + ) { $this->_wishlistFactory = $wishlistFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function _beforeToHtml() diff --git a/app/code/Magento/Adminhtml/Block/Report/Wishlist/Grid.php b/app/code/Magento/Adminhtml/Block/Report/Wishlist/Grid.php index 0267454e50b2d..d0a7e08aaa5f2 100644 --- a/app/code/Magento/Adminhtml/Block/Report/Wishlist/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Report/Wishlist/Grid.php @@ -40,24 +40,22 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_productsFactory; - /** - * @param \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory, + array $data = array() + ) { $this->_productsFactory = $productsFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Review/Add/Form.php b/app/code/Magento/Adminhtml/Block/Review/Add/Form.php index 49843a68a0457..57ab6ced96f39 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Add/Form.php +++ b/app/code/Magento/Adminhtml/Block/Review/Add/Form.php @@ -48,27 +48,27 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Review\Helper\Data $reviewData - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Review\Helper\Data $reviewData + * @param array $data */ - public function __construct( - \Magento\Core\Model\System\Store $systemStore, - \Magento\Review\Helper\Data $reviewData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Review\Helper\Data $reviewData, + array $data = array() + ) { $this->_reviewData = $reviewData; $this->_systemStore = $systemStore; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Adminhtml/Block/Review/Edit.php b/app/code/Magento/Adminhtml/Block/Review/Edit.php index 19aec3669700f..207148434d0c9 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Review/Edit.php @@ -50,26 +50,26 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_reviewFactory; - /** - * @param \Magento\Review\Model\ReviewFactory $reviewFactory - * @param \Magento\Review\Helper\Action\Pager $reviewActionPager - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Review\Model\ReviewFactory $reviewFactory + * @param \Magento\Review\Helper\Action\Pager $reviewActionPager + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Review\Model\ReviewFactory $reviewFactory, - \Magento\Review\Helper\Action\Pager $reviewActionPager, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Review\Model\ReviewFactory $reviewFactory, + \Magento\Review\Helper\Action\Pager $reviewActionPager, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_reviewActionPager = $reviewActionPager; $this->_reviewFactory = $reviewFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Review/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Review/Edit/Form.php index 41c5fac3f074c..7867f8a1923cf 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Review/Edit/Form.php @@ -53,33 +53,33 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Review\Helper\Data $reviewData - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Review\Helper\Data $reviewData + * @param array $data */ - public function __construct( - \Magento\Core\Model\System\Store $systemStore, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Review\Helper\Data $reviewData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Review\Helper\Data $reviewData, + array $data = array() + ) { $this->_reviewData = $reviewData; $this->_customerFactory = $customerFactory; $this->_productFactory = $productFactory; $this->_systemStore = $systemStore; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Adminhtml/Block/Review/Grid.php b/app/code/Magento/Adminhtml/Block/Review/Grid.php index 54ed13592fd3d..34758723c83cf 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Review/Grid.php @@ -72,36 +72,34 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_reviewFactory; - /** - * @param \Magento\Review\Model\ReviewFactory $reviewFactory - * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory - * @param \Magento\Review\Helper\Data $reviewData - * @param \Magento\Review\Helper\Action\Pager $reviewActionPager - * @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 \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Review\Model\ReviewFactory $reviewFactory + * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory + * @param \Magento\Review\Helper\Data $reviewData + * @param \Magento\Review\Helper\Action\Pager $reviewActionPager + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Review\Model\ReviewFactory $reviewFactory, - \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory, - \Magento\Review\Helper\Data $reviewData, - \Magento\Review\Helper\Action\Pager $reviewActionPager, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Review\Model\ReviewFactory $reviewFactory, + \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory, + \Magento\Review\Helper\Data $reviewData, + \Magento\Review\Helper\Action\Pager $reviewActionPager, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_productsFactory = $productsFactory; $this->_coreRegistry = $coreRegistry; $this->_reviewData = $reviewData; $this->_reviewActionPager = $reviewActionPager; $this->_reviewFactory = $reviewFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Review/Main.php b/app/code/Magento/Adminhtml/Block/Review/Main.php index e3be25f5e8e16..eac15d1f71317 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Main.php +++ b/app/code/Magento/Adminhtml/Block/Review/Main.php @@ -48,26 +48,26 @@ class Main extends \Magento\Adminhtml\Block\Widget\Grid\Container */ protected $_productFactory; - /** - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_customerFactory = $customerFactory; $this->_productFactory = $productFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Review/Product/Grid.php b/app/code/Magento/Adminhtml/Block/Review/Product/Grid.php index 3210efe0633ee..38038e6d01046 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Product/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Review/Product/Grid.php @@ -41,7 +41,9 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid protected $_websitesFactory; /** - * @param \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel * @param \Magento\Core\Model\WebsiteFactory $websiteFactory * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -49,16 +51,13 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid * @param \Magento\Catalog\Model\Product\Status $status * @param \Magento\Catalog\Model\Product\Visibility $visibility * @param \Magento\Catalog\Helper\Data $catalogData - * @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 \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory, + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, \Magento\Core\Model\WebsiteFactory $websiteFactory, \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -66,16 +65,22 @@ public function __construct( \Magento\Catalog\Model\Product\Status $status, \Magento\Catalog\Model\Product\Visibility $visibility, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, + \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory, array $data = array() ) { $this->_websitesFactory = $websitesFactory; parent::__construct( - $websiteFactory, $setsFactory, $productFactory, $type, $status, $visibility, $catalogData, $coreData, - $context, $storeManager, $urlModel, $data + $context, + $coreData, + $urlModel, + $websiteFactory, + $setsFactory, + $productFactory, + $type, + $status, + $visibility, + $catalogData, + $data ); } diff --git a/app/code/Magento/Adminhtml/Block/Review/Rating/Detailed.php b/app/code/Magento/Adminhtml/Block/Review/Rating/Detailed.php index 8c464d1a72476..aed4f848991f2 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Rating/Detailed.php +++ b/app/code/Magento/Adminhtml/Block/Review/Rating/Detailed.php @@ -52,26 +52,26 @@ class Detailed extends \Magento\Adminhtml\Block\Template */ protected $_votesFactory; - /** - * @param \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory - * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory + * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory, - \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory, + \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_ratingsFactory = $ratingsFactory; $this->_votesFactory = $votesFactory; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Review/Rating/Summary.php b/app/code/Magento/Adminhtml/Block/Review/Rating/Summary.php index b3d99b87b30a3..9cb9a4fd4713d 100644 --- a/app/code/Magento/Adminhtml/Block/Review/Rating/Summary.php +++ b/app/code/Magento/Adminhtml/Block/Review/Rating/Summary.php @@ -50,26 +50,26 @@ class Summary extends \Magento\Adminhtml\Block\Template */ protected $_ratingFactory; - /** - * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory - * @param \Magento\Rating\Model\RatingFactory $ratingFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory + * @param \Magento\Rating\Model\RatingFactory $ratingFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, - \Magento\Rating\Model\RatingFactory $ratingFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, + \Magento\Rating\Model\RatingFactory $ratingFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_votesFactory = $votesFactory; $this->_ratingFactory = $ratingFactory; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php b/app/code/Magento/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php index 01fbb2b0dac0d..6798661931b8f 100644 --- a/app/code/Magento/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php +++ b/app/code/Magento/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php @@ -60,27 +60,25 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory - * @param \Magento\Shipping\Model\Carrier\Tablerate $tablerate - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory + * @param \Magento\Shipping\Model\Carrier\Tablerate $tablerate + * @param array $data */ - public function __construct( - \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory, - \Magento\Shipping\Model\Carrier\Tablerate $tablerate, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory, + \Magento\Shipping\Model\Carrier\Tablerate $tablerate, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_tablerate = $tablerate; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Sitemap/Edit.php b/app/code/Magento/Adminhtml/Block/Sitemap/Edit.php index 813fb82a0a7d5..c9d7920924779 100644 --- a/app/code/Magento/Adminhtml/Block/Sitemap/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Sitemap/Edit.php @@ -42,20 +42,20 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Sitemap/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Sitemap/Edit/Form.php index 35e38bb6a1ef8..5122754073dbe 100644 --- a/app/code/Magento/Adminhtml/Block/Sitemap/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Sitemap/Edit/Form.php @@ -40,24 +40,24 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Core\Model\System\Store $systemStore - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Core\Model\System\Store $systemStore, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_systemStore = $systemStore; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php b/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php index 4637739196f5a..3baf481abd691 100644 --- a/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php +++ b/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php @@ -44,18 +44,18 @@ class Link extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\Abstract */ protected $_sitemapFactory; - /** - * @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Filesystem $filesystem - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory + * @param \Magento\Filesystem $filesystem + * @param array $data */ - public function __construct( - \Magento\Sitemap\Model\SitemapFactory $sitemapFactory, - \Magento\Backend\Block\Context $context, - \Magento\Filesystem $filesystem, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Sitemap\Model\SitemapFactory $sitemapFactory, + \Magento\Filesystem $filesystem, + array $data = array() + ) { $this->_sitemapFactory = $sitemapFactory; $this->_filesystem = $filesystem; parent::__construct($context, $data); diff --git a/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php b/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php index b66d948eed256..414d0bc23c795 100644 --- a/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php +++ b/app/code/Magento/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php @@ -39,16 +39,16 @@ class Time extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\Abstract */ protected $_date; - /** - * @param \Magento\Core\Model\Date $date - * @param \Magento\Backend\Block\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Core\Model\Date $date + * @param array $data */ - public function __construct( - \Magento\Core\Model\Date $date, - \Magento\Backend\Block\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Core\Model\Date $date, + array $data = array() + ) { $this->_date = $date; parent::__construct($context, $data); } diff --git a/app/code/Magento/Adminhtml/Block/Text/ListText.php b/app/code/Magento/Adminhtml/Block/Text/ListText.php index 5ae98bdcfe0a4..151cd4997b377 100644 --- a/app/code/Magento/Adminhtml/Block/Text/ListText.php +++ b/app/code/Magento/Adminhtml/Block/Text/ListText.php @@ -34,6 +34,6 @@ */ namespace Magento\Adminhtml\Block\Text; -class ListText extends \Magento\Core\Block\Text\ListText +class ListText extends \Magento\View\Block\Text\ListText { } diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite.php b/app/code/Magento/Adminhtml/Block/Urlrewrite.php index 12c52c2fa0d6e..cc6745ab12946 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite.php @@ -50,20 +50,20 @@ class Urlrewrite extends \Magento\Adminhtml\Block\Widget\Grid\Container */ protected $_urlrewriteSelector; - /** - * @param \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector + * @param array $data */ - public function __construct( - \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector, + array $data = array() + ) { $this->_urlrewriteSelector = $urlrewriteSelector; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php index eb63830d34ae5..5d36e90c52d30 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php @@ -45,24 +45,24 @@ class Edit */ protected $_categoryFactory; - /** - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { $this->_categoryFactory = $categoryFactory; - parent::__construct($rewriteFactory, $adminhtmlData, $coreData, $context, $data); + parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php index 112b806b4f929..385ae7a4063d5 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php @@ -61,30 +61,30 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, + \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + array $data = array() + ) { $this->_categoryFactory = $categoryFactory; $this->_productFactory = $productFactory; $this->_adminhtmlData = $adminhtmlData; - parent::__construct($categoryTree, $coreData, $context, $registry, $data); + parent::__construct($context, $coreData, $categoryTree, $registry, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php index 87e2bbf6f94ba..bfa806ad3afb2 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php @@ -61,45 +61,51 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form protected $_categoryFactory; /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Url $catalogUrl + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory * @param \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Backend\Helper\Data $adminhtmlData - * @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 \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Catalog\Model\Url $catalogUrl * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Catalog\Model\Url $catalogUrl, + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory, \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, \Magento\Core\Model\System\Store $systemStore, - \Magento\Backend\Model\Session $backendSession, \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Catalog\Model\Url $catalogUrl, array $data = array() ) { $this->_productFactory = $productFactory; $this->_categoryFactory = $categoryFactory; $this->_catalogUrl = $catalogUrl; parent::__construct( - $typesFactory, $optionFactory, $rewriteFactory, $systemStore, $backendSession, $adminhtmlData, $registry, - $formFactory, $coreData, $context, $data + $context, + $coreData, + $registry, + $formFactory, + $typesFactory, + $optionFactory, + $rewriteFactory, + $systemStore, + $adminhtmlData, + $data ); } diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php index 96799d5401edd..da37c7a96d35b 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php @@ -52,27 +52,27 @@ class Edit extends \Magento\Adminhtml\Block\Urlrewrite\Edit */ protected $_categoryFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { $this->_categoryFactory = $categoryFactory; $this->_productFactory = $productFactory; - parent::__construct($rewriteFactory, $adminhtmlData, $coreData, $context, $data); + parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php index 21b28ec5647ce..be91545f67ac0 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php @@ -43,24 +43,24 @@ class Edit extends \Magento\Adminhtml\Block\Urlrewrite\Edit */ protected $_pageFactory; - /** - * @param \Magento\Cms\Model\PageFactory $pageFactory - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param \Magento\Cms\Model\PageFactory $pageFactory + * @param array $data */ - public function __construct( - \Magento\Cms\Model\PageFactory $pageFactory, - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + \Magento\Cms\Model\PageFactory $pageFactory, + array $data = array() + ) { $this->_pageFactory = $pageFactory; - parent::__construct($rewriteFactory, $adminhtmlData, $coreData, $context, $data); + parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php index f7a1a53addb90..b066a10057747 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php @@ -54,42 +54,48 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form protected $_urlRewriteFactory; /** - * @param \Magento\Cms\Model\Page\UrlrewriteFactory $urlRewriteFactory - * @param \Magento\Cms\Model\PageFactory $pageFactory + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory * @param \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Backend\Helper\Data $adminhtmlData - * @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 \Magento\Cms\Model\Page\UrlrewriteFactory $urlRewriteFactory + * @param \Magento\Cms\Model\PageFactory $pageFactory * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Cms\Model\Page\UrlrewriteFactory $urlRewriteFactory, - \Magento\Cms\Model\PageFactory $pageFactory, + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory, \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, \Magento\Core\Model\System\Store $systemStore, - \Magento\Backend\Model\Session $backendSession, \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, + \Magento\Cms\Model\Page\UrlrewriteFactory $urlRewriteFactory, + \Magento\Cms\Model\PageFactory $pageFactory, array $data = array() ) { $this->_urlRewriteFactory = $urlRewriteFactory; $this->_pageFactory = $pageFactory; parent::__construct( - $typesFactory, $optionFactory, $rewriteFactory, $systemStore, $backendSession, $adminhtmlData, $registry, - $formFactory, $coreData, $context, $data + $context, + $coreData, + $registry, + $formFactory, + $typesFactory, + $optionFactory, + $rewriteFactory, + $systemStore, + $adminhtmlData, + $data ); } diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php index 9027b3d0fc0fe..62f85dd7de96d 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php @@ -69,23 +69,23 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Container */ protected $_rewriteFactory; - /** - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param array $data */ - public function __construct( - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + array $data = array() + ) { $this->_rewriteFactory = $rewriteFactory; $this->_adminhtmlData = $adminhtmlData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php index 7c2b06f3fe90c..640a40be19d16 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -69,11 +69,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_adminhtmlData = null; - /** - * @var \Magento\Backend\Model\Session - */ - protected $_backendSession; - /** * @var \Magento\Core\Model\System\Store */ @@ -95,40 +90,37 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic protected $_typesFactory; /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory * @param \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Backend\Helper\Data $adminhtmlData - * @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 * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, \Magento\Core\Model\Source\Urlrewrite\OptionsFactory $optionFactory, \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, \Magento\Core\Model\System\Store $systemStore, - \Magento\Backend\Model\Session $backendSession, \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, array $data = array() ) { $this->_typesFactory = $typesFactory; $this->_optionFactory = $optionFactory; $this->_rewriteFactory = $rewriteFactory; $this->_systemStore = $systemStore; - $this->_backendSession = $backendSession; $this->_adminhtmlData = $adminhtmlData; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php index 588f3dd61fd4b..b9e48dc84ac3e 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php @@ -37,7 +37,7 @@ */ namespace Magento\Adminhtml\Block\Urlrewrite; -class Link extends \Magento\Core\Block\AbstractBlock +class Link extends \Magento\View\Block\AbstractBlock { /** * Render output diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php index 26cdac523bb3d..f9c3d2557674b 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php @@ -33,7 +33,7 @@ */ namespace Magento\Adminhtml\Block\Urlrewrite; -class Selector extends \Magento\Core\Block\Template +class Selector extends \Magento\View\Block\Template { /** * List of available modes from source model diff --git a/app/code/Magento/Adminhtml/Controller/Newsletter/Problem.php b/app/code/Magento/Adminhtml/Controller/Newsletter/Problem.php index 149d34db364f1..e8a921042102c 100644 --- a/app/code/Magento/Adminhtml/Controller/Newsletter/Problem.php +++ b/app/code/Magento/Adminhtml/Controller/Newsletter/Problem.php @@ -33,27 +33,27 @@ */ namespace Magento\Adminhtml\Controller\Newsletter; -class Problem extends \Magento\Backend\Controller\Adminhtml\Action +class Problem extends \Magento\Backend\App\Action { public function indexAction() { - $this->_title(__('Newsletter Problems Report')); + $this->_title->add(__('Newsletter Problems Report')); if ($this->getRequest()->getQuery('ajax')) { $this->_forward('grid'); return; } - $this->getLayout()->getMessagesBlock()->setMessages( + $this->_view->getLayout()->getMessagesBlock()->setMessages( $this->_objectManager->get('Magento\Adminhtml\Model\Session')->getMessages(true) ); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Newsletter::newsletter_problem'); $this->_addBreadcrumb(__('Newsletter Problem Reports'), __('Newsletter Problem Reports')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function gridAction() @@ -89,10 +89,10 @@ public function gridAction() $this->_objectManager->get('Magento\Adminhtml\Model\Session') ->addSuccess(__('The problems you identified have been deleted.')); } - $this->getLayout()->getMessagesBlock()->setMessages($this->_objectManager->get('Magento\Adminhtml\Model\Session')->getMessages(true)); + $this->_view->getLayout()->getMessagesBlock()->setMessages($this->_objectManager->get('Magento\Adminhtml\Model\Session')->getMessages(true)); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } protected function _isAllowed() diff --git a/app/code/Magento/Adminhtml/Controller/Newsletter/Queue.php b/app/code/Magento/Adminhtml/Controller/Newsletter/Queue.php index 295f7f47b4f05..440e022e2ca8f 100644 --- a/app/code/Magento/Adminhtml/Controller/Newsletter/Queue.php +++ b/app/code/Magento/Adminhtml/Controller/Newsletter/Queue.php @@ -33,7 +33,7 @@ */ namespace Magento\Adminhtml\Controller\Newsletter; -class Queue extends \Magento\Backend\Controller\Adminhtml\Action +class Queue extends \Magento\Backend\App\Action { /** * Core registry @@ -43,11 +43,11 @@ class Queue extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -59,20 +59,20 @@ public function __construct( */ public function indexAction() { - $this->_title(__('Newsletter Queue')); + $this->_title->add(__('Newsletter Queue')); if ($this->getRequest()->getQuery('ajax')) { $this->_forward('grid'); return; } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Newsletter::newsletter_queue'); $this->_addBreadcrumb(__('Newsletter Queue'), __('Newsletter Queue')); - $this->renderLayout(); + $this->_view->renderLayout(); } @@ -81,8 +81,8 @@ public function indexAction() */ public function dropAction() { - $this->loadLayout('newsletter_queue_preview'); - $this->renderLayout(); + $this->_view->loadLayout('newsletter_queue_preview'); + $this->_view->renderLayout(); } /** @@ -90,10 +90,10 @@ public function dropAction() */ public function previewAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $data = $this->getRequest()->getParams(); if (empty($data) || !isset($data['id'])) { - $this->_forward('noRoute'); + $this->_forward('noroute'); return $this; } @@ -101,8 +101,8 @@ public function previewAction() $data['preview_store_id'] = $this->_objectManager->get('Magento\Core\Model\StoreManager') ->getDefaultStoreView()->getId(); - $this->getLayout()->getBlock('preview_form')->setFormData($data); - $this->renderLayout(); + $this->_view->getLayout()->getBlock('preview_form')->setFormData($data); + $this->_view->renderLayout(); } /** @@ -110,8 +110,8 @@ public function previewAction() */ public function gridAction() { - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } public function startAction() @@ -202,7 +202,7 @@ public function sendingAction() public function editAction() { - $this->_title(__('Newsletter Queue')); + $this->_title->add(__('Newsletter Queue')); $this->_coreRegistry->register('current_queue', $this->_objectManager->get('Magento\Newsletter\Model\Queue')); @@ -216,9 +216,9 @@ public function editAction() $queue = $this->_coreRegistry->registry('current_queue')->setTemplateId($template->getId()); } - $this->_title(__('Edit Queue')); + $this->_title->add(__('Edit Queue')); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Newsletter::newsletter_queue'); @@ -229,7 +229,7 @@ public function editAction() ); $this->_addBreadcrumb(__('Edit Queue'), __('Edit Queue')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function saveAction() @@ -289,7 +289,7 @@ public function saveAction() if ($id) { $this->_redirect('adminhtml/*/edit', array('id' => $id)); } else { - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); } } } diff --git a/app/code/Magento/Adminhtml/Controller/Newsletter/Subscriber.php b/app/code/Magento/Adminhtml/Controller/Newsletter/Subscriber.php index a768e0bad6913..a91f652f1266f 100644 --- a/app/code/Magento/Adminhtml/Controller/Newsletter/Subscriber.php +++ b/app/code/Magento/Adminhtml/Controller/Newsletter/Subscriber.php @@ -33,32 +33,48 @@ */ namespace Magento\Adminhtml\Controller\Newsletter; -class Subscriber extends \Magento\Backend\Controller\Adminhtml\Action +class Subscriber extends \Magento\Backend\App\Action { + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\App\Response\Http\FileFactory $fileFactory + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\App\Response\Http\FileFactory $fileFactory + ) { + $this->_fileFactory = $fileFactory; + parent::__construct($context); + } public function indexAction() { - $this->_title(__('Newsletter Subscribers')); + $this->_title->add(__('Newsletter Subscribers')); if ($this->getRequest()->getParam('ajax')) { $this->_forward('grid'); return; } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Newsletter::newsletter_subscriber'); $this->_addBreadcrumb(__('Newsletter'), __('Newsletter')); $this->_addBreadcrumb(__('Subscribers'), __('Subscribers')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function gridAction() { - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -66,11 +82,11 @@ public function gridAction() */ public function exportCsvAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'subscribers.csv'; - $content = $this->getLayout()->getChildBlock('adminhtml.newslettrer.subscriber.grid', 'grid.export'); + $content = $this->_view->getLayout()->getChildBlock('adminhtml.newslettrer.subscriber.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $content->getCsvFile($fileName)); + return $this->_fileFactory->create($fileName, $content->getCsvFile($fileName)); } /** @@ -78,10 +94,10 @@ public function exportCsvAction() */ public function exportXmlAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'subscribers.xml'; - $content = $this->getLayout()->getChildBlock('adminhtml.newslettrer.subscriber.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $content->getExcelFile($fileName)); + $content = $this->_view->getLayout()->getChildBlock('adminhtml.newslettrer.subscriber.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $content->getExcelFile($fileName)); } public function massUnsubscribeAction() diff --git a/app/code/Magento/Adminhtml/Controller/Newsletter/Template.php b/app/code/Magento/Adminhtml/Controller/Newsletter/Template.php index 9b17d8cf37ebf..53537fe7b0823 100644 --- a/app/code/Magento/Adminhtml/Controller/Newsletter/Template.php +++ b/app/code/Magento/Adminhtml/Controller/Newsletter/Template.php @@ -32,7 +32,7 @@ */ namespace Magento\Adminhtml\Controller\Newsletter; -class Template extends \Magento\Backend\Controller\Adminhtml\Action +class Template extends \Magento\Backend\App\Action { /** * Core registry @@ -40,13 +40,12 @@ class Template extends \Magento\Backend\Controller\Adminhtml\Action * @var \Magento\Core\Model\Registry */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -71,7 +70,7 @@ protected function _isAllowed() */ protected function _setTitle() { - return $this->_title(__('Newsletter Templates')); + return $this->_title->add(__('Newsletter Templates')); } /** @@ -86,11 +85,11 @@ public function indexAction() $this->_forward('grid'); return; } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Newsletter::newsletter_template'); $this->_addBreadcrumb(__('Newsletter Templates'), __('Newsletter Templates')); - $this->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Newsletter\Template', 'template')); - $this->renderLayout(); + $this->_addContent($this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Newsletter\Template', 'template')); + $this->_view->renderLayout(); } /** @@ -99,8 +98,8 @@ public function indexAction() */ public function gridAction() { - $this->loadLayout(); - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Newsletter\Template\Grid') + $this->_view->loadLayout(); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Newsletter\Template\Grid') ->toHtml(); $this->getResponse()->setBody($grid); } @@ -130,7 +129,7 @@ public function editAction() $this->_coreRegistry->register('_current_template', $model); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Newsletter::newsletter_template'); if ($model->getId()) { @@ -141,7 +140,7 @@ public function editAction() $breadcrumbLabel = __('Create Newsletter Template'); } - $this->_title($model->getId() ? $model->getTemplateCode() : __('New Template')); + $this->_title->add($model->getId() ? $model->getTemplateCode() : __('New Template')); $this->_addBreadcrumb($breadcrumbLabel, $breadcrumbTitle); @@ -151,12 +150,12 @@ public function editAction() $model->addData($values); } - $editBlock = $this->getLayout()->getBlock('template_edit'); + $editBlock = $this->_view->getLayout()->getBlock('template_edit'); if ($editBlock) { $editBlock->setEditMode($model->getId() > 0); } - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -165,8 +164,8 @@ public function editAction() */ public function dropAction() { - $this->loadLayout('newsletter_template_preview'); - $this->renderLayout(); + $this->_view->loadLayout('newsletter_template_preview'); + $this->_view->renderLayout(); } /** @@ -259,11 +258,11 @@ public function deleteAction() public function previewAction() { $this->_setTitle(); - $this->loadLayout(); + $this->_view->loadLayout(); $data = $this->getRequest()->getParams(); if (empty($data) || !isset($data['id'])) { - $this->_forward('noRoute'); + $this->_forward('noroute'); return $this; } @@ -271,7 +270,7 @@ public function previewAction() $data['preview_store_id'] = $this->_objectManager->get('Magento\Core\Model\StoreManager') ->getDefaultStoreView()->getId(); - $this->getLayout()->getBlock('preview_form')->setFormData($data); - $this->renderLayout(); + $this->_view->getLayout()->getBlock('preview_form')->setFormData($data); + $this->_view->renderLayout(); } } diff --git a/app/code/Magento/Adminhtml/Controller/Report.php b/app/code/Magento/Adminhtml/Controller/Report.php index c550488c9bf4f..45ed4c367ed34 100644 --- a/app/code/Magento/Adminhtml/Controller/Report.php +++ b/app/code/Magento/Adminhtml/Controller/Report.php @@ -33,26 +33,43 @@ */ namespace Magento\Adminhtml\Controller; -class Report extends \Magento\Backend\Controller\Adminhtml\Action +class Report extends \Magento\Backend\App\Action { + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\App\Response\Http\FileFactory $fileFactory + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\App\Response\Http\FileFactory $fileFactory + ) { + $this->_fileFactory = $fileFactory; + parent::__construct($context); + } + public function _initAction() { - $this->loadLayout() - ->_addBreadcrumb(__('Reports'), __('Reports')); + $this->_view->loadLayout(); + $this->_addBreadcrumb(__('Reports'), __('Reports')); return $this; } public function searchAction() { - $this->_title(__('Search Terms Report')); + $this->_title->add(__('Search Terms Report')); $this->_eventManager->dispatch('on_view_report', array('report' => 'search')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_search') - ->_addBreadcrumb(__('Search Terms'), __('Search Terms')) - ->renderLayout(); + ->_addBreadcrumb(__('Search Terms'), __('Search Terms')); + $this->_view->renderLayout(); } /** @@ -60,9 +77,9 @@ public function searchAction() */ public function exportSearchCsvAction() { - $this->loadLayout(false); - $content = $this->getLayout()->getChildBlock('adminhtml.report.search.grid', 'grid.export'); - $this->_prepareDownloadResponse('search.csv', $content->getCsvFile()); + $this->_view->loadLayout(false); + $content = $this->_view->getLayout()->getChildBlock('adminhtml.report.search.grid', 'grid.export'); + return $this->_fileFactory->create('search.csv', $content->getCsvFile()); } /** @@ -70,9 +87,9 @@ public function exportSearchCsvAction() */ public function exportSearchExcelAction() { - $this->loadLayout(false); - $content = $this->getLayout()->getChildBlock('adminhtml.report.search.grid', 'grid.export'); - $this->_prepareDownloadResponse('search.xml', $content->getExcelFile()); + $this->_view->loadLayout(false); + $content = $this->_view->getLayout()->getChildBlock('adminhtml.report.search.grid', 'grid.export'); + return $this->_fileFactory->create('search.xml', $content->getExcelFile()); } protected function _isAllowed() diff --git a/app/code/Magento/Adminhtml/Controller/Report/AbstractReport.php b/app/code/Magento/Adminhtml/Controller/Report/AbstractReport.php index 5d6a4d569e63e..21c7d398f839a 100644 --- a/app/code/Magento/Adminhtml/Controller/Report/AbstractReport.php +++ b/app/code/Magento/Adminhtml/Controller/Report/AbstractReport.php @@ -34,8 +34,33 @@ */ namespace Magento\Adminhtml\Controller\Report; -abstract class AbstractReport extends \Magento\Backend\Controller\Adminhtml\Action +abstract class AbstractReport extends \Magento\Backend\App\Action { + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + + /** + * @var \Magento\Core\Filter\Date + */ + protected $_dateFilter; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Core\Filter\Date $dateFilter + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Core\Filter\Date $dateFilter + ) { + parent::__construct($context); + $this->_fileFactory = $fileFactory; + $this->_dateFilter = $dateFilter; + } + /** * Admin session model * @@ -63,8 +88,8 @@ protected function _getSession() */ public function _initAction() { - $this->loadLayout() - ->_addBreadcrumb(__('Reports'), __('Reports')); + $this->_view->loadLayout(); + $this->_addBreadcrumb(__('Reports'), __('Reports')); return $this; } @@ -82,7 +107,9 @@ public function _initReportAction($blocks) $requestData = $this->_objectManager->get('Magento\Adminhtml\Helper\Data') ->prepareFilterString($this->getRequest()->getParam('filter')); - $requestData = $this->_filterDates($requestData, array('from', 'to')); + $inputFilter = new \Zend_Filter_Input(array('from' => $this->_dateFilter, 'to' => $this->_dateFilter), + array(), $requestData); + $requestData = $inputFilter->getUnescaped(); $requestData['store_ids'] = $this->getRequest()->getParam('store_ids'); $params = new \Magento\Object(); diff --git a/app/code/Magento/Adminhtml/Controller/Report/Customer.php b/app/code/Magento/Adminhtml/Controller/Report/Customer.php index ad5fcdb9f808b..da40a61d283b6 100644 --- a/app/code/Magento/Adminhtml/Controller/Report/Customer.php +++ b/app/code/Magento/Adminhtml/Controller/Report/Customer.php @@ -34,8 +34,25 @@ */ namespace Magento\Adminhtml\Controller\Report; -class Customer extends \Magento\Backend\Controller\Adminhtml\Action +class Customer extends \Magento\Backend\App\Action { + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\App\Response\Http\FileFactory $fileFactory + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\App\Response\Http\FileFactory $fileFactory + ) { + $this->_fileFactory = $fileFactory; + parent::__construct($context); + } + public function _initAction() { $act = $this->getRequest()->getActionName(); @@ -43,29 +60,29 @@ public function _initAction() $act = 'default'; } - $this->loadLayout() - ->_addBreadcrumb( - __('Reports'), - __('Reports') - ) - ->_addBreadcrumb( - __('Customers'), - __('Customers') - ); + $this->_view->loadLayout(); + $this->_addBreadcrumb( + __('Reports'), + __('Reports') + ); + $this->_addBreadcrumb( + __('Customers'), + __('Customers') + ); return $this; } public function accountsAction() { - $this->_title(__('New Accounts Report')); + $this->_title->add(__('New Accounts Report')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_customers_accounts') ->_addBreadcrumb( __('New Accounts'), __('New Accounts') - ) - ->renderLayout(); + ); + $this->_view->renderLayout(); } /** @@ -73,11 +90,11 @@ public function accountsAction() */ public function exportAccountsCsvAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'new_accounts.csv'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getCsvFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile()); } /** @@ -85,22 +102,22 @@ public function exportAccountsCsvAction() */ public function exportAccountsExcelAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'new_accounts.xml'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getExcelFile($fileName)); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile($fileName)); } public function ordersAction() { - $this->_title(__('Order Count Report')); + $this->_title->add(__('Order Count Report')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_customers_orders') ->_addBreadcrumb(__('Customers by Number of Orders'), - __('Customers by Number of Orders')) - ->renderLayout(); + __('Customers by Number of Orders')); + $this->_view->renderLayout(); } /** @@ -108,11 +125,11 @@ public function ordersAction() */ public function exportOrdersCsvAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'customers_orders.csv'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getCsvFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile()); } /** @@ -120,22 +137,22 @@ public function exportOrdersCsvAction() */ public function exportOrdersExcelAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'customers_orders.xml'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getExcelFile($fileName)); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile($fileName)); } public function totalsAction() { - $this->_title(__('Order Total Report')); + $this->_title->add(__('Order Total Report')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_customers_totals') ->_addBreadcrumb(__('Customers by Orders Total'), - __('Customers by Orders Total')) - ->renderLayout(); + __('Customers by Orders Total')); + $this->_view->renderLayout(); } /** @@ -143,11 +160,11 @@ public function totalsAction() */ public function exportTotalsCsvAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'customer_totals.csv'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getCsvFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile()); } /** @@ -155,11 +172,11 @@ public function exportTotalsCsvAction() */ public function exportTotalsExcelAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'customer_totals.xml'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getExcelFile($fileName)); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile($fileName)); } protected function _isAllowed() diff --git a/app/code/Magento/Adminhtml/Controller/Report/Product.php b/app/code/Magento/Adminhtml/Controller/Report/Product.php index 356c49ddbf85a..5365f1e4a9f9b 100644 --- a/app/code/Magento/Adminhtml/Controller/Report/Product.php +++ b/app/code/Magento/Adminhtml/Controller/Report/Product.php @@ -57,14 +57,14 @@ public function _initAction() */ public function soldAction() { - $this->_title(__('Ordered Products Report')); + $this->_title->add(__('Ordered Products Report')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_products_sold') ->_addBreadcrumb( __('Products Ordered'), __('Products Ordered') - ) - ->renderLayout(); + ); + $this->_view->renderLayout(); } /** @@ -73,11 +73,11 @@ public function soldAction() */ public function exportSoldCsvAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'products_ordered.csv'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getCsvFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile()); } /** @@ -86,11 +86,11 @@ public function exportSoldCsvAction() */ public function exportSoldExcelAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $fileName = 'products_ordered.xml'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getExcelFile($fileName)); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile($fileName)); } /** @@ -99,7 +99,7 @@ public function exportSoldExcelAction() */ public function viewedAction() { - $this->_title(__('Product Views Report')); + $this->_title->add(__('Product Views Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_PRODUCT_VIEWED_FLAG_CODE, 'viewed'); @@ -110,15 +110,15 @@ public function viewedAction() __('Products Most Viewed Report') ); - $gridBlock = $this->getLayout()->getBlock('report_product_viewed.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_product_viewed.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -128,9 +128,9 @@ public function viewedAction() public function exportViewedCsvAction() { $fileName = 'products_mostviewed.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Viewed\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Viewed\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -140,9 +140,9 @@ public function exportViewedCsvAction() public function exportViewedExcelAction() { $fileName = 'products_mostviewed.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Viewed\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Viewed\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } /** @@ -151,7 +151,7 @@ public function exportViewedExcelAction() */ public function lowstockAction() { - $this->_title(__('Low Stock Report')); + $this->_title->add(__('Low Stock Report')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_products_lowstock') @@ -159,7 +159,7 @@ public function lowstockAction() __('Low Stock'), __('Low Stock') ); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -168,10 +168,11 @@ public function lowstockAction() */ public function exportLowstockCsvAction() { - $this->loadLayout(false); + $this->_view->loadLayout(false); $fileName = 'products_lowstock.csv'; - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.block.report.product.lowstock.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getCsvFile()); + $exportBlock = $this->_view->getLayout() + ->getChildBlock('adminhtml.block.report.product.lowstock.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile()); } /** @@ -180,10 +181,11 @@ public function exportLowstockCsvAction() */ public function exportLowstockExcelAction() { - $this->loadLayout(false); + $this->_view->loadLayout(false); $fileName = 'products_lowstock.xml'; - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.block.report.product.lowstock.grid', 'grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getExcelFile()); + $exportBlock = $this->_view->getLayout() + ->getChildBlock('adminhtml.block.report.product.lowstock.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile()); } /** @@ -192,7 +194,7 @@ public function exportLowstockExcelAction() */ public function downloadsAction() { - $this->_title(__('Downloads Report')); + $this->_title->add(__('Downloads Report')); $this->_initAction() ->_setActiveMenu('Magento_Downloadable::report_products_downloads') @@ -200,8 +202,10 @@ public function downloadsAction() __('Downloads'), __('Downloads') ) - ->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Downloads')) - ->renderLayout(); + ->_addContent( + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Downloads') + ); + $this->_view->renderLayout(); } /** @@ -211,11 +215,11 @@ public function downloadsAction() public function exportDownloadsCsvAction() { $fileName = 'products_downloads.csv'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Downloads\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Downloads\Grid') ->setSaveParametersInSession(true) ->getCsv(); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } /** @@ -225,11 +229,11 @@ public function exportDownloadsCsvAction() public function exportDownloadsExcelAction() { $fileName = 'products_downloads.xml'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Downloads\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Product\Downloads\Grid') ->setSaveParametersInSession(true) ->getExcel($fileName); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } /** diff --git a/app/code/Magento/Adminhtml/Controller/Report/Review.php b/app/code/Magento/Adminhtml/Controller/Report/Review.php index d6ad16dbd667f..8e4fe66345a5e 100644 --- a/app/code/Magento/Adminhtml/Controller/Report/Review.php +++ b/app/code/Magento/Adminhtml/Controller/Report/Review.php @@ -33,25 +33,42 @@ */ namespace Magento\Adminhtml\Controller\Report; -class Review extends \Magento\Backend\Controller\Adminhtml\Action +class Review extends \Magento\Backend\App\Action { + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\App\Response\Http\FileFactory $fileFactory + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\App\Response\Http\FileFactory $fileFactory + ) { + $this->_fileFactory = $fileFactory; + parent::__construct($context); + } + public function _initAction() { - $this->loadLayout() - ->_addBreadcrumb( - __('Reports'), - __('Reports') - ) - ->_addBreadcrumb( - __('Review'), - __('Reviews') - ); + $this->_view->loadLayout(); + $this->_addBreadcrumb( + __('Reports'), + __('Reports') + ); + $this->_addBreadcrumb( + __('Review'), + __('Reviews') + ); return $this; } public function customerAction() { - $this->_title(__('Customer Reviews Report')); + $this->_title->add(__('Customer Reviews Report')); $this->_initAction() ->_setActiveMenu('Magento_Review::report_review_customer') @@ -59,7 +76,7 @@ public function customerAction() __('Customers Report'), __('Customers Report') ); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -67,10 +84,10 @@ public function customerAction() */ public function exportCustomerCsvAction() { - $this->loadLayout(false); + $this->_view->loadLayout(false); $fileName = 'review_customer.csv'; - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.block.report.review.customer.grid','grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getCsvFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.block.report.review.customer.grid','grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile()); } /** @@ -78,16 +95,16 @@ public function exportCustomerCsvAction() */ public function exportCustomerExcelAction() { - $this->loadLayout(false); + $this->_view->loadLayout(false); $fileName = 'review_customer.xml'; - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.block.report.review.customer.grid','grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getExcelFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.block.report.review.customer.grid','grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile()); } public function productAction() { - $this->_title(__('Product Reviews Report')); + $this->_title->add(__('Product Reviews Report')); $this->_initAction() ->_setActiveMenu('Magento_Review::report_review_product') @@ -95,7 +112,7 @@ public function productAction() __('Products Report'), __('Products Report') ); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -103,10 +120,10 @@ public function productAction() */ public function exportProductCsvAction() { - $this->loadLayout(false); + $this->_view->loadLayout(false); $fileName = 'review_product.csv'; - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.block.report.review.product.grid','grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getCsvFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.block.report.review.product.grid','grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile()); } /** @@ -114,22 +131,24 @@ public function exportProductCsvAction() */ public function exportProductExcelAction() { - $this->loadLayout(false); + $this->_view->loadLayout(false); $fileName = 'review_product.xml'; - $exportBlock = $this->getLayout()->getChildBlock('adminhtml.block.report.review.product.grid','grid.export'); - $this->_prepareDownloadResponse($fileName, $exportBlock->getExcelFile()); + $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.block.report.review.product.grid','grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile()); } public function productDetailAction() { - $this->_title(__('Details')); + $this->_title->add(__('Details')); $this->_initAction() ->_setActiveMenu('Magento_Review::report_review') ->_addBreadcrumb(__('Products Report'), __('Products Report')) ->_addBreadcrumb(__('Product Reviews'), __('Product Reviews')) - ->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Review\Detail')) - ->renderLayout(); + ->_addContent( + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Review\Detail') + ); + $this->_view->renderLayout(); } /** @@ -138,10 +157,10 @@ public function productDetailAction() public function exportProductDetailCsvAction() { $fileName = 'review_product_detail.csv'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Review\Detail\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Review\Detail\Grid') ->getCsv(); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } /** @@ -150,10 +169,10 @@ public function exportProductDetailCsvAction() public function exportProductDetailExcelAction() { $fileName = 'review_product_detail.xml'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Review\Detail\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Review\Detail\Grid') ->getExcel($fileName); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } protected function _isAllowed() diff --git a/app/code/Magento/Adminhtml/Controller/Report/Sales.php b/app/code/Magento/Adminhtml/Controller/Report/Sales.php index e99b0c8cad37a..4a02b2853ea1b 100644 --- a/app/code/Magento/Adminhtml/Controller/Report/Sales.php +++ b/app/code/Magento/Adminhtml/Controller/Report/Sales.php @@ -49,7 +49,7 @@ public function _initAction() public function salesAction() { - $this->_title(__('Sales Report')); + $this->_title->add(__('Sales Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_ORDER_FLAG_CODE, 'sales'); @@ -57,20 +57,20 @@ public function salesAction() ->_setActiveMenu('Magento_Reports::report_salesroot_sales') ->_addBreadcrumb(__('Sales Report'), __('Sales Report')); - $gridBlock = $this->getLayout()->getBlock('report_sales_sales.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_sales_sales.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } public function bestsellersAction() { - $this->_title(__('Best Sellers Report')); + $this->_title->add(__('Best Sellers Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_BESTSELLERS_FLAG_CODE, 'bestsellers'); @@ -78,15 +78,15 @@ public function bestsellersAction() ->_setActiveMenu('Magento_Reports::report_products_bestsellers') ->_addBreadcrumb(__('Products Bestsellers Report'), __('Products Bestsellers Report')); - $gridBlock = $this->getLayout()->getBlock('report_sales_bestsellers.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_sales_bestsellers.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -95,9 +95,9 @@ public function bestsellersAction() public function exportBestsellersCsvAction() { $fileName = 'bestsellers.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Bestsellers\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Bestsellers\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -106,9 +106,9 @@ public function exportBestsellersCsvAction() public function exportBestsellersExcelAction() { $fileName = 'bestsellers.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Bestsellers\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Bestsellers\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } /** @@ -137,9 +137,9 @@ public function refreshLifetimeAction() public function exportSalesCsvAction() { $fileName = 'sales.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Sales\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Sales\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -148,14 +148,14 @@ public function exportSalesCsvAction() public function exportSalesExcelAction() { $fileName = 'sales.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Sales\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Sales\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } public function taxAction() { - $this->_title(__('Tax Report')); + $this->_title->add(__('Tax Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_TAX_FLAG_CODE, 'tax'); @@ -163,15 +163,15 @@ public function taxAction() ->_setActiveMenu('Magento_Reports::report_salesroot_tax') ->_addBreadcrumb(__('Tax'), __('Tax')); - $gridBlock = $this->getLayout()->getBlock('report_sales_tax.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_sales_tax.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -180,9 +180,9 @@ public function taxAction() public function exportTaxCsvAction() { $fileName = 'tax.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Tax\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Tax\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -191,14 +191,14 @@ public function exportTaxCsvAction() public function exportTaxExcelAction() { $fileName = 'tax.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Tax\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Tax\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } public function shippingAction() { - $this->_title(__('Shipping Report')); + $this->_title->add(__('Shipping Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_SHIPPING_FLAG_CODE, 'shipping'); @@ -206,15 +206,15 @@ public function shippingAction() ->_setActiveMenu('Magento_Reports::report_salesroot_shipping') ->_addBreadcrumb(__('Shipping'), __('Shipping')); - $gridBlock = $this->getLayout()->getBlock('report_sales_shipping.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_sales_shipping.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -223,9 +223,9 @@ public function shippingAction() public function exportShippingCsvAction() { $fileName = 'shipping.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Shipping\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Shipping\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -234,14 +234,14 @@ public function exportShippingCsvAction() public function exportShippingExcelAction() { $fileName = 'shipping.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Shipping\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Shipping\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } public function invoicedAction() { - $this->_title(__('Invoice Report')); + $this->_title->add(__('Invoice Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_INVOICE_FLAG_CODE, 'invoiced'); @@ -249,15 +249,15 @@ public function invoicedAction() ->_setActiveMenu('Magento_Reports::report_salesroot_invoiced') ->_addBreadcrumb(__('Total Invoiced'), __('Total Invoiced')); - $gridBlock = $this->getLayout()->getBlock('report_sales_invoiced.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_sales_invoiced.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -266,9 +266,9 @@ public function invoicedAction() public function exportInvoicedCsvAction() { $fileName = 'invoiced.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Invoiced\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Invoiced\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -277,14 +277,14 @@ public function exportInvoicedCsvAction() public function exportInvoicedExcelAction() { $fileName = 'invoiced.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Invoiced\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Invoiced\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } public function refundedAction() { - $this->_title(__('Refunds Report')); + $this->_title->add(__('Refunds Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_REFUNDED_FLAG_CODE, 'refunded'); @@ -292,15 +292,15 @@ public function refundedAction() ->_setActiveMenu('Magento_Reports::report_salesroot_refunded') ->_addBreadcrumb(__('Total Refunded'), __('Total Refunded')); - $gridBlock = $this->getLayout()->getBlock('report_sales_refunded.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_sales_refunded.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -309,9 +309,9 @@ public function refundedAction() public function exportRefundedCsvAction() { $fileName = 'refunded.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Refunded\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Refunded\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -320,14 +320,14 @@ public function exportRefundedCsvAction() public function exportRefundedExcelAction() { $fileName = 'refunded.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Refunded\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Refunded\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } public function couponsAction() { - $this->_title(__('Coupons Report')); + $this->_title->add(__('Coupons Report')); $this->_showLastExecutionTime(\Magento\Reports\Model\Flag::REPORT_COUPONS_FLAG_CODE, 'coupons'); @@ -335,15 +335,15 @@ public function couponsAction() ->_setActiveMenu('Magento_Reports::report_salesroot_coupons') ->_addBreadcrumb(__('Coupons'), __('Coupons')); - $gridBlock = $this->getLayout()->getBlock('report_sales_coupons.grid'); - $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + $gridBlock = $this->_view->getLayout()->getBlock('report_sales_coupons.grid'); + $filterFormBlock = $this->_view->getLayout()->getBlock('grid.filter.form'); $this->_initReportAction(array( $gridBlock, $filterFormBlock )); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -352,9 +352,9 @@ public function couponsAction() public function exportCouponsCsvAction() { $fileName = 'coupons.csv'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Coupons\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Coupons\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); + return $this->_fileFactory->create($fileName, $grid->getCsvFile()); } /** @@ -363,9 +363,9 @@ public function exportCouponsCsvAction() public function exportCouponsExcelAction() { $fileName = 'coupons.xml'; - $grid = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Coupons\Grid'); + $grid = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Sales\Coupons\Grid'); $this->_initReportAction($grid); - $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); } public function refreshStatisticsAction() diff --git a/app/code/Magento/Adminhtml/Controller/Report/Shopcart.php b/app/code/Magento/Adminhtml/Controller/Report/Shopcart.php index 0bdbb5155c849..965d125ad6198 100644 --- a/app/code/Magento/Adminhtml/Controller/Report/Shopcart.php +++ b/app/code/Magento/Adminhtml/Controller/Report/Shopcart.php @@ -33,26 +33,46 @@ */ namespace Magento\Adminhtml\Controller\Report; -class Shopcart extends \Magento\Backend\Controller\Adminhtml\Action +class Shopcart extends \Magento\Backend\App\Action { + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\App\Response\Http\FileFactory $fileFactory + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\App\Response\Http\FileFactory $fileFactory + ) { + $this->_fileFactory = $fileFactory; + parent::__construct($context); + } + public function _initAction() { - $act = $this->getRequest()->getActionName(); - $this->loadLayout() - ->_addBreadcrumb(__('Reports'), __('Reports')) - ->_addBreadcrumb(__('Shopping Cart'), __('Shopping Cart')); + $this->_view->loadLayout(); + $this->_addBreadcrumb(__('Reports'), __('Reports')); + $this->_addBreadcrumb(__('Shopping Cart'), __('Shopping Cart')); return $this; } public function customerAction() { - $this->_title(__('Customer Shopping Carts')); + $this->_title->add(__('Customer Shopping Carts')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_shopcart_customer') ->_addBreadcrumb(__('Customers Report'), __('Customers Report')) - ->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Customer')) - ->renderLayout(); + ->_addContent( + $this->_view + ->getLayout() + ->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Customer') + ); + $this->_view->renderLayout(); } /** @@ -61,10 +81,10 @@ public function customerAction() public function exportCustomerCsvAction() { $fileName = 'shopcart_customer.csv'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Customer\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Customer\Grid') ->getCsvFile(); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } /** @@ -73,21 +93,23 @@ public function exportCustomerCsvAction() public function exportCustomerExcelAction() { $fileName = 'shopcart_customer.xml'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Customer\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Customer\Grid') ->getExcelFile($fileName); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } public function productAction() { - $this->_title(__('Products in Carts')); + $this->_title->add(__('Products in Carts')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_shopcart_product') ->_addBreadcrumb(__('Products Report'), __('Products Report')) - ->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Product')) - ->renderLayout(); + ->_addContent( + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Product') + ); + $this->_view->renderLayout(); } /** @@ -96,10 +118,10 @@ public function productAction() public function exportProductCsvAction() { $fileName = 'shopcart_product.csv'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Product\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Product\Grid') ->getCsvFile(); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } /** @@ -108,21 +130,23 @@ public function exportProductCsvAction() public function exportProductExcelAction() { $fileName = 'shopcart_product.xml'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Product\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Product\Grid') ->getExcelFile($fileName); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } public function abandonedAction() { - $this->_title(__('Abandoned Carts')); + $this->_title->add(__('Abandoned Carts')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_shopcart_abandoned') ->_addBreadcrumb(__('Abandoned Carts'), __('Abandoned Carts')) - ->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Abandoned')) - ->renderLayout(); + ->_addContent( + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Abandoned') + ); + $this->_view->renderLayout(); } /** @@ -131,10 +155,10 @@ public function abandonedAction() public function exportAbandonedCsvAction() { $fileName = 'shopcart_abandoned.csv'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Abandoned\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Abandoned\Grid') ->getCsvFile(); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } /** @@ -143,10 +167,10 @@ public function exportAbandonedCsvAction() public function exportAbandonedExcelAction() { $fileName = 'shopcart_abandoned.xml'; - $content = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Abandoned\Grid') + $content = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Report\Shopcart\Abandoned\Grid') ->getExcelFile($fileName); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } protected function _isAllowed() diff --git a/app/code/Magento/Adminhtml/Controller/Report/Statistics.php b/app/code/Magento/Adminhtml/Controller/Report/Statistics.php index 7671ef5b81480..50877faea2166 100644 --- a/app/code/Magento/Adminhtml/Controller/Report/Statistics.php +++ b/app/code/Magento/Adminhtml/Controller/Report/Statistics.php @@ -33,7 +33,7 @@ */ namespace Magento\Adminhtml\Controller\Report; -class Statistics extends \Magento\Backend\Controller\Adminhtml\Action +class Statistics extends \Magento\Backend\App\Action { /** * Admin session model @@ -42,11 +42,26 @@ class Statistics extends \Magento\Backend\Controller\Adminhtml\Action */ protected $_adminSession = null; + /** + * @var \Magento\Core\Filter\Date + */ + protected $_dateFilter; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\Core\Filter\Date $dateFilter + */ + public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Core\Filter\Date $dateFilter) + { + $this->_dateFilter = $dateFilter; + parent::__construct($context); + } + public function _initAction() { - $this->loadLayout() - ->_addBreadcrumb(__('Reports'), __('Reports')) - ->_addBreadcrumb(__('Statistics'), __('Statistics')); + $this->_view->loadLayout(); + $this->_addBreadcrumb(__('Reports'), __('Reports')); + $this->_addBreadcrumb(__('Statistics'), __('Statistics')); return $this; } @@ -58,7 +73,9 @@ public function _initReportAction($blocks) $requestData = $this->_objectManager->get('Magento\Adminhtml\Helper\Data') ->prepareFilterString($this->getRequest()->getParam('filter')); - $requestData = $this->_filterDates($requestData, array('from', 'to')); + $inputFilter = new \Zend_Filter_Input(array('from' => $this->_dateFilter, 'to' => $this->_dateFilter), + array(), $requestData); + $requestData = $inputFilter->getUnescaped(); $requestData['store_ids'] = $this->getRequest()->getParam('store_ids'); $params = new \Magento\Object(); @@ -141,7 +158,7 @@ public function refreshRecentAction() if($this->_getSession()->isFirstPageAfterLogin()) { $this->_redirect('adminhtml/*'); } else { - $this->_redirectReferer('*/*'); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl('*/*')); } return $this; } @@ -172,7 +189,7 @@ public function refreshLifetimeAction() if($this->_getSession()->isFirstPageAfterLogin()) { $this->_redirect('adminhtml/*'); } else { - $this->_redirectReferer('*/*'); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl('*/*')); } return $this; @@ -180,12 +197,12 @@ public function refreshLifetimeAction() public function indexAction() { - $this->_title(__('Refresh Statistics')); + $this->_title->add(__('Refresh Statistics')); $this->_initAction() ->_setActiveMenu('Magento_Reports::report_statistics_refresh') - ->_addBreadcrumb(__('Refresh Statistics'), __('Refresh Statistics')) - ->renderLayout(); + ->_addBreadcrumb(__('Refresh Statistics'), __('Refresh Statistics')); + $this->_view->renderLayout(); } protected function _isAllowed() diff --git a/app/code/Magento/Adminhtml/Controller/Urlrewrite.php b/app/code/Magento/Adminhtml/Controller/Urlrewrite.php index 5112c98e086c5..712e86affb549 100644 --- a/app/code/Magento/Adminhtml/Controller/Urlrewrite.php +++ b/app/code/Magento/Adminhtml/Controller/Urlrewrite.php @@ -33,7 +33,7 @@ */ namespace Magento\Adminhtml\Controller; -class Urlrewrite extends \Magento\Backend\Controller\Adminhtml\Action +class Urlrewrite extends \Magento\Backend\App\Action { const ID_MODE = 'id'; const PRODUCT_MODE = 'product'; @@ -65,11 +65,11 @@ class Urlrewrite extends \Magento\Backend\Controller\Adminhtml\Action */ public function indexAction() { - $this->_title(__('URL Redirects')); + $this->_title->add(__('URL Redirects')); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Catalog::catalog_urlrewrite'); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -77,17 +77,17 @@ public function indexAction() */ public function editAction() { - $this->_title(__('URL Redirects')) - ->_title(__('[New/Edit] URL Redirect')); + $this->_title->add(__('URL Redirects')); + $this->_title->add(__('[New/Edit] URL Redirect')); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Catalog::catalog_urlrewrite'); $mode = $this->_getMode(); switch ($mode) { case self::PRODUCT_MODE: - $editBlock = $this->getLayout() + $editBlock = $this->_view->getLayout() ->createBlock('Magento\Adminhtml\Block\Urlrewrite\Catalog\Product\Edit', '', array('data' => array( 'category' => $this->_getCategory(), 'product' => $this->_getProduct(), @@ -96,25 +96,28 @@ public function editAction() ))); break; case self::CATEGORY_MODE: - $editBlock = $this->getLayout() + $editBlock = $this->_view->getLayout() ->createBlock('Magento\Adminhtml\Block\Urlrewrite\Catalog\Category\Edit', '', array('data' => array( 'category' => $this->_getCategory(), 'url_rewrite' => $this->_getUrlRewrite() ))); break; case self::CMS_PAGE_MODE: - $editBlock = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Urlrewrite\Cms\Page\Edit', '', - array( - 'data' => array( - 'cms_page' => $this->_getCmsPage(), - 'url_rewrite' => $this->_getUrlRewrite(), - ), - ) + $editBlock = $this->_view->getLayout() + ->createBlock( + 'Magento\Adminhtml\Block\Urlrewrite\Cms\Page\Edit', '', + array( + 'data' => array( + 'cms_page' => $this->_getCmsPage(), + 'url_rewrite' => $this->_getUrlRewrite(), + ), + ) ); break; case self::ID_MODE: default: - $editBlock = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Urlrewrite\Edit', '', array( + $editBlock = $this->_view->getLayout()->createBlock( + 'Magento\Adminhtml\Block\Urlrewrite\Edit', '', array( 'data' => array('url_rewrite' => $this->_getUrlRewrite()) )); break; @@ -122,9 +125,9 @@ public function editAction() $this->_addContent($editBlock); if (in_array($mode, array(self::PRODUCT_MODE, self::CATEGORY_MODE))) { - $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); + $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true); } - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -154,7 +157,7 @@ private function _getMode() public function productGridAction() { $this->getResponse()->setBody( - $this->getLayout()->createBlock('Magento\Adminhtml\Block\Urlrewrite\Catalog\Product\Grid')->toHtml() + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Urlrewrite\Catalog\Product\Grid')->toHtml() ); } @@ -176,7 +179,7 @@ public function categoriesJsonAction() public function cmsPageGridAction() { $this->getResponse()->setBody( - $this->getLayout()->createBlock('Magento\Adminhtml\Block\Urlrewrite\Cms\Page\Grid')->toHtml() + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Urlrewrite\Cms\Page\Grid')->toHtml() ); } @@ -230,7 +233,7 @@ public function saveAction() ->setUrlrewriteData($data); } } - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); } /** diff --git a/app/code/Magento/Adminhtml/Helper/Addresses.php b/app/code/Magento/Adminhtml/Helper/Addresses.php index a1501d721797b..ddbf8e4943ff0 100644 --- a/app/code/Magento/Adminhtml/Helper/Addresses.php +++ b/app/code/Magento/Adminhtml/Helper/Addresses.php @@ -33,7 +33,7 @@ */ namespace Magento\Adminhtml\Helper; -class Addresses extends \Magento\Core\Helper\AbstractHelper +class Addresses extends \Magento\App\Helper\AbstractHelper { const DEFAULT_STREET_LINES_COUNT = 2; diff --git a/app/code/Magento/Adminhtml/Model/Session/Quote.php b/app/code/Magento/Adminhtml/Model/Session/Quote.php index c7759239aa3ff..dc13f7485e305 100644 --- a/app/code/Magento/Adminhtml/Model/Session/Quote.php +++ b/app/code/Magento/Adminhtml/Model/Session/Quote.php @@ -66,11 +66,6 @@ class Quote extends \Magento\Core\Model\Session\AbstractSession */ protected $_orderFactory; - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Customer\Model\CustomerFactory */ @@ -85,7 +80,6 @@ class Quote extends \Magento\Core\Model\Session\AbstractSession * @param \Magento\Core\Model\Session\Context $context * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param array $data */ @@ -93,13 +87,11 @@ public function __construct( \Magento\Core\Model\Session\Context $context, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\OrderFactory $orderFactory, array $data = array() ) { $this->_quoteFactory = $quoteFactory; $this->_customerFactory = $customerFactory; - $this->_storeManager = $storeManager; $this->_orderFactory = $orderFactory; parent::__construct($context, $data); $this->init('adminhtml_quote'); diff --git a/app/code/Magento/Adminhtml/etc/adminhtml/acl.xml b/app/code/Magento/Adminhtml/etc/adminhtml/acl.xml index e160fdbc64239..bc6e642838fbb 100644 --- a/app/code/Magento/Adminhtml/etc/adminhtml/acl.xml +++ b/app/code/Magento/Adminhtml/etc/adminhtml/acl.xml @@ -34,9 +34,6 @@ - - - diff --git a/app/code/Magento/Adminhtml/etc/config.xml b/app/code/Magento/Adminhtml/etc/config.xml index 2142978ee0ca1..bcff89c470e2d 100644 --- a/app/code/Magento/Adminhtml/etc/config.xml +++ b/app/code/Magento/Adminhtml/etc/config.xml @@ -28,15 +28,6 @@ - - - email - - - - system_emails_forgot_email_template - general - 1 @@ -79,9 +70,9 @@ - admin/index/noRoute + admin/noroute/index - \ No newline at end of file + diff --git a/app/code/Magento/Adminhtml/etc/events.xml b/app/code/Magento/Adminhtml/etc/events.xml index ecb34a534129f..166dcf93fadb0 100644 --- a/app/code/Magento/Adminhtml/etc/events.xml +++ b/app/code/Magento/Adminhtml/etc/events.xml @@ -24,9 +24,6 @@ */ --> - - - diff --git a/app/code/Magento/Adminhtml/view/adminhtml/admin/popup.phtml b/app/code/Magento/Adminhtml/view/adminhtml/admin/popup.phtml index faf7a1d261157..81d21c9c0da93 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/admin/popup.phtml +++ b/app/code/Magento/Adminhtml/view/adminhtml/admin/popup.phtml @@ -26,13 +26,13 @@ ?> - + 404 Error

Page not found.

]]> diff --git a/app/code/Magento/Adminhtml/view/adminhtml/layout/default.xml b/app/code/Magento/Adminhtml/view/adminhtml/layout/default.xml index 3980c42ad63e2..8b77671e35619 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Adminhtml/view/adminhtml/layout/default.xml @@ -272,7 +272,7 @@
- + @@ -288,7 +288,7 @@ - + diff --git a/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_queue_preview.xml b/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_queue_preview.xml index dee31157f6faa..596315b0f0cae 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_queue_preview.xml +++ b/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_queue_preview.xml @@ -24,7 +24,7 @@ */ --> - + diff --git a/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_template_preview.xml b/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_template_preview.xml index 0a1a6e63bd2ff..5fbce706060ee 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_template_preview.xml +++ b/app/code/Magento/Adminhtml/view/adminhtml/layout/newsletter_template_preview.xml @@ -24,7 +24,7 @@ */ --> - + diff --git a/app/code/Magento/Adminhtml/view/adminhtml/layout/preview.xml b/app/code/Magento/Adminhtml/view/adminhtml/layout/preview.xml index 291c2f2422c3f..f92336d5d09d7 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/layout/preview.xml +++ b/app/code/Magento/Adminhtml/view/adminhtml/layout/preview.xml @@ -24,7 +24,7 @@ */ --> - + diff --git a/app/code/Magento/Adminhtml/view/adminhtml/page/js/calendar.phtml b/app/code/Magento/Adminhtml/view/adminhtml/page/js/calendar.phtml index 12456d524147f..a6083df04e9e9 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/page/js/calendar.phtml +++ b/app/code/Magento/Adminhtml/view/adminhtml/page/js/calendar.phtml @@ -30,7 +30,7 @@ /** * Calendar localization script. Should be put into page header. * - * @see \Magento\Core\Block\Html\Calendar + * @see \Magento\View\Block\Html\Calendar */ ?> diff --git a/app/code/Magento/Authorizenet/Block/Directpost/Form.php b/app/code/Magento/Authorizenet/Block/Directpost/Form.php index 7f5fadd42645c..3c327bcd36e84 100644 --- a/app/code/Magento/Authorizenet/Block/Directpost/Form.php +++ b/app/code/Magento/Authorizenet/Block/Directpost/Form.php @@ -48,24 +48,22 @@ class Form extends \Magento\Payment\Block\Form\Cc protected $_checkoutModel; /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Payment\Model\Config $paymentConfig * @param \Magento\Authorizenet\Model\Directpost $model * @param \Magento\Checkout\Model\Type\Onepage $checkoutModel * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Payment\Model\Config $paymentConfig, \Magento\Authorizenet\Model\Directpost $model, \Magento\Checkout\Model\Type\Onepage $checkoutModel, array $data = array() ) { - parent::__construct($coreData, $context, $paymentConfig, $data); + parent::__construct($context, $coreData, $paymentConfig, $data); $this->_model = $model; $this->_checkoutModel = $checkoutModel; } diff --git a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php b/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php index df2d132f52844..b5e66559d38b3 100644 --- a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php +++ b/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php @@ -33,7 +33,7 @@ */ namespace Magento\Authorizenet\Block\Directpost; -class Iframe extends \Magento\Core\Block\Template +class Iframe extends \Magento\View\Block\Template { /** * Core registry @@ -43,19 +43,19 @@ class Iframe extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -63,7 +63,7 @@ public function __construct( * * You can redefine this method in child classes for changing layout * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php index 09086d4d67473..97bc41b2154a5 100644 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php @@ -36,15 +36,17 @@ class Payment protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\Catalog\Helper\Product $productHelper * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, + \Magento\Catalog\Helper\Product $productHelper, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; - parent::__construct($context); + parent::__construct($context, $productHelper); } /** @@ -214,7 +216,7 @@ public function redirectAction() } $this->_coreRegistry->register('authorizenet_directpost_form_params', array_merge($params, $redirectParams)); - $this->loadLayout(false)->renderLayout(); + $this->_view->loadLayout(false)->renderLayout(); } /** diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php index d8c19d1021f45..fbf2630b3eb5d 100644 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php @@ -33,7 +33,7 @@ */ namespace Magento\Authorizenet\Controller\Directpost; -class Payment extends \Magento\Core\Controller\Front\Action +class Payment extends \Magento\App\Action\Action { /** * Core registry @@ -43,11 +43,11 @@ class Payment extends \Magento\Core\Controller\Front\Action protected $_coreRegistry = null; /** - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @param \Magento\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, + \Magento\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -117,8 +117,8 @@ public function responseAction() } $this->_coreRegistry->register('authorizenet_directpost_form_params', $params); - $this->addPageLayoutHandles(); - $this->loadLayout(false)->renderLayout(); + $this->_view->addPageLayoutHandles(); + $this->_view->loadLayout(false)->renderLayout(); } /** @@ -150,8 +150,8 @@ public function redirectAction() } $this->_coreRegistry->register('authorizenet_directpost_form_params', array_merge($params, $redirectParams)); - $this->addPageLayoutHandles(); - $this->loadLayout(false)->renderLayout(); + $this->_view->addPageLayoutHandles(); + $this->_view->loadLayout(false)->renderLayout(); } /** diff --git a/app/code/Magento/Authorizenet/Helper/Data.php b/app/code/Magento/Authorizenet/Helper/Data.php index 63a555f67882b..3e61e8c4f1295 100644 --- a/app/code/Magento/Authorizenet/Helper/Data.php +++ b/app/code/Magento/Authorizenet/Helper/Data.php @@ -33,15 +33,10 @@ */ namespace Magento\Authorizenet\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { /** - * @var \Magento\Core\Model\App - */ - protected $_application; - - /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -56,21 +51,18 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_urlBuilder; /** - * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\App $application - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Backend\Model\Url $urlBuilder */ public function __construct( - \Magento\Core\Helper\Context $context, - \Magento\Core\Model\App $application, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\App\Helper\Context $context, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Backend\Model\Url $urlBuilder ) { parent::__construct($context); - $this->_application = $application; $this->_storeManager = $storeManager; $this->_orderFactory = $orderFactory; $this->_urlBuilder = $urlBuilder; @@ -211,16 +203,6 @@ public function getSuccessOrderUrl($params) return $this->_getUrl($route, $param); } - /** - * Get controller name - * - * @return string - */ - public function getControllerName() - { - return $this->_application->getFrontController()->getRequest()->getControllerName(); - } - /** * Update all child and parent order's edit increment numbers. * Needed for Admin area. diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index e497766c0bda2..c9abc5bce283e 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -49,7 +49,7 @@ class Directpost extends \Magento\Paygate\Model\Authorizenet protected $_isInitializeNeeded = true; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -90,7 +90,7 @@ class Directpost extends \Magento\Paygate\Model\Authorizenet * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Centinel\Model\Service $centinelService - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Authorizenet\Model\Directpost\RequestFactory $requestFactory @@ -112,7 +112,7 @@ public function __construct( \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\Centinel\Model\Service $centinelService, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Authorizenet\Model\Directpost\RequestFactory $requestFactory, diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php b/app/code/Magento/Authorizenet/Model/Directpost/Observer.php index 5fd8ce25f47a6..bf71c6b32293d 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Observer.php @@ -67,7 +67,7 @@ class Observer protected $_session; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -77,7 +77,7 @@ class Observer * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Authorizenet\Model\DirectpostFactory $modelFactory * @param \Magento\Authorizenet\Model\Directpost\Session $session - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( \Magento\Authorizenet\Helper\Data $authorizenetData, @@ -85,7 +85,7 @@ public function __construct( \Magento\Core\Model\Registry $coreRegistry, \Magento\Authorizenet\Model\DirectpostFactory $modelFactory, \Magento\Authorizenet\Model\Directpost\Session $session, - \Magento\Core\Model\StoreManager $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_coreRegistry = $coreRegistry; $this->_authorizenetData = $authorizenetData; @@ -124,12 +124,9 @@ public function addAdditionalFieldsToResponseFrontend(\Magento\Event\Observer $o if ($order && $order->getId()) { $payment = $order->getPayment(); if ($payment && $payment->getMethod() == $this->_modelFactory->create()->getCode()) { - /* @var $controller \Magento\Core\Controller\Varien\Action */ - $controller = $observer->getEvent()->getData('controller_action'); - $result = $this->_coreData->jsonDecode( - $controller->getResponse()->getBody('default'), - \Zend_Json::TYPE_ARRAY - ); + $request = $observer->getEvent()->getRequest(); + $response = $observer->getEvent()->getResponse(); + $result = $this->_coreData->jsonDecode($response->getBody('default'), \Zend_Json::TYPE_ARRAY); if (empty($result['error'])) { $payment = $order->getPayment(); @@ -137,13 +134,13 @@ public function addAdditionalFieldsToResponseFrontend(\Magento\Event\Observer $o $this->_session->addCheckoutOrderIncrementId($order->getIncrementId()); $this->_session->setLastOrderIncrementId($order->getIncrementId()); $requestToPaygate = $payment->getMethodInstance()->generateRequestFromOrder($order); - $requestToPaygate->setControllerActionName($controller->getRequest()->getControllerName()); + $requestToPaygate->setControllerActionName($request->getControllerName()); $requestToPaygate->setIsSecure((string)$this->_storeManager->getStore()->isCurrentlySecure()); $result['directpost'] = array('fields' => $requestToPaygate->getData()); - $controller->getResponse()->clearHeader('Location'); - $controller->getResponse()->setBody($this->_coreData->jsonEncode($result)); + $response->clearHeader('Location'); + $response->setBody($this->_coreData->jsonEncode($result)); } } } diff --git a/app/code/Magento/Authorizenet/view/adminhtml/directpost/info.phtml b/app/code/Magento/Authorizenet/view/adminhtml/directpost/info.phtml index 8ac13ed1a0225..8d08867396b4d 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/directpost/info.phtml +++ b/app/code/Magento/Authorizenet/view/adminhtml/directpost/info.phtml @@ -32,7 +32,7 @@ $_form = $this; $_code = $_form->getMethodCode(); $_method = $_form->getMethod(); -$_controller = $this->helper('Magento\Authorizenet\Helper\Data')->getControllerName(); +$_controller = $this->getRequest()->getControllerName(); $_orderUrl = $this->helper('Magento\Authorizenet\Helper\Data')->getPlaceOrderAdminUrl(); ?> diff --git a/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml b/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml index 42f57f81ea728..b2d202315fca5 100644 --- a/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml +++ b/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml @@ -32,77 +32,77 @@ $_form = $this; $_code = $_form->getMethodCode(); $_method = $_form->getMethod(); -$_controller = $this->helper('Magento\Authorizenet\Helper\Data')->getControllerName(); +$_controller = $this->getRequest()->getControllerName(); $_orderUrl = $this->helper('Magento\Authorizenet\Helper\Data')->getPlaceOrderFrontUrl(); ?> -
+ - -
-
-
-
-
-
    -
  • - -
    - -
    -
  • -
  • - -
    - -
    -
  • -
  • - -
    -
    - + + getInfoData('cc_type') ?> + getCcAvailableTypes() as $_typeCode => $_typeName): ?> +
    -
    - getInfoData('cc_exp_year') ?> - +
    +
    + +
    +
    -
  • - getChildHtml() ?> - hasVerification()): ?> -
  • - -
    -
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + getInfoData('cc_exp_year') ?> + +
    +
    +
    +
    +
    + hasVerification()): ?> +
    + +
    +
    + +
    +
    -
    -
  • - -
-
-
+ + getChildHtml() ?>
-
- diff --git a/app/code/Magento/Authorizenet/view/frontend/directpost/info.phtml b/app/code/Magento/Authorizenet/view/frontend/directpost/info.phtml index 7f1a692d0c199..ec5a56ac5ee0a 100644 --- a/app/code/Magento/Authorizenet/view/frontend/directpost/info.phtml +++ b/app/code/Magento/Authorizenet/view/frontend/directpost/info.phtml @@ -28,8 +28,8 @@ * @see \Magento\Authorizenet\Block\Directpost\Form */ ?> - + diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php new file mode 100644 index 0000000000000..308a1c84d8479 --- /dev/null +++ b/app/code/Magento/Backend/App/AbstractAction.php @@ -0,0 +1,396 @@ +_authorization = $context->getAuthorization(); + $this->_auth = $context->getAuth(); + $this->_helper = $context->getHelper(); + $this->_backendUrl = $context->getBackendUrl(); + $this->_formKeyValidator = $context->getFormKeyValidator(); + $this->_title = $context->getTitle(); + $this->_locale = $context->getLocale(); + $this->_canUseBaseUrl = $context->getCanUseBaseUrl(); + $this->_session = $context->getSession(); + } + + protected function _isAllowed() + { + return true; + } + + /** + * Retrieve adminhtml session model object + * + * @return \Magento\Backend\Model\Session + */ + protected function _getSession() + { + return $this->_session; + } + + /** + * Define active menu item in menu block + * @param string $itemId current active menu item + * @return \Magento\Backend\App\AbstractAction + */ + protected function _setActiveMenu($itemId) + { + /** @var $menuBlock \Magento\Backend\Block\Menu */ + $menuBlock = $this->_view->getLayout()->getBlock('menu'); + $menuBlock->setActive($itemId); + $parents = $menuBlock->getMenuModel()->getParentItems($itemId); + $parents = array_reverse($parents); + foreach ($parents as $item) { + /** @var $item \Magento\Backend\Model\Menu\Item */ + $this->_title->add($item->getTitle(), true); + } + return $this; + } + + /** + * @param $label + * @param $title + * @param null $link + * @return \Magento\Backend\App\AbstractAction + */ + protected function _addBreadcrumb($label, $title, $link=null) + { + $this->_view->getLayout()->getBlock('breadcrumbs')->addLink($label, $title, $link); + return $this; + } + + /** + * @param \Magento\View\Block\AbstractBlock $block + * @return \Magento\Backend\App\AbstractAction + */ + protected function _addContent(\Magento\View\Block\AbstractBlock $block) + { + return $this->_moveBlockToContainer($block, 'content'); + } + + /** + * @param \Magento\View\Block\AbstractBlock $block + * @return \Magento\Backend\App\AbstractAction + */ + protected function _addLeft(\Magento\View\Block\AbstractBlock $block) + { + return $this->_moveBlockToContainer($block, 'left'); + } + + /** + * @param \Magento\View\Block\AbstractBlock $block + * @return \Magento\Backend\App\AbstractAction + */ + protected function _addJs(\Magento\View\Block\AbstractBlock $block) + { + return $this->_moveBlockToContainer($block, 'js'); + } + + /** + * Set specified block as an anonymous child to specified container + * + * The block will be moved to the container from previous parent after all other elements + * + * @param \Magento\View\Block\AbstractBlock $block + * @param string $containerName + * @return \Magento\Backend\App\AbstractAction + */ + private function _moveBlockToContainer(\Magento\View\Block\AbstractBlock $block, $containerName) + { + $this->_view->getLayout()->setChild($containerName, $block->getNameInLayout(), ''); + return $this; + } + + /** + * @param \Magento\App\RequestInterface $request + * @return $this|mixed + */ + public function dispatch(\Magento\App\RequestInterface $request) + { + if (!$this->_processUrlKeys()) { + return parent::dispatch($request); + } + + if ($request->isDispatched() && $request->getActionName() !== 'denied' && !$this->_isAllowed()) { + $this->_forward('denied'); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); + return parent::dispatch($request); + } + + if ($this->_isUrlChecked()) { + $this->_actionFlag->set('', self::FLAG_IS_URLS_CHECKED, true); + } + + $this->_processLocaleSettings(); + + return parent::dispatch($request); + } + + /** + * Check whether url is checked + * + * @return bool + */ + protected function _isUrlChecked() + { + return !$this->_actionFlag->get('', self::FLAG_IS_URLS_CHECKED) + && !$this->getRequest()->getParam('forwarded') + && !$this->_getSession()->getIsUrlNotice(true) + && !$this->_canUseBaseUrl; + } + + /** + * Check url keys. If non valid - redirect + * + * @return bool + */ + public function _processUrlKeys() + { + $_isValidFormKey = true; + $_isValidSecretKey = true; + $_keyErrorMsg = ''; + if ($this->_auth->isLoggedIn()) { + if ($this->getRequest()->isPost()) { + $_isValidFormKey = $this->_formKeyValidator->validate($this->getRequest()); + $_keyErrorMsg = __('Invalid Form Key. Please refresh the page.'); + } elseif ($this->_backendUrl->useSecretKey()) { + $_isValidSecretKey = $this->_validateSecretKey(); + $_keyErrorMsg = __('You entered an invalid Secret Key. Please refresh the page.'); + } + } + if (!$_isValidFormKey || !$_isValidSecretKey) { + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', self::FLAG_NO_POST_DISPATCH, true); + if ($this->getRequest()->getQuery('isAjax', false) || $this->getRequest()->getQuery('ajax', false)) { + $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(array( + 'error' => true, + 'message' => $_keyErrorMsg + ))); + } else { + $this->_redirect($this->_backendUrl->getStartupPageUrl()); + } + return false; + } + return true; + } + + /** + * Set session locale, + * process force locale set through url params + * + * @return \Magento\Backend\App\AbstractAction + */ + protected function _processLocaleSettings() + { + $forceLocale = $this->getRequest()->getParam('locale', null); + if ($this->_objectManager->get('Magento\Core\Model\Locale\Validator')->isValid($forceLocale)) { + $this->_getSession()->setSessionLocale($forceLocale); + } + + if (is_null($this->_getSession()->getLocale())) { + $this->_getSession()->setLocale($this->_locale->getLocaleCode()); + } + + return $this; + } + + public function deniedAction() + { + $this->getResponse()->setHeader('HTTP/1.1', '403 Forbidden'); + if (!$this->_auth->isLoggedIn()) { + $this->_redirect('*/auth/login'); + return; + } + $this->_view->loadLayout(array('default', 'adminhtml_denied')); + $this->_view->renderLayout(); + } + + /** + * No route action + * + * @param null $coreRoute + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function norouteAction($coreRoute = null) + { + $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found'); + $this->getResponse()->setHeader('Status', '404 File not found'); + $this->_view->loadLayout(array('default', 'adminhtml_noroute')); + $this->_view->renderLayout(); + } + + /** + * Set redirect into response + * + * @param string $path + * @param array $arguments + * @return \Magento\Backend\App\AbstractAction + */ + protected function _redirect($path, $arguments=array()) + { + $this->_getSession()->setIsUrlNotice($this->_actionFlag->get('', self::FLAG_IS_URLS_CHECKED)); + $this->getResponse()->setRedirect($this->getUrl($path, $arguments)); + return $this; + } + + protected function _forward($action, $controller = null, $module = null, array $params = null) + { + $this->_getSession()->setIsUrlNotice($this->_actionFlag->get('', self::FLAG_IS_URLS_CHECKED)); + return parent::_forward($action, $controller, $module, $params); + } + + /** + * Generate url by route and parameters + * + * @param string $route + * @param array $params + * @return string + */ + public function getUrl($route = '', $params=array()) + { + return $this->_helper->getUrl($route, $params); + } + + /** + * Validate Secret Key + * + * @return bool + */ + protected function _validateSecretKey() + { + if (is_array($this->_publicActions) && in_array($this->getRequest()->getActionName(), $this->_publicActions)) { + return true; + } + + $secretKey = $this->getRequest()->getParam(\Magento\Backend\Model\Url::SECRET_KEY_PARAM_NAME, null); + if (!$secretKey || $secretKey != $this->_backendUrl->getSecretKey()) { + return false; + } + return true; + } + + /** + * Render specified template + * + * @param string $tplName + * @param array $data parameters required by template + */ + protected function _outTemplate($tplName, $data = array()) + { + $this->_view->getLayout()->initMessages('Magento\Backend\Model\Session'); + $block = $this->_view->getLayout() + ->createBlock('Magento\Backend\Block\Template')->setTemplate("{$tplName}.phtml"); + foreach ($data as $index => $value) { + $block->assign($index, $value); + } + $html = $block->toHtml(); + $this->_objectManager->get('Magento\Core\Model\Translate')->processResponseBody($html); + $this->getResponse()->setBody($html); + } +} \ No newline at end of file diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Action.php b/app/code/Magento/Backend/App/Action.php similarity index 90% rename from app/code/Magento/Backend/Controller/Adminhtml/Action.php rename to app/code/Magento/Backend/App/Action.php index bc612975e5910..3cb001f8cf877 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Action.php +++ b/app/code/Magento/Backend/App/Action.php @@ -27,8 +27,8 @@ /** * Generic backend controller */ -namespace Magento\Backend\Controller\Adminhtml; +namespace Magento\Backend\App; -class Action extends \Magento\Backend\Controller\AbstractAction +class Action extends \Magento\Backend\App\AbstractAction { } diff --git a/app/code/Magento/Backend/Controller/Context.php b/app/code/Magento/Backend/App/Action/Context.php similarity index 73% rename from app/code/Magento/Backend/Controller/Context.php rename to app/code/Magento/Backend/App/Action/Context.php index 2879f6c73fd62..7774862ce1207 100644 --- a/app/code/Magento/Backend/Controller/Context.php +++ b/app/code/Magento/Backend/App/Action/Context.php @@ -24,44 +24,42 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Backend\Controller; +namespace Magento\Backend\App\Action; /** - * Controller context - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * Backend Controller context */ -class Context extends \Magento\Core\Controller\Varien\Action\Context +class Context extends \Magento\App\Action\Context { /** - * @var \Magento\Backend\Model\Session + * @var \Magento\AuthorizationInterface */ - protected $_session; + protected $_authorization; /** - * @var \Magento\Backend\Helper\Data + * @var \Magento\Backend\Model\Auth */ - protected $_helper; + protected $_auth; /** - * @var \Magento\AuthorizationInterface + * @var \Magento\Backend\Helper\Data */ - protected $_authorization; + protected $_helper; /** - * @var \Magento\Core\Model\Translate + * @var \Magento\Backend\Model\Url */ - protected $_translator; + protected $_backendUrl; /** - * @var \Magento\Backend\Model\Auth + * @var \Magento\Core\App\Action\FormKeyValidator */ - protected $_auth; + protected $_formKeyValidator; /** - * @var \Magento\Backend\Model\Url + * @var \Magento\App\Action\Title */ - protected $_backendUrl; + protected $_title; /** * @var \Magento\Core\Model\LocaleInterface @@ -74,102 +72,115 @@ class Context extends \Magento\Core\Controller\Varien\Action\Context protected $_canUseBaseUrl; /** - * @param \Magento\Logger $logger + * @var \Magento\Backend\Model\Session + */ + protected $_session; + + /** * @param \Magento\App\RequestInterface $request * @param \Magento\App\ResponseInterface $response * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\FrontController $frontController - * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\HTTP\Authentication $authentication * @param \Magento\Backend\Model\Session $session - * @param \Magento\Backend\Helper\Data $helper + * @param \Magento\UrlInterface $url + * @param \Magento\App\Response\RedirectInterface $redirect + * @param \Magento\App\ActionFlag $actionFlag + * @param \Magento\App\ViewInterface $view * @param \Magento\AuthorizationInterface $authorization - * @param \Magento\Core\Model\Translate $translator * @param \Magento\Backend\Model\Auth $auth + * @param \Magento\Backend\Helper\Data $helper * @param \Magento\Backend\Model\Url $backendUrl + * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator + * @param \Magento\App\Action\Title $title * @param \Magento\Core\Model\LocaleInterface $locale * @param bool $canUseBaseUrl - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Logger $logger, \Magento\App\RequestInterface $request, \Magento\App\ResponseInterface $response, \Magento\ObjectManager $objectManager, - \Magento\App\FrontController $frontController, - \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, - \Magento\HTTP\Authentication $authentication, \Magento\Backend\Model\Session $session, - \Magento\Backend\Helper\Data $helper, + \Magento\UrlInterface $url, + \Magento\App\Response\RedirectInterface $redirect, + \Magento\App\ActionFlag $actionFlag, + \Magento\App\ViewInterface $view, \Magento\AuthorizationInterface $authorization, - \Magento\Core\Model\Translate $translator, \Magento\Backend\Model\Auth $auth, + \Magento\Backend\Helper\Data $helper, \Magento\Backend\Model\Url $backendUrl, + \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, + \Magento\App\Action\Title $title, \Magento\Core\Model\LocaleInterface $locale, $canUseBaseUrl = false ) { - parent::__construct($logger, $request, $response, $objectManager, $frontController, $layout, $eventManager, - $authentication + parent::__construct( + $request, + $response, + $objectManager, + $eventManager, + $url, + $redirect, + $actionFlag, + $view ); - $this->_canUseBaseUrl = $canUseBaseUrl; $this->_session = $session; - $this->_helper = $helper; $this->_authorization = $authorization; - $this->_translator = $translator; $this->_auth = $auth; + $this->_helper = $helper; $this->_backendUrl = $backendUrl; + $this->_formKeyValidator = $formKeyValidator; + $this->_title = $title; $this->_locale = $locale; + $this->_canUseBaseUrl = $canUseBaseUrl; } /** - * @return \Magento\Backend\Helper\Data + * @return \Magento\Backend\Model\Auth */ - public function getHelper() + public function getAuth() { - return $this->_helper; + return $this->_auth; } /** - * @return \Magento\Backend\Model\Session + * @return \Magento\AuthorizationInterface */ - public function getSession() + public function getAuthorization() { - return $this->_session; + return $this->_authorization; } /** - * @return \Magento\AuthorizationInterface + * @return \Magento\Backend\Model\Url */ - public function getAuthorization() + public function getBackendUrl() { - return $this->_authorization; + return $this->_backendUrl; } /** - * @return \Magento\Core\Model\Translate + * @return boolean */ - public function getTranslator() + public function getCanUseBaseUrl() { - return $this->_translator; + return $this->_canUseBaseUrl; } /** - * @return \Magento\Backend\Model\Auth + * @return \Magento\Core\App\Action\FormKeyValidator */ - public function getAuth() + public function getFormKeyValidator() { - return $this->_auth; + return $this->_formKeyValidator; } /** - * @return \Magento\Backend\Model\Url + * @return \Magento\Backend\Helper\Data */ - public function getBackendUrl() + public function getHelper() { - return $this->_backendUrl; + return $this->_helper; } /** @@ -181,10 +192,18 @@ public function getLocale() } /** - * @return boolean + * @return \Magento\App\Action\Title */ - public function getCanUseBaseUrl() + public function getTitle() { - return $this->_canUseBaseUrl; + return $this->_title; + } + + /** + * @return \Magento\Backend\Model\Session + */ + public function getSession() + { + return $this->_session; } -} +} \ No newline at end of file diff --git a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php new file mode 100644 index 0000000000000..9013a9d6d49ca --- /dev/null +++ b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php @@ -0,0 +1,196 @@ +_auth = $auth; + $this->_session = $session; + $this->_url = $url; + $this->_response = $response; + $this->_actionFlag = $actionFlag; + } + + /** + * @param array $arguments + * @param \Magento\Code\Plugin\InvocationChain $invocationChain + * @return mixed + */ + public function aroundDispatch(array $arguments, \Magento\Code\Plugin\InvocationChain $invocationChain) + { + $request = $arguments[0]; + $requestedActionName = $request->getActionName(); + if (in_array($requestedActionName, $this->_openActions)) { + $request->setDispatched(true); + } else { + if ($this->_auth->getUser()) { + $this->_auth->getUser()->reload(); + } + if (!$this->_auth->isLoggedIn()) { + $this->_processNotLoggedInUser($request); + } + } + $this->_auth->getAuthStorage()->refreshAcl(); + return $invocationChain->proceed($arguments); + } + + /** + * Process not logged in user data + * + * @param \Magento\App\RequestInterface $request + */ + protected function _processNotLoggedInUser(\Magento\App\RequestInterface $request) + { + $isRedirectNeeded = false; + if ($request->getPost('login') && $this->_performLogin($request)) { + $isRedirectNeeded = $this->_redirectIfNeededAfterLogin($request); + } + if (!$isRedirectNeeded && !$request->getParam('forwarded')) { + if ($request->getParam('isIframe')) { + $request->setParam('forwarded', true) + ->setRouteName('adminhtml') + ->setControllerName('auth') + ->setActionName('deniedIframe') + ->setDispatched(false); + } elseif ($request->getParam('isAjax')) { + $request->setParam('forwarded', true) + ->setRouteName('adminhtml') + ->setControllerName('auth') + ->setActionName('deniedJson') + ->setDispatched(false); + } else { + $request->setParam('forwarded', true) + ->setRouteName('adminhtml') + ->setControllerName('auth') + ->setActionName('login') + ->setDispatched(false); + } + } + } + + /** + * Performs login, if user submitted login form + * + * @param \Magento\App\RequestInterface $request + * @return bool + */ + protected function _performLogin(\Magento\App\RequestInterface $request) + { + $outputValue = true; + $postLogin = $request->getPost('login'); + $username = isset($postLogin['username']) ? $postLogin['username'] : ''; + $password = isset($postLogin['password']) ? $postLogin['password'] : ''; + $request->setPost('login', null); + + try { + $this->_auth->login($username, $password); + } catch (\Magento\Backend\Model\Auth\Exception $e) { + if (!$request->getParam('messageSent')) { + $this->_session->addError($e->getMessage()); + $request->setParam('messageSent', true); + $outputValue = false; + } + } + return $outputValue; + } + + /** + * Checks, whether Magento requires redirection after successful admin login, and redirects user, if needed + * + * @param \Magento\App\RequestInterface $request + * @return bool + */ + protected function _redirectIfNeededAfterLogin(\Magento\App\RequestInterface $request) + { + $requestUri = null; + + // Checks, whether secret key is required for admin access or request uri is explicitly set + if ($this->_url->useSecretKey()) { + $requestUri = $this->_url->getUrl('*/*/*', array('_current' => true)); + } elseif ($request) { + $requestUri = $request->getRequestUri(); + } + + if (!$requestUri) { + return false; + } + + $this->_response->setRedirect($requestUri); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + return true; + } +} \ No newline at end of file diff --git a/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php b/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php new file mode 100644 index 0000000000000..6900a35f0dabc --- /dev/null +++ b/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php @@ -0,0 +1,49 @@ +getPost('massaction_prepare_key'); + if ($key) { + $postData = $request->getPost($key); + $value = is_array($postData) ? $postData : explode(',', $postData); + $request->setPost($key, $value ? $value : null); + } + return $invocationChain->proceed($arguments); + } +} \ No newline at end of file diff --git a/app/code/Magento/Backend/App/Action/Plugin/Store.php b/app/code/Magento/Backend/App/Action/Plugin/Store.php new file mode 100644 index 0000000000000..25d991069eb72 --- /dev/null +++ b/app/code/Magento/Backend/App/Action/Plugin/Store.php @@ -0,0 +1,53 @@ +_storeManager = $storeManager; + } + + /** + * @param array $arguments + * @param \Magento\Code\Plugin\InvocationChain $invocationChain + * @return array + */ + public function aroundDispatch(array $arguments, \Magento\Code\Plugin\InvocationChain $invocationChain) + { + $this->_storeManager->setCurrentStore('admin'); + return $invocationChain->proceed($arguments); + } +} \ No newline at end of file diff --git a/app/code/Magento/Backend/App/Response/Http/FileFactory.php b/app/code/Magento/Backend/App/Response/Http/FileFactory.php new file mode 100644 index 0000000000000..2facf5afe453f --- /dev/null +++ b/app/code/Magento/Backend/App/Response/Http/FileFactory.php @@ -0,0 +1,120 @@ +_auth = $auth; + $this->_backendUrl = $backendUrl; + $this->_session = $session; + $this->_flag = $flag; + $this->_helper = $helper; + parent::__construct($responseFactory, $filesystem); + } + + + /** + * Set redirect into response + * + * @param string $path + * @param array $arguments + * @return \Magento\App\ResponseInterface + * @TODO move method + */ + protected function _redirect($path, $arguments=array()) + { + $this->_session + ->setIsUrlNotice($this->_flag->get('', \Magento\Backend\App\AbstractAction::FLAG_IS_URLS_CHECKED)); + $response = $this->_responseFactory->create(); + $response->setRedirect($this->_helper->getUrl($path, $arguments)); + return $response; + } + + /** + * Declare headers and content file in response for file download + * + * @param string $fileName + * @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in + * that case + * @param string $contentType + * @param int $contentLength explicit content length, if strlen($content) isn't applicable + * @return \Magento\App\ResponseInterface + */ + public function create($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null) + { + if ($this->_auth->getAuthStorage()->isFirstPageAfterLogin()) { + $response = $this->_redirect($this->_backendUrl->getStartupPageUrl()); + return $response; + } + return parent::create($fileName, $content, $contentType, $contentLength); + } +} \ No newline at end of file diff --git a/app/code/Magento/Backend/App/Router/NoRouteHandler.php b/app/code/Magento/Backend/App/Router/NoRouteHandler.php index 5db07afe0fe49..bef2e0e58cfbb 100644 --- a/app/code/Magento/Backend/App/Router/NoRouteHandler.php +++ b/app/code/Magento/Backend/App/Router/NoRouteHandler.php @@ -54,8 +54,8 @@ public function process(\Magento\App\RequestInterface $request) if ($areaFrontName == $this->_helper->getAreaFrontName()) { $moduleName = 'admin'; - $controllerName = 'index'; - $actionName = 'noRoute'; + $controllerName = 'noroute'; + $actionName = 'index'; $request->setModuleName($moduleName) ->setControllerName($controllerName) diff --git a/app/code/Magento/Backend/Block/AbstractBlock.php b/app/code/Magento/Backend/Block/AbstractBlock.php index 4b6938b6d9605..d2f15309be743 100644 --- a/app/code/Magento/Backend/Block/AbstractBlock.php +++ b/app/code/Magento/Backend/Block/AbstractBlock.php @@ -31,7 +31,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class AbstractBlock extends \Magento\Core\Block\AbstractBlock +class AbstractBlock extends \Magento\View\Block\AbstractBlock { /** * @var \Magento\AuthorizationInterface 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 23b3247368dab..5fbf20e5c8f90 100644 --- a/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php +++ b/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php @@ -33,18 +33,18 @@ class Statuses extends \Magento\Backend\Block\Widget\Grid\Column protected $_cacheTypeList; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @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\Helper\Data $coreData, \Magento\App\Cache\TypeListInterface $cacheTypeList, array $data = array() ) { - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); $this->_cacheTypeList = $cacheTypeList; } diff --git a/app/code/Magento/Backend/Block/Context.php b/app/code/Magento/Backend/Block/Context.php index 244de9a48b925..55880dc9e89c5 100644 --- a/app/code/Magento/Backend/Block/Context.php +++ b/app/code/Magento/Backend/Block/Context.php @@ -28,7 +28,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Context extends \Magento\Core\Block\Context +class Context extends \Magento\View\Block\Context { /** * @var \Magento\AuthorizationInterface @@ -46,7 +46,7 @@ class Context extends \Magento\Core\Block\Context * @param \Magento\Core\Model\Session\AbstractSession $session * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController - * @param \Magento\Core\Model\Factory\Helper $helperFactory + * @param \Magento\App\Helper\HelperFactory $helperFactory * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig * @param \Magento\App\Cache\StateInterface $cacheState @@ -71,7 +71,7 @@ public function __construct( \Magento\Core\Model\Session\AbstractSession $session, \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, - \Magento\Core\Model\Factory\Helper $helperFactory, + \Magento\App\Helper\HelperFactory $helperFactory, \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, \Magento\App\Cache\StateInterface $cacheState, diff --git a/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php b/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php index 96b3a8860c8ae..123848b6717a7 100644 --- a/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php +++ b/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php @@ -43,20 +43,20 @@ abstract class AbstractDashboard extends \Magento\Adminhtml\Block\Widget */ protected $_collectionFactory; - /** - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getCollection() diff --git a/app/code/Magento/Backend/Block/Dashboard/Graph.php b/app/code/Magento/Backend/Block/Dashboard/Graph.php index 31b7da638ef78..797aaec69a2ac 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Graph.php +++ b/app/code/Magento/Backend/Block/Dashboard/Graph.php @@ -120,22 +120,22 @@ class Graph extends \Magento\Backend\Block\Dashboard\AbstractDashboard */ protected $_dashboardData = null; - /** - * @param \Magento\Backend\Helper\Dashboard\Data $dashboardData - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param \Magento\Backend\Helper\Dashboard\Data $dashboardData + * @param array $data */ - public function __construct( - \Magento\Backend\Helper\Dashboard\Data $dashboardData, - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + \Magento\Backend\Helper\Dashboard\Data $dashboardData, + array $data = array() + ) { $this->_dashboardData = $dashboardData; - parent::__construct($collectionFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $collectionFactory, $data); } /** @@ -340,9 +340,9 @@ public function getChartUrl($directUrl = true) $currentvalue = $thisdataarray[$j]; if (is_numeric($currentvalue)) { $ylocation = round((strlen($this->_simpleEncoding)-1) * ($yorigin + $currentvalue) / $yrange); - array_push($chartdata, substr($this->_simpleEncoding, $ylocation, 1) . $dataDelimiter); + $chartdata[] = substr($this->_simpleEncoding, $ylocation, 1) . $dataDelimiter; } else { - array_push($chartdata, $dataMissing . $dataDelimiter); + $chartdata[] = $dataMissing . $dataDelimiter; } } // END SIMPLE ENCODING @@ -360,14 +360,14 @@ public function getChartUrl($directUrl = true) $secondchar = $ylocation % 64; $mappedchar = substr($this->_extendedEncoding, $firstchar, 1) . substr($this->_extendedEncoding, $secondchar, 1); - array_push($chartdata, $mappedchar . $dataDelimiter); + $chartdata[] = $mappedchar . $dataDelimiter; } else { - array_push($chartdata, $dataMissing . $dataDelimiter); + $chartdata[] = $dataMissing . $dataDelimiter; } } // ============= END EXTENDED ENCODING ============= } - array_push($chartdata, $dataSetdelimiter); + $chartdata[] = $dataSetdelimiter; } $buffer = implode('', $chartdata); diff --git a/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php b/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php index 93c1f246cf9cd..05cd859d92c44 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php +++ b/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php @@ -41,24 +41,22 @@ class Grid extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php b/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php index b5e82583b7c50..c340713e2b231 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php +++ b/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php @@ -43,24 +43,22 @@ class Last extends \Magento\Backend\Block\Dashboard\Grid */ protected $_queriesFactory; - /** - * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory + * @param array $data */ - public function __construct( - \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, + array $data = array() + ) { $this->_queriesFactory = $queriesFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() 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 910711f08d45e..43df3a75d246f 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Searches/Renderer/Searchquery.php +++ b/app/code/Magento/Backend/Block/Dashboard/Searches/Renderer/Searchquery.php @@ -41,13 +41,13 @@ class Searchquery protected $_stringHelper = null; /** - * @param \Magento\Stdlib\String $stringHelper * @param \Magento\Backend\Block\Context $context + * @param \Magento\Stdlib\String $stringHelper * @param array $data */ public function __construct( - \Magento\Stdlib\String $stringHelper, \Magento\Backend\Block\Context $context, + \Magento\Stdlib\String $stringHelper, array $data = array() ) { $this->_stringHelper = $stringHelper; diff --git a/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php b/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php index c440370317c11..a525d9e837227 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php +++ b/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php @@ -43,24 +43,22 @@ class Top extends \Magento\Backend\Block\Dashboard\Grid */ protected $_queriesFactory; - /** - * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory + * @param array $data */ - public function __construct( - \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, + array $data = array() + ) { $this->_queriesFactory = $queriesFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php index 4b4839f51e4e8..86fe59f32fe07 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php @@ -41,24 +41,22 @@ class Most extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php index e07c4254b63f2..72215de3b598a 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php @@ -41,24 +41,22 @@ class Newest extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php index 01881f2902d5e..24166c3530e56 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php @@ -41,24 +41,22 @@ class Ordered extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php index 937f782d4a1d1..ac246a749d41e 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php @@ -41,24 +41,22 @@ class Viewed extends \Magento\Backend\Block\Dashboard\Grid */ protected $_productsFactory; - /** - * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory + * @param array $data */ - public function __construct( - \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory, + array $data = array() + ) { $this->_productsFactory = $productsFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Menu.php b/app/code/Magento/Backend/Block/Menu.php index 4ccced0de2404..d7e946f5d270b 100644 --- a/app/code/Magento/Backend/Block/Menu.php +++ b/app/code/Magento/Backend/Block/Menu.php @@ -70,32 +70,34 @@ class Menu extends \Magento\Backend\Block\Template */ protected $_authSession; - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * @var \Magento\Backend\Model\Menu\Config */ protected $_menuConfig; - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Url $url, - \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Backend\Model\Menu\Config $menuConfig, - array $data = array() - ) { + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Url $url + * @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Backend\Model\Menu\Config $menuConfig + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Url $url, + \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Backend\Model\Menu\Config $menuConfig, + array $data = array() + ) { $this->_url = $url; $this->_iteratorFactory = $iteratorFactory; $this->_authSession = $authSession; - $this->_locale = $locale; $this->_menuConfig = $menuConfig; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/Store/Switcher.php b/app/code/Magento/Backend/Block/Store/Switcher.php index 6f557d2761f71..9644f6152111a 100644 --- a/app/code/Magento/Backend/Block/Store/Switcher.php +++ b/app/code/Magento/Backend/Block/Store/Switcher.php @@ -74,13 +74,6 @@ class Switcher extends \Magento\Backend\Block\Template */ protected $_template = 'Magento_Backend::store/switcher.phtml'; - /** - * Application model - * - * @var \Magento\Core\Model\App - */ - protected $_application; - /** * Website factory * @@ -102,26 +95,23 @@ class Switcher extends \Magento\Backend\Block\Template */ protected $_storeFactory; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory - * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory + * @param \Magento\Core\Model\StoreFactory $storeFactory + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - \Magento\Core\Model\Website\Factory $websiteFactory, - \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, - \Magento\Core\Model\StoreFactory $storeFactory, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); - $this->_application = $application; + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Website\Factory $websiteFactory, + \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, + \Magento\Core\Model\StoreFactory $storeFactory, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_websiteFactory = $websiteFactory; $this->_storeGroupFactory = $storeGroupFactory; $this->_storeFactory = $storeFactory; @@ -158,7 +148,7 @@ public function getWebsiteCollection() */ public function getWebsites() { - $websites = $this->_application->getWebsites(); + $websites = $this->_storeManager->getWebsites(); if ($websiteIds = $this->getWebsiteIds()) { foreach (array_keys($websites) as $websiteId) { if (!in_array($websiteId, $websiteIds)) { @@ -190,7 +180,7 @@ public function getGroupCollection($website) public function getStoreGroups($website) { if (!$website instanceof \Magento\Core\Model\Website) { - $website = $this->_application->getWebsite($website); + $website = $this->_storeManager->getWebsite($website); } return $website->getGroups(); } @@ -221,7 +211,7 @@ public function getStoreCollection($group) public function getStores($group) { if (!$group instanceof \Magento\Core\Model\Store\Group) { - $group = $this->_application->getGroup($group); + $group = $this->_storeManager->getGroup($group); } $stores = $group->getStores(); if ($storeIds = $this->getStoreIds()) { @@ -302,7 +292,7 @@ public function getStoreIds() */ public function isShow() { - return !$this->_application->isSingleStoreMode(); + return !$this->_storeManager->isSingleStoreMode(); } /** diff --git a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php index 40e5c2607aefd..3f2a19901c1d9 100644 --- a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php +++ b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php @@ -46,27 +46,27 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_userFactory; - /** - * @param \Magento\User\Model\UserFactory $userFactory - * @param \Magento\Backend\Model\Auth\Session $authSession - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\User\Model\UserFactory $userFactory + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param array $data */ - public function __construct( - \Magento\User\Model\UserFactory $userFactory, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\User\Model\UserFactory $userFactory, + \Magento\Backend\Model\Auth\Session $authSession, + array $data = array() + ) { $this->_userFactory = $userFactory; $this->_authSession = $authSession; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Backend/Block/System/Config/Dwstree.php b/app/code/Magento/Backend/Block/System/Config/Dwstree.php index 74841e30f07ce..8afe0bce778c0 100644 --- a/app/code/Magento/Backend/Block/System/Config/Dwstree.php +++ b/app/code/Magento/Backend/Block/System/Config/Dwstree.php @@ -31,29 +31,6 @@ class Dwstree extends \Magento\Backend\Block\Widget\Tabs { - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param array $data - */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\StoreManagerInterface $storeManager, - array $data = array() - ) { - parent::__construct($coreData, $context, $authSession, $data); - $this->_storeManager = $storeManager; - } - protected function _construct() { parent::_construct(); diff --git a/app/code/Magento/Backend/Block/System/Config/Edit.php b/app/code/Magento/Backend/Block/System/Config/Edit.php index ca648a063882c..81f16df269312 100644 --- a/app/code/Magento/Backend/Block/System/Config/Edit.php +++ b/app/code/Magento/Backend/Block/System/Config/Edit.php @@ -61,26 +61,26 @@ class Edit extends \Magento\Backend\Block\Widget */ protected $_configStructure; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Config\Structure $configStructure - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Config\Structure $configStructure + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Config\Structure $configStructure, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Config\Structure $configStructure, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_configStructure = $configStructure; } /** * Prepare layout object * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/System/Config/Form.php b/app/code/Magento/Backend/Block/System/Config/Form.php index b35c713e5473a..20cc7cd2df27e 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form.php +++ b/app/code/Magento/Backend/Block/System/Config/Form.php @@ -125,45 +125,35 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic protected $_config; /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Backend\Model\Config\Factory $configFactory * @param \Magento\Backend\Model\Config\Structure $configStructure * @param \Magento\Backend\Block\System\Config\Form\Fieldset\Factory $fieldsetFactory * @param \Magento\Backend\Block\System\Config\Form\Field\Factory $fieldFactory * @param \Magento\Core\Model\Config $coreConfig - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @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 - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, \Magento\Backend\Model\Config\Factory $configFactory, \Magento\Backend\Model\Config\Structure $configStructure, \Magento\Backend\Block\System\Config\Form\Fieldset\Factory $fieldsetFactory, \Magento\Backend\Block\System\Config\Form\Field\Factory $fieldFactory, \Magento\Core\Model\Config $coreConfig, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, array $data = array() ) { - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); $this->_configFactory = $configFactory; $this->_configStructure = $configStructure; $this->_fieldsetFactory = $fieldsetFactory; $this->_fieldFactory = $fieldFactory; $this->_config = $coreConfig; - $this->_storeManager = $storeManager; $this->_scopeLabels = array( self::SCOPE_DEFAULT => __('[GLOBAL]'), @@ -471,7 +461,7 @@ public function getConfigValue($path) /** * * - * @return \Magento\Backend\Block\Widget\Form|\Magento\Core\Block\AbstractBlock|void + * @return \Magento\Backend\Block\Widget\Form|\Magento\View\Block\AbstractBlock|void */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field.php b/app/code/Magento/Backend/Block/System/Config/Form/Field.php index ffcbd33f4a924..ec966bbdfa944 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field.php @@ -41,29 +41,6 @@ class Field extends \Magento\Backend\Block\Template implements \Magento\Data\Form\Element\Renderer\RendererInterface { - /** - * Application - * - * @var \Magento\Core\Model\App - */ - protected $_application; - - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param array $data - */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - array $data = array() - ) { - $this->_application = $application; - parent::__construct($coreData, $context, $data); - } - /** * Retrieve element HTML markup * @@ -186,7 +163,7 @@ protected function _getInheritCheckboxLabel(\Magento\Data\Form\Element\AbstractE protected function _renderScopeLabel(\Magento\Data\Form\Element\AbstractElement $element) { $html = ''; - if ($element->getScope() && false == $this->_application->isSingleStoreMode()) { + if ($element->getScope() && false == $this->_app->isSingleStoreMode()) { $html .= $element->getScopeLabel(); } $html .= ''; diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field/Datetime.php b/app/code/Magento/Backend/Block/System/Config/Form/Field/Datetime.php index 77bf076750fba..4f85cd677b189 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field/Datetime.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field/Datetime.php @@ -33,9 +33,9 @@ class Datetime extends \Magento\Backend\Block\System\Config\Form\Field { protected function _getElementHtml(\Magento\Data\Form\Element\AbstractElement $element) { - $format = $this->_application->getLocale()->getDateTimeFormat( + $format = $this->_app->getLocale()->getDateTimeFormat( \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM ); - return $this->_application->getLocale()->date(intval($element->getValue()))->toString($format); + return $this->_app->getLocale()->date(intval($element->getValue()))->toString($format); } } diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field/Export.php b/app/code/Magento/Backend/Block/System/Config/Form/Field/Export.php index 380ac862d61eb..f5fdd0edbe4e5 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field/Export.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field/Export.php @@ -36,7 +36,7 @@ class Export extends \Magento\Data\Form\Element\AbstractElement { /** - * @var \Magento\Core\Model\Factory\Helper + * @var \Magento\App\Helper\HelperFactory */ protected $_helperFactory; @@ -44,14 +44,14 @@ class Export 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\Factory\Helper $helperFactory + * @param \Magento\App\Helper\HelperFactory $helperFactory * @param array $attributes */ public function __construct( \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, - \Magento\Core\Model\Factory\Helper $helperFactory, + \Magento\App\Helper\HelperFactory $helperFactory, array $attributes = array() ) { $this->_helperFactory = $helperFactory; diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php b/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php index 39b368241f3a4..adc4ed43bd7fa 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php @@ -101,7 +101,7 @@ public function addColumn($name, $params) 'class' => $this->_getParam($params, 'class'), 'renderer' => false, ); - if ((!empty($params['renderer'])) && ($params['renderer'] instanceof \Magento\Core\Block\AbstractBlock)) { + if ((!empty($params['renderer'])) && ($params['renderer'] instanceof \Magento\View\Block\AbstractBlock)) { $this->_columns[$name]['renderer'] = $params['renderer']; } } diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field/Notification.php b/app/code/Magento/Backend/Block/System/Config/Form/Field/Notification.php index 5103f20df7842..e2b47bcc96270 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field/Notification.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field/Notification.php @@ -33,10 +33,10 @@ class Notification extends \Magento\Backend\Block\System\Config\Form\Field { protected function _getElementHtml(\Magento\Data\Form\Element\AbstractElement $element) { - $element->setValue($this->_application->loadCache('admin_notifications_lastcheck')); - $format = $this->_application->getLocale()->getDateTimeFormat( + $element->setValue($this->_app->loadCache('admin_notifications_lastcheck')); + $format = $this->_app->getLocale()->getDateTimeFormat( \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM ); - return $this->_application->getLocale()->date(intval($element->getValue()))->toString($format); + return $this->_app->getLocale()->date(intval($element->getValue()))->toString($format); } } diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php b/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php index 4eadf3c9e92be..28fd6d6b07483 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php @@ -42,25 +42,23 @@ class Regexceptions */ protected $_labelFactory; - /** - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param array $data */ - public function __construct( - \Magento\Data\Form\Element\Factory $elementFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Data\Form\Element\Factory $elementFactory, + \Magento\Core\Model\Theme\LabelFactory $labelFactory, + array $data = array() + ) { $this->_elementFactory = $elementFactory; $this->_labelFactory = $labelFactory; - parent::__construct($coreData, $context, $application, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Config/Switcher.php b/app/code/Magento/Backend/Block/System/Config/Switcher.php index c7c5f07be63ff..6ab009aeb2030 100644 --- a/app/code/Magento/Backend/Block/System/Config/Switcher.php +++ b/app/code/Magento/Backend/Block/System/Config/Switcher.php @@ -34,31 +34,23 @@ class Switcher extends \Magento\Backend\Block\Template protected $_systemStore; /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\System\Store $systemStore, - \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { $this->_systemStore = $systemStore; - $this->_storeManager = $storeManager; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php b/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php index dd8743738cfa2..ca8c823a68fe9 100644 --- a/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php +++ b/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php @@ -39,22 +39,20 @@ class Synchronize */ protected $_fileStorage; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param \Magento\Core\Model\File\Storage $fileStorage - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\File\Storage $fileStorage + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - \Magento\Core\Model\File\Storage $fileStorage, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\File\Storage $fileStorage, + array $data = array() + ) { $this->_fileStorage = $fileStorage; - parent::__construct($coreData, $context, $application, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Config/Tabs.php b/app/code/Magento/Backend/Block/System/Config/Tabs.php index 5bae0bf86e45f..83728b75fab63 100644 --- a/app/code/Magento/Backend/Block/System/Config/Tabs.php +++ b/app/code/Magento/Backend/Block/System/Config/Tabs.php @@ -76,19 +76,19 @@ class Tabs extends \Magento\Backend\Block\Widget */ protected $_storeCode; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Config\Structure $configStructure - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Config\Structure $configStructure + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Config\Structure $configStructure, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Config\Structure $configStructure, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_tabs = $configStructure->getTabs(); $this->setId('system_config_tabs'); diff --git a/app/code/Magento/Backend/Block/System/Design/Edit.php b/app/code/Magento/Backend/Block/System/Design/Edit.php index 599bfd2fccc1b..751ea6b97c9b0 100644 --- a/app/code/Magento/Backend/Block/System/Design/Edit.php +++ b/app/code/Magento/Backend/Block/System/Design/Edit.php @@ -38,20 +38,20 @@ class Edit extends \Magento\Adminhtml\Block\Widget */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php index b353c44dd719e..32a3ef650fe1f 100644 --- a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php +++ b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php @@ -32,40 +32,32 @@ class General extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_labelFactory; - /** - * @var \Magento\Backend\Model\Session - */ - protected $_backendSession; - /** * @var \Magento\Core\Model\System\Store */ protected $_systemStore; - /** - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory - * @param \Magento\Backend\Model\Session $backendSession - * @param \Magento\Core\Model\System\Store $systemStore - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Core\Model\Theme\LabelFactory $labelFactory, - \Magento\Backend\Model\Session $backendSession, - \Magento\Core\Model\System\Store $systemStore, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Theme\LabelFactory $labelFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_labelFactory = $labelFactory; - $this->_backendSession = $backendSession; $this->_systemStore = $systemStore; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Shipping/Ups.php b/app/code/Magento/Backend/Block/System/Shipping/Ups.php index 17d4f85f6992e..39c77447a8d0d 100644 --- a/app/code/Magento/Backend/Block/System/Shipping/Ups.php +++ b/app/code/Magento/Backend/Block/System/Shipping/Ups.php @@ -41,31 +41,23 @@ class Ups extends \Magento\Backend\Block\Template */ protected $_websiteModel; - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeConfig; - - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel - * @param \Magento\Core\Model\Website $websiteModel - * @param \Magento\Core\Model\Store\Config $storeConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel + * @param \Magento\Core\Model\Website $websiteModel + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel, - \Magento\Core\Model\Website $websiteModel, - \Magento\Core\Model\Store\Config $storeConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel, + \Magento\Core\Model\Website $websiteModel, + array $data = array() + ) { $this->_shippingModel = $shippingModel; $this->_websiteModel = $websiteModel; - $this->_storeConfig = $storeConfig; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit.php b/app/code/Magento/Backend/Block/System/Store/Edit.php index c46b8beaf3881..e43f5746b0fcf 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit.php @@ -39,20 +39,20 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php index ad1392b7b5d08..65fce16e9cb3f 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php @@ -54,30 +54,30 @@ class Group */ protected $_websiteFactory; - /** - * @param \Magento\Catalog\Model\Config\Source\Category $category - * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Catalog\Model\Config\Source\Category $category + * @param \Magento\Core\Model\StoreFactory $storeFactory + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Config\Source\Category $category, - \Magento\Core\Model\StoreFactory $storeFactory, - \Magento\Core\Model\Website\Factory $websiteFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Catalog\Model\Config\Source\Category $category, + \Magento\Core\Model\StoreFactory $storeFactory, + \Magento\Core\Model\Website\Factory $websiteFactory, + array $data = array() + ) { $this->_category = $category; $this->_storeFactory = $storeFactory; $this->_websiteFactory = $websiteFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php index fa9b3af8a5b36..43006b0954ae2 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php @@ -49,27 +49,27 @@ class Store */ protected $_groupFactory; - /** - * @param \Magento\Core\Model\Store\Group\Factory $groupFactory - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Store\Group\Factory $groupFactory + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param array $data */ - public function __construct( - \Magento\Core\Model\Store\Group\Factory $groupFactory, - \Magento\Core\Model\Website\Factory $websiteFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Store\Group\Factory $groupFactory, + \Magento\Core\Model\Website\Factory $websiteFactory, + array $data = array() + ) { $this->_groupFactory = $groupFactory; $this->_websiteFactory = $websiteFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php index 45fa7e1681163..284e0d7c0b764 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php @@ -44,24 +44,24 @@ class Website */ protected $_groupFactory; - /** - * @param \Magento\Core\Model\Store\GroupFactory $groupFactory - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Store\GroupFactory $groupFactory + * @param array $data */ - public function __construct( - \Magento\Core\Model\Store\GroupFactory $groupFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Store\GroupFactory $groupFactory, + array $data = array() + ) { $this->_groupFactory = $groupFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Variable/Edit.php b/app/code/Magento/Backend/Block/System/Variable/Edit.php index 70e9d49104509..c1c4668a1ff6f 100644 --- a/app/code/Magento/Backend/Block/System/Variable/Edit.php +++ b/app/code/Magento/Backend/Block/System/Variable/Edit.php @@ -38,20 +38,20 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/Template.php b/app/code/Magento/Backend/Block/Template.php index aff926903f8c7..f7f0f0dbb6bca 100644 --- a/app/code/Magento/Backend/Block/Template.php +++ b/app/code/Magento/Backend/Block/Template.php @@ -31,18 +31,13 @@ * * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Template extends \Magento\Core\Block\Template +class Template extends \Magento\View\Block\Template { /** * @var \Magento\AuthorizationInterface */ protected $_authorization; - /** - * @var \Magento\Core\Model\StoreManager - */ - protected $_storeManager; - /** * @var \Magento\Core\Model\LocaleInterface */ @@ -54,20 +49,25 @@ class Template extends \Magento\Core\Block\Template protected $mathRandom; /** - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Backend\Model\Session + */ + protected $_backendSession; + + /** * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param array $data */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, array $data = array() ) { - $this->_storeManager = $context->getStoreManager(); $this->_locale = $context->getLocale(); $this->_authorization = $context->getAuthorization(); $this->mathRandom = $context->getMathRandom(); - parent::__construct($coreData, $context, $data); + $this->_backendSession = $context->getBackendSession(); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/Template/Context.php b/app/code/Magento/Backend/Block/Template/Context.php index 0ef867226f9ea..ca04a1cafaa06 100644 --- a/app/code/Magento/Backend/Block/Template/Context.php +++ b/app/code/Magento/Backend/Block/Template/Context.php @@ -28,7 +28,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Context extends \Magento\Core\Block\Template\Context +class Context extends \Magento\View\Block\Template\Context { /** * @var \Magento\AuthorizationInterface @@ -36,17 +36,16 @@ class Context extends \Magento\Core\Block\Template\Context protected $_authorization; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Math\Random */ - protected $_storeManager; + protected $mathRandom; /** - * @var \Magento\Math\Random + * @var \Magento\Backend\Model\Session */ - protected $mathRandom; + protected $_backendSession; /** - * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager @@ -57,7 +56,7 @@ class Context extends \Magento\Core\Block\Template\Context * @param \Magento\Core\Model\Session $session * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController - * @param \Magento\Core\Model\Factory\Helper $helperFactory + * @param \Magento\App\Helper\HelperFactory $helperFactory * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig * @param \Magento\App\Cache\StateInterface $cacheState @@ -65,20 +64,21 @@ class Context extends \Magento\Core\Block\Template\Context * @param \Magento\Logger $logger * @param \Magento\Filesystem $filesystem * @param \Magento\View\FileSystem $viewFileSystem - * @param \Magento\View\TemplateEngineFactory $engineFactory - * @param \Magento\AuthorizationInterface $authorization + * @param \Magento\View\TemplateEnginePool $enginePool * @param \Magento\Core\Model\App $app * @param \Magento\App\State $appState * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager - * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\AuthorizationInterface $authorization + * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Math\Random $mathRandom - * + * @param array $data + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\StoreManager $storeManager, \Magento\App\RequestInterface $request, \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, @@ -89,7 +89,7 @@ public function __construct( \Magento\Core\Model\Session $session, \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, - \Magento\Core\Model\Factory\Helper $helperFactory, + \Magento\App\Helper\HelperFactory $helperFactory, \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, \Magento\App\Cache\StateInterface $cacheState, @@ -97,16 +97,21 @@ public function __construct( \Magento\Logger $logger, \Magento\Filesystem $filesystem, \Magento\View\FileSystem $viewFileSystem, - \Magento\View\TemplateEngineFactory $engineFactory, - \Magento\AuthorizationInterface $authorization, + \Magento\View\TemplateEnginePool $enginePool, \Magento\Core\Model\App $app, \Magento\App\State $appState, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, - \Magento\Backend\Model\Session $backendSession, \Magento\Core\Model\LocaleInterface $locale, - \Magento\Math\Random $mathRandom + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\AuthorizationInterface $authorization, + \Magento\Backend\Model\Session $backendSession, + \Magento\Math\Random $mathRandom, + array $data = array() ) { + $this->_authorization = $authorization; + $this->_backendSession = $backendSession; + $this->mathRandom = $mathRandom; parent::__construct( $request, $layout, @@ -126,23 +131,22 @@ public function __construct( $logger, $filesystem, $viewFileSystem, - $engineFactory, + $enginePool, $app, $appState, $escaper, $filterManager, - $locale + $locale, + $storeManager, + $data ); - $this->_storeManager = $storeManager; - $this->_authorization = $authorization; - $this->_backendSession = $backendSession; - $this->mathRandom = $mathRandom; } + /** * Get store manager * - * @return \Magento\Core\Model\StoreManager + * @return \Magento\Core\Model\StoreManagerInterface */ public function getStoreManager() { diff --git a/app/code/Magento/Backend/Block/Widget/Accordion.php b/app/code/Magento/Backend/Block/Widget/Accordion.php index ddddf6e40ee43..7de430c0a747f 100644 --- a/app/code/Magento/Backend/Block/Widget/Accordion.php +++ b/app/code/Magento/Backend/Block/Widget/Accordion.php @@ -57,7 +57,7 @@ public function addItem($itemId, $config) ->setData($config) ->setAccordion($this) ->setId($itemId); - if (isset($config['content']) && $config['content'] instanceof \Magento\Core\Block\AbstractBlock) { + if (isset($config['content']) && $config['content'] instanceof \Magento\View\Block\AbstractBlock) { $this->_items[$itemId]->setChild($itemId.'_content', $config['content']); } diff --git a/app/code/Magento/Backend/Block/Widget/Accordion/Item.php b/app/code/Magento/Backend/Block/Widget/Accordion/Item.php index b79c033f93958..85b65c92a2183 100644 --- a/app/code/Magento/Backend/Block/Widget/Accordion/Item.php +++ b/app/code/Magento/Backend/Block/Widget/Accordion/Item.php @@ -64,7 +64,7 @@ public function getContent() if (is_string($content)) { return $content; } - if ($content instanceof \Magento\Core\Block\AbstractBlock) { + if ($content instanceof \Magento\View\Block\AbstractBlock) { return $content->toHtml(); } return null; diff --git a/app/code/Magento/Backend/Block/Widget/Container.php b/app/code/Magento/Backend/Block/Widget/Container.php index df31be59299ce..3cdb73c67b403 100644 --- a/app/code/Magento/Backend/Block/Widget/Container.php +++ b/app/code/Magento/Backend/Block/Widget/Container.php @@ -202,7 +202,7 @@ public function updateButton($buttonId, $key = null, $data) /** * Preparing child blocks for each added button * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/Widget/Form.php b/app/code/Magento/Backend/Block/Widget/Form.php index 8ca216c0de5a1..d3f6dd06e7a79 100644 --- a/app/code/Magento/Backend/Block/Widget/Form.php +++ b/app/code/Magento/Backend/Block/Widget/Form.php @@ -47,18 +47,18 @@ class Form extends \Magento\Backend\Block\Widget */ protected $_locale; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + array $data = array() + ) { $this->_locale = $context->getLocale(); - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -78,7 +78,7 @@ protected function _construct() * * You can redefine this method in child classes for changing layout * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { @@ -154,7 +154,7 @@ protected function _prepareForm() /** * This method is called before rendering HTML * - * @return \Magento\Backend\Block\Widget\Form|\Magento\Core\Block\AbstractBlock + * @return \Magento\Backend\Block\Widget\Form|\Magento\View\Block\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/Widget/Form/Container.php b/app/code/Magento/Backend/Block/Widget/Form/Container.php index ec3aa2de94292..a2494e34954da 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Container.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Container.php @@ -84,7 +84,7 @@ protected function _construct() /** * Create form block * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php b/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php index 898ee8d41307f..8d9d9de344b37 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php @@ -78,18 +78,18 @@ class Dependence extends \Magento\Backend\Block\AbstractBlock */ protected $_fieldFactory; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Context $context, - \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory, + array $data = array() + ) { $this->_coreData = $coreData; $this->_fieldFactory = $fieldFactory; parent::__construct($context, $data); diff --git a/app/code/Magento/Backend/Block/Widget/Form/Generic.php b/app/code/Magento/Backend/Block/Widget/Form/Generic.php index 8cee1231e12d9..713f3e1216149 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Generic.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Generic.php @@ -47,22 +47,22 @@ class Generic extends \Magento\Backend\Block\Widget\Form */ protected $_coreRegistry; - /** - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param array $data */ - public function __construct( - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_formFactory = $formFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } } diff --git a/app/code/Magento/Backend/Block/Widget/Grid.php b/app/code/Magento/Backend/Block/Widget/Grid.php index 582288bc39838..1ccbc22101f6f 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid.php +++ b/app/code/Magento/Backend/Block/Widget/Grid.php @@ -109,11 +109,6 @@ class Grid extends \Magento\Backend\Block\Widget protected $_template = 'Magento_Backend::widget/grid.phtml'; - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Core\Model\Url */ @@ -125,23 +120,20 @@ class Grid extends \Magento\Backend\Block\Widget protected $_backendSession; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Url $urlModel * @param array $data */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Url $urlModel, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_urlModel = $urlModel; $this->_backendSession = $context->getBackendSession(); - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() @@ -216,7 +208,7 @@ public function getColumnSet() * Retrieve export block * * @throws \Magento\Core\Exception - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ public function getExportBlock() { @@ -250,7 +242,7 @@ public function getColumnCount() * Retrieve column by id * * @param string $columnId - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ public function getColumn($columnId) { @@ -412,7 +404,7 @@ protected function _prepareGrid() /** * Get massaction block * - * @return bool|\Magento\Core\Block\AbstractBlock + * @return bool|\Magento\View\Block\AbstractBlock */ public function getMassactionBlock() { @@ -444,7 +436,7 @@ protected function _prepareFilterButtons() /** * Initialize grid before rendering * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php index 0dccc13fc7f2e..4351f21f1adb9 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php @@ -25,22 +25,22 @@ class Extended extends \Magento\Backend\Block\Widget\Grid\Column { - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + array $data = array() + ) { $this->_rendererTypes['options'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Extended'; $this->_filterTypes['options'] = 'Magento\Backend\Block\Widget\Grid\Column\Filter\Select\Extended'; $this->_rendererTypes['select'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Select\Extended'; $this->_rendererTypes['checkbox'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Checkboxes\Extended'; $this->_rendererTypes['radio'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Radio\Extended'; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php index 016098c1020da..478e5e43de249 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php @@ -32,31 +32,23 @@ class Date extends \Magento\Backend\Block\Widget\Grid\Column\Filter\AbstractFilter { - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * @var \Magento\Math\Random */ protected $mathRandom; /** - * @param \Magento\Core\Model\Resource\Helper $resourceHelper * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\Core\Model\Resource\Helper $resourceHelper * @param \Magento\Math\Random $mathRandom * @param array $data */ public function __construct( - \Magento\Core\Model\Resource\Helper $resourceHelper, \Magento\Backend\Block\Context $context, - \Magento\Core\Model\LocaleInterface $locale, + \Magento\Core\Model\Resource\Helper $resourceHelper, \Magento\Math\Random $mathRandom, array $data = array() ) { - $this->_locale = $locale; $this->mathRandom = $mathRandom; parent::__construct($context, $resourceHelper, $data); } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php index 1580a87eb708f..848a262308cb4 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php @@ -36,26 +36,16 @@ class Multistore extends \Magento\Backend\Block\Widget\Grid\Column { /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Helper\Data $coreData * @param array $data */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Helper\Data $coreData, array $data = array() ) { - parent::__construct($coreData, $context, $data); - $this->_storeManager = $storeManager; + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/AbstractRenderer.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/AbstractRenderer.php index 2ecd1b4578a24..7e4902de20075 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/AbstractRenderer.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/AbstractRenderer.php @@ -35,7 +35,8 @@ namespace Magento\Backend\Block\Widget\Grid\Column\Renderer; abstract class AbstractRenderer - extends \Magento\Backend\Block\AbstractBlock implements \Magento\Backend\Block\Widget\Grid\Column\Renderer\RendererInterface + extends \Magento\Backend\Block\AbstractBlock + implements \Magento\Backend\Block\Widget\Grid\Column\Renderer\RendererInterface { protected $_defaultWidth; protected $_column; diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php index f054a26bd2ca1..8c88e4caf3b72 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php @@ -44,16 +44,16 @@ class Action */ protected $_coreData = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Core\Helper\Data $coreData, + array $data = array() + ) { $this->_coreData = $coreData; parent::__construct($context, $data); } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Country.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Country.php index b89e009ccff49..6c2c6988620f7 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Country.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Country.php @@ -32,25 +32,6 @@ class Country extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\LocaleInterface $locale - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\LocaleInterface $locale, - array $data = array() - ) { - $this->_locale = $locale; - parent::__construct($context, $data); - } - /** * Render country grid column * diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php index 6ffbd69dcc4e4..90272e8d55d63 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php @@ -47,7 +47,7 @@ class Currency /** * Application object * - * @var \Magento\Core\Model\App + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -66,24 +66,20 @@ class Currency /** * @param \Magento\Backend\Block\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Directory\Model\Currency\DefaultLocator $currencyLocator * @param array $data */ public function __construct( \Magento\Backend\Block\Context $context, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\LocaleInterface $locale, \Magento\Directory\Model\Currency\DefaultLocator $currencyLocator, array $data = array() ) { parent::__construct($context, $data); $this->_storeManager = $storeManager; - $this->_locale = $locale; $this->_currencyLocator = $currencyLocator; } - /** * Renders grid column * diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php index a28975c7375d5..03b9c3467aef6 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php @@ -38,25 +38,6 @@ class Date */ protected static $_format = null; - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\LocaleInterface $locale - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\LocaleInterface $locale, - array $data = array() - ) { - $this->_locale = $locale; - parent::__construct($context, $data); - } - /** * Retrieve date format * diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php index 6eb6c5bf23e6d..ce4a4bae9da0b 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php @@ -37,25 +37,6 @@ class Datetime */ protected static $_format = null; - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\LocaleInterface $locale - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\LocaleInterface $locale, - array $data = array() - ) { - $this->_locale = $locale; - parent::__construct($context, $data); - } - /** * Retrieve datetime format * diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Longtext.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Longtext.php index f1521180522d5..587e04e9a59d1 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Longtext.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Longtext.php @@ -31,27 +31,6 @@ */ class Longtext extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { - /** - * Core string - * - * @var \Magento\Filter\FilterManager - */ - protected $filter; - - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Filter\FilterManager $filter - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Filter\FilterManager $filter, - array $data = array() - ) { - $this->filter = $filter; - parent::__construct($context, $data); - } - /** * Render contents as a long text * @@ -71,7 +50,7 @@ public function render(\Magento\Object $row) if ($this->getColumn()->getTruncate()) { $truncateLength = $this->getColumn()->getTruncate(); } - $text = $this->filter->truncate(parent::_getValue($row), array('length' => $truncateLength)); + $text = $this->filterManager->truncate(parent::_getValue($row), array('length' => $truncateLength)); if ($this->getColumn()->getEscape()) { $text = $this->escapeHtml($text); } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Price.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Price.php index 81b89f2365dad..63b249785c5e3 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Price.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Price.php @@ -38,25 +38,6 @@ class Price */ protected static $_currencies = array(); - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\LocaleInterface $locale - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\LocaleInterface $locale, - array $data = array() - ) { - $this->_locale = $locale; - parent::__construct($context, $data); - } - /** * Renders grid column * diff --git a/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php b/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php index 19c2c1245415e..20771cbace8a0 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php @@ -34,7 +34,7 @@ /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class ColumnSet extends \Magento\Core\Block\Template +class ColumnSet extends \Magento\View\Block\Template { /** * @var \Magento\Backend\Model\Widget\Grid\Row\UrlGenerator @@ -120,17 +120,16 @@ class ColumnSet extends \Magento\Core\Block\Template protected $_totals = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory - * $generatorFactory + * @param \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory * @param \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals * @param \Magento\Backend\Model\Widget\Grid\Totals $totals * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory, \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals, \Magento\Backend\Model\Widget\Grid\Totals $totals, @@ -150,7 +149,7 @@ public function __construct( array_key_exists('filter_visibility', $data) ? (bool) $data['filter_visibility'] : true ); - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); $this->setEmptyText(__( isset($data['empty_text'])? $data['empty_text'] : 'We couldn\'t find any records.' @@ -243,7 +242,7 @@ public function setFilterType($type, $className) /** * Prepare block for rendering * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Export.php b/app/code/Magento/Backend/Block/Widget/Grid/Export.php index 67bf75f7c953d..1c7ea433520bc 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Export.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Export.php @@ -64,20 +64,20 @@ class Export */ protected $_collectionFactory; - /** - * @param \Magento\Data\CollectionFactory $collectionFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Data\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Data\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Data\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() @@ -157,7 +157,7 @@ public function getId() /** * Prepare export button * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php index 72bdd253523a9..277948d31397d 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php @@ -190,7 +190,7 @@ protected function _construct() /** * Initialize child blocks * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _prepareLayout() { @@ -223,7 +223,7 @@ protected function _prepareLayout() /** * Retrieve column set block * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ public function getColumnSet() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php index 69ccd8cb84927..5695da8fee3e5 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php @@ -44,23 +44,23 @@ class Additional extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_handlerFactory; - /** - * @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 \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory + * @param array $data */ - public function __construct( - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory, - array $data = array() - ) { - parent::__construct($registry, $formFactory, $coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory, + array $data = array() + ) { + parent::__construct($context, $coreData, $registry, $formFactory, $data); $this->_handlerFactory = $handlerFactory; } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php index 9d439f94933f5..f706254a356de 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php @@ -59,20 +59,20 @@ class Extended extends \Magento\Backend\Block\Widget */ protected $_backendData = null; - /** - * @param \Magento\Backend\Helper\Data $backendData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Helper\Data $backendData + * @param array $data */ - public function __construct( - \Magento\Backend\Helper\Data $backendData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Helper\Data $backendData, + array $data = array() + ) { $this->_backendData = $backendData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -92,7 +92,7 @@ public function _construct() * 'complete' => string, // Only for ajax enabled grid (optional) * 'url' => string, * 'confirm' => string, // text of confirmation of this action (optional) - * 'additional' => string|array|\Magento\Core\Block\AbstractBlock // (optional) + * 'additional' => string|array|\Magento\View\Block\AbstractBlock // (optional) * ); * * @param string $itemId diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php index 1f2515a119b78..742edfbfb54a5 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php @@ -64,7 +64,7 @@ public function getMassaction() /** * Set additional action block for this item * - * @param string|\Magento\Core\Block\AbstractBlock $block + * @param string|\Magento\View\Block\AbstractBlock $block * @return \Magento\Backend\Block\Widget\Grid\Massaction\Item * @throws \Magento\Core\Exception */ @@ -74,7 +74,7 @@ public function setAdditionalActionBlock($block) $block = $this->getLayout()->createBlock($block); } elseif (is_array($block)) { $block = $this->_createFromConfig($block); - } elseif (!($block instanceof \Magento\Core\Block\AbstractBlock)) { + } elseif (!($block instanceof \Magento\View\Block\AbstractBlock)) { throw new \Magento\Core\Exception('Unknown block type'); } @@ -99,7 +99,7 @@ protected function _createFromConfig(array $config) /** * Retrive additional action block for this item * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ public function getAdditionalActionBlock() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php b/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php index c1201d0471e40..c28b6ef2cdc8d 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Block\Widget\Grid; -class Serializer extends \Magento\Core\Block\Template +class Serializer extends \Magento\View\Block\Template { /** * Preparing global layout diff --git a/app/code/Magento/Backend/Block/Widget/Tabs.php b/app/code/Magento/Backend/Block/Widget/Tabs.php index cfcd8cf28335b..076d838ef9af7 100644 --- a/app/code/Magento/Backend/Block/Widget/Tabs.php +++ b/app/code/Magento/Backend/Block/Widget/Tabs.php @@ -60,20 +60,20 @@ class Tabs extends \Magento\Backend\Block\Widget */ protected $_authSession; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Auth\Session $authSession, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Auth\Session $authSession, + array $data = array() + ) { $this->_authSession = $authSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Backend/Controller/AbstractAction.php b/app/code/Magento/Backend/Controller/AbstractAction.php deleted file mode 100644 index f5969a7cf0133..0000000000000 --- a/app/code/Magento/Backend/Controller/AbstractAction.php +++ /dev/null @@ -1,587 +0,0 @@ -_helper = $context->getHelper(); - $this->_session = $context->getSession(); - $this->_authorization = $context->getAuthorization(); - $this->_translator = $context->getTranslator(); - $this->_auth = $context->getAuth(); - $this->_backendUrl = $context->getBackendUrl(); - $this->_locale = $context->getLocale(); - $this->_canUseBaseUrl = $context->getCanUseBaseUrl(); - } - - protected function _isAllowed() - { - return true; - } - - /** - * Retrieve adminhtml session model object - * - * @return \Magento\Backend\Model\Session - */ - protected function _getSession() - { - return $this->_session; - } - - /** - * Retrieve base adminhtml helper - * - * @return \Magento\Backend\Helper\Data - */ - protected function _getHelper() - { - return $this->_helper; - } - - /** - * Define active menu item in menu block - * @param string $itemId current active menu item - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _setActiveMenu($itemId) - { - /** @var $menuBlock \Magento\Backend\Block\Menu */ - $menuBlock = $this->getLayout()->getBlock('menu'); - $menuBlock->setActive($itemId); - $parents = $menuBlock->getMenuModel()->getParentItems($itemId); - $parents = array_reverse($parents); - foreach ($parents as $item) { - /** @var $item \Magento\Backend\Model\Menu\Item */ - array_unshift($this->_titles, $item->getTitle()); - } - return $this; - } - - /** - * @param $label - * @param $title - * @param null $link - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _addBreadcrumb($label, $title, $link=null) - { - $this->getLayout()->getBlock('breadcrumbs')->addLink($label, $title, $link); - return $this; - } - - /** - * @param \Magento\Core\Block\AbstractBlock $block - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _addContent(\Magento\Core\Block\AbstractBlock $block) - { - return $this->_moveBlockToContainer($block, 'content'); - } - - /** - * @param \Magento\Core\Block\AbstractBlock $block - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _addLeft(\Magento\Core\Block\AbstractBlock $block) - { - return $this->_moveBlockToContainer($block, 'left'); - } - - /** - * @param \Magento\Core\Block\AbstractBlock $block - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _addJs(\Magento\Core\Block\AbstractBlock $block) - { - return $this->_moveBlockToContainer($block, 'js'); - } - - /** - * Set specified block as an anonymous child to specified container - * - * The block will be moved to the container from previous parent after all other elements - * - * @param \Magento\Core\Block\AbstractBlock $block - * @param string $containerName - * @return \Magento\Backend\Controller\AbstractAction - */ - private function _moveBlockToContainer(\Magento\Core\Block\AbstractBlock $block, $containerName) - { - $this->getLayout()->setChild($containerName, $block->getNameInLayout(), ''); - return $this; - } - - /** - * Controller predispatch method - * - * @return \Magento\Backend\Controller\AbstractAction - */ - public function preDispatch() - { - /** @var $storeManager \Magento\Core\Model\StoreManager */ - $storeManager = $this->_objectManager->get('Magento\Core\Model\StoreManager'); - $storeManager->setCurrentStore('admin'); - - $this->_eventManager->dispatch('adminhtml_controller_action_predispatch_start', array()); - parent::preDispatch(); - if (!$this->_processUrlKeys()) { - return $this; - } - - if ($this->getRequest()->isDispatched() - && $this->getRequest()->getActionName() !== 'denied' - && !$this->_isAllowed()) { - $this->_forward('denied'); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); - return $this; - } - - if ($this->_isUrlChecked()) { - $this->setFlag('', self::FLAG_IS_URLS_CHECKED, true); - } - - $this->_processLocaleSettings(); - - return $this; - } - - /** - * Check whether url is checked - * - * @return bool - */ - protected function _isUrlChecked() - { - return !$this->getFlag('', self::FLAG_IS_URLS_CHECKED) - && !$this->getRequest()->getParam('forwarded') - && !$this->_getSession()->getIsUrlNotice(true) - && !$this->_canUseBaseUrl; - } - - /** - * Check url keys. If non valid - redirect - * - * @return bool - */ - public function _processUrlKeys() - { - $_isValidFormKey = true; - $_isValidSecretKey = true; - $_keyErrorMsg = ''; - if ($this->_auth->isLoggedIn()) { - if ($this->getRequest()->isPost()) { - $_isValidFormKey = $this->_validateFormKey(); - $_keyErrorMsg = __('Invalid Form Key. Please refresh the page.'); - } elseif ($this->_backendUrl->useSecretKey()) { - $_isValidSecretKey = $this->_validateSecretKey(); - $_keyErrorMsg = __('You entered an invalid Secret Key. Please refresh the page.'); - } - } - if (!$_isValidFormKey || !$_isValidSecretKey) { - $this->setFlag('', self::FLAG_NO_DISPATCH, true); - $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); - if ($this->getRequest()->getQuery('isAjax', false) || $this->getRequest()->getQuery('ajax', false)) { - $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(array( - 'error' => true, - 'message' => $_keyErrorMsg - ))); - } else { - $this->_redirect($this->_backendUrl->getStartupPageUrl()); - } - return false; - } - return true; - } - - /** - * Set session locale, - * process force locale set through url params - * - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _processLocaleSettings() - { - $forceLocale = $this->getRequest()->getParam('locale', null); - if ($this->_objectManager->get('Magento\Core\Model\Locale\Validator')->isValid($forceLocale)) { - $this->_getSession()->setSessionLocale($forceLocale); - } - - if (is_null($this->_getSession()->getLocale())) { - $this->_getSession()->setLocale($this->_locale->getLocaleCode()); - } - - return $this; - } - - /** - * Fire predispatch events, execute extra logic after predispatch - */ - protected function _firePreDispatchEvents() - { - $this->_initAuthentication(); - parent::_firePreDispatchEvents(); - } - - /** - * Start authentication process - * - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _initAuthentication() - { - $request = $this->getRequest(); - $requestedActionName = $request->getActionName(); - $openActions = array( - 'forgotpassword', - 'resetpassword', - 'resetpasswordpost', - 'logout', - 'refresh' // captcha refresh - ); - if (in_array($requestedActionName, $openActions)) { - $request->setDispatched(true); - } else { - if ($this->_auth->getUser()) { - $this->_auth->getUser()->reload(); - } - if (!$this->_auth->isLoggedIn()) { - $this->_processNotLoggedInUser($request); - } - } - $this->_auth->getAuthStorage()->refreshAcl(); - return $this; - } - - /** - * Process not logged in user data - * - * @param \Magento\App\RequestInterface $request - */ - protected function _processNotLoggedInUser(\Magento\App\RequestInterface $request) - { - $isRedirectNeeded = false; - if ($request->getPost('login') && $this->_performLogin()) { - $isRedirectNeeded = $this->_redirectIfNeededAfterLogin(); - } - if (!$isRedirectNeeded && !$request->getParam('forwarded')) { - if ($request->getParam('isIframe')) { - $request->setParam('forwarded', true) - ->setRouteName('adminhtml') - ->setControllerName('auth') - ->setActionName('deniedIframe') - ->setDispatched(false); - } elseif ($request->getParam('isAjax')) { - $request->setParam('forwarded', true) - ->setRouteName('adminhtml') - ->setControllerName('auth') - ->setActionName('deniedJson') - ->setDispatched(false); - } else { - $request->setParam('forwarded', true) - ->setRouteName('adminhtml') - ->setControllerName('auth') - ->setActionName('login') - ->setDispatched(false); - } - } - } - - /** - * Performs login, if user submitted login form - * - * @return boolean - */ - protected function _performLogin() - { - $outputValue = true; - $postLogin = $this->getRequest()->getPost('login'); - $username = isset($postLogin['username']) ? $postLogin['username'] : ''; - $password = isset($postLogin['password']) ? $postLogin['password'] : ''; - $this->getRequest()->setPost('login', null); - - try { - $this->_auth->login($username, $password); - } catch (\Magento\Backend\Model\Auth\Exception $e) { - if (!$this->getRequest()->getParam('messageSent')) { - $this->_session->addError($e->getMessage()); - $this->getRequest()->setParam('messageSent', true); - $outputValue = false; - } - } - return $outputValue; - } - - /** - * Checks, whether Magento requires redirection after successful admin login, and redirects user, if needed - * - * @return bool - */ - protected function _redirectIfNeededAfterLogin() - { - $requestUri = null; - - // Checks, whether secret key is required for admin access or request uri is explicitly set - if ($this->_backendUrl->useSecretKey()) { - $requestUri = $this->_backendUrl->getUrl('*/*/*', array('_current' => true)); - } elseif ($this->getRequest()) { - $requestUri = $this->getRequest()->getRequestUri(); - } - - if (!$requestUri) { - return false; - } - - $this->getResponse()->setRedirect($requestUri); - $this->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); - return true; - } - - public function deniedAction() - { - $this->getResponse()->setHeader('HTTP/1.1', '403 Forbidden'); - if (!$this->_auth->isLoggedIn()) { - $this->_redirect('*/auth/login'); - return; - } - $this->loadLayout(array('default', 'adminhtml_denied')); - $this->renderLayout(); - } - - /** - * Load layout by handles and verify user ACL - * - * @param string|null|bool|array $ids - * @param bool $generateBlocks - * @param bool $generateXml - * @return \Magento\Backend\Controller\AbstractAction|\Magento\Core\Controller\Varien\Action - */ - public function loadLayout($ids = null, $generateBlocks = true, $generateXml = true) - { - parent::loadLayout($ids, false, $generateXml); - $this->_objectManager->get('Magento\Core\Model\Layout\Filter\Acl') - ->filterAclNodes($this->getLayout()->getNode()); - if ($generateBlocks) { - $this->generateLayoutBlocks(); - $this->_isLayoutLoaded = true; - } - $this->_initLayoutMessages('Magento\Backend\Model\Session'); - return $this; - } - - /** - * No route action - * - * @param null $coreRoute - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function norouteAction($coreRoute = null) - { - $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found'); - $this->getResponse()->setHeader('Status', '404 File not found'); - $this->loadLayout(array('default', 'adminhtml_noroute')); - $this->renderLayout(); - } - - /** - * Set referrer url for redirect in response - * - * Is overridden here to set defaultUrl to admin url - * - * @param string $defaultUrl - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _redirectReferer($defaultUrl = null) - { - $defaultUrl = empty($defaultUrl) ? $this->getUrl('*') : $defaultUrl; - parent::_redirectReferer($defaultUrl); - return $this; - } - - /** - * Set redirect into response - * - * @param string $path - * @param array $arguments - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _redirect($path, $arguments=array()) - { - $this->_getSession()->setIsUrlNotice($this->getFlag('', self::FLAG_IS_URLS_CHECKED)); - $this->getResponse()->setRedirect($this->getUrl($path, $arguments)); - return $this; - } - - protected function _forward($action, $controller = null, $module = null, array $params = null) - { - $this->_getSession()->setIsUrlNotice($this->getFlag('', self::FLAG_IS_URLS_CHECKED)); - return parent::_forward($action, $controller, $module, $params); - } - - /** - * Generate url by route and parameters - * - * @param string $route - * @param array $params - * @return string - */ - public function getUrl($route = '', $params=array()) - { - return $this->_getHelper()->getUrl($route, $params); - } - - /** - * Validate Secret Key - * - * @return bool - */ - protected function _validateSecretKey() - { - if (is_array($this->_publicActions) && in_array($this->getRequest()->getActionName(), $this->_publicActions)) { - return true; - } - - $secretKey = $this->getRequest()->getParam(\Magento\Backend\Model\Url::SECRET_KEY_PARAM_NAME, null); - if (!$secretKey || $secretKey != $this->_backendUrl->getSecretKey()) { - return false; - } - return true; - } - - /** - * Render specified template - * - * @param string $tplName - * @param array $data parameters required by template - */ - protected function _outTemplate($tplName, $data = array()) - { - $this->_initLayoutMessages('Magento\Backend\Model\Session'); - $block = $this->getLayout()->createBlock('Magento\Backend\Block\Template')->setTemplate("{$tplName}.phtml"); - foreach ($data as $index => $value) { - $block->assign($index, $value); - } - $html = $block->toHtml(); - $this->_objectManager->get('Magento\Core\Model\Translate')->processResponseBody($html); - $this->getResponse()->setBody($html); - } - - /** - * Declare headers and content file in response for file download - * - * @param string $fileName - * @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in - * that case - * @param string $contentType - * @param int $contentLength explicit content length, if strlen($content) isn't applicable - * @return \Magento\Backend\Controller\AbstractAction - */ - protected function _prepareDownloadResponse($fileName, $content, $contentType = 'application/octet-stream', - $contentLength = null - ) { - if ($this->_auth->getAuthStorage()->isFirstPageAfterLogin()) { - $this->_redirect($this->_backendUrl->getStartupPageUrl()); - return $this; - } - return parent::_prepareDownloadResponse($fileName, $content, $contentType, $contentLength); - } -} diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Ajax.php b/app/code/Magento/Backend/Controller/Adminhtml/Ajax.php index a8ff8da09e045..174eb6e45019e 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Ajax.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Ajax.php @@ -23,7 +23,7 @@ */ namespace Magento\Backend\Controller\Adminhtml; -class Ajax extends \Magento\Backend\Controller\Adminhtml\Action +class Ajax extends \Magento\Backend\App\Action { /** * Ajax action for inline translation @@ -36,6 +36,6 @@ public function translateAction() $translationHelper = $this->_objectManager->get('Magento\Core\Helper\Translate'); $response = $translationHelper->apply($translationParams, $area); $this->getResponse()->setBody($response); - $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + $this->_actionFlag->set('', self::FLAG_NO_POST_DISPATCH, true); } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth.php index 9e711ea79e02b..513ac3505ffa0 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Controller\Adminhtml; -class Auth extends \Magento\Backend\Controller\AbstractAction +class Auth extends \Magento\Backend\App\AbstractAction { /** * Administrator login action @@ -43,8 +43,8 @@ public function loginAction() $this->_redirect($this->_backendUrl->getStartupPageUrl()); return; } - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php index 003fedf1b4791..51c97b9f6e3ca 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php @@ -26,7 +26,9 @@ namespace Magento\Backend\Controller\Adminhtml; -class Cache extends \Magento\Backend\Controller\Adminhtml\Action +use Magento\Backend\App\Action; + +class Cache extends \Magento\Backend\App\Action { /** * @var \Magento\App\Cache\TypeListInterface @@ -44,13 +46,13 @@ class Cache extends \Magento\Backend\Controller\Adminhtml\Action private $_cacheFrontendPool; /** - * @param \Magento\Backend\Controller\Context $context + * @param Action\Context $context * @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, + Action\Context $context, \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\App\Cache\StateInterface $cacheState, \Magento\App\Cache\Frontend\Pool $cacheFrontendPool @@ -76,11 +78,11 @@ protected function _getSession() */ public function indexAction() { - $this->_title(__('Cache Management')); + $this->_title->add(__('Cache Management')); - $this->loadLayout() - ->_setActiveMenu('Magento_Adminhtml::system_cache') - ->renderLayout(); + $this->_view->loadLayout(); + $this->_setActiveMenu('Magento_Adminhtml::system_cache'); + $this->_view->renderLayout(); } /** diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php index 859a2eb70bd3b..ae450db148eae 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php @@ -33,16 +33,24 @@ */ namespace Magento\Backend\Controller\Adminhtml; -class Dashboard extends \Magento\Backend\Controller\Adminhtml\Action +class Dashboard extends \Magento\Backend\App\Action { + /** + * @param \Magento\Backend\App\Action\Context $context + */ + public function __construct(\Magento\Backend\App\Action\Context $context) + { + parent::__construct($context); + } + public function indexAction() { - $this->_title(__('Dashboard')); + $this->_title->add(__('Dashboard')); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Adminhtml::dashboard'); $this->_addBreadcrumb(__('Dashboard'), __('Dashboard')); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -51,8 +59,8 @@ public function indexAction() */ public function productsViewedAction() { - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -61,8 +69,8 @@ public function productsViewedAction() */ public function customersNewestAction() { - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -71,8 +79,8 @@ public function customersNewestAction() */ public function customersMostAction() { - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } public function ajaxBlockAction() @@ -85,7 +93,7 @@ public function ajaxBlockAction() ucwords(str_replace('_', ' ', $blockTab)) ); if (in_array($blockTab, array('tab_orders', 'tab_amounts', 'totals'))) { - $output = $this->getLayout()->createBlock('Magento\\Backend\\Block\\Dashboard\\' . $blockClassSuffix) + $output = $this->_view->getLayout()->createBlock('Magento\\Backend\\Block\\Dashboard\\' . $blockClassSuffix) ->toHtml(); } $this->getResponse()->setBody($output); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Index.php b/app/code/Magento/Backend/Controller/Adminhtml/Index.php index a9893978394b4..86347b3a4cde6 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Index.php @@ -29,7 +29,9 @@ */ namespace Magento\Backend\Controller\Adminhtml; -class Index extends \Magento\Backend\Controller\AbstractAction +use Magento\App\Action\NotFoundException; + +class Index extends \Magento\Backend\App\AbstractAction { /** * Search modules list @@ -39,11 +41,11 @@ class Index extends \Magento\Backend\Controller\AbstractAction protected $_searchModules; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param array $searchModules */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, array $searchModules = array() ) { $this->_searchModules = $searchModules; diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Noroute.php b/app/code/Magento/Backend/Controller/Adminhtml/Noroute.php new file mode 100644 index 0000000000000..e1a6916475979 --- /dev/null +++ b/app/code/Magento/Backend/Controller/Adminhtml/Noroute.php @@ -0,0 +1,39 @@ +getResponse()->setHeader('HTTP/1.1', '404 Not Found'); + $this->getResponse()->setHeader('Status', '404 File not found'); + $this->_view->loadLayout(array('default', 'adminhtml_noroute')); + $this->_view->renderLayout(); + } +} \ No newline at end of file diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System.php b/app/code/Magento/Backend/Controller/Adminhtml/System.php index 3239b98f15b58..3e47135ccfa02 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System.php @@ -33,17 +33,17 @@ */ namespace Magento\Backend\Controller\Adminhtml; -class System extends \Magento\Backend\Controller\AbstractAction +class System extends \Magento\Backend\App\AbstractAction { public function indexAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Adminhtml::system'); $this->_addBreadcrumb( __('System'), __('System') ); - $this->renderLayout(); + $this->_view->renderLayout(); } public function setStoreAction() @@ -52,7 +52,7 @@ public function setStoreAction() if ($storeId) { $this->_session->setStoreId($storeId); } - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); } protected function _isAllowed() diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php b/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php index b85f4cdb54b1a..0f61f7793815c 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php @@ -29,7 +29,9 @@ */ namespace Magento\Backend\Controller\Adminhtml\System; -abstract class AbstractConfig extends \Magento\Backend\Controller\AbstractAction +use Magento\App\Action\NotFoundException; + +abstract class AbstractConfig extends \Magento\Backend\App\AbstractAction { /** * @var \Magento\Backend\Model\Config\Structure @@ -37,11 +39,11 @@ abstract class AbstractConfig extends \Magento\Backend\Controller\AbstractAction protected $_configStructure; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Backend\Model\Config\Structure $configStructure */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\Config\Structure $configStructure ) { parent::__construct($context); @@ -49,23 +51,21 @@ public function __construct( } /** - * Controller pre-dispatch method * Check if current section is found and is allowed * - * @return \Magento\Backend\Controller\AbstractAction + * @param \Magento\App\RequestInterface $request + * @return $this|mixed */ - public function preDispatch() + public function dispatch(\Magento\App\RequestInterface $request) { - parent::preDispatch(); - $section = null; - if (!$this->getRequest()->getParam('section')) { + if (!$request->getParam('section')) { $section = $this->_configStructure->getFirstSection(); - $this->getRequest()->setParam('section', $section->getId()); + $request->setParam('section', $section->getId()); } else { - $this->_isSectionAllowed($this->getRequest()->getParam('section')); + $this->_isSectionAllowed($request->getParam('section')); } - return $this; + return parent::dispatch($request); } /** @@ -86,6 +86,7 @@ protected function _isAllowed() * @param string $sectionId * @throws \Exception * @return bool + * @throws NotFoundException */ protected function _isSectionAllowed($sectionId) { @@ -95,12 +96,10 @@ protected function _isSectionAllowed($sectionId) } return true; } catch (\Zend_Acl_Exception $e) { - $this->norouteAction(); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); - return false; + throw new NotFoundException(); } catch (\Exception $e) { $this->deniedAction(); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); return false; } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php index 1a425ff8dab88..6bab53bc587cd 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php @@ -34,14 +34,14 @@ namespace Magento\Backend\Controller\Adminhtml\System; -class Account extends \Magento\Backend\Controller\Adminhtml\Action +class Account extends \Magento\Backend\App\Action { public function indexAction() { - $this->_title(__('My Account')); + $this->_title->add(__('My Account')); - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Backup.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Backup.php index d0359eaf83fe1..0bea7de81560f 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Backup.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Backup.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Controller\Adminhtml\System; -class Backup extends \Magento\Backend\Controller\Adminhtml\Action +class Backup extends \Magento\Backend\App\Action { /** * Core registry @@ -48,17 +48,25 @@ class Backup extends \Magento\Backend\Controller\Adminhtml\Action protected $_backupFactory; /** - * @param \Magento\Backend\Controller\Context $context + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + + /** + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Backup\Factory $backupFactory + * @param \Magento\App\Response\Http\FileFactory $fileFactory */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry, - \Magento\Backup\Factory $backupFactory + \Magento\Backup\Factory $backupFactory, + \Magento\App\Response\Http\FileFactory $fileFactory ) { $this->_coreRegistry = $coreRegistry; $this->_backupFactory = $backupFactory; + $this->_fileFactory = $fileFactory; parent::__construct($context); } @@ -67,20 +75,20 @@ public function __construct( */ public function indexAction() { - $this->_title(__('Backups')); + $this->_title->add(__('Backups')); if ($this->getRequest()->getParam('ajax')) { $this->_forward('grid'); return; } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Backup::system_tools_backup'); $this->_addBreadcrumb(__('System'), __('System')); $this->_addBreadcrumb(__('Tools'), __('Tools')); $this->_addBreadcrumb(__('Backups'), __('Backup')); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -89,13 +97,13 @@ public function indexAction() public function gridAction() { $this->renderLayot(false); - $this->renderLayout(); + $this->_view->renderLayout(); } /** * Create backup action * - * @return \Magento\Backend\Controller\Adminhtml\Action + * @return \Magento\Backend\App\Action */ public function createAction() { @@ -179,7 +187,7 @@ public function createAction() /** * Download backup action * - * @return \Magento\Backend\Controller\Adminhtml\Action + * @return \Magento\Backend\App\Action */ public function downloadAction() { @@ -196,9 +204,9 @@ public function downloadAction() $fileName = $this->_objectManager->get('Magento\Backup\Helper\Data') ->generateBackupDownloadName($backup); - $this->_prepareDownloadResponse($fileName, null, 'application/octet-stream', $backup->getSize()); + $response = $this->_fileFactory->create($fileName, null, 'application/octet-stream', $backup->getSize()); - $this->getResponse()->sendHeaders(); + $response->sendHeaders(); $backup->output(); exit(); @@ -207,7 +215,7 @@ public function downloadAction() /** * Rollback Action * - * @return \Magento\Backend\Controller\Adminhtml\Action + * @return \Magento\Backend\App\Action */ public function rollbackAction() { @@ -325,7 +333,7 @@ public function rollbackAction() /** * Delete backups mass action * - * @return \Magento\Backend\Controller\Adminhtml\Action + * @return \Magento\Backend\App\Action */ public function massDeleteAction() { diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php index 7ee8fb21bd01a..0a3b13f40e2ce 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php @@ -31,22 +31,30 @@ class Config extends \Magento\Backend\Controller\Adminhtml\System\AbstractConfig { + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + /** * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Backend\Model\Config\Structure $configStructure + * @param \Magento\App\Response\Http\FileFactory $fileFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\Config\Structure $configStructure, + \Magento\App\Response\Http\FileFactory $fileFactory, \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; + $this->_fileFactory = $fileFactory; parent::__construct($context, $configStructure); } @@ -65,7 +73,7 @@ public function indexAction() */ public function editAction() { - $this->_title(__('Configuration')); + $this->_title->add(__('Configuration')); $current = $this->getRequest()->getParam('section'); $website = $this->getRequest()->getParam('website'); @@ -77,10 +85,10 @@ public function editAction() return $this->_redirect('adminhtml/*/', array('website' => $website, 'store' => $store)); } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Adminhtml::system_config'); - $this->getLayout()->getBlock('menu')->setAdditionalCacheKeyInfo(array($current)); + $this->_view->getLayout()->getBlock('menu')->setAdditionalCacheKeyInfo(array($current)); $this->_addBreadcrumb( __('System'), @@ -88,7 +96,7 @@ public function editAction() $this->getUrl('*\/system') ); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -114,7 +122,8 @@ public function exportTableratesAction() { $fileName = 'tablerates.csv'; /** @var $gridBlock \Magento\Adminhtml\Block\Shipping\Carrier\Tablerate\Grid */ - $gridBlock = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Shipping\Carrier\Tablerate\Grid'); + $gridBlock = $this->_view->getLayout() + ->createBlock('Magento\Adminhtml\Block\Shipping\Carrier\Tablerate\Grid'); $website = $this->_storeManager->getWebsite($this->getRequest()->getParam('website')); if ($this->getRequest()->getParam('conditionName')) { $conditionName = $this->getRequest()->getParam('conditionName'); @@ -123,6 +132,6 @@ public function exportTableratesAction() } $gridBlock->setWebsiteId($website->getId())->setConditionName($conditionName); $content = $gridBlock->getCsvFile(); - $this->_prepareDownloadResponse($fileName, $content); + return $this->_fileFactory->create($fileName, $content); } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/Save.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/Save.php index e2794d4d203c9..ec6a87db567a5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/Save.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/Save.php @@ -57,14 +57,14 @@ class Save extends \Magento\Backend\Controller\Adminhtml\System\AbstractConfig protected $string; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Backend\Model\Config\Structure $configStructure * @param \Magento\Backend\Model\Config\Factory $configFactory * @param \Magento\Cache\FrontendInterface $cache * @param \Magento\Stdlib\String $string */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\Config\Structure $configStructure, \Magento\Backend\Model\Config\Factory $configFactory, \Magento\Cache\FrontendInterface $cache, diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php index 74067e8c96184..caebd1ee74263 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Controller\Adminhtml\System\Config\System; -class Storage extends \Magento\Backend\Controller\Adminhtml\Action +class Storage extends \Magento\Backend\App\Action { /** * Return file storage singleton diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php index 71293d03c9529..74e55caa5e738 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Controller\Adminhtml\System; -class Design extends \Magento\Backend\Controller\Adminhtml\Action +class Design extends \Magento\Backend\App\Action { /** * Core registry @@ -36,11 +36,11 @@ class Design extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -49,16 +49,16 @@ public function __construct( public function indexAction() { - $this->_title(__('Store Design')); - $this->loadLayout(); + $this->_title->add(__('Store Design')); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Adminhtml::system_design_schedule'); - $this->renderLayout(); + $this->_view->renderLayout(); } public function gridAction() { - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } public function newAction() @@ -68,11 +68,11 @@ public function newAction() public function editAction() { - $this->_title(__('Store Design')); + $this->_title->add(__('Store Design')); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Adminhtml::system_design_schedule'); - $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); + $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true); $id = (int)$this->getRequest()->getParam('id'); $design = $this->_objectManager->create('Magento\Core\Model\Design'); @@ -81,14 +81,14 @@ public function editAction() $design->load($id); } - $this->_title($design->getId() ? __('Edit Store Design Change') : __('New Store Design Change')); + $this->_title->add($design->getId() ? __('Edit Store Design Change') : __('New Store Design Change')); $this->_coreRegistry->register('design', $design); - $this->_addContent($this->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit')); - $this->_addLeft($this->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit\Tabs', 'design_tabs')); + $this->_addContent($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit')); + $this->_addLeft($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit\Tabs', 'design_tabs')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function saveAction() diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php index 36fabb88e2e5c..d6ae70931e1f5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Controller\Adminhtml\System; -class Store extends \Magento\Backend\Controller\Adminhtml\Action +class Store extends \Magento\Backend\App\Action { /** * Core registry @@ -48,12 +48,12 @@ class Store extends \Magento\Backend\Controller\Adminhtml\Action protected $filterManager; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Filter\FilterManager $filterManager */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry, \Magento\Filter\FilterManager $filterManager ) { @@ -70,8 +70,8 @@ public function __construct( protected function _initAction() { // load layout, set active menu and breadcrumbs - $this->loadLayout() - ->_setActiveMenu('Magento_Adminhtml::system_store') + $this->_view->loadLayout(); + $this->_setActiveMenu('Magento_Adminhtml::system_store') ->_addBreadcrumb(__('System'), __('System')) ->_addBreadcrumb(__('Manage Stores'), __('Manage Stores')); return $this; @@ -79,9 +79,9 @@ protected function _initAction() public function indexAction() { - $this->_title(__('Stores')); - $this->_initAction() - ->renderLayout(); + $this->_title->add(__('Stores')); + $this->_initAction(); + $this->_view->renderLayout(); } public function newWebsiteAction() @@ -119,7 +119,7 @@ public function editGroupAction() public function editStoreAction() { - $this->_title(__('Stores')); + $this->_title->add(__('Stores')); $session = $this->_getSession(); if ($session->getPostData()) { @@ -165,9 +165,9 @@ public function editStoreAction() $this->_coreRegistry->register('store_data', $model); if ($this->_coreRegistry->registry('store_action') == 'add') { - $this->_title(__('New ') . $title); + $this->_title->add(__('New ') . $title); } else { - $this->_title($model->getName()); + $this->_title->add($model->getName()); } if ($this->_coreRegistry->registry('store_action') == 'edit' && $codeBase && !$model->isReadOnly()) { @@ -175,8 +175,8 @@ public function editStoreAction() } $this->_initAction() - ->_addContent($this->getLayout()->createBlock('Magento\Backend\Block\System\Store\Edit')) - ->renderLayout(); + ->_addContent($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Store\Edit')); + $this->_view->renderLayout(); } else { $session->addError($notExists); $this->_redirect('adminhtml/*/'); @@ -263,7 +263,7 @@ public function saveAction() $session->addException($e, __('An error occurred while saving. Please review the error log.')); $session->setPostData($postData); } - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); return; } $this->_redirect('adminhtml/*/'); @@ -271,7 +271,7 @@ public function saveAction() public function deleteWebsiteAction() { - $this->_title(__('Delete Web Site')); + $this->_title->add(__('Delete Web Site')); $session = $this->_getSession(); $itemId = $this->getRequest()->getParam('item_id', null); @@ -290,18 +290,18 @@ public function deleteWebsiteAction() $this->_initAction() ->_addBreadcrumb(__('Delete Web Site'), __('Delete Web Site')) - ->_addContent($this->getLayout()->createBlock('Magento\Backend\Block\System\Store\Delete') + ->_addContent($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Store\Delete') ->setFormActionUrl($this->getUrl('adminhtml/*/deleteWebsitePost')) ->setBackUrl($this->getUrl('adminhtml/*/editWebsite', array('website_id' => $itemId))) ->setStoreTypeTitle(__('Web Site')) ->setDataObject($model) - ) - ->renderLayout(); + ); + $this->_view->renderLayout(); } public function deleteGroupAction() { - $this->_title(__('Delete Store')); + $this->_title->add(__('Delete Store')); $session = $this->_getSession(); $itemId = $this->getRequest()->getParam('item_id', null); @@ -320,18 +320,18 @@ public function deleteGroupAction() $this->_initAction() ->_addBreadcrumb(__('Delete Store'), __('Delete Store')) - ->_addContent($this->getLayout()->createBlock('Magento\Backend\Block\System\Store\Delete') + ->_addContent($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Store\Delete') ->setFormActionUrl($this->getUrl('adminhtml/*/deleteGroupPost')) ->setBackUrl($this->getUrl('adminhtml/*/editGroup', array('group_id' => $itemId))) ->setStoreTypeTitle(__('Store')) ->setDataObject($model) - ) - ->renderLayout(); + ); + $this->_view->renderLayout(); } public function deleteStoreAction() { - $this->_title(__('Delete Store View')); + $this->_title->add(__('Delete Store View')); $session = $this->_getSession(); $itemId = $this->getRequest()->getParam('item_id', null); @@ -350,13 +350,13 @@ public function deleteStoreAction() $this->_initAction() ->_addBreadcrumb(__('Delete Store View'), __('Delete Store View')) - ->_addContent($this->getLayout()->createBlock('Magento\Backend\Block\System\Store\Delete') + ->_addContent($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Store\Delete') ->setFormActionUrl($this->getUrl('adminhtml/*/deleteStorePost')) ->setBackUrl($this->getUrl('adminhtml/*/editStore', array('store_id' => $itemId))) ->setStoreTypeTitle(__('Store View')) ->setDataObject($model) - ) - ->renderLayout(); + ); + $this->_view->renderLayout(); } public function deleteWebsitePostAction() diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php index 1ddee1bd032b1..47cba7c717e5b 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Controller\Adminhtml\System; -class Variable extends \Magento\Backend\Controller\Adminhtml\Action +class Variable extends \Magento\Backend\App\Action { /** * Core registry @@ -43,11 +43,11 @@ class Variable extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -61,8 +61,8 @@ public function __construct( */ protected function _initLayout() { - $this->loadLayout() - ->_setActiveMenu('Magento_Adminhtml::system_variable') + $this->_view->loadLayout(); + $this->_setActiveMenu('Magento_Adminhtml::system_variable') ->_addBreadcrumb(__('Custom Variables'), __('Custom Variables')); return $this; } @@ -74,11 +74,11 @@ protected function _initLayout() */ protected function _initVariable() { - $this->_title(__('Custom Variables')); + $this->_title->add(__('Custom Variables')); $variableId = $this->getRequest()->getParam('variable_id', null); $storeId = (int)$this->getRequest()->getParam('store', 0); - /* @var $emailVariable \Magento\Core\Model\Variable */ + /* @var $variable \Magento\Core\Model\Variable */ $variable = $this->_objectManager->create('Magento\Core\Model\Variable'); if ($variableId) { $variable->setStoreId($storeId) @@ -93,10 +93,10 @@ protected function _initVariable() */ public function indexAction() { - $this->_title(__('Custom Variables')); + $this->_title->add(__('Custom Variables')); $this->_initLayout(); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -114,14 +114,16 @@ public function editAction() { $variable = $this->_initVariable(); - $this->_title($variable->getId() ? $variable->getCode() : __('New Custom Variable')); + $this->_title->add($variable->getId() ? $variable->getCode() : __('New Custom Variable')); $this->_initLayout() - ->_addContent($this->getLayout()->createBlock('Magento\Backend\Block\System\Variable\Edit')) - ->_addJs($this->getLayout()->createBlock('Magento\Core\Block\Template', '', array( + ->_addContent( + $this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Variable\Edit') + ) + ->_addJs($this->_view->getLayout()->createBlock('Magento\View\Block\Template', '', array( 'data' => array('template' => 'Magento_Backend::system/variable/js.phtml') - ))) - ->renderLayout(); + ))); + $this->_view->renderLayout(); } /** @@ -135,9 +137,9 @@ public function validateAction() $result = $variable->validate(); if ($result !== true && is_string($result)) { $this->_getSession()->addError($result); - $this->_initLayoutMessages('Magento\Adminhtml\Model\Session'); + $this->_view->getLayout()->initMessages('Magento\Adminhtml\Model\Session'); $response->setError(true); - $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml()); + $response->setMessage($this->_view->getLayout()->getMessagesBlock()->getGroupedHtml()); } $this->getResponse()->setBody($response->toJson()); } @@ -202,7 +204,7 @@ public function deleteAction() public function wysiwygPluginAction() { $customVariables = $this->_objectManager->create('Magento\Core\Model\Variable')->getVariablesOptionArray(true); - $storeContactVariabls = $this->_objectManager->create('Magento\Core\Model\Source\Email\Variables')->toOptionArray(true); + $storeContactVariabls = $this->_objectManager->create('Magento\Email\Model\Source\Variables')->toOptionArray(true); $variables = array($storeContactVariabls, $customVariables); $this->getResponse()->setBody(\Zend_Json::encode($variables)); } diff --git a/app/code/Magento/Backend/Helper/Dashboard/Data.php b/app/code/Magento/Backend/Helper/Dashboard/Data.php index b8f0a758abe31..c565f996d5056 100644 --- a/app/code/Magento/Backend/Helper/Dashboard/Data.php +++ b/app/code/Magento/Backend/Helper/Dashboard/Data.php @@ -41,18 +41,18 @@ class Data extends \Magento\Core\Helper\Data protected $_installDate; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Locale $locale * @param \Magento\App\State $appState * @param $installDate * @param bool $dbCompatibleMode */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Locale $locale, \Magento\App\State $appState, $installDate, diff --git a/app/code/Magento/Backend/Helper/Dashboard/Order.php b/app/code/Magento/Backend/Helper/Dashboard/Order.php index d232dac346e3d..3e1ce6b0af78e 100644 --- a/app/code/Magento/Backend/Helper/Dashboard/Order.php +++ b/app/code/Magento/Backend/Helper/Dashboard/Order.php @@ -36,18 +36,18 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard protected $_orderCollection; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Locale $locale * @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\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Locale $locale, \Magento\App\State $appState, \Magento\Reports\Model\Resource\Order\Collection $orderCollection, diff --git a/app/code/Magento/Backend/Helper/Data.php b/app/code/Magento/Backend/Helper/Data.php index 5f0eaed22c828..4a0e86758ba10 100644 --- a/app/code/Magento/Backend/Helper/Data.php +++ b/app/code/Magento/Backend/Helper/Data.php @@ -29,7 +29,7 @@ /** * @SuppressWarnings(PHPMD.LongVariable) */ -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { const XML_PATH_USE_CUSTOM_ADMIN_URL = 'admin/url/use_custom'; @@ -66,7 +66,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $mathRandom; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\App\Route\Config $routeConfig * @param \Magento\Core\Model\AppInterface $app * @param \Magento\Backend\Model\Url $backendUrl @@ -75,7 +75,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper * @param \Magento\Math\Random $mathRandom */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\App\Route\Config $routeConfig, \Magento\Core\Model\AppInterface $app, \Magento\Backend\Model\Url $backendUrl, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php index 15a79417093dc..9f1e1caf5a4f1 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php @@ -54,7 +54,7 @@ class Custom extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Config\Storage\WriterInterface $configWriter * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -64,7 +64,7 @@ class Custom extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Config\Storage\WriterInterface $configWriter, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php index 1da5b648850d4..43ab9de786556 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php @@ -44,7 +44,7 @@ class Robots extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Filesystem $filesystem * @param \Magento\App\Dir $dir @@ -55,7 +55,7 @@ class Robots extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Filesystem $filesystem, \Magento\App\Dir $dir, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php index 5291d8ef5f1be..0211d4338bf4e 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php @@ -42,7 +42,7 @@ class Usecustom extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Config\Storage\WriterInterface $configWriter * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -52,7 +52,7 @@ class Usecustom extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Config\Storage\WriterInterface $configWriter, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php index c081f8ef31122..5dcea3010bb5b 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php @@ -39,7 +39,7 @@ class Usesecretkey extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Backend\Model\Url $backendUrl * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -49,7 +49,7 @@ class Usesecretkey extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Backend\Model\Url $backendUrl, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php index 93d8f6ab42923..b8e152f162774 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php @@ -33,7 +33,7 @@ class Baseurl extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Page\Asset\MergeService $mergeService * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -43,7 +43,7 @@ class Baseurl extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Page\Asset\MergeService $mergeService, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php index f446a33e46d16..2e009ec3444f5 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php @@ -50,7 +50,7 @@ abstract class AbstractCurrency extends \Magento\Core\Model\Config\Value * * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -60,7 +60,7 @@ abstract class AbstractCurrency extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php index a60491743f643..7b0b566cad365 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php @@ -40,7 +40,7 @@ class Allow extends \Magento\Backend\Model\Config\Backend\Currency\AbstractCurre /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\LocaleInterface $locale @@ -51,7 +51,7 @@ class Allow extends \Magento\Backend\Model\Config\Backend\Currency\AbstractCurre public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php index 3ed511db85841..d1f9a0da4b7e0 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php @@ -41,7 +41,7 @@ class Cron extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -51,7 +51,7 @@ class Cron extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php b/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php index d2a2f9ad9f872..4d356830cc537 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php @@ -39,7 +39,7 @@ class Encrypted /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -49,7 +49,7 @@ class Encrypted public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/File.php b/app/code/Magento/Backend/Model/Config/Backend/File.php index 0c09afff08b7e..ad53e13aa4c20 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/File.php +++ b/app/code/Magento/Backend/Model/Config/Backend/File.php @@ -64,7 +64,7 @@ class File extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface $requestData * @param \Magento\Filesystem $filesystem @@ -79,7 +79,7 @@ public function __construct( \Magento\Core\Model\File\UploaderFactory $uploaderFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface $requestData, \Magento\Filesystem $filesystem, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Locale.php b/app/code/Magento/Backend/Model/Config/Backend/Locale.php index c9a73d48c8c80..22298756e3cd4 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Locale.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Locale.php @@ -54,7 +54,7 @@ class Locale extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\Config\Data\CollectionFactory $configsFactory * @param \Magento\Core\Model\LocaleInterface $locale @@ -69,7 +69,7 @@ class Locale extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\Config\Data\CollectionFactory $configsFactory, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php b/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php index 17d86acf5047a..76cdcf29c6cf2 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php @@ -47,7 +47,7 @@ class Cron extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -58,7 +58,7 @@ class Cron extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php index a743893c6fc82..ec624916431bb 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php @@ -40,7 +40,7 @@ class Database extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -50,7 +50,7 @@ public function __construct( \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Translate.php b/app/code/Magento/Backend/Model/Config/Backend/Translate.php index 7baf77350a4a7..7a1a877b2fed5 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Translate.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Translate.php @@ -55,7 +55,7 @@ class Translate extends \Magento\Core\Model\Config\Value * * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\Cache\TypeListInterface $cacheTypeList @@ -66,7 +66,7 @@ class Translate extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\Cache\TypeListInterface $cacheTypeList, diff --git a/app/code/Magento/Backend/Model/Config/Source/Email/Template.php b/app/code/Magento/Backend/Model/Config/Source/Email/Template.php index 876d2e8013c02..2fbe58567cbb4 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Email/Template.php +++ b/app/code/Magento/Backend/Model/Config/Source/Email/Template.php @@ -32,25 +32,25 @@ class Template extends \Magento\Object private $_coreRegistry; /** - * @var \Magento\Core\Model\Email\Template\Config + * @var \Magento\Email\Model\Template\Config */ private $_emailConfig; /** - * @var \Magento\Core\Model\Resource\Email\Template\CollectionFactory + * @var \Magento\Email\Model\Resource\Template\CollectionFactory */ protected $_templatesFactory; /** * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Core\Model\Resource\Email\Template\CollectionFactory $templatesFactory - * @param \Magento\Core\Model\Email\Template\Config $emailConfig + * @param \Magento\Email\Model\Resource\Template\CollectionFactory $templatesFactory + * @param \Magento\Email\Model\Template\Config $emailConfig * @param array $data */ public function __construct( \Magento\Core\Model\Registry $coreRegistry, - \Magento\Core\Model\Resource\Email\Template\CollectionFactory $templatesFactory, - \Magento\Core\Model\Email\Template\Config $emailConfig, + \Magento\Email\Model\Resource\Template\CollectionFactory $templatesFactory, + \Magento\Email\Model\Template\Config $emailConfig, array $data = array() ) { parent::__construct($data); @@ -66,7 +66,7 @@ public function __construct( */ public function toOptionArray() { - /** @var $collection \Magento\Core\Model\Resource\Email\Template\Collection */ + /** @var $collection \Magento\Email\Model\Resource\Template\Collection */ if (!$collection = $this->_coreRegistry->registry('config_system_email_template')) { $collection = $this->_templatesFactory->create(); $collection->load(); diff --git a/app/code/Magento/Backend/Model/Locale.php b/app/code/Magento/Backend/Model/Locale.php index daf6c5259ebe9..f79c42fb435fe 100644 --- a/app/code/Magento/Backend/Model/Locale.php +++ b/app/code/Magento/Backend/Model/Locale.php @@ -62,7 +62,7 @@ class Locale extends \Magento\Core\Model\Locale * @param \Magento\Core\Helper\Translate $translate * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\State $appState - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Locale\Config $config * @param \Magento\Core\Model\App $app * @param \Magento\Stdlib\DateTime $dateTime @@ -80,7 +80,7 @@ public function __construct( \Magento\Core\Helper\Translate $translate, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\State $appState, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Locale\Config $config, \Magento\Core\Model\App $app, \Magento\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Backend/Model/Menu/Item.php b/app/code/Magento/Backend/Model/Menu/Item.php index bade2870d2ea1..7b3e40b63929b 100644 --- a/app/code/Magento/Backend/Model/Menu/Item.php +++ b/app/code/Magento/Backend/Model/Menu/Item.php @@ -50,7 +50,7 @@ class Item /** * Module of menu item * - * @var \Magento\Core\Helper\AbstractHelper + * @var \Magento\App\Helper\AbstractHelper */ protected $_moduleHelper; @@ -171,7 +171,7 @@ class Item * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\Backend\Model\MenuFactory $menuFactory * @param \Magento\Backend\Model\Url $urlModel - * @param \Magento\Core\Helper\AbstractHelper $helper + * @param \Magento\App\Helper\AbstractHelper $helper * @param \Magento\Module\ModuleListInterface $moduleList * @param array $data */ @@ -181,7 +181,7 @@ public function __construct( \Magento\Core\Model\Store\Config $storeConfig, \Magento\Backend\Model\MenuFactory $menuFactory, \Magento\Backend\Model\Url $urlModel, - \Magento\Core\Helper\AbstractHelper $helper, + \Magento\App\Helper\AbstractHelper $helper, \Magento\Module\ModuleListInterface $moduleList, array $data = array() ) { @@ -371,11 +371,11 @@ public function setTooltip($tooltip) /** * Set Item module * - * @param \Magento\Core\Helper\AbstractHelper $helper + * @param \Magento\App\Helper\AbstractHelper $helper * @return \Magento\Backend\Model\Menu\Item * @throws \InvalidArgumentException */ - public function setModuleHelper(\Magento\Core\Helper\AbstractHelper $helper) + public function setModuleHelper(\Magento\App\Helper\AbstractHelper $helper) { $this->_validator->validateParam('module', $helper); $this->_moduleHelper = $helper; diff --git a/app/code/Magento/Backend/Model/Menu/Item/Factory.php b/app/code/Magento/Backend/Model/Menu/Item/Factory.php index 96644749e16f2..e9200060fb984 100644 --- a/app/code/Magento/Backend/Model/Menu/Item/Factory.php +++ b/app/code/Magento/Backend/Model/Menu/Item/Factory.php @@ -33,17 +33,17 @@ class Factory protected $_objectManager; /** - * @var \Magento\Core\Model\Factory\Helper + * @var \Magento\App\Helper\HelperFactory */ protected $_helperFactory; /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Factory\Helper $helperFactory + * @param \Magento\App\Helper\HelperFactory $helperFactory */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Factory\Helper $helperFactory + \Magento\App\Helper\HelperFactory $helperFactory ) { $this->_objectManager = $objectManager; $this->_helperFactory = $helperFactory; diff --git a/app/code/Magento/Backend/Model/Observer.php b/app/code/Magento/Backend/Model/Observer.php index 6f8e542816098..9540ef8df74ea 100644 --- a/app/code/Magento/Backend/Model/Observer.php +++ b/app/code/Magento/Backend/Model/Observer.php @@ -79,22 +79,6 @@ public function bindLocale($observer) return $this; } - /** - * Prepare mass action separated data - * - * @return \Magento\Backend\Model\Observer - */ - public function massactionPrepareKey() - { - $key = $this->_request->getPost('massaction_prepare_key'); - if ($key) { - $postData = $this->_request->getPost($key); - $value = is_array($postData) ? $postData : explode(',', $postData); - $this->_request->setPost($key, $value ? $value : null); - } - return $this; - } - /** * Clear result of configuration files access level verification in system cache * diff --git a/app/code/Magento/Backend/Model/Url.php b/app/code/Magento/Backend/Model/Url.php index f55622f52b074..240914ab0d22a 100644 --- a/app/code/Magento/Backend/Model/Url.php +++ b/app/code/Magento/Backend/Model/Url.php @@ -94,13 +94,13 @@ class Url extends \Magento\Core\Model\Url /** * @param \Magento\App\Route\ConfigInterface $routeConfig * @param \Magento\App\RequestInterface $request - * @param \Magento\Core\Model\Url\SecurityInfoInterface $securityInfo + * @param \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Core\Model\Session $session * @param Menu\Config $menuConfig * @param \Magento\Core\Model\App $app - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\CacheInterface $cache * @param Auth\Session $authSession * @param \Magento\Encryption\EncryptorInterface $encryptor @@ -110,13 +110,13 @@ class Url extends \Magento\Core\Model\Url public function __construct( \Magento\App\Route\ConfigInterface $routeConfig, \Magento\App\RequestInterface $request, - \Magento\Core\Model\Url\SecurityInfoInterface $securityInfo, + \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Backend\Helper\Data $backendHelper, \Magento\Core\Model\Session $session, \Magento\Backend\Model\Menu\Config $menuConfig, \Magento\Core\Model\App $app, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\CacheInterface $cache, \Magento\Backend\Model\Auth\Session $authSession, \Magento\Encryption\EncryptorInterface $encryptor, @@ -125,7 +125,7 @@ public function __construct( ) { $this->_encryptor = $encryptor; parent::__construct( - $routeConfig, $request, $securityInfo, $coreStoreConfig, + $routeConfig, $request, $urlSecurityInfo, $coreStoreConfig, $app, $storeManager, $session, $areaCode, $data ); $this->_startupMenuItemId = $coreStoreConfig->getConfig(self::XML_PATH_STARTUP_MENU_ITEM); diff --git a/app/code/Magento/Backend/Model/View.php b/app/code/Magento/Backend/Model/View.php new file mode 100644 index 0000000000000..394ae973d1ea7 --- /dev/null +++ b/app/code/Magento/Backend/Model/View.php @@ -0,0 +1,74 @@ +_aclFilter = $aclFilter; + parent::__construct($layout, $request, $response, $configScope, $eventManager, $translator, $actionFlag); + } + + + /** + * {@inheritdoc} + */ + public function loadLayout($handles = null, $generateBlocks = true, $generateXml = true) + { + parent::loadLayout($handles, false, $generateXml); + $this->_aclFilter->filterAclNodes($this->getLayout()->getNode()); + if ($generateBlocks) { + $this->generateLayoutBlocks(); + $this->_isLayoutLoaded = true; + } + $this->getLayout()->initMessages('Magento\Backend\Model\Session'); + return $this; + } + +} \ No newline at end of file diff --git a/app/code/Magento/Backend/etc/adminhtml/di.xml b/app/code/Magento/Backend/etc/adminhtml/di.xml index ab4b298d5a8ae..57d29fca271a7 100644 --- a/app/code/Magento/Backend/etc/adminhtml/di.xml +++ b/app/code/Magento/Backend/etc/adminhtml/di.xml @@ -27,13 +27,20 @@ - + + + + + + + + @@ -124,4 +131,19 @@ + + + Magento\Backend\App\AbstractAction::SESSION_NAMESPACE + + + + + + + + + + false + +
diff --git a/app/code/Magento/Backend/etc/adminhtml/menu.xml b/app/code/Magento/Backend/etc/adminhtml/menu.xml index 126f3323af44d..b054038fd6c1d 100644 --- a/app/code/Magento/Backend/etc/adminhtml/menu.xml +++ b/app/code/Magento/Backend/etc/adminhtml/menu.xml @@ -29,7 +29,6 @@ - diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 927fd0ad1fd8d..25a442ebb201e 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -36,11 +36,6 @@ - - - - - admin diff --git a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml index 1c295f207b9d9..5a63d7d2737d5 100644 --- a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml +++ b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml @@ -38,9 +38,8 @@ - + - diff --git a/app/code/Magento/Backup/Helper/Data.php b/app/code/Magento/Backup/Helper/Data.php index 9a4b3614acbf3..88f8134bf35d3 100644 --- a/app/code/Magento/Backup/Helper/Data.php +++ b/app/code/Magento/Backup/Helper/Data.php @@ -27,7 +27,7 @@ */ namespace Magento\Backup\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { /** * Backup type constant for database backup @@ -64,11 +64,6 @@ class Data extends \Magento\Core\Helper\AbstractHelper */ protected $_authorization; - /** - * @var \Magento\Cache\ConfigInterface - */ - protected $_cacheConfig; - /** * @var \Magento\App\Cache\TypeListInterface */ @@ -91,19 +86,17 @@ class Data extends \Magento\Core\Helper\AbstractHelper /** * Construct * - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Filesystem $filesystem * @param \Magento\AuthorizationInterface $authorization - * @param \Magento\Cache\ConfigInterface $cacheConfig * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\App\Dir $dir * @param \Magento\Index\Model\Resource\Process\CollectionFactory $processFactory */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Filesystem $filesystem, \Magento\AuthorizationInterface $authorization, - \Magento\Cache\ConfigInterface $cacheConfig, \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\App\Dir $dir, \Magento\Index\Model\Resource\Process\CollectionFactory $processFactory @@ -111,7 +104,6 @@ public function __construct( parent::__construct($context); $this->_authorization = $authorization; $this->_filesystem = $filesystem; - $this->_cacheConfig = $cacheConfig; $this->_cacheTypeList = $cacheTypeList; $this->_dir = $dir; } diff --git a/app/code/Magento/Backup/Model/Config/Backend/Cron.php b/app/code/Magento/Backup/Model/Config/Backend/Cron.php index 783b49ebb6e97..486d39ab74ba0 100644 --- a/app/code/Magento/Backup/Model/Config/Backend/Cron.php +++ b/app/code/Magento/Backup/Model/Config/Backend/Cron.php @@ -51,7 +51,7 @@ class Cron extends \Magento\Core\Model\Config\Value /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -62,7 +62,7 @@ class Cron extends \Magento\Core\Model\Config\Value public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Config\ValueFactory $configValueFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index 13f44331cf24d..bb9c72242752e 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -46,20 +46,20 @@ class Extend */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index ca30197c6356c..fd4b662c7ca37 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -47,20 +47,20 @@ class Bundle extends \Magento\Adminhtml\Block\Widget */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getTabUrl() diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 93546494311d9..d0637627f1826 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -74,11 +74,6 @@ class Option extends \Magento\Backend\Block\Widget */ protected $_coreRegistry = null; - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Bundle\Model\Source\Option\Type */ @@ -90,28 +85,25 @@ class Option extends \Magento\Backend\Block\Widget protected $_yesno; /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Model\Config\Source\Yesno $yesno * @param \Magento\Bundle\Model\Source\Option\Type $optionTypes - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @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\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Backend\Model\Config\Source\Yesno $yesno, \Magento\Bundle\Model\Source\Option\Type $optionTypes, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - $this->_storeManager = $storeManager; $this->_optionTypes = $optionTypes; $this->_yesno = $yesno; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php index 2abcf375ae4f1..b7cf851e8b8ba 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php @@ -48,27 +48,25 @@ class Grid */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Bundle\Helper\Data $bundleData - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Bundle\Helper\Data $bundleData + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Bundle\Helper\Data $bundleData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Bundle\Helper\Data $bundleData, + array $data = array() + ) { $this->_bundleData = $bundleData; $this->_productFactory = $productFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php index 65e6b9ce0ad01..e546a89210085 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php @@ -62,29 +62,29 @@ class Selection */ protected $_yesno; - /** - * @param \Magento\Backend\Model\Config\Source\Yesno $yesno - * @param \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Config\Source\Yesno $yesno + * @param \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Model\Config\Source\Yesno $yesno, - \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Config\Source\Yesno $yesno, + \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_catalogData = $catalogData; $this->_coreRegistry = $registry; $this->_priceType = $priceType; $this->_yesno = $yesno; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php b/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php index df74c4341ae84..9d6ff7d2c3a8d 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php @@ -31,33 +31,6 @@ */ class Renderer extends \Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer { - /** - * Filter manager - * - * @var \Magento\Filter\FilterManager - */ - protected $filter; - - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Filter\FilterManager $filter - * @param array $data - */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Filter\FilterManager $filter, - array $data = array() - ) { - $this->filter = $filter; - parent::__construct($productFactory, $coreData, $context, $registry, $data); - } - /** * Truncate string * @@ -70,7 +43,7 @@ public function __construct( */ public function truncateString($value, $length = 80, $etc = '...', &$remainder = '', $breakWords = true) { - return $this->filter->truncate($value, array( + return $this->filterManager->truncate($value, array( 'length' => $length, 'etc' => $etc, 'remainder' => $remainder, diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php b/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php index 8a232551c3d5e..bf4b2d54b9965 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php @@ -31,33 +31,6 @@ */ class Renderer extends \Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer { - /** - * Core string - * - * @var \Magento\Filter\FilterManager - */ - protected $filter; - - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Filter\FilterManager $filter - * @param array $data - */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Filter\FilterManager $filter, - array $data = array() - ) { - $this->filter = $filter; - parent::__construct($productFactory, $coreData, $context, $registry, $data); - } - /** * Truncate string * @@ -70,7 +43,7 @@ public function __construct( */ public function truncateString($value, $length = 80, $etc = '...', &$remainder = '', $breakWords = true) { - return $this->filter->truncate($value, array( + return $this->filterManager->truncate($value, array( 'length' => $length, 'etc' => $etc, 'remainder' => $remainder, diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php index e1a517d51e451..1ab8e943a7b94 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php @@ -41,11 +41,10 @@ class Price extends \Magento\Catalog\Block\Product\Price protected $_taxCalc; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Stdlib\String $string * @param \Magento\Math\Random $mathRandom @@ -53,28 +52,17 @@ class Price extends \Magento\Catalog\Block\Product\Price * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Stdlib\String $string, \Magento\Math\Random $mathRandom, \Magento\Tax\Model\Calculation $taxCalc, array $data = array() ) { - parent::__construct( - $storeManager, - $catalogData, - $taxData, - $coreData, - $context, - $registry, - $string, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogData, $taxData, $registry, $string, $mathRandom, $data); $this->_taxCalc = $taxCalc; } 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 15fbec6ea4d11..59eb3b1182082 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 @@ -58,55 +58,40 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView protected $_productPrice; /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \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 * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Stdlib\ArrayUtils $arrayUtils, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Model\LocaleInterface $locale, \Magento\Bundle\Model\Product\PriceFactory $productPrice, array $data = array() ) { $this->_catalogProduct = $catalogProduct; $this->_productPrice = $productPrice; - $this->_locale = $locale; parent::__construct( - $storeManager, + $context, + $coreData, $catalogConfig, - $coreRegistry, + $registry, $taxData, $catalogData, - $coreData, - $context, $mathRandom, $arrayUtils, $data diff --git a/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php b/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php index 121adb787aa73..07f609cfde27a 100644 --- a/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php @@ -45,23 +45,23 @@ class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer protected $_bundleProdConfigur = null; /** - * @param \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Product\Configuration $productConfig * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Bundle\Helper\Catalog\Product\Configuration $bundleProdConfigur * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Product\Configuration $productConfig, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Bundle\Helper\Catalog\Product\Configuration $bundleProdConfigur, array $data = array() ) { $this->_bundleProdConfigur = $bundleProdConfigur; - parent::__construct($ctlgProdConfigur, $coreData, $context, $checkoutSession, $data); + parent::__construct($context, $coreData, $productConfig, $checkoutSession, $data); } protected function _construct() diff --git a/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit.php b/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit.php index 7ac58a5e53dba..c4e233917c3b9 100644 --- a/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit.php +++ b/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Product/Edit.php @@ -39,7 +39,7 @@ public function formAction() { $product = $this->_initProduct(); $this->getResponse()->setBody( - $this->getLayout() + $this->_view->getLayout() ->createBlock('Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle', 'admin.product.bundle.items') ->setProductId($product->getId()) diff --git a/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Selection.php b/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Selection.php index 5821cd8790c93..3d32189f63fc6 100644 --- a/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Selection.php +++ b/app/code/Magento/Bundle/Controller/Adminhtml/Bundle/Selection.php @@ -33,12 +33,12 @@ */ namespace Magento\Bundle\Controller\Adminhtml\Bundle; -class Selection extends \Magento\Backend\Controller\Adminhtml\Action +class Selection extends \Magento\Backend\App\Action { public function searchAction() { return $this->getResponse()->setBody( - $this->getLayout() + $this->_view->getLayout() ->createBlock('Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Search') ->setIndex($this->getRequest()->getParam('index')) ->setFirstShow(true) @@ -49,7 +49,7 @@ public function searchAction() public function gridAction() { return $this->getResponse()->setBody( - $this->getLayout() + $this->_view->getLayout() ->createBlock('Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Search\Grid', 'adminhtml.catalog.product.edit.tab.bundle.option.search.grid') ->setIndex($this->getRequest()->getParam('index')) diff --git a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php index 8cdd59bb70929..5e15017a59776 100644 --- a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php +++ b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php @@ -33,7 +33,7 @@ */ namespace Magento\Bundle\Helper\Catalog\Product; -class Configuration extends \Magento\Core\Helper\AbstractHelper +class Configuration extends \Magento\App\Helper\AbstractHelper implements \Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface { /** @@ -58,13 +58,13 @@ class Configuration extends \Magento\Core\Helper\AbstractHelper /** * @param \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Escaper $escaper */ public function __construct( \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Escaper $escaper ) { $this->_ctlgProdConfigur = $ctlgProdConfigur; diff --git a/app/code/Magento/Bundle/Helper/Data.php b/app/code/Magento/Bundle/Helper/Data.php index 75494e422e341..9a05a8c0e3759 100644 --- a/app/code/Magento/Bundle/Helper/Data.php +++ b/app/code/Magento/Bundle/Helper/Data.php @@ -33,7 +33,7 @@ */ namespace Magento\Bundle\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { /** * @var \Magento\Catalog\Model\ProductTypes\ConfigInterface @@ -41,11 +41,11 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_config; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Catalog\Model\ProductTypes\ConfigInterface $config ) { $this->_config = $config; diff --git a/app/code/Magento/Bundle/Model/Option.php b/app/code/Magento/Bundle/Model/Option.php index f3779afbd4387..f54b1b858b408 100644 --- a/app/code/Magento/Bundle/Model/Option.php +++ b/app/code/Magento/Bundle/Model/Option.php @@ -74,10 +74,8 @@ public function addSelection($selection) if (!$selection) { return false; } - if (!$selections = $this->getData('selections')) { - $selections = array(); - } - array_push($selections, $selection); + $selections = $this->getDataSetDefault('selections', array()); + $selections[] = $selection; $this->setSelections($selections); return $this; } diff --git a/app/code/Magento/Bundle/Model/Price/Index.php b/app/code/Magento/Bundle/Model/Price/Index.php index dc2d778e9a8b2..1cd7e914e5c2a 100644 --- a/app/code/Magento/Bundle/Model/Price/Index.php +++ b/app/code/Magento/Bundle/Model/Price/Index.php @@ -53,12 +53,12 @@ class Index extends \Magento\Core\Model\AbstractModel protected $_customerSession; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; /** - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry @@ -67,7 +67,7 @@ class Index extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index 8cb10c5d352c2..f5a80005dd3ff 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -848,10 +848,10 @@ public function getSelectionsByIds($selectionIds, $product) ->addFilterByRequiredOptions() ->setSelectionIdsFilter($selectionIds); - if (!$this->_catalogData->isPriceGlobal() && $storeId) { + if (!$this->_catalogData->isPriceGlobal() && $storeId) { $websiteId = $this->_storeManager->getStore($storeId)->getWebsiteId(); $usedSelections->joinPrices($websiteId); - } + } $product->setData($this->_keyUsedSelections, $usedSelections); $product->setData($this->_keyUsedSelectionsIds, $selectionIds); } diff --git a/app/code/Magento/Captcha/Block/Captcha.php b/app/code/Magento/Captcha/Block/Captcha.php index 3b6128c8818fc..7b5596960bf6f 100644 --- a/app/code/Magento/Captcha/Block/Captcha.php +++ b/app/code/Magento/Captcha/Block/Captcha.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Block; -class Captcha extends \Magento\Core\Block\Template +class Captcha extends \Magento\View\Block\Template { /** * Captcha data @@ -43,19 +43,19 @@ class Captcha extends \Magento\Core\Block\Template protected $_captchaData = null; /** - * @param \Magento\Captcha\Helper\Data $captchaData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Captcha\Helper\Data $captchaData * @param array $data */ public function __construct( - \Magento\Captcha\Helper\Data $captchaData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Captcha\Helper\Data $captchaData, array $data = array() ) { $this->_captchaData = $captchaData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php b/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php index 280f1e8398d16..d351063c5d938 100644 --- a/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php +++ b/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Block\Captcha; -class DefaultCaptcha extends \Magento\Core\Block\Template +class DefaultCaptcha extends \Magento\View\Block\Template { protected $_template = 'default.phtml'; @@ -48,27 +48,19 @@ class DefaultCaptcha extends \Magento\Core\Block\Template protected $_captchaData; /** - * @var \Magento\Core\Model\StoreManager - */ - protected $_storeManager; - - /** - * @param \Magento\Captcha\Helper\Data $captchaData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Captcha\Helper\Data $captchaData * @param array $data */ public function __construct( - \Magento\Captcha\Helper\Data $captchaData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Captcha\Helper\Data $captchaData, array $data = array() ) { - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); $this->_captchaData = $captchaData; - $this->_storeManager = $storeManager; } /** diff --git a/app/code/Magento/Captcha/Controller/Adminhtml/Refresh.php b/app/code/Magento/Captcha/Controller/Adminhtml/Refresh.php index 62e7149993fa5..cb474b8933fec 100644 --- a/app/code/Magento/Captcha/Controller/Adminhtml/Refresh.php +++ b/app/code/Magento/Captcha/Controller/Adminhtml/Refresh.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Controller\Adminhtml; -class Refresh extends \Magento\Backend\Controller\Adminhtml\Action +class Refresh extends \Magento\Backend\App\Action { /** * Refreshes captcha and returns JSON encoded URL to image (AJAX action) @@ -45,8 +45,12 @@ public function refreshAction() { $formId = $this->getRequest()->getPost('formId'); $captchaModel = $this->_objectManager->get('Magento\Captcha\Helper\Data')->getCaptcha($formId); - $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml(); + $this->_view->getLayout() + ->createBlock($captchaModel->getBlockName()) + ->setFormId($formId) + ->setIsAjax(true) + ->toHtml(); $this->getResponse()->setBody(json_encode(array('imgSrc' => $captchaModel->getImgSrc()))); - $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + $this->_actionFlag->set('', self::FLAG_NO_POST_DISPATCH, true); } } diff --git a/app/code/Magento/Captcha/Controller/Refresh.php b/app/code/Magento/Captcha/Controller/Refresh.php index 85853acf47056..ee85eb4fca22a 100644 --- a/app/code/Magento/Captcha/Controller/Refresh.php +++ b/app/code/Magento/Captcha/Controller/Refresh.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Controller; -class Refresh extends \Magento\Core\Controller\Front\Action +class Refresh extends \Magento\App\Action\Action { /** * Refreshes captcha and returns JSON encoded URL to image (AJAX action) @@ -45,8 +45,12 @@ public function indexAction() { $formId = $this->getRequest()->getPost('formId'); $captchaModel = $this->_objectManager->get('Magento\Captcha\Helper\Data')->getCaptcha($formId); - $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml(); + $this->_view->getLayout() + ->createBlock($captchaModel->getBlockName()) + ->setFormId($formId) + ->setIsAjax(true) + ->toHtml(); $this->getResponse()->setBody(json_encode(array('imgSrc' => $captchaModel->getImgSrc()))); - $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + $this->_actionFlag->set('', self::FLAG_NO_POST_DISPATCH, true); } } diff --git a/app/code/Magento/Captcha/Helper/Data.php b/app/code/Magento/Captcha/Helper/Data.php index e045e0d151ab5..5c0e6ddaa0075 100644 --- a/app/code/Magento/Captcha/Helper/Data.php +++ b/app/code/Magento/Captcha/Helper/Data.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { /** * Used for "name" attribute of captcha's input field @@ -82,7 +82,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_dirs = null; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -92,17 +92,17 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_factory; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\App\Dir $dirs - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Filesystem $filesystem * @param \Magento\Captcha\Model\CaptchaFactory $factory */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\App\Dir $dirs, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Filesystem $filesystem, \Magento\Captcha\Model\CaptchaFactory $factory diff --git a/app/code/Magento/Captcha/Model/Observer.php b/app/code/Magento/Captcha/Model/Observer.php index 225083f4a2602..28c0ece35a832 100644 --- a/app/code/Magento/Captcha/Model/Observer.php +++ b/app/code/Magento/Captcha/Model/Observer.php @@ -74,7 +74,7 @@ class Observer protected $_request; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -94,7 +94,12 @@ class Observer protected $_resLogFactory; /** - * @param \Magento\Captcha\Model\Resource\LogFactory $resLogFactory + * @var \Magento\App\ActionFlag + */ + protected $_actionFlag; + + /** + * @param Resource\LogFactory $resLogFactory * @param \Magento\Core\Model\Session\AbstractSession $session * @param \Magento\Checkout\Model\Type\Onepage $typeOnepage * @param \Magento\Core\Helper\Data $coreData @@ -103,7 +108,8 @@ class Observer * @param \Magento\Core\Model\Url $urlManager * @param \Magento\Filesystem $filesystem * @param \Magento\App\RequestInterface $request - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\App\ActionFlag $actionFlag */ public function __construct( \Magento\Captcha\Model\Resource\LogFactory $resLogFactory, @@ -115,7 +121,8 @@ public function __construct( \Magento\Core\Model\Url $urlManager, \Magento\Filesystem $filesystem, \Magento\App\RequestInterface $request, - \Magento\Core\Model\StoreManager $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\App\ActionFlag $actionFlag ) { $this->_resLogFactory = $resLogFactory; $this->_session = $session; @@ -127,6 +134,7 @@ public function __construct( $this->_filesystem = $filesystem; $this->_request = $request; $this->_storeManager = $storeManager; + $this->_actionFlag = $actionFlag; } /** @@ -140,10 +148,11 @@ public function checkForgotpassword($observer) $formId = 'user_forgotpassword'; $captchaModel = $this->_helper->getCaptcha($formId); if ($captchaModel->isRequired()) { + /** @var \Magento\App\Action\Action $controller */ $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->_session->addError(__('Incorrect CAPTCHA')); - $controller->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $controller->getResponse()->setRedirect($this->_urlManager->getUrl('*/*/forgotpassword')); } } @@ -163,7 +172,7 @@ public function checkContactUsForm($observer) $controller = $observer->getControllerAction(); if (!$captcha->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->_session->addError(__('Incorrect CAPTCHA.')); - $controller->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $controller->getResponse()->setRedirect($this->_urlManager->getUrl('contacts/index/index')); } } @@ -186,7 +195,7 @@ public function checkUserLogin($observer) $word = $this->_getCaptchaString($controller->getRequest(), $formId); if (!$captchaModel->isCorrect($word)) { $this->_session->addError(__('Incorrect CAPTCHA')); - $controller->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $this->_session->setUsername($login); $beforeUrl = $this->_session->getBeforeAuthUrl(); $url = $beforeUrl ? $beforeUrl : $this->_customerData->getLoginUrl(); @@ -211,7 +220,7 @@ public function checkUserCreate($observer) $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->_session->addError(__('Incorrect CAPTCHA')); - $controller->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $this->_session->setCustomerFormData($controller->getRequest()->getPost()); $controller->getResponse()->setRedirect($this->_urlManager->getUrl('*/*/create')); } @@ -234,7 +243,7 @@ public function checkGuestCheckout($observer) if ($captchaModel->isRequired()) { $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { - $controller->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $result = array('error' => 1, 'message' => __('Incorrect CAPTCHA')); $controller->getResponse()->setBody($this->_coreData->jsonEncode($result)); } @@ -258,7 +267,7 @@ public function checkRegisterCheckout($observer) if ($captchaModel->isRequired()) { $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { - $controller->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $result = array('error' => 1, 'message' => __('Incorrect CAPTCHA')); $controller->getResponse()->setBody($this->_coreData->jsonEncode($result)); } @@ -309,7 +318,7 @@ public function checkUserForgotPasswordBackend($observer) if ($captchaModel->isRequired()) { if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->_session->setEmail((string) $controller->getRequest()->getPost('email')); - $controller->setFlag('', \Magento\Core\Controller\Varien\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $this->_session->addError(__('Incorrect CAPTCHA')); $controller->getResponse() ->setRedirect($controller->getUrl('*/*/forgotpassword', array('_nosecret' => true))); diff --git a/app/code/Magento/Captcha/etc/events.xml b/app/code/Magento/Captcha/etc/events.xml index dc8c14352923f..1f10660d1a4ae 100644 --- a/app/code/Magento/Captcha/etc/events.xml +++ b/app/code/Magento/Captcha/etc/events.xml @@ -30,6 +30,9 @@ + + + diff --git a/app/code/Magento/Captcha/view/adminhtml/default.phtml b/app/code/Magento/Captcha/view/adminhtml/default.phtml index 74546ec24f767..fbed441fcf830 100644 --- a/app/code/Magento/Captcha/view/adminhtml/default.phtml +++ b/app/code/Magento/Captcha/view/adminhtml/default.phtml @@ -18,14 +18,13 @@ * 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) */ ?> + + getCaptchaModel() ?> -
diff --git a/app/code/Magento/Captcha/view/frontend/default.phtml b/app/code/Magento/Captcha/view/frontend/default.phtml index 86746491042cd..0972ed6b57f48 100644 --- a/app/code/Magento/Captcha/view/frontend/default.phtml +++ b/app/code/Magento/Captcha/view/frontend/default.phtml @@ -23,9 +23,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> + - - getCaptchaModel() ?>
diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php index 19d4b52f364c1..19db3f966ca28 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php @@ -47,23 +47,23 @@ class AbstractCategory extends \Magento\Backend\Block\Template */ protected $_categoryTree; - /** - * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_categoryTree = $categoryTree; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Image.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Image.php index cc5e2ffd7faa8..1164f299018f6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Image.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Image.php @@ -36,12 +36,12 @@ class Image extends \Magento\Data\Form\Element\Image { /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; /** - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection @@ -49,7 +49,7 @@ class Image extends \Magento\Data\Form\Element\Image * @param array $attributes */ public function __construct( - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php index 4b5167e61b5d4..6ff20d407aefb 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php @@ -41,24 +41,24 @@ class Attributes extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_wysiwygConfig; - /** - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php index 402212ca660cd..e073a3782af50 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php @@ -47,27 +47,25 @@ class Product extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @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 \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_productFactory = $productFactory; $this->_coreRegistry = $coreRegistry; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php index d3bf896255637..3c8f365f731d7 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php @@ -59,28 +59,28 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs */ protected $_collectionFactory; - /** - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Helper\Catalog $helperCatalog - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Helper\Catalog $helperCatalog + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, - \Magento\Catalog\Helper\Catalog $helperCatalog, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, + \Magento\Catalog\Helper\Catalog $helperCatalog, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_coreRegistry = $registry; $this->_helperCatalog = $helperCatalog; - parent::__construct($coreData, $context, $authSession, $data); + parent::__construct($context, $coreData, $authSession, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index 02a82ea70deee..8d50e246bb59b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -55,30 +55,30 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory */ protected $_helperPool; - /** - * @param \Magento\Core\Model\Resource\HelperPool $helperPool - * @param \Magento\Backend\Model\Auth\Session $backendSession - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\Resource\HelperPool $helperPool + * @param \Magento\Backend\Model\Auth\Session $backendSession + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Core\Model\Resource\HelperPool $helperPool, - \Magento\Backend\Model\Auth\Session $backendSession, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, + \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\Resource\HelperPool $helperPool, + \Magento\Backend\Model\Auth\Session $backendSession, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { $this->_helperPool = $helperPool; $this->_backendSession = $backendSession; $this->_categoryFactory = $categoryFactory; - parent::__construct($categoryTree, $coreData, $context, $registry, $data); + parent::__construct($context, $coreData, $categoryTree, $registry, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php index 2f1c035d73674..a1cf464d6d051 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php @@ -50,23 +50,23 @@ class Urlkey */ protected $_elementFactory; - /** - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Data\Form\Element\Factory $elementFactory, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Data\Form\Element\Factory $elementFactory, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_elementFactory = $elementFactory; $this->_catalogData = $catalogData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getElementHtml() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php index 1f7482f935bc0..c5b898f710ddb 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php @@ -41,24 +41,24 @@ class Content */ protected $_wysiwygConfig; - /** - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product.php b/app/code/Magento/Catalog/Block/Adminhtml/Product.php index 3fccf671cb533..f7aac690456ba 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product.php @@ -47,24 +47,24 @@ class Product extends \Magento\Adminhtml\Block\Widget\Container */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\Product\TypeFactory $typeFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Product\TypeFactory $typeFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product\TypeFactory $typeFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Product\TypeFactory $typeFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; $this->_typeFactory = $typeFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php index a4f227816cc7f..b4f277ec39962 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php @@ -46,20 +46,20 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index 2201dece316de..baa0d5a08c107 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -49,27 +49,27 @@ class Advanced */ protected $_yesNo; - /** - * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo - * @param \Magento\Eav\Helper\Data $eavData - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo + * @param \Magento\Eav\Helper\Data $eavData + * @param array $data */ - public function __construct( - \Magento\Backend\Model\Config\Source\Yesno $yesNo, - \Magento\Eav\Helper\Data $eavData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Backend\Model\Config\Source\Yesno $yesNo, + \Magento\Eav\Helper\Data $eavData, + array $data = array() + ) { $this->_yesNo = $yesNo; $this->_eavData = $eavData; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php index c9cf6f1571e7c..dc181e2577447 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php @@ -42,24 +42,24 @@ class Front */ protected $_yesNo; - /** - * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo + * @param array $data */ - public function __construct( - \Magento\Backend\Model\Config\Source\Yesno $yesNo, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Backend\Model\Config\Source\Yesno $yesNo, + array $data = array() + ) { $this->_yesNo = $yesNo; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php index 3ddc8d3326312..b53a3bf69a674 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php @@ -40,25 +40,23 @@ class Grid extends \Magento\Eav\Block\Adminhtml\Attribute\Grid\AbstractGrid */ protected $_collectionFactory; - /** - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_module = 'catalog'; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php index ef822d317db1d..cc3d422af242c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php @@ -55,26 +55,26 @@ class Created extends \Magento\Backend\Block\Widget */ protected $_setFactory; - /** - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory - * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory + * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, - \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, + \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_setFactory = $setFactory; $this->_attributeFactory = $attributeFactory; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php index 97c20a3d2b5f9..5b12d72460009 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php @@ -71,35 +71,35 @@ class Main extends \Magento\Backend\Block\Template */ protected $_attributeFactory; - /** - * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory - * @param \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory - * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory + * @param \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory + * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Helper\Product $catalogProduct + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Entity\TypeFactory $typeFactory, - \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory, - \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Eav\Model\Entity\TypeFactory $typeFactory, + \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory, + \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, + \Magento\Catalog\Helper\Product $catalogProduct, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_typeFactory = $typeFactory; $this->_groupFactory = $groupFactory; $this->_attributeFactory = $attributeFactory; $this->_collectionFactory = $collectionFactory; $this->_coreRegistry = $registry; $this->_catalogProduct = $catalogProduct; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php index e283eb0ff0984..59a0ab8609e81 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php @@ -40,24 +40,24 @@ class Formgroup */ protected $_typeFactory; - /** - * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Entity\TypeFactory $typeFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Model\Entity\TypeFactory $typeFactory, + array $data = array() + ) { $this->_typeFactory = $typeFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php index b7d1f94d04d74..0828ebbab7885 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php @@ -34,24 +34,24 @@ class Formset */ protected $_setFactory; - /** - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, + array $data = array() + ) { $this->_setFactory = $setFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php index 31f542e8be672..2cf4226a935b1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php @@ -40,24 +40,24 @@ class Filter */ protected $_setFactory; - /** - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, + array $data = array() + ) { $this->_setFactory = $setFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php index 667e8196b3554..2dc36feddfbdc 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php @@ -54,23 +54,23 @@ class Configure extends \Magento\Adminhtml\Block\Widget */ protected $_catalogProduct; - /** - * @param \Magento\Catalog\Model\Product $product - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Product $product + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product $product, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Product $product, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_catalogProduct = $product; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php index 7bab6937961b2..d005b8634784a 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite; -class Error extends \Magento\Core\Block\Template +class Error extends \Magento\View\Block\Template { /** * Core registry @@ -42,20 +42,20 @@ class Error extends \Magento\Core\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php index 55f915ebac8b1..bb81640b271cc 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite; -class Fieldset extends \Magento\Core\Block\Text\ListText +class Fieldset extends \Magento\View\Block\Text\ListText { /** * @@ -47,7 +47,7 @@ protected function _toHtml() $total = count($children); $i = 0; $this->setText(''); - /** @var $block \Magento\Core\Block\AbstractBlock */ + /** @var $block \Magento\View\Block\AbstractBlock */ foreach ($children as $block) { $i++; $block->setIsLastFieldset($i == $total); 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 57dd6fe48ba3c..ed712a68f64c1 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,26 +40,24 @@ class Grouped protected $_priceBlockDefaultTemplate = 'catalog/product/price.phtml'; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param \Magento\Tax\Model\Calculation $taxCalculation * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Stdlib\ArrayUtils $arrayUtils, \Magento\Tax\Model\Calculation $taxCalculation, @@ -67,16 +65,7 @@ public function __construct( ) { $this->_taxCalculation = $taxCalculation; parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $arrayUtils, - $data + $context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $arrayUtils, $data ); } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php index 5ad377bfe6a78..10318696be4f4 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset; -class Qty extends \Magento\Core\Block\Template +class Qty extends \Magento\View\Block\Template { /** * Core registry @@ -38,20 +38,20 @@ class Qty extends \Magento\Core\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php index 34d75a06bbd1d..dde58155e8055 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php @@ -35,7 +35,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite\Update; -class Result extends \Magento\Core\Block\Template +class Result extends \Magento\View\Block\Template { /** * Adminhtml js @@ -51,23 +51,23 @@ class Result extends \Magento\Core\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Adminhtml\Helper\Js $adminhtmlJs - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Adminhtml\Helper\Js $adminhtmlJs + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Adminhtml\Helper\Js $adminhtmlJs, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Adminhtml\Helper\Js $adminhtmlJs, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_adminhtmlJs = $adminhtmlJs; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php index 9f593f53a8580..94993e6faf3f1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php @@ -48,20 +48,20 @@ class Created extends \Magento\Adminhtml\Block\Widget */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php index fefd6246b4362..3f4a8026e08e6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php @@ -49,23 +49,23 @@ class Edit extends \Magento\Backend\Block\Widget */ protected $_attributeSetFactory; - /** - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_attributeSetFactory = $attributeSetFactory; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php index 35cc3d1dd58d9..a3518827035d6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php @@ -44,20 +44,20 @@ class Attribute extends \Magento\Adminhtml\Block\Widget */ protected $_helperActionAttribute = null; - /** - * @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute + * @param array $data */ - public function __construct( - \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute, + array $data = array() + ) { $this->_helperActionAttribute = $helperActionAttribute; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php index 63a3b96a4427e..bbf5f15c66d96 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php @@ -43,24 +43,24 @@ class Attributes */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php index 85cb43ba9dc46..16707d06ac980 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php @@ -42,20 +42,20 @@ class Inventory */ protected $_backorders; - /** - * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders + * @param array $data */ - public function __construct( - \Magento\CatalogInventory\Model\Source\Backorders $backorders, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\CatalogInventory\Model\Source\Backorders $backorders, + array $data = array() + ) { $this->_backorders = $backorders; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php index a6a76c898ab78..480a1f8e60f45 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php @@ -42,20 +42,20 @@ class AttributeSet extends \Magento\Backend\Block\Widget\Form */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php index 4888ebc2875fd..f18d195891e5b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php @@ -35,20 +35,20 @@ class Js extends \Magento\Adminhtml\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php index 4045d0db1f740..ce1b092e0ab31 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php @@ -38,23 +38,23 @@ */ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic { - /** - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { - parent::__construct($registry, $formFactory, $coreData, $context, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { + parent::__construct($context, $coreData, $registry, $formFactory, $data); $this->setUseContainer(true); $this->_categoryFactory = $categoryFactory; } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php index 044371b065423..9e62dda5b001b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php @@ -25,7 +25,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Ajax; -class Serializer extends \Magento\Core\Block\Template +class Serializer extends \Magento\View\Block\Template { public function _construct() { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php index 3c0bdf702a988..e705bb1ceb3c7 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php @@ -48,27 +48,25 @@ class Price extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_priceFactory; - /** - * @param \Magento\ProductAlert\Model\PriceFactory $priceFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\ProductAlert\Model\PriceFactory $priceFactory + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\ProductAlert\Model\PriceFactory $priceFactory, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\ProductAlert\Model\PriceFactory $priceFactory, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_priceFactory = $priceFactory; $this->_catalogData = $catalogData; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php index ff9081f8f5c5b..7460e9d1fbb13 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php @@ -48,27 +48,25 @@ class Stock extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_stockFactory; - /** - * @param \Magento\ProductAlert\Model\StockFactory $stockFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\ProductAlert\Model\StockFactory $stockFactory + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\ProductAlert\Model\StockFactory $stockFactory, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\ProductAlert\Model\StockFactory $stockFactory, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_stockFactory = $stockFactory; $this->_catalogData = $catalogData; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php index d00d21075d6c0..f2960deaa2088 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php @@ -47,27 +47,27 @@ class Attributes extends \Magento\Catalog\Block\Adminhtml\Form */ protected $_wysiwygConfig; - /** - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Data\FormFactory $formFactory, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; $this->_catalogData = $catalogData; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php index ceebf65883d11..9fa51ea9b55c7 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php @@ -52,26 +52,26 @@ class Search extends \Magento\Backend\Block\Widget */ protected $_helperPool; - /** - * @param \Magento\Core\Model\Resource\HelperPool $helperPool - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Resource\HelperPool $helperPool + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Core\Model\Resource\HelperPool $helperPool, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Resource\HelperPool $helperPool, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_helperPool = $helperPool; $this->_collectionFactory = $collectionFactory; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php index f4cd6aedeac7a..f5220902e9b68 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php @@ -72,36 +72,32 @@ class Crosssell extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_visibility; - /** - * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @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 \Magento\Core\Model\Registry $coreRegistry - * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product\LinkFactory $linkFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Product\LinkFactory $linkFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_linkFactory = $linkFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -109,7 +105,7 @@ public function __construct( $this->_status = $status; $this->_visibility = $visibility; $this->_coreRegistry = $coreRegistry; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php index 9a7a7dd7d6dce..613b4b31b2de5 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php @@ -42,11 +42,6 @@ class Inventory extends \Magento\Adminhtml\Block\Widget */ protected $_catalogData = null; - /** - * @var \Magento\Core\Model\StoreManager - */ - protected $_storeManager; - /** * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData @@ -66,32 +61,29 @@ class Inventory extends \Magento\Adminhtml\Block\Widget */ protected $_backorders; - /** - * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders - * @param \Magento\CatalogInventory\Model\Source\Stock $stock - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\StoreManager $storeManager - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders + * @param \Magento\CatalogInventory\Model\Source\Stock $stock + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\CatalogInventory\Model\Source\Backorders $backorders, - \Magento\CatalogInventory\Model\Source\Stock $stock, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\StoreManager $storeManager, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\CatalogInventory\Model\Source\Backorders $backorders, + \Magento\CatalogInventory\Model\Source\Stock $stock, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_stock = $stock; $this->_backorders = $backorders; $this->_catalogData = $catalogData; $this->_coreRegistry = $coreRegistry; - $this->_storeManager = $storeManager; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getBackordersOption() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php index b10e34625fd02..288e9b8216397 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php @@ -66,32 +66,32 @@ class Option extends \Magento\Adminhtml\Block\Widget */ protected $_optionType; - /** - * @param \Magento\Backend\Model\Config\Source\Yesno $configYesNo - * @param \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType - * @param \Magento\Catalog\Model\Product $product - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Config\Source\Yesno $configYesNo + * @param \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType + * @param \Magento\Catalog\Model\Product $product + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Model\Config\Source\Yesno $configYesNo, - \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType, - \Magento\Catalog\Model\Product $product, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Config\Source\Yesno $configYesNo, + \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType, + \Magento\Catalog\Model\Product $product, + \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\ProductOptions\ConfigInterface $productOptionConfig, + array $data = array() + ) { $this->_optionType = $optionType; $this->_configYesNo = $configYesNo; $this->_product = $product; $this->_productOptionConfig = $productOptionConfig; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php index d8b94b774f76e..7d0065a0ac285 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php @@ -43,20 +43,20 @@ class AbstractType extends \Magento\Adminhtml\Block\Widget */ protected $_optionPrice; - /** - * @param \Magento\Catalog\Model\Config\Source\Product\Options\Price $optionPrice - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Config\Source\Product\Options\Price $optionPrice + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Config\Source\Product\Options\Price $optionPrice, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Config\Source\Product\Options\Price $optionPrice, + array $data = array() + ) { $this->_optionPrice = $optionPrice; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php index 33352b03936e8..a834234f5426d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php @@ -82,29 +82,29 @@ abstract class AbstractGroup */ protected $_groupFactory; - /** - * @param \Magento\Customer\Model\GroupFactory $groupFactory - * @param \Magento\Directory\Helper\Data $directoryHelper - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Customer\Model\GroupFactory $groupFactory + * @param \Magento\Directory\Helper\Data $directoryHelper + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Customer\Model\GroupFactory $groupFactory, - \Magento\Directory\Helper\Data $directoryHelper, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Customer\Model\GroupFactory $groupFactory, + \Magento\Directory\Helper\Data $directoryHelper, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_groupFactory = $groupFactory; $this->_directoryHelper = $directoryHelper; $this->_catalogData = $catalogData; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php index be02daf35d755..8d6a526a33e77 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php @@ -39,20 +39,20 @@ class Recurring */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php index 84f15aff75169..118da106ba362 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php @@ -72,36 +72,32 @@ class Related extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_visibility; - /** - * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @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 \Magento\Core\Model\Registry $coreRegistry - * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product\LinkFactory $linkFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Product\LinkFactory $linkFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_linkFactory = $linkFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -109,7 +105,7 @@ public function __construct( $this->_status = $status; $this->_visibility = $visibility; $this->_coreRegistry = $coreRegistry; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php index 4e7c7a1b709c5..90bb3fd6c7e1d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php @@ -46,16 +46,6 @@ class Config */ protected $_catalogData = null; - /** - * @var \Magento\Core\Model\App - */ - protected $_storeManager; - - /** - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * Core registry * @@ -69,31 +59,25 @@ class Config protected $_configurableType; /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\App $app - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param array $data */ public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Product\Type\Configurable $configurableType, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\App $app, - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, \Magento\Core\Model\Registry $coreRegistry, array $data = array() ) { $this->_configurableType = $configurableType; $this->_coreRegistry = $coreRegistry; $this->_catalogData = $catalogData; - $this->_storeManager = $app; - $this->_locale = $locale; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -165,20 +149,6 @@ protected function _prepareLayout() )); $this->addChild('super_settings', 'Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Super\Settings'); -// @todo: Remove unused code and blocks -// if ($this->getProduct()->getId()) { -// $this->setChild('simple', -// $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Super\Config\Simple', -// 'catalog.product.edit.tab.super.config.simple') -// ); -// -// $this->addChild('create_from_configurable', 'Magento\Adminhtml\Block\Widget\Button', array( -// 'label' => __('Copy From Configurable'), -// 'class' => 'add', -// 'onclick' => 'superProduct.createNewProduct()' -// )); -// } - $this->addChild( 'generate', 'Magento\Backend\Block\Widget\Button', @@ -489,7 +459,7 @@ public function getParentTab() */ public function getApp() { - return $this->_storeManager; + return $this->_app; } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php index 5da7411049b31..d5a2e2e2da69d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php @@ -43,18 +43,18 @@ class Checkbox extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\Chec */ protected $_coreData = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter + * @param \Magento\Core\Helper\Data $coreData + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Context $context, - \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter, + \Magento\Core\Helper\Data $coreData, + array $data = array() + ) { $this->_coreData = $coreData; parent::__construct($context, $converter, $data); } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php index e1dcda84f9263..f8bc14458e7b9 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php @@ -36,12 +36,6 @@ class Matrix extends \Magento\Backend\Block\Template { - /** @var \Magento\Core\Model\App */ - protected $_application; - - /** @var \Magento\Core\Model\LocaleInterface */ - protected $_locale; - /** * @param \Magento\Core\Helper\Data $coreData * Core registry @@ -65,35 +59,29 @@ class Matrix */ protected $_config; - /** - * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType - * @param \Magento\Catalog\Model\Config $config - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType + * @param \Magento\Catalog\Model\Config $config + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product\Type\Configurable $configurableType, - \Magento\Catalog\Model\Config $config, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Product\Type\Configurable $configurableType, + \Magento\Catalog\Model\Config $config, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_configurableType = $configurableType; $this->_productFactory = $productFactory; $this->_config = $config; $this->_coreRegistry = $coreRegistry; - parent::__construct($coreData, $context, $data); - $this->_application = $application; - $this->_locale = $locale; + parent::__construct($context, $coreData, $data); } /** @@ -104,7 +92,7 @@ public function __construct( */ public function renderPrice($price) { - return $this->_locale->currency($this->_application->getBaseCurrencyCode())->toCurrency(sprintf('%f', $price)); + return $this->_locale->currency($this->_app->getBaseCurrencyCode())->toCurrency(sprintf('%f', $price)); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php index 0f7993bcc1f84..54c0fa632e82b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php @@ -48,28 +48,28 @@ class Simple */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Data\FormFactory $formFactory, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; - parent::__construct($wysiwygConfig, $formFactory, $catalogData, $coreData, $context, $registry, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $wysiwygConfig, $catalogData, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php index 192a12d363ff4..977eb64579331 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php @@ -40,24 +40,24 @@ class Settings extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_configurableType; - /** - * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product\Type\Configurable $configurableType, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Catalog\Model\Product\Type\Configurable $configurableType, + array $data = array() + ) { $this->_configurableType = $configurableType; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php index ddecd88716bce..1b983bc844891 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php @@ -72,36 +72,32 @@ class Upsell extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_visibility; - /** - * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @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 \Magento\Core\Model\Registry $coreRegistry - * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product\LinkFactory $linkFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Product\LinkFactory $linkFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_linkFactory = $linkFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -109,7 +105,7 @@ public function __construct( $this->_status = $status; $this->_visibility = $visibility; $this->_coreRegistry = $coreRegistry; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php index ea8e21ac25c06..0091dc7b01d00 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php @@ -46,32 +46,26 @@ class Websites extends \Magento\Backend\Block\Store\Switcher */ protected $_coreRegistry = null; - /** - * Constructor - * - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\App $application - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory - * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory + * @param \Magento\Core\Model\StoreFactory $storeFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\App $application, - \Magento\Core\Model\Website\Factory $websiteFactory, - \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, - \Magento\Core\Model\StoreFactory $storeFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Website\Factory $websiteFactory, + \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, + \Magento\Core\Model\StoreFactory $storeFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; - parent::__construct( - $coreData, $context, $application, $websiteFactory, $storeGroupFactory, $storeFactory, $data - ); + parent::__construct($context, $coreData, $websiteFactory, $storeGroupFactory, $storeFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php index 0ce48e8f4c60d..915f01943f02a 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php @@ -66,31 +66,31 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs */ protected $_collectionFactory; - /** - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Helper\Catalog $helperCatalog - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Helper\Catalog $helperCatalog + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, - \Magento\Catalog\Helper\Catalog $helperCatalog, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, + \Magento\Catalog\Helper\Catalog $helperCatalog, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_helperCatalog = $helperCatalog; $this->_catalogData = $catalogData; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $authSession, $data); + parent::__construct($context, $coreData, $authSession, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php index e0fe599ae8115..e18930377acf8 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php @@ -57,22 +57,22 @@ class Watermark */ protected $_imageTypes; - /** - * @param \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition - * @param \Magento\Backend\Block\System\Config\Form\Field $formField - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param \Magento\Backend\Block\Context $context - * @param array $imageTypes - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition + * @param \Magento\Backend\Block\System\Config\Form\Field $formField + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param array $data + * @param array $imageTypes */ - public function __construct( - \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition, - \Magento\Backend\Block\System\Config\Form\Field $formField, - \Magento\Data\Form\Element\Factory $elementFactory, - \Magento\Backend\Block\Context $context, - array $imageTypes = array(), - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition, + \Magento\Backend\Block\System\Config\Form\Field $formField, + \Magento\Data\Form\Element\Factory $elementFactory, + array $data = array(), + array $imageTypes = array() + ) { $this->_watermarkPosition = $watermarkPosition; $this->_formField = $formField; $this->_elementFactory = $elementFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php index 1d7683e482985..306e7bff49793 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php @@ -72,36 +72,32 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_websiteFactory; - /** - * @param \Magento\Core\Model\WebsiteFactory $websiteFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Catalog\Helper\Data $catalogData - * @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 - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Core\Model\WebsiteFactory $websiteFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Core\Model\WebsiteFactory $websiteFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Core\Model\WebsiteFactory $websiteFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_websiteFactory = $websiteFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -109,7 +105,7 @@ public function __construct( $this->_status = $status; $this->_visibility = $visibility; $this->_catalogData = $catalogData; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery.php index 45bb07ea552e7..98e85e6076ef8 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery.php @@ -37,7 +37,7 @@ class Gallery extends \Magento\Data\Form\Element\AbstractElement { /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -48,7 +48,7 @@ class Gallery extends \Magento\Data\Form\Element\AbstractElement /** * @param \Magento\View\LayoutInterface $layout - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection @@ -56,7 +56,7 @@ class Gallery extends \Magento\Data\Form\Element\AbstractElement */ public function __construct( \Magento\View\LayoutInterface $layout, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php index bed0f7f924507..51c2f9046c1e0 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php @@ -45,20 +45,20 @@ class Content extends \Magento\Backend\Block\Widget */ protected $_mediaConfig; - /** - * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\Product\Media\Config $mediaConfig, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Product\Media\Config $mediaConfig, + array $data = array() + ) { $this->_mediaConfig = $mediaConfig; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php index d3c52d75425f4..c4c19bab14478 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php @@ -53,7 +53,7 @@ class Price extends \Magento\Data\Form\Element\Text protected $_locale; /** - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement @@ -62,7 +62,7 @@ class Price extends \Magento\Data\Form\Element\Text * @param array $attributes */ public function __construct( - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\LocaleInterface $locale, \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php index c8bfb58fc8554..477426fa37044 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php @@ -54,20 +54,20 @@ class Ajax extends \Magento\Backend\Block\AbstractBlock */ protected $_productFactory; - /** - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_coreData = $coreData; $this->_productFactory = $productFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php index 72fee2023700a..79cdc85bc810f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php @@ -57,33 +57,31 @@ class Chooser extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_categoryFactory; - /** - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Model\Resource\Category $resourceCategory - * @param \Magento\Catalog\Model\Resource\Product $resourceProduct - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Model\Resource\Category $resourceCategory + * @param \Magento\Catalog\Model\Resource\Product $resourceProduct + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory, - \Magento\Catalog\Model\Resource\Category $resourceCategory, - \Magento\Catalog\Model\Resource\Product $resourceProduct, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory, + \Magento\Catalog\Model\Resource\Category $resourceCategory, + \Magento\Catalog\Model\Resource\Product $resourceProduct, + array $data = array() + ) { $this->_categoryFactory = $categoryFactory; $this->_collectionFactory = $collectionFactory; $this->_resourceCategory = $resourceCategory; $this->_resourceProduct = $resourceProduct; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php index 02738604f8307..d5e8538e58639 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php @@ -39,20 +39,20 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php index 739307f67232a..e1eb0d9aac548 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php @@ -41,24 +41,24 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Core\Model\System\Store $systemStore - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Core\Model\System\Store $systemStore, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_systemStore = $systemStore; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Breadcrumbs.php b/app/code/Magento/Catalog/Block/Breadcrumbs.php index b9434101fdec7..f2a9fb0b0d35b 100644 --- a/app/code/Magento/Catalog/Block/Breadcrumbs.php +++ b/app/code/Magento/Catalog/Block/Breadcrumbs.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block; -class Breadcrumbs extends \Magento\Core\Block\Template +class Breadcrumbs extends \Magento\View\Block\Template { /** * Catalog data @@ -43,31 +43,19 @@ class Breadcrumbs extends \Magento\Core\Block\Template protected $_catalogData = null; /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Data $catalogData * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Helper\Data $catalogData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_catalogData = $catalogData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Category/View.php b/app/code/Magento/Catalog/Block/Category/View.php index 60a8d233fa24a..e7434c4d7827c 100644 --- a/app/code/Magento/Catalog/Block/Category/View.php +++ b/app/code/Magento/Catalog/Block/Category/View.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Category; -class View extends \Magento\Core\Block\Template +class View extends \Magento\View\Block\Template { /** * Core registry @@ -50,34 +50,22 @@ class View extends \Magento\Core\Block\Template protected $_catalogLayer; /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Layer $catalogLayer + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Layer $catalogLayer, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Core\Model\Registry $registry, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_catalogLayer = $catalogLayer; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Category/Widget/Link.php b/app/code/Magento/Catalog/Block/Category/Widget/Link.php index ef7cbf1ed6e36..a89e445717e12 100644 --- a/app/code/Magento/Catalog/Block/Category/Widget/Link.php +++ b/app/code/Magento/Catalog/Block/Category/Widget/Link.php @@ -38,24 +38,20 @@ class Link extends \Magento\Catalog\Block\Widget\Link { /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite * @param \Magento\Catalog\Model\Resource\Category $resourceCategory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, \Magento\Catalog\Model\Resource\Category $resourceCategory, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, array $data = array() ) { - parent::__construct($urlRewrite, $storeManager, $coreData, $context, $data); + parent::__construct($context, $coreData, $urlRewrite, $data); $this->_entityResource = $resourceCategory; } } diff --git a/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php b/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php index cfe62c714e22d..69f5eda44bf4f 100644 --- a/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php +++ b/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Layer\Filter; -abstract class AbstractFilter extends \Magento\Core\Block\Template +abstract class AbstractFilter extends \Magento\View\Block\Template { /** * Catalog Layer Filter Attribute model @@ -77,24 +77,22 @@ abstract class AbstractFilter extends \Magento\Core\Block\Template protected $_layerFilterFactory; /** - * Construct - * - * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Layer\Filter\Factory $layerFilterFactory * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Layer\Filter\Factory $layerFilterFactory, array $data = array() ) { $this->_catalogData = $catalogData; $this->_layerFilterFactory = $layerFilterFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Layer/State.php b/app/code/Magento/Catalog/Block/Layer/State.php index 0dc30be6f2328..095bb93785136 100644 --- a/app/code/Magento/Catalog/Block/Layer/State.php +++ b/app/code/Magento/Catalog/Block/Layer/State.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Layer; -class State extends \Magento\Core\Block\Template +class State extends \Magento\View\Block\Template { protected $_template = 'layer/state.phtml'; @@ -45,21 +45,19 @@ class State extends \Magento\Core\Block\Template protected $_catalogLayer; /** - * Construct - * - * @param \Magento\Catalog\Model\Layer $catalogLayer + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Model\Layer $catalogLayer * @param array $data */ public function __construct( - \Magento\Catalog\Model\Layer $catalogLayer, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Model\Layer $catalogLayer, array $data = array() ) { $this->_catalogLayer = $catalogLayer; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Layer/View.php b/app/code/Magento/Catalog/Block/Layer/View.php index a1b6c7cd26aa4..6be814a2a5dbb 100644 --- a/app/code/Magento/Catalog/Block/Layer/View.php +++ b/app/code/Magento/Catalog/Block/Layer/View.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Layer; -class View extends \Magento\Core\Block\Template +class View extends \Magento\View\Block\Template { /** * State block name @@ -78,21 +78,19 @@ class View extends \Magento\Core\Block\Template protected $_catalogLayer; /** - * Construct - * - * @param \Magento\Catalog\Model\Layer $catalogLayer + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Model\Layer $catalogLayer * @param array $data */ public function __construct( - \Magento\Catalog\Model\Layer $catalogLayer, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Model\Layer $catalogLayer, array $data = array() ) { $this->_catalogLayer = $catalogLayer; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Navigation.php b/app/code/Magento/Catalog/Block/Navigation.php index 04ee7fa90c8f6..1554da667a327 100644 --- a/app/code/Magento/Catalog/Block/Navigation.php +++ b/app/code/Magento/Catalog/Block/Navigation.php @@ -31,7 +31,7 @@ * * @SuppressWarnings(PHPMD.LongVariable) */ -class Navigation extends \Magento\Core\Block\Template +class Navigation extends \Magento\View\Block\Template { protected $_categoryInstance = null; @@ -82,13 +82,6 @@ class Navigation extends \Magento\Core\Block\Template */ protected $_catalogLayer; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Product collection factory * @@ -97,42 +90,37 @@ class Navigation extends \Magento\Core\Block\Template protected $_productCollectionFactory; /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat * @param \Magento\Catalog\Helper\Category $catalogCategory * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat, \Magento\Catalog\Helper\Category $catalogCategory, \Magento\Core\Model\Registry $registry, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, array $data = array() ) { $this->_productCollectionFactory = $productCollectionFactory; - $this->_storeManager = $storeManager; $this->_catalogLayer = $catalogLayer; $this->_customerSession = $customerSession; $this->_catalogCategoryFlat = $catalogCategoryFlat; $this->_catalogCategory = $catalogCategory; $this->_registry = $registry; $this->_categoryInstance = $categoryFactory->create(); - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Product.php b/app/code/Magento/Catalog/Block/Product.php index 891a183dcf1e2..e104a80f49d60 100644 --- a/app/code/Magento/Catalog/Block/Product.php +++ b/app/code/Magento/Catalog/Block/Product.php @@ -24,10 +24,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Catalog\Block; -class Product extends \Magento\Core\Block\Template +class Product extends \Magento\View\Block\Template { protected $_finalPrice = array(); @@ -39,21 +38,19 @@ class Product extends \Magento\Core\Block\Template protected $_productFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param array $data */ public function __construct( - \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, array $data = array() ) { $this->_productFactory = $productFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getProduct() diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index bf01e61be60d4..502efcdf9d069 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product; -abstract class AbstractProduct extends \Magento\Core\Block\Template +abstract class AbstractProduct extends \Magento\View\Block\Template { protected $_priceBlock = array(); @@ -109,49 +109,37 @@ abstract class AbstractProduct extends \Magento\Core\Block\Template */ protected $_catalogConfig; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Math\Random */ protected $mathRandom; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; - $this->_coreRegistry = $coreRegistry; + $this->_coreRegistry = $registry; $this->_taxData = $taxData; $this->_catalogData = $catalogData; $this->mathRandom = $mathRandom; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -267,7 +255,7 @@ protected function _getPriceBlockTemplate($productTypeId) * Prepares and returns block to render some product type * * @param string $productType - * @return \Magento\Core\Block\Template + * @return \Magento\View\Block\Template */ public function _preparePriceRenderer($productType) { diff --git a/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php b/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php index 5cf07ba9f17a0..4fb668446a6b2 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php @@ -44,41 +44,29 @@ abstract class AbstractCompare extends \Magento\Catalog\Block\Product\AbstractPr protected $_catalogProductCompare = null; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \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, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $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 fea4805604a39..41aa1b04033b3 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php @@ -100,13 +100,12 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare protected $_itemCollectionFactory; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory @@ -116,13 +115,12 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, @@ -136,13 +134,12 @@ public function __construct( $this->_logVisitor = $logVisitor; $this->_customerSession = $customerSession; parent::__construct( - $storeManager, + $context, + $coreData, $catalogConfig, - $coreRegistry, + $registry, $taxData, $catalogData, - $coreData, - $context, $mathRandom, $catalogProductCompare, $data @@ -158,7 +155,7 @@ public function __construct( public function getAddToWishlistUrl($product) { $continueUrl = $this->_coreData->urlEncode($this->getUrl('customer/account')); - $urlParamName = \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED; + $urlParamName = \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED; $params = array( $urlParamName => $continueUrl diff --git a/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php b/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php index c2dbc46494e84..db7c4a8f09908 100644 --- a/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php +++ b/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php @@ -55,8 +55,8 @@ class ColumnSet protected $_productType; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory * @param \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals * @param \Magento\Backend\Model\Widget\Grid\Totals $totals @@ -65,8 +65,8 @@ class ColumnSet * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory, \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals, \Magento\Backend\Model\Widget\Grid\Totals $totals, @@ -74,7 +74,7 @@ public function __construct( \Magento\Core\Model\Registry $registryManager, array $data = array() ) { - parent::__construct($coreData, $context, $generatorFactory, $subtotals, $totals, $data); + parent::__construct($context, $coreData, $generatorFactory, $subtotals, $totals, $data); $this->_registryManager = $registryManager; $this->_productType = $productType; diff --git a/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php b/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php index 83d510c0702d7..e39b31cc2ac24 100644 --- a/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php +++ b/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php @@ -47,25 +47,23 @@ class AttributeSelector extends \Magento\Backend\Block\Template */ protected $_resourceHelper; - /** - * Construct - * - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper + * @param array $data */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, + array $data = array() + ) { $this->_attributeColFactory = $attributeColFactory; $this->_resourceHelper = $resourceHelper; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Gallery.php b/app/code/Magento/Catalog/Block/Product/Gallery.php index d3166820fa4b4..077d15f1f874b 100644 --- a/app/code/Magento/Catalog/Block/Product/Gallery.php +++ b/app/code/Magento/Catalog/Block/Product/Gallery.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Product; -class Gallery extends \Magento\Core\Block\Template +class Gallery extends \Magento\View\Block\Template { /** * Core registry @@ -43,19 +43,19 @@ class Gallery extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php b/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php index af82534849437..8a540fbfbb565 100644 --- a/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php +++ b/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php @@ -35,13 +35,6 @@ class ListAssociatedProducts extends \Magento\Backend\Block\Template { - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManager - */ - protected $_storeManager; - /** * Registry * @@ -49,22 +42,19 @@ class ListAssociatedProducts extends \Magento\Backend\Block\Template */ protected $_registry; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\StoreManager $storeManager - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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\StoreManager $storeManager, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { - parent::__construct($coreData, $context, $data); - $this->_storeManager = $storeManager; + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + parent::__construct($context, $coreData, $data); $this->_registry = $registry; } diff --git a/app/code/Magento/Catalog/Block/Product/Image.php b/app/code/Magento/Catalog/Block/Product/Image.php index a39de76390574..7489db03a246f 100644 --- a/app/code/Magento/Catalog/Block/Product/Image.php +++ b/app/code/Magento/Catalog/Block/Product/Image.php @@ -46,7 +46,7 @@ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Image extends \Magento\Core\Block\Template +class Image extends \Magento\View\Block\Template { /** * Template image only @@ -68,19 +68,19 @@ class Image extends \Magento\Core\Block\Template protected $_productImageView; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Catalog\Model\Product\Image\View $productImageView * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Catalog\Model\Product\Image\View $productImageView, array $data = array() ) { $this->_productImageView = $productImageView; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index 091d98690afa5..ab704a3459a3b 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -65,26 +65,24 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct protected $_categoryFactory; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Layer $catalogLayer * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Layer $catalogLayer, @@ -92,17 +90,7 @@ public function __construct( ) { $this->_categoryFactory = $categoryFactory; $this->_catalogLayer = $catalogLayer; - parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/NewProduct.php b/app/code/Magento/Catalog/Block/Product/NewProduct.php index 88b192da14b21..34e581214ba67 100644 --- a/app/code/Magento/Catalog/Block/Product/NewProduct.php +++ b/app/code/Magento/Catalog/Block/Product/NewProduct.php @@ -59,13 +59,6 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct */ protected $_catalogProductVisibility; - /** - * Locale - * - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * Product collection factory * @@ -74,52 +67,35 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct protected $_productCollectionFactory; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \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\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \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, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** @@ -205,7 +181,7 @@ protected function _getProductCollection() /** * Prepare collection with new products * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Catalog/Block/Product/Price.php b/app/code/Magento/Catalog/Block/Product/Price.php index dd7f339d96967..4bd748c9f2ad4 100644 --- a/app/code/Magento/Catalog/Block/Product/Price.php +++ b/app/code/Magento/Catalog/Block/Product/Price.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Product; -class Price extends \Magento\Core\Block\Template +class Price extends \Magento\View\Block\Template { protected $_priceDisplayType = null; protected $_idSuffix = ''; @@ -59,13 +59,6 @@ class Price extends \Magento\Core\Block\Template */ protected $_catalogData = null; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Stdlib\String */ @@ -77,36 +70,31 @@ class Price extends \Magento\Core\Block\Template protected $mathRandom; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Stdlib\String $string * @param \Magento\Math\Random $mathRandom * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Stdlib\String $string, \Magento\Math\Random $mathRandom, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_coreRegistry = $registry; $this->_catalogData = $catalogData; $this->_taxData = $taxData; $this->string = $string; $this->mathRandom = $mathRandom; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Price/Template.php b/app/code/Magento/Catalog/Block/Product/Price/Template.php index 284b103e3755b..5e349ea57fba1 100644 --- a/app/code/Magento/Catalog/Block/Product/Price/Template.php +++ b/app/code/Magento/Catalog/Block/Product/Price/Template.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\Price; -class Template extends \Magento\Core\Block\AbstractBlock +class Template extends \Magento\View\Block\AbstractBlock { /** * Product Price block types cache diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php index 71097bd8b7cae..5467c63158cfc 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php @@ -42,13 +42,12 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct protected $_layerFactory; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Layer $catalogLayer @@ -57,13 +56,12 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Layer $catalogLayer, @@ -74,13 +72,12 @@ public function __construct( $this->_layerFactory = $layerFactory; $this->_productCollectionFactory = $productCollectionFactory; parent::__construct( - $storeManager, + $context, + $coreData, $catalogConfig, - $coreRegistry, + $registry, $taxData, $catalogData, - $coreData, - $context, $mathRandom, $categoryFactory, $catalogLayer, @@ -94,7 +91,7 @@ protected function _getProductCollection() /** @var \Magento\Catalog\Model\Resource\Product\Collection $collection */ $collection = $this->_productCollectionFactory->create(); $this->_layerFactory->create()->prepareProductCollection($collection); -// your custom filter + $collection->addAttributeToFilter('promotion', 1) ->addStoreFilter(); diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php index 51a99f2d9738b..d14df1a7d4bb1 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php @@ -48,13 +48,12 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct protected $_layerFactory; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Layer $catalogLayer @@ -63,13 +62,12 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Layer $catalogLayer, @@ -80,13 +78,12 @@ public function __construct( $this->_layerFactory = $layerFactory; $this->_productCollectionFactory = $productCollectionFactory; parent::__construct( - $storeManager, + $context, + $coreData, $catalogConfig, - $coreRegistry, + $registry, $taxData, $catalogData, - $coreData, - $context, $mathRandom, $categoryFactory, $catalogLayer, diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index 8d0ee404e5f13..cbbbefec79673 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -64,28 +64,25 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct protected $_checkoutCart; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \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\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Checkout\Model\Resource\Cart $checkoutCart, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, @@ -95,17 +92,7 @@ public function __construct( $this->_checkoutCart = $checkoutCart; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_checkoutSession = $checkoutSession; - parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } protected function _prepareData() diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php index c3849bc439fba..b5c72df453abe 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\ProductList; -class Toolbar extends \Magento\Core\Block\Template +class Toolbar extends \Magento\View\Block\Template { /** * Products collection @@ -158,24 +158,22 @@ class Toolbar extends \Magento\Core\Block\Template protected $_catalogSession; /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Session $catalogSession, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, array $data = array() ) { $this->_catalogSession = $catalogSession; $this->_catalogConfig = $catalogConfig; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index f8a15b1914511..8e53a409ae085 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -70,47 +70,37 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct protected $_checkoutCart; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \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\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Checkout\Model\Resource\Cart $checkoutCart, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Core\Model\Registry $coreRegistry, array $data = array() ) { $this->_checkoutCart = $checkoutCart; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_checkoutSession = $checkoutSession; - parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $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 c86c541b6b5ba..35d31e0bcef2e 100644 --- a/app/code/Magento/Catalog/Block/Product/Send.php +++ b/app/code/Magento/Catalog/Block/Product/Send.php @@ -44,41 +44,29 @@ class Send extends \Magento\Catalog\Block\Product\AbstractProduct protected $_customerSession; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php index c2a3524f14b7b..758c6c51e9e4f 100644 --- a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php +++ b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php @@ -31,7 +31,7 @@ * * @SuppressWarnings(PHPMD.LongVariable) */ -class TemplateSelector extends \Magento\Core\Block\Template +class TemplateSelector extends \Magento\View\Block\Template { /** * Core registry @@ -55,19 +55,17 @@ class TemplateSelector extends \Magento\Core\Block\Template protected $_resourceHelper; /** - * Construct - * - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param array $data */ public function __construct( - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory, \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\Resource\Helper $resourceHelper, array $data = array() @@ -75,7 +73,7 @@ public function __construct( $this->_setColFactory = $setColFactory; $this->_coreRegistry = $registry; $this->_resourceHelper = $resourceHelper; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 8323b9cc02db7..91c0c05399b35 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -52,13 +52,6 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct */ protected $_taxCalculation; - /** - * Locale - * - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - /** * Product factory * @@ -67,52 +60,35 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct protected $_productFactory; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Tax\Model\Calculation $taxCalculation - * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Stdlib\String $string + * @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 \Magento\Math\Random $mathRandom + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Tax\Model\Calculation $taxCalculation + * @param \Magento\Stdlib\String $string * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Tax\Model\Calculation $taxCalculation, - \Magento\Core\Model\Registry $coreRegistry, - \Magento\Stdlib\String $string, + \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, \Magento\Math\Random $mathRandom, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Tax\Model\Calculation $taxCalculation, + \Magento\Stdlib\String $string, array $data = array() ) { $this->_productFactory = $productFactory; - $this->_locale = $locale; $this->_taxCalculation = $taxCalculation; $this->string = $string; - parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** @@ -208,7 +184,7 @@ public function getAddToCartUrl($product, $additional = array()) $additional['wishlist_next'] = 1; } - $addUrlKey = \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED; + $addUrlKey = \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED; $addUrlValue = $this->_urlBuilder->getUrl('*/*/*', array('_use_rewrite' => true, '_current' => true)); $additional[$addUrlKey] = $this->_coreData->urlEncode($addUrlValue); diff --git a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php index 7543e612f480c..0d684a721a8a3 100644 --- a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php +++ b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php @@ -41,43 +41,32 @@ abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProdu protected $arrayUtils; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \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 - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } + /** * Retrive product * diff --git a/app/code/Magento/Catalog/Block/Product/View/Additional.php b/app/code/Magento/Catalog/Block/Product/View/Additional.php index 613da7aca3187..a9d07f23c1f74 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Additional.php +++ b/app/code/Magento/Catalog/Block/Product/View/Additional.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Additional extends \Magento\Core\Block\Template +class Additional extends \Magento\View\Block\Template { protected $_list; diff --git a/app/code/Magento/Catalog/Block/Product/View/Attributes.php b/app/code/Magento/Catalog/Block/Product/View/Attributes.php index ed1397ff8df22..6576cae55bac8 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Attributes.php +++ b/app/code/Magento/Catalog/Block/Product/View/Attributes.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Attributes extends \Magento\Core\Block\Template +class Attributes extends \Magento\View\Block\Template { protected $_product = null; @@ -46,31 +46,19 @@ class Attributes extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } function getProduct() diff --git a/app/code/Magento/Catalog/Block/Product/View/Description.php b/app/code/Magento/Catalog/Block/Product/View/Description.php index da7448dba01d2..6e7c0fdae58a6 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Description.php +++ b/app/code/Magento/Catalog/Block/Product/View/Description.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Description extends \Magento\Core\Block\Template +class Description extends \Magento\View\Block\Template { protected $_product = null; @@ -46,19 +46,19 @@ class Description extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getProduct() diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index a31b562e3f335..b9f791510f48d 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Options extends \Magento\Core\Block\Template +class Options extends \Magento\View\Block\Template { protected $_product; @@ -67,38 +67,31 @@ class Options extends \Magento\Core\Block\Template protected $_catalogProduct; /** - * @var \Magento\Stdlib\ArrayUtils - */ - protected $arrayUtils; - - /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Product $catalogProduct * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Core\Helper\Data $coreData - * @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( + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Product $catalogProduct, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Helper\Data $coreData, - \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; - parent::__construct($coreData, $context, $data); $this->_registry = $registry; $this->_option = $option; $this->_taxData = $taxData; $this->arrayUtils = $arrayUtils; + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php index 48bda570b90be..50693fb405530 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View\Options; -abstract class AbstractOptions extends \Magento\Core\Block\Template +abstract class AbstractOptions extends \Magento\View\Block\Template { /** * Product object @@ -58,19 +58,19 @@ abstract class AbstractOptions extends \Magento\Core\Block\Template protected $_taxData = null; /** - * @param \Magento\Tax\Helper\Data $taxData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Tax\Helper\Data $taxData * @param array $data */ public function __construct( - \Magento\Tax\Helper\Data $taxData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Tax\Helper\Data $taxData, array $data = array() ) { $this->_taxData = $taxData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php index c613f2a5afa6c..6867d3546ed6b 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php @@ -49,34 +49,21 @@ class Date extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions protected $_catalogProductOptionTypeDate; /** - * Locale - * - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * Construct - * - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Catalog\Model\Product\Option\Type\Date - * $catalogProductOptionTypeDate - * @param \Magento\Tax\Helper\Data $taxData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Tax\Helper\Data $taxData + * @param \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate * @param array $data */ public function __construct( - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate, - \Magento\Tax\Helper\Data $taxData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Tax\Helper\Data $taxData, + \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate, array $data = array() ) { - $this->_locale = $locale; $this->_catalogProductOptionTypeDate = $catalogProductOptionTypeDate; - parent::__construct($taxData, $coreData, $context, $data); + parent::__construct($context, $coreData, $taxData, $data); } protected function _prepareLayout() @@ -125,7 +112,7 @@ public function getCalendarDateHtml() $yearEnd = $this->_catalogProductOptionTypeDate->getYearEnd(); $calendar = $this->getLayout() - ->createBlock('Magento\Core\Block\Html\Date') + ->createBlock('Magento\View\Block\Html\Date') ->setId('options_'.$this->getOption()->getId().'_date') ->setName('options['.$this->getOption()->getId().'][date]') ->setClass('product-custom-option datetime-picker input-text') @@ -216,7 +203,7 @@ protected function _getSelectFromToHtml($name, $from, $to, $value = null) * HTML select element * * @param string $name Id/name of html select element - * @return \Magento\Core\Block\Html\Select + * @return \Magento\View\Block\Html\Select */ protected function _getHtmlSelect($name, $value = null) { @@ -226,7 +213,7 @@ protected function _getHtmlSelect($name, $value = null) // $require = $this->getOption()->getIsRequire() ? ' required-entry' : ''; $require = ''; - $select = $this->getLayout()->createBlock('Magento\Core\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') ->setId('options_' . $this->getOption()->getId() . '_' . $name) ->setClass('product-custom-option datetime-picker' . $require) ->setExtraParams() diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php index 3b287f383f284..2f6b0a0cae586 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php @@ -54,7 +54,7 @@ public function getValuesHtml() || $_option->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_MULTIPLE) { $require = ($_option->getIsRequire()) ? ' required' : ''; $extraParams = ''; - $select = $this->getLayout()->createBlock('Magento\Core\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') ->setData(array( 'id' => 'select_'.$_option->getId(), 'class' => $require.' product-custom-option' diff --git a/app/code/Magento/Catalog/Block/Product/View/Price.php b/app/code/Magento/Catalog/Block/Product/View/Price.php index ac1e5860d50d7..c7ee886d32479 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Price.php +++ b/app/code/Magento/Catalog/Block/Product/View/Price.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Price extends \Magento\Core\Block\Template +class Price extends \Magento\View\Block\Template { /** * Core registry @@ -39,19 +39,19 @@ class Price extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getPrice() diff --git a/app/code/Magento/Catalog/Block/Product/View/Tabs.php b/app/code/Magento/Catalog/Block/Product/View/Tabs.php index 6ae02f5d6805e..c4384e1a69194 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Tabs.php +++ b/app/code/Magento/Catalog/Block/Product/View/Tabs.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Tabs extends \Magento\Core\Block\Template +class Tabs extends \Magento\View\Block\Template { /** * Configured tabs 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 47ce73a86ce0e..eaab4c369e2f1 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php @@ -65,13 +65,12 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView protected $_taxCalculation; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param \Magento\Tax\Model\Calculation $taxCalculation @@ -79,13 +78,12 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Stdlib\ArrayUtils $arrayUtils, \Magento\Tax\Model\Calculation $taxCalculation, @@ -95,16 +93,7 @@ public function __construct( $this->_taxCalculation = $taxCalculation; $this->_catalogProduct = $catalogProduct; parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $arrayUtils, - $data + $context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $arrayUtils, $data ); } diff --git a/app/code/Magento/Catalog/Block/Product/Widget/Link.php b/app/code/Magento/Catalog/Block/Product/Widget/Link.php index 445e4304a1785..c5033970afa4c 100644 --- a/app/code/Magento/Catalog/Block/Product/Widget/Link.php +++ b/app/code/Magento/Catalog/Block/Product/Widget/Link.php @@ -38,24 +38,20 @@ class Link extends \Magento\Catalog\Block\Widget\Link { /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Product $catalogProduct - * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite + * @param \Magento\Catalog\Model\Resource\Product $catalogProduct * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Product $catalogProduct, - \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, + \Magento\Catalog\Model\Resource\Product $catalogProduct, array $data = array() ) { - parent::__construct($urlRewrite, $storeManager, $coreData, $context, $data); + parent::__construct($context, $coreData, $urlRewrite, $data); $this->_entityResource = $catalogProduct; } } diff --git a/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php b/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php index b0b3b4866b967..af3a3c62c0bf8 100644 --- a/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php +++ b/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php @@ -201,7 +201,7 @@ public function getPagerHtml() ->setTotalLimit($this->getProductsCount()) ->setCollection($this->getProductCollection()); } - if ($this->_pager instanceof \Magento\Core\Block\AbstractBlock) { + if ($this->_pager instanceof \Magento\View\Block\AbstractBlock) { return $this->_pager->toHtml(); } } diff --git a/app/code/Magento/Catalog/Block/Widget/Link.php b/app/code/Magento/Catalog/Block/Widget/Link.php index 29db4ed58b696..6479a6f52c7ca 100644 --- a/app/code/Magento/Catalog/Block/Widget/Link.php +++ b/app/code/Magento/Catalog/Block/Widget/Link.php @@ -35,7 +35,7 @@ namespace Magento\Catalog\Block\Widget; class Link - extends \Magento\Core\Block\Html\Link + extends \Magento\View\Block\Html\Link implements \Magento\Widget\Block\BlockInterface { /** @@ -58,13 +58,6 @@ class Link */ protected $_anchorText; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Url rewrite * @@ -73,24 +66,19 @@ class Link protected $_urlRewrite; /** - * Construct - * - * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite * @param array $data */ public function __construct( - \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, array $data = array() ) { $this->_urlRewrite = $urlRewrite; - $this->_storeManager = $storeManager; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php index 61a0934b9653d..4b71aba114785 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml; -class Category extends \Magento\Backend\Controller\Adminhtml\Action +class Category extends \Magento\Backend\App\Action { /** * Initialize requested category and put it into registry. @@ -40,7 +40,7 @@ class Category extends \Magento\Backend\Controller\Adminhtml\Action */ protected function _initCategory($getRootInstead = false) { - $this->_title(__('Categories')); + $this->_title->add(__('Categories')); $categoryId = (int)$this->getRequest()->getParam('id', false); $storeId = (int)$this->getRequest()->getParam('store'); @@ -135,7 +135,7 @@ public function editAction() return; } - $this->_title($categoryId ? $category->getName() : __('Categories')); + $this->_title->add($categoryId ? $category->getName() : __('Categories')); /** * Check if we have data in session (if during category save was exception) @@ -170,13 +170,13 @@ public function editAction() ->setLastViewedStore($this->getRequest()->getParam('store')); $this->_objectManager->get('Magento\Backend\Model\Auth\Session') ->setLastEditedCategory($category->getId()); - $this->loadLayout(); + $this->_view->loadLayout(); $eventResponse = new \Magento\Object(array( - 'content' => $this->getLayout()->getBlock('category.edit')->getFormHtml() - . $this->getLayout()->getBlock('category.tree') + 'content' => $this->_view->getLayout()->getBlock('category.edit')->getFormHtml() + . $this->_view->getLayout()->getBlock('category.tree') ->getBreadcrumbsJavascript($breadcrumbsPath, 'editingCategoryBreadcrumbs'), - 'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(), + 'messages' => $this->_view->getLayout()->getMessagesBlock()->getGroupedHtml(), )); $this->_eventManager->dispatch( 'category_prepare_ajax_response', @@ -191,18 +191,18 @@ public function editAction() return; } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Catalog::catalog_categories'); - $this->getLayout()->getBlock('head')->setCanLoadExtJs(true)->setContainerCssClass('catalog-categories'); + $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true)->setContainerCssClass('catalog-categories'); $this->_addBreadcrumb(__('Manage Catalog Categories'), __('Manage Categories')); - $block = $this->getLayout()->getBlock('catalog.wysiwyg.js'); + $block = $this->_view->getLayout()->getBlock('catalog.wysiwyg.js'); if ($block) { $block->setStoreId($storeId); } - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -216,7 +216,7 @@ public function wysiwygAction() $storeMediaUrl = $this->_objectManager->get('Magento\Core\Model\StoreManagerInterface')->getStore($storeId) ->getBaseUrl(\Magento\Core\Model\Store::URL_TYPE_MEDIA); - $content = $this->getLayout()->createBlock( + $content = $this->_view->getLayout()->createBlock( 'Magento\Catalog\Block\Adminhtml\Helper\Form\Wysiwyg\Content', '', array( @@ -249,7 +249,7 @@ public function categoriesJsonAction() return; } $this->getResponse()->setBody( - $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree') ->getTreeJson($category) ); } @@ -363,8 +363,8 @@ public function saveAction() if ($this->getRequest()->getPost('return_session_messages_only')) { $category->load($category->getId()); // to obtain truncated category name - /** @var $block \Magento\Core\Block\Messages */ - $block = $this->_objectManager->get('Magento\Core\Block\Messages'); + /** @var $block \Magento\View\Block\Messages */ + $block = $this->_objectManager->get('Magento\View\Block\Messages'); $block->setMessages($this->_getSession()->getMessages(true)); $body = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(array( 'messages' => $block->getGroupedHtml(), @@ -468,7 +468,7 @@ public function gridAction() if (!$category) { return; } - $this->getResponse()->setBody($this->getLayout()->createBlock( + $this->getResponse()->setBody($this->_view->getLayout()->createBlock( 'Magento\Catalog\Block\Adminhtml\Category\Tab\Product', 'category.product.grid' )->toHtml()); } @@ -492,7 +492,7 @@ public function treeAction() $category = $this->_initCategory(true); - $block = $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree'); + $block = $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree'); $root = $block->getRoot(); $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(array( 'data' => $block->getTree(), @@ -530,7 +530,7 @@ public function refreshPathAction() */ public function suggestCategoriesAction() { - $this->getResponse()->setBody($this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree') + $this->getResponse()->setBody($this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree') ->getSuggestedCategoriesJson($this->getRequest()->getParam('label_part'))); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php index 25e08961c82e2..8731437136b33 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Category; -class Widget extends \Magento\Backend\Controller\Adminhtml\Action +class Widget extends \Magento\Backend\App\Action { /** * Core registry @@ -43,11 +43,11 @@ class Widget extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -85,7 +85,7 @@ public function categoriesJsonAction() protected function _getCategoryTreeBlock() { - return $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Widget\Chooser', '', array( + return $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Widget\Chooser', '', array( 'data' => array( 'id' => $this->getRequest()->getParam('uniq_id'), 'use_massaction' => $this->getRequest()->getParam('use_massaction', false) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php index 9a7d1518d3f33..4ac2ac6291605 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php @@ -33,7 +33,9 @@ */ namespace Magento\Catalog\Controller\Adminhtml; -class Product extends \Magento\Backend\Controller\Adminhtml\Action +use Magento\Backend\App\Action; + +class Product extends \Magento\Backend\App\Action { /** * The greatest value which could be stored in CatalogInventory Qty field @@ -55,14 +57,22 @@ class Product extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @var \Magento\Core\Filter\Date + */ + protected $_dateFilter; + + /** + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Core\Filter\Date $dateFilter */ public function __construct( - \Magento\Backend\Controller\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Backend\App\Action\Context $context, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Core\Filter\Date $dateFilter ) { $this->_coreRegistry = $coreRegistry; + $this->_dateFilter = $dateFilter; parent::__construct($context); } @@ -73,7 +83,7 @@ public function __construct( */ protected function _initProduct() { - $this->_title(__('Products')); + $this->_title->add(__('Products')); $productId = (int)$this->getRequest()->getParam('id'); /** @var $product \Magento\Catalog\Model\Product */ @@ -171,7 +181,7 @@ protected function _createSerializerBlock( \Magento\Adminhtml\Block\Widget\Grid $gridBlock, $productsArray ) { - return $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Ajax\Serializer') + return $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Ajax\Serializer') ->setGridBlock($gridBlock) ->setProducts($productsArray) ->setInputElementName($inputName); @@ -183,7 +193,7 @@ protected function _createSerializerBlock( protected function _outputBlocks() { $blocks = func_get_args(); - $output = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Text\ListText'); + $output = $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Text\ListText'); foreach ($blocks as $block) { $output->insert($block, '', true); } @@ -195,10 +205,10 @@ protected function _outputBlocks() */ public function indexAction() { - $this->_title(__('Products')); - $this->loadLayout(); + $this->_title->add(__('Products')); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Catalog::catalog_products'); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -219,12 +229,12 @@ public function newAction() $product->addData($productData); } - $this->_title(__('New Product')); + $this->_title->add(__('New Product')); $this->_eventManager->dispatch('catalog_product_new_action', array('product' => $product)); if ($this->getRequest()->getParam('popup')) { - $this->loadLayout('popup'); + $this->_view->loadLayout('popup'); } else { $_additionalLayoutPart = ''; if ($product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_CONFIGURABLE @@ -232,22 +242,22 @@ public function newAction() ) { $_additionalLayoutPart = '_new'; } - $this->loadLayout(array( + $this->_view->loadLayout(array( 'default', - strtolower($this->getFullActionName()), + strtolower($this->_request->getFullActionName()), 'catalog_product_' . $product->getTypeId() . $_additionalLayoutPart )); $this->_setActiveMenu('Magento_Catalog::catalog_products'); } - $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); + $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true); - $block = $this->getLayout()->getBlock('catalog.wysiwyg.js'); + $block = $this->_view->getLayout()->getBlock('catalog.wysiwyg.js'); if ($block) { $block->setStoreId($product->getStoreId()); } - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -266,7 +276,7 @@ public function editAction() return; } - $this->_title($product->getName()); + $this->_title->add($product->getName()); $this->_eventManager->dispatch('catalog_product_edit_action', array('product' => $product)); @@ -277,9 +287,9 @@ public function editAction() $additionalLayoutPart = '_new'; } - $this->loadLayout(array( + $this->_view->loadLayout(array( 'default', - strtolower($this->getFullActionName()), + strtolower($this->_request->getFullActionName()), 'catalog_product_'.$product->getTypeId() . $additionalLayoutPart )); @@ -287,7 +297,7 @@ public function editAction() if ( !$this->_objectManager->get('Magento\Core\Model\StoreManagerInterface')->isSingleStoreMode() - && ($switchBlock = $this->getLayout()->getBlock('store_switcher')) + && ($switchBlock = $this->_view->getLayout()->getBlock('store_switcher')) ) { $switchBlock->setDefaultStoreName(__('Default Values')) ->setWebsiteIds($product->getWebsiteIds()) @@ -300,14 +310,14 @@ public function editAction() ))); } - $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); + $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true); - $block = $this->getLayout()->getBlock('catalog.wysiwyg.js'); + $block = $this->_view->getLayout()->getBlock('catalog.wysiwyg.js'); if ($block) { $block->setStoreId($product->getStoreId()); } - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -321,7 +331,7 @@ public function wysiwygAction() $storeMediaUrl = $this->_objectManager->get('Magento\Core\Model\StoreManagerInterface') ->getStore($storeId)->getBaseUrl(\Magento\Core\Model\Store::URL_TYPE_MEDIA); - $content = $this->getLayout()->createBlock( + $content = $this->_view->getLayout()->createBlock( 'Magento\Catalog\Block\Adminhtml\Helper\Form\Wysiwyg\Content', '', array( @@ -340,8 +350,8 @@ public function wysiwygAction() */ public function gridAction() { - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -350,13 +360,13 @@ public function gridAction() public function gridOnlyAction() { $this->_initProduct(); - $this->loadLayout(); + $this->_view->loadLayout(); $block = $this->getRequest()->getParam('gridOnlyBlock'); $blockClassSuffix = str_replace(' ', '_', ucwords(str_replace('_', ' ', $block))); $this->getResponse()->setBody( - $this->getLayout() + $this->_view->getLayout() ->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\\' . $blockClassSuffix) ->toHtml() ); @@ -369,8 +379,8 @@ public function generateVariationsAction() { $this->_saveAttributeOptions(); $this->_initProductSave($this->_initProduct()); - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -429,8 +439,8 @@ protected function _saveAttributeOptions() public function categoriesAction() { $this->_initProduct(); - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -440,8 +450,8 @@ public function categoriesAction() public function optionsAction() { $this->_initProduct(); - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -450,10 +460,10 @@ public function optionsAction() public function relatedAction() { $this->_initProduct(); - $this->loadLayout(); - $this->getLayout()->getBlock('catalog.product.edit.tab.related') + $this->_view->loadLayout(); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.related') ->setProductsRelated($this->getRequest()->getPost('products_related', null)); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -462,10 +472,10 @@ public function relatedAction() public function upsellAction() { $this->_initProduct(); - $this->loadLayout(); - $this->getLayout()->getBlock('catalog.product.edit.tab.upsell') + $this->_view->loadLayout(); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.upsell') ->setProductsUpsell($this->getRequest()->getPost('products_upsell', null)); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -474,10 +484,10 @@ public function upsellAction() public function crosssellAction() { $this->_initProduct(); - $this->loadLayout(); - $this->getLayout()->getBlock('catalog.product.edit.tab.crosssell') + $this->_view->loadLayout(); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.crosssell') ->setProductsCrossSell($this->getRequest()->getPost('products_crosssell', null)); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -486,10 +496,10 @@ public function crosssellAction() public function relatedGridAction() { $this->_initProduct(); - $this->loadLayout(); - $this->getLayout()->getBlock('catalog.product.edit.tab.related') + $this->_view->loadLayout(); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.related') ->setProductsRelated($this->getRequest()->getPost('products_related', null)); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -498,10 +508,10 @@ public function relatedGridAction() public function upsellGridAction() { $this->_initProduct(); - $this->loadLayout(); - $this->getLayout()->getBlock('catalog.product.edit.tab.upsell') + $this->_view->loadLayout(); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.upsell') ->setProductsRelated($this->getRequest()->getPost('products_upsell', null)); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -510,10 +520,10 @@ public function upsellGridAction() public function crosssellGridAction() { $this->_initProduct(); - $this->loadLayout(); - $this->getLayout()->getBlock('catalog.product.edit.tab.crosssell') + $this->_view->loadLayout(); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.crosssell') ->setProductsRelated($this->getRequest()->getPost('products_crosssell', null)); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -522,8 +532,8 @@ public function crosssellGridAction() public function superGroupAction() { $this->_initProduct(); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -532,8 +542,8 @@ public function superGroupAction() public function superGroupPopupAction() { $this->_initProduct(); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -543,11 +553,11 @@ public function superGroupPopupAction() public function reviewsAction() { $this->_initProduct(); - $this->loadLayout(); - $this->getLayout()->getBlock('admin.product.reviews') + $this->_view->loadLayout(); + $this->_view->getLayout()->getBlock('admin.product.reviews') ->setProductId($this->_coreRegistry->registry('product')->getId()) ->setUseAjax(true); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -557,8 +567,8 @@ public function reviewsAction() public function superConfigAction() { $this->_initProduct(); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -596,16 +606,17 @@ public function validateAction() $product->load($productId); } - $dateFields = array(); + $dateFieldFilters = array(); $attributes = $product->getAttributes(); foreach ($attributes as $attrKey => $attribute) { if ($attribute->getBackend()->getType() == 'datetime') { if (array_key_exists($attrKey, $productData) && $productData[$attrKey] != '') { - $dateFields[] = $attrKey; + $dateFieldFilters[$attrKey] = $this->_dateFilter; } } } - $productData = $this->_filterDates($productData, $dateFields); + $inputFilter = new \Zend_Filter_Input($dateFieldFilters, array(), $productData); + $productData = $inputFilter->getUnescaped(); $product->addData($productData); /* set restrictions for date ranges */ @@ -636,9 +647,9 @@ public function validateAction() $response->setMessage($e->getMessage()); } catch (\Exception $e) { $this->_getSession()->addError($e->getMessage()); - $this->_initLayoutMessages('Magento\Adminhtml\Model\Session'); + $this->_view->getLayout()->initMessages('Magento\Adminhtml\Model\Session'); $response->setError(true); - $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml()); + $response->setMessage($this->_view->getLayout()->getMessagesBlock()->getGroupedHtml()); } $this->getResponse()->setBody($response->toJson()); @@ -963,8 +974,8 @@ public function duplicateAction() */ public function alertsPriceGridAction() { - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -972,27 +983,27 @@ public function alertsPriceGridAction() */ public function alertsStockGridAction() { - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } public function addAttributeAction() { - $this->loadLayout('popup'); + $this->_view->loadLayout('popup'); $this->_initProduct(); $this->_addContent( - $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\NewAttribute\Product\Created') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\NewAttribute\Product\Created') ); - $this->renderLayout(); + $this->_view->renderLayout(); } public function createdAction() { - $this->loadLayout('popup'); + $this->_view->loadLayout('popup'); $this->_addContent( - $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Created') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Created') ); - $this->renderLayout(); + $this->_view->renderLayout(); } public function massDeleteAction() @@ -1088,7 +1099,7 @@ public function showUpdateResultAction() if ($session->hasCompositeProductResult() && $session->getCompositeProductResult() instanceof \Magento\Object) { $this->_objectManager->get('Magento\Catalog\Helper\Product\Composite') - ->renderUpdateResult($this, $session->getCompositeProductResult()); + ->renderUpdateResult($session->getCompositeProductResult()); $session->unsCompositeProductResult(); } else { $session->unsCompositeProductResult(); @@ -1101,8 +1112,8 @@ public function showUpdateResultAction() */ public function optionsImportGridAction() { - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -1111,8 +1122,8 @@ public function optionsImportGridAction() public function customOptionsAction() { $this->_coreRegistry->register('import_option_products', $this->getRequest()->getPost('products')); - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -1122,7 +1133,7 @@ public function suggestProductTemplatesAction() { $this->_initProduct(); $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode( - $this->getLayout()->createBlock('Magento\Catalog\Block\Product\TemplateSelector') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Product\TemplateSelector') ->getSuggestedTemplates($this->getRequest()->getParam('label_part')) )); } @@ -1133,7 +1144,7 @@ public function suggestProductTemplatesAction() public function suggestAttributesAction() { $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode( - $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Search') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Search') ->getSuggestedAttributes($this->getRequest()->getParam('label_part')) )); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php index b52ae646b1fea..eb937b0f85486 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php @@ -34,16 +34,30 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product\Action; -class Attribute extends \Magento\Backend\Controller\Adminhtml\Action +use Magento\Backend\App\Action; + +class Attribute extends \Magento\Backend\App\Action { + /** + * @param Action\Context $context + * @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helper + */ + public function __construct( + Action\Context $context, + \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helper + ) { + parent::__construct($context); + $this->_helper = $helper; + } + public function editAction() { if (!$this->_validateProducts()) { return; } - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -73,7 +87,7 @@ public function saveAction() if ($attributesData) { $dateFormat = $this->_objectManager->get('Magento\Core\Model\LocaleInterface') ->getDateFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT); - $storeId = $this->_getHelper()->getSelectedStoreId(); + $storeId = $this->_helper->getSelectedStoreId(); foreach ($attributesData as $attributeCode => $value) { $attribute = $this->_objectManager->get('Magento\Eav\Model\Config') @@ -110,14 +124,14 @@ public function saveAction() } $this->_objectManager->get('Magento\Catalog\Model\Product\Action') - ->updateAttributes($this->_getHelper()->getProductIds(), $attributesData, $storeId); + ->updateAttributes($this->_helper->getProductIds(), $attributesData, $storeId); } if ($inventoryData) { $stockItem = $this->_objectManager->create('Magento\CatalogInventory\Model\Stock\Item'); $stockItem->setProcessIndexEvents(false); $stockItemSaved = false; - foreach ($this->_getHelper()->getProductIds() as $productId) { + foreach ($this->_helper->getProductIds() as $productId) { $stockItem->setData(array()); $stockItem->loadByProduct($productId) ->setProductId($productId); @@ -146,7 +160,7 @@ public function saveAction() if ($websiteAddData || $websiteRemoveData) { /* @var $actionModel \Magento\Catalog\Model\Product\Action */ $actionModel = $this->_objectManager->get('Magento\Catalog\Model\Product\Action'); - $productIds = $this->_getHelper()->getProductIds(); + $productIds = $this->_helper->getProductIds(); if ($websiteRemoveData) { $actionModel->updateWebsites($productIds, $websiteRemoveData, 'remove'); @@ -166,7 +180,7 @@ public function saveAction() } $this->_getSession()->addSuccess( - __('A total of %1 record(s) were updated.', count($this->_getHelper()->getProductIds())) + __('A total of %1 record(s) were updated.', count($this->_helper->getProductIds())) ); } catch (\Magento\Core\Exception $e) { @@ -177,7 +191,7 @@ public function saveAction() ->addException($e, __('Something went wrong while updating the product(s) attributes.')); } - $this->_redirect('catalog/product/', array('store'=>$this->_getHelper()->getSelectedStoreId())); + $this->_redirect('catalog/product/', array('store'=>$this->_helper->getSelectedStoreId())); } /** @@ -188,7 +202,7 @@ public function saveAction() protected function _validateProducts() { $error = false; - $productIds = $this->_getHelper()->getProductIds(); + $productIds = $this->_helper->getProductIds(); if (!is_array($productIds)) { $error = __('Please select products for attributes update.'); } else if (!$this->_objectManager->create('Magento\Catalog\Model\Product')->isProductsHasSku($productIds)) { @@ -203,16 +217,6 @@ protected function _validateProducts() return !$error; } - /** - * Rertive data manipulation helper - * - * @return \Magento\Catalog\Helper\Product\Edit\Action\Attribute - */ - protected function _getHelper() - { - return $this->_objectManager->get('Magento\Catalog\Helper\Product\Edit\Action\Attribute'); - } - protected function _isAllowed() { return $this->_authorization->isAllowed('Magento_Catalog::update_attributes'); @@ -252,9 +256,9 @@ public function validateAction() } catch (\Exception $e) { $this->_getSession() ->addException($e, __('Something went wrong while updating the product(s) attributes.')); - $this->_initLayoutMessages('Magento\Adminhtml\Model\Session'); + $this->_view->getLayout()->initMessages('Magento\Adminhtml\Model\Session'); $response->setError(true); - $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml()); + $response->setMessage($this->_view->getLayout()->getMessagesBlock()->getGroupedHtml()); } $this->getResponse()->setBody($response->toJson()); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index 30bfb070fbaf9..3118f6faf9716 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product; -class Attribute extends \Magento\Backend\Controller\Adminhtml\Action +class Attribute extends \Magento\Backend\App\Action { /** * @var \Magento\Cache\FrontendInterface @@ -49,38 +49,46 @@ class Attribute extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Cache\FrontendInterface $attributeLabelCache * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Cache\FrontendInterface $attributeLabelCache, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; - parent::__construct($context); $this->_attributeLabelCache = $attributeLabelCache; + parent::__construct($context); } - public function preDispatch() + /** + * Dispatch request + * + * @param \Magento\App\RequestInterface $request + * @return $this|mixed + */ + public function dispatch(\Magento\App\RequestInterface $request) { - parent::preDispatch(); $this->_entityTypeId = $this->_objectManager->create('Magento\Eav\Model\Entity') ->setType(\Magento\Catalog\Model\Product::ENTITY) ->getTypeId(); + return parent::dispatch($request); } protected function _initAction() { - $this->_title(__('Product Attributes')); + $this->_title->add(__('Product Attributes')); if ($this->getRequest()->getParam('popup')) { - $this->loadLayout(array('popup', $this->getDefaultLayoutHandle() . '_popup')); - $this->getLayout()->getBlock('root')->addBodyClass('attribute-popup'); + $this->_view->loadLayout( + array('popup', $this->_view->getDefaultLayoutHandle() . '_popup') + ); + $this->_view->getLayout()->getBlock('root')->addBodyClass('attribute-popup'); } else { - $this->loadLayout() - ->_addBreadcrumb( + $this->_view->loadLayout(); + $this->_addBreadcrumb( __('Catalog'), __('Catalog') ) @@ -97,8 +105,10 @@ protected function _initAction() public function indexAction() { $this->_initAction() - ->_addContent($this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute')) - ->renderLayout(); + ->_addContent( + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute') + ); + $this->_view->renderLayout(); } public function newAction() @@ -145,17 +155,17 @@ public function editAction() $this->_initAction(); - $this->_title($id ? $model->getName() : __('New Product Attribute')); + $this->_title->add($id ? $model->getName() : __('New Product Attribute')); $item = $id ? __('Edit Product Attribute') : __('New Product Attribute'); $this->_addBreadcrumb($item, $item); - $this->getLayout()->getBlock('attribute_edit_js') + $this->_view->getLayout()->getBlock('attribute_edit_js') ->setIsPopup((bool)$this->getRequest()->getParam('popup')); - $this->renderLayout(); + $this->_view->renderLayout(); } @@ -198,9 +208,9 @@ public function validateAction() __('Attribute Set with name \'%1\' already exists.', $setName) ); - $this->_initLayoutMessages('Magento\Adminhtml\Model\Session'); + $this->_view->getLayout()->initMessages('Magento\Adminhtml\Model\Session'); $response->setError(true); - $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml()); + $response->setMessage($this->_view->getLayout()->getMessagesBlock()->getGroupedHtml()); } } $this->getResponse()->setBody($response->toJson()); @@ -446,7 +456,7 @@ public function deleteAction() public function suggestConfigurableAttributesAction() { $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode( - $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Configurable\AttributeSelector') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Product\Configurable\AttributeSelector') ->getSuggestedAttributes($this->getRequest()->getParam('label_part')) )); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Datafeeds.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Datafeeds.php index 9044049c7f6bf..00b4876932592 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Datafeeds.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Datafeeds.php @@ -27,7 +27,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; -class Datafeeds extends \Magento\Backend\Controller\Adminhtml\Action +class Datafeeds extends \Magento\Backend\App\Action { public function indexAction() diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php index ea9b0fd8b9298..7123f488ce09a 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product; -class Gallery extends \Magento\Backend\Controller\Adminhtml\Action +class Gallery extends \Magento\Backend\App\Action { public function uploadAction() { diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Group.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Group.php index 4ac83da482947..a31e87935f213 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Group.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Group.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; -class Group extends \Magento\Backend\Controller\Adminhtml\Action +class Group extends \Magento\Backend\App\Action { public function saveAction() { diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php index 42b4be117442c..805a9fc234016 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product; -class Review extends \Magento\Backend\Controller\Adminhtml\Action +class Review extends \Magento\Backend\App\Action { /** * Array of actions which can be processed without secret key validation @@ -46,11 +46,11 @@ class Review extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -59,70 +59,70 @@ public function __construct( public function indexAction() { - $this->_title(__('Customer Reviews')); + $this->_title->add(__('Customer Reviews')); - $this->_title(__('Reviews')); + $this->_title->add(__('Reviews')); if ($this->getRequest()->getParam('ajax')) { return $this->_forward('reviewGrid'); } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Review::catalog_reviews_ratings_reviews_all'); - $this->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Main')); + $this->_addContent($this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Main')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function pendingAction() { - $this->_title(__('Customer Reviews')); + $this->_title->add(__('Customer Reviews')); - $this->_title(__('Pending Reviews')); + $this->_title->add(__('Pending Reviews')); if ($this->getRequest()->getParam('ajax')) { $this->_coreRegistry->register('usePendingFilter', true); return $this->_forward('reviewGrid'); } - $this->loadLayout(); + $this->_view->loadLayout(); $this->_coreRegistry->register('usePendingFilter', true); - $this->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Main')); + $this->_addContent($this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Main')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function editAction() { - $this->_title(__('Customer Reviews')); + $this->_title->add(__('Customer Reviews')); - $this->_title(__('Edit Review')); + $this->_title->add(__('Edit Review')); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Review::catalog_reviews_ratings_reviews_all'); - $this->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Edit')); + $this->_addContent($this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Edit')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function newAction() { - $this->_title(__('Customer Reviews')); + $this->_title->add(__('Customer Reviews')); - $this->_title(__('New Review')); + $this->_title->add(__('New Review')); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Review::catalog_reviews_ratings_reviews_all'); - $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); + $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true); - $this->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Add')); - $this->_addContent($this->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Product\Grid')); + $this->_addContent($this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Add')); + $this->_addContent($this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Product\Grid')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function saveAction() @@ -292,14 +292,14 @@ public function massVisibleInAction() public function productGridAction() { $this->getResponse()->setBody( - $this->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Product\Grid')->toHtml() + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Product\Grid')->toHtml() ); } public function reviewGridAction() { $this->getResponse()->setBody( - $this->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Grid')->toHtml() + $this->_view->getLayout()->createBlock('Magento\Adminhtml\Block\Review\Grid')->toHtml() ); } @@ -379,7 +379,7 @@ public function postAction() public function ratingItemsAction() { $this->getResponse()->setBody( - $this->getLayout() + $this->_view->getLayout() ->createBlock('Magento\Adminhtml\Block\Review\Rating\Detailed') ->setIndependentMode() ->toHtml() diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php index 5049846135668..a84b6d9afc72e 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php @@ -34,7 +34,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; -class Set extends \Magento\Backend\Controller\Adminhtml\Action +class Set extends \Magento\Backend\App\Action { /** * Core registry @@ -44,11 +44,11 @@ class Set extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -57,11 +57,11 @@ public function __construct( public function indexAction() { - $this->_title(__('Product Templates')); + $this->_title->add(__('Product Templates')); $this->_setTypeId(); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Catalog::catalog_attributes_sets'); $this->_addBreadcrumb(__('Catalog'), __('Catalog')); @@ -69,12 +69,12 @@ public function indexAction() __('Manage Attribute Sets'), __('Manage Attribute Sets')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function editAction() { - $this->_title(__('Product Templates')); + $this->_title->add(__('Product Templates')); $this->_setTypeId(); $attributeSet = $this->_objectManager->create('Magento\Eav\Model\Entity\Attribute\Set') @@ -85,13 +85,13 @@ public function editAction() return; } - $this->_title($attributeSet->getId() ? $attributeSet->getAttributeSetName() : __('New Set')); + $this->_title->add($attributeSet->getId() ? $attributeSet->getAttributeSetName() : __('New Set')); $this->_coreRegistry->register('current_attribute_set', $attributeSet); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Catalog::catalog_attributes_sets'); - $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); + $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true); $this->_addBreadcrumb(__('Catalog'), __('Catalog')); $this->_addBreadcrumb( @@ -99,17 +99,17 @@ public function editAction() __('Manage Product Sets')); $this->_addContent( - $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main') ); - $this->renderLayout(); + $this->_view->renderLayout(); } public function setGridAction() { $this->_setTypeId(); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -172,8 +172,8 @@ public function saveAction() if ($isNewSet) { if ($this->getRequest()->getPost('return_session_messages_only')) { - /** @var $block \Magento\Core\Block\Messages */ - $block = $this->_objectManager->get('Magento\Core\Block\Messages'); + /** @var $block \Magento\View\Block\Messages */ + $block = $this->_objectManager->get('Magento\View\Block\Messages'); $block->setMessages($this->_getSession()->getMessages(true)); $body = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(array( 'messages' => $block->getGroupedHtml(), @@ -191,9 +191,9 @@ public function saveAction() } else { $response = array(); if ($hasError) { - $this->_initLayoutMessages('Magento\Adminhtml\Model\Session'); + $this->_view->getLayout()->initMessages('Magento\Adminhtml\Model\Session'); $response['error'] = 1; - $response['message'] = $this->getLayout()->getMessagesBlock()->getGroupedHtml(); + $response['message'] = $this->_view->getLayout()->getMessagesBlock()->getGroupedHtml(); } else { $response['error'] = 0; $response['url'] = $this->getUrl('catalog/*/'); @@ -205,19 +205,19 @@ public function saveAction() public function addAction() { - $this->_title(__('New Product Template')); + $this->_title->add(__('New Product Template')); $this->_setTypeId(); - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_Catalog::catalog_attributes_sets'); $this->_addContent( - $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Add') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Add') ); - $this->renderLayout(); + $this->_view->renderLayout(); } public function deleteAction() @@ -232,7 +232,7 @@ public function deleteAction() $this->getResponse()->setRedirect($this->getUrl('catalog/*/')); } catch (\Exception $e) { $this->_getSession()->addError(__('An error occurred while deleting this set.')); - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Widget.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Widget.php index 06ebd6ffd5842..b843922736335 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Widget.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Widget.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product; -class Widget extends \Magento\Backend\Controller\Adminhtml\Action +class Widget extends \Magento\Backend\App\Action { /** * Chooser Source action @@ -45,7 +45,7 @@ public function chooserAction() $massAction = $this->getRequest()->getParam('use_massaction', false); $productTypeId = $this->getRequest()->getParam('product_type_id', null); - $productsGrid = $this->getLayout()->createBlock( + $productsGrid = $this->_view->getLayout()->createBlock( 'Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser', '', array( @@ -61,7 +61,7 @@ public function chooserAction() $html = $productsGrid->toHtml(); if (!$this->getRequest()->getParam('products_grid')) { - $categoriesTree = $this->getLayout()->createBlock( + $categoriesTree = $this->_view->getLayout()->createBlock( 'Magento\Catalog\Block\Adminhtml\Category\Widget\Chooser', '', array( @@ -73,7 +73,7 @@ public function chooserAction() ) ); - $html = $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser\Container') + $html = $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser\Container') ->setTreeHtml($categoriesTree->toHtml()) ->setGridHtml($html) ->toHtml(); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Search.php b/app/code/Magento/Catalog/Controller/Adminhtml/Search.php index 18954bfc8f221..0ff8a401edb91 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Search.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Search.php @@ -26,7 +26,9 @@ namespace Magento\Catalog\Controller\Adminhtml; -class Search extends \Magento\Backend\Controller\Adminhtml\Action +use Magento\Backend\App\Action; + +class Search extends \Magento\Backend\App\Action { /** * Core registry @@ -36,11 +38,11 @@ class Search extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -49,8 +51,8 @@ public function __construct( protected function _initAction() { - $this->loadLayout() - ->_setActiveMenu('Magento_CatalogSearch::catalog_search') + $this->_view->loadLayout(); + $this->_setActiveMenu('Magento_CatalogSearch::catalog_search') ->_addBreadcrumb(__('Search'), __('Search')) ; return $this; @@ -58,11 +60,11 @@ protected function _initAction() public function indexAction() { - $this->_title(__('Search Terms')); + $this->_title->add(__('Search Terms')); $this->_initAction() ->_addBreadcrumb(__('Catalog'), __('Catalog')); - $this->renderLayout(); + $this->_view->renderLayout(); } public function newAction() @@ -72,7 +74,7 @@ public function newAction() public function editAction() { - $this->_title(__('Search Terms')); + $this->_title->add(__('Search Terms')); $id = $this->getRequest()->getParam('id'); $model = $this->_objectManager->create('Magento\CatalogSearch\Model\Query'); @@ -96,17 +98,17 @@ public function editAction() $this->_initAction(); - $this->_title($id ? $model->getQueryText() : __('New Search')); + $this->_title->add($id ? $model->getQueryText() : __('New Search')); - $this->getLayout()->getBlock('head')->setCanLoadRulesJs(true); + $this->_view->getLayout()->getBlock('head')->setCanLoadRulesJs(true); - $this->getLayout()->getBlock('adminhtml.catalog.search.edit') + $this->_view->getLayout()->getBlock('adminhtml.catalog.search.edit') ->setData('action', $this->getUrl('catalog/search/save')); $this ->_addBreadcrumb($id ? __('Edit Search') : __('New Search'), $id ? __('Edit Search') : __('New Search')); - $this->renderLayout(); + $this->_view->renderLayout(); } /** diff --git a/app/code/Magento/Catalog/Controller/Category.php b/app/code/Magento/Catalog/Controller/Category.php index 5666b5a7879e7..cac91bfe80671 100644 --- a/app/code/Magento/Catalog/Controller/Category.php +++ b/app/code/Magento/Catalog/Controller/Category.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Controller; -class Category extends \Magento\Core\Controller\Front\Action +class Category extends \Magento\App\Action\Action { /** * Core registry @@ -56,13 +56,6 @@ class Category extends \Magento\Core\Controller\Front\Action */ protected $_catalogDesign; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Category factory * @@ -71,25 +64,28 @@ class Category extends \Magento\Core\Controller\Front\Action protected $_categoryFactory; /** - * Construct - * + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + + /** + * @param \Magento\App\Action\Context $context * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Catalog\Model\Session $catalogSession - * @param \Magento\Core\Controller\Varien\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( + \Magento\App\Action\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Design $catalogDesign, \Magento\Catalog\Model\Session $catalogSession, - \Magento\Core\Controller\Varien\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Core\Model\StoreManagerInterface $storeManager ) { - $this->_categoryFactory = $categoryFactory; $this->_storeManager = $storeManager; + $this->_categoryFactory = $categoryFactory; $this->_catalogDesign = $catalogDesign; $this->_catalogSession = $catalogSession; $this->_coreRegistry = $coreRegistry; @@ -150,7 +146,7 @@ public function viewAction() $this->_catalogSession->setLastViewedCategoryId($category->getId()); - $update = $this->getLayout()->getUpdate(); + $update = $this->_view->getLayout()->getUpdate(); $update->addHandle('default'); if ($category->getIsAnchor()) { $type = $category->hasChildren() ? 'layered' : 'layered_without_children'; @@ -161,10 +157,10 @@ public function viewAction() if (!$category->hasChildren()) { // Two levels removed from parent. Need to add default page type. $parentType = strtok($type, '_'); - $this->addPageLayoutHandles(array('type' => $parentType)); + $this->_view->addPageLayoutHandles(array('type' => $parentType)); } - $this->addPageLayoutHandles(array('type' => $type, 'id' => $category->getId())); - $this->loadLayoutUpdates(); + $this->_view->addPageLayoutHandles(array('type' => $type, 'id' => $category->getId())); + $this->_view->loadLayoutUpdates(); // apply custom layout update once layout is loaded $layoutUpdates = $settings->getLayoutUpdates(); @@ -174,23 +170,23 @@ public function viewAction() } } - $this->generateLayoutXml()->generateLayoutBlocks(); + $this->_view->generateLayoutXml(); + $this->_view->generateLayoutBlocks(); // apply custom layout (page) template once the blocks are generated if ($settings->getPageLayout()) { $this->_objectManager->get('Magento\Page\Helper\Layout')->applyTemplate($settings->getPageLayout()); } - $root = $this->getLayout()->getBlock('root'); + $root = $this->_view->getLayout()->getBlock('root'); if ($root) { $root->addBodyClass('categorypath-' . $category->getUrlPath()) ->addBodyClass('category-' . $category->getUrlKey()); } - $this->_initLayoutMessages('Magento\Catalog\Model\Session'); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); - $this->renderLayout(); + $this->_view->getLayout()->initMessages(array('Magento\Catalog\Model\Session', 'Magento\Checkout\Model\Session')); + $this->_view->renderLayout(); } elseif (!$this->getResponse()->isRedirect()) { - $this->_forward('noRoute'); + $this->_forward('noroute'); } } } diff --git a/app/code/Magento/Catalog/Controller/Index.php b/app/code/Magento/Catalog/Controller/Index.php index c73e30f543f94..450d3203e4180 100644 --- a/app/code/Magento/Catalog/Controller/Index.php +++ b/app/code/Magento/Catalog/Controller/Index.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Controller; -class Index extends \Magento\Core\Controller\Front\Action +class Index extends \Magento\App\Action\Action { /** * Index action diff --git a/app/code/Magento/Catalog/Controller/Product.php b/app/code/Magento/Catalog/Controller/Product.php index b28bf4a5513f4..7f36f5cbee482 100644 --- a/app/code/Magento/Catalog/Controller/Product.php +++ b/app/code/Magento/Catalog/Controller/Product.php @@ -27,7 +27,7 @@ namespace Magento\Catalog\Controller; class Product - extends \Magento\Core\Controller\Front\Action + extends \Magento\App\Action\Action implements \Magento\Catalog\Controller\Product\View\ViewInterface { /** @@ -84,11 +84,11 @@ public function viewAction() if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) { $this->_redirect(''); } elseif (!$this->getResponse()->isRedirect()) { - $this->_forward('noRoute'); + $this->_forward('noroute'); } } else { $this->_objectManager->get('Magento\Logger')->logException($e); - $this->_forward('noRoute'); + $this->_forward('noroute'); } } } @@ -102,11 +102,11 @@ public function galleryAction() if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) { $this->_redirect(''); } elseif (!$this->getResponse()->isRedirect()) { - $this->_forward('noRoute'); + $this->_forward('noroute'); } return; } - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } } diff --git a/app/code/Magento/Catalog/Controller/Product/Compare.php b/app/code/Magento/Catalog/Controller/Product/Compare.php index 5350c99109496..3c202c60e6925 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare.php @@ -31,15 +31,8 @@ * * @SuppressWarnings(PHPMD.LongVariable) */ -class Compare extends \Magento\Core\Controller\Front\Action +class Compare extends \Magento\App\Action\Action { - /** - * Action list where need check enabled cookie - * - * @var array - */ - protected $_cookieCheckActions = array('add'); - /** * Customer id * @@ -75,13 +68,6 @@ class Compare extends \Magento\Core\Controller\Front\Action */ protected $_customerSession; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Item collection factory * @@ -111,36 +97,39 @@ class Compare extends \Magento\Core\Controller\Front\Action protected $_customerFactory; /** - * Construct - * + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + + /** + * @param \Magento\App\Action\Context $context * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList * @param \Magento\Catalog\Model\Session $catalogSession - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( + \Magento\App\Action\Context $context, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, \Magento\Log\Model\Visitor $logVisitor, \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList, \Magento\Catalog\Model\Session $catalogSession, - \Magento\Core\Controller\Varien\Action\Context $context + \Magento\Core\Model\StoreManagerInterface $storeManager ) { + $this->_storeManager = $storeManager; $this->_customerFactory = $customerFactory; $this->_compareItemFactory = $compareItemFactory; $this->_productFactory = $productFactory; $this->_itemCollectionFactory = $itemCollectionFactory; - $this->_storeManager = $storeManager; $this->_customerSession = $customerSession; $this->_logVisitor = $logVisitor; $this->_catalogProductCompareList = $catalogProductCompareList; @@ -170,8 +159,8 @@ public function indexAction() return; } - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } /** @@ -200,8 +189,7 @@ public function addAction() $this->_objectManager->get('Magento\Catalog\Helper\Product\Compare')->calculate(); } - - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl()); } /** @@ -245,7 +233,7 @@ public function removeAction() } if (!$this->getRequest()->getParam('isAjax', false)) { - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl()); } } @@ -275,7 +263,7 @@ public function clearAction() $this->_catalogSession->addException($e, __('Something went wrong clearing the comparison list.')); } - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl()); } /** diff --git a/app/code/Magento/Catalog/Controller/Product/View/ViewInterface.php b/app/code/Magento/Catalog/Controller/Product/View/ViewInterface.php index d56a5802a323d..eaa21b89ebac3 100644 --- a/app/code/Magento/Catalog/Controller/Product/View/ViewInterface.php +++ b/app/code/Magento/Catalog/Controller/Product/View/ViewInterface.php @@ -25,17 +25,8 @@ */ /** - * Interface needed to be implemented by controller that wants to - * show product view page + * Marker interface for controllers on product view page */ namespace Magento\Catalog\Controller\Product\View; -interface ViewInterface -{ - /** - * Loads layout messages from message storage - * - * @param string $messagesStorage - */ - public function initLayoutMessages($messagesStorage); -} +interface ViewInterface{} diff --git a/app/code/Magento/Catalog/Helper/Catalog.php b/app/code/Magento/Catalog/Helper/Catalog.php index 81ff721c7f953..0ccce4bf22d54 100644 --- a/app/code/Magento/Catalog/Helper/Catalog.php +++ b/app/code/Magento/Catalog/Helper/Catalog.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Helper; -class Catalog extends \Magento\Core\Helper\AbstractHelper +class Catalog extends \Magento\App\Helper\AbstractHelper { /** * Config path to valid file paths @@ -68,12 +68,12 @@ class Catalog extends \Magento\Core\Helper\AbstractHelper /** * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig */ public function __construct( \Magento\Core\Helper\Data $coreData, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig ) { $this->_coreStoreConfig = $coreStoreConfig; diff --git a/app/code/Magento/Catalog/Helper/Category.php b/app/code/Magento/Catalog/Helper/Category.php index 463bd3d3888c2..d416c2459e2df 100644 --- a/app/code/Magento/Catalog/Helper/Category.php +++ b/app/code/Magento/Catalog/Helper/Category.php @@ -31,7 +31,7 @@ * * @SuppressWarnings(PHPMD.LongVariable) */ -class Category extends \Magento\Core\Helper\AbstractHelper +class Category extends \Magento\App\Helper\AbstractHelper { const XML_PATH_CATEGORY_URL_SUFFIX = 'catalog/seo/category_url_suffix'; const XML_PATH_USE_CATEGORY_CANONICAL_TAG = 'catalog/seo/category_canonical_tag'; @@ -84,14 +84,14 @@ class Category extends \Magento\Core\Helper\AbstractHelper * * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Data\CollectionFactory $dataCollectionFactory */ public function __construct( \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Data\CollectionFactory $dataCollectionFactory ) { diff --git a/app/code/Magento/Catalog/Helper/Category/Flat.php b/app/code/Magento/Catalog/Helper/Category/Flat.php index 07b776abe6091..d73c9ec0d2095 100644 --- a/app/code/Magento/Catalog/Helper/Category/Flat.php +++ b/app/code/Magento/Catalog/Helper/Category/Flat.php @@ -78,13 +78,13 @@ class Flat extends \Magento\Catalog\Helper\Flat\AbstractFlat * * @param \Magento\Index\Model\ProcessFactory $processFactory * @param \Magento\Catalog\Model\Resource\Category\Flat $catalogCategoryFlat - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig */ public function __construct( \Magento\Index\Model\ProcessFactory $processFactory, \Magento\Catalog\Model\Resource\Category\Flat $catalogCategoryFlat, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig ) { $this->_catalogCategoryFlat = $catalogCategoryFlat; diff --git a/app/code/Magento/Catalog/Helper/Data.php b/app/code/Magento/Catalog/Helper/Data.php index 1184ad2eb566f..50238607c49e1 100644 --- a/app/code/Magento/Catalog/Helper/Data.php +++ b/app/code/Magento/Catalog/Helper/Data.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { const PRICE_SCOPE_GLOBAL = 0; const PRICE_SCOPE_WEBSITE = 1; @@ -164,7 +164,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper * @param \Magento\Stdlib\String $string * @param \Magento\Catalog\Helper\Category $catalogCategory * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory @@ -180,7 +180,7 @@ public function __construct( \Magento\Stdlib\String $string, \Magento\Catalog\Helper\Category $catalogCategory, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Registry $coreRegistry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory, diff --git a/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php b/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php index accbcd03852b0..a1256ab513cd4 100644 --- a/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php +++ b/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Helper\Flat; -abstract class AbstractFlat extends \Magento\Core\Helper\AbstractHelper +abstract class AbstractFlat extends \Magento\App\Helper\AbstractHelper { /** * Catalog Flat index process code @@ -76,11 +76,11 @@ abstract public function isEnabled($deprecatedParam = false); * Construct * * @param \Magento\Index\Model\ProcessFactory $processFactory - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context */ public function __construct( \Magento\Index\Model\ProcessFactory $processFactory, - \Magento\Core\Helper\Context $context + \Magento\App\Helper\Context $context ) { $this->_processFactory = $processFactory; parent::__construct($context); diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index d11173db0b1a7..2e2813525e465 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -31,7 +31,7 @@ */ namespace Magento\Catalog\Helper; -class Image extends \Magento\Core\Helper\AbstractHelper +class Image extends \Magento\App\Helper\AbstractHelper { /** * Current model @@ -133,13 +133,13 @@ class Image extends \Magento\Core\Helper\AbstractHelper * Construct * * @param \Magento\Catalog\Model\Product\ImageFactory $productImageFactory - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @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\App\Helper\Context $context, \Magento\View\Url $viewUrl, \Magento\Core\Model\Store\Config $coreStoreConfig ) { diff --git a/app/code/Magento/Catalog/Helper/Output.php b/app/code/Magento/Catalog/Helper/Output.php index 5aa52bcf820ff..dd1d38c31c8b5 100644 --- a/app/code/Magento/Catalog/Helper/Output.php +++ b/app/code/Magento/Catalog/Helper/Output.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Helper; -class Output extends \Magento\Core\Helper\AbstractHelper +class Output extends \Magento\App\Helper\AbstractHelper { /** * Array of existing handlers @@ -66,13 +66,13 @@ class Output extends \Magento\Core\Helper\AbstractHelper * * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Escaper $escaper */ public function __construct( \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Escaper $escaper ) { $this->_eavConfig = $eavConfig; diff --git a/app/code/Magento/Catalog/Helper/Product.php b/app/code/Magento/Catalog/Helper/Product.php index 4c183bbff418a..ebbd9c1293740 100644 --- a/app/code/Magento/Catalog/Helper/Product.php +++ b/app/code/Magento/Catalog/Helper/Product.php @@ -64,13 +64,6 @@ class Product extends \Magento\Core\Helper\Url */ protected $_viewUrl; - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * Core registry * @@ -127,21 +120,18 @@ class Product extends \Magento\Core\Helper\Url protected $_categoryFactory; /** - * Construct - * * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Session $catalogSession - * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @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 * @param \Magento\Core\Model\Config $coreConfig - * @param string $typeSwitcherLabel - * + * @param $typeSwitcherLabel + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -149,8 +139,7 @@ public function __construct( \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Session $catalogSession, - \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\View\Url $viewUrl, \Magento\Core\Model\Registry $coreRegistry, \Magento\Catalog\Model\Attribute\Config $attributeConfig, @@ -164,7 +153,6 @@ public function __construct( $this->_typeSwitcherLabel = $typeSwitcherLabel; $this->_attributeConfig = $attributeConfig; $this->_coreRegistry = $coreRegistry; - $this->_eventManager = $eventManager; $this->_coreRegistry = $coreRegistry; $this->_coreStoreConfig = $coreStoreConfig; $this->_viewUrl = $viewUrl; @@ -408,7 +396,7 @@ public function getAttributeSourceModelByInputType($inputType) * If empty (except FALSE) - will be guessed (e.g. from last visited) to load as current. * * @param int $productId - * @param \Magento\Core\Controller\Front\Action $controller + * @param \Magento\App\Action\Action $controller * @param \Magento\Object $params * * @return false|\Magento\Catalog\Model\Product diff --git a/app/code/Magento/Catalog/Helper/Product/Compare.php b/app/code/Magento/Catalog/Helper/Product/Compare.php index f7573eb245b81..a11835d619bd0 100644 --- a/app/code/Magento/Catalog/Helper/Product/Compare.php +++ b/app/code/Magento/Catalog/Helper/Product/Compare.php @@ -105,7 +105,7 @@ class Compare extends \Magento\Core\Helper\Url * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\Session $catalogSession - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context */ public function __construct( \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, @@ -114,7 +114,7 @@ public function __construct( \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\Session $catalogSession, - \Magento\Core\Helper\Context $context + \Magento\App\Helper\Context $context ) { $this->_itemCollectionFactory = $itemCollectionFactory; $this->_catalogProductVisibility = $catalogProductVisibility; @@ -138,7 +138,7 @@ public function getListUrl() $params = array( 'items'=>implode(',', $itemIds), - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() ); return $this->_getUrl('catalog/product_compare', $params); @@ -154,7 +154,7 @@ protected function _getUrlParams($product) { return array( 'product' => $product->getId(), - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() ); } @@ -181,7 +181,7 @@ public function getAddToWishlistUrl($product) $params = array( 'product'=>$product->getId(), - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) ); return $this->_getUrl('wishlist/index/add', $params); @@ -198,7 +198,7 @@ public function getAddToCartUrl($product) $beforeCompareUrl = $this->_catalogSession->getBeforeCompareUrl(); $params = array( 'product'=>$product->getId(), - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) ); return $this->_getUrl('checkout/cart/add', $params); @@ -214,7 +214,7 @@ public function getRemoveUrl($item) { $params = array( 'product'=>$item->getId(), - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() ); return $this->_getUrl('catalog/product_compare/remove', $params); } @@ -227,7 +227,7 @@ public function getRemoveUrl($item) public function getClearListUrl() { $params = array( - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() ); return $this->_getUrl('catalog/product_compare/clear', $params); } diff --git a/app/code/Magento/Catalog/Helper/Product/Composite.php b/app/code/Magento/Catalog/Helper/Product/Composite.php index aa1eb73efe70f..bbafd2addca62 100644 --- a/app/code/Magento/Catalog/Helper/Product/Composite.php +++ b/app/code/Magento/Catalog/Helper/Product/Composite.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Helper\Product; -class Composite extends \Magento\Core\Helper\AbstractHelper +class Composite extends \Magento\App\Helper\AbstractHelper { /** * Core registry @@ -50,7 +50,7 @@ class Composite extends \Magento\Core\Helper\AbstractHelper protected $_catalogProduct = null; /** - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -64,41 +64,49 @@ class Composite extends \Magento\Core\Helper\AbstractHelper */ protected $_customerFactory; + /** + * @var \Magento\App\ViewInterface + */ + protected $_view; + /** * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\App\ViewInterface $view */ public function __construct( \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Helper\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\App\Helper\Context $context, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\App\ViewInterface $view ) { $this->_customerFactory = $customerFactory; $this->_productFactory = $productFactory; $this->_storeManager = $storeManager; $this->_coreRegistry = $coreRegistry; $this->_catalogProduct = $catalogProduct; + $this->_view = $view; parent::__construct($context); } /** * Init layout of product configuration update result * - * @param \Magento\Backend\Controller\Adminhtml\Action $controller * @return \Magento\Catalog\Helper\Product\Composite */ - protected function _initUpdateResultLayout($controller) + protected function _initUpdateResultLayout() { - $controller->getLayout()->getUpdate() - ->addHandle('CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT'); - $controller->loadLayoutUpdates()->generateLayoutXml()->generateLayoutBlocks(); + $this->_view->getLayout()->getUpdate()->addHandle('CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT'); + $this->_view->loadLayoutUpdates(); + $this->_view->generateLayoutXml(); + $this->_view->generateLayoutBlocks(); return $this; } @@ -106,16 +114,15 @@ protected function _initUpdateResultLayout($controller) * Prepares and render result of composite product configuration update for a case * when single configuration submitted * - * @param \Magento\Backend\Controller\Adminhtml\Action $controller * @param \Magento\Object $updateResult * @return \Magento\Catalog\Helper\Product\Composite */ - public function renderUpdateResult($controller, \Magento\Object $updateResult) + public function renderUpdateResult(\Magento\Object $updateResult) { $this->_coreRegistry->register('composite_update_result', $updateResult); - $this->_initUpdateResultLayout($controller); - $controller->renderLayout(); + $this->_initUpdateResultLayout(); + $this->_view->renderLayout(); } /** @@ -124,21 +131,22 @@ public function renderUpdateResult($controller, \Magento\Object $updateResult) * $isOk - true or false, whether action was completed nicely or with some error * If $isOk is FALSE (some error during configuration), so $productType must be null * - * @param \Magento\Backend\Controller\Adminhtml\Action $controller * @param bool $isOk * @param string $productType * @return \Magento\Catalog\Helper\Product\Composite */ - protected function _initConfigureResultLayout($controller, $isOk, $productType) + protected function _initConfigureResultLayout($isOk, $productType) { - $update = $controller->getLayout()->getUpdate(); + $update = $this->_view->getLayout()->getUpdate(); if ($isOk) { $update->addHandle('CATALOG_PRODUCT_COMPOSITE_CONFIGURE') ->addHandle('catalog_product_view_type_' . $productType); } else { $update->addHandle('CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR'); } - $controller->loadLayoutUpdates()->generateLayoutXml()->generateLayoutBlocks(); + $this->_view->loadLayoutUpdates(); + $this->_view->generateLayoutXml(); + $this->_view->generateLayoutBlocks(); return $this; } @@ -149,11 +157,10 @@ protected function _initConfigureResultLayout($controller, $isOk, $productType) * - 'ok' = true, and 'product_id', 'buy_request', 'current_store_id', 'current_customer' or 'current_customer_id' * - 'error' = true, and 'message' to show * - * @param \Magento\Backend\Controller\Adminhtml\Action $controller * @param \Magento\Object $configureResult * @return \Magento\Catalog\Helper\Product\Composite */ - public function renderConfigureResult($controller, \Magento\Object $configureResult) + public function renderConfigureResult(\Magento\Object $configureResult) { try { if (!$configureResult->getOk()) { @@ -200,7 +207,7 @@ public function renderConfigureResult($controller, \Magento\Object $configureRes $this->_coreRegistry->register('composite_configure_result_error_message', $e->getMessage()); } - $this->_initConfigureResultLayout($controller, $isOk, $productType); - $controller->renderLayout(); + $this->_initConfigureResultLayout($isOk, $productType); + $this->_view->renderLayout(); } } diff --git a/app/code/Magento/Catalog/Helper/Product/Configuration.php b/app/code/Magento/Catalog/Helper/Product/Configuration.php index 07bf007fbddb1..3a413ce38f5a0 100644 --- a/app/code/Magento/Catalog/Helper/Product/Configuration.php +++ b/app/code/Magento/Catalog/Helper/Product/Configuration.php @@ -31,7 +31,7 @@ * * @SuppressWarnings(PHPMD.LongVariable) */ -class Configuration extends \Magento\Core\Helper\AbstractHelper +class Configuration extends \Magento\App\Helper\AbstractHelper implements \Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface { /** @@ -64,14 +64,14 @@ class Configuration extends \Magento\Core\Helper\AbstractHelper /** * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Filter\FilterManager $filter - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config * @param \Magento\Stdlib\String $string */ public function __construct( \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Filter\FilterManager $filter, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Catalog\Model\ProductTypes\ConfigInterface $config, \Magento\Stdlib\String $string ) { diff --git a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php index c6bcb4f01a9e0..c7f2c748d53c0 100644 --- a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php +++ b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php @@ -68,7 +68,7 @@ class Attribute extends \Magento\Backend\Helper\Data protected $_eavConfig; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\App\Route\Config $routeConfig * @param \Magento\Core\Model\AppInterface $app * @param \Magento\Backend\Model\Url $backendUrl @@ -80,7 +80,7 @@ class Attribute extends \Magento\Backend\Helper\Data * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productsFactory */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\App\Route\Config $routeConfig, \Magento\Core\Model\AppInterface $app, \Magento\Backend\Model\Url $backendUrl, diff --git a/app/code/Magento/Catalog/Helper/Product/Flat.php b/app/code/Magento/Catalog/Helper/Product/Flat.php index 43b6888ecc11c..41317bc6a3267 100644 --- a/app/code/Magento/Catalog/Helper/Product/Flat.php +++ b/app/code/Magento/Catalog/Helper/Product/Flat.php @@ -96,7 +96,7 @@ class Flat extends \Magento\Catalog\Helper\Flat\AbstractFlat * Construct * * @param \Magento\Index\Model\ProcessFactory $processFactory - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Product\Flat\Flag $flatFlag * @param $addFilterableAttrs @@ -104,7 +104,7 @@ class Flat extends \Magento\Catalog\Helper\Flat\AbstractFlat */ public function __construct( \Magento\Index\Model\ProcessFactory $processFactory, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Product\Flat\Flag $flatFlag, $addFilterableAttrs, diff --git a/app/code/Magento/Catalog/Helper/Product/Options.php b/app/code/Magento/Catalog/Helper/Product/Options.php index 40291d5012ca5..0520e2ebe7203 100644 --- a/app/code/Magento/Catalog/Helper/Product/Options.php +++ b/app/code/Magento/Catalog/Helper/Product/Options.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Helper\Product; -class Options extends \Magento\Core\Helper\AbstractHelper +class Options extends \Magento\App\Helper\AbstractHelper { /** * @var \Magento\Filesystem @@ -42,10 +42,10 @@ class Options extends \Magento\Core\Helper\AbstractHelper protected $_filesystem; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Filesystem $filesystem */ - public function __construct(\Magento\Core\Helper\Context $context, \Magento\Filesystem $filesystem) + public function __construct(\Magento\App\Helper\Context $context, \Magento\Filesystem $filesystem) { parent::__construct($context); $this->_filesystem = $filesystem; diff --git a/app/code/Magento/Catalog/Helper/Product/Url.php b/app/code/Magento/Catalog/Helper/Product/Url.php index ed198dc39e86a..ff31c375d0a88 100644 --- a/app/code/Magento/Catalog/Helper/Product/Url.php +++ b/app/code/Magento/Catalog/Helper/Product/Url.php @@ -100,14 +100,14 @@ class Url extends \Magento\Core\Helper\Url /** * Check additional instruction for convertation table in configuration * - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Config $config - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Config $config, - \Magento\Core\Model\StoreManager $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager ) { parent::__construct($context, $storeManager); $convertConfig = $config->getValue('url/convert', 'default'); diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index 3e86645fd98ae..65b796af3e249 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Helper\Product; -class View extends \Magento\Core\Helper\AbstractHelper +class View extends \Magento\App\Helper\AbstractHelper { // List of exceptions throwable during prepareAndRender() method public $ERR_NO_PRODUCT_LOADED = 1; @@ -67,13 +67,6 @@ class View extends \Magento\Core\Helper\AbstractHelper */ protected $_pageLayout = null; - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * Catalog design * @@ -89,33 +82,36 @@ class View extends \Magento\Core\Helper\AbstractHelper protected $_catalogSession; /** - * Construct - * + * @var \Magento\App\ViewInterface + */ + protected $_view; + + /** * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Catalog\Model\Design $catalogDesign - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Page\Helper\Layout $pageLayout - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\App\ViewInterface $view * @param array $messageModels */ public function __construct( \Magento\Catalog\Model\Session $catalogSession, \Magento\Catalog\Model\Design $catalogDesign, - \Magento\Event\ManagerInterface $eventManager, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Page\Helper\Layout $pageLayout, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Registry $coreRegistry, + \Magento\App\ViewInterface $view, array $messageModels = array() ) { $this->_catalogSession = $catalogSession; $this->_catalogDesign = $catalogDesign; - $this->_eventManager = $eventManager; $this->_catalogProduct = $catalogProduct; $this->_pageLayout = $pageLayout; $this->_coreRegistry = $coreRegistry; + $this->_view = $view; parent::__construct($context); $this->_messageModels = $messageModels; } @@ -124,7 +120,7 @@ public function __construct( * Inits layout for viewing product page * * @param \Magento\Catalog\Model\Product $product - * @param \Magento\Core\Controller\Front\Action $controller + * @param \Magento\App\Action\Action $controller * * @return \Magento\Catalog\Helper\Product\View */ @@ -136,12 +132,12 @@ public function initProductLayout($product, $controller) $this->_catalogDesign->applyCustomDesign($settings->getCustomDesign()); } - $update = $controller->getLayout()->getUpdate(); + $update = $this->_view->getLayout()->getUpdate(); $update->addHandle('default'); - $controller->addPageLayoutHandles( + $this->_view->addPageLayoutHandles( array('id' => $product->getId(), 'sku' => $product->getSku(), 'type' => $product->getTypeId()) ); - $controller->loadLayoutUpdates(); + $this->_view->loadLayoutUpdates(); // Apply custom layout update once layout is loaded $layoutUpdates = $settings->getLayoutUpdates(); if ($layoutUpdates) { @@ -152,7 +148,8 @@ public function initProductLayout($product, $controller) } } - $controller->generateLayoutXml()->generateLayoutBlocks(); + $this->_view->generateLayoutXml(); + $this->_view->generateLayoutBlocks(); // Apply custom layout (page) template once the blocks are generated if ($settings->getPageLayout()) { @@ -160,9 +157,9 @@ public function initProductLayout($product, $controller) } $currentCategory = $this->_coreRegistry->registry('current_category'); - $root = $controller->getLayout()->getBlock('root'); + $root = $this->_view->getLayout()->getBlock('root'); if ($root) { - $controllerClass = $controller->getFullActionName(); + $controllerClass = $this->_request->getFullActionName(); if ($controllerClass != 'catalog-product-view') { $root->addBodyClass('catalog-product-view'); } @@ -186,7 +183,7 @@ public function initProductLayout($product, $controller) * - 'configure_mode' - boolean, whether we're in Configure-mode to edit product configuration * * @param int $productId - * @param \Magento\Core\Controller\Front\Action $controller + * @param \Magento\App\Action\Action $controller * @param null|\Magento\Object $params * * @return \Magento\Catalog\Helper\Product\View @@ -200,7 +197,7 @@ public function prepareAndRender($productId, $controller, $params = null) $params = new \Magento\Object(); } - // Standard algorithm to prepare and rendern product view page + // Standard algorithm to prepare and render product view page $product = $productHelper->initProduct($productId, $controller, $params); if (!$product) { throw new \Magento\Core\Exception(__('Product is not loaded'), $this->ERR_NO_PRODUCT_LOADED); @@ -228,7 +225,7 @@ public function prepareAndRender($productId, $controller, $params = null) if ($controller instanceof \Magento\Catalog\Controller\Product\View\ViewInterface) { foreach ($this->_messageModels as $sessionModel) { - $controller->initLayoutMessages($sessionModel); + $this->_view->getLayout()->initMessages($sessionModel); } } else { throw new \Magento\Core\Exception( @@ -236,7 +233,7 @@ public function prepareAndRender($productId, $controller, $params = null) $this->ERR_BAD_CONTROLLER_INTERFACE ); } - $controller->renderLayout(); + $this->_view->renderLayout(); return $this; } diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index bda04ca32e754..ee6c2ed06743d 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -125,13 +125,6 @@ class Category extends \Magento\Catalog\Model\AbstractModel */ protected $filter; - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * Index indexer * @@ -194,7 +187,6 @@ class Category extends \Magento\Catalog\Model\AbstractModel * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Index\Model\Indexer $indexIndexer - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat * @param \Magento\Core\Model\Context $context @@ -217,7 +209,6 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Index\Model\Indexer $indexIndexer, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat, \Magento\Core\Model\Context $context, @@ -235,7 +226,6 @@ public function __construct( $this->_productCollectionFactory = $productCollectionFactory; $this->_catalogConfig = $catalogConfig; $this->_indexIndexer = $indexIndexer; - $this->_eventManager = $eventManager; $this->filter = $filter; $this->_catalogCategoryFlat = $catalogCategoryFlat; $this->_treeModel = $categoryTreeResource; diff --git a/app/code/Magento/Catalog/Model/Config/Backend/Category.php b/app/code/Magento/Catalog/Model/Config/Backend/Category.php index 3ec920d9e61a5..b8e4d570b9cc1 100644 --- a/app/code/Magento/Catalog/Model/Config/Backend/Category.php +++ b/app/code/Magento/Catalog/Model/Config/Backend/Category.php @@ -48,7 +48,7 @@ class Category extends \Magento\Core\Model\Config\Value * @param \Magento\Catalog\Model\Category $catalogCategory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -58,7 +58,7 @@ public function __construct( \Magento\Catalog\Model\Category $catalogCategory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php index f7011d4cea7ba..0c1572225bfc1 100644 --- a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php +++ b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php @@ -54,7 +54,7 @@ class Image extends \Magento\Core\Model\Config\Value * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -65,7 +65,7 @@ public function __construct( \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Entity/Attribute.php b/app/code/Magento/Catalog/Model/Entity/Attribute.php index 3cd8024135f02..76a29cbdfe9cd 100644 --- a/app/code/Magento/Catalog/Model/Entity/Attribute.php +++ b/app/code/Magento/Catalog/Model/Entity/Attribute.php @@ -86,7 +86,7 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\LocaleInterface $locale @@ -101,7 +101,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Category.php b/app/code/Magento/Catalog/Model/Layer/Filter/Category.php index 52930b3b25c63..c900032becbb8 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Category.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Category.php @@ -121,7 +121,7 @@ public function getResetValue() * Apply category filter to layer * * @param \Zend_Controller_Request_Abstract $request - * @param \Magento\Core\Block\AbstractBlock $filterBlock + * @param \Magento\View\Block\AbstractBlock $filterBlock * @return \Magento\Catalog\Model\Layer\Filter\Category */ public function apply(\Zend_Controller_Request_Abstract $request, $filterBlock) diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 16ba34b0e779e..de01c1491b720 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -32,7 +32,6 @@ * @method \Magento\Catalog\Model\Product setHasError(bool $value) * @method null|bool getHasError() * @method \Magento\Catalog\Model\Product setTypeId(string $typeId) - * @method string \Magento\Catalog\Model\Product getTypeId() * @method \Magento\Catalog\Model\Product setAssociatedProductIds(array $productIds) * @method array getAssociatedProductIds() * @method \Magento\Catalog\Model\Product setNewVariationsAttributeSetId(int $value) @@ -138,13 +137,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel */ protected $_catalogImage = null; - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * @var \Magento\Data\CollectionFactory */ @@ -229,7 +221,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel * @param \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Catalog\Model\Product\Type $catalogProductType - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Helper\Image $catalogImage * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Helper\Product $catalogProduct @@ -256,7 +247,6 @@ public function __construct( \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig, \Magento\Index\Model\Indexer $indexIndexer, \Magento\Catalog\Model\Product\Type $catalogProductType, - \Magento\Event\ManagerInterface $eventManager, \Magento\Catalog\Helper\Image $catalogImage, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Helper\Product $catalogProduct, @@ -277,7 +267,6 @@ public function __construct( $this->_catalogProductMediaConfig = $catalogProductMediaConfig; $this->_indexIndexer = $indexIndexer; $this->_catalogProductType = $catalogProductType; - $this->_eventManager = $eventManager; $this->_catalogImage = $catalogImage; $this->_catalogData = $catalogData; $this->_catalogProduct = $catalogProduct; @@ -356,9 +345,9 @@ public function getName() } /** - * Get product price throught type instance + * Get product price through type instance * - * @return unknown + * @return float */ public function getPrice() { @@ -441,7 +430,7 @@ public function getLinkInstance() } /** - * Retrive product id by sku + * Retrieve product id by sku * * @param string $sku * @return integer @@ -670,7 +659,7 @@ protected function _afterSave() } /** - * Clear chache related with product and protect delete from not admin + * Clear cache related with product and protect delete from not admin * Register indexing event before delete product * * @return \Magento\Catalog\Model\Product @@ -877,7 +866,7 @@ public function getSpecialToDate() ** Linked products API */ /** - * Retrieve array of related roducts + * Retrieve array of related products * * @return array */ @@ -1089,7 +1078,7 @@ public function getGroupedLinkCollection() ** Media API */ /** - * Retrive attributes for media gallery + * Retrieve attributes for media gallery * * @return array */ @@ -1108,7 +1097,7 @@ public function getMediaAttributes() } /** - * Retrive media gallery images + * Retrieve media gallery images * * @return \Magento\Data\Collection */ @@ -1154,7 +1143,7 @@ public function addImageToMediaGallery($file, $mediaAttribute=null, $move=false, } /** - * Retrive product media config + * Retrieve product media config * * @return \Magento\Catalog\Model\Product\Media\Config */ @@ -1335,7 +1324,7 @@ public function getVisibleStatuses() } /** - * Check Product visilbe in catalog + * Check Product visible in catalog * * @return bool */ @@ -1685,9 +1674,9 @@ public function getSku() } /** - * Retrieve weight throught type instance + * Retrieve weight through type instance * - * @return unknown + * @return float */ public function getWeight() { @@ -1942,7 +1931,7 @@ public function reset() } /** - * Get cahce tags associated with object id + * Get cache tags associated with object id * * @return array */ diff --git a/app/code/Magento/Catalog/Model/Product/Action.php b/app/code/Magento/Catalog/Model/Product/Action.php index 87243c33104a2..b8422eb2678b2 100644 --- a/app/code/Magento/Catalog/Model/Product/Action.php +++ b/app/code/Magento/Catalog/Model/Product/Action.php @@ -36,13 +36,6 @@ class Action extends \Magento\Core\Model\AbstractModel { - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * Index indexer * @@ -62,7 +55,6 @@ class Action extends \Magento\Core\Model\AbstractModel * * @param \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory * @param \Magento\Index\Model\Indexer $indexIndexer - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -72,7 +64,6 @@ class Action extends \Magento\Core\Model\AbstractModel public function __construct( \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory, \Magento\Index\Model\Indexer $indexIndexer, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, @@ -81,7 +72,6 @@ public function __construct( ) { $this->_productWebsiteFactory = $productWebsiteFactory; $this->_indexIndexer = $indexIndexer; - $this->_eventManager = $eventManager; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } diff --git a/app/code/Magento/Catalog/Model/Product/Status.php b/app/code/Magento/Catalog/Model/Product/Status.php index eeb654e054ca3..0ff9a0683d74f 100644 --- a/app/code/Magento/Catalog/Model/Product/Status.php +++ b/app/code/Magento/Catalog/Model/Product/Status.php @@ -54,13 +54,6 @@ class Status extends \Magento\Core\Model\AbstractModel */ protected $_attribute; - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * Catalog product action * @@ -80,7 +73,6 @@ class Status extends \Magento\Core\Model\AbstractModel * * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\Action $catalogProductAction - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -90,7 +82,6 @@ class Status extends \Magento\Core\Model\AbstractModel public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Action $catalogProductAction, - \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, @@ -99,7 +90,6 @@ public function __construct( ) { $this->_storeManager = $storeManager; $this->_catalogProductAction = $catalogProductAction; - $this->_eventManager = $eventManager; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } diff --git a/app/code/Magento/Catalog/Model/Product/Type/Configurable.php b/app/code/Magento/Catalog/Model/Product/Type/Configurable.php index 2cdec88051be0..fc53f62519a62 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Configurable.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Configurable.php @@ -98,7 +98,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType /** * Store manager * - * @var \Magento\Core\Model\StoreManager + * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -177,7 +177,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\Product\CollectionFactory $productCollectionFactory * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable $catalogProductTypeConfigurable - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb @@ -201,7 +201,7 @@ public function __construct( \Magento\Catalog\Model\Resource\Product\Type\Configurable\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Resource\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Catalog\Model\Resource\Product\Type\Configurable $catalogProductTypeConfigurable, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, diff --git a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php index 7dd01c133ec54..4f6f16c47a79b 100644 --- a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php +++ b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php @@ -59,7 +59,7 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $coreResource + * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory @@ -71,14 +71,14 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $coreResource, + \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $coreResource, + parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, $eavEntityFactory, $resourceHelper, $universalFactory); } diff --git a/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php index 25cb201040928..a04381db6b43e 100644 --- a/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php @@ -116,7 +116,7 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\LocaleInterface $locale @@ -132,7 +132,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\LocaleInterface $locale, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php index 6142b9caac26e..e36de785d713c 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php @@ -270,7 +270,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $coreResource + * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -292,7 +292,7 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $coreResource, + \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -315,7 +315,7 @@ public function __construct( $this->_customerSession = $customerSession; $this->_resourceHelper = $resourceHelper; $this->dateTime = $dateTime; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $coreResource, + parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, $eavEntityFactory, $resourceHelper, $universalFactory, $storeManager); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php b/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php index ab01778c8391e..f6d3abd98be66 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php @@ -62,7 +62,7 @@ class AssociatedProduct * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $coreResource + * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -86,7 +86,7 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $coreResource, + \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -106,7 +106,7 @@ public function __construct( $this->_registryManager = $registryManager; $this->_productType = $productType; $this->_configurationHelper = $configurationHelper; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $coreResource, + parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime ); diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php index 8dc2d65adfc5f..0d5287f8809fe 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -78,7 +78,7 @@ class Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $coreResource + * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -102,7 +102,7 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $coreResource, + \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -121,7 +121,7 @@ public function __construct( $this->_catalogProductCompareItem = $catalogProductCompareItem; $this->_catalogProductCompare = $catalogProductCompare; parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $coreResource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, + $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime ); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php b/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php index f7c9281ac2998..86cf51586bc22 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php @@ -58,7 +58,7 @@ class AssociatedProductsCollection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $coreResource + * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -82,7 +82,7 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $coreResource, + \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -100,7 +100,7 @@ public function __construct( ) { $this->_coreRegistry = $coreRegistry; $this->_config = $config; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $coreResource, + parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime ); diff --git a/app/code/Magento/Catalog/Model/Resource/Setup.php b/app/code/Magento/Catalog/Model/Resource/Setup.php index 50200f13d1796..de6dee60c64ec 100755 --- a/app/code/Magento/Catalog/Model/Resource/Setup.php +++ b/app/code/Magento/Catalog/Model/Resource/Setup.php @@ -50,13 +50,6 @@ class Setup extends \Magento\Eav\Model\Entity\Setup */ protected $_indexerFactory; - /** - * Migration setup model factory - * - * @var \Magento\Core\Model\Resource\Setup\MigrationFactory - */ - protected $_resourceMigrationFactory; - /** * Attribute resource model factory * @@ -73,7 +66,6 @@ class Setup extends \Magento\Eav\Model\Entity\Setup * @param string $resourceName * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Index\Model\IndexerFactory $indexerFactory - * @param \Magento\Core\Model\Resource\Setup\MigrationFactory $resourceMigrationFactory * @param \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeResourceFactory * @param string $moduleName * @param string $connectionName @@ -85,14 +77,12 @@ public function __construct( $resourceName, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Index\Model\IndexerFactory $indexerFactory, - \Magento\Core\Model\Resource\Setup\MigrationFactory $resourceMigrationFactory, \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeResourceFactory, $moduleName = 'Magento_Catalog', $connectionName = '' ) { $this->_categoryFactory = $categoryFactory; $this->_indexerFactory = $indexerFactory; - $this->_resourceMigrationFactory = $resourceMigrationFactory; $this->_eavAttributeResourceFactory = $eavAttributeResourceFactory; parent::__construct($context, $cache, $attrGrCollFactory, $resourceName, $moduleName, $connectionName); } @@ -128,7 +118,7 @@ public function createIndexer($data = array()) */ public function createSetupMigration($data = array()) { - return $this->_resourceMigrationFactory->create($data); + return $this->_migrationFactory->create($data); } /** diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php index 279ca9e74130f..5ac15b549c2f2 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php @@ -44,7 +44,7 @@ class Flat extends \Magento\Core\Model\Config\Value * @param \Magento\Index\Model\IndexerFactory $indexerFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -54,7 +54,7 @@ public function __construct( \Magento\Index\Model\IndexerFactory $indexerFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php index 1fe3962b10a8a..ce40ff299b305 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php @@ -44,7 +44,7 @@ class Flat extends \Magento\Core\Model\Config\Value * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -54,7 +54,7 @@ public function __construct( \Magento\Index\Model\Indexer $indexIndexer, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php index 5169d9d955c7b..73227bc59ac82 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php @@ -42,7 +42,7 @@ class Suffix extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -52,7 +52,7 @@ public function __construct( \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \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 c7f84b5d594c5..5b52d053f4e3b 100644 --- a/app/code/Magento/Catalog/Model/Template/Filter.php +++ b/app/code/Magento/Catalog/Model/Template/Filter.php @@ -84,7 +84,7 @@ public function __construct( * Set use absolute links flag * * @param bool $flag - * @return \Magento\Core\Model\Email\Template\Filter + * @return \Magento\Email\Model\Template\Filter */ public function setUseAbsoluteLinks($flag) { @@ -97,7 +97,7 @@ public function setUseAbsoluteLinks($flag) * Doesn't set anything intentionally, since SID is not allowed in any kind of emails * * @param bool $flag - * @return \Magento\Core\Model\Email\Template\Filter + * @return \Magento\Email\Model\Template\Filter */ public function setUseSessionInUrl($flag) { @@ -110,7 +110,7 @@ public function setUseSessionInUrl($flag) * * @param array $construction * @return string - * @see \Magento\Core\Model\Email\Template\Filter::viewDirective() method has been copypasted + * @see \Magento\Email\Model\Template\Filter::viewDirective() method has been copypasted */ public function viewDirective($construction) { @@ -127,7 +127,7 @@ public function viewDirective($construction) * * @param array $construction * @return string - * @see \Magento\Core\Model\Email\Template\Filter::mediaDirective() method has been copypasted + * @see \Magento\Email\Model\Template\Filter::mediaDirective() method has been copypasted */ public function mediaDirective($construction) { @@ -141,7 +141,7 @@ public function mediaDirective($construction) * * @param array $construction * @return string - * @see \Magento\Core\Model\Email\Template\Filter::storeDirective() method has been copypasted + * @see \Magento\Email\Model\Template\Filter::storeDirective() method has been copypasted */ public function storeDirective($construction) { diff --git a/app/code/Magento/Catalog/etc/frontend/di.xml b/app/code/Magento/Catalog/etc/frontend/di.xml index 1bf37d9d6c7af..2946fd33dff22 100644 --- a/app/code/Magento/Catalog/etc/frontend/di.xml +++ b/app/code/Magento/Catalog/etc/frontend/di.xml @@ -37,4 +37,14 @@ + + + + add + + + + + + diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml index 88a97b6e89aec..8d2019790962c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml @@ -23,7 +23,7 @@ * @copyright Copyright (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\Core\Block\Template */ +/* @var $this \Magento\View\Block\Template */ ?>
getMessagesBlock()->getGroupedHtml() ?>
-
+
getOptions()): ?> @@ -53,7 +53,7 @@
-

productAttribute($_product, $_product->getName(), 'name') ?>

+

productAttribute($_product, $_product->getName(), 'name') ?>

canEmailToFriend()): ?> @@ -89,8 +89,7 @@

-
productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>
+
productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>
diff --git a/app/code/Magento/Catalog/view/frontend/product/view/base-image.phtml b/app/code/Magento/Catalog/view/frontend/product/view/base-image.phtml index 9b1df0e979dfe..fb701a64ef767 100644 --- a/app/code/Magento/Catalog/view/frontend/product/view/base-image.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/view/base-image.phtml @@ -37,7 +37,7 @@ getImage() != 'no_selection' && $_product->getImage()): ?>

helper('Magento\Catalog\Helper\Image')->init($_product, 'image').'" alt="'.$this->escapeHtml($this->getImageLabel()).'" title="'.$this->escapeHtml($this->getImageLabel()).'" />'; + $_img = ''.$this->escapeHtml($this->getImageLabel()).''; echo $_helper->productAttribute($_product, $_img, 'image'); ?>

@@ -60,7 +60,7 @@

getBaseImageUrl($_product).'" alt="'.$this->escapeHtml($this->getImageLabel()).'" title="'.$this->escapeHtml($this->getImageLabel()).'" />'; + $_img = ''.$this->escapeHtml($this->getImageLabel()).''; echo $_helper->productAttribute($_product, $_img, 'image'); ?>

diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php index 7c8a448c646bf..e7adb5187b5ea 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php @@ -28,7 +28,7 @@ */ namespace Magento\CatalogInventory\Block\Adminhtml\Form\Field; -class Customergroup extends \Magento\Core\Block\Html\Select +class Customergroup extends \Magento\View\Block\Html\Select { /** * Customer groups cache @@ -54,12 +54,12 @@ class Customergroup extends \Magento\Core\Block\Html\Select /** * Construct * - * @param \Magento\Core\Block\Context $context + * @param \Magento\View\Block\Context $context * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $groupCollectionFactory * @param array $data */ public function __construct( - \Magento\Core\Block\Context $context, + \Magento\View\Block\Context $context, \Magento\Customer\Model\Resource\Group\CollectionFactory $groupCollectionFactory, array $data = array() ) { diff --git a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php index a7aa292ca44b7..398d9d663f8cd 100644 --- a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogInventory\Block; -class Qtyincrements extends \Magento\Core\Block\Template +class Qtyincrements extends \Magento\View\Block\Template { /** * Qty Increments cache @@ -51,19 +51,19 @@ class Qtyincrements extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php index 4ec0e4f2edae5..17f6471e7b4fa 100644 --- a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php +++ b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogInventory\Block\Stockqty; -abstract class AbstractStockqty extends \Magento\Core\Block\Template +abstract class AbstractStockqty extends \Magento\View\Block\Template { const XML_PATH_STOCK_THRESHOLD_QTY = 'cataloginventory/options/stock_threshold_qty'; @@ -46,19 +46,19 @@ abstract class AbstractStockqty extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/CatalogInventory/Helper/Data.php b/app/code/Magento/CatalogInventory/Helper/Data.php index a5b57b2261761..6f577396939a6 100644 --- a/app/code/Magento/CatalogInventory/Helper/Data.php +++ b/app/code/Magento/CatalogInventory/Helper/Data.php @@ -29,7 +29,7 @@ */ namespace Magento\CatalogInventory\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { const XML_PATH_SHOW_OUT_OF_STOCK = 'cataloginventory/options/show_out_of_stock'; const XML_PATH_ITEM_AUTO_RETURN = 'cataloginventory/item_options/auto_return'; @@ -64,12 +64,12 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_coreStoreConfig; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\ProductTypes\ConfigInterface $config ) { diff --git a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php index eb5b2b4103a5b..ff62f4ffb2670 100644 --- a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php +++ b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php @@ -46,7 +46,7 @@ class Managestock * @param \Magento\CatalogInventory\Model\Stock\Status $stockStatus * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -56,7 +56,7 @@ public function __construct( \Magento\CatalogInventory\Model\Stock\Status $stockStatus, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php index 169aac951024f..a98821e53c6c8 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php @@ -30,8 +30,6 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { /** - * Store model manager - * * @var \Magento\Core\Model\StoreManagerInterface */ protected $_storeManager; @@ -42,7 +40,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Resource\Db\Abstract $resource + * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( \Magento\Event\ManagerInterface $eventManager, @@ -52,9 +50,8 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); - $this->_storeManager = $storeManager; + parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); } /** diff --git a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php index 566168b806912..f03cbf87ef5b7 100644 --- a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php @@ -43,7 +43,7 @@ class Minsaleqty extends \Magento\Core\Model\Config\Value * @param \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -53,7 +53,7 @@ public function __construct( \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php index bfd977961fa85..c326a78bf8341 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php @@ -39,20 +39,20 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php index b6a95b26c6cef..1057fd89fba15 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php @@ -40,27 +40,27 @@ class Conditions */ protected $_conditions; - /** - * @param \Magento\Rule\Block\Conditions $conditions - * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Rule\Block\Conditions $conditions + * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset + * @param array $data */ - public function __construct( - \Magento\Rule\Block\Conditions $conditions, - \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Rule\Block\Conditions $conditions, + \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, + array $data = array() + ) { $this->_rendererFieldset = $rendererFieldset; $this->_conditions = $conditions; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php index c028300cb3cfa..80da91b789841 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php @@ -37,11 +37,6 @@ class Main extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { - /** - * @var \Magento\Core\Model\StoreManager - */ - protected $_storeManager; - /** * @var \Magento\Core\Model\System\Store */ @@ -53,27 +48,26 @@ class Main protected $_customerGroup; /** - * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup - * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @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 \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup + * @param \Magento\Core\Model\System\Store $systemStore * @param array $data */ public function __construct( - \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup, - \Magento\Core\Model\System\Store $systemStore, + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, + \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup, + \Magento\Core\Model\System\Store $systemStore, array $data = array() ) { - $this->_storeManager = $context->getStoreManager(); $this->_systemStore = $systemStore; $this->_customerGroup = $customerGroup; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php index 16710323f8a5a..b902561416dd4 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php @@ -36,24 +36,22 @@ class Chooser extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_salesRule; - /** - * @param \Magento\SalesRule\Model\RuleFactory $salesRule - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\SalesRule\Model\RuleFactory $salesRule + * @param array $data */ - public function __construct( - \Magento\SalesRule\Model\RuleFactory $salesRule, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\SalesRule\Model\RuleFactory $salesRule, + array $data = array() + ) { $this->_salesRule = $salesRule; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Daterange.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Daterange.php index 287054dc7b3c5..5d06461672e38 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Daterange.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Daterange.php @@ -63,18 +63,18 @@ class Daterange extends \Magento\Backend\Block\AbstractBlock */ protected $mathRandom; - /** - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Math\Random $mathRandom - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Math\Random $mathRandom + * @param array $data */ - public function __construct( - \Magento\Data\FormFactory $formFactory, - \Magento\Backend\Block\Context $context, - \Magento\Math\Random $mathRandom, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Data\FormFactory $formFactory, + \Magento\Math\Random $mathRandom, + array $data = array() + ) { $this->_formFactory = $formFactory; $this->mathRandom = $mathRandom; parent::__construct($context, $data); diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php index 3455e82fbe680..aa54e2e677c6d 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php @@ -55,33 +55,31 @@ class Sku extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_catalogProduct; - /** - * @param \Magento\Catalog\Model\ProductFactory $catalogProduct - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection - * @param \Magento\Catalog\Model\Product\Type $catalogType - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\ProductFactory $catalogProduct + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection + * @param \Magento\Catalog\Model\Product\Type $catalogType + * @param array $data */ - public function __construct( - \Magento\Catalog\Model\ProductFactory $catalogProduct, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection, - \Magento\Catalog\Model\Product\Type $catalogType, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\ProductFactory $catalogProduct, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection, + \Magento\Catalog\Model\Product\Type $catalogType, + array $data = array() + ) { $this->_catalogType = $catalogType; $this->_cpCollection = $cpCollection; $this->_eavAttSetCollection = $eavAttSetCollection; $this->_catalogProduct = $catalogProduct; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo.php index e6b307b05f8f4..36e77611703c2 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo.php @@ -33,15 +33,15 @@ */ namespace Magento\CatalogRule\Controller\Adminhtml; -class Promo extends \Magento\Backend\Controller\Adminhtml\Action +class Promo extends \Magento\Backend\App\Action { public function indexAction() { - $this->loadLayout(); + $this->_view->loadLayout(); $this->_setActiveMenu('Magento_CatalogRule::promo'); $this->_addBreadcrumb(__('Promotions'), __('Promo')); - $this->renderLayout(); + $this->_view->renderLayout(); } protected function _isAllowed() diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php index 67323e4692620..a308eb102a6a5 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogRule\Controller\Adminhtml\Promo; -class Catalog extends \Magento\Backend\Controller\Adminhtml\Action +class Catalog extends \Magento\Backend\App\Action { /** * Dirty rules notice message @@ -50,22 +50,30 @@ class Catalog extends \Magento\Backend\Controller\Adminhtml\Action */ protected $_coreRegistry = null; + /* + * @var \Magento\Core\Filter\Date + */ + protected $_dateFilter; + /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Core\Filter\Date $dateFilter */ public function __construct( - \Magento\Backend\Controller\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Backend\App\Action\Context $context, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Core\Filter\Date $dateFilter ) { - $this->_coreRegistry = $coreRegistry; parent::__construct($context); + $this->_coreRegistry = $coreRegistry; + $this->_dateFilter = $dateFilter; } protected function _initAction() { - $this->loadLayout() - ->_setActiveMenu('Magento_CatalogRule::promo_catalog') + $this->_view->loadLayout(); + $this->_setActiveMenu('Magento_CatalogRule::promo_catalog') ->_addBreadcrumb( __('Promotions'), __('Promotions') @@ -75,7 +83,7 @@ protected function _initAction() public function indexAction() { - $this->_title(__('Catalog Price Rules')); + $this->_title->add(__('Catalog Price Rules')); $dirtyRules = $this->_objectManager->create('Magento\CatalogRule\Model\Flag')->loadSelf(); if ($dirtyRules->getState()) { @@ -86,8 +94,8 @@ public function indexAction() ->_addBreadcrumb( __('Catalog'), __('Catalog') - ) - ->renderLayout(); + ); + $this->_view->renderLayout(); } public function newAction() @@ -97,7 +105,7 @@ public function newAction() public function editAction() { - $this->_title(__('Catalog Price Rules')); + $this->_title->add(__('Catalog Price Rules')); $id = $this->getRequest()->getParam('id'); $model = $this->_objectManager->create('Magento\CatalogRule\Model\Rule'); @@ -113,7 +121,7 @@ public function editAction() } } - $this->_title($model->getRuleId() ? $model->getName() : __('New Catalog Price Rule')); + $this->_title->add($model->getRuleId() ? $model->getName() : __('New Catalog Price Rule')); // set entered data if was error when we do save $data = $this->_objectManager->get('Magento\Adminhtml\Model\Session')->getPageData(true); @@ -124,11 +132,13 @@ public function editAction() $this->_coreRegistry->register('current_promo_catalog_rule', $model); - $this->_initAction()->getLayout()->getBlock('promo_catalog_edit') + $this->_initAction(); + $this->_view->getLayout()->getBlock('promo_catalog_edit') ->setData('action', $this->getUrl('catalog_rule/promo_catalog/save')); $breadcrumb = $id ? __('Edit Rule') : __('New Rule'); - $this->_addBreadcrumb($breadcrumb, $breadcrumb)->renderLayout(); + $this->_addBreadcrumb($breadcrumb, $breadcrumb); + $this->_view->renderLayout(); } public function saveAction() @@ -141,7 +151,9 @@ public function saveAction() array('request' => $this->getRequest()) ); $data = $this->getRequest()->getPost(); - $data = $this->_filterDates($data, array('from_date', 'to_date')); + $inputFilter = new \Zend_Filter_Input( + array('from_date' => $this->_dateFilter, 'to_date' => $this->_dateFilter), array(), $data); + $data = $inputFilter->getUnescaped(); $id = $this->getRequest()->getParam('rule_id'); if ($id) { $model->load($id); @@ -152,7 +164,7 @@ public function saveAction() $validateResult = $model->validateData(new \Magento\Object($data)); if ($validateResult !== true) { - foreach($validateResult as $errorMessage) { + foreach ($validateResult as $errorMessage) { $this->_getSession()->addError($errorMessage); } $this->_getSession()->setPageData($data); @@ -265,7 +277,7 @@ public function chooserAction() $type = 'Magento\CatalogRule\Block\Adminhtml\Promo\Widget\Chooser\Sku'; } if (!empty($type)) { - $block = $this->getLayout()->createBlock($type); + $block = $this->_view->getLayout()->createBlock($type); if ($block) { $this->getResponse()->setBody($block->toHtml()); } diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php index 69a377fc0cc7b..170cbd4e273ae 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php @@ -26,7 +26,7 @@ namespace Magento\CatalogRule\Controller\Adminhtml\Promo; -class Widget extends \Magento\Backend\Controller\Adminhtml\Action +class Widget extends \Magento\Backend\App\Action { /** * Core registry @@ -36,11 +36,11 @@ class Widget extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -58,7 +58,7 @@ public function chooserAction() switch ($request->getParam('attribute')) { case 'sku': - $block = $this->getLayout()->createBlock( + $block = $this->_view->getLayout()->createBlock( 'Magento\CatalogRule\Block\Adminhtml\Promo\Widget\Chooser\Sku', 'promo_widget_chooser_sku', array('data' => array('js_form_object' => $request->getParam('form')), )); @@ -80,7 +80,7 @@ public function chooserAction() } - $block = $this->getLayout()->createBlock( + $block = $this->_view->getLayout()->createBlock( 'Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree', 'promo_widget_chooser_category_ids', array('data' => array('js_form_object' => $request->getParam('form'))) ) @@ -116,7 +116,7 @@ public function categoriesJsonAction() return; } $this->getResponse()->setBody( - $this->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree') + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Category\Tree') ->getTreeJson($category) ); } diff --git a/app/code/Magento/CatalogRule/Helper/Data.php b/app/code/Magento/CatalogRule/Helper/Data.php index 9f130791341e4..ddc89877d8cd9 100644 --- a/app/code/Magento/CatalogRule/Helper/Data.php +++ b/app/code/Magento/CatalogRule/Helper/Data.php @@ -29,7 +29,7 @@ */ namespace Magento\CatalogRule\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { /** * Algorithm for calculating price rule diff --git a/app/code/Magento/CatalogSearch/Block/Advanced/Form.php b/app/code/Magento/CatalogSearch/Block/Advanced/Form.php index 2313f1e350828..6b92f27f4fe0b 100644 --- a/app/code/Magento/CatalogSearch/Block/Advanced/Form.php +++ b/app/code/Magento/CatalogSearch/Block/Advanced/Form.php @@ -33,22 +33,8 @@ */ namespace Magento\CatalogSearch\Block\Advanced; -class Form extends \Magento\Core\Block\Template +class Form extends \Magento\View\Block\Template { - /** - * Locale - * - * @var \Magento\Core\Model\LocaleInterface - */ - protected $_locale; - - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Currency factory * @@ -64,30 +50,22 @@ class Form extends \Magento\Core\Block\Template protected $_catalogSearchAdvanced; /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced, \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\LocaleInterface $locale, array $data = array() ) { $this->_catalogSearchAdvanced = $catalogSearchAdvanced; $this->_currencyFactory = $currencyFactory; - $this->_storeManager = $storeManager; - $this->_locale = $locale; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function _prepareLayout() @@ -308,7 +286,7 @@ protected function _getSelectBlock() { $block = $this->getData('_select_block'); if (is_null($block)) { - $block = $this->getLayout()->createBlock('Magento\Core\Block\Html\Select'); + $block = $this->getLayout()->createBlock('Magento\View\Block\Html\Select'); $this->setData('_select_block', $block); } return $block; @@ -318,7 +296,7 @@ protected function _getDateBlock() { $block = $this->getData('_date_block'); if (is_null($block)) { - $block = $this->getLayout()->createBlock('Magento\Core\Block\Html\Date'); + $block = $this->getLayout()->createBlock('Magento\View\Block\Html\Date'); $this->setData('_date_block', $block); } return $block; diff --git a/app/code/Magento/CatalogSearch/Block/Advanced/Result.php b/app/code/Magento/CatalogSearch/Block/Advanced/Result.php index 5ee0294f767e4..2115c0642a8da 100644 --- a/app/code/Magento/CatalogSearch/Block/Advanced/Result.php +++ b/app/code/Magento/CatalogSearch/Block/Advanced/Result.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogSearch\Block\Advanced; -class Result extends \Magento\Core\Block\Template +class Result extends \Magento\View\Block\Template { /** * Url factory @@ -42,13 +42,6 @@ class Result extends \Magento\Core\Block\Template */ protected $_urlFactory; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Catalog layer * @@ -64,30 +57,25 @@ class Result extends \Magento\Core\Block\Template protected $_catalogSearchAdvanced; /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced * @param \Magento\Catalog\Model\Layer $catalogLayer - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\UrlFactory $urlFactory * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced, \Magento\Catalog\Model\Layer $catalogLayer, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\UrlFactory $urlFactory, array $data = array() ) { $this->_catalogSearchAdvanced = $catalogSearchAdvanced; $this->_catalogLayer = $catalogLayer; - $this->_storeManager = $storeManager; $this->_urlFactory = $urlFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/CatalogSearch/Block/Autocomplete.php b/app/code/Magento/CatalogSearch/Block/Autocomplete.php index 818a8e5968aad..966fb71c73592 100644 --- a/app/code/Magento/CatalogSearch/Block/Autocomplete.php +++ b/app/code/Magento/CatalogSearch/Block/Autocomplete.php @@ -29,7 +29,7 @@ */ namespace Magento\CatalogSearch\Block; -class Autocomplete extends \Magento\Core\Block\AbstractBlock +class Autocomplete extends \Magento\View\Block\AbstractBlock { protected $_suggestData = null; diff --git a/app/code/Magento/CatalogSearch/Block/Layer.php b/app/code/Magento/CatalogSearch/Block/Layer.php index 112326586fda2..b0d90f5de3858 100644 --- a/app/code/Magento/CatalogSearch/Block/Layer.php +++ b/app/code/Magento/CatalogSearch/Block/Layer.php @@ -51,13 +51,6 @@ class Layer extends \Magento\Catalog\Block\Layer\View */ protected $_catalogSearchData = null; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Catalog search layer * @@ -66,26 +59,22 @@ class Layer extends \Magento\Catalog\Block\Layer\View protected $_catalogSearchLayer; /** - * Construct - * - * @param \Magento\CatalogSearch\Model\Layer $layer + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\CatalogSearch\Model\Layer $catalogLayer * @param \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\CatalogSearch\Model\Layer $catalogSearchLayer - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\CatalogSearch\Model\Layer $layer, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\CatalogSearch\Model\Layer $catalogLayer, \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider, \Magento\CatalogSearch\Helper\Data $catalogSearchData, \Magento\CatalogSearch\Model\Layer $catalogSearchLayer, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Registry $registry, array $data = array() ) { @@ -93,8 +82,7 @@ public function __construct( $this->_coreRegistry = $registry; $this->_catalogSearchData = $catalogSearchData; $this->_catalogSearchLayer = $catalogSearchLayer; - $this->_storeManager = $storeManager; - parent::__construct($layer, $coreData, $context, $data); + parent::__construct($context, $coreData, $catalogLayer, $data); } /** diff --git a/app/code/Magento/CatalogSearch/Block/Result.php b/app/code/Magento/CatalogSearch/Block/Result.php index b6559296ef6d9..f1d047b6ef934 100644 --- a/app/code/Magento/CatalogSearch/Block/Result.php +++ b/app/code/Magento/CatalogSearch/Block/Result.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogSearch\Block; -class Result extends \Magento\Core\Block\Template +class Result extends \Magento\View\Block\Template { /** * Catalog Product collection @@ -50,13 +50,6 @@ class Result extends \Magento\Core\Block\Template */ protected $_catalogSearchData = null; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Catalog layer * @@ -65,27 +58,22 @@ class Result extends \Magento\Core\Block\Template protected $_catalogLayer; /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Catalog\Model\Layer $catalogLayer - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Catalog\Model\Layer $catalogLayer, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\CatalogSearch\Helper\Data $catalogSearchData, array $data = array() ) { $this->_catalogLayer = $catalogLayer; - $this->_storeManager = $storeManager; $this->_catalogSearchData = $catalogSearchData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/CatalogSearch/Block/Term.php b/app/code/Magento/CatalogSearch/Block/Term.php index 3b3bb6f30225d..30031df9e58f7 100644 --- a/app/code/Magento/CatalogSearch/Block/Term.php +++ b/app/code/Magento/CatalogSearch/Block/Term.php @@ -33,19 +33,12 @@ */ namespace Magento\CatalogSearch\Block; -class Term extends \Magento\Core\Block\Template +class Term extends \Magento\View\Block\Template { protected $_terms; protected $_minPopularity; protected $_maxPopularity; - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * Url factory * @@ -61,27 +54,22 @@ class Term extends \Magento\Core\Block\Template protected $_queryCollectionFactory; /** - * Construct - * + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queryCollectionFactory * @param \Magento\Core\Model\UrlFactory $urlFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queryCollectionFactory, \Magento\Core\Model\UrlFactory $urlFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { $this->_queryCollectionFactory = $queryCollectionFactory; $this->_urlFactory = $urlFactory; - $this->_storeManager = $storeManager; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/CatalogSearch/Controller/Advanced.php b/app/code/Magento/CatalogSearch/Controller/Advanced.php index 2885540a810de..79e66db657cd2 100644 --- a/app/code/Magento/CatalogSearch/Controller/Advanced.php +++ b/app/code/Magento/CatalogSearch/Controller/Advanced.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogSearch\Controller; -class Advanced extends \Magento\Core\Controller\Front\Action +class Advanced extends \Magento\App\Action\Action { /** @@ -60,13 +60,13 @@ class Advanced extends \Magento\Core\Controller\Front\Action /** * Construct * - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @param \Magento\App\Action\Context $context * @param \Magento\Core\Model\Session\Generic $catalogSearchSession * @param \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced * @param \Magento\Core\Model\UrlFactory $urlFactory */ public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, + \Magento\App\Action\Context $context, \Magento\Core\Model\Session\Generic $catalogSearchSession, \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced, \Magento\Core\Model\UrlFactory $urlFactory @@ -79,25 +79,24 @@ public function __construct( public function indexAction() { - $this->loadLayout(); - $this->_initLayoutMessages('Magento\CatalogSearch\Model\Session'); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\CatalogSearch\Model\Session'); + $this->_view->renderLayout(); } public function resultAction() { - $this->loadLayout(); + $this->_view->loadLayout(); try { $this->_catalogSearchAdvanced->addFilters($this->getRequest()->getQuery()); } catch (\Magento\Core\Exception $e) { $this->_catalogSearchSession->addError($e->getMessage()); - $this->_redirectError( - $this->_urlFactory->create() - ->setQueryParams($this->getRequest()->getQuery()) - ->getUrl('*/*/') - ); + $defaultUrl = $this->_urlFactory->create() + ->setQueryParams($this->getRequest()->getQuery()) + ->getUrl('*/*/'); + $this->getResponse()->setRedirect($this->_redirect->error($defaultUrl)); } - $this->_initLayoutMessages('Magento\Catalog\Model\Session'); - $this->renderLayout(); + $this->_view->getLayout()->initMessages('Magento\Catalog\Model\Session'); + $this->_view->renderLayout(); } } diff --git a/app/code/Magento/CatalogSearch/Controller/Ajax.php b/app/code/Magento/CatalogSearch/Controller/Ajax.php index 04dc8405498bb..fdd3dbfea6990 100644 --- a/app/code/Magento/CatalogSearch/Controller/Ajax.php +++ b/app/code/Magento/CatalogSearch/Controller/Ajax.php @@ -33,36 +33,16 @@ */ namespace Magento\CatalogSearch\Controller; -class Ajax extends \Magento\Core\Controller\Front\Action +class Ajax extends \Magento\App\Action\Action { - /** - * Url - * - * @var \Magento\Core\Model\Url - */ - protected $_url; - - /** - * Construct - * - * @param \Magento\Core\Controller\Varien\Action\Context $context - * @param \Magento\Core\Model\Url $url - */ - public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, - \Magento\Core\Model\Url $url - ) { - $this->_url = $url; - parent::__construct($context); - } - public function suggestAction() { if (!$this->getRequest()->getParam('q', false)) { $this->getResponse()->setRedirect($this->_url->getBaseUrl()); } - $this->addPageLayoutHandles(); - $this->loadLayout(false)->renderLayout(); + $this->_view->addPageLayoutHandles(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } } diff --git a/app/code/Magento/CatalogSearch/Controller/Result.php b/app/code/Magento/CatalogSearch/Controller/Result.php index 6036637a28bf7..0fe3a2ac61546 100644 --- a/app/code/Magento/CatalogSearch/Controller/Result.php +++ b/app/code/Magento/CatalogSearch/Controller/Result.php @@ -29,14 +29,8 @@ */ namespace Magento\CatalogSearch\Controller; -class Result extends \Magento\Core\Controller\Front\Action +class Result extends \Magento\App\Action\Action { - /** - * Store manager - * - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; /** * Catalog session @@ -46,19 +40,22 @@ class Result extends \Magento\Core\Controller\Front\Action protected $_catalogSession; /** - * Construct - * - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + + /** + * @param \Magento\App\Action\Context $context * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, + \Magento\App\Action\Context $context, \Magento\Catalog\Model\Session $catalogSession, \Magento\Core\Model\StoreManagerInterface $storeManager ) { - $this->_catalogSession = $catalogSession; $this->_storeManager = $storeManager; + $this->_catalogSession = $catalogSession; parent::__construct($context); } @@ -86,38 +83,34 @@ public function indexAction() $query->setId(0) ->setIsActive(1) ->setIsProcessed(1); - } - else { + } else { if ($query->getId()) { $query->setPopularity($query->getPopularity()+1); - } - else { + } else { $query->setPopularity(1); } - if ($query->getRedirect()){ + if ($query->getRedirect()) { $query->save(); $this->getResponse()->setRedirect($query->getRedirect()); return; - } - else { + } else { $query->prepare(); } } $this->_objectManager->get('Magento\CatalogSearch\Helper\Data')->checkNotes(); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Catalog\Model\Session'); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->getLayout() + ->initMessages(array('Magento\Catalog\Model\Session', 'Magento\Checkout\Model\Session')); + $this->_view->renderLayout(); if (!$this->_objectManager->get('Magento\CatalogSearch\Helper\Data')->isMinQueryLength()) { $query->save(); } - } - else { - $this->_redirectReferer(); + } else { + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl()); } } } diff --git a/app/code/Magento/CatalogSearch/Controller/Term.php b/app/code/Magento/CatalogSearch/Controller/Term.php index 2d4ee9a26b309..23c2cacddfb30 100644 --- a/app/code/Magento/CatalogSearch/Controller/Term.php +++ b/app/code/Magento/CatalogSearch/Controller/Term.php @@ -27,20 +27,27 @@ namespace Magento\CatalogSearch\Controller; -class Term extends \Magento\Core\Controller\Front\Action { +use Magento\App\Action\NotFoundException; +use Magento\App\RequestInterface; - public function preDispatch(){ - parent::preDispatch(); - if(!$this->_objectManager->get('Magento\Core\Model\Store\Config')->getConfig('catalog/seo/search_terms')){ - $this->_redirect('noroute'); - $this->setFlag('',self::FLAG_NO_DISPATCH,true); +class Term extends \Magento\App\Action\Action +{ + /** + * @param RequestInterface $request + * @return mixed + */ + public function dispatch(RequestInterface $request) + { + if (!$this->_objectManager->get('Magento\Core\Model\Store\Config')->getConfig('catalog/seo/search_terms')) { + $this->_redirect('noroute'); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); } - return $this; - + return parent::dispatch($request); } + public function popularAction() { - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } } diff --git a/app/code/Magento/CatalogSearch/Helper/Data.php b/app/code/Magento/CatalogSearch/Helper/Data.php index 93e59294c7777..29c7c8ff4e00d 100644 --- a/app/code/Magento/CatalogSearch/Helper/Data.php +++ b/app/code/Magento/CatalogSearch/Helper/Data.php @@ -29,7 +29,7 @@ /** * Catalog search helper */ -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { /** * Query variable @@ -110,7 +110,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper /** * Construct * - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\CatalogSearch\Model\QueryFactory $queryFactory @@ -118,7 +118,7 @@ class Data extends \Magento\Core\Helper\AbstractHelper * @param \Magento\Filter\FilterManager $filter */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Stdlib\String $string, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\CatalogSearch\Model\QueryFactory $queryFactory, diff --git a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php index c029880c65d6b..53fbae7e7b84c 100644 --- a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php +++ b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php @@ -48,7 +48,7 @@ class Type extends \Magento\Core\Model\Config\Value * * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -59,7 +59,7 @@ public function __construct( \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogSearch/Model/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Fulltext.php index dd544df5bba92..75d67d04c13db 100644 --- a/app/code/Magento/CatalogSearch/Model/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Fulltext.php @@ -56,13 +56,6 @@ class Fulltext extends \Magento\Core\Model\AbstractModel */ protected $_catalogSearchData = null; - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * Core store config * @@ -71,7 +64,6 @@ class Fulltext extends \Magento\Core\Model\AbstractModel protected $_coreStoreConfig; /** - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry @@ -81,7 +73,6 @@ class Fulltext extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, \Magento\CatalogSearch\Helper\Data $catalogSearchData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, @@ -90,7 +81,6 @@ public function __construct( \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->_eventManager = $eventManager; $this->_catalogSearchData = $catalogSearchData; $this->_coreStoreConfig = $coreStoreConfig; parent::__construct($context, $registry, $resource, $resourceCollection, $data); diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php index 7fda440d4cb15..87af424704bde 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php @@ -49,7 +49,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $coreResource + * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -72,7 +72,7 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $coreResource, + \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -89,7 +89,7 @@ public function __construct( ) { $this->_date = $date; parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $coreResource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, + $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime ); diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php index 25fbbb4191417..988b07c29ae76 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -56,7 +56,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $coreResource + * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -80,7 +80,7 @@ public function __construct( \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $coreResource, + \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -99,7 +99,7 @@ public function __construct( $this->_catalogSearchFulltext = $catalogSearchFulltext; $this->_catalogSearchData = $catalogSearchData; parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $coreResource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, + $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime ); diff --git a/app/code/Magento/CatalogSearch/etc/di.xml b/app/code/Magento/CatalogSearch/etc/di.xml index cad205dce5f67..43d80ea34b4f8 100644 --- a/app/code/Magento/CatalogSearch/etc/di.xml +++ b/app/code/Magento/CatalogSearch/etc/di.xml @@ -25,7 +25,7 @@ --> - + diff --git a/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml b/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml index 6b161cc0461a0..34325028b58f5 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml +++ b/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml @@ -25,7 +25,7 @@ */ ?> helper('Magento\CatalogSearch\Helper\Data'); ?> 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 6027719a58da0..5dc716342e983 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 @@ -37,6 +37,6 @@ - + diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml index e4b5d8f6a49e7..8454bb6d813c9 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml @@ -25,7 +25,7 @@ --> - + diff --git a/app/code/Magento/Centinel/Block/Authentication.php b/app/code/Magento/Centinel/Block/Authentication.php index 73dfb7cc9b7b3..075de9e727de4 100644 --- a/app/code/Magento/Centinel/Block/Authentication.php +++ b/app/code/Magento/Centinel/Block/Authentication.php @@ -29,7 +29,7 @@ */ namespace Magento\Centinel\Block; -class Authentication extends \Magento\Core\Block\Template +class Authentication extends \Magento\View\Block\Template { /** * Checkout session @@ -54,19 +54,19 @@ class Authentication extends \Magento\Core\Block\Template protected $_authenticationStartMode = false; /** - * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\Checkout\Model\Session $checkoutSession, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Centinel/Block/Authentication/Complete.php b/app/code/Magento/Centinel/Block/Authentication/Complete.php index 690ef669d988f..f3bb56bbe3af3 100644 --- a/app/code/Magento/Centinel/Block/Authentication/Complete.php +++ b/app/code/Magento/Centinel/Block/Authentication/Complete.php @@ -30,7 +30,7 @@ */ namespace Magento\Centinel\Block\Authentication; -class Complete extends \Magento\Core\Block\Template +class Complete extends \Magento\View\Block\Template { /** * Core registry @@ -40,19 +40,19 @@ class Complete extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Centinel/Block/Authentication/Start.php b/app/code/Magento/Centinel/Block/Authentication/Start.php index 42bb3f4f65a48..7c0b164ca8a45 100644 --- a/app/code/Magento/Centinel/Block/Authentication/Start.php +++ b/app/code/Magento/Centinel/Block/Authentication/Start.php @@ -30,7 +30,7 @@ */ namespace Magento\Centinel\Block\Authentication; -class Start extends \Magento\Core\Block\Template +class Start extends \Magento\View\Block\Template { /** * Core registry @@ -40,19 +40,19 @@ class Start extends \Magento\Core\Block\Template protected $_coreRegistry = null; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Centinel/Block/Logo.php b/app/code/Magento/Centinel/Block/Logo.php index 8762c61ed98af..311c649eb79f7 100644 --- a/app/code/Magento/Centinel/Block/Logo.php +++ b/app/code/Magento/Centinel/Block/Logo.php @@ -29,7 +29,7 @@ */ namespace Magento\Centinel\Block; -class Logo extends \Magento\Core\Block\Template +class Logo extends \Magento\View\Block\Template { protected $_template = 'logo.phtml'; diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php index d7460f27cb09b..a529ad5bfb577 100644 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php +++ b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php @@ -33,7 +33,7 @@ */ namespace Magento\Centinel\Controller\Adminhtml\Centinel; -class Index extends \Magento\Backend\Controller\Adminhtml\Action +class Index extends \Magento\Backend\App\Action { /** * Core registry @@ -43,11 +43,11 @@ class Index extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -89,7 +89,7 @@ public function authenticationStartAction() if ($validator) { $this->_coreRegistry->register('current_centinel_validator', $validator); } - $this->loadLayout()->renderLayout(); + $this->_view->loadLayout()->renderLayout(); } /** @@ -113,7 +113,7 @@ public function authenticationCompleteAction() } catch (\Exception $e) { $this->_coreRegistry->register('current_centinel_validator', false); } - $this->loadLayout()->renderLayout(); + $this->_view->loadLayout()->renderLayout(); } /** diff --git a/app/code/Magento/Centinel/Controller/Index.php b/app/code/Magento/Centinel/Controller/Index.php index 14518848bc828..c0e335118fda4 100644 --- a/app/code/Magento/Centinel/Controller/Index.php +++ b/app/code/Magento/Centinel/Controller/Index.php @@ -30,7 +30,7 @@ */ namespace Magento\Centinel\Controller; -class Index extends \Magento\Core\Controller\Front\Action +class Index extends \Magento\App\Action\Action { /** * Core registry @@ -40,11 +40,11 @@ class Index extends \Magento\Core\Controller\Front\Action protected $_coreRegistry = null; /** - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @param \Magento\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, + \Magento\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -61,7 +61,7 @@ public function authenticationStartAction() if ($validator) { $this->_coreRegistry->register('current_centinel_validator', $validator); } - $this->loadLayout()->renderLayout(); + $this->_view->loadLayout()->renderLayout(); } /** @@ -85,7 +85,7 @@ public function authenticationCompleteAction() } catch (\Exception $e) { $this->_coreRegistry->register('current_centinel_validator', false); } - $this->loadLayout()->renderLayout(); + $this->_view->loadLayout()->renderLayout(); } /** diff --git a/app/code/Magento/Centinel/Helper/Data.php b/app/code/Magento/Centinel/Helper/Data.php index 146401eadf074..763e4ac8f74bc 100644 --- a/app/code/Magento/Centinel/Helper/Data.php +++ b/app/code/Magento/Centinel/Helper/Data.php @@ -31,7 +31,7 @@ */ namespace Magento\Centinel\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { /** * Layout factory @@ -41,11 +41,11 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_layout; /** - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\View\LayoutInterface $layout */ public function __construct( - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\View\LayoutInterface $layout ) { $this->_layout = $layout; diff --git a/app/code/Magento/Centinel/view/frontend/logo.phtml b/app/code/Magento/Centinel/view/frontend/logo.phtml index 599835fc3f79a..8ab95a76afa96 100644 --- a/app/code/Magento/Centinel/view/frontend/logo.phtml +++ b/app/code/Magento/Centinel/view/frontend/logo.phtml @@ -24,10 +24,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - +
diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php index 2654b64b9c541..607d7dfb1eb53 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php @@ -35,20 +35,20 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @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() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php index 340071531db3b..c5d49f12aa2f7 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php @@ -33,24 +33,24 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Core\Model\System\Store $systemStore - * @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\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Core\Model\System\Store $systemStore, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_systemStore = $systemStore; - parent::__construct($registry, $formFactory, $coreData, $context, $data); + parent::__construct($context, $coreData, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php index 7b28d430ac14e..fcd958b73ea4c 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php @@ -32,24 +32,22 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory - * @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 + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Url $urlModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Url $urlModel, + \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($coreData, $context, $storeManager, $urlModel, $data); + parent::__construct($context, $coreData, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Checkout/Block/Agreements.php b/app/code/Magento/Checkout/Block/Agreements.php index c97b092d521b3..4060adf6b2e0d 100644 --- a/app/code/Magento/Checkout/Block/Agreements.php +++ b/app/code/Magento/Checkout/Block/Agreements.php @@ -25,7 +25,7 @@ */ namespace Magento\Checkout\Block; -class Agreements extends \Magento\Core\Block\Template +class Agreements extends \Magento\View\Block\Template { /** * @var \Magento\Checkout\Model\Resource\Agreement\CollectionFactory @@ -33,27 +33,19 @@ class Agreements extends \Magento\Core\Block\Template protected $_agreementCollFactory; /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollFactory * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollFactory, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_agreementCollFactory = $agreementCollFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index f7db27f482117..92a7e85da4413 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -35,47 +35,31 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart { - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Catalog\Model\Resource\Url */ protected $_catalogUrlBuilder; /** - * @var \Magento\UrlInterface - */ - protected $_urlBuilder; - - /** - * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Resource\Url $catalogUrlBuilder - * @param \Magento\UrlInterface $urlBuilder + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Catalog\Model\Resource\Url $catalogUrlBuilder * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Url $catalogUrlBuilder, - \Magento\UrlInterface $urlBuilder, array $data = array() ) { - $this->_storeManager = $storeManager; $this->_catalogUrlBuilder = $catalogUrlBuilder; - $this->_urlBuilder = $urlBuilder; - parent::__construct($catalogData, $coreData, $context, $customerSession, $checkoutSession, $data); + parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/AbstractCart.php b/app/code/Magento/Checkout/Block/Cart/AbstractCart.php index 19183c6d6ba13..bf11f7db07ecd 100644 --- a/app/code/Magento/Checkout/Block/Cart/AbstractCart.php +++ b/app/code/Magento/Checkout/Block/Cart/AbstractCart.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Cart; -class AbstractCart extends \Magento\Core\Block\Template +class AbstractCart extends \Magento\View\Block\Template { /** * Block alias fallback @@ -63,17 +63,17 @@ class AbstractCart extends \Magento\Core\Block\Template protected $_checkoutSession; /** - * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() @@ -81,7 +81,7 @@ public function __construct( $this->_customerSession = $customerSession; $this->_checkoutSession = $checkoutSession; $this->_catalogData = $catalogData; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -104,7 +104,7 @@ protected function _prepareLayout() * * @param string $type * @throws \RuntimeException - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ public function getItemRenderer($type) { diff --git a/app/code/Magento/Checkout/Block/Cart/Crosssell.php b/app/code/Magento/Checkout/Block/Cart/Crosssell.php index 7d1e9736b8842..1bb998b973b5b 100644 --- a/app/code/Magento/Checkout/Block/Cart/Crosssell.php +++ b/app/code/Magento/Checkout/Block/Cart/Crosssell.php @@ -63,32 +63,28 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct protected $_productLinkFactory; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\View\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Core\Model\Registry $coreRegistry + * @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 \Magento\Math\Random $mathRandom * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Catalog\Model\Product\Visibility $productVisibility * @param \Magento\CatalogInventory\Model\Stock $stock * @param \Magento\Catalog\Model\Product\LinkFactory $productLinkFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\View\Block\Template\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Core\Model\Registry $coreRegistry, + \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, \Magento\Math\Random $mathRandom, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Catalog\Model\Product\Visibility $productVisibility, @@ -100,17 +96,7 @@ public function __construct( $this->_productVisibility = $productVisibility; $this->_stock = $stock; $this->_productLinkFactory = $productLinkFactory; - parent::__construct( - $storeManager, - $catalogConfig, - $coreRegistry, - $taxData, - $catalogData, - $coreData, - $context, - $mathRandom, - $data - ); + parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Configure.php b/app/code/Magento/Checkout/Block/Cart/Item/Configure.php index fa23e48725940..6be0c50ea0a4c 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Configure.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Configure.php @@ -35,7 +35,7 @@ */ namespace Magento\Checkout\Block\Cart\Item; -class Configure extends \Magento\Core\Block\Template +class Configure extends \Magento\View\Block\Template { /** diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php index bca0f9052ac70..2dda9fd8b153b 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php @@ -36,7 +36,7 @@ */ namespace Magento\Checkout\Block\Cart\Item; -class Renderer extends \Magento\Core\Block\Template +class Renderer extends \Magento\View\Block\Template { /** @var \Magento\Checkout\Model\Session */ protected $_checkoutSession; @@ -63,25 +63,25 @@ class Renderer extends \Magento\Core\Block\Template * * @var \Magento\Catalog\Helper\Product\Configuration */ - protected $_productConfigur = null; + protected $_productConfig = null; /** - * @param \Magento\Catalog\Helper\Product\Configuration $productConfigur + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Product\Configuration $productConfig * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Product\Configuration $productConfigur, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Product\Configuration $productConfig, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { - $this->_productConfigur = $productConfigur; + $this->_productConfig = $productConfig; $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -273,7 +273,7 @@ public function getProductName() public function getProductOptions() { /* @var $helper \Magento\Catalog\Helper\Product\Configuration */ - $helper = $this->_productConfigur; + $helper = $this->_productConfig; return $helper->getCustomOptions($this->getItem()); } @@ -316,7 +316,7 @@ public function getDeleteUrl() 'checkout/cart/delete', array( 'id'=>$this->getItem()->getId(), - \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED => $encodedUrl + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $encodedUrl ) ); } @@ -372,15 +372,15 @@ public function getMessages() // Add messages saved previously in checkout session $checkoutSession = $this->getCheckoutSession(); if ($checkoutSession) { - /* @var $collection \Magento\Core\Model\Message\Collection */ + /* @var $collection \Magento\Message\Collection */ $collection = $checkoutSession->getQuoteItemMessages($quoteItem->getId(), true); if ($collection) { $additionalMessages = $collection->getItems(); foreach ($additionalMessages as $message) { - /* @var $message \Magento\Core\Model\Message\AbstractMessage */ + /* @var $message \Magento\Message\AbstractMessage */ $messages[] = array( 'text' => $message->getCode(), - 'type' => ($message->getType() == \Magento\Core\Model\Message::ERROR) ? 'error' : 'notice' + 'type' => ($message->getType() == \Magento\Message\Factory::ERROR) ? 'error' : 'notice' ); } } @@ -412,7 +412,7 @@ public function getMessages() public function getFormatedOptionValue($optionValue) { /* @var $helper \Magento\Catalog\Helper\Product\Configuration */ - $helper = $this->_productConfigur; + $helper = $this->_productConfig; $params = array( 'max_length' => 55, 'cut_replacer' => ' ...' @@ -433,7 +433,7 @@ public function isProductVisible() /** * Return product additional information block * - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ public function getProductAdditionalInformationBlock() { diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Renderer/Configurable.php b/app/code/Magento/Checkout/Block/Cart/Item/Renderer/Configurable.php index 1ce40228c922c..9e68d55c65ba8 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Renderer/Configurable.php @@ -109,6 +109,6 @@ public function getProductAttributes() */ public function getOptionList() { - return $this->_productConfigur->getConfigurableOptions($this->getItem()); + return $this->_productConfig->getConfigurableOptions($this->getItem()); } } diff --git a/app/code/Magento/Checkout/Block/Cart/Link.php b/app/code/Magento/Checkout/Block/Cart/Link.php index 597cdeddc2fee..c9fd4c0ce92ed 100644 --- a/app/code/Magento/Checkout/Block/Cart/Link.php +++ b/app/code/Magento/Checkout/Block/Cart/Link.php @@ -35,18 +35,18 @@ class Link extends \Magento\Page\Block\Link protected $_moduleManager; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Module\Manager $moduleManager * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Module\Manager $moduleManager, array $data = array() ) { - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); $this->_moduleManager = $moduleManager; } diff --git a/app/code/Magento/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Checkout/Block/Cart/Shipping.php index 5abc237102569..9f2de88b2b6cc 100644 --- a/app/code/Magento/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Checkout/Block/Cart/Shipping.php @@ -53,25 +53,25 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart protected $_directoryBlock; /** - * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Directory\Block\Data $directoryBlock * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Directory\Block\Data $directoryBlock, array $data = array() ) { $this->_directoryBlock = $directoryBlock; - parent::__construct($catalogData, $coreData, $context, $customerSession, $checkoutSession, $data); + parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/Sidebar.php b/app/code/Magento/Checkout/Block/Cart/Sidebar.php index cb38717271b7c..c7eb59e7c4576 100644 --- a/app/code/Magento/Checkout/Block/Cart/Sidebar.php +++ b/app/code/Magento/Checkout/Block/Cart/Sidebar.php @@ -50,11 +50,6 @@ class Sidebar extends \Magento\Checkout\Block\Cart\AbstractCart */ protected $_catalogUrl; - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Tax\Model\Config */ @@ -66,37 +61,34 @@ class Sidebar extends \Magento\Checkout\Block\Cart\AbstractCart protected $_checkoutCart; /** - * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Model\Resource\Url $catalogUrl - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Tax\Model\Config $taxConfig * @param \Magento\Checkout\Model\Cart $checkoutCart * @param array $data */ public function __construct( - \Magento\Tax\Helper\Data $taxData, - \Magento\Catalog\Helper\Data $catalogData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Model\Resource\Url $catalogUrl, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Tax\Model\Config $taxConfig, \Magento\Checkout\Model\Cart $checkoutCart, array $data = array() ) { $this->_taxData = $taxData; $this->_catalogUrl = $catalogUrl; - $this->_storeManager = $storeManager; $this->_taxConfig = $taxConfig; $this->_checkoutCart = $checkoutCart; - parent::__construct($catalogData, $coreData, $context, $customerSession, $checkoutSession, $data); + parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); } /** @@ -333,7 +325,7 @@ protected function _serializeRenders() { $result = array(); foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $block) { - /** @var $block \Magento\Core\Block\Template */ + /** @var $block \Magento\View\Block\Template */ $result[] = implode('|', array( // skip $this->getNameInLayout() and '.' substr($block->getNameInLayout(), strlen($this->getNameInLayout()) + 1), diff --git a/app/code/Magento/Checkout/Block/Cart/Totals.php b/app/code/Magento/Checkout/Block/Cart/Totals.php index cae238ed8823a..6a18cfecf9653 100644 --- a/app/code/Magento/Checkout/Block/Cart/Totals.php +++ b/app/code/Magento/Checkout/Block/Cart/Totals.php @@ -38,40 +38,25 @@ class Totals extends \Magento\Checkout\Block\Cart\AbstractCart protected $_salesConfig; /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Sales\Model\Config $salesConfig * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, - \Magento\Sales\Model\Config $salesConfig, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Sales\Model\Config $salesConfig, array $data = array() ) { $this->_salesConfig = $salesConfig; - $this->_storeManager = $storeManager; - parent::__construct( - $catalogData, - $coreData, - $context, - $customerSession, - $checkoutSession, - $data - ); + parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); } diff --git a/app/code/Magento/Checkout/Block/Link.php b/app/code/Magento/Checkout/Block/Link.php index ec77a89541abf..e830d7d8156fe 100644 --- a/app/code/Magento/Checkout/Block/Link.php +++ b/app/code/Magento/Checkout/Block/Link.php @@ -35,18 +35,18 @@ class Link extends \Magento\Page\Block\Link protected $_moduleManager; /** - * @param \Magento\Core\Block\Template\Context $context - * @param \Magento\Module\Manager $moduleManager + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Module\Manager $moduleManager * @param array $data */ public function __construct( - \Magento\Core\Block\Template\Context $context, - \Magento\Module\Manager $moduleManager, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, + \Magento\Module\Manager $moduleManager, array $data = array() ) { - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); $this->_moduleManager = $moduleManager; } diff --git a/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php b/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php index 29e2d24f34d1f..e7c36860c30e7 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php +++ b/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Multishipping; -class AbstractMultishipping extends \Magento\Core\Block\Template +class AbstractMultishipping extends \Magento\View\Block\Template { /** * @var \Magento\Checkout\Model\Type\Multishipping @@ -41,19 +41,19 @@ class AbstractMultishipping extends \Magento\Core\Block\Template protected $_multishipping; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_multishipping = $multishipping; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Addresses.php b/app/code/Magento/Checkout/Block/Multishipping/Addresses.php index 6cc7b3e293363..ca5d94b845235 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Addresses.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Addresses.php @@ -46,22 +46,22 @@ class Addresses extends \Magento\Sales\Block\Items\AbstractItems protected $_multishipping; /** - * @param \Magento\Filter\Object\GridFactory $filterGridFactory + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Filter\Object\GridFactory $filterGridFactory * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\Filter\Object\GridFactory $filterGridFactory, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Filter\Object\GridFactory $filterGridFactory, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_filterGridFactory = $filterGridFactory; $this->_multishipping = $multishipping; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -107,7 +107,7 @@ public function getItems() */ public function getAddressesHtmlSelect($item, $index) { - $select = $this->getLayout()->createBlock('Magento\Core\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') ->setName('ship['.$index.']['.$item->getQuoteItemId().'][address]') ->setId('ship_'.$index.'_'.$item->getQuoteItemId().'_address') ->setValue($item->getCustomerAddressId()) diff --git a/app/code/Magento/Checkout/Block/Multishipping/Billing.php b/app/code/Magento/Checkout/Block/Multishipping/Billing.php index 657aa88b884a9..7acc228644469 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Billing.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Billing.php @@ -46,22 +46,22 @@ class Billing extends \Magento\Payment\Block\Form\Container protected $_checkoutSession; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_multishipping = $multishipping; $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php b/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php index b917018a4bfa7..374dc895e4e67 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php @@ -46,22 +46,22 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems protected $_checkoutSession; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_multishipping = $multishipping; $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Link.php b/app/code/Magento/Checkout/Block/Multishipping/Link.php index 570c54deb0d16..c46940f9017bf 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Link.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Link.php @@ -29,7 +29,7 @@ */ namespace Magento\Checkout\Block\Multishipping; -class Link extends \Magento\Core\Block\Template +class Link extends \Magento\View\Block\Template { /** * Checkout data @@ -44,22 +44,22 @@ class Link extends \Magento\Core\Block\Template protected $_checkoutSession; /** - * @param \Magento\Checkout\Helper\Data $checkoutData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Checkout\Helper\Data $checkoutData * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\Checkout\Helper\Data $checkoutData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Checkout\Helper\Data $checkoutData, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutData = $checkoutData; $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Overview.php b/app/code/Magento/Checkout/Block/Multishipping/Overview.php index e9219bdbae1a7..240ba98ec05a9 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Overview.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Overview.php @@ -46,19 +46,19 @@ class Overview extends \Magento\Sales\Block\Items\AbstractItems protected $_multishipping; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_multishipping = $multishipping; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -362,7 +362,7 @@ public function getRowItemHtml(\Magento\Object $item) * Retrieve renderer block for row-level item output * * @param string $type - * @return \Magento\Core\Block\AbstractBlock + * @return \Magento\View\Block\AbstractBlock */ protected function _getRowItemRenderer($type) { diff --git a/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php b/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php index 33d9374bd16f2..ecd73a13d1072 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php @@ -41,21 +41,21 @@ class Info extends \Magento\Payment\Block\Info\AbstractContainer protected $_multishipping; /** - * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Payment\Helper\Data $paymentData, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_multishipping = $multishipping; - parent::__construct($paymentData, $coreData, $context, $data); + parent::__construct($context, $coreData, $paymentData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Shipping.php b/app/code/Magento/Checkout/Block/Multishipping/Shipping.php index a2a58b8fdd22d..3c729003c0516 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Shipping.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Shipping.php @@ -41,22 +41,22 @@ class Shipping extends \Magento\Sales\Block\Items\AbstractItems protected $_filterGridFactory; /** - * @param \Magento\Filter\Object\GridFactory $filterGridFactory + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Filter\Object\GridFactory $filterGridFactory * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\Filter\Object\GridFactory $filterGridFactory, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Filter\Object\GridFactory $filterGridFactory, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_filterGridFactory = $filterGridFactory; $this->_multishipping = $multishipping; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/State.php b/app/code/Magento/Checkout/Block/Multishipping/State.php index 9a1a5fb7a6561..c6eae8c6bd340 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/State.php +++ b/app/code/Magento/Checkout/Block/Multishipping/State.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Multishipping; -class State extends \Magento\Core\Block\Template +class State extends \Magento\View\Block\Template { /** * @var \Magento\Checkout\Model\Type\Multishipping\State @@ -41,19 +41,19 @@ class State extends \Magento\Core\Block\Template protected $_multishippingState; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping\State $multishippingState * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping\State $multishippingState, array $data = array() ) { $this->_multishippingState = $multishippingState; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Success.php b/app/code/Magento/Checkout/Block/Multishipping/Success.php index 3f1ae6f5937c1..245f1fa0b6760 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Success.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Success.php @@ -36,26 +36,18 @@ class Success extends \Magento\Checkout\Block\Multishipping\AbstractMultishipping { /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, - \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { - $this->_storeManager = $storeManager; - parent::__construct($coreData, $context, $multishipping,$data); + parent::__construct($context, $coreData, $multishipping, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php index d71b70adf7be3..b8bc7e5e727de 100644 --- a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php +++ b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php @@ -31,7 +31,7 @@ */ namespace Magento\Checkout\Block\Onepage; -abstract class AbstractOnepage extends \Magento\Core\Block\Template +abstract class AbstractOnepage extends \Magento\View\Block\Template { /** * @var \Magento\App\Cache\Type\Config @@ -44,11 +44,6 @@ abstract class AbstractOnepage extends \Magento\Core\Block\Template protected $_regionCollection; protected $_addressesCollection; - /** - * @var \Magento\Customer\Model\Session - */ - protected $_customerSession; - /** * @var \Magento\Checkout\Model\Session */ @@ -65,30 +60,23 @@ abstract class AbstractOnepage extends \Magento\Core\Block\Template protected $_countryCollFactory; /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, array $data = array() ) { $this->_configCacheType = $configCacheType; @@ -96,8 +84,7 @@ public function __construct( $this->_checkoutSession = $resourceSession; $this->_countryCollFactory = $countryCollFactory; $this->_regionCollFactory = $regionCollFactory; - $this->_storeManager = $storeManager; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** @@ -198,7 +185,7 @@ public function getAddressesHtmlSelect($type) } } - $select = $this->getLayout()->createBlock('Magento\Core\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') ->setName($type.'_address_id') ->setId($type.'-address-select') ->setClass('address-select') @@ -220,7 +207,7 @@ public function getCountryHtmlSelect($type) if (is_null($countryId)) { $countryId = $this->_coreData->getDefaultCountry(); } - $select = $this->getLayout()->createBlock('Magento\Core\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') ->setName($type.'[country_id]') ->setId($type.':country_id') ->setTitle(__('Country')) @@ -233,7 +220,7 @@ public function getCountryHtmlSelect($type) public function getRegionHtmlSelect($type) { - $select = $this->getLayout()->createBlock('Magento\Core\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') ->setName($type.'[region]') ->setId($type.':region') ->setTitle(__('State/Province')) diff --git a/app/code/Magento/Checkout/Block/Onepage/Billing.php b/app/code/Magento/Checkout/Block/Onepage/Billing.php index d06a8dab64033..416c6de0ffb6a 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Billing.php +++ b/app/code/Magento/Checkout/Block/Onepage/Billing.php @@ -56,32 +56,38 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_addressFactory; /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\Quote\AddressFactory $addressFactory * @param array $data */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Quote\AddressFactory $addressFactory, array $data = array() ) { $this->_addressFactory = $addressFactory; - parent::__construct($configCacheType, $coreData, $context, $customerSession, $resourceSession, - $countryCollFactory, $regionCollFactory, $storeManager, $data); + parent::__construct( + $context, + $coreData, + $configCacheType, + $customerSession, + $resourceSession, + $countryCollFactory, + $regionCollFactory, + $data + ); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Failure.php b/app/code/Magento/Checkout/Block/Onepage/Failure.php index 8832a192ddbc9..eb2d74dd9f045 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Failure.php +++ b/app/code/Magento/Checkout/Block/Onepage/Failure.php @@ -27,7 +27,7 @@ namespace Magento\Checkout\Block\Onepage; -class Failure extends \Magento\Core\Block\Template +class Failure extends \Magento\View\Block\Template { /** * @var \Magento\Checkout\Model\Session @@ -35,19 +35,19 @@ class Failure extends \Magento\Core\Block\Template protected $_checkoutSession; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } public function getRealOrderId() diff --git a/app/code/Magento/Checkout/Block/Onepage/Link.php b/app/code/Magento/Checkout/Block/Onepage/Link.php index 17e2215e6e176..ae1c190e0607e 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Link.php +++ b/app/code/Magento/Checkout/Block/Onepage/Link.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Onepage; -class Link extends \Magento\Core\Block\Template +class Link extends \Magento\View\Block\Template { /** * @var \Magento\Checkout\Model\Session @@ -41,19 +41,19 @@ class Link extends \Magento\Core\Block\Template protected $_checkoutSession; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Login.php b/app/code/Magento/Checkout/Block/Onepage/Login.php index 7c9f0e46a8ec1..082db96ccc128 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Login.php +++ b/app/code/Magento/Checkout/Block/Onepage/Login.php @@ -44,33 +44,39 @@ class Login extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_checkoutData = null; /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Checkout\Helper\Data $checkoutData * @param array $data */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Helper\Data $checkoutData, array $data = array() ) { $this->_checkoutData = $checkoutData; - parent::__construct($configCacheType, $coreData, $context, $customerSession, $resourceSession, - $countryCollFactory, $regionCollFactory, $storeManager, $data); + parent::__construct( + $context, + $coreData, + $configCacheType, + $customerSession, + $resourceSession, + $countryCollFactory, + $regionCollFactory, + $data + ); } protected function _construct() diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php index a44351c4e74da..1f38720086d38 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php @@ -41,21 +41,21 @@ class Info extends \Magento\Payment\Block\Info\AbstractContainer protected $_checkoutSession; /** - * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\Payment\Helper\Data $paymentData, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($paymentData, $coreData, $context,$data); + parent::__construct($context, $coreData, $paymentData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php index 5dae3261a291b..4615084fab167 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php @@ -42,19 +42,19 @@ class Methods extends \Magento\Payment\Block\Form\Container protected $_checkoutSession; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php index 4eabc4048ca48..935cc6b89df4b 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php @@ -37,19 +37,19 @@ class Info extends \Magento\Sales\Block\Items\AbstractItems protected $_checkoutSession; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping.php b/app/code/Magento/Checkout/Block/Onepage/Shipping.php index 113a0ea8e7a2a..01a26f747670c 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping.php @@ -44,32 +44,38 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_addressFactory; /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\Quote\AddressFactory $addressFactory * @param array $data */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Quote\AddressFactory $addressFactory, array $data = array() ) { $this->_addressFactory = $addressFactory; - parent::__construct($configCacheType, $coreData, $context, $customerSession, $resourceSession, - $countryCollFactory, $regionCollFactory, $storeManager, $data); + parent::__construct( + $context, + $coreData, + $configCacheType, + $customerSession, + $resourceSession, + $countryCollFactory, + $regionCollFactory, + $data + ); } /** 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 d6886091e36ed..42d925dd3da54 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -47,32 +47,38 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_taxData = null; /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context + * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Tax\Helper\Data $taxData * @param array $data */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, + \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Tax\Helper\Data $taxData, array $data = array() ) { $this->_taxData = $taxData; - parent::__construct($configCacheType, $coreData, $context, $customerSession, $resourceSession, - $countryCollFactory, $regionCollFactory, $storeManager, $data); + parent::__construct( + $context, + $coreData, + $configCacheType, + $customerSession, + $resourceSession, + $countryCollFactory, + $regionCollFactory, + $data + ); } public function getShippingRates() diff --git a/app/code/Magento/Checkout/Block/Onepage/Success.php b/app/code/Magento/Checkout/Block/Onepage/Success.php index 48f6474e6b1e3..a5e27ecd562e3 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Success.php +++ b/app/code/Magento/Checkout/Block/Onepage/Success.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Onepage; -class Success extends \Magento\Core\Block\Template +class Success extends \Magento\View\Block\Template { /** * @var \Magento\Checkout\Model\Session @@ -66,8 +66,8 @@ class Success extends \Magento\Core\Block\Template protected $_orderConfig; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\OrderFactory $orderFactory @@ -77,8 +77,8 @@ class Success extends \Magento\Core\Block\Template * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, @@ -93,7 +93,7 @@ public function __construct( $this->_agreementFactory = $agreementFactory; $this->_profileCollFactory = $profileCollFactory; $this->_orderConfig = $orderConfig; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Success.php b/app/code/Magento/Checkout/Block/Success.php index 426bf4d2d5f85..efead2fd444ae 100644 --- a/app/code/Magento/Checkout/Block/Success.php +++ b/app/code/Magento/Checkout/Block/Success.php @@ -24,10 +24,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - namespace Magento\Checkout\Block; -class Success extends \Magento\Core\Block\Template +class Success extends \Magento\View\Block\Template { /** * @var \Magento\Sales\Model\OrderFactory @@ -35,19 +34,19 @@ class Success extends \Magento\Core\Block\Template protected $_orderFactory; /** + * @param \Magento\View\Block\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Block\Template\Context $context * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param array $data */ public function __construct( + \Magento\View\Block\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\Core\Block\Template\Context $context, \Magento\Sales\Model\OrderFactory $orderFactory, array $data = array() ) { $this->_orderFactory = $orderFactory; - parent::__construct($coreData, $context, $data); + parent::__construct($context, $coreData, $data); } /** diff --git a/app/code/Magento/Checkout/Controller/Action.php b/app/code/Magento/Checkout/Controller/Action.php index cfce1fb113395..134ef1794b111 100644 --- a/app/code/Magento/Checkout/Controller/Action.php +++ b/app/code/Magento/Checkout/Controller/Action.php @@ -30,7 +30,7 @@ */ namespace Magento\Checkout\Controller; -abstract class Action extends \Magento\Core\Controller\Front\Action +abstract class Action extends \Magento\App\Action\Action { /** * @var \Magento\Customer\Model\Session @@ -38,11 +38,11 @@ abstract class Action extends \Magento\Core\Controller\Front\Action protected $_customerSession; /** - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @param \Magento\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession */ public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, + \Magento\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession ) { $this->_customerSession = $customerSession; @@ -70,7 +70,7 @@ protected function _preDispatchValidateCustomer($redirect = true, $addErrors = t } if ($redirect) { $this->_redirect('customer/account/edit'); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); } return false; } diff --git a/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php b/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php index 8deba3850f3b0..533ad31afa8ae 100644 --- a/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php +++ b/app/code/Magento/Checkout/Controller/Adminhtml/Agreement.php @@ -26,7 +26,7 @@ namespace Magento\Checkout\Controller\Adminhtml; -class Agreement extends \Magento\Backend\Controller\Adminhtml\Action +class Agreement extends \Magento\Backend\App\Action { /** * Core registry @@ -36,11 +36,11 @@ class Agreement extends \Magento\Backend\Controller\Adminhtml\Action protected $_coreRegistry = null; /** - * @param \Magento\Backend\Controller\Context $context + * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Backend\Controller\Context $context, + \Magento\Backend\App\Action\Context $context, \Magento\Core\Model\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -49,11 +49,13 @@ public function __construct( public function indexAction() { - $this->_title(__('Terms and Conditions')); + $this->_title->add(__('Terms and Conditions')); $this->_initAction() - ->_addContent($this->getLayout()->createBlock('Magento\Checkout\Block\Adminhtml\Agreement')) - ->renderLayout(); + ->_addContent( + $this->_view->getLayout()->createBlock('Magento\Checkout\Block\Adminhtml\Agreement') + ); + $this->_view->renderLayout(); return $this; } @@ -64,7 +66,7 @@ public function newAction() public function editAction() { - $this->_title(__('Terms and Conditions')); + $this->_title->add(__('Terms and Conditions')); $id = $this->getRequest()->getParam('id'); $agreementModel = $this->_objectManager->create('Magento\Checkout\Model\Agreement'); @@ -80,7 +82,7 @@ public function editAction() } } - $this->_title($agreementModel->getId() ? $agreementModel->getName() : __('New Condition')); + $this->_title->add($agreementModel->getId() ? $agreementModel->getName() : __('New Condition')); $data = $this->_objectManager->get('Magento\Adminhtml\Model\Session')->getAgreementData(true); if (!empty($data)) { @@ -95,11 +97,11 @@ public function editAction() $id ? __('Edit Condition') : __('New Condition') ) ->_addContent( - $this->getLayout() + $this->_view->getLayout() ->createBlock('Magento\Checkout\Block\Adminhtml\Agreement\Edit') ->setData('action', $this->getUrl('checkout/*/save')) - ) - ->renderLayout(); + ); + $this->_view->renderLayout(); } public function saveAction() @@ -123,7 +125,7 @@ public function saveAction() } $this->_objectManager->get('Magento\Adminhtml\Model\Session')->setAgreementData($postData); - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); } } @@ -149,18 +151,18 @@ public function deleteAction() $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addError(__('Something went wrong while deleting this condition.')); } - $this->_redirectReferer(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); } /** * Initialize action * - * @return \Magento\Backend\Controller\Adminhtml\Action + * @return \Magento\Backend\App\Action */ protected function _initAction() { - $this->loadLayout() - ->_setActiveMenu('Magento_Checkout::sales_checkoutagreement') + $this->_view->loadLayout(); + $this->_setActiveMenu('Magento_Checkout::sales_checkoutagreement') ->_addBreadcrumb(__('Sales'), __('Sales')) ->_addBreadcrumb(__('Checkout Conditions'), __('Checkout Terms and Conditions')); return $this; diff --git a/app/code/Magento/Checkout/Controller/Cart.php b/app/code/Magento/Checkout/Controller/Cart.php index 9d439f87b2abf..abc32c9735e44 100644 --- a/app/code/Magento/Checkout/Controller/Cart.php +++ b/app/code/Magento/Checkout/Controller/Cart.php @@ -30,16 +30,9 @@ namespace Magento\Checkout\Controller; class Cart - extends \Magento\Core\Controller\Front\Action + extends \Magento\App\Action\Action implements \Magento\Catalog\Controller\Product\View\ViewInterface { - /** - * Action list where need check enabled cookie - * - * @var array - */ - protected $_cookieCheckActions = array('add'); - /** * @var \Magento\Core\Model\Store\ConfigInterface */ @@ -51,18 +44,26 @@ class Cart protected $_checkoutSession; /** - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + + /** + * @param \Magento\App\Action\Context $context * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, + \Magento\App\Action\Context $context, \Magento\Core\Model\Store\ConfigInterface $storeConfig, - \Magento\Checkout\Model\Session $checkoutSession + \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Core\Model\StoreManagerInterface $storeManager ) { - parent::__construct($context); $this->_storeConfig = $storeConfig; $this->_checkoutSession = $checkoutSession; + $this->_storeManager = $storeManager; + parent::__construct($context); } /** @@ -93,17 +94,17 @@ protected function _getQuote() protected function _goBack() { $returnUrl = $this->getRequest()->getParam('return_url'); - if ($returnUrl && $this->_isUrlInternal($returnUrl)) { + if ($returnUrl && $this->_isInternalUrl($returnUrl)) { $this->_checkoutSession->getMessages(true); $this->getResponse()->setRedirect($returnUrl); } elseif (!$this->_storeConfig->getConfig('checkout/cart/redirect_to_cart') && !$this->getRequest()->getParam('in_cart') - && $backUrl = $this->_getRefererUrl() + && $backUrl = $this->_redirect->getRefererUrl() ) { $this->getResponse()->setRedirect($backUrl); } else { if (($this->getRequest()->getActionName() == 'add') && !$this->getRequest()->getParam('in_cart')) { - $this->_checkoutSession->setContinueShoppingUrl($this->_getRefererUrl()); + $this->_checkoutSession->setContinueShoppingUrl($this->_redirect->getRefererUrl()); } $this->_redirect('checkout/cart'); } @@ -173,12 +174,13 @@ public function indexAction() $this->_checkoutSession->setCartWasUpdated(true); \Magento\Profiler::start(__METHOD__ . 'cart_display'); - $this - ->loadLayout() - ->_initLayoutMessages('Magento\Checkout\Model\Session') - ->_initLayoutMessages('Magento\Catalog\Model\Session') - ->getLayout()->getBlock('head')->setTitle(__('Shopping Cart')); - $this->renderLayout(); + $messageStores = array('Magento\Checkout\Model\Session', 'Magento\Catalog\Model\Session'); + + $this->_view->loadLayout(); + $layout = $this->_view->getLayout(); + $layout->initMessages($messageStores); + $layout->getBlock('head')->setTitle(__('Shopping Cart')); + $this->_view->renderLayout(); \Magento\Profiler::stop(__METHOD__ . 'cart_display'); } @@ -237,7 +239,9 @@ public function addAction() } else { $messages = array_unique(explode("\n", $e->getMessage())); foreach ($messages as $message) { - $this->_checkoutSession->addError($this->_objectManager->get('Magento\Escaper')->escapeHtml($message)); + $this->_checkoutSession->addError( + $this->_objectManager->get('Magento\Escaper')->escapeHtml($message) + ); } } @@ -245,7 +249,8 @@ public function addAction() if ($url) { $this->getResponse()->setRedirect($url); } else { - $this->_redirectReferer($this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl()); + $cartUrl = $this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($cartUrl)); } } catch (\Exception $e) { $this->_checkoutSession->addException($e, __('We cannot add this item to your shopping cart')); @@ -387,7 +392,8 @@ public function updateItemOptionsAction() if ($url) { $this->getResponse()->setRedirect($url); } else { - $this->_redirectReferer($this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl()); + $cartUrl = $this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl(); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($cartUrl)); } } catch (\Exception $e) { $this->_checkoutSession->addException($e, __('We cannot update the item.')); @@ -468,7 +474,7 @@ protected function _emptyShoppingCart() } /** - * Delete shoping cart item action + * Delete shopping cart item action */ public function deleteAction() { @@ -482,7 +488,8 @@ public function deleteAction() $this->_objectManager->get('Magento\Logger')->logException($e); } } - $this->_redirectReferer($this->_objectManager->create('Magento\UrlInterface')->getUrl('*/*')); + $defaultUrl = $this->_objectManager->create('Magento\UrlInterface')->getUrl('*/*'); + $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($defaultUrl)); } /** @@ -529,10 +536,9 @@ public function couponPostAction() return; } - $couponCode = (string) $this->getRequest()->getParam('coupon_code'); - if ($this->getRequest()->getParam('remove') == 1) { - $couponCode = ''; - } + $couponCode = $this->getRequest()->getParam('remove') == 1 + ? '' + : trim($this->getRequest()->getParam('coupon_code')); $oldCouponCode = $this->_getQuote()->getCouponCode(); if (!strlen($couponCode) && !strlen($oldCouponCode)) { @@ -572,4 +578,26 @@ public function couponPostAction() $this->_goBack(); } + + /** + * check if URL corresponds store + * + * @param string $url + * @return bool + */ + protected function _isInternalUrl($url) + { + if (strpos($url, 'http') === false) { + return false; + } + + /** + * Url must start from base secure or base unsecure url + */ + /** @var $store \Magento\Core\Model\Store */ + $store = $this->_storeManager->getStore(); + $unsecure = (strpos($url, $store->getBaseUrl()) === 0); + $secure = (strpos($url, $store->getBaseUrl($store::URL_TYPE_LINK, true)) === 0); + return $unsecure || $secure; + } } diff --git a/app/code/Magento/Checkout/Controller/Index.php b/app/code/Magento/Checkout/Controller/Index.php index 848da112a7369..a11df22a6d7f7 100644 --- a/app/code/Magento/Checkout/Controller/Index.php +++ b/app/code/Magento/Checkout/Controller/Index.php @@ -26,7 +26,7 @@ namespace Magento\Checkout\Controller; -class Index extends \Magento\Core\Controller\Front\Action +class Index extends \Magento\App\Action\Action { function indexAction() { diff --git a/app/code/Magento/Checkout/Controller/Multishipping.php b/app/code/Magento/Checkout/Controller/Multishipping.php index 29da8e0daf564..740efd0d36521 100644 --- a/app/code/Magento/Checkout/Controller/Multishipping.php +++ b/app/code/Magento/Checkout/Controller/Multishipping.php @@ -31,6 +31,9 @@ */ namespace Magento\Checkout\Controller; +use Magento\App\Action\NotFoundException; +use Magento\App\RequestInterface; + class Multishipping extends \Magento\Checkout\Controller\Action { /** @@ -74,21 +77,19 @@ protected function _getCheckoutSession() } /** - * Action predispatch - * - * Check customer authentication for some actions + * Dispatch request * - * @return \Magento\Checkout\Controller\Multishipping + * @param RequestInterface $request + * @return $this|mixed */ - public function preDispatch() + public function dispatch(RequestInterface $request) { - parent::preDispatch(); - - if ($this->getFlag('', 'redirectLogin')) { - return $this; + $this->_request = $request; + if ($this->_actionFlag->get('', 'redirectLogin')) { + return parent::dispatch($request); } - $action = $this->getRequest()->getActionName(); + $action = $request->getActionName(); $checkoutSessionQuote = $this->_getCheckoutSession()->getQuote(); /** @@ -103,22 +104,22 @@ public function preDispatch() && !in_array($action, array('login', 'register', 'success')) ) { $this->_redirect('*/*/index'); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); - return $this; + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); + return parent::dispatch($request); } if (!in_array($action, array('login', 'register'))) { $customerSession = $this->_objectManager->get('Magento\Customer\Model\Session'); if (!$customerSession->authenticate($this, $this->_getHelper()->getMSLoginUrl())) { - $this->setFlag('', self::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); } if (!$this->_objectManager->get('Magento\Checkout\Helper\Data')->isMultishippingCheckoutAvailable()) { $error = $this->_getCheckout()->getMinimumAmountError(); $this->_getCheckoutSession()->addError($error); - $this->_redirectUrl($this->_getHelper()->getCartUrl()); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); - return $this; + $this->getResponse()->setRedirect($this->_getHelper()->getCartUrl()); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); + return parent::dispatch($request); } } @@ -129,22 +130,22 @@ public function preDispatch() if ($this->_getCheckoutSession()->getCartWasUpdated(true) && !in_array($action, array('index', 'login', 'register', 'addresses', 'success')) ) { - $this->_redirectUrl($this->_getHelper()->getCartUrl()); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); + $this->getResponse()->setRedirect($this->_getHelper()->getCartUrl()); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); + return parent::dispatch($request); } if ($action == 'success' && $this->_getCheckout()->getCheckoutSession()->getDisplaySuccess(true)) { - return $this; + return parent::dispatch($request); } $quote = $this->_getCheckout()->getQuote(); if (!$quote->hasItems() || $quote->getHasError() || $quote->isVirtual()) { - $this->_redirectUrl($this->_getHelper()->getCartUrl()); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); - return; + $this->getResponse()->setRedirect($this->_getHelper()->getCartUrl()); + $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); } - return $this; + return parent::dispatch($request); } /** @@ -166,15 +167,15 @@ public function loginAction() return; } - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Customer\Model\Session'); // set account create url - $loginForm = $this->getLayout()->getBlock('customer_form_login'); + $loginForm = $this->_view->getLayout()->getBlock('customer_form_login'); if ($loginForm) { $loginForm->setCreateAccountUrl($this->_getHelper()->getMSRegisterUrl()); } - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -183,14 +184,14 @@ public function loginAction() public function registerAction() { if ($this->_objectManager->get('Magento\Customer\Model\Session')->isLoggedIn()) { - $this->_redirectUrl($this->_getHelper()->getMSCheckoutUrl()); + $this->getResponse()->setRedirect($this->_getHelper()->getMSCheckoutUrl()); return; } - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Customer\Model\Session'); - $registerForm = $this->getLayout()->getBlock('customer_form_register'); + $registerForm = $this->_view->getLayout()->getBlock('customer_form_register'); if ($registerForm) { $registerForm->setShowAddressFields(true) ->setBackUrl($this->_getHelper()->getMSLoginUrl()) @@ -198,7 +199,7 @@ public function registerAction() ->setErrorUrl($this->_getHelper()->getCurrentUrl()); } - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -223,10 +224,10 @@ public function addressesAction() $message = $this->_getCheckout()->getMinimumAmountDescription(); $this->_getCheckout()->getCheckoutSession()->addNotice($message); } - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); - $this->renderLayout(); + $this->_view->loadLayout(); + $messageStores = array('Magento\Customer\Model\Session', 'Magento\Checkout\Model\Session'); + $this->_view->getLayout()->initMessages($messageStores); + $this->_view->renderLayout(); } /** @@ -326,10 +327,10 @@ public function shippingAction() $this->_getState()->setActiveStep( \Magento\Checkout\Model\Type\Multishipping\State::STEP_SHIPPING ); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); - $this->renderLayout(); + $this->_view->loadLayout(); + $messageStores = array('Magento\Customer\Model\Session', 'Magento\Checkout\Model\Session'); + $this->_view->getLayout()->initMessages($messageStores); + $this->_view->renderLayout(); } public function backToShippingAction() @@ -387,10 +388,10 @@ public function billingAction() \Magento\Checkout\Model\Type\Multishipping\State::STEP_BILLING ); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); - $this->renderLayout(); + $this->_view->loadLayout(); + $messageStores = array('Magento\Customer\Model\Session', 'Magento\Checkout\Model\Session'); + $this->_view->getLayout()->initMessages($messageStores); + $this->_view->renderLayout(); } /** @@ -445,10 +446,10 @@ public function overviewAction() \Magento\Checkout\Model\Type\Multishipping\State::STEP_BILLING ); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - $this->renderLayout(); + $this->_view->loadLayout(); + $messageStores = array('Magento\Customer\Model\Session', 'Magento\Checkout\Model\Session'); + $this->_view->getLayout()->initMessages($messageStores); + $this->_view->renderLayout(); } catch (\Magento\Core\Exception $e) { $this->_getCheckoutSession()->addError($e->getMessage()); $this->_redirect('*/*/billing'); @@ -536,11 +537,11 @@ public function successAction() return $this; } - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Checkout\Model\Session'); $ids = $this->_getCheckout()->getOrderIds(); $this->_eventManager->dispatch('checkout_multishipping_controller_success_action', array('order_ids' => $ids)); - $this->renderLayout(); + $this->_view->renderLayout(); } /** @@ -549,7 +550,7 @@ public function successAction() */ public function redirectLogin() { - $this->setFlag('', 'no-dispatch', true); + $this->_actionFlag->set('', 'no-dispatch', true); $url = $this->_objectManager->create('Magento\UrlInterface') ->getUrl('*/*', array('_secure' => true)); $this->_objectManager->get('Magento\Customer\Model\Session')->setBeforeAuthUrl($url); @@ -561,6 +562,6 @@ public function redirectLogin() ) ); - $this->setFlag('', 'redirectLogin', true); + $this->_actionFlag->set('', 'redirectLogin', true); } } diff --git a/app/code/Magento/Checkout/Controller/Multishipping/Address.php b/app/code/Magento/Checkout/Controller/Multishipping/Address.php index cebec53488063..7bf410342f9a8 100644 --- a/app/code/Magento/Checkout/Controller/Multishipping/Address.php +++ b/app/code/Magento/Checkout/Controller/Multishipping/Address.php @@ -33,25 +33,8 @@ */ namespace Magento\Checkout\Controller\Multishipping; -class Address extends \Magento\Core\Controller\Front\Action +class Address extends \Magento\App\Action\Action { - /** - * @var \Magento\UrlInterface - */ - protected $_urlBuilder; - - /** - * @param \Magento\Core\Controller\Varien\Action\Context $context - * @param \Magento\UrlInterface $urlBuilder - */ - public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, - \Magento\UrlInterface $urlBuilder - ) { - $this->_urlBuilder = $urlBuilder; - parent::__construct($context); - } - /** * Retrieve multishipping checkout model * @@ -79,25 +62,24 @@ protected function _getState() public function newShippingAction() { $this->_getState()->setActiveStep(\Magento\Checkout\Model\Type\Multishipping\State::STEP_SELECT_ADDRESSES); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) { + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Customer\Model\Session'); + if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { $addressForm->setTitle(__('Create Shipping Address')) - ->setSuccessUrl($this->_urlBuilder->getUrl('*/*/shippingSaved')) - ->setErrorUrl($this->_urlBuilder->getUrl('*/*/*')); + ->setSuccessUrl($this->_url->getUrl('*/*/shippingSaved')) + ->setErrorUrl($this->_url->getUrl('*/*/*')); - if ($headBlock = $this->getLayout()->getBlock('head')) { + if ($headBlock = $this->_view->getLayout()->getBlock('head')) { $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle()); } if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) { - $addressForm->setBackUrl($this->_urlBuilder->getUrl('*/multishipping/addresses')); - } - else { - $addressForm->setBackUrl($this->_urlBuilder->getUrl('*/cart/')); + $addressForm->setBackUrl($this->_url->getUrl('*/multishipping/addresses')); + } else { + $addressForm->setBackUrl($this->_url->getUrl('*/cart/')); } } - $this->renderLayout(); + $this->_view->renderLayout(); } public function shippingSavedAction() @@ -114,22 +96,22 @@ public function shippingSavedAction() public function editShippingAction() { $this->_getState()->setActiveStep(\Magento\Checkout\Model\Type\Multishipping\State::STEP_SHIPPING); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) { + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Customer\Model\Session'); + if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { $addressForm->setTitle(__('Edit Shipping Address')) - ->setSuccessUrl($this->_urlBuilder->getUrl('*/*/editShippingPost', array('id'=>$this->getRequest()->getParam('id')))) - ->setErrorUrl($this->_urlBuilder->getUrl('*/*/*')); + ->setSuccessUrl($this->_url->getUrl('*/*/editShippingPost', array('id'=>$this->getRequest()->getParam('id')))) + ->setErrorUrl($this->_url->getUrl('*/*/*')); - if ($headBlock = $this->getLayout()->getBlock('head')) { + if ($headBlock = $this->_view->getLayout()->getBlock('head')) { $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle()); } if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) { - $addressForm->setBackUrl($this->_urlBuilder->getUrl('*/multishipping/shipping')); + $addressForm->setBackUrl($this->_url->getUrl('*/multishipping/shipping')); } } - $this->renderLayout(); + $this->_view->renderLayout(); } public function editShippingPostAction() @@ -144,44 +126,44 @@ public function editShippingPostAction() public function selectBillingAction() { $this->_getState()->setActiveStep(\Magento\Checkout\Model\Type\Multishipping\State::STEP_BILLING); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); - $this->renderLayout(); + $this->_view->loadLayout(); + $messageStores = array('Magento\Customer\Model\Session', 'Magento\Catalog\Model\Session'); + $this->_view->getLayout()->initMessages($messageStores); + $this->_view->renderLayout(); } public function newBillingAction() { - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) { + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Customer\Model\Session'); + if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { $addressForm->setTitle(__('Create Billing Address')) - ->setSuccessUrl($this->_urlBuilder->getUrl('*/*/selectBilling')) - ->setErrorUrl($this->_urlBuilder->getUrl('*/*/*')) - ->setBackUrl($this->_urlBuilder->getUrl('*/*/selectBilling')); + ->setSuccessUrl($this->_url->getUrl('*/*/selectBilling')) + ->setErrorUrl($this->_url->getUrl('*/*/*')) + ->setBackUrl($this->_url->getUrl('*/*/selectBilling')); - if ($headBlock = $this->getLayout()->getBlock('head')) { + if ($headBlock = $this->_view->getLayout()->getBlock('head')) { $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle()); } } - $this->renderLayout(); + $this->_view->renderLayout(); } public function editAddressAction() { - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) { + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Customer\Model\Session'); + if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { $addressForm->setTitle(__('Edit Address')) - ->setSuccessUrl($this->_urlBuilder->getUrl('*/*/selectBilling')) - ->setErrorUrl($this->_urlBuilder->getUrl('*/*/*', array('id'=>$this->getRequest()->getParam('id')))) - ->setBackUrl($this->_urlBuilder->getUrl('*/*/selectBilling')); + ->setSuccessUrl($this->_url->getUrl('*/*/selectBilling')) + ->setErrorUrl($this->_url->getUrl('*/*/*', array('id'=>$this->getRequest()->getParam('id')))) + ->setBackUrl($this->_url->getUrl('*/*/selectBilling')); - if ($headBlock = $this->getLayout()->getBlock('head')) { + if ($headBlock = $this->_view->getLayout()->getBlock('head')) { $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle()); } } - $this->renderLayout(); + $this->_view->renderLayout(); } public function editBillingAction() @@ -189,18 +171,18 @@ public function editBillingAction() $this->_getState()->setActiveStep( \Magento\Checkout\Model\Type\Multishipping\State::STEP_BILLING ); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) { + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Customer\Model\Session'); + if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { $addressForm->setTitle(__('Edit Billing Address')) - ->setSuccessUrl($this->_urlBuilder->getUrl('*/*/saveBilling', array('id'=>$this->getRequest()->getParam('id')))) - ->setErrorUrl($this->_urlBuilder->getUrl('*/*/*', array('id'=>$this->getRequest()->getParam('id')))) - ->setBackUrl($this->_urlBuilder->getUrl('*/multishipping/overview')); - if ($headBlock = $this->getLayout()->getBlock('head')) { + ->setSuccessUrl($this->_url->getUrl('*/*/saveBilling', array('id'=>$this->getRequest()->getParam('id')))) + ->setErrorUrl($this->_url->getUrl('*/*/*', array('id'=>$this->getRequest()->getParam('id')))) + ->setBackUrl($this->_url->getUrl('*/multishipping/overview')); + if ($headBlock = $this->_view->getLayout()->getBlock('head')) { $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle()); } } - $this->renderLayout(); + $this->_view->renderLayout(); } public function setBillingAction() diff --git a/app/code/Magento/Checkout/Controller/Onepage.php b/app/code/Magento/Checkout/Controller/Onepage.php index 0a538f3918e58..f74a3a11743ea 100644 --- a/app/code/Magento/Checkout/Controller/Onepage.php +++ b/app/code/Magento/Checkout/Controller/Onepage.php @@ -26,6 +26,9 @@ namespace Magento\Checkout\Controller; +use Magento\App\Action\NotFoundException; +use Magento\App\RequestInterface; + class Onepage extends \Magento\Checkout\Controller\Action { /** @@ -50,12 +53,12 @@ class Onepage extends \Magento\Checkout\Controller\Action protected $_coreRegistry = null; /** - * @param \Magento\Core\Controller\Varien\Action\Context $context + * @param \Magento\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Registry $coreRegistry */ public function __construct( - \Magento\Core\Controller\Varien\Action\Context $context, + \Magento\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Registry $coreRegistry ) { @@ -64,11 +67,15 @@ public function __construct( } /** - * @return \Magento\Checkout\Controller\Onepage|null + * Dispatch request + * + * @param RequestInterface $request + * @return mixed + * @throws \Magento\App\Action\NotFoundException */ - public function preDispatch() + public function dispatch(RequestInterface $request) { - parent::preDispatch(); + $this->_request = $request; $this->_preDispatchValidateCustomer(); $checkoutSessionQuote = $this->_objectManager->get('Magento\Checkout\Model\Session')->getQuote(); @@ -78,12 +85,9 @@ public function preDispatch() } if (!$this->_canShowForUnregisteredUsers()) { - $this->norouteAction(); - $this->setFlag('', self::FLAG_NO_DISPATCH, true); - return null; + throw new NotFoundException(); } - - return $this; + return parent::dispatch($request); } /** @@ -129,7 +133,7 @@ protected function _expireAjax() */ protected function _getHtmlByHandle($handle) { - $layout = $this->getLayout(); + $layout = $this->_view->getLayout(); $layout->getUpdate()->addPageHandles(array($handle)); $layout->getUpdate()->load(); $layout->generateXml(); @@ -217,10 +221,11 @@ public function indexAction() ->getUrl('*/*/*', array('_secure'=>true)); $this->_objectManager->get('Magento\Customer\Model\Session')->setBeforeAuthUrl($currentUrl); $this->getOnepage()->initCheckout(); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Customer\Model\Session'); - $this->getLayout()->getBlock('head')->setTitle(__('Checkout')); - $this->renderLayout(); + $this->_view->loadLayout(); + $layout = $this->_view->getLayout(); + $layout->initMessages('Magento\Customer\Model\Session'); + $layout->getBlock('head')->setTitle(__('Checkout')); + $this->_view->renderLayout(); } /** @@ -231,9 +236,9 @@ public function progressAction() if ($this->_expireAjax()) { return; } - $this->addPageLayoutHandles(); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->addPageLayoutHandles(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } public function shippingMethodAction() @@ -241,9 +246,9 @@ public function shippingMethodAction() if ($this->_expireAjax()) { return; } - $this->addPageLayoutHandles(); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->addPageLayoutHandles(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } public function reviewAction() @@ -251,9 +256,9 @@ public function reviewAction() if ($this->_expireAjax()) { return; } - $this->addPageLayoutHandles(); - $this->loadLayout(false); - $this->renderLayout(); + $this->_view->addPageLayoutHandles(); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -276,12 +281,12 @@ public function successAction() } $session->clear(); - $this->loadLayout(); - $this->_initLayoutMessages('Magento\Checkout\Model\Session'); + $this->_view->loadLayout(); + $this->_view->getLayout()->initMessages('Magento\Checkout\Model\Session'); $this->_eventManager->dispatch( 'checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)) ); - $this->renderLayout(); + $this->_view->renderLayout(); } public function failureAction() @@ -294,8 +299,8 @@ public function failureAction() return; } - $this->loadLayout(); - $this->renderLayout(); + $this->_view->loadLayout(); + $this->_view->renderLayout(); } @@ -620,18 +625,6 @@ public function saveOrderAction() $this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result)); } - /** - * Filtering posted data. Converting localized data if needed - * - * @param array - * @return array - */ - protected function _filterPostData($data) - { - $data = $this->_filterDates($data, array('dob')); - return $data; - } - /** * Check can page show for unregistered users * diff --git a/app/code/Magento/Checkout/Helper/Cart.php b/app/code/Magento/Checkout/Helper/Cart.php index f25f095da6bd2..eef0d2f0c9425 100644 --- a/app/code/Magento/Checkout/Helper/Cart.php +++ b/app/code/Magento/Checkout/Helper/Cart.php @@ -65,16 +65,16 @@ class Cart extends \Magento\Core\Helper\Url protected $_checkoutSession; /** - * @param \Magento\Core\Helper\Context $context - * @param \Magento\Core\Model\StoreManager $storeManager + * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Checkout\Model\Cart $checkoutCart * @param \Magento\Checkout\Model\Session $checkoutSession */ public function __construct( - \Magento\Core\Helper\Context $context, - \Magento\Core\Model\StoreManager $storeManager, + \Magento\App\Helper\Context $context, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Checkout\Model\Cart $checkoutCart, @@ -107,7 +107,7 @@ public function getCart() public function getAddUrl($product, $additional = array()) { $continueUrl = $this->_coreData->urlEncode($this->getCurrentUrl()); - $urlParamName = \Magento\Core\Controller\Front\Action::PARAM_NAME_URL_ENCODED; + $urlParamName = \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED; $routeParams = array( $urlParamName => $continueUrl, @@ -141,7 +141,7 @@ public function getRemoveUrl($item) { $params = array( 'id'=>$item->getId(), - \Magento\Core\Controller\Front\Action::PARAM_NAME_BASE64_URL => $this->getCurrentBase64Url() + \Magento\App\Action\Action::PARAM_NAME_BASE64_URL => $this->getCurrentBase64Url() ); return $this->_getUrl('checkout/cart/delete', $params); } diff --git a/app/code/Magento/Checkout/Helper/Data.php b/app/code/Magento/Checkout/Helper/Data.php index ba27c5b1dc1e2..531760bba5ff2 100644 --- a/app/code/Magento/Checkout/Helper/Data.php +++ b/app/code/Magento/Checkout/Helper/Data.php @@ -31,20 +31,13 @@ */ namespace Magento\Checkout\Helper; -class Data extends \Magento\Core\Helper\AbstractHelper +class Data extends \Magento\App\Helper\AbstractHelper { const XML_PATH_GUEST_CHECKOUT = 'checkout/options/guest_checkout'; const XML_PATH_CUSTOMER_MUST_BE_LOGGED = 'checkout/options/customer_must_be_logged'; protected $_agreements = null; - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - /** * Core store config * @@ -73,31 +66,28 @@ class Data extends \Magento\Core\Helper\AbstractHelper protected $_agreementCollFactory; /** - * @var \Magento\Core\Model\Email\TemplateFactory + * @var \Magento\Email\Model\TemplateFactory */ protected $_emailTemplFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Core\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollFactory - * @param \Magento\Core\Model\Email\TemplateFactory $emailTemplFactory + * @param \Magento\Email\Model\TemplateFactory $emailTemplFactory */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Helper\Context $context, + \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Core\Model\LocaleInterface $locale, \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollFactory, - \Magento\Core\Model\Email\TemplateFactory $emailTemplFactory + \Magento\Email\Model\TemplateFactory $emailTemplFactory ) { - $this->_eventManager = $eventManager; $this->_coreStoreConfig = $coreStoreConfig; $this->_storeManager = $storeManager; $this->_checkoutSession = $checkoutSession; @@ -221,14 +211,15 @@ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'one /* @var $translate \Magento\Core\Model\Translate */ $this->_translator->setTranslateInline(false); - /** @var \Magento\Core\Model\Email\Template $mailTemplate */ + /** @var \Magento\Email\Model\Template $mailTemplate */ $mailTemplate = $this->_emailTemplFactory->create(); - /* @var $mailTemplate \Magento\Core\Model\Email\Template */ $template = $this->_coreStoreConfig->getConfig('checkout/payment_failed/template', $checkout->getStoreId()); $copyTo = $this->_getEmails('checkout/payment_failed/copy_to', $checkout->getStoreId()); - $copyMethod = $this->_coreStoreConfig->getConfig('checkout/payment_failed/copy_method', $checkout->getStoreId()); + $copyMethod = $this->_coreStoreConfig->getConfig( + 'checkout/payment_failed/copy_method', $checkout->getStoreId() + ); if ($copyTo && $copyMethod == 'bcc') { $mailTemplate->addBcc($copyTo); } @@ -236,8 +227,12 @@ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'one $_receiver = $this->_coreStoreConfig->getConfig('checkout/payment_failed/receiver', $checkout->getStoreId()); $sendTo = array( array( - 'email' => $this->_coreStoreConfig->getConfig('trans_email/ident_'.$_receiver.'/email', $checkout->getStoreId()), - 'name' => $this->_coreStoreConfig->getConfig('trans_email/ident_'.$_receiver.'/name', $checkout->getStoreId()) + 'email' => $this->_coreStoreConfig->getConfig( + 'trans_email/ident_' . $_receiver . '/email', $checkout->getStoreId() + ), + 'name' => $this->_coreStoreConfig->getConfig( + 'trans_email/ident_' . $_receiver . '/name', $checkout->getStoreId() + ) ) ); diff --git a/app/code/Magento/Checkout/Model/Cart.php b/app/code/Magento/Checkout/Model/Cart.php index 667ecd068aee0..8ec67fb6c1d48 100644 --- a/app/code/Magento/Checkout/Model/Cart.php +++ b/app/code/Magento/Checkout/Model/Cart.php @@ -89,9 +89,9 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI protected $_customerSession; /** - * @var \Magento\Core\Model\Message + * @var \Magento\Message\Factory */ - protected $_message; + protected $messageFactory; /** * @param \Magento\Event\ManagerInterface $eventManager @@ -101,7 +101,7 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI * @param \Magento\Checkout\Model\Resource\Cart $resourceCart * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Core\Model\Message $message + * @param \Magento\Message\Factory $messageFactory * @param array $data */ public function __construct( @@ -112,7 +112,7 @@ public function __construct( \Magento\Checkout\Model\Resource\Cart $resourceCart, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, - \Magento\Core\Model\Message $message, + \Magento\Message\Factory $messageFactory, array $data = array() ) { $this->_eventManager = $eventManager; @@ -122,7 +122,7 @@ public function __construct( $this->_resourceCart = $resourceCart; $this->_checkoutSession = $checkoutSession; $this->_customerSession = $customerSession; - $this->_message = $message; + $this->messageFactory = $messageFactory; parent::__construct($data); } @@ -499,7 +499,9 @@ public function updateItems($data) if (isset($itemInfo['before_suggest_qty']) && ($itemInfo['before_suggest_qty'] != $qty)) { $qtyRecalculatedFlag = true; - $message = $this->_message->notice(__('Quantity was recalculated from %1 to %2', $itemInfo['before_suggest_qty'], $qty)); + $message = $this->messageFactory->notice( + __('Quantity was recalculated from %1 to %2', $itemInfo['before_suggest_qty'], $qty) + ); $session->addQuoteItemMessage($item->getId(), $message); } } diff --git a/app/code/Magento/Checkout/Model/Session.php b/app/code/Magento/Checkout/Model/Session.php index de136ca5222da..b67a58eaed30c 100644 --- a/app/code/Magento/Checkout/Model/Session.php +++ b/app/code/Magento/Checkout/Model/Session.php @@ -64,31 +64,16 @@ class Session extends \Magento\Core\Model\Session\AbstractSession */ protected $_orderFactory; - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - /** * @var \Magento\Customer\Model\Session */ protected $_customerSession; - /** - * @var \Magento\Core\Model\Message\CollectionFactory - */ - protected $_messageCollFactory; - /** * @var \Magento\Sales\Model\QuoteFactory */ protected $_quoteFactory; - /** - * @var \Magento\App\RequestInterface - */ - protected $_request; - /** * @var \Magento\HTTP\PhpEnvironment\RemoteAddress */ @@ -97,9 +82,7 @@ class Session extends \Magento\Core\Model\Session\AbstractSession /** * @param \Magento\Core\Model\Session\Context $context * @param \Magento\Sales\Model\OrderFactory $orderFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Core\Model\Message\CollectionFactory $messageCollFactory * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress * @param null $sessionName @@ -108,18 +91,14 @@ class Session extends \Magento\Core\Model\Session\AbstractSession public function __construct( \Magento\Core\Model\Session\Context $context, \Magento\Sales\Model\OrderFactory $orderFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, - \Magento\Core\Model\Message\CollectionFactory $messageCollFactory, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, $sessionName = null, array $data = array() ) { $this->_orderFactory = $orderFactory; - $this->_storeManager = $storeManager; $this->_customerSession = $customerSession; - $this->_messageCollFactory = $messageCollFactory; $this->_quoteFactory = $quoteFactory; $this->_remoteAddress = $remoteAddress; parent::__construct($context, $data); @@ -360,7 +339,7 @@ public function getAdditionalMessages($clear = false) * @param string $itemKey * @param bool $clear * - * @return null|\Magento\Core\Model\Message\Collection + * @return null|\Magento\Message\Collection */ public function getItemAdditionalMessages($itemKey, $clear = false) { @@ -382,7 +361,7 @@ public function getItemAdditionalMessages($itemKey, $clear = false) * itemKey is a unique hash (e.g 'quote_item17') to distinguish item messages among message collections * * @param string $itemKey - * @param \Magento\Core\Model\Message $message + * @param \Magento\Message\AbstractMessage $message * * @return \Magento\Checkout\Model\Session */ @@ -390,7 +369,7 @@ public function addItemAdditionalMessage($itemKey, $message) { $allMessages = $this->getAdditionalMessages(); if (!isset($allMessages[$itemKey])) { - $allMessages[$itemKey] = $this->_messageCollFactory->create(); + $allMessages[$itemKey] = $this->messagesFactory->create(); } $allMessages[$itemKey]->add($message); $this->setAdditionalMessages($allMessages); @@ -403,7 +382,7 @@ public function addItemAdditionalMessage($itemKey, $message) * @param int $itemId * @param bool $clear * - * @return null|\Magento\Core\Model\Message\Collection + * @return null|\Magento\Message\Collection */ public function getQuoteItemMessages($itemId, $clear = false) { @@ -414,11 +393,11 @@ public function getQuoteItemMessages($itemId, $clear = false) * Adds new message to a list of quote item messages, saved in this session * * @param int $itemId - * @param \Magento\Core\Model\Message $message + * @param \Magento\Message\AbstractMessage $message * * @return \Magento\Checkout\Model\Session */ - function addQuoteItemMessage($itemId, $message) + public function addQuoteItemMessage($itemId, $message) { return $this->addItemAdditionalMessage('quote_item' . $itemId, $message); } diff --git a/app/code/Magento/Checkout/etc/frontend/di.xml b/app/code/Magento/Checkout/etc/frontend/di.xml index 75935756987a8..7339df75782a9 100644 --- a/app/code/Magento/Checkout/etc/frontend/di.xml +++ b/app/code/Magento/Checkout/etc/frontend/di.xml @@ -37,4 +37,14 @@ + + + + add + + + + + + diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/multishipping/agreements.phtml b/app/code/Magento/Checkout/view/frontend/agreements.phtml similarity index 74% rename from app/design/frontend/magento_plushe/Magento_Checkout/multishipping/agreements.phtml rename to app/code/Magento/Checkout/view/frontend/agreements.phtml index c2d5797a9f646..5550fb0fd730b 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/multishipping/agreements.phtml +++ b/app/code/Magento/Checkout/view/frontend/agreements.phtml @@ -26,23 +26,23 @@ ?> -getAgreements()) return; ?> -
    +getAgreements()) return; ?> +
      getAgreements() as $_a): ?>
    1. -
      getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>> +
      getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>> getIsHtml()):?> getContent() ?> escapeHtml($_a->getContent())) ?>
      -
      +
      - +
    2. diff --git a/app/code/Magento/Checkout/view/frontend/cart.phtml b/app/code/Magento/Checkout/view/frontend/cart.phtml index 2931540d95f47..2725134f1311a 100644 --- a/app/code/Magento/Checkout/view/frontend/cart.phtml +++ b/app/code/Magento/Checkout/view/frontend/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) */ @@ -28,145 +27,11 @@ /** * Shopping cart template * - * @see \Magento\Checkout\Block\Cart + * @var $this \Magento\Checkout\Block\Cart */ -?> -getItemsCount()): ?> -
      -
      -

      - hasError()): ?> -
        - getMethods('top_methods') as $method): ?> - getMethodHtml($method)): ?> -
      • - - -
      - -
      - getMessagesBlock()->getGroupedHtml() ?> - getChildHtml('form_before') ?> - -
      - - - - - helper('Magento\Wishlist\Helper\Data')->isAllowInCart()) : ?> - - - helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - - - helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - - - - helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - - - helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - - - - helper('Magento\Tax\Helper\Data')->displayCartBothPrices() ? 2 : 1); ?> - - - - - - helper('Magento\Wishlist\Helper\Data')->isAllowInCart()) : ?> - - - - - - - - helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - - - - - - - - - - - - - - - getItems() as $_item): ?> - getItemHtml($_item) ?> - - -
        
      helper('Magento\Tax\Helper\Data')->getIncExcTaxLabel(false) ?>helper('Magento\Tax\Helper\Data')->getIncExcTaxLabel(true) ?>helper('Magento\Tax\Helper\Data')->getIncExcTaxLabel(false) ?>helper('Magento\Tax\Helper\Data')->getIncExcTaxLabel(true) ?>
      - getContinueShoppingUrl()): ?> - - - - - - -
      - -
      - -
      -
      -
      - getChildHtml('crosssell') ?> -
      -
      - - getChildHtml('checkout.cart.extra') ?> - getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?> -
      -
      -
      - getChildHtml('totals'); ?> - hasError()): ?> -
        - getMethods('methods') as $method): ?> - getMethodHtml($method)): ?> -
      • - - -
      - -
      -
      -
      - -
      -

      -
      -
      - getMessagesBlock()->getGroupedHtml() ?> - getChildHtml('checkout_cart_empty_widget'); ?> -

      -

      here to continue shopping.', $this->getContinueShoppingUrl()) ?>

      - getChildHtml('shopping.cart.table.after'); ?> -
      - +if ($this->getItemsCount()) { + echo $this->getChildHtml('with-items'); +} else { + echo $this->getChildHtml('no-items'); +} diff --git a/app/code/Magento/Checkout/view/frontend/cart/coupon.phtml b/app/code/Magento/Checkout/view/frontend/cart/coupon.phtml index 9386430baa075..9bd1430c089ac 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/coupon.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/coupon.phtml @@ -19,31 +19,38 @@ * 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) */ ?> -
      -
      -

      -
      - - -
      - -
      -
      - - getCouponCode())): ?> -   - -
      -
      -
      -
      - + //]]> + +
+
diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/cart/form.phtml b/app/code/Magento/Checkout/view/frontend/cart/form.phtml similarity index 96% rename from app/design/frontend/magento_plushe/Magento_Checkout/cart/form.phtml rename to app/code/Magento/Checkout/view/frontend/cart/form.phtml index 4efca67cfb04e..e139a2d49049e 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/cart/form.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/form.phtml @@ -18,17 +18,11 @@ * 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) */ -?> - helper('Magento\Tax\Helper\Data')->displayCartBothPrices() ? 2 : 1); ?>
@@ -39,7 +33,7 @@ - + helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> diff --git a/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml b/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml index e24f55d04aea4..1c13b896e1479 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml @@ -19,27 +19,25 @@ * 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) */ ?> - getProduct(); ?> isSaleable()): ?> -
+
isGrouped()): ?> - - getStockItem() && $_product->getStockItem()->getIsQtyDecimal()) : ?> - data-validate="{required:true, 'validate-greater-than-zero':true}"/> - - data-validate="{required:true, digits:true}"/> - +
+ +
+ +
+
- +
+ +
getChildHtml('', true) ?>
diff --git a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml index 1c3fff9ed0a2b..faf4f01808d9e 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml @@ -18,75 +18,70 @@ * 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) */ -?> -getItem(); $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility(); $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_item->getProduct(), \Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type::TYPE_BEFORE_ORDER_CONFIRM); ?> - - hasProductUrl()):?><?php echo $this->escapeHtml($this->getProductName()) ?>hasProductUrl()):?> - -

- hasProductUrl()):?> - escapeHtml($this->getProductName()) ?> - - escapeHtml($this->getProductName()) ?> - -

- getOptionList()):?> -
- - getFormatedOptionValue($_option) ?> -
escapeHtml($_option['label']) ?>
- class="truncated" data-mage-init="{truncateOptions:[]}"> - -
-
-
escapeHtml($_option['label']) ?>
-
-
-
- - - -
- - getMessages()): ?> - -

* escapeHtml($message['text']) ?>

- - - getProductAdditionalInformationBlock(); ?> - - setItem($_item)->toHtml() ?> + + + + hasProductUrl()):?> + + + getLayout()->createBlock('Magento\Catalog\Block\Product\Image')->init($_item->getProduct(), 'cart_page_product_thumbnail')->toHtml(); ?> + hasProductUrl()):?> +
+ + hasProductUrl()):?> + escapeHtml($this->getProductName()) ?> + + escapeHtml($this->getProductName()) ?> + + + getOptionList()):?> +
+ + getFormatedOptionValue($_option) ?> +
escapeHtml($_option['label']) ?>
+ class="truncated" data-mage-init="{truncateOptions:[]}"> + +
+
+
escapeHtml($_option['label']) ?>
+
+
+
+ + + +
+ + getMessages()): ?> + +
* escapeHtml($message['text']) ?>
+ + + getProductAdditionalInformationBlock(); ?> + + setItem($_item)->toHtml() ?> + +
+ - - - - - - helper('Magento\Wishlist\Helper\Data')->isAllowInCart()) : ?> - - - - - - - helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> colspan="2"> - - + helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> colspan="2"> + + getId(); ?> - + getProduct(); ?> + helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - + helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - + - + helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> - - helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> -