diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8730a663489..4baa1101f39e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,40 @@ +2.0.0.0-dev56 +============= +* Fixed bugs: + * Fixed placing order with PayPal Payments Advanced and Payflow Link + * Fixed losing previously assigned categories after saving the product with changed category selector field + * Fixed losing of a newly created category assignment after variations generation during Configurable product or Gift Card creation + * Fixed the error in order placement with Recurring profile payment +* GitHub requests: + * [#299](https://github.com/magento/magento2/pull/299) -- Fix for issue Refactor Mage_Rating_Model_Resource_Rating_Collection + * [#341](https://github.com/magento/magento2/pull/341) -- Replacing simple preg calls with less expensive alternates +* Modularity improvements: + * Layout page type config moved to library + * Design loader moved to library + * Theme label moved to library +* Themes update: + * Reduced amount of templates and layouts in magento_plushe theme + * Responsive design improvements +* Integrity improvements: + * Covered all Magento classes with argument sequence validator + * Added arguments type duplication validator +* Implemented API Integration UX flows: + * Ability to create and edit API Integrations + * Ability to delete API integrations that were not created using configuration files +* Removed System REST menu item and all associated UX flows: + * Users, Roles, and Webhook Subscriptions sub-menu items were removed +* Removed the Webhook module + 2.0.0.0-dev55 ============= * Modularity improvements: - * Session configuration moved to library - * FormKey logic was moved from Session - * SessionIdFlags from Session was removed + * Session configuration is moved to library + * FormKey logic is moved out from Session model + * SessionIdFlags is removed from Session model * Move Page logic to the Theme module and library -* Created integration module UX +* Created UX for the Integration module * Created authorization service (Magento_Authz module) + * Implemented an API Authz check in the Webapi framework * Fixed bugs: * Fixed the issue that prevented a customer group's shopping cart rules from applying properly to prices. The issue occurred when a customer was manually assigned to a customer group and automatic group assignment was enabled. * Fixed the bug with schema upgrade scripts not running after installation diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php index 2769b31300a89..04f0465b272f7 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -174,7 +174,7 @@ protected function _prepareForm() // Prepare form /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'use_container' => true, 'method' => 'post', diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index c9abc5bce283e..878c38cfcd87d 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -53,79 +53,80 @@ class Directpost extends \Magento\Paygate\Model\Authorizenet */ protected $_storeManager; - /** - * @var \Magento\Sales\Model\OrderFactory - */ - protected $_orderFactory; - /** * @var \Magento\Sales\Model\QuoteFactory */ protected $_quoteFactory; - /** - * @var \Magento\Authorizenet\Model\Directpost\RequestFactory - */ - protected $_requestFactory; - /** * @var \Magento\Authorizenet\Model\Directpost\Response */ protected $_response; /** - * Construct - * - * @param \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory - * @param \Magento\Paygate\Model\Authorizenet\RequestFactory $parentRequestFactory - * @param \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory - * @param \Magento\Sales\Model\OrderFactory $orderFactory - * @param \Magento\Core\Model\Session\AbstractSession $session - * @param \Magento\Logger $logger * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Paygate\Helper\Data $paygateData - * @param \Magento\Module\ModuleListInterface $moduleList - * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger $logger + * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Centinel\Model\Service $centinelService - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory + * @param \Magento\Paygate\Model\Authorizenet\RequestFactory $requestFactory + * @param \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory + * @param \Magento\Core\Model\Session\AbstractSession $session + * @param \Magento\Paygate\Helper\Data $paygateData + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\QuoteFactory $quoteFactory - * @param \Magento\Authorizenet\Model\Directpost\RequestFactory $requestFactory + * @param \Magento\Authorizenet\Model\Directpost\RequestFactory $directRequestFactory * @param \Magento\Authorizenet\Model\Directpost\Response $response * @param array $data + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory, - \Magento\Paygate\Model\Authorizenet\RequestFactory $parentRequestFactory, - \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory, - \Magento\Sales\Model\OrderFactory $orderFactory, - \Magento\Core\Model\Session\AbstractSession $session, - \Magento\Logger $logger, \Magento\Event\ManagerInterface $eventManager, - \Magento\Paygate\Helper\Data $paygateData, - \Magento\Module\ModuleListInterface $moduleList, - \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Payment\Helper\Data $paymentData, + \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger $logger, + \Magento\Module\ModuleListInterface $moduleList, \Magento\Core\Model\LocaleInterface $locale, \Magento\Centinel\Model\Service $centinelService, - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory, + \Magento\Paygate\Model\Authorizenet\RequestFactory $requestFactory, + \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory, \Magento\Sales\Model\OrderFactory $orderFactory, + \Magento\Core\Model\Session\AbstractSession $session, + \Magento\Paygate\Helper\Data $paygateData, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\QuoteFactory $quoteFactory, - \Magento\Authorizenet\Model\Directpost\RequestFactory $requestFactory, + \Magento\Authorizenet\Model\Directpost\RequestFactory $directRequestFactory, \Magento\Authorizenet\Model\Directpost\Response $response, array $data = array() ) { - parent::__construct($cardsFactory, $parentRequestFactory, $resultFactory, $orderFactory, $session, - $logger, $eventManager, $paygateData, $moduleList, $coreStoreConfig, $paymentData, - $logAdapterFactory, $locale, $centinelService, $data); + parent::__construct( + $eventManager, + $paymentData, + $coreStoreConfig, + $logAdapterFactory, + $logger, + $moduleList, + $locale, + $centinelService, + $cardsFactory, + $requestFactory, + $resultFactory, + $orderFactory, + $session, + $paygateData, + $data + ); $this->_storeManager = $storeManager; - $this->_orderFactory = $orderFactory; $this->_quoteFactory = $quoteFactory; - $this->_requestFactory = $requestFactory; + $this->_requestFactory = $directRequestFactory; $this->_response = $response; } diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Session.php b/app/code/Magento/Authorizenet/Model/Directpost/Session.php index 778a9f409225e..e7e3dfb566fd9 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Session.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Session.php @@ -39,15 +39,15 @@ class Session extends \Magento\Core\Model\Session\AbstractSession * @param \Magento\Core\Model\Session\Context $context * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig + * @param null $sessionName * @param array $data - * @param string|null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, - array $data = array(), - $sessionName = null + $sessionName = null, + array $data = array() ) { parent::__construct($context, $sidResolver, $sessionConfig, $data); $this->start('authorizenet_directpost', $sessionName); diff --git a/app/code/Magento/Authz/Service/AuthorizationV1.php b/app/code/Magento/Authz/Service/AuthorizationV1.php index cce2256d61a24..3c8d7d86a6efc 100644 --- a/app/code/Magento/Authz/Service/AuthorizationV1.php +++ b/app/code/Magento/Authz/Service/AuthorizationV1.php @@ -192,6 +192,23 @@ public function getAllowedResources(UserIdentifier $userIdentifier) return $allowedResources; } + /** + * {@inheritdoc} + */ + public function removePermissions(UserIdentifier $userIdentifier) + { + try { + $this->_deleteRole($userIdentifier); + } catch (ServiceException $e) { + throw $e; + } catch (\Exception $e) { + $this->_logger->logException($e); + throw new ServiceException( + __('Error happened while deleting role and permissions. Check exception log for details.') + ); + } + } + /** * Create new ACL role. * @@ -223,6 +240,28 @@ protected function _createRole($userIdentifier) return $role; } + /** + * Remove an ACL role. This deletes the cascading permissions + * + * @param UserIdentifier $userIdentifier + * @return Role + * @throws \LogicException + */ + protected function _deleteRole($userIdentifier) + { + $userType = $userIdentifier->getUserType(); + $userId = $userIdentifier->getUserId(); + switch ($userType) { + case UserIdentifier::USER_TYPE_INTEGRATION: + $roleName = $userType . $userId; + break; + default: + throw new \LogicException("Unknown user type: '{$userType}'."); + } + $role = $this->_roleFactory->create()->load($roleName, 'role_name'); + return $role->delete(); + } + /** * Identify user role from user identifier. * diff --git a/app/code/Magento/Authz/Service/AuthorizationV1Interface.php b/app/code/Magento/Authz/Service/AuthorizationV1Interface.php index 02b6f60d2c140..80cf0be14d375 100644 --- a/app/code/Magento/Authz/Service/AuthorizationV1Interface.php +++ b/app/code/Magento/Authz/Service/AuthorizationV1Interface.php @@ -69,4 +69,12 @@ public function isAllowed($resources, UserIdentifier $userIdentifier = null); * @throws ServiceException */ public function getAllowedResources(UserIdentifier $userIdentifier); + + /** + * Remove user role and associated permissions. + * + * @param UserIdentifier $userIdentifier + * @throws ServiceException + */ + public function removePermissions(UserIdentifier $userIdentifier); } diff --git a/app/code/Magento/Backend/App/Action/Context.php b/app/code/Magento/Backend/App/Action/Context.php index 1eec150730b63..c0728e95e4182 100644 --- a/app/code/Magento/Backend/App/Action/Context.php +++ b/app/code/Magento/Backend/App/Action/Context.php @@ -81,11 +81,11 @@ class Context extends \Magento\App\Action\Context * @param \Magento\App\ResponseInterface $response * @param \Magento\ObjectManager $objectManager * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Backend\Model\Session $session * @param \Magento\UrlInterface $url * @param \Magento\App\Response\RedirectInterface $redirect * @param \Magento\App\ActionFlag $actionFlag * @param \Magento\App\ViewInterface $view + * @param \Magento\Backend\Model\Session $session * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Backend\Model\Auth $auth * @param \Magento\Backend\Helper\Data $helper @@ -100,11 +100,11 @@ public function __construct( \Magento\App\ResponseInterface $response, \Magento\ObjectManager $objectManager, \Magento\Event\ManagerInterface $eventManager, - \Magento\Backend\Model\Session $session, \Magento\UrlInterface $url, \Magento\App\Response\RedirectInterface $redirect, \Magento\App\ActionFlag $actionFlag, \Magento\App\ViewInterface $view, + \Magento\Backend\Model\Session $session, \Magento\AuthorizationInterface $authorization, \Magento\Backend\Model\Auth $auth, \Magento\Backend\Helper\Data $helper, @@ -114,16 +114,8 @@ public function __construct( \Magento\Core\Model\LocaleInterface $locale, $canUseBaseUrl = false ) { - parent::__construct( - $request, - $response, - $objectManager, - $eventManager, - $url, - $redirect, - $actionFlag, - $view - ); + parent::__construct($request, $response, $objectManager, $eventManager, $url, $redirect, $actionFlag, $view); + $this->_session = $session; $this->_authorization = $authorization; $this->_auth = $auth; diff --git a/app/code/Magento/Backend/App/Router/DefaultRouter.php b/app/code/Magento/Backend/App/Router/DefaultRouter.php index 57c1b9c5d02fe..bde535d4029a3 100644 --- a/app/code/Magento/Backend/App/Router/DefaultRouter.php +++ b/app/code/Magento/Backend/App/Router/DefaultRouter.php @@ -44,22 +44,22 @@ class DefaultRouter extends \Magento\Core\App\Router\Base protected $_coreConfig; /** - * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\App\ActionFactory $actionFactory * @param \Magento\App\DefaultPathInterface $defaultPath * @param \Magento\App\ResponseFactory $responseFactory * @param \Magento\App\Route\ConfigInterface $routeConfig * @param \Magento\App\State $appState - * @param \Magento\Core\Model\Url|\Magento\UrlInterface $url - * @param \Magento\Core\Model\StoreManager|\Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\UrlInterface $url + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo - * @param $routerId + * @param string $routerId + * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Backend\App\ConfigInterface $backendConfig - * @throws \InvalidArgumentException + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\Config $coreConfig, \Magento\App\ActionFactory $actionFactory, \Magento\App\DefaultPathInterface $defaultPath, \Magento\App\ResponseFactory $responseFactory, @@ -70,11 +70,20 @@ public function __construct( \Magento\Core\Model\Store\Config $storeConfig, \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo, $routerId, + \Magento\Core\Model\Config $coreConfig, \Magento\Backend\App\ConfigInterface $backendConfig ) { parent::__construct( - $actionFactory, $defaultPath, $responseFactory, $routeConfig, $appState, $url, $storeManager, $storeConfig, - $urlSecurityInfo, $routerId + $actionFactory, + $defaultPath, + $responseFactory, + $routeConfig, + $appState, + $url, + $storeManager, + $storeConfig, + $urlSecurityInfo, + $routerId ); $this->_coreConfig = $coreConfig; $this->_backendConfig = $backendConfig; diff --git a/app/code/Magento/Backend/Block/Context.php b/app/code/Magento/Backend/Block/Context.php index be933a5adb5a5..28420ebb514d7 100644 --- a/app/code/Magento/Backend/Block/Context.php +++ b/app/code/Magento/Backend/Block/Context.php @@ -51,14 +51,14 @@ class Context extends \Magento\View\Element\Context * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig * @param \Magento\App\Cache\StateInterface $cacheState - * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Logger $logger * @param \Magento\Core\Model\App $app * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\AuthorizationInterface $authorization * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -77,12 +77,12 @@ public function __construct( \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, \Magento\App\Cache\StateInterface $cacheState, - \Magento\AuthorizationInterface $authorization, \Magento\Logger $logger, \Magento\Core\Model\App $app, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, \Magento\Core\Model\LocaleInterface $locale, + \Magento\AuthorizationInterface $authorization, array $data = array() ) { $this->_authorization = $authorization; 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 f5fdd0edbe4e5..3bdedf592d049 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 @@ -41,21 +41,21 @@ class Export extends \Magento\Data\Form\Element\AbstractElement protected $_helperFactory; /** - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\App\Helper\HelperFactory $helperFactory - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\App\Helper\HelperFactory $helperFactory, - array $attributes = array() + array $data = array() ) { $this->_helperFactory = $helperFactory; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } public function getElementHtml() 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 933a2a1986e62..a65b00c769500 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 @@ -38,20 +38,20 @@ class Regexceptions protected $_elementFactory; /** - * @var \Magento\Core\Model\Theme\LabelFactory + * @var \Magento\View\Design\Theme\LabelFactory */ protected $_labelFactory; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param \Magento\View\Design\Theme\LabelFactory $labelFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Data\Form\Element\Factory $elementFactory, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, + \Magento\View\Design\Theme\LabelFactory $labelFactory, array $data = array() ) { $this->_elementFactory = $elementFactory; @@ -84,7 +84,7 @@ protected function _construct() public function renderCellTemplate($columnName) { if ($columnName == 'value' && isset($this->_columns[$columnName])) { - /** @var $label \Magento\Core\Model\Theme\Label */ + /** @var $label \Magento\View\Design\Theme\Label */ $label = $this->_labelFactory->create(); $options = $label->getLabelsCollection(__('-- No Theme --')); $element = $this->_elementFactory->create('select'); 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 f41d6865deaad..9c94e95dd29bf 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 @@ -28,7 +28,7 @@ class General extends \Magento\Backend\Block\Widget\Form\Generic { /** - * @var \Magento\Core\Model\Theme\LabelFactory + * @var \Magento\View\Design\Theme\LabelFactory */ protected $_labelFactory; @@ -41,7 +41,7 @@ class General extends \Magento\Backend\Block\Widget\Form\Generic * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param \Magento\View\Design\Theme\LabelFactory $labelFactory * @param \Magento\Core\Model\System\Store $systemStore * @param array $data */ @@ -49,7 +49,7 @@ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, + \Magento\View\Design\Theme\LabelFactory $labelFactory, \Magento\Core\Model\System\Store $systemStore, array $data = array() ) { @@ -90,7 +90,7 @@ protected function _prepareForm() )); } - /** @var $label \Magento\Core\Model\Theme\Label */ + /** @var $label \Magento\View\Design\Theme\Label */ $label = $this->_labelFactory->create(); $options = $label->getLabelsCollection(__('-- Please Select --')); $fieldset->addField('design', 'select', array( diff --git a/app/code/Magento/Backend/Block/System/Store/Delete/Form.php b/app/code/Magento/Backend/Block/System/Store/Delete/Form.php index 24afcf4cd7a50..17f69c304b69b 100644 --- a/app/code/Magento/Backend/Block/System/Store/Delete/Form.php +++ b/app/code/Magento/Backend/Block/System/Store/Delete/Form.php @@ -53,7 +53,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/AbstractForm.php b/app/code/Magento/Backend/Block/System/Store/Edit/AbstractForm.php index c2b29edc020d0..d8a6907cf186b 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/AbstractForm.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/AbstractForm.php @@ -56,7 +56,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Backend/Block/System/Variable/Edit/Form.php b/app/code/Magento/Backend/Block/System/Variable/Edit/Form.php index 418f10eadd835..e434932502b61 100644 --- a/app/code/Magento/Backend/Block/System/Variable/Edit/Form.php +++ b/app/code/Magento/Backend/Block/System/Variable/Edit/Form.php @@ -54,7 +54,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Backend/Block/Template/Context.php b/app/code/Magento/Backend/Block/Template/Context.php index cc5d8166fb1eb..3ebe55ef7568c 100644 --- a/app/code/Magento/Backend/Block/Template/Context.php +++ b/app/code/Magento/Backend/Block/Template/Context.php @@ -66,16 +66,16 @@ class Context extends \Magento\View\Element\Template\Context * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig * @param \Magento\App\Cache\StateInterface $cacheState - * @param \Magento\App\Dir $dirs * @param \Magento\Logger $logger - * @param \Magento\Filesystem $filesystem - * @param \Magento\View\FileSystem $viewFileSystem - * @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\Core\Model\LocaleInterface $locale + * @param \Magento\App\Dir $dirs + * @param \Magento\Filesystem $filesystem + * @param \Magento\View\FileSystem $viewFileSystem + * @param \Magento\View\TemplateEnginePool $enginePool + * @param \Magento\App\State $appState * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Backend\Model\Session $backendSession @@ -101,16 +101,16 @@ public function __construct( \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, \Magento\App\Cache\StateInterface $cacheState, - \Magento\App\Dir $dirs, \Magento\Logger $logger, - \Magento\Filesystem $filesystem, - \Magento\View\FileSystem $viewFileSystem, - \Magento\View\TemplateEnginePool $enginePool, \Magento\Core\Model\App $app, - \Magento\App\State $appState, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, \Magento\Core\Model\LocaleInterface $locale, + \Magento\App\Dir $dirs, + \Magento\Filesystem $filesystem, + \Magento\View\FileSystem $viewFileSystem, + \Magento\View\TemplateEnginePool $enginePool, + \Magento\App\State $appState, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\AuthorizationInterface $authorization, \Magento\Backend\Model\Session $backendSession, @@ -138,16 +138,16 @@ public function __construct( $viewUrl, $viewConfig, $cacheState, - $dirs, $logger, - $filesystem, - $viewFileSystem, - $enginePool, $app, - $appState, $escaper, $filterManager, $locale, + $dirs, + $filesystem, + $viewFileSystem, + $enginePool, + $appState, $storeManager, $data ); diff --git a/app/code/Magento/Backend/Block/Widget/Container.php b/app/code/Magento/Backend/Block/Widget/Container.php index 558184496dbe1..d040ea541b1fa 100644 --- a/app/code/Magento/Backend/Block/Widget/Container.php +++ b/app/code/Magento/Backend/Block/Widget/Container.php @@ -163,7 +163,7 @@ public function removeButton($buttonId) * @param mixed $data * @return \Magento\Backend\Block\Widget\Container */ - protected function _updateButton($buttonId, $key=null, $data) + protected function _updateButton($buttonId, $key, $data) { foreach ($this->_buttons as $level => $buttons) { if (isset($buttons[$buttonId])) { @@ -194,7 +194,7 @@ protected function _updateButton($buttonId, $key=null, $data) * @param mixed $data * @return \Magento\Backend\Block\Widget\Container */ - public function updateButton($buttonId, $key = null, $data) + public function updateButton($buttonId, $key, $data) { return $this->_updateButton($buttonId, $key, $data); } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Theme.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Theme.php index d7f94fb6c59b8..60ec3d0bab603 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Theme.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Theme.php @@ -33,20 +33,20 @@ class Theme extends \Magento\Backend\Block\Widget\Grid\Column\Filter\AbstractFilter { /** - * @var \Magento\Core\Model\Theme\LabelFactory + * @var \Magento\View\Design\Theme\LabelFactory */ protected $_labelFactory; /** * @param \Magento\Backend\Block\Context $context * @param \Magento\Core\Model\Resource\Helper $resourceHelper - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param \Magento\View\Design\Theme\LabelFactory $labelFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Context $context, \Magento\Core\Model\Resource\Helper $resourceHelper, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, + \Magento\View\Design\Theme\LabelFactory $labelFactory, array $data = array() ) { $this->_labelFactory = $labelFactory; @@ -87,7 +87,7 @@ public function getOptions() { $options = $this->getColumn()->getOptions(); if (empty($options) || !is_array($options)) { - /** @var $label \Magento\Core\Model\Theme\Label */ + /** @var $label \Magento\View\Design\Theme\Label */ $label = $this->_labelFactory->create(); $options = $label->getLabelsCollection(); } 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 94ccea59c988d..0d8f1d5373561 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php @@ -40,7 +40,7 @@ class Additional extends \Magento\Backend\Block\Widget\Form\Generic { /** - * @var \Magento\Core\Model\Layout\Argument\HandlerFactory + * @var \Magento\View\Layout\Argument\HandlerFactory */ protected $_handlerFactory; @@ -48,14 +48,14 @@ class Additional extends \Magento\Backend\Block\Widget\Form\Generic * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory + * @param \Magento\View\Layout\Argument\HandlerFactory $handlerFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory, + \Magento\View\Layout\Argument\HandlerFactory $handlerFactory, array $data = array() ) { parent::__construct($context, $registry, $formFactory, $data); 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 caebd1ee74263..327a5432a94bd 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 @@ -152,6 +152,7 @@ public function statusAction() ->save(); } } + // fall-through intentional case \Magento\Core\Model\File\Storage\Flag::STATE_FINISHED: case \Magento\Core\Model\File\Storage\Flag::STATE_NOTIFIED: $flagData = $flag->getFlagData(); diff --git a/app/code/Magento/Backend/Model/Config/Structure/Reader.php b/app/code/Magento/Backend/Model/Config/Structure/Reader.php index 57e1953bb0726..babc69fc95d24 100644 --- a/app/code/Magento/Backend/Model/Config/Structure/Reader.php +++ b/app/code/Magento/Backend/Model/Config/Structure/Reader.php @@ -65,6 +65,7 @@ class Reader extends \Magento\Config\Reader\Filesystem * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -73,10 +74,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'system.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } } diff --git a/app/code/Magento/Backend/Model/Locale.php b/app/code/Magento/Backend/Model/Locale.php index f79c42fb435fe..07daff86781d0 100644 --- a/app/code/Magento/Backend/Model/Locale.php +++ b/app/code/Magento/Backend/Model/Locale.php @@ -55,10 +55,6 @@ class Locale extends \Magento\Core\Model\Locale /** * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Backend\Model\Session $session - * @param \Magento\Backend\Model\Locale\Manager $localeManager - * @param \Magento\App\RequestInterface $request - * @param \Magento\Core\Model\Locale\Validator $localeValidator * @param \Magento\Core\Helper\Translate $translate * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\State $appState @@ -67,16 +63,16 @@ class Locale extends \Magento\Core\Model\Locale * @param \Magento\Core\Model\App $app * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Date $dateModel - * @param string $locale - * + * @param \Magento\Backend\Model\Session $session + * @param \Magento\Backend\Model\Locale\Manager $localeManager + * @param \Magento\App\RequestInterface $request + * @param \Magento\Core\Model\Locale\Validator $localeValidator + * @param mixed $locale + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Event\ManagerInterface $eventManager, - \Magento\Backend\Model\Session $session, - \Magento\Backend\Model\Locale\Manager $localeManager, - \Magento\App\RequestInterface $request, - \Magento\Core\Model\Locale\Validator $localeValidator, \Magento\Core\Helper\Translate $translate, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\State $appState, @@ -85,6 +81,10 @@ public function __construct( \Magento\Core\Model\App $app, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Date $dateModel, + \Magento\Backend\Model\Session $session, + \Magento\Backend\Model\Locale\Manager $localeManager, + \Magento\App\RequestInterface $request, + \Magento\Core\Model\Locale\Validator $localeValidator, $locale = null ) { $this->_session = $session; diff --git a/app/code/Magento/Backend/Model/Menu/Config/Reader.php b/app/code/Magento/Backend/Model/Menu/Config/Reader.php index cbe1a9de74b96..73dfd4841d706 100644 --- a/app/code/Magento/Backend/Model/Menu/Config/Reader.php +++ b/app/code/Magento/Backend/Model/Menu/Config/Reader.php @@ -35,6 +35,7 @@ class Reader extends \Magento\Config\Reader\Filesystem * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -43,10 +44,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'menu.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Backend\Model\Menu\Config\Menu\Dom' + $domDocumentClass = 'Magento\Backend\Model\Menu\Config\Menu\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } } diff --git a/app/code/Magento/Backend/Model/Url.php b/app/code/Magento/Backend/Model/Url.php index f4e902d153c1f..a79a347df59da 100644 --- a/app/code/Magento/Backend/Model/Url.php +++ b/app/code/Magento/Backend/Model/Url.php @@ -105,18 +105,18 @@ class Url extends \Magento\Core\Model\Url * @var \Magento\Data\Form\FormKey */ protected $formKey; - + /** * @param \Magento\App\Route\ConfigInterface $routeConfig * @param \Magento\App\RequestInterface $request * @param \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Backend\Helper\Data $backendHelper + * @param \Magento\Core\Model\App $app + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Session $session * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Backend\Helper\Data $backendHelper * @param Menu\Config $menuConfig - * @param \Magento\Core\Model\App $app - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\CacheInterface $cache * @param Auth\Session $authSession * @param \Magento\Encryption\EncryptorInterface $encryptor @@ -126,18 +126,20 @@ class Url extends \Magento\Core\Model\Url * @param \Magento\Data\Form\FormKey $formKey * @param null $areaCode * @param array $data + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\App\Route\ConfigInterface $routeConfig, \Magento\App\RequestInterface $request, \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo, \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Backend\Helper\Data $backendHelper, + \Magento\Core\Model\App $app, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Session $session, \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Backend\Helper\Data $backendHelper, \Magento\Backend\Model\Menu\Config $menuConfig, - \Magento\Core\Model\App $app, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\CacheInterface $cache, \Magento\Backend\Model\Auth\Session $authSession, \Magento\Encryption\EncryptorInterface $encryptor, diff --git a/app/code/Magento/Backend/etc/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index a03ce759c0406..44e6841acd7a3 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -124,7 +124,7 @@ - Magento\Core\Model\Theme\Label::getLabelsCollectionForSystemConfiguration + Magento\View\Design\Theme\Label::getLabelsCollectionForSystemConfiguration Magento\Core\Model\Design\Backend\Theme diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 638faa9da90e1..550e9ec0cdfde 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -31,6 +31,7 @@ + diff --git a/app/code/Magento/Bundle/Model/Product/Price.php b/app/code/Magento/Bundle/Model/Product/Price.php index 9a5b72029060e..409ad68b7fa1b 100644 --- a/app/code/Magento/Bundle/Model/Product/Price.php +++ b/app/code/Magento/Bundle/Model/Product/Price.php @@ -140,7 +140,7 @@ public function getTotalBundleItemsPrice($product, $qty = null) * @param \Magento\Catalog\Model\Product $product * @return double */ - public function getFinalPrice($qty = null, $product) + public function getFinalPrice($qty, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); @@ -523,7 +523,7 @@ protected function _applyTierPrice($product, $qty, $finalPrice) * @param \Magento\Catalog\Model\Product $product * @return decimal */ - public function getTierPrice($qty=null, $product) + public function getTierPrice($qty, $product) { $allGroups = \Magento\Customer\Model\Group::CUST_GROUP_ALL; $prices = $product->getData('tier_price'); 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 1164f299018f6..28e8f57bbc792 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Image.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Image.php @@ -41,23 +41,23 @@ class Image extends \Magento\Data\Form\Element\Image protected $_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 + * @param \Magento\Escaper $escaper * @param \Magento\UrlInterface $urlBuilder - * @param array $attributes + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\UrlInterface $urlBuilder, - $attributes = array() + \Magento\Core\Model\StoreManagerInterface $storeManager, + $data = array() ) { $this->_storeManager = $storeManager; - parent::__construct($escaper, $factoryElement, $factoryCollection, $urlBuilder, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $urlBuilder, $data); } protected function _getUrl() 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 f77878d44083f..d9acf3257a916 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 @@ -82,7 +82,7 @@ public function getElementHtml() 'disabled' => true, ); /** @var \Magento\Data\Form\Element\Hidden $hidden */ - $hidden = $this->_elementFactory->create('hidden', array('attributes' => $data)); + $hidden = $this->_elementFactory->create('hidden', array('data' => $data)); $hidden->setForm($element->getForm()); $storeId = $element->getForm()->getDataObject()->getStoreId(); @@ -91,7 +91,7 @@ public function getElementHtml() $data['value'] = $element->getValue(); $data['checked'] = $this->_catalogData->shouldSaveUrlRewritesHistory($storeId); /** @var \Magento\Data\Form\Element\Checkbox $checkbox */ - $checkbox = $this->_elementFactory->create('checkbox', array('attributes' => $data)); + $checkbox = $this->_elementFactory->create('checkbox', array('data' => $data)); $checkbox->setForm($element->getForm()); return parent::getElementHtml() . '
' . $hidden->getElementHtml() . $checkbox->getElementHtml() . $checkbox->getLabelHtml(); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php index 22481c85d9139..39768756a3e98 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php @@ -60,30 +60,30 @@ class Wysiwyg extends \Magento\Data\Form\Element\Textarea protected $_layout; /** - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\View\LayoutInterface $layout - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\View\LayoutInterface $layout * @param \Magento\Module\Manager $moduleManager * @param \Magento\Backend\Helper\Data $backendData - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\View\LayoutInterface $layout, - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\View\LayoutInterface $layout, \Magento\Module\Manager $moduleManager, \Magento\Backend\Helper\Data $backendData, - array $attributes = array() + array $data = array() ) { $this->_wysiwygConfig = $wysiwygConfig; $this->_layout = $layout; $this->_moduleManager = $moduleManager; $this->_backendData = $backendData; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } /** 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 e732d9182d4fe..b57e110878298 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 @@ -69,7 +69,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'wysiwyg_edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Form.php index 8c173867c54b4..15fa712d5a930 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Form.php @@ -41,7 +41,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', 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 60792a268b0e5..690e3f927a4de 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 @@ -79,7 +79,7 @@ protected function _prepareForm() { $attributeObject = $this->getAttributeObject(); - $form = $this->_formFactory->create(array('attributes' => array( + $form = $this->_formFactory->create(array('data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post' 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 8ccfc9a5ebaca..70e7792346671 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 @@ -69,7 +69,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', 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 521f1fa1b86ca..b336778eadc47 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php @@ -72,7 +72,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'new_category_form', )) ); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php index 28dce9b62ca08..d1b6807ba37b9 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/BaseImage.php @@ -63,26 +63,26 @@ class BaseImage extends \Magento\Data\Form\Element\AbstractElement protected $_viewUrl; /** - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\View\UrlFactory $coreViewUrlFactory * @param \Magento\Backend\Model\UrlFactory $backendUrlFactory * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\File\Size $fileConfig - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\View\UrlFactory $coreViewUrlFactory, \Magento\Backend\Model\UrlFactory $backendUrlFactory, \Magento\Catalog\Helper\Data $catalogData, \Magento\File\Size $fileConfig, - array $attributes = array() + array $data = array() ) { - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); $this->_viewUrl = $coreViewUrlFactory->create(); $this->_url = $backendUrlFactory->create(); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php index c25f519a3d1e9..8fd0a345c7d3f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php @@ -48,40 +48,35 @@ class Category extends \Magento\Data\Form\Element\Multiselect */ protected $_collectionFactory; - /** - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - /** * @var \Magento\Json\EncoderInterface */ protected $_jsonEncoder; /** - * @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $collectionFactory - * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper + * @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $collectionFactory * @param \Magento\Backend\Helper\Data $backendData * @param \Magento\View\LayoutInterface $layout - * @param array $attributes + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Category\CollectionFactory $collectionFactory, - \Magento\Json\EncoderInterface $jsonEncoder, - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, + \Magento\Catalog\Model\Resource\Category\CollectionFactory $collectionFactory, \Magento\Backend\Helper\Data $backendData, \Magento\View\LayoutInterface $layout, - array $attributes = array() + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; $this->_collectionFactory = $collectionFactory; $this->_backendData = $backendData; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); $this->_layout = $layout; } 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 fba2da65e8a24..0c2f515892d88 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 @@ -47,24 +47,24 @@ class Gallery extends \Magento\Data\Form\Element\AbstractElement protected $_layout; /** - * @param \Magento\View\LayoutInterface $layout - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection - * @param array $attributes + * @param \Magento\Escaper $escaper + * @param \Magento\View\LayoutInterface $layout + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param array $data */ public function __construct( - \Magento\View\LayoutInterface $layout, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, - $attributes = array() + \Magento\Escaper $escaper, + \Magento\View\LayoutInterface $layout, + \Magento\Core\Model\StoreManagerInterface $storeManager, + $data = array() ) { $this->_layout = $layout; $this->_storeManager = $storeManager; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } public function getElementHtml() 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 c4c19bab14478..deb8206f74c97 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,27 +53,27 @@ class Price extends \Magento\Data\Form\Element\Text protected $_locale; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Tax\Helper\Data $taxData - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\LocaleInterface $locale, - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Model\LocaleInterface $locale, \Magento\Tax\Helper\Data $taxData, - array $attributes = array() + array $data = array() ) { $this->_locale = $locale; $this->_storeManager = $storeManager; $this->_taxData = $taxData; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Weight.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Weight.php index 75cab01e27d2a..374ac3b195fdb 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Weight.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Weight.php @@ -52,26 +52,26 @@ class Weight extends \Magento\Data\Form\Element\Text protected $_helper; /** - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\Catalog\Helper\Product $helper - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\Catalog\Helper\Product $helper, - array $attributes = array() + array $data = array() ) { $this->_helper = $helper; $this->_virtual = $factoryElement->create('checkbox'); $this->_virtual->setId(self::VIRTUAL_FIELD_HTML_ID)->setName('is_virtual') ->setLabel($this->_helper->getTypeSwitcherControlLabel()); - $attributes['class'] = + $data['class'] = 'validate-number validate-zero-or-greater validate-number-range number-range-0-99999999.9999'; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } /** 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 67e85f553d8f8..5af166e54249e 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php @@ -82,7 +82,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Catalog/Block/Category/View.php b/app/code/Magento/Catalog/Block/Category/View.php index 2c6d33afdba42..b35ce907683e7 100644 --- a/app/code/Magento/Catalog/Block/Category/View.php +++ b/app/code/Magento/Catalog/Block/Category/View.php @@ -103,7 +103,7 @@ protected function _prepareLayout() /** * want to show rss feed in the url */ - if ($this->IsRssCatalogEnable() && $this->IsTopCategory()) { + if ($this->isRssCatalogEnable() && $this->isTopCategory()) { $title = __('%1 RSS Feed', $this->getCurrentCategory()->getName()); $headBlock->addRss($title, $this->getRssLink()); } @@ -116,12 +116,12 @@ protected function _prepareLayout() return $this; } - public function IsRssCatalogEnable() + public function isRssCatalogEnable() { return $this->_storeConfig->getConfig('rss/catalog/category'); } - public function IsTopCategory() + public function isTopCategory() { return $this->getCurrentCategory()->getLevel()==2; } diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index 4dfa461a47c86..976d021cc7443 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -79,7 +79,6 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct * @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( @@ -92,7 +91,6 @@ public function __construct( \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; @@ -194,7 +192,7 @@ public function getIterableItem() /** * Set how many items we need to show in upsell block - * Notice: this parametr will be also applied + * Notice: this parameter will be also applied * * @param string $type * @param int $limit diff --git a/app/code/Magento/Catalog/Model/Attribute/Backend/Customlayoutupdate.php b/app/code/Magento/Catalog/Model/Attribute/Backend/Customlayoutupdate.php index 23a5997ac928b..307a86b15ceb8 100644 --- a/app/code/Magento/Catalog/Model/Attribute/Backend/Customlayoutupdate.php +++ b/app/code/Magento/Catalog/Model/Attribute/Backend/Customlayoutupdate.php @@ -34,29 +34,20 @@ class Customlayoutupdate extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend { - /** - * Product custom layout update attribute validate function. - * In case invalid data throws exception. - * - * @param \Magento\Object $object - * @throws \Magento\Eav\Model\Entity\Attribute\Exception - */ /** - * Layoutupdate validator factory + * Layout update validator factory * * @var \Magento\Core\Model\Layout\Update\ValidatorFactory */ protected $_layoutUpdateValidatorFactory; /** - * Construct - * - * @param \Magento\Core\Model\Layout\Update\ValidatorFactory $layoutUpdateValidatorFactory * @param \Magento\Logger $logger + * @param \Magento\Core\Model\Layout\Update\ValidatorFactory $layoutUpdateValidatorFactory */ public function __construct( - \Magento\Core\Model\Layout\Update\ValidatorFactory $layoutUpdateValidatorFactory, - \Magento\Logger $logger + \Magento\Logger $logger, + \Magento\Core\Model\Layout\Update\ValidatorFactory $layoutUpdateValidatorFactory ) { $this->_layoutUpdateValidatorFactory = $layoutUpdateValidatorFactory; parent::__construct($logger); diff --git a/app/code/Magento/Catalog/Model/Attribute/Config/Reader.php b/app/code/Magento/Catalog/Model/Attribute/Config/Reader.php index a03c78a96a326..237ab6022e632 100644 --- a/app/code/Magento/Catalog/Model/Attribute/Config/Reader.php +++ b/app/code/Magento/Catalog/Model/Attribute/Config/Reader.php @@ -27,23 +27,45 @@ class Reader extends \Magento\Config\Reader\Filesystem { + /** + * List of id attributes for merge + * + * @var array + */ + protected $_idAttributes = array( + '/config/group' => 'name', + '/config/group/attribute' => 'name', + ); + /** * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Catalog\Model\Attribute\Config\Converter $converter - * @param \Magento\Catalog\Model\Attribute\Config\SchemaLocator $schemaLocator + * @param Converter $converter + * @param SchemaLocator $schemaLocator * @param \Magento\Config\ValidationStateInterface $validationState + * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, \Magento\Catalog\Model\Attribute\Config\Converter $converter, \Magento\Catalog\Model\Attribute\Config\SchemaLocator $schemaLocator, - \Magento\Config\ValidationStateInterface $validationState + \Magento\Config\ValidationStateInterface $validationState, + $fileName = 'catalog_attributes.xml', + $idAttributes = array(), + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { - $fileName = 'catalog_attributes.xml'; - $idAttributes = array( - '/config/group' => 'name', - '/config/group/attribute' => 'name', + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); - parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes); } } diff --git a/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php b/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php index f126ea6af484b..b16fea5c54300 100644 --- a/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php +++ b/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php @@ -210,6 +210,7 @@ protected function _registerEvent(\Magento\Index\Model\Event $event) $this->_registerCoreStoreEvent($event); break; } + // fall-through intentional case \Magento\Core\Model\Store\Group::ENTITY: $event->addNewData('catalog_category_flat_skip_call_event_handler', true); $process = $event->getProcess(); diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php index 2e2539825a53e..2a77459993f48 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php @@ -89,24 +89,22 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter protected $_customerSession; /** - * Class constructor - * * @param \Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $catalogLayerFilterPriceAlgorithm - * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Core\Model\Registry $coreRegistry * @param array $data */ public function __construct( \Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $catalogLayerFilterPriceAlgorithm, - \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Core\Model\Registry $coreRegistry, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php index 9972c5f786118..7db7a9859c2d9 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php @@ -42,28 +42,25 @@ class Groupprice protected $_productAttributeBackendGroupprice; /** - * Construct - * * @param \Magento\Logger $logger * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Model\Config $config + * @param \Magento\Catalog\Model\Product\Type $catalogProductType + * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice */ public function __construct( \Magento\Logger $logger, \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Product\Type $catalogProductType, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Config $config + \Magento\Core\Model\Config $config, + \Magento\Catalog\Model\Product\Type $catalogProductType, + \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice ) { $this->_productAttributeBackendGroupprice = $productAttributeBackendGroupprice; - parent::__construct($logger, $currencyFactory, $storeManager, $catalogProductType, $catalogData, - $config); + parent::__construct($logger, $currencyFactory, $storeManager, $catalogData, $config, $catalogProductType); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php index 40bc88be6ab5c..cae206db4b7f0 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php @@ -60,22 +60,20 @@ abstract protected function _getDuplicateErrorMessage(); protected $_catalogProductType; /** - * Construct - * * @param \Magento\Logger $logger * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Model\Config $config + * @param \Magento\Catalog\Model\Product\Type $catalogProductType */ public function __construct( \Magento\Logger $logger, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Product\Type $catalogProductType, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Config $config + \Magento\Core\Model\Config $config, + \Magento\Catalog\Model\Product\Type $catalogProductType ) { $this->_catalogProductType = $catalogProductType; parent::__construct($logger, $currencyFactory, $storeManager, $catalogData, $config); diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Startdate.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Startdate.php index f2d3db3d839c9..95466d771f5d5 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Startdate.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Startdate.php @@ -45,16 +45,14 @@ class Startdate extends \Magento\Eav\Model\Entity\Attribute\Backend\Datetime protected $_date; /** - * Construct - * - * @param \Magento\Core\Model\Date $date - * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Logger $logger + * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\Core\Model\Date $date */ public function __construct( - \Magento\Core\Model\Date $date, + \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, - \Magento\Logger $logger + \Magento\Core\Model\Date $date ) { $this->_date = $date; parent::__construct($logger, $locale); diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php index 5de002872a20e..f2b357a73b7e2 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php @@ -45,28 +45,25 @@ class Tierprice protected $_productAttributeBackendTierprice; /** - * Construct - * * @param \Magento\Logger $logger * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice $productAttributeTierprice * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Model\Config $config + * @param \Magento\Catalog\Model\Product\Type $catalogProductType + * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice $productAttributeTierprice */ public function __construct( \Magento\Logger $logger, \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice $productAttributeTierprice, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Product\Type $catalogProductType, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Config $config + \Magento\Core\Model\Config $config, + \Magento\Catalog\Model\Product\Type $catalogProductType, + \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice $productAttributeTierprice ) { $this->_productAttributeBackendTierprice = $productAttributeTierprice; - parent::__construct($logger, $currencyFactory, $storeManager, $catalogProductType, $catalogData, - $config); + parent::__construct($logger, $currencyFactory, $storeManager, $catalogData, $config, $catalogProductType); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php b/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php index 1e2e5bde24991..eb0732a228f1d 100644 --- a/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php +++ b/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php @@ -294,6 +294,7 @@ protected function _registerEvent(\Magento\Index\Model\Event $event) $this->_registerCoreStoreEvent($event); break; } + // fall-through intentional case \Magento\Catalog\Model\Resource\Eav\Attribute::ENTITY: case \Magento\Core\Model\Store\Group::ENTITY: $event->addNewData('catalog_product_flat_skip_call_event_handler', true); diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php index e27fd34751ee7..9c71199729f4a 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php @@ -48,17 +48,15 @@ class Date extends \Magento\Catalog\Model\Product\Option\Type\DefaultType protected $_locale; /** - * Construct - * - * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data */ public function __construct( - \Magento\Core\Model\LocaleInterface $locale, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Core\Model\LocaleInterface $locale, array $data = array() ) { $this->_locale = $locale; diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php index ed4a58fd8048f..c9fcc3e8d550c 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php @@ -90,30 +90,28 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType protected $_itemOptionFactory; /** - * Construct - * + * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Sales\Model\Quote\Item\OptionFactory $itemOptionFactory * @param \Magento\UrlInterface $url * @param \Magento\App\Dir $dir - * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Escaper $escaper * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase - * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Filesystem $filesystem * @param \Magento\File\Size $fileSize * @param array $data */ public function __construct( + \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Sales\Model\Quote\Item\OptionFactory $itemOptionFactory, \Magento\UrlInterface $url, \Magento\App\Dir $dir, - \Magento\Checkout\Model\Session $checkoutSession, \Magento\Escaper $escaper, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, - \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Filesystem $filesystem, \Magento\File\Size $fileSize, - $data = array() + array $data = array() ) { $this->_itemOptionFactory = $itemOptionFactory; $this->_url = $url; diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php index 83ac16ae1187d..3164914a931ab 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php @@ -50,16 +50,16 @@ class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType /** * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Stdlib\String $string * @param \Magento\Escaper $escaper - * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param array $data */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Stdlib\String $string, \Magento\Escaper $escaper, - \Magento\Core\Model\Store\Config $coreStoreConfig, array $data = array() ) { $this->string = $string; diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index 985f1b154f7d0..2e8eaa7711a29 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -899,7 +899,7 @@ public function getStoreFilter($product) * @param \Magento\Catalog\Model\Product $product * @return \Magento\Catalog\Model\Product\Type\AbstractType */ - public function setStoreFilter($store = null, $product) + public function setStoreFilter($store, $product) { $cacheKey = '_cache_instance_store_filter'; $product->setData($cacheKey, $store); diff --git a/app/code/Magento/Catalog/Model/Product/Type/Configurable.php b/app/code/Magento/Catalog/Model/Product/Type/Configurable.php index e680ecaac99b5..77c5227e90b3e 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Configurable.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Configurable.php @@ -161,14 +161,18 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType protected $_typeConfigurableFactory; /** - * Construct - * * @codingStandardsIgnoreStart/End * * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\Product\Option $catalogProductOption * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Product\Type $catalogProductType + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb + * @param \Magento\Filesystem $filesystem + * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Logger $logger * @param \Magento\Catalog\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory * @param \Magento\Eav\Model\EntityFactory $entityFactory * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory @@ -178,14 +182,8 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable $catalogProductTypeConfigurable * @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 - * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Logger $logger * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -193,6 +191,12 @@ public function __construct( \Magento\Catalog\Model\Product\Option $catalogProductOption, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Product\Type $catalogProductType, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Helper\File\Storage\Database $fileStorageDb, + \Magento\Filesystem $filesystem, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Logger $logger, \Magento\Catalog\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory, \Magento\Eav\Model\EntityFactory $entityFactory, \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory, @@ -202,12 +206,6 @@ public function __construct( \Magento\Catalog\Model\Resource\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Catalog\Model\Resource\Product\Type\Configurable $catalogProductTypeConfigurable, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Event\ManagerInterface $eventManager, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Helper\File\Storage\Database $fileStorageDb, - \Magento\Filesystem $filesystem, - \Magento\Core\Model\Registry $coreRegistry, - \Magento\Logger $logger, array $data = array() ) { $this->_typeConfigurableFactory = $typeConfigurableFactory; @@ -219,8 +217,19 @@ public function __construct( $this->_attributeCollectionFactory = $attributeCollectionFactory; $this->_catalogProductTypeConfigurable = $catalogProductTypeConfigurable; $this->_storeManager = $storeManager; - parent::__construct($productFactory, $catalogProductOption, $eavConfig, $catalogProductType, - $eventManager, $coreData, $fileStorageDb, $filesystem, $coreRegistry, $logger, $data); + parent::__construct( + $productFactory, + $catalogProductOption, + $eavConfig, + $catalogProductType, + $eventManager, + $coreData, + $fileStorageDb, + $filesystem, + $coreRegistry, + $logger, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Type/Configurable/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Configurable/Price.php index 7e4045ee6b0cd..e9c5b9e3b07ad 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Configurable/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Configurable/Price.php @@ -42,7 +42,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price * @param \Magento\Catalog\Model\Product $product * @return double */ - public function getFinalPrice($qty=null, $product) + public function getFinalPrice($qty, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); diff --git a/app/code/Magento/Catalog/Model/Product/Type/Grouped.php b/app/code/Magento/Catalog/Model/Product/Type/Grouped.php index 2e1060925c179..aadecf9b8c66e 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Grouped.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Grouped.php @@ -99,38 +99,38 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType protected $_appState; /** - * Construct - * * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\Product\Option $catalogProductOption * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Product\Type $catalogProductType - * @param \Magento\Catalog\Model\Resource\Product\Link $catalogProductLink - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Product\Status $catalogProductStatus * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\Filesystem $filesystem * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Logger $logger + * @param \Magento\Catalog\Model\Resource\Product\Link $catalogProductLink + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Catalog\Model\Product\Status $catalogProductStatus * @param \Magento\App\State $appState * @param array $data + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\Product\Option $catalogProductOption, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Product\Type $catalogProductType, - \Magento\Catalog\Model\Resource\Product\Link $catalogProductLink, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Product\Status $catalogProductStatus, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\Filesystem $filesystem, \Magento\Core\Model\Registry $coreRegistry, \Magento\Logger $logger, + \Magento\Catalog\Model\Resource\Product\Link $catalogProductLink, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Catalog\Model\Product\Status $catalogProductStatus, \Magento\App\State $appState, array $data = array() ) { @@ -138,8 +138,19 @@ public function __construct( $this->_storeManager = $storeManager; $this->_catalogProductStatus = $catalogProductStatus; $this->_appState = $appState; - parent::__construct($productFactory, $catalogProductOption, $eavConfig, $catalogProductType, - $eventManager, $coreData, $fileStorageDb, $filesystem, $coreRegistry, $logger, $data); + parent::__construct( + $productFactory, + $catalogProductOption, + $eavConfig, + $catalogProductType, + $eventManager, + $coreData, + $fileStorageDb, + $filesystem, + $coreRegistry, + $logger, + $data + ); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Type/Grouped/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Grouped/Price.php index 0e22db24152e0..8591eaeb5f4cf 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Grouped/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Grouped/Price.php @@ -42,7 +42,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price * @param \Magento\Catalog\Model\Product $product * @return double */ - public function getFinalPrice($qty=null, $product) + public function getFinalPrice($qty, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 8d1b57b72d01f..2b6c8d8d3dd85 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -131,7 +131,7 @@ public function getBasePrice($product, $qty = null) * @param \Magento\Catalog\Model\Product $product * @return float */ - public function getFinalPrice($qty = null, $product) + public function getFinalPrice($qty, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); @@ -235,7 +235,7 @@ protected function _applyTierPrice($product, $qty, $finalPrice) * @param \Magento\Catalog\Model\Product $product * @return float */ - public function getTierPrice($qty = null, $product) + public function getTierPrice($qty, $product) { $allGroups = \Magento\Customer\Model\Group::CUST_GROUP_ALL; $prices = $product->getData('tier_price'); @@ -353,7 +353,7 @@ public function getTierPriceCount($product) * @param \Magento\Catalog\Model\Product $product * @return array || float */ - public function getFormatedTierPrice($qty=null, $product) + public function getFormatedTierPrice($qty, $product) { $price = $product->getTierPrice($qty); if (is_array($price)) { diff --git a/app/code/Magento/Catalog/Model/ProductOptions/Config/Reader.php b/app/code/Magento/Catalog/Model/ProductOptions/Config/Reader.php index a98b554e56517..b0df41d4e75da 100644 --- a/app/code/Magento/Catalog/Model/ProductOptions/Config/Reader.php +++ b/app/code/Magento/Catalog/Model/ProductOptions/Config/Reader.php @@ -43,6 +43,7 @@ class Reader extends \Magento\Config\Reader\Filesystem * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -51,10 +52,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'product_options.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } } diff --git a/app/code/Magento/Catalog/Model/ProductTypes/Config/Reader.php b/app/code/Magento/Catalog/Model/ProductTypes/Config/Reader.php index 6321b9b5fb75a..b23ae4b3355be 100644 --- a/app/code/Magento/Catalog/Model/ProductTypes/Config/Reader.php +++ b/app/code/Magento/Catalog/Model/ProductTypes/Config/Reader.php @@ -47,6 +47,7 @@ class Reader extends \Magento\Config\Reader\Filesystem * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -55,10 +56,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'product_types.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } } diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index 0b9f48aac7901..3ebf8306126bd 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -736,6 +736,7 @@ protected function _getStaticColumns() } else { break; } + // fall-through intentional case \Magento\DB\Ddl\Table::TYPE_DECIMAL: $options = $column['PRECISION'] . ',' . $column['SCALE']; $_is_unsigned = null; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php index 3a8aa9d12d3f0..4da0fb68e3649 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php @@ -52,15 +52,13 @@ class Image protected $_fileUploaderFactory; /** - * Construct - * - * @param \Magento\App\Dir $dir * @param \Magento\Logger $logger + * @param \Magento\App\Dir $dir * @param \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory */ public function __construct( - \Magento\App\Dir $dir, \Magento\Logger $logger, + \Magento\App\Dir $dir, \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory ) { $this->_dir = $dir; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php index ab653e852e2cc..b107288adc6cf 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php @@ -45,15 +45,11 @@ class Urlkey protected $_catalogUrl; /** - * Construct - * - * @param \Magento\Catalog\Model\Url $catalogUrl * @param \Magento\Logger $logger + * @param \Magento\Catalog\Model\Url $catalogUrl */ - public function __construct( - \Magento\Catalog\Model\Url $catalogUrl, - \Magento\Logger $logger - ) { + public function __construct(\Magento\Logger $logger, \Magento\Catalog\Model\Url $catalogUrl) + { $this->_catalogUrl = $catalogUrl; parent::__construct($logger); } diff --git a/app/code/Magento/Catalog/Model/Session.php b/app/code/Magento/Catalog/Model/Session.php index b550dd7961c69..7d9a489b9440c 100644 --- a/app/code/Magento/Catalog/Model/Session.php +++ b/app/code/Magento/Catalog/Model/Session.php @@ -39,15 +39,15 @@ class Session extends \Magento\Core\Model\Session\AbstractSession * @param \Magento\Core\Model\Session\Context $context * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig - * @param array $data * @param null $sessionName + * @param array $data */ public function __construct( \Magento\Core\Model\Session\Context $context, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, - array $data = array(), - $sessionName = null + $sessionName = null, + array $data = array() ) { parent::__construct($context, $sidResolver, $sessionConfig, $data); $this->start('catalog', $sessionName); diff --git a/app/code/Magento/Catalog/Model/Template/Filter.php b/app/code/Magento/Catalog/Model/Template/Filter.php index 5b52d053f4e3b..331e8c9c64b74 100644 --- a/app/code/Magento/Catalog/Model/Template/Filter.php +++ b/app/code/Magento/Catalog/Model/Template/Filter.php @@ -64,20 +64,20 @@ class Filter extends \Magento\Filter\Template protected $_storeManager; /** - * Construct - * * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\View\Url $viewUrl + * @param array $variables */ public function __construct( \Magento\Stdlib\String $string, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\View\Url $viewUrl + \Magento\View\Url $viewUrl, + $variables = array() ) { $this->_storeManager = $storeManager; $this->_viewUrl = $viewUrl; - parent::__construct($string); + parent::__construct($string, $variables); } /** diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml index 5c133f983c1de..4f71e645988c3 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml @@ -49,31 +49,10 @@ - - - - - - - - - - - - - - - - - - - - - - - + + getSku sku @@ -82,8 +61,10 @@ itemprop="sku" - - + + + + getShortDescription short_description @@ -93,12 +74,31 @@ itemprop="description" - - - + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php index 1d8d9c2fd9c04..d867957778645 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php @@ -55,26 +55,24 @@ class Stock extends \Magento\Data\Form\Element\Select protected $_factoryText; /** - * Construct - * - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\TextFactory $factoryText - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\Data\Form\Element\TextFactory $factoryText, - array $attributes = array() + array $data = array() ) { $this->_factoryText = $factoryText; - $this->_qty = isset($attributes['qty']) ? $attributes['qty'] : $this->_createQtyElement(); - unset($attributes['qty']); - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); - $this->setName($attributes['name']); + $this->_qty = isset($data['qty']) ? $data['qty'] : $this->_createQtyElement(); + unset($data['qty']); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); + $this->setName($data['name']); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Form.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Form.php index 34ee5a9e41de6..db3334dcabbd1 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Form.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Form.php @@ -47,7 +47,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getUrl('catalog_rule/promo_catalog/save'), 'method' => 'post', diff --git a/app/code/Magento/CatalogRule/Model/Observer.php b/app/code/Magento/CatalogRule/Model/Observer.php index 5d8ed38d7b08e..36d8448895263 100644 --- a/app/code/Magento/CatalogRule/Model/Observer.php +++ b/app/code/Magento/CatalogRule/Model/Observer.php @@ -107,10 +107,9 @@ class Observer * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Backend\Model\Session $backendSession - * @param Rule\Product\Price $productPrice * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Stdlib\DateTime $dateTime - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -124,7 +123,6 @@ public function __construct( \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, \Magento\Backend\Model\Session $backendSession, - \Magento\CatalogRule\Model\Rule\Product\Price $productPrice, \Magento\Core\Model\Registry $coreRegistry, \Magento\Stdlib\DateTime $dateTime ) { diff --git a/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php b/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php index c6928607953a9..4c0918300f10c 100644 --- a/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php +++ b/app/code/Magento/CatalogRule/Model/Rule/Action/Collection.php @@ -31,17 +31,17 @@ class Collection extends \Magento\Rule\Model\Action\Collection { /** * @param \Magento\View\Url $viewUrl - * @param \Magento\Rule\Model\ActionFactory $actionFactory * @param \Magento\View\LayoutInterface $layout + * @param \Magento\Rule\Model\ActionFactory $actionFactory * @param array $data */ public function __construct( \Magento\View\Url $viewUrl, - \Magento\Rule\Model\ActionFactory $actionFactory, \Magento\View\LayoutInterface $layout, + \Magento\Rule\Model\ActionFactory $actionFactory, array $data = array() ) { - parent::__construct($viewUrl, $actionFactory, $layout, $data); + parent::__construct($viewUrl, $layout, $actionFactory, $data); $this->setType('Magento\CatalogRule\Model\Rule\Action\Collection'); } diff --git a/app/code/Magento/CatalogRule/Model/Rule/Condition/Combine.php b/app/code/Magento/CatalogRule/Model/Rule/Condition/Combine.php index d2183913c5546..5c8a3abe7a01b 100644 --- a/app/code/Magento/CatalogRule/Model/Rule/Condition/Combine.php +++ b/app/code/Magento/CatalogRule/Model/Rule/Condition/Combine.php @@ -37,13 +37,13 @@ class Combine extends \Magento\Rule\Model\Condition\Combine protected $_productFactory; /** - * @param \Magento\CatalogRule\Model\Rule\Condition\ProductFactory $conditionFactory * @param \Magento\Rule\Model\Condition\Context $context + * @param \Magento\CatalogRule\Model\Rule\Condition\ProductFactory $conditionFactory * @param array $data */ public function __construct( - \Magento\CatalogRule\Model\Rule\Condition\ProductFactory $conditionFactory, \Magento\Rule\Model\Condition\Context $context, + \Magento\CatalogRule\Model\Rule\Condition\ProductFactory $conditionFactory, array $data = array() ) { $this->_productFactory = $conditionFactory; diff --git a/app/code/Magento/CatalogSearch/Block/Autocomplete.php b/app/code/Magento/CatalogSearch/Block/Autocomplete.php index 2f282e0cf3051..3acebfb3e7da8 100644 --- a/app/code/Magento/CatalogSearch/Block/Autocomplete.php +++ b/app/code/Magento/CatalogSearch/Block/Autocomplete.php @@ -58,8 +58,9 @@ protected function _toHtml() $item['row_class'] .= ' last'; } - $html .= '
  • ' - . ''.$item['num_of_results'].''.$this->escapeHtml($item['title']).'
  • '; + $escapedTitle = $this->escapeHtml($item['title']); + $html .= '
  • ' + . ''.$item['num_of_results'].''.$escapedTitle.'
  • '; } $html.= ''; diff --git a/app/code/Magento/CatalogSearch/Block/Layer.php b/app/code/Magento/CatalogSearch/Block/Layer.php index 4be2228a3a4b0..5a22b1279fb6b 100644 --- a/app/code/Magento/CatalogSearch/Block/Layer.php +++ b/app/code/Magento/CatalogSearch/Block/Layer.php @@ -63,7 +63,6 @@ class Layer extends \Magento\Catalog\Block\Layer\View * @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\Registry $registry * @param array $data */ @@ -72,14 +71,12 @@ public function __construct( \Magento\CatalogSearch\Model\Layer $catalogLayer, \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider, \Magento\CatalogSearch\Helper\Data $catalogSearchData, - \Magento\CatalogSearch\Model\Layer $catalogSearchLayer, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_engineProvider = $engineProvider; $this->_coreRegistry = $registry; $this->_catalogSearchData = $catalogSearchData; - $this->_catalogSearchLayer = $catalogSearchLayer; parent::__construct($context, $catalogLayer, $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 8eacc56285ab9..474938fed3d7c 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php @@ -72,7 +72,7 @@ protected function _prepareForm() $model = $this->_coreRegistry->registry('checkout_agreement'); /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Checkout/Block/Onepage/Success.php b/app/code/Magento/Checkout/Block/Onepage/Success.php index 97a598a3a0880..c8139e46cc1cb 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Success.php +++ b/app/code/Magento/Checkout/Block/Onepage/Success.php @@ -58,7 +58,7 @@ class Success extends \Magento\View\Element\Template /** * @var \Magento\Sales\Model\Resource\Recurring\Profile\Collection */ - protected $_profileCollFactory; + protected $_recurringProfileCollectionFactory; /** * @var \Magento\Sales\Model\Order\Config @@ -71,7 +71,7 @@ class Success extends \Magento\View\Element\Template * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory - * @param \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollFactory + * @param \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $recurringProfileCollectionFactory * @param \Magento\Sales\Model\Order\Config $orderConfig * @param array $data */ @@ -81,17 +81,17 @@ public function __construct( \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory, - \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollFactory, + \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $recurringProfileCollectionFactory, \Magento\Sales\Model\Order\Config $orderConfig, array $data = array() ) { + parent::__construct($context, $data); $this->_checkoutSession = $checkoutSession; $this->_customerSession = $customerSession; $this->_orderFactory = $orderFactory; $this->_agreementFactory = $agreementFactory; - $this->_profileCollFactory = $profileCollFactory; + $this->_recurringProfileCollectionFactory = $recurringProfileCollectionFactory; $this->_orderConfig = $orderConfig; - parent::__construct($context, $data); } /** @@ -175,9 +175,8 @@ protected function _prepareLastRecurringProfiles() { $profileIds = $this->_checkoutSession->getLastRecurringProfileIds(); if ($profileIds && is_array($profileIds)) { - $collection = $this->_profileCollFactory->create()->getCollection() - ->addFieldToFilter('profile_id', array('in' => $profileIds)) - ; + $collection = $this->_recurringProfileCollectionFactory->create() + ->addFieldToFilter('profile_id', array('in' => $profileIds)); $profiles = array(); foreach ($collection as $profile) { $profiles[] = $profile; diff --git a/app/code/Magento/Checkout/view/frontend/js/opcheckout.js b/app/code/Magento/Checkout/view/frontend/js/opcheckout.js index 1e2f48c7e8d62..501ef6b3c056e 100644 --- a/app/code/Magento/Checkout/view/frontend/js/opcheckout.js +++ b/app/code/Magento/Checkout/view/frontend/js/opcheckout.js @@ -51,35 +51,40 @@ }, _create: function() { - var _this = this; this.checkoutPrice = this.options.quoteBaseGrandTotal; if (this.options.checkout.suggestRegistration) { $(this.options.checkout.loginGuestSelector).prop('checked', false); $(this.options.checkout.loginRegisterSelector).prop('checked', true); } - this.element - .on('click', this.options.checkout.continueSelector, function() { - $.proxy(_this._continue($(this)), _this); - }) - .on('gotoSection', function(event, section) { - $.proxy(_this._ajaxUpdateProgress(section), _this); - _this.element.trigger('enableSection', {selector: _this.options.sectionSelectorPrefix + section}); - }) - .on('ajaxError', $.proxy(this._ajaxError, this)) - .on('showAjaxLoader', $.proxy(this._ajaxSend, this)) - .on('hideAjaxLoader', $.proxy(this._ajaxComplete, this)) - .on('click', this.options.backSelector, function() { - _this.element.trigger('enableSection', {selector: '#' + _this.element.find('.active').prev().attr('id')}); - }) - .on('click', '[data-action="login-form-submit"]', function() { - $(_this.options.checkout.loginFormSelector).submit(); - }); - $(this.options.checkoutProgressContainer).on('click', '[data-goto-section]', $.proxy(function(e) { - var gotoSection = $(e.target).data('goto-section'); - this._ajaxUpdateProgress(gotoSection); - this.element.trigger('enableSection', {selector: _this.options.sectionSelectorPrefix + gotoSection}); - return false; - }, this)); + var events = {}; + events['click ' + this.options.checkout.continueSelector] = function(e) { + this._continue($(e.target)); + }; + events['click ' + this.options.backSelector] = function() { + this.element.trigger('enableSection', {selector: '#' + this.element.find('.active').prev().attr('id')}); + }; + $.extend(events, { + ajaxError: '_ajaxError', + showAjaxLoader: '_ajaxSend', + hideAjaxLoader: '_ajaxComplete', + gotoSection: function(e, section) { + this._ajaxUpdateProgress(section); + this.element.trigger('enableSection', {selector: this.options.sectionSelectorPrefix + section}); + }, + 'click [data-action=login-form-submit]': function() { + $(this.options.checkout.loginFormSelector).submit(); + } + }); + this._on(events); + + this._on($(this.options.checkoutProgressContainer), { + 'click [data-goto-section]' : function(e) { + var gotoSection = $(e.target).data('goto-section'); + this._ajaxUpdateProgress(gotoSection); + this.element.trigger('enableSection', {selector: this.options.sectionSelectorPrefix + gotoSection}); + return false; + } + }); }, /** @@ -236,16 +241,18 @@ _create: function() { this._super(); - this.element - .on('change', this.options.billing.addressDropdownSelector, $.proxy(function(e) { - this.element.find(this.options.billing.newAddressFormSelector).toggle(!$(e.target).val()); - }, this)) - .on('click', this.options.billing.continueSelector, $.proxy(function() { - if ($(this.options.billing.form).validation && $(this.options.billing.form).validation('isValid')) { - this._billingSave(); - } - }, this)) - .find(this.options.billing.form).validation(); + var events = {}; + events['change ' + this.options.billing.addressDropdownSelector] = function(e) { + this.element.find(this.options.billing.newAddressFormSelector).toggle(!$(e.target).val()); + }; + events['click ' + this.options.billing.continueSelector] = function() { + if ($(this.options.billing.form).validation && $(this.options.billing.form).validation('isValid')) { + this._billingSave(); + } + }; + this._on(events); + + this.element.find(this.options.billing.form).validation(); } , _billingSave: function() { @@ -271,27 +278,31 @@ _create: function() { this._super(); - this.element - .on('change', this.options.shipping.addressDropdownSelector, $.proxy(function(e) { - $(this.options.shipping.newAddressFormSelector).toggle(!$(e.target).val()); - }, this)) - .on('input propertychange', this.options.shipping.form + ' :input[name]', $.proxy(function() { - $(this.options.shipping.copyBillingSelector).prop('checked', false); - }, this)) - .on('click', this.options.shipping.copyBillingSelector, $.proxy(function(e) { - if ($(e.target).is(':checked')) { - this._billingToShipping(); - } - }, this)) - .on('click', this.options.shipping.continueSelector, $.proxy(function() { - if ($(this.options.shipping.form).validation && $(this.options.shipping.form).validation('isValid')) { + var events = {}; + events['change ' + this.options.shipping.addressDropdownSelector] = function(e) { + $(this.options.shipping.newAddressFormSelector).toggle(!$(e.target).val()); + }; + var onInputPropChange = function() { + $(this.options.shipping.copyBillingSelector).prop('checked', false); + }; + events['input ' + this.options.shipping.form + ' :input[name]'] = onInputPropChange; + events['propertychange ' + this.options.shipping.form + ' :input[name]'] = onInputPropChange; + events['click ' + this.options.shipping.copyBillingSelector] = function(e) { + if ($(e.target).is(':checked')) { + this._billingToShipping(); + } + }; + events['click ' + this.options.shipping.continueSelector] = function() { + if ($(this.options.shipping.form).validation && $(this.options.shipping.form).validation('isValid')) { this._ajaxContinue(this.options.shipping.saveUrl, $(this.options.shipping.form).serialize(), false, function() { //Trigger indicating shipping save. eg. GiftMessage listens to this to inject gift options this.element.trigger('shippingSave'); }); - } - }, this)) - .find(this.options.shipping.form).validation(); + } + }; + this._on(events); + + this.element.find(this.options.shipping.form).validation(); }, /** @@ -321,26 +332,29 @@ _create: function() { this._super(); - var _this = this; - this.element - .on('click', this.options.shippingMethod.continueSelector, $.proxy(function() { - if (this._validateShippingMethod()&& - $(this.options.shippingMethod.form).validation && - $(this.options.shippingMethod.form).validation('isValid')) { - this._ajaxContinue(this.options.shippingMethod.saveUrl, $(this.options.shippingMethod.form).serialize()); - } - }, this)) - .on('click', 'input[name="shipping_method"]', function() { - var selectedPrice = _this.shippingCodePrice[$(this).val()] || 0, - oldPrice = _this.shippingCodePrice[_this.currentShippingMethod] || 0; - _this.checkoutPrice = _this.checkoutPrice - oldPrice + selectedPrice; - _this.currentShippingMethod = $(this).val(); - }) - .on('contentUpdated', $.proxy(function() { + var events = {}; + events['click ' + this.options.shippingMethod.continueSelector] = function() { + if (this._validateShippingMethod()&& + $(this.options.shippingMethod.form).validation && + $(this.options.shippingMethod.form).validation('isValid')) { + this._ajaxContinue(this.options.shippingMethod.saveUrl, $(this.options.shippingMethod.form).serialize()); + } + }; + $.extend(events, { + 'click input[name=shipping_method]': function(e) { + var selectedPrice = this.shippingCodePrice[$(e.target).val()] || 0, + oldPrice = this.shippingCodePrice[this.currentShippingMethod] || 0; + this.checkoutPrice = this.checkoutPrice - oldPrice + selectedPrice; + this.currentShippingMethod = $(e.target).val(); + }, + 'contentUpdated': function() { this.currentShippingMethod = this.element.find('input[name="shipping_method"]:checked').val(); this.shippingCodePrice = this.element.find('[data-shipping-code-price]').data('shipping-code-price'); - }, this)) - .find(this.options.shippingMethod.form).validation(); + } + }); + this._on(events); + + this.element.find(this.options.shippingMethod.form).validation(); }, /** @@ -378,15 +392,30 @@ _create: function() { this._super(); - this.element - .on('click', this.options.payment.continueSelector, $.proxy(function() { - if (this._validatePaymentMethod() && - $(this.options.payment.form).validation && - $(this.options.payment.form).validation('isValid')) { - this._ajaxContinue(this.options.payment.saveUrl, $(this.options.payment.form).serialize()); - } - }, this)) - .on('updateCheckoutPrice', $.proxy(function(event, data) { + var events = {}; + events['click ' + this.options.payment.continueSelector] = function() { + if (this._validatePaymentMethod() && + $(this.options.payment.form).validation && + $(this.options.payment.form).validation('isValid')) { + this._ajaxContinue(this.options.payment.saveUrl, $(this.options.payment.form).serialize()); + } + }; + events['contentUpdated ' + this.options.payment.form] = function() { + $(this.options.payment.form).find('dd [name^="payment["]').prop('disabled', true); + var checkoutPrice = this.element.find(this.options.payment.form).find('[data-checkout-price]').data('checkout-price'); + if ($.isNumeric(checkoutPrice)) { + this.checkoutPrice = checkoutPrice; + } + if (this.checkoutPrice < this.options.minBalance) { + this._disablePaymentMethods(); + } else { + this._enablePaymentMethods(); + } + }; + events['click ' + this.options.payment.form + ' dt input:radio'] = '_paymentMethodHandler'; + + $.extend(events, { + updateCheckoutPrice: function(event, data) { if (data.price) { this.checkoutPrice += data.price; } @@ -400,21 +429,12 @@ // Remove free input field, show all payment method this._enablePaymentMethods(); } - }, this)) - .on('contentUpdated', this.options.payment.form, $.proxy(function() { - $(this.options.payment.form).find('dd [name^="payment["]').prop('disabled', true); - var checkoutPrice = this.element.find(this.options.payment.form).find('[data-checkout-price]').data('checkout-price'); - if ($.isNumeric(checkoutPrice)) { - this.checkoutPrice = checkoutPrice; - } - if (this.checkoutPrice < this.options.minBalance) { - this._disablePaymentMethods(); - } else { - this._enablePaymentMethods(); - } - }, this)) - .on('click', this.options.payment.form + ' dt input:radio', $.proxy(this._paymentMethodHandler, this)) - .find(this.options.payment.form).validation({ + } + }); + + this._on(events); + + this.element.find(this.options.payment.form).validation({ errorPlacement: function(error, element) { if (element.attr('data-validate') && element.attr('data-validate').indexOf('validate-cc-ukss') >= 0) { element.parents('form').find('[data-validation-msg="validate-cc-ukss"]').html(error); @@ -499,26 +519,27 @@ _create: function() { this._super(); - this.element - .on('click', this.options.review.continueSelector, $.proxy(this._saveOrder, this)) - .on('saveOrder', this.options.review.container, $.proxy(this._saveOrder, this)) - .on('contentUpdated', this.options.review.container, $.proxy(function() { - var paypalIframe = this.element.find(this.options.review.container) - .find('[data-container="paypal-iframe"]'); - if (paypalIframe.length) { - paypalIframe.show(); - $(this.options.review.submitContainer).hide(); - } - }, this)); + var events = {}; + events['click ' + this.options.review.continueSelector] = this._saveOrder; + events['saveOrder' + this.options.review.container] = this._saveOrder; + events['contentUpdated' + this.options.review.container] = function() { + var paypalIframe = this.element.find(this.options.review.container) + .find('[data-container="paypal-iframe"]'); + if (paypalIframe.length) { + paypalIframe.show(); + $(this.options.review.submitContainer).hide(); + } + }; + this._on(events); }, _saveOrder: function() { - if ($(this.options.payment.form).validation && - $(this.options.payment.form).validation('isValid')) { - this._ajaxContinue( - this.options.review.saveUrl, + if ($(this.options.payment.form).validation && + $(this.options.payment.form).validation('isValid')) { + this._ajaxContinue( + this.options.review.saveUrl, $(this.options.payment.form).serialize() + '&' + $(this.options.review.agreementFormSelector).serialize()); - } + } } }); })(jQuery, window); diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml index b899db32ef36b..8732368c29fde 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml @@ -24,6 +24,7 @@ */ --> + diff --git a/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml b/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml index 49eedbea9b0d4..9ea6704cdc689 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml @@ -42,7 +42,7 @@ diff --git a/app/code/Magento/Checkout/view/frontend/onepage/login.phtml b/app/code/Magento/Checkout/view/frontend/onepage/login.phtml index 084ebdadb5637..459243004aaed 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage/login.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage/login.phtml @@ -41,7 +41,7 @@
    diff --git a/app/code/Magento/Checkout/view/frontend/onepage/review/button.phtml b/app/code/Magento/Checkout/view/frontend/onepage/review/button.phtml index 1990699641007..91008edae7de1 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage/review/button.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage/review/button.phtml @@ -22,4 +22,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - + diff --git a/app/code/Magento/Checkout/view/frontend/success.phtml b/app/code/Magento/Checkout/view/frontend/success.phtml index 95681ab6f6e26..b13b4eeab3b85 100644 --- a/app/code/Magento/Checkout/view/frontend/success.phtml +++ b/app/code/Magento/Checkout/view/frontend/success.phtml @@ -23,36 +23,38 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -

    -getOrderId()):?> - getCanViewOrder()) :?> -

    %s', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?>

    - -

    escapeHtml($this->getOrderId())) ?>

    +
    +

    + getOrderId()):?> + getCanViewOrder()) :?> +

    %s', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?>

    + +

    escapeHtml($this->getOrderId())) ?>

    + +

    + getCanViewOrder() && $this->getCanPrintOrder()) :?> +

    + here to print a copy of your order confirmation.', $this->getPrintUrl()) ?> + getChildHtml() ?> +

    + -

    - getCanViewOrder() && $this->getCanPrintOrder()) :?> -

    - here to print a copy of your order confirmation.', $this->getPrintUrl()) ?> - getChildHtml() ?> -

    - - -getAgreementRefId()): ?> -

    %s', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?>

    - + getAgreementRefId()): ?> +

    %s', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?>

    + -getRecurringProfiles()):?> -

    -
      - -getCanViewProfiles() ? sprintf('%s', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?> -
    • escapeHtml($this->getObjectData($profile, 'schedule_description')))?>
    • - -
    - + getRecurringProfiles()):?> +

    +
      + + getCanViewProfiles() ? sprintf('%s', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?> +
    • escapeHtml($this->getObjectData($profile, 'schedule_description')))?>
    • + +
    + -
    - -
    +
    + +
    +
    \ No newline at end of file diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php index d946aa452c8f5..4a992a8e30c59 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php @@ -94,7 +94,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Form.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Form.php index c12d78114687a..191d22ffcfaaa 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Form.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Form.php @@ -41,7 +41,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php index fd7e6462f1f97..7af55766780c0 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php @@ -33,7 +33,7 @@ class Design implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** - * @var \Magento\Core\Model\Theme\LabelFactory + * @var \Magento\View\Design\Theme\LabelFactory */ protected $_labelFactory; @@ -47,7 +47,7 @@ class Design * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param \Magento\View\Design\Theme\LabelFactory $labelFactory * @param array $data */ public function __construct( @@ -55,7 +55,7 @@ public function __construct( \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Theme\Model\Layout\Source\Layout $pageLayout, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, + \Magento\View\Design\Theme\LabelFactory $labelFactory, array $data = array() ) { $this->_labelFactory = $labelFactory; @@ -86,7 +86,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'html_id_prefix' => 'page_', )) ); diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php index 3dc6b5bdbdb9a..f302d7aeef88c 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php @@ -44,7 +44,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml b/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml index 6f4471a3afab8..d910d951a3846 100644 --- a/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml +++ b/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml @@ -24,19 +24,12 @@ */ --> + Contact Us - - - 2columns-right.phtml - - - Contact Us - - diff --git a/app/code/Magento/Core/App/Action/Plugin/Design.php b/app/code/Magento/Core/App/Action/Plugin/Design.php index 714c9c4c05f9e..8de0812655490 100644 --- a/app/code/Magento/Core/App/Action/Plugin/Design.php +++ b/app/code/Magento/Core/App/Action/Plugin/Design.php @@ -27,14 +27,14 @@ class Design { /** - * @var \Magento\Core\Model\DesignLoader + * @var \Magento\View\DesignLoader */ protected $_designLoader; /** - * @param \Magento\Core\Model\DesignLoader $designLoader + * @param \Magento\View\DesignLoader $designLoader */ - public function __construct(\Magento\Core\Model\DesignLoader $designLoader) + public function __construct(\Magento\View\DesignLoader $designLoader) { $this->_designLoader = $designLoader; } diff --git a/app/code/Magento/Core/Helper/Url.php b/app/code/Magento/Core/Helper/Url.php index b0f07d5f1b8f7..3a67e2039386d 100644 --- a/app/code/Magento/Core/Helper/Url.php +++ b/app/code/Magento/Core/Helper/Url.php @@ -130,9 +130,10 @@ public function addRequestParam($url, $param) public function removeRequestParam($url, $paramKey, $caseSensitive = false) { $regExpression = '/\\?[^#]*?(' . preg_quote($paramKey, '/') . '\\=[^#&]*&?)/' . ($caseSensitive ? '' : 'i'); - while (preg_match($regExpression, $url, $matches) != 0) { + while (preg_match($regExpression, $url, $matches) !== 0) { $paramString = $matches[1]; - if (preg_match('/&$/', $paramString) == 0) { + // if ampersand is at the end of $paramString + if (substr($paramString, -1, 1) != '&') { $url = preg_replace('/(&|\\?)?' . preg_quote($paramString, '/') . '/', '', $url); } else { $url = str_replace($paramString, '', $url); diff --git a/app/code/Magento/Core/Model/App.php b/app/code/Magento/Core/Model/App.php index bb96568d46310..edf27a95d8efb 100644 --- a/app/code/Magento/Core/Model/App.php +++ b/app/code/Magento/Core/Model/App.php @@ -53,7 +53,7 @@ class App implements \Magento\Core\Model\AppInterface /** * Magento version */ - const VERSION = '2.0.0.0-dev55'; + const VERSION = '2.0.0.0-dev56'; /** @@ -801,7 +801,7 @@ public function getVersionInfo() 'revision' => '0', 'patch' => '0', 'stability' => 'dev', - 'number' => '55', + 'number' => '56', ); } } diff --git a/app/code/Magento/Core/Model/DataService/Config/Reader.php b/app/code/Magento/Core/Model/DataService/Config/Reader.php index 71f1a287a6011..f714a3308d339 100644 --- a/app/code/Magento/Core/Model/DataService/Config/Reader.php +++ b/app/code/Magento/Core/Model/DataService/Config/Reader.php @@ -33,13 +33,11 @@ class Reader extends \Magento\Config\AbstractXml private $_modulesReader; /** - * @param \Magento\Module\Dir\Reader $moduleReader * @param array $configFiles + * @param \Magento\Module\Dir\Reader $moduleReader */ - public function __construct( - \Magento\Module\Dir\Reader $moduleReader, - array $configFiles - ) { + public function __construct(array $configFiles, \Magento\Module\Dir\Reader $moduleReader) + { if (count($configFiles)) { parent::__construct($configFiles); } diff --git a/app/code/Magento/Core/Model/File/Uploader.php b/app/code/Magento/Core/Model/File/Uploader.php index 7b70048ba12b7..22199b3253800 100644 --- a/app/code/Magento/Core/Model/File/Uploader.php +++ b/app/code/Magento/Core/Model/File/Uploader.php @@ -63,18 +63,16 @@ class Uploader extends \Magento\File\Uploader protected $_validator; /** - * Init upload - * + * @param string $fileId * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Core\Model\File\Validator\NotProtectedExtension $validator - * @param $fileId */ public function __construct( + $fileId, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Helper\File\Storage $coreFileStorage, - \Magento\Core\Model\File\Validator\NotProtectedExtension $validator, - $fileId + \Magento\Core\Model\File\Validator\NotProtectedExtension $validator ) { $this->_coreFileStorageDb = $coreFileStorageDb; $this->_coreFileStorage = $coreFileStorage; diff --git a/app/code/Magento/Core/Model/Layout.php b/app/code/Magento/Core/Model/Layout.php index 5f06c0c3db669..dabdb6ffe58d5 100644 --- a/app/code/Magento/Core/Model/Layout.php +++ b/app/code/Magento/Core/Model/Layout.php @@ -917,7 +917,7 @@ public function getServiceCalls() * @param array $options * @throws \Magento\Exception if any of arguments are invalid */ - protected function _generateContainer($name, $label = '', array $options) + protected function _generateContainer($name, $label, array $options) { $this->_structure->setAttribute($name, Element::CONTAINER_OPT_LABEL, $label); unset($options[Element::CONTAINER_OPT_LABEL]); diff --git a/app/code/Magento/Core/Model/Layout/Argument/AbstractHandler.php b/app/code/Magento/Core/Model/Layout/Argument/AbstractHandler.php index 2c72abf591a77..b5551fc61ab19 100644 --- a/app/code/Magento/Core/Model/Layout/Argument/AbstractHandler.php +++ b/app/code/Magento/Core/Model/Layout/Argument/AbstractHandler.php @@ -33,8 +33,7 @@ */ namespace Magento\Core\Model\Layout\Argument; -abstract class AbstractHandler - implements \Magento\Core\Model\Layout\Argument\HandlerInterface +abstract class AbstractHandler implements \Magento\View\Layout\Argument\HandlerInterface { /** * @var \Magento\ObjectManager diff --git a/app/code/Magento/Core/Model/Layout/Argument/Handler/ArrayHandler.php b/app/code/Magento/Core/Model/Layout/Argument/Handler/ArrayHandler.php index 3927a804aed87..bc08284bf0505 100644 --- a/app/code/Magento/Core/Model/Layout/Argument/Handler/ArrayHandler.php +++ b/app/code/Magento/Core/Model/Layout/Argument/Handler/ArrayHandler.php @@ -36,15 +36,15 @@ class ArrayHandler extends \Magento\Core\Model\Layout\Argument\AbstractHandler { /** - * @var \Magento\Core\Model\Layout\Argument\HandlerFactory + * @var \Magento\View\Layout\Argument\HandlerFactory */ protected $_handlerFactory; /** - * @param \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory + * @param \Magento\View\Layout\Argument\HandlerFactory $handlerFactory */ public function __construct( - \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory + \Magento\View\Layout\Argument\HandlerFactory $handlerFactory ) { $this->_handlerFactory = $handlerFactory; } diff --git a/app/code/Magento/Core/Model/Layout/Argument/HandlerFactoryInterface.php b/app/code/Magento/Core/Model/Layout/Argument/HandlerFactoryInterface.php deleted file mode 100644 index 4a8ec64688470..0000000000000 --- a/app/code/Magento/Core/Model/Layout/Argument/HandlerFactoryInterface.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -namespace Magento\Core\Model\Layout\Argument; - -interface HandlerFactoryInterface -{ - /** - * Create concrete handler object - * @return \Magento\Core\Model\Layout\Argument\HandlerInterface - */ - public function createHandler(); -} diff --git a/app/code/Magento/Core/Model/Layout/Argument/Processor.php b/app/code/Magento/Core/Model/Layout/Argument/Processor.php index b4389dd83d647..b44a9e0ecc673 100644 --- a/app/code/Magento/Core/Model/Layout/Argument/Processor.php +++ b/app/code/Magento/Core/Model/Layout/Argument/Processor.php @@ -36,7 +36,7 @@ class Processor { /** - * @var \Magento\Core\Model\Layout\Argument\HandlerFactory + * @var \Magento\View\Layout\Argument\HandlerFactory */ protected $_handlerFactory; @@ -54,11 +54,11 @@ class Processor /** * @param \Magento\Core\Model\Layout\Argument\Updater $argumentUpdater - * @param \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory + * @param \Magento\View\Layout\Argument\HandlerFactory $handlerFactory */ public function __construct( \Magento\Core\Model\Layout\Argument\Updater $argumentUpdater, - \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory + \Magento\View\Layout\Argument\HandlerFactory $handlerFactory ) { $this->_handlerFactory = $handlerFactory; $this->_argumentUpdater = $argumentUpdater; diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index 3975d5a91f93d..f7c1d46684aaa 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -712,4 +712,26 @@ public function __destruct() $this->_updates = array(); $this->_layoutUpdatesCache = null; } + + /** + * @inheritdoc + */ + public function isCustomerDesignAbstraction(array $abstraction) + { + if (!isset($abstraction['design_abstraction'])) { + return false; + } + return $abstraction['design_abstraction'] === self::DESIGN_ABSTRACTION_CUSTOM; + } + + /** + * @inheritdoc + */ + public function isPageLayoutDesignAbstraction(array $abstraction) + { + if (!isset($abstraction['design_abstraction'])) { + return false; + } + return $abstraction['design_abstraction'] === self::DESIGN_ABSTRACTION_PAGE_LAYOUT; + } } diff --git a/app/code/Magento/Core/Model/Locale/Hierarchy/Config/Reader.php b/app/code/Magento/Core/Model/Locale/Hierarchy/Config/Reader.php index 998be57d93047..d2ebe44ec1e64 100644 --- a/app/code/Magento/Core/Model/Locale/Hierarchy/Config/Reader.php +++ b/app/code/Magento/Core/Model/Locale/Hierarchy/Config/Reader.php @@ -35,25 +35,34 @@ class Reader extends \Magento\Config\Reader\Filesystem ); /** - * @param \Magento\Core\Model\Locale\Hierarchy\Config\FileResolver $fileResolver - * @param \Magento\Core\Model\Locale\Hierarchy\Config\Converter $converter - * @param \Magento\Core\Model\Locale\Hierarchy\Config\SchemaLocator $schemeLocator + * @param FileResolver $fileResolver + * @param Converter $converter + * @param SchemaLocator $schemaLocator * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Core\Model\Locale\Hierarchy\Config\FileResolver $fileResolver, \Magento\Core\Model\Locale\Hierarchy\Config\Converter $converter, - \Magento\Core\Model\Locale\Hierarchy\Config\SchemaLocator $schemeLocator, + \Magento\Core\Model\Locale\Hierarchy\Config\SchemaLocator $schemaLocator, \Magento\Config\ValidationStateInterface $validationState, $fileName = 'config.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemeLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } } diff --git a/app/code/Magento/Core/Model/Resource/Theme/Collection.php b/app/code/Magento/Core/Model/Resource/Theme/Collection.php index 4f2a3ace42c8d..05efca13a61d9 100644 --- a/app/code/Magento/Core/Model/Resource/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Theme/Collection.php @@ -29,7 +29,9 @@ */ namespace Magento\Core\Model\Resource\Theme; -class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection +class Collection + extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection + implements \Magento\View\Design\Theme\Label\ListInterface, \Magento\View\Design\Theme\ListInterface { /** * Default page size @@ -216,4 +218,16 @@ public function filterThemeCustomizations( $this->addAreaFilter($area)->addTypeFilter($type); return $this; } + + /** + * @inheritdoc + */ + public function getLabels() + { + $this->_reset()->clear(); + $labels = $this->setOrder('theme_title', \Magento\Data\Collection::SORT_ORDER_ASC) + ->filterVisibleThemes() + ->addAreaFilter(\Magento\Core\Model\App\Area::AREA_FRONTEND); + return $labels->toOptionArray(); + } } diff --git a/app/code/Magento/Core/Model/Session.php b/app/code/Magento/Core/Model/Session.php index 5ad6862ad6767..dc9c435b5a94a 100644 --- a/app/code/Magento/Core/Model/Session.php +++ b/app/code/Magento/Core/Model/Session.php @@ -41,15 +41,15 @@ class Session extends \Magento\Core\Model\Session\AbstractSession * @param Session\Context $context * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig - * @param array $data * @param null $sessionName + * @param array $data */ public function __construct( \Magento\Core\Model\Session\Context $context, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\Session\Config\ConfigInterface $sessionConfig, - array $data = array(), - $sessionName = null + \Magento\Session\Config\ConfigInterface $sessionConfig, + $sessionName = null, + array $data = array() ) { parent::__construct($context, $sidResolver, $sessionConfig, $data); $this->start('core', $sessionName); diff --git a/app/code/Magento/Core/Model/Session/Generic.php b/app/code/Magento/Core/Model/Session/Generic.php index f0404480f59f0..60d367e361fd5 100644 --- a/app/code/Magento/Core/Model/Session/Generic.php +++ b/app/code/Magento/Core/Model/Session/Generic.php @@ -30,16 +30,16 @@ class Generic extends \Magento\Core\Model\Session\AbstractSession * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param string $sessionNamespace + * @param mixed $sessionName * @param array $data - * @param null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, $sessionNamespace, - array $data = array(), - $sessionName = null + $sessionName = null, + array $data = array() ) { parent::__construct($context, $sidResolver, $sessionConfig, $data); $this->start($sessionNamespace, $sessionName); diff --git a/app/code/Magento/Core/Model/Theme/Collection.php b/app/code/Magento/Core/Model/Theme/Collection.php index d0b3f1b46b97d..6f5896b0470b7 100644 --- a/app/code/Magento/Core/Model/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Theme/Collection.php @@ -29,7 +29,7 @@ */ namespace Magento\Core\Model\Theme; -class Collection extends \Magento\Data\Collection +class Collection extends \Magento\Data\Collection implements \Magento\View\Design\Theme\ListInterface { /** * @var \Magento\Filesystem @@ -350,4 +350,19 @@ public function hasTheme(\Magento\View\Design\ThemeInterface $theme) $themeItems = $this->getItems(); return $theme->getThemePath() && isset($themeItems[$theme->getFullPath()]); } + + /** + * Get theme from file system by area and theme_path + * + * @param string $fullPath + * @return \Magento\View\Design\ThemeInterface + */ + public function getThemeByFullPath($fullPath) + { + list($area, $themePath) = explode('/', $fullPath, 2); + $this->addDefaultPattern($area) + ->addFilter('theme_path', $themePath); + + return $this->getFirstItem(); + } } diff --git a/app/code/Magento/Core/Model/Theme/Domain/Physical.php b/app/code/Magento/Core/Model/Theme/Domain/Physical.php index 2a680d166eeb8..8255611b44377 100644 --- a/app/code/Magento/Core/Model/Theme/Domain/Physical.php +++ b/app/code/Magento/Core/Model/Theme/Domain/Physical.php @@ -44,7 +44,7 @@ class Physical implements \Magento\View\Design\Theme\Domain\PhysicalInterface protected $_themeFactory; /** - * @var \Magento\Core\Model\Theme\CopyService + * @var \Magento\Theme\Model\CopyService */ protected $_themeCopyService; @@ -56,13 +56,13 @@ class Physical implements \Magento\View\Design\Theme\Domain\PhysicalInterface /** * @param \Magento\View\Design\ThemeInterface $theme * @param \Magento\Core\Model\ThemeFactory $themeFactory - * @param \Magento\Core\Model\Theme\CopyService $themeCopyService + * @param \Magento\Theme\Model\CopyService $themeCopyService * @param \Magento\Core\Model\Resource\Theme\Collection $themeCollection */ public function __construct( \Magento\View\Design\ThemeInterface $theme, \Magento\Core\Model\ThemeFactory $themeFactory, - \Magento\Core\Model\Theme\CopyService $themeCopyService, + \Magento\Theme\Model\CopyService $themeCopyService, \Magento\Core\Model\Resource\Theme\Collection $themeCollection ) { $this->_theme = $theme; diff --git a/app/code/Magento/Core/Model/Theme/Domain/Staging.php b/app/code/Magento/Core/Model/Theme/Domain/Staging.php index 2d2a17582c727..09be9f75cc6b3 100644 --- a/app/code/Magento/Core/Model/Theme/Domain/Staging.php +++ b/app/code/Magento/Core/Model/Theme/Domain/Staging.php @@ -39,17 +39,17 @@ class Staging implements \Magento\View\Design\Theme\Domain\StagingInterface protected $_theme; /** - * @var \Magento\Core\Model\Theme\CopyService + * @var \Magento\Theme\Model\CopyService */ protected $_themeCopyService; /** * @param \Magento\View\Design\ThemeInterface $theme - * @param \Magento\Core\Model\Theme\CopyService $themeCopyService + * @param \Magento\Theme\Model\CopyService $themeCopyService */ public function __construct( \Magento\View\Design\ThemeInterface $theme, - \Magento\Core\Model\Theme\CopyService $themeCopyService + \Magento\Theme\Model\CopyService $themeCopyService ) { $this->_theme = $theme; $this->_themeCopyService = $themeCopyService; diff --git a/app/code/Magento/Core/Model/Theme/Domain/Virtual.php b/app/code/Magento/Core/Model/Theme/Domain/Virtual.php index f538989e18cea..0cd748f576eec 100644 --- a/app/code/Magento/Core/Model/Theme/Domain/Virtual.php +++ b/app/code/Magento/Core/Model/Theme/Domain/Virtual.php @@ -51,7 +51,7 @@ class Virtual implements \Magento\View\Design\Theme\Domain\VirtualInterface protected $_stagingTheme; /** - * @var \Magento\Core\Model\Theme\CopyService + * @var \Magento\Theme\Model\CopyService */ protected $_themeCopyService; @@ -65,13 +65,13 @@ class Virtual implements \Magento\View\Design\Theme\Domain\VirtualInterface /** * @param \Magento\View\Design\ThemeInterface $theme * @param \Magento\Core\Model\ThemeFactory $themeFactory - * @param \Magento\Core\Model\Theme\CopyService $themeCopyService + * @param \Magento\Theme\Model\CopyService $themeCopyService * @param \Magento\Theme\Model\Config\Customization $customizationConfig */ public function __construct( \Magento\View\Design\ThemeInterface $theme, \Magento\Core\Model\ThemeFactory $themeFactory, - \Magento\Core\Model\Theme\CopyService $themeCopyService, + \Magento\Theme\Model\CopyService $themeCopyService, \Magento\Theme\Model\Config\Customization $customizationConfig ) { $this->_theme = $theme; diff --git a/app/code/Magento/Core/Model/Theme/Source/Theme.php b/app/code/Magento/Core/Model/Theme/Source/Theme.php index 5a65bd8d86bec..9fb385ada9e35 100644 --- a/app/code/Magento/Core/Model/Theme/Source/Theme.php +++ b/app/code/Magento/Core/Model/Theme/Source/Theme.php @@ -29,7 +29,7 @@ */ namespace Magento\Core\Model\Theme\Source; -use Magento\Core\Model\Theme\Label; +use Magento\View\Design\Theme\Label; use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; /** @@ -40,12 +40,12 @@ class Theme extends AbstractSource { /** - * @var Label + * @var \Magento\View\Design\Theme\Label */ protected $themeLabel; /** - * @param Label $themeLabel + * @param \Magento\View\Design\Theme\Label $themeLabel */ public function __construct(Label $themeLabel) { diff --git a/app/code/Magento/Core/Model/View/Design.php b/app/code/Magento/Core/Model/View/Design.php index b35fc64bacf14..9079857446aac 100644 --- a/app/code/Magento/Core/Model/View/Design.php +++ b/app/code/Magento/Core/Model/View/Design.php @@ -31,25 +31,6 @@ class Design implements \Magento\View\DesignInterface { - /** - * Common node path to theme design configuration - */ - const XML_PATH_THEME_ID = 'design/theme/theme_id'; - - /** - * Regular expressions matches cache - * - * @var array - */ - private static $_regexMatchCache = array(); - - /** - * Custom theme type cache - * - * @var array - */ - private static $_customThemeTypeCache = array(); - /** * Package area * @@ -253,33 +234,6 @@ public function getDesignTheme() return $this->_theme; } - /** - * Return package name based on design exception rules - * - * @param array $rules - design exception rules - * @param string $regexpsConfigPath - * @return bool|string - */ - public static function getPackageByUserAgent(array $rules, $regexpsConfigPath = 'path_mock') - { - foreach ($rules as $rule) { - if (!empty(self::$_regexMatchCache[$rule['regexp']][$_SERVER['HTTP_USER_AGENT']])) { - self::$_customThemeTypeCache[$regexpsConfigPath] = $rule['value']; - return $rule['value']; - } - - $regexp = '/' . trim($rule['regexp'], '/') . '/'; - - if (@preg_match($regexp, $_SERVER['HTTP_USER_AGENT'])) { - self::$_regexMatchCache[$rule['regexp']][$_SERVER['HTTP_USER_AGENT']] = true; - self::$_customThemeTypeCache[$regexpsConfigPath] = $rule['value']; - return $rule['value']; - } - } - - return false; - } - /** * {@inheritdoc} */ diff --git a/app/code/Magento/Core/etc/di.xml b/app/code/Magento/Core/etc/di.xml index e7c79712c206b..992533f8b1c10 100644 --- a/app/code/Magento/Core/etc/di.xml +++ b/app/code/Magento/Core/etc/di.xml @@ -415,31 +415,31 @@ - + page_types.xml - + - + frontend - + - + page_types_config - + - + diff --git a/app/design/frontend/magento_plushe/Magento_Core/template.phtml b/app/code/Magento/Core/view/frontend/template.phtml similarity index 100% rename from app/design/frontend/magento_plushe/Magento_Core/template.phtml rename to app/code/Magento/Core/view/frontend/template.phtml diff --git a/app/code/Magento/Cron/Model/Config/Reader/Xml.php b/app/code/Magento/Cron/Model/Config/Reader/Xml.php index 31e062270e811..5901d9fc5d412 100644 --- a/app/code/Magento/Cron/Model/Config/Reader/Xml.php +++ b/app/code/Magento/Cron/Model/Config/Reader/Xml.php @@ -41,15 +41,14 @@ class Xml extends \Magento\Config\Reader\Filesystem ); /** - * Initialize parameters - * - * @param \Magento\Config\FileResolverInterface $fileResolver + * @param \Magento\Config\FileResolverInterface $fileResolver * @param \Magento\Cron\Model\Config\Converter\Xml $converter * @param \Magento\Cron\Model\Config\SchemaLocator $schemaLocator * @param \Magento\Config\ValidationStateInterface $validationState - * @param string $fileName - * @param array $idAttributes - * @param string $domDocumentClass + * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -58,10 +57,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'crontab.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php index 0b41cfa26b474..1b0b096ddd169 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php @@ -35,7 +35,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getUrl('customer/*/save'), 'method' => 'post', diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php index 4ffb6c7c98945..1aee33aa2fc90 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php @@ -49,24 +49,24 @@ class File extends \Magento\Data\Form\Element\AbstractElement protected $_adminhtmlData = null; /** - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\Backend\Helper\Data $adminhtmlData * @param \Magento\View\Url $viewUrl - * @param array $attributes + * @param array $data */ - public function __construct( - \Magento\Escaper $escaper, + public function __construct( \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\Backend\Helper\Data $adminhtmlData, \Magento\View\Url $viewUrl, - $attributes = array() + $data = array() ) { $this->_adminhtmlData = $adminhtmlData; $this->_viewUrl = $viewUrl; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); $this->setType('file'); } diff --git a/app/code/Magento/Customer/Model/Session.php b/app/code/Magento/Customer/Model/Session.php index d10c2400f54c8..467ef6584f8c2 100644 --- a/app/code/Magento/Customer/Model/Session.php +++ b/app/code/Magento/Customer/Model/Session.php @@ -88,15 +88,15 @@ class Session extends \Magento\Core\Model\Session\AbstractSession * @param \Magento\Core\Model\Session\Context $context * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig - * @param \Magento\Customer\Model\Config\Share $configShare + * @param Config\Share $configShare * @param \Magento\Core\Helper\Url $coreUrl * @param \Magento\Customer\Helper\Data $customerData - * @param \Magento\Customer\Model\Resource\Customer $customerResource - * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param Resource\Customer $customerResource + * @param CustomerFactory $customerFactory * @param \Magento\Core\Model\UrlFactory $urlFactory * @param \Magento\Core\Model\Session $session - * @param array $data * @param null $sessionName + * @param array $data */ public function __construct( \Magento\Core\Model\Session\Context $context, @@ -109,8 +109,8 @@ public function __construct( \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Core\Model\UrlFactory $urlFactory, \Magento\Core\Model\Session $session, - array $data = array(), - $sessionName = null + $sessionName = null, + array $data = array() ) { $this->_coreUrl = $coreUrl; $this->_customerData = $customerData; diff --git a/app/design/frontend/magento_plushe/Magento_Customer/account/customer.phtml b/app/code/Magento/Customer/view/frontend/account/customer.phtml similarity index 95% rename from app/design/frontend/magento_plushe/Magento_Customer/account/customer.phtml rename to app/code/Magento/Customer/view/frontend/account/customer.phtml index f158025e4468a..3c867adcf236b 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/account/customer.phtml +++ b/app/code/Magento/Customer/view/frontend/account/customer.phtml @@ -29,9 +29,9 @@ getCustomerName(); ?> getChildHtml()):?> - + +
    diff --git a/app/code/Magento/Customer/view/frontend/form/confirmation.phtml b/app/code/Magento/Customer/view/frontend/form/confirmation.phtml index 1956b26aa8c7b..846c7e3355d60 100644 --- a/app/code/Magento/Customer/view/frontend/form/confirmation.phtml +++ b/app/code/Magento/Customer/view/frontend/form/confirmation.phtml @@ -29,7 +29,7 @@ diff --git a/app/code/Magento/Customer/view/frontend/form/edit.phtml b/app/code/Magento/Customer/view/frontend/form/edit.phtml index 2aa77595ea1a6..5a2abcf2e3272 100644 --- a/app/code/Magento/Customer/view/frontend/form/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/form/edit.phtml @@ -31,7 +31,7 @@ getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?> diff --git a/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml b/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml index 48cd1f7dee449..1e1a42e50a9e9 100644 --- a/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml +++ b/app/code/Magento/Customer/view/frontend/form/forgotpassword.phtml @@ -29,7 +29,7 @@ getChildHtml('form_additional_info'); ?> diff --git a/app/code/Magento/Customer/view/frontend/form/login.phtml b/app/code/Magento/Customer/view/frontend/form/login.phtml index 374fc86688ef3..407bdd903296c 100644 --- a/app/code/Magento/Customer/view/frontend/form/login.phtml +++ b/app/code/Magento/Customer/view/frontend/form/login.phtml @@ -39,7 +39,7 @@
    diff --git a/app/code/Magento/Customer/view/frontend/form/register.phtml b/app/code/Magento/Customer/view/frontend/form/register.phtml index 23feacec27fa4..ec373e3133330 100644 --- a/app/code/Magento/Customer/view/frontend/form/register.phtml +++ b/app/code/Magento/Customer/view/frontend/form/register.phtml @@ -42,7 +42,7 @@
    - +
    isNewsletterEnabled()): ?> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml index 6a4ef38b38634..cdb1ff1405e39 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml @@ -24,9 +24,12 @@ */ --> - - - + + + + account + + diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml index c4faa5b6d62f2..2ce6bfeaa3799 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml @@ -25,6 +25,11 @@ --> + + + true + + diff --git a/app/code/Magento/Customer/view/frontend/layout/default.xml b/app/code/Magento/Customer/view/frontend/layout/default.xml index aefd5ecf386c4..be8d4da7aa04a 100644 --- a/app/code/Magento/Customer/view/frontend/layout/default.xml +++ b/app/code/Magento/Customer/view/frontend/layout/default.xml @@ -30,6 +30,11 @@ My Account + + + Register + + diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Element/Composite/AbstractComposite.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Element/Composite/AbstractComposite.php index 69e5010302bc2..a6e3f430b034a 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Element/Composite/AbstractComposite.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Element/Composite/AbstractComposite.php @@ -70,25 +70,25 @@ abstract class AbstractComposite protected $_elementsFactory; /** - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Element\Factory $elementsFactory * @param \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Renderer\Factory $rendererFactory - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Element\Factory $elementsFactory, \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Renderer\Factory $rendererFactory, - $attributes = array() + $data = array() ) { $this->_elementsFactory = $elementsFactory; $this->_rendererFactory = $rendererFactory; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } /** diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php index c8694d00acfb1..43b3fbb410093 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php @@ -71,7 +71,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'action' => '#', 'method' => 'post', )) diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php index 09593dcd3ea92..e579b83550679 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php @@ -92,7 +92,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'action' => '#', 'method' => 'post', )) diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php index 041d724c04dee..44a78d00eed2d 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php @@ -73,7 +73,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'action' => '#', 'method' => 'post', )) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php index b4ecc0e88584c..6176e5fb19642 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php @@ -272,8 +272,8 @@ public function duplicateAction() $themeId = (int)$this->getRequest()->getParam('theme_id'); /** @var $themeCopy \Magento\View\Design\ThemeInterface */ $themeCopy = $this->_objectManager->create('Magento\View\Design\ThemeInterface'); - /** @var $copyService \Magento\Core\Model\Theme\CopyService */ - $copyService = $this->_objectManager->get('Magento\Core\Model\Theme\CopyService'); + /** @var $copyService \Magento\Theme\Model\CopyService */ + $copyService = $this->_objectManager->get('Magento\Theme\Model\CopyService'); try { $theme = $this->_loadThemeById($themeId); if (!$theme->isVirtual()) { @@ -314,8 +314,8 @@ public function revertAction() } try { - /** @var $copyService \Magento\Core\Model\Theme\CopyService */ - $copyService = $this->_objectManager->get('Magento\Core\Model\Theme\CopyService'); + /** @var $copyService \Magento\Theme\Model\CopyService */ + $copyService = $this->_objectManager->get('Magento\Theme\Model\CopyService'); $stagingTheme = $virtualTheme->getDomainModel(\Magento\View\Design\ThemeInterface::TYPE_VIRTUAL) ->getStagingTheme(); switch ($revertTo) { diff --git a/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php b/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php index b537723770320..59a2736d00b7d 100644 --- a/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php +++ b/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php @@ -63,10 +63,12 @@ class Standard extends \Magento\Core\App\Router\Base * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo + * @param string $routerId * @param \Magento\App\RouterListInterface $routerList * @param \Magento\ObjectManager $objectManager * @param \Magento\Core\App\Request\RewriteService $urlRewriteService - * @param $routerId + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\App\ActionFactory $actionFactory, @@ -78,14 +80,22 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Store\Config $storeConfig, \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo, + $routerId, \Magento\App\RouterListInterface $routerList, \Magento\ObjectManager $objectManager, - \Magento\Core\App\Request\RewriteService $urlRewriteService, - $routerId + \Magento\Core\App\Request\RewriteService $urlRewriteService ) { parent::__construct( - $actionFactory, $defaultPath, $responseFactory, $routeConfig, $appState, $url, $storeManager, $storeConfig, - $urlSecurityInfo, $routerId + $actionFactory, + $defaultPath, + $responseFactory, + $routeConfig, + $appState, + $url, + $storeManager, + $storeConfig, + $urlSecurityInfo, + $routerId ); $this->_urlRewriteService = $urlRewriteService; $this->_objectManager = $objectManager; diff --git a/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Builder.php b/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Builder.php index d622780ec6c7f..604a3f8153bfb 100644 --- a/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Builder.php +++ b/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Builder.php @@ -103,7 +103,7 @@ public function create(array $data = array()) if ($isFilePresent) { /** @var $form \Magento\Data\Form */ $form = $this->_formFactory->create(array( - 'attributes' => $data, + 'data' => $data, )); $this->_addElementTypes($form); @@ -112,7 +112,7 @@ public function create(array $data = array()) $this->_populateColumns($columns, $data['tab']); } else { $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'action' => '#', )) ); diff --git a/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Element/Factory.php b/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Element/Factory.php index 9ed53b372899d..1b2f9bcfd447a 100644 --- a/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Element/Factory.php +++ b/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/Form/Element/Factory.php @@ -48,6 +48,6 @@ public function __construct(\Magento\ObjectManager $objectManager) */ public function create($className, array $data = array()) { - return $this->_objectManager->create($className, array('attributes' => $data)); + return $this->_objectManager->create($className, array('data' => $data)); } } diff --git a/app/code/Magento/DesignEditor/Model/State.php b/app/code/Magento/DesignEditor/Model/State.php index 51081a97d5212..72f2352985991 100644 --- a/app/code/Magento/DesignEditor/Model/State.php +++ b/app/code/Magento/DesignEditor/Model/State.php @@ -191,11 +191,11 @@ protected function _setTheme() if ($this->_themeContext->getEditableTheme()) { $themeId = $this->_themeContext->getVisibleTheme()->getId(); $this->_application->getStore()->setConfig( - \Magento\Core\Model\View\Design::XML_PATH_THEME_ID, + \Magento\View\DesignInterface::XML_PATH_THEME_ID, $themeId ); $this->_application->getConfig()->setValue( - \Magento\Core\Model\View\Design::XML_PATH_THEME_ID, + \Magento\View\DesignInterface::XML_PATH_THEME_ID, $themeId ); } diff --git a/app/code/Magento/DesignEditor/Model/Theme/Context.php b/app/code/Magento/DesignEditor/Model/Theme/Context.php index c98c55ecb9e72..3bc3d6e70ccd3 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Context.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Context.php @@ -37,7 +37,7 @@ class Context protected $_themeFactory; /** - * @var \Magento\Core\Model\Theme\CopyService + * @var \Magento\Theme\Model\CopyService */ protected $_copyService; @@ -55,11 +55,11 @@ class Context * Initialize dependencies * * @param \Magento\Core\Model\ThemeFactory $themeFactory - * @param \Magento\Core\Model\Theme\CopyService $copyService + * @param \Magento\Theme\Model\CopyService $copyService */ public function __construct( \Magento\Core\Model\ThemeFactory $themeFactory, - \Magento\Core\Model\Theme\CopyService $copyService + \Magento\Theme\Model\CopyService $copyService ) { $this->_themeFactory = $themeFactory; $this->_copyService = $copyService; diff --git a/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php b/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php index 2892d3c061203..6ed4970bc953f 100644 --- a/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php +++ b/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php @@ -56,25 +56,27 @@ class NavigationMode extends \Magento\Core\Model\Url * @param \Magento\App\Route\ConfigInterface $routeConfig * @param \Magento\App\RequestInterface $request * @param \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo - * @param \Magento\DesignEditor\Helper\Data $helper * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\App $app * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Session $session * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\DesignEditor\Helper\Data $helper * @param string $areaCode * @param array $data + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\App\Route\ConfigInterface $routeConfig, \Magento\App\RequestInterface $request, \Magento\Core\Model\Url\SecurityInfoInterface $urlSecurityInfo, - \Magento\DesignEditor\Helper\Data $helper, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\App $app, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Session $session, \Magento\Session\SidResolverInterface $sidResolver, + \Magento\DesignEditor\Helper\Data $helper, $areaCode, array $data = array() ) { diff --git a/app/code/Magento/DesignEditor/etc/di.xml b/app/code/Magento/DesignEditor/etc/di.xml index a9748f13bb728..8a56ee6004c13 100644 --- a/app/code/Magento/DesignEditor/etc/di.xml +++ b/app/code/Magento/DesignEditor/etc/di.xml @@ -29,7 +29,7 @@ vde - + diff --git a/app/code/Magento/Downloadable/Model/Product/Price.php b/app/code/Magento/Downloadable/Model/Product/Price.php index bd46745082d53..28f3ceae35133 100644 --- a/app/code/Magento/Downloadable/Model/Product/Price.php +++ b/app/code/Magento/Downloadable/Model/Product/Price.php @@ -42,7 +42,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price * @param \Magento\Catalog\Model\Product $product * @return float */ - public function getFinalPrice($qty=null, $product) + public function getFinalPrice($qty, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); diff --git a/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml b/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml index 4e6157bf2eb9d..c0e12644d00d9 100644 --- a/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml +++ b/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml @@ -61,7 +61,7 @@ -

    +
    getChildHtml('pager'); ?> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml index a4616435e4e40..feeee4aa3fa43 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml @@ -25,7 +25,7 @@ --> - + diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php index e7483e0fbb562..5a516296e923c 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php @@ -116,7 +116,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php b/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php index d65cfdd4a7684..acab8a8935b9d 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php @@ -82,6 +82,7 @@ public function outputValue($format = \Magento\Eav\Model\AttributeDataFactory::O case \Magento\Eav\Model\AttributeDataFactory::OUTPUT_FORMAT_JSON: case \Magento\Eav\Model\AttributeDataFactory::OUTPUT_FORMAT_ARRAY: $output = $values; + // fall-through intentional default: $output = array(); foreach ($values as $value) { diff --git a/app/code/Magento/Email/Model/Sender.php b/app/code/Magento/Email/Model/Sender.php index 1f4b58e3c74cc..b3b93de453d2f 100644 --- a/app/code/Magento/Email/Model/Sender.php +++ b/app/code/Magento/Email/Model/Sender.php @@ -68,7 +68,7 @@ public function __construct( * @param int $storeId * @return \Magento\Email\Model\Sender */ - public function send($email, $name, $template, $sender, $templateParams = array(), $storeId) + public function send($email, $name, $template, $sender, $templateParams, $storeId) { $this->_store->load($storeId); $this->_emailInfo->addTo($email, $name); diff --git a/app/code/Magento/Email/Model/Template/Config/Reader.php b/app/code/Magento/Email/Model/Template/Config/Reader.php index dd27e292f98ce..3c52bbf0b5949 100644 --- a/app/code/Magento/Email/Model/Template/Config/Reader.php +++ b/app/code/Magento/Email/Model/Template/Config/Reader.php @@ -33,25 +33,36 @@ class Reader extends \Magento\Config\Reader\Filesystem private $_moduleDirResolver; /** - * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Email\Model\Template\Config\Converter $converter - * @param \Magento\Email\Model\Template\Config\SchemaLocator $schemaLocator - * @param \Magento\Config\ValidationStateInterface $validationState - * @param \Magento\Module\Dir\ReverseResolver $moduleDirResolver + * List of id attributes for merge + * + * @var array */ + protected $_idAttributes = array( + '/config/template' => 'id', + ); + public function __construct( \Magento\Config\FileResolverInterface $fileResolver, \Magento\Email\Model\Template\Config\Converter $converter, \Magento\Email\Model\Template\Config\SchemaLocator $schemaLocator, \Magento\Config\ValidationStateInterface $validationState, - \Magento\Module\Dir\ReverseResolver $moduleDirResolver + \Magento\Module\Dir\ReverseResolver $moduleDirResolver, + $fileName = 'email_templates.xml', + $idAttributes = array(), + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { - $fileName = 'email_templates.xml'; - $idAttributes = array( - '/config/template' => 'id', - ); - parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes); $this->_moduleDirResolver = $moduleDirResolver; + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope + ); } /** diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index cfdcf34c7ad93..cce841106a2f9 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -121,7 +121,6 @@ class Filter extends \Magento\Filter\Template protected $_appState; /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @param \Magento\Stdlib\String $string * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper @@ -132,6 +131,9 @@ class Filter extends \Magento\Filter\Template * @param \Magento\View\LayoutInterface $layout * @param \Magento\View\LayoutFactory $layoutFactory * @param \Magento\App\State $appState + * @param array $variables + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Stdlib\String $string, @@ -143,7 +145,8 @@ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\View\LayoutInterface $layout, \Magento\View\LayoutFactory $layoutFactory, - \Magento\App\State $appState + \Magento\App\State $appState, + $variables = array() ) { $this->_escaper = $escaper; $this->_viewUrl = $viewUrl; @@ -155,7 +158,7 @@ public function __construct( $this->_layout = $layout; $this->_layoutFactory = $layoutFactory; $this->_appState = $appState; - parent::__construct($string); + parent::__construct($string, $variables); } /** diff --git a/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php b/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php index a66753612c8da..ee3ee63b86746 100644 --- a/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php +++ b/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php @@ -44,21 +44,21 @@ class Config protected $_coreStoreConfig; /** - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\Core\Model\Store\Config $coreStoreConfig, - $attributes = array() + $data = array() ) { $this->_coreStoreConfig = $coreStoreConfig; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } /** diff --git a/app/code/Magento/GiftMessage/Model/Message.php b/app/code/Magento/GiftMessage/Model/Message.php index a8cd97b7120ae..0228e88443b00 100644 --- a/app/code/Magento/GiftMessage/Model/Message.php +++ b/app/code/Magento/GiftMessage/Model/Message.php @@ -63,8 +63,8 @@ class Message extends \Magento\Core\Model\AbstractModel public function __construct( \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\GiftMessage\Model\Resource\Message $resource = null, - \Magento\Data\Collection\Db $resourceCollection = null, + \Magento\GiftMessage\Model\Resource\Message $resource, + \Magento\Data\Collection\Db $resourceCollection, \Magento\GiftMessage\Model\TypeFactory $typeFactory, array $data = array() ) { diff --git a/app/code/Magento/GoogleAnalytics/Block/Ga.php b/app/code/Magento/GoogleAnalytics/Block/Ga.php index ddce627f4754b..d117d07140853 100644 --- a/app/code/Magento/GoogleAnalytics/Block/Ga.php +++ b/app/code/Magento/GoogleAnalytics/Block/Ga.php @@ -99,7 +99,7 @@ public function getPageTrackingCode($accountId) { $pageName = trim($this->getPageName()); $optPageURL = ''; - if ($pageName && preg_match('/^\/.*/i', $pageName)) { + if ($pageName && substr($pageName, 0, 1) == '/' && strlen($pageName) > 1) { $optPageURL = ", '{$this->escapeJsQuote($pageName)}'"; } return " diff --git a/app/code/Magento/GoogleAnalytics/Model/Observer.php b/app/code/Magento/GoogleAnalytics/Model/Observer.php index 4e3b0c7911d6a..bcb839b1fc06b 100644 --- a/app/code/Magento/GoogleAnalytics/Model/Observer.php +++ b/app/code/Magento/GoogleAnalytics/Model/Observer.php @@ -49,7 +49,7 @@ class Observer protected $_googleAnalyticsData = null; /** - * @var \Magento\Core\Model\Layout + * @var \Magento\View\LayoutInterface */ protected $_layout; @@ -60,12 +60,12 @@ class Observer /** * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Layout $layout + * @param \Magento\View\LayoutInterface $layout * @param \Magento\GoogleAnalytics\Helper\Data $googleAnalyticsData */ public function __construct( \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Layout $layout, + \Magento\View\LayoutInterface $layout, \Magento\GoogleAnalytics\Helper\Data $googleAnalyticsData ) { $this->_googleAnalyticsData = $googleAnalyticsData; diff --git a/app/code/Magento/GoogleCheckout/Model/Api/Xml/Callback.php b/app/code/Magento/GoogleCheckout/Model/Api/Xml/Callback.php index 2c3a829d33f0c..ea7a51b8586ee 100644 --- a/app/code/Magento/GoogleCheckout/Model/Api/Xml/Callback.php +++ b/app/code/Magento/GoogleCheckout/Model/Api/Xml/Callback.php @@ -64,24 +64,24 @@ class Callback extends \Magento\GoogleCheckout\Model\Api\Xml\AbstractXml protected $string; /** + * @param \Magento\ObjectManager $objectManager + * @param \Magento\Core\Model\Translate $translator + * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\GoogleCheckout\Helper\Data $googleCheckoutData * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Translate $translator - * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Stdlib\String $string * @param array $data */ public function __construct( + \Magento\ObjectManager $objectManager, + \Magento\Core\Model\Translate $translator, + \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\GoogleCheckout\Helper\Data $googleCheckoutData, \Magento\Tax\Helper\Data $taxData, - \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Translate $translator, - \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Stdlib\String $string, array $data = array() ) { diff --git a/app/code/Magento/GoogleCheckout/Model/Api/Xml/Checkout.php b/app/code/Magento/GoogleCheckout/Model/Api/Xml/Checkout.php index cf44cff5d6482..8d6dc445dff58 100644 --- a/app/code/Magento/GoogleCheckout/Model/Api/Xml/Checkout.php +++ b/app/code/Magento/GoogleCheckout/Model/Api/Xml/Checkout.php @@ -93,25 +93,25 @@ class Checkout extends \Magento\GoogleCheckout\Model\Api\Xml\AbstractXml protected $_eventManager = null; /** + * @param \Magento\ObjectManager $objectManager + * @param \Magento\Core\Model\Translate $translator + * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\GoogleCheckout\Helper\Data $googleCheckoutData * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Weee\Helper\Data $weeeData - * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Translate $translator - * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param array $data */ public function __construct( + \Magento\ObjectManager $objectManager, + \Magento\Core\Model\Translate $translator, + \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Event\ManagerInterface $eventManager, \Magento\Customer\Helper\Data $customerData, \Magento\GoogleCheckout\Helper\Data $googleCheckoutData, \Magento\Tax\Helper\Data $taxData, \Magento\Weee\Helper\Data $weeeData, - \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Translate $translator, - \Magento\Core\Model\Store\Config $coreStoreConfig, array $data = array() ) { $this->_eventManager = $eventManager; diff --git a/app/code/Magento/GoogleCheckout/Model/Payment.php b/app/code/Magento/GoogleCheckout/Model/Payment.php index 9c4543a17cd41..b76378021d3d3 100644 --- a/app/code/Magento/GoogleCheckout/Model/Payment.php +++ b/app/code/Magento/GoogleCheckout/Model/Payment.php @@ -64,13 +64,13 @@ class Payment extends \Magento\Payment\Model\Method\AbstractMethod protected $dateFactory; public function __construct( - \Magento\Core\Model\DateFactory $dateFactory, - \Magento\Core\Model\UrlFactory $urlFactory, - \Magento\GoogleCheckout\Model\ApiFactory $apiFactory, \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Core\Model\DateFactory $dateFactory, + \Magento\Core\Model\UrlFactory $urlFactory, + \Magento\GoogleCheckout\Model\ApiFactory $apiFactory, array $data = array() ) { $this->dateFactory = $dateFactory; diff --git a/app/code/Magento/GoogleShopping/Model/Service/Item.php b/app/code/Magento/GoogleShopping/Model/Service/Item.php index 35be6c55869cb..885e2438d1bee 100644 --- a/app/code/Magento/GoogleShopping/Model/Service/Item.php +++ b/app/code/Magento/GoogleShopping/Model/Service/Item.php @@ -49,17 +49,17 @@ class Item extends \Magento\GoogleShopping\Model\Service /** * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory - * @param \Magento\Core\Model\Date $date * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\GoogleShopping\Model\Config $config + * @param \Magento\Core\Model\Date $date * @param \Magento\GoogleShopping\Helper\Data $gsData * @param array $data */ public function __construct( \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, - \Magento\Core\Model\Date $date, \Magento\Core\Model\Registry $coreRegistry, \Magento\GoogleShopping\Model\Config $config, + \Magento\Core\Model\Date $date, \Magento\GoogleShopping\Helper\Data $gsData, array $data = array() ) { diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php index f771269af4e79..943ea21bd2773 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php @@ -75,7 +75,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getUrl('adminhtml/*/getFilter'), 'method' => 'post', diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php index 608d1a813006d..dbc7b55bc3e40 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -85,7 +85,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getUrl('adminhtml/*/validate'), 'method' => 'post', diff --git a/app/code/Magento/ImportExport/Model/Export/Config/Reader.php b/app/code/Magento/ImportExport/Model/Export/Config/Reader.php index bdec2c430e823..28c4907db4f3b 100644 --- a/app/code/Magento/ImportExport/Model/Export/Config/Reader.php +++ b/app/code/Magento/ImportExport/Model/Export/Config/Reader.php @@ -39,11 +39,12 @@ class Reader extends \Magento\Config\Reader\Filesystem /** * @param \Magento\Config\FileResolverInterface $fileResolver * @param \Magento\ImportExport\Model\Export\Config\Converter $converter - * @param \Magento\Config\ValidationStateInterface $validationState * @param \Magento\ImportExport\Model\Export\Config\SchemaLocator $schemaLocator + * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -52,10 +53,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'export.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/Product.php b/app/code/Magento/ImportExport/Model/Export/Entity/Product.php index 7e4d1096c5973..62333f7e03947 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/Product.php @@ -653,8 +653,10 @@ protected function _getItemsPerPage() switch($lastMemoryLimitLetter) { case 'g': $memoryLimit *= 1024; + // fall-through intentional case 'm': $memoryLimit *= 1024; + // fall-through intentional case 'k': $memoryLimit *= 1024; break; diff --git a/app/code/Magento/ImportExport/Model/Import/Config/Reader.php b/app/code/Magento/ImportExport/Model/Import/Config/Reader.php index 159ad4daa794c..799e251217e02 100644 --- a/app/code/Magento/ImportExport/Model/Import/Config/Reader.php +++ b/app/code/Magento/ImportExport/Model/Import/Config/Reader.php @@ -38,11 +38,12 @@ class Reader extends \Magento\Config\Reader\Filesystem /** * @param \Magento\Config\FileResolverInterface $fileResolver * @param \Magento\ImportExport\Model\Import\Config\Converter $converter - * @param \Magento\Config\ValidationStateInterface $validationState * @param \Magento\ImportExport\Model\Import\Config\SchemaLocator $schemaLocator + * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -51,10 +52,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'import.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Configurable.php b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Configurable.php index 244cf30a12510..e83f10e43f303 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Configurable.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Configurable.php @@ -153,20 +153,20 @@ class Configurable /** * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $attrSetColFac * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $prodAttrColFac + * @param array $params * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypesConfig * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper * @param \Magento\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $_productColFac - * @param array $params */ public function __construct( \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $attrSetColFac, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $prodAttrColFac, + array $params, \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypesConfig, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, \Magento\App\Resource $resource, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $_productColFac, - array $params + \Magento\Catalog\Model\Resource\Product\CollectionFactory $_productColFac ) { $this->_productTypesConfig = $productTypesConfig; $this->_resourceHelper = $resourceHelper; diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Grouped.php b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Grouped.php index abe164fd975b8..6b016d3abda11 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Grouped.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/Grouped.php @@ -70,20 +70,19 @@ class Grouped /** * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $attrSetColFac * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $prodAttrColFac + * @param array $params * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\Catalog\Model\Resource\Product\LinkFactory $productLinkFactory * @param \Magento\App\Resource $resource - * @param array $params */ public function __construct( \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $attrSetColFac, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $prodAttrColFac, + array $params, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\Catalog\Model\Resource\Product\LinkFactory $productLinkFactory, - \Magento\App\Resource $resource, - array $params - ) - { + \Magento\App\Resource $resource + ) { $this->_importFactory = $importFactory; $this->_resource = $resource; $this->_productLinkFactory = $productLinkFactory; diff --git a/app/code/Magento/Index/Block/Adminhtml/Process/Edit/Form.php b/app/code/Magento/Index/Block/Adminhtml/Process/Edit/Form.php index 8dd4f0791d9cf..f0699b20eaff6 100644 --- a/app/code/Magento/Index/Block/Adminhtml/Process/Edit/Form.php +++ b/app/code/Magento/Index/Block/Adminhtml/Process/Edit/Form.php @@ -32,7 +32,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getActionUrl(), 'method' => 'post', diff --git a/app/code/Magento/Index/Model/Indexer/Config/Reader.php b/app/code/Magento/Index/Model/Indexer/Config/Reader.php index d46fe4775c2e6..1a93bcdafc1a9 100644 --- a/app/code/Magento/Index/Model/Indexer/Config/Reader.php +++ b/app/code/Magento/Index/Model/Indexer/Config/Reader.php @@ -45,6 +45,7 @@ class Reader extends \Magento\Config\Reader\Filesystem * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, @@ -53,10 +54,18 @@ public function __construct( \Magento\Config\ValidationStateInterface $validationState, $fileName = 'indexers.xml', $idAttributes = array(), - $domDocumentClass = 'Magento\Config\Dom' + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { parent::__construct( - $fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope ); } diff --git a/app/code/Magento/Index/Model/Shell.php b/app/code/Magento/Index/Model/Shell.php index b3822a9f14384..3ddf6efef97a9 100644 --- a/app/code/Magento/Index/Model/Shell.php +++ b/app/code/Magento/Index/Model/Shell.php @@ -48,16 +48,16 @@ class Shell extends \Magento\Core\Model\AbstractShell protected $_indexer; /** - * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\Filesystem $filesystem * @param string $entryPoint * @param \Magento\App\Dir $dir + * @param \Magento\Index\Model\Indexer $indexer */ public function __construct( - \Magento\Index\Model\Indexer $indexer, \Magento\Filesystem $filesystem, $entryPoint, - \Magento\App\Dir $dir + \Magento\App\Dir $dir, + \Magento\Index\Model\Indexer $indexer ) { $this->_indexer = $indexer; parent::__construct($filesystem, $entryPoint, $dir); diff --git a/app/code/Magento/Install/App/Action/Plugin/Design.php b/app/code/Magento/Install/App/Action/Plugin/Design.php index 141bd171386fe..58423881ca8b7 100644 --- a/app/code/Magento/Install/App/Action/Plugin/Design.php +++ b/app/code/Magento/Install/App/Action/Plugin/Design.php @@ -42,9 +42,9 @@ class Design protected $_layout; /** - * @var \Magento\Core\Model\Theme\CollectionFactory + * @var \Magento\View\Design\Theme\ListInterface */ - protected $_collectionFactory; + protected $_themeList; /** * @var \Magento\View\DesignInterface @@ -56,17 +56,17 @@ class Design * @param \Magento\Core\Model\App $app * @param \Magento\View\LayoutInterface $layout * @param \Magento\View\DesignInterface $viewDesign - * @param \Magento\Core\Model\Theme\CollectionFactory $collectionFactory + * @param \Magento\View\Design\Theme\ListInterface $themeList */ public function __construct( \Magento\App\RequestInterface $request, \Magento\Core\Model\App $app, \Magento\View\LayoutInterface $layout, \Magento\View\DesignInterface $viewDesign, - \Magento\Core\Model\Theme\CollectionFactory $collectionFactory + \Magento\View\Design\Theme\ListInterface $themeList ) { $this->_viewDesign = $viewDesign; - $this->_collectionFactory = $collectionFactory; + $this->_themeList = $themeList; $this->_request = $request; $this->_app = $app; $this->_layout = $layout; @@ -84,11 +84,9 @@ public function beforeDispatch(array $arguments = array()) $area = $this->_app->getArea($areaCode); $area->load(\Magento\Core\Model\App\Area::PART_CONFIG); - /** @var $themesCollection \Magento\Core\Model\Theme\Collection */ - $themesCollection = $this->_collectionFactory->create(); - $themeModel = $themesCollection->addDefaultPattern($areaCode) - ->addFilter('theme_path', $this->_viewDesign->getConfigurationDesignTheme($areaCode)) - ->getFirstItem(); + $themePath = $this->_viewDesign->getConfigurationDesignTheme($areaCode); + $themeFullPath = $areaCode . \Magento\View\Design\ThemeInterface::PATH_SEPARATOR . $themePath; + $themeModel = $this->_themeList->getThemeByFullPath($themeFullPath); $this->_viewDesign->setArea($areaCode)->setDesignTheme($themeModel); $area->detectDesign($this->_request); diff --git a/app/code/Magento/Install/etc/di.xml b/app/code/Magento/Install/etc/di.xml index 7460d942e67b4..551fc38f61bfa 100644 --- a/app/code/Magento/Install/etc/di.xml +++ b/app/code/Magento/Install/etc/di.xml @@ -24,6 +24,7 @@ */ --> + install diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php index a4b1a47c2ccbe..1bfaaefb92324 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php @@ -1,6 +1,6 @@ _removeButton('reset'); $this->_removeButton('delete'); + + if ($this->_isNewIntegration()) { + $this->removeButton('save')->addButton( + 'save', + [ + 'id' => 'save-split-button', + 'label' => __('Save'), + 'class_name' => 'Magento\Backend\Block\Widget\Button\SplitButton', + 'button_class' => 'PrimarySplitButton', + 'data_attribute' => [ + 'mage-init' => [ + 'button' => ['event' => 'save', 'target' => '#edit_form'], + ], + ], + 'options' => [ + 'save_activate' => [ + 'id' => 'activate', + 'label' => __('Save & Activate'), + 'data_attribute' => [ + 'mage-init' => [ + 'button' => [ + 'event' => 'saveAndActivate', + 'target' => '#edit_form', + ], + 'integration' => [ + 'gridUrl' => $this->getUrl('*/*/'), + ] + ] + ] + ] + ] + ] + ); + } } /** @@ -70,15 +106,15 @@ protected function _construct() */ public function getHeaderText() { - if (isset($this->_registry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION)[Info::DATA_ID])) { + if ($this->_isNewIntegration()) { + return __('New Integration'); + } else { return __( "Edit Integration '%1'", $this->escapeHtml( $this->_registry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION)[Info::DATA_NAME] ) ); - } else { - return __('New Integration'); } } @@ -89,4 +125,14 @@ public function getFormActionUrl() { return $this->getUrl('*/*/save'); } + + /** + * Determine whether we create new integration or editing an existing one. + * + * @return bool + */ + protected function _isNewIntegration() + { + return !isset($this->_registry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION)[Info::DATA_ID]); + } } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Form.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Form.php index 9c0f4ce006e40..2d38b893f23a6 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Form.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Form.php @@ -44,7 +44,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create( array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php index 1eccbee1b67f6..9755e8ffe589e 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php @@ -26,7 +26,8 @@ namespace Magento\Integration\Block\Adminhtml\Integration\Edit\Tab; -use \Magento\Integration\Controller\Adminhtml\Integration; +use Magento\Integration\Controller\Adminhtml\Integration; +use Magento\Integration\Model\Integration as IntegrationModel; /** * Main Integration info edit form @@ -38,7 +39,7 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { /**#@+ - * edit_form element names. + * Form elements names. */ const HTML_ID_PREFIX = 'integration_properties_'; const DATA_ID = 'integration_id'; @@ -46,6 +47,7 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic const DATA_EMAIL = 'email'; const DATA_ENDPOINT = 'endpoint'; const DATA_SETUP_TYPE = 'setup_type'; + const DATA_CONSUMER_ID = 'consumer_id'; /**#@-*/ /** @@ -59,44 +61,8 @@ protected function _prepareForm() $form = $this->_formFactory->create(); $form->setHtmlIdPrefix(self::HTML_ID_PREFIX); $integrationData = $this->_coreRegistry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION); - $fieldset = $form->addFieldset('base_fieldset', array('legend' => __('General'))); - if (isset($integrationData[self::DATA_ID])) { - $fieldset->addField(self::DATA_ID, 'hidden', array('name' => 'id')); - } - $fieldset->addField( - self::DATA_NAME, - 'text', - array( - 'label' => __('Name'), - 'name' => self::DATA_NAME, - 'required' => true, - 'disabled' => false, - 'maxlength' => '255' - ) - ); - $fieldset->addField( - self::DATA_EMAIL, - 'text', - array( - 'label' => __('Email'), - 'name' => self::DATA_EMAIL, - 'disabled' => false, - 'class' => 'validate-email', - 'maxlength' => '254' - ) - ); - $fieldset->addField( - self::DATA_ENDPOINT, - 'text', - array( - 'label' => __('Callback URL'), - 'name' => self::DATA_ENDPOINT, - 'disabled' => false, - // @codingStandardsIgnoreStart - 'note'=> __('When using Oauth for token exchange, enter URL where Oauth credentials can be POST-ed. We strongly recommend you to use https://') - // @codingStandardsIgnoreEnd - ) - ); + $this->_addGeneralFieldset($form, $integrationData); + $this->_addDetailsFieldset($form, $integrationData); $form->setValues($integrationData); $this->setForm($form); return $this; @@ -141,4 +107,79 @@ public function isHidden() { return false; } + + /** + * Add fieldset with general integration information. + * + * @param \Magento\Data\Form $form + * @param array $integrationData + */ + protected function _addGeneralFieldset($form, $integrationData) + { + $fieldset = $form->addFieldset('base_fieldset', array('legend' => __('General'))); + + $disabled = false; + if (isset($integrationData[self::DATA_ID])) { + $fieldset->addField(self::DATA_ID, 'hidden', array('name' => 'id')); + + if ($integrationData[self::DATA_SETUP_TYPE] == IntegrationModel::TYPE_CONFIG) { + $disabled = true; + } + } + + $fieldset->addField( + self::DATA_NAME, + 'text', + array( + 'label' => __('Name'), + 'name' => self::DATA_NAME, + 'required' => true, + 'disabled' => $disabled, + 'maxlength' => '255' + ) + ); + $fieldset->addField( + self::DATA_EMAIL, + 'text', + array( + 'label' => __('Email'), + 'name' => self::DATA_EMAIL, + 'disabled' => $disabled, + 'class' => 'validate-email', + 'maxlength' => '254' + ) + ); + $fieldset->addField( + self::DATA_ENDPOINT, + 'text', + array( + 'label' => __('Callback URL'), + 'name' => self::DATA_ENDPOINT, + 'disabled' => $disabled, + // @codingStandardsIgnoreStart + 'note' => __( + 'Enter URL where Oauth credentials can be sent when using Oauth for token exchange. We strongly recommend using https://.' + ) + // @codingStandardsIgnoreEnd + ) + ); + } + + /** + * Add fieldset with integration details. This fieldset is available for existing integrations only. + * + * @param \Magento\Data\Form $form + * @param array $integrationData + */ + protected function _addDetailsFieldset($form, $integrationData) + { + if (isset($integrationData[self::DATA_ID])) { + $fieldset = $form->addFieldset('details_fieldset', array('legend' => __('Integration Details'))); + /** @var \Magento\Integration\Block\Adminhtml\Integration\Tokens $tokensBlock */ + $tokensBlock = $this->getChildBlock('integration_tokens'); + foreach ($tokensBlock->getFormFields() as $field) { + $fieldset->addField($field['name'], $field['type'], $field['metadata']); + } + } + } } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Token.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Token.php deleted file mode 100644 index e64c122d4235e..0000000000000 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Token.php +++ /dev/null @@ -1,82 +0,0 @@ -_formFactory->create(); - $htmlIdPrefix = 'integration_token_'; - $form->setHtmlIdPrefix($htmlIdPrefix); - - $fieldset = $form->addFieldset('base_fieldset', array( - 'legend' => __('Integration Tokens for Extensions'), - 'class' => 'fieldset-wide' - )); - - $fieldset->addField('token', 'text', array( - 'label' => __('Token'), - 'name' => 'token', - 'readonly' => true - )); - - $fieldset->addField('token-secret', 'text', array( - 'label' => __('Token Secret'), - 'name' => 'token-secret', - 'readonly' => true - )); - - $fieldset->addField('client-id', 'text', array( - 'label' => __('Client ID'), - 'name' => 'client-id', - 'readonly' => true - )); - - $fieldset->addField('client-secret', 'text', array( - 'label' => __('Client Secret'), - 'name' => 'client-secret', - 'readonly' => true - )); - - // TODO: retrieve token associated to this integration to populate the form - // $form->setValues($model->getData()); - - $this->setForm($form); - - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Tokens.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Tokens.php new file mode 100644 index 0000000000000..abfba8ffe0099 --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Tokens.php @@ -0,0 +1,123 @@ +_formFactory->create(); + $htmlIdPrefix = 'integration_token_'; + $form->setHtmlIdPrefix($htmlIdPrefix); + + $fieldset = $form->addFieldset( + 'base_fieldset', + array( + 'legend' => __('Integration Tokens for Extensions'), + 'class' => 'fieldset-wide' + ) + ); + + foreach ($this->getFormFields() as $field) { + $fieldset->addField($field['name'], $field['type'], $field['metadata']); + } + + $integrationData = $this->_coreRegistry->registry(IntegrationController::REGISTRY_KEY_CURRENT_INTEGRATION); + if ($integrationData) { + $form->setValues($integrationData); + } + $this->setForm($form); + return parent::_prepareForm(); + } + + /** + * Return a list of form fields with oAuth credentials. + * + * @return array + */ + public function getFormFields() + { + return array( + array( + 'name' => self::DATA_CONSUMER_KEY, + 'type' => 'text', + 'metadata' => array( + 'label' => __('Consumer Key'), + 'name' => self::DATA_CONSUMER_KEY, + 'readonly' => true, + ) + ), + array( + 'name' => self::DATA_CONSUMER_SECRET, + 'type' => 'text', + 'metadata' => array( + 'label' => __('Consumer Secret'), + 'name' => self::DATA_CONSUMER_SECRET, + 'readonly' => true, + ) + ), + array( + 'name' => self::DATA_TOKEN, + 'type' => 'text', + 'metadata' => array( + 'label' => __('Access Token'), + 'name' => self::DATA_TOKEN, + 'readonly' => true, + ) + ), + array( + 'name' => self::DATA_TOKEN_SECRET, + 'type' => 'text', + 'metadata' => array( + 'label' => __('Access Token Secret'), + 'name' => self::DATA_TOKEN_SECRET, + 'readonly' => true, + ) + ), + ); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php index 011613dc07c68..1b1e22eb1cc47 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php @@ -25,7 +25,8 @@ namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer; use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; -use \Magento\Object; +use Magento\Integration\Model\Integration; +use Magento\Object; /** * Render HTML ', $this->_getAttributesStr($attributes), $this->_getValue($row)); } + /** + * Determine whether current integration came from config file + * + * @param \Magento\Object $row + * @return bool + */ + protected function _isConfigBasedIntegration(Object $row) + { + return ($row->hasData(Integration::SETUP_TYPE) + && $row->getData(Integration::SETUP_TYPE) == Integration::TYPE_CONFIG); + } + /** * Whether current item is disabled. * diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php index a9364800f3e5a..f253d21a3ac24 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php @@ -26,9 +26,10 @@ namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; +use Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; use Magento\Object; -class Delete extends IntegrationAbstract +class Delete extends Button { /** * Return 'onclick' action for the button (redirect to the integration edit page). @@ -38,7 +39,7 @@ class Delete extends IntegrationAbstract */ protected function _getOnclickAttribute(Object $row) { - return sprintf("window.location.href='%s'", $this->getUrl('*/*/delete', ['id' => $row->getId()])); + return sprintf("this.setAttribute('data-url', '%s')", $this->getUrl('*/*/delete', ['id' => $row->getId()])); } /** @@ -51,4 +52,15 @@ protected function _getTitleAttribute(Object $row) { return $this->_isDisabled($row) ? __('Uninstall the extension to remove this integration') : __('Remove'); } + + /** + * Determine whether current integration came from config file, thus can not be removed + * + * @param \Magento\Object $row + * @return bool + */ + protected function _isDisabled(Object $row) + { + return $this->_isConfigBasedIntegration($row); + } } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php index 3c1d6e4a57570..30832c1979612 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php @@ -27,8 +27,9 @@ namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; use Magento\Object; +use Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; -class Edit extends IntegrationAbstract +class Edit extends Button { /** * Return 'onclick' action for the button (redirect to the integration edit page). @@ -49,6 +50,20 @@ protected function _getOnclickAttribute(Object $row) */ protected function _getTitleAttribute(Object $row) { - return $this->_isDisabled($row) ? '' : __('Edit'); + return $this->_isConfigBasedIntegration($row) ? __('View') : __('Edit'); + } + + /** + * Get the icon on the grid according to the integration type + * + * @param \Magento\Object $row + * return string + */ + public function _getClassAttribute(Object $row) + { + $class = $this->_isConfigBasedIntegration($row) ? 'info' : 'edit'; + + return 'action ' . $class; + } } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/IntegrationAbstract.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/IntegrationAbstract.php deleted file mode 100644 index 76db7a82352e7..0000000000000 --- a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/IntegrationAbstract.php +++ /dev/null @@ -1,46 +0,0 @@ -hasData(Integration::SETUP_TYPE) - && $row->getData(Integration::SETUP_TYPE) == Integration::TYPE_CONFIG); - } -} diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php index f5e1693d972a1..63c56ae663bd5 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php @@ -26,8 +26,9 @@ use Magento\Backend\App\Action; use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; -use Magento\Integration\Model\Integration as IntegrationKeyConstants; use Magento\Integration\Exception as IntegrationException; +use Magento\Integration\Service\OauthV1Interface as IntegrationOauthService; +use Magento\Integration\Model\Integration as IntegrationModel; /** * Controller for integrations management. @@ -40,16 +41,6 @@ class Integration extends Action /** Keys used for registering data into the registry */ const REGISTRY_KEY_CURRENT_INTEGRATION = 'current_integration'; - /** Request parameter which define the dialog window requested */ - const PARAM_DIALOG_ID = 'popup_dialog'; - - /**#@+ - * Allowed values for PARAM_DIALOG_ID request parameter - */ - const DIALOG_PERMISSIONS = 'permissions'; - const DIALOG_TOKENS = 'tokens'; - /**#@-*/ - /** * Core registry * @@ -63,21 +54,40 @@ class Integration extends Action /** @var \Magento\Integration\Service\IntegrationV1Interface */ private $_integrationService; + /** @var IntegrationOauthService */ + protected $_oauthService; + + /** @var \Magento\Core\Helper\Data */ + protected $_coreHelper; + + /** @var \Magento\Integration\Helper\Data */ + protected $_integrationData; + /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService * @param \Magento\Core\Model\Registry $registry * @param \Magento\Logger $logger + * @param IntegrationOauthService $oauthService + * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService + * @param \Magento\Core\Helper\Data $coreHelper + * @param \Magento\Integration\Helper\Data $integrationData */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Integration\Service\IntegrationV1Interface $integrationService, \Magento\Core\Model\Registry $registry, - \Magento\Logger $logger + \Magento\Logger $logger, + \Magento\Integration\Service\IntegrationV1Interface $integrationService, + IntegrationOauthService $oauthService, + \Magento\Core\Helper\Data $coreHelper, + \Magento\Integration\Helper\Data $integrationData ) { + parent::__construct($context); $this->_registry = $registry; $this->_logger = $logger; $this->_integrationService = $integrationService; + $this->_oauthService = $oauthService; + $this->_coreHelper = $coreHelper; + $this->_integrationData = $integrationData; parent::__construct($context); } @@ -139,30 +149,28 @@ public function editAction() $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID); if ($integrationId) { try { - $integrationData = $this->_integrationService->get($integrationId); + $integrationData = $this->_integrationService->get($integrationId)->getData(); + $originalName = $integrationData[Info::DATA_NAME]; } catch (IntegrationException $e) { $this->_getSession()->addError($e->getMessage()); $this->_redirect('*/*/'); return; + } catch (\Exception $e) { + $this->_logger->logException($e); + $this->_getSession()->addError(__('Internal error. Check exception log for details.')); + $this->_redirect('*/*'); + return; } $restoredIntegration = $this->_getSession()->getIntegrationData(); if (isset($restoredIntegration[Info::DATA_ID]) && $integrationId == $restoredIntegration[Info::DATA_ID]) { $integrationData = array_merge($integrationData, $restoredIntegration); } - - if (isset($integrationData[Info::DATA_SETUP_TYPE]) - && $integrationData[Info::DATA_SETUP_TYPE] == IntegrationKeyConstants::TYPE_CONFIG - ) { - //Cannot edit Integrations created from Config. No error necessary just redirect to grid - $this->_redirect('*/*/'); - return; - } - $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); } else { $this->_getSession()->addError(__('Integration ID is not specified or is invalid.')); $this->_redirect('*/*/'); return; } + $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); $this->_view->loadLayout(); $this->_getSession()->setIntegrationData(array()); $this->_setActiveMenu('Magento_Integration::system_integrations'); @@ -170,12 +178,15 @@ public function editAction() __('Edit "%1" Integration', $integrationData[Info::DATA_NAME]), __('Edit "%1" Integration', $integrationData[Info::DATA_NAME]) ); - $this->_title->add(__('Edit "%1" Integration', $integrationData[Info::DATA_NAME])); + $this->_title->add(__('Edit "%1" Integration', $originalName)); $this->_view->renderLayout(); } /** * Save integration action. + * + * TODO: Fix cyclomatic complexity. + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function saveAction() { @@ -184,33 +195,47 @@ public function saveAction() try { $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID); if ($integrationId) { - $integrationData = $this->_integrationService->get($integrationId); - if (!$integrationData[Info::DATA_ID]) { - $this->_getSession()->addError(__('This integration no longer exists.')); + try { + $integrationData = $this->_integrationService->get($integrationId)->getData(); + } catch (IntegrationException $e) { + $this->_getSession()->addError($e->getMessage()); $this->_redirect('*/*/'); return; + } catch (\Exception $e) { + $this->_logger->logException($e); + $this->_getSession()->addError(__('Internal error. Check exception log for details.')); + $this->_redirect('*/*'); + return; } } /** @var array $data */ $data = $this->getRequest()->getPost(); if (!empty($data)) { + // TODO: Move out work with API permissions to Web API module if (!isset($data['resource'])) { $integrationData['resource'] = array(); } $integrationData = array_merge($integrationData, $data); - $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); if (!isset($integrationData[Info::DATA_ID])) { - $this->_integrationService->create($integrationData); + $integrationData = $this->_integrationService->create($integrationData); } else { - $this->_integrationService->update($integrationData); + $integrationData = $this->_integrationService->update($integrationData); + } + if (!$this->getRequest()->isXmlHttpRequest()) { + $this->_getSession() + ->addSuccess(__('The integration \'%1\' has been saved.', $integrationData[Info::DATA_NAME])); } - $this->_getSession() - ->addSuccess(__('The integration \'%1\' has been saved.', $integrationData[Info::DATA_NAME])); } else { $this->_getSession()->addError(__('The integration was not saved.')); } - $this->_redirect('*/*/'); - } catch (\Magento\Integration\Exception $e) { + if ($this->getRequest()->isXmlHttpRequest()) { + $this->getResponse()->setBody( + $this->_coreHelper->jsonEncode(['integrationId' => $integrationData[Info::DATA_ID]]) + ); + } else { + $this->_redirect('*/*/'); + } + } catch (IntegrationException $e) { $this->_getSession()->addError($e->getMessage())->setIntegrationData($integrationData); $this->_redirectOnSaveError(); } catch (\Magento\Core\Exception $e) { @@ -224,57 +249,109 @@ public function saveAction() } /** - * Activates the integration. Also contains intermediate steps (permissions confirmation and tokens). + * Show permissions popup. */ - public function activateAction() + public function permissionsDialogAction() { $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID); if ($integrationId) { - $integrationData = $this->_integrationService->get($integrationId); - if (!$integrationData[Info::DATA_ID]) { - $this->_getSession()->addError(__('This integration no longer exists.')); + try { + $integrationData = $this->_integrationService->get($integrationId)->getData(); + $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); + } catch (IntegrationException $e) { + $this->_getSession()->addError($e->getMessage()); $this->_redirect('*/*/'); return; + } catch (\Exception $e) { + $this->_logger->logException($e); + $this->_getSession()->addError(__('Internal error. Check exception log for details.')); + $this->_redirect('*/*'); + return; } - $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); } else { $this->_getSession()->addError(__('Integration ID is not specified or is invalid.')); $this->_redirect('*/*/'); return; } - $dialogName = $this->getRequest()->getParam(self::PARAM_DIALOG_ID); - - if (in_array($dialogName, [self::DIALOG_PERMISSIONS, self::DIALOG_TOKENS])) { - $this->_view->loadLayout($this->_getPopupHandleNames($dialogName)); - } else { - $this->_view->loadLayout(); + /** Add handles of the tabs which are defined in other modules */ + $handleNodes = $this->_view->getLayout()->getUpdate()->getFileLayoutUpdatesXml() + ->xpath('//referenceBlock[@name="integration.activate.permissions.tabs"]/../@id'); + $handles = array(); + if (is_array($handleNodes)) { + foreach ($handleNodes as $node) { + $handles[] = (string)$node; + } } - + $this->_view->loadLayout($handles); $this->_view->renderLayout(); } /** - * @param string $dialogName - * @return array + * Delete the integration. */ - protected function _getPopupHandleNames($dialogName) + public function deleteAction() { - $handles = [sprintf('%s_%s_popup', $this->_view->getDefaultLayoutHandle(), $dialogName)]; - - if ($dialogName === self::DIALOG_PERMISSIONS) { - $handleNodes = $this->_view->getLayout()->getUpdate()->getFileLayoutUpdatesXml() - ->xpath('//referenceBlock[@name="integration.activate.permissions.tabs"]/../@id'); - - if (is_array($handleNodes)) { - foreach ($handleNodes as $node) { - $handles[] = (string)$node; + $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID); + try { + if ($integrationId) { + $integrationData = $this->_integrationService->get($integrationId); + if ($this->_integrationData->isConfigType($integrationData)) { + $this->_getSession()->addError( + __("Uninstall the extension to remove integration '%1'.", $integrationData[Info::DATA_NAME]) + ); + $this->_redirect('*/*/'); + return; } + $integrationData = $this->_integrationService->delete($integrationId); + if (!$integrationData[Info::DATA_ID]) { + $this->_getSession()->addError(__('This integration no longer exists.')); + } else { + //Integration deleted successfully, now safe to delete the associated consumer data + if (isset($integrationData[Info::DATA_CONSUMER_ID])) { + $this->_oauthService->deleteConsumer($integrationData[Info::DATA_CONSUMER_ID]); + } + $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); + $this->_getSession() + ->addSuccess(__("The integration '%1' has been deleted.", $integrationData[Info::DATA_NAME])); + } + } else { + $this->_getSession()->addError(__('Integration ID is not specified or is invalid.')); } + } catch (\Magento\Integration\Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (\Exception $e) { + $this->_logger->logException($e); } + $this->_redirect('*/*/'); + } - return $handles; + /** + * Show tokens popup. + */ + public function tokensDialogAction() + { + try { + $integrationId = $this->getRequest()->getParam('id'); + $integration = $this->_integrationService->get($integrationId); + $this->_oauthService->createAccessToken($integration->getConsumerId()); + $this->_registry->register( + self::REGISTRY_KEY_CURRENT_INTEGRATION, + $this->_integrationService->get($integrationId)->getData() + ); + } catch (\Magento\Core\Exception $e) { + $this->_getSession()->addError($e->getMessage()); + $this->_redirect('*/*'); + return; + } catch (\Exception $e) { + $this->_logger->logException($e); + $this->_getSession()->addError(__('Internal error. Check exception log for details.')); + $this->_redirect('*/*'); + return; + } + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -289,4 +366,23 @@ protected function _redirectOnSaveError() $this->_redirect('*/*/new'); } } + + /** + * Don't actually redirect if we've got AJAX request - return redirect URL instead. + * + * @param string $path + * @param array $arguments + * @return $this|\Magento\Backend\App\AbstractAction + */ + protected function _redirect($path, $arguments = array()) + { + if ($this->getRequest()->isXmlHttpRequest()) { + $this->getResponse()->setBody( + $this->_coreHelper->jsonEncode(['_redirect' => $this->getUrl($path, $arguments)]) + ); + return $this; + } else { + return parent::_redirect($path, $arguments); + } + } } diff --git a/app/code/Magento/Integration/Helper/Data.php b/app/code/Magento/Integration/Helper/Data.php index 7becc725d7d0f..891756d4af411 100644 --- a/app/code/Magento/Integration/Helper/Data.php +++ b/app/code/Magento/Integration/Helper/Data.php @@ -24,6 +24,8 @@ namespace Magento\Integration\Helper; +use Magento\Integration\Model\Integration as IntegrationModel; + class Data extends \Magento\App\Helper\AbstractHelper { /** @@ -48,4 +50,16 @@ public function mapResources(array $resources) } return $output; } + + /** + * Check if integration is created using config file + * + * @param $integrationData + * @return bool true if integration is created using Config file + */ + public function isConfigType($integrationData) + { + return isset($integrationData[IntegrationModel::SETUP_TYPE]) + && $integrationData[IntegrationModel::SETUP_TYPE] == IntegrationModel::TYPE_CONFIG; + } } diff --git a/app/code/Magento/Integration/Helper/Oauth/Consumer.php b/app/code/Magento/Integration/Helper/Oauth/Consumer.php deleted file mode 100644 index 70cd70b5516cc..0000000000000 --- a/app/code/Magento/Integration/Helper/Oauth/Consumer.php +++ /dev/null @@ -1,144 +0,0 @@ -_storeManager = $storeManager; - $this->_consumerFactory = $consumerFactory; - $this->_tokenFactory = $tokenFactory; - $this->_dataHelper = $dataHelper; - $this->_httpClient = $httpClient; - $this->_logger = $logger; - } - - /** - * Create a new consumer account when an integration is installed. - * - * @param array $consumerData - Information provided by an integration when the integration is installed. - *
    -     * array(
    -     *     'name' => 'Integration Name',
    -     *     'key' => 'a6aa81cc3e65e2960a4879392445e718',
    -     *     'secret' => 'b7bb92dd4f76f3a71b598a4a3556f829'
    -     * )
    -     * 
    - * @return array - The integration (consumer) data. - * @throws \Magento\Core\Exception - * @throws \Magento\Oauth\Exception - */ - public function createConsumer($consumerData) - { - try { - $consumer = $this->_consumerFactory->create($consumerData); - $consumer->save(); - return $consumer->getData(); - } catch (\Magento\Core\Exception $exception) { - throw $exception; - } catch (\Exception $exception) { - throw new \Magento\Oauth\Exception(__('Unexpected error. Unable to create OAuth Consumer account.')); - } - } - - /** - * Execute post to integration (consumer) HTTP Post URL. Generate and return oauth_verifier. - * - * @param int $consumerId - The consumer Id. - * @param string $endpointUrl - The integration endpoint Url (for HTTP Post) - * @return string - The oauth_verifier. - * @throws \Magento\Core\Exception - * @throws \Magento\Oauth\Exception - */ - public function postToConsumer($consumerId, $endpointUrl) - { - try { - $consumer = $this->_consumerFactory->create()->load($consumerId); - if (!$consumer->getId()) { - throw new \Magento\Oauth\Exception( - __('A consumer with ID %1 does not exist', $consumerId), OauthInterface::ERR_PARAMETER_REJECTED); - } - $consumerData = $consumer->getData(); - $verifier = $this->_tokenFactory->create()->createVerifierToken($consumerId); - $storeBaseUrl = $this->_storeManager->getStore()->getBaseUrl(); - $this->_httpClient->setUri($endpointUrl); - $this->_httpClient->setParameterPost( - array( - 'oauth_consumer_key' => $consumerData['key'], - 'oauth_consumer_secret' => $consumerData['secret'], - 'store_base_url' => $storeBaseUrl, - 'oauth_verifier' => $verifier->getVerifier() - ) - ); - $maxredirects = $this->_dataHelper->getConsumerPostMaxRedirects(); - $timeout = $this->_dataHelper->getConsumerPostTimeout(); - $this->_httpClient->setConfig(array('maxredirects' => $maxredirects, 'timeout' => $timeout)); - $this->_httpClient->request(\Magento\HTTP\ZendClient::POST); - return $verifier->getVerifier(); - } catch (\Magento\Core\Exception $exception) { - throw $exception; - } catch (\Magento\Oauth\Exception $exception) { - throw $exception; - } catch (\Exception $exception) { - $this->_logger->logException($exception); - throw new \Magento\Oauth\Exception(__('Unable to post data to consumer due to an unexpected error')); - } - } -} diff --git a/app/code/Magento/Integration/Model/Config/Reader.php b/app/code/Magento/Integration/Model/Config/Reader.php index 4fd412169b732..fd252136de43f 100644 --- a/app/code/Magento/Integration/Model/Config/Reader.php +++ b/app/code/Magento/Integration/Model/Config/Reader.php @@ -39,18 +39,33 @@ class Reader extends \Magento\Config\Reader\Filesystem /** * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Integration\Model\Config\Converter $converter - * @param \Magento\Integration\Model\Config\SchemaLocator $schemeLocator + * @param Converter $converter + * @param SchemaLocator $schemaLocator * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, \Magento\Integration\Model\Config\Converter $converter, - \Magento\Integration\Model\Config\SchemaLocator $schemeLocator, + \Magento\Integration\Model\Config\SchemaLocator $schemaLocator, \Magento\Config\ValidationStateInterface $validationState, - $fileName = 'integration\config.xml' + $fileName = 'integration\config.xml', + $idAttributes = array(), + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { - parent::__construct($fileResolver, $converter, $schemeLocator, $validationState, $fileName); + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope + ); } } diff --git a/app/code/Magento/Integration/Model/Integration.php b/app/code/Magento/Integration/Model/Integration.php index 1822d2e11ef35..0659bb4679586 100644 --- a/app/code/Magento/Integration/Model/Integration.php +++ b/app/code/Magento/Integration/Model/Integration.php @@ -36,6 +36,8 @@ * @method \int getType() * @method Integration setType(\int $value) * @method \string getEndpoint() + * @method Integration setConsumerId(\string $consumerId) + * @method \string getConsumerId() * @method Integration setEndpoint(\string $endpoint) * @method \string getCreatedAt() * @method Integration setCreatedAt(\string $createdAt) @@ -66,6 +68,7 @@ class Integration extends \Magento\Core\Model\AbstractModel const EMAIL = 'email'; const ENDPOINT = 'endpoint'; const SETUP_TYPE = 'setup_type'; + const CONSUMER_ID = 'consumer_id'; /**#@-*/ /** @@ -107,7 +110,7 @@ protected function _construct() /** * Prepare data to be saved to database * - * @return \Magento\Integration\Model\Integration + * @return Integration */ protected function _beforeSave() { @@ -118,4 +121,15 @@ protected function _beforeSave() $this->setUpdatedAt($this->_dateTime->formatDate(true)); return $this; } + + /** + * Load integration by oAuth consumer ID. + * + * @param int $consumerId + * @return Integration + */ + public function loadByConsumerId($consumerId) + { + return $this->load($consumerId, self::CONSUMER_ID); + } } diff --git a/app/code/Magento/Integration/Model/Manager.php b/app/code/Magento/Integration/Model/Manager.php index b19c32335d485..50f3e9152524b 100644 --- a/app/code/Magento/Integration/Model/Manager.php +++ b/app/code/Magento/Integration/Model/Manager.php @@ -84,11 +84,11 @@ public function processIntegrationConfig(array $integrationNames) } $integrationData[Integration::SETUP_TYPE] = Integration::TYPE_CONFIG; // If it already exists, update it - $data = $this->_integrationService->findByName($name); - if (isset($data[Integration::ID])) { + $integration = $this->_integrationService->findByName($name); + if ($integration->getId()) { //If Integration already exists, update it. //For now we will just overwrite the integration with same name but we will need a long term solution - $integrationData[Integration::ID] = $data[Integration::ID]; + $integrationData[Integration::ID] = $integration->getId(); $this->_integrationService->update($integrationData); } else { $this->_integrationService->create($integrationData); @@ -97,4 +97,4 @@ public function processIntegrationConfig(array $integrationNames) } return $integrationNames; } -} \ No newline at end of file +} diff --git a/app/code/Magento/Integration/Model/Oauth/Token.php b/app/code/Magento/Integration/Model/Oauth/Token.php index f5bf1f6951559..22117849efb7a 100644 --- a/app/code/Magento/Integration/Model/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Oauth/Token.php @@ -24,34 +24,38 @@ namespace Magento\Integration\Model\Oauth; +use Magento\Oauth\Helper\Oauth as OauthHelper; +use Magento\Integration\Model\Resource\Oauth\Token\Collection as TokenCollection; +use Magento\Oauth\Exception as OauthException; + /** * oAuth token model * * @method string getName() Consumer name (joined from consumer table) - * @method \Magento\Integration\Model\Resource\Oauth\Token\Collection getCollection() - * @method \Magento\Integration\Model\Resource\Oauth\Token\Collection getResourceCollection() + * @method TokenCollection getCollection() + * @method TokenCollection getResourceCollection() * @method \Magento\Integration\Model\Resource\Oauth\Token getResource() * @method \Magento\Integration\Model\Resource\Oauth\Token _getResource() * @method int getConsumerId() - * @method \Magento\Integration\Model\Oauth\Token setConsumerId() setConsumerId(int $consumerId) + * @method Token setConsumerId() setConsumerId(int $consumerId) * @method int getAdminId() - * @method \Magento\Integration\Model\Oauth\Token setAdminId() setAdminId(int $adminId) + * @method Token setAdminId() setAdminId(int $adminId) * @method int getCustomerId() - * @method \Magento\Integration\Model\Oauth\Token setCustomerId() setCustomerId(int $customerId) + * @method Token setCustomerId() setCustomerId(int $customerId) * @method string getType() - * @method \Magento\Integration\Model\Oauth\Token setType() setType(string $type) + * @method Token setType() setType(string $type) * @method string getCallbackUrl() - * @method \Magento\Integration\Model\Oauth\Token setCallbackUrl() setCallbackUrl(string $callbackUrl) + * @method Token setCallbackUrl() setCallbackUrl(string $callbackUrl) * @method string getCreatedAt() - * @method \Magento\Integration\Model\Oauth\Token setCreatedAt() setCreatedAt(string $createdAt) + * @method Token setCreatedAt() setCreatedAt(string $createdAt) * @method string getToken() - * @method \Magento\Integration\Model\Oauth\Token setToken() setToken(string $token) + * @method Token setToken() setToken(string $token) * @method string getSecret() - * @method \Magento\Integration\Model\Oauth\Token setSecret() setSecret(string $tokenSecret) + * @method Token setSecret() setSecret(string $tokenSecret) * @method int getRevoked() - * @method \Magento\Integration\Model\Oauth\Token setRevoked() setRevoked(int $revoked) + * @method Token setRevoked() setRevoked(int $revoked) * @method int getAuthorized() - * @method \Magento\Integration\Model\Oauth\Token setAuthorized() setAuthorized(int $authorized) + * @method Token setAuthorized() setAuthorized(int $authorized) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Token extends \Magento\Core\Model\AbstractModel @@ -71,7 +75,7 @@ class Token extends \Magento\Core\Model\AbstractModel const USER_TYPE_CUSTOMER = 'customer'; /**#@- */ - /** @var \Magento\Oauth\Helper\Oauth */ + /** @var OauthHelper */ protected $_oauthHelper; /** @var \Magento\Integration\Helper\Oauth\Data */ @@ -97,7 +101,7 @@ class Token extends \Magento\Core\Model\AbstractModel * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory * @param \Magento\Integration\Helper\Oauth\Data $oauthData - * @param \Magento\Oauth\Helper\Oauth $oauthHelper + * @param OauthHelper $oauthHelper * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -112,7 +116,7 @@ public function __construct( \Magento\Stdlib\DateTime $dateTime, \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory, \Magento\Integration\Helper\Oauth\Data $oauthData, - \Magento\Oauth\Helper\Oauth $oauthHelper, + OauthHelper $oauthHelper, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -139,7 +143,7 @@ protected function _construct() /** * "After save" actions * - * @return \Magento\Integration\Model\Oauth\Token + * @return Token */ protected function _afterSave() { @@ -156,7 +160,7 @@ protected function _afterSave() * Generate an oauth_verifier for a consumer, if the consumer doesn't already have one. * * @param int $consumerId - The id of the consumer associated with the verifier to be generated. - * @return \Magento\Integration\Model\Oauth\Token + * @return Token */ public function createVerifierToken($consumerId) { @@ -169,7 +173,7 @@ public function createVerifierToken($consumerId) 'token' => $this->_oauthHelper->generateToken(), 'secret' => $this->_oauthHelper->generateTokenSecret(), 'verifier' => $this->_oauthHelper->generateVerifier(), - 'callback_url' => \Magento\Oauth\Helper\Oauth::CALLBACK_ESTABLISHED + 'callback_url' => OauthHelper::CALLBACK_ESTABLISHED )); $this->save(); } @@ -181,23 +185,23 @@ public function createVerifierToken($consumerId) * * @param int $userId Authorization user identifier * @param string $userType Authorization user type - * @return \Magento\Integration\Model\Oauth\Token - * @throws \Magento\Oauth\Exception + * @return Token + * @throws OauthException */ public function authorize($userId, $userType) { if (!$this->getId() || !$this->getConsumerId()) { - throw new \Magento\Oauth\Exception(__('Token is not ready to be authorized')); + throw new OauthException(__('Token is not ready to be authorized')); } if ($this->getAuthorized()) { - throw new \Magento\Oauth\Exception(__('Token is already authorized')); + throw new OauthException(__('Token is already authorized')); } if (self::USER_TYPE_ADMIN == $userType) { $this->setAdminId($userId); } elseif (self::USER_TYPE_CUSTOMER == $userType) { $this->setCustomerId($userId); } else { - throw new \Magento\Oauth\Exception(__('User type is unknown')); + throw new OauthException(__('User type is unknown')); } $this->setVerifier($this->_oauthHelper->generateVerifier()); @@ -212,13 +216,13 @@ public function authorize($userId, $userType) /** * Convert token to access type * - * @return \Magento\Integration\Model\Oauth\Token - * @throws \Magento\Oauth\Exception + * @return Token + * @throws OauthException */ public function convertToAccess() { if (self::TYPE_REQUEST != $this->getType()) { - throw new \Magento\Oauth\Exception(__('Cannot convert to access token due to token is not request type')); + throw new OauthException(__('Cannot convert to access token due to token is not request type')); } $this->setType(self::TYPE_ACCESS); @@ -234,10 +238,11 @@ public function convertToAccess() * * @param int $entityId Token identifier * @param string $callbackUrl Callback URL - * @return \Magento\Integration\Model\Oauth\Token + * @return Token */ public function createRequestToken($entityId, $callbackUrl) { + $callbackUrl = !empty($callbackUrl) ? $callbackUrl : OauthHelper::CALLBACK_ESTABLISHED; $this->setData(array( 'entity_id' => $entityId, 'type' => self::TYPE_REQUEST, @@ -254,7 +259,7 @@ public function createRequestToken($entityId, $callbackUrl) * Get OAuth user type * * @return string - * @throws \Magento\Oauth\Exception + * @throws OauthException */ public function getUserType() { @@ -263,7 +268,7 @@ public function getUserType() } elseif ($this->getCustomerId()) { return self::USER_TYPE_CUSTOMER; } else { - throw new \Magento\Oauth\Exception(__('User type is unknown')); + throw new OauthException(__('User type is unknown')); } } @@ -299,39 +304,39 @@ protected function _beforeSave() * Validate data * * @return array|bool - * @throws \Magento\Oauth\Exception Throw exception on fail validation + * @throws OauthException Throw exception on fail validation */ public function validate() { - if (\Magento\Oauth\Helper\Oauth::CALLBACK_ESTABLISHED != $this->getCallbackUrl() + if (OauthHelper::CALLBACK_ESTABLISHED != $this->getCallbackUrl() && !$this->_urlValidator->isValid($this->getCallbackUrl()) ) { $messages = $this->_urlValidator->getMessages(); - throw new \Magento\Oauth\Exception(array_shift($messages)); + throw new OauthException(array_shift($messages)); } /** @var $validatorLength \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength */ $validatorLength = $this->_keyLengthFactory->create(); - $validatorLength->setLength(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_SECRET); + $validatorLength->setLength(OauthHelper::LENGTH_TOKEN_SECRET); $validatorLength->setName('Token Secret Key'); if (!$validatorLength->isValid($this->getSecret())) { $messages = $validatorLength->getMessages(); - throw new \Magento\Oauth\Exception(array_shift($messages)); + throw new OauthException(array_shift($messages)); } - $validatorLength->setLength(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN); + $validatorLength->setLength(OauthHelper::LENGTH_TOKEN); $validatorLength->setName('Token Key'); if (!$validatorLength->isValid($this->getToken())) { $messages = $validatorLength->getMessages(); - throw new \Magento\Oauth\Exception(array_shift($messages)); + throw new OauthException(array_shift($messages)); } if (null !== ($verifier = $this->getVerifier())) { - $validatorLength->setLength(\Magento\Oauth\Helper\Oauth::LENGTH_TOKEN_VERIFIER); + $validatorLength->setLength(OauthHelper::LENGTH_TOKEN_VERIFIER); $validatorLength->setName('Verifier Key'); if (!$validatorLength->isValid($verifier)) { $messages = $validatorLength->getMessages(); - throw new \Magento\Oauth\Exception(array_shift($messages)); + throw new OauthException(array_shift($messages)); } } return true; @@ -366,7 +371,7 @@ public function getVerifier() * Set the token's verifier. * * @param string $verifier - * @return \Magento\Integration\Model\Oauth\Token + * @return Token */ public function setVerifier($verifier) { diff --git a/app/code/Magento/Integration/Model/Oauth/Token/Provider.php b/app/code/Magento/Integration/Model/Oauth/Token/Provider.php index c493b8542177b..cb4aa771276c4 100644 --- a/app/code/Magento/Integration/Model/Oauth/Token/Provider.php +++ b/app/code/Magento/Integration/Model/Oauth/Token/Provider.php @@ -79,7 +79,7 @@ public function validateConsumer($consumer) */ public function createRequestToken($consumer) { - $token = $this->_getTokenByConsumer($consumer->getId()); + $token = $this->getTokenByConsumerId($consumer->getId()); if ($token->getType() != \Magento\Integration\Model\Oauth\Token::TYPE_VERIFIER) { throw new \Magento\Oauth\Exception( __('Cannot create request token because consumer token is not a verifier token'), @@ -119,7 +119,7 @@ public function validateRequestToken($requestToken, $consumer, $oauthVerifier) public function getAccessToken($consumer) { /** TODO: log the request token in dev mode since its not persisted. */ - $token = $this->_getTokenByConsumer($consumer->getId()); + $token = $this->getTokenByConsumerId($consumer->getId()); if (\Magento\Integration\Model\Oauth\Token::TYPE_REQUEST != $token->getType()) { throw new \Magento\Oauth\Exception( __('Cannot get access token because consumer token is not a request token')); @@ -168,7 +168,7 @@ public function validateAccessToken($accessToken) __('Access token has been revoked'), OauthInterface::ERR_TOKEN_REVOKED); } - return true; + return $token->getConsumerId(); } /** @@ -271,7 +271,7 @@ protected function _getToken($token) * @return \Magento\Integration\Model\Oauth\Token * @throws \Magento\Oauth\Exception */ - protected function _getTokenByConsumer($consumerId) + public function getTokenByConsumerId($consumerId) { $token = $this->_tokenFactory->create()->load($consumerId, 'consumer_id'); diff --git a/app/code/Magento/Integration/Service/IntegrationV1.php b/app/code/Magento/Integration/Service/IntegrationV1.php index 49d3f16b533c6..91a8b838b8e88 100644 --- a/app/code/Magento/Integration/Service/IntegrationV1.php +++ b/app/code/Magento/Integration/Service/IntegrationV1.php @@ -21,13 +21,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Integration\Service; -use Magento\Authz\Model\UserIdentifier; -use Magento\Authz\Service\AuthorizationV1Interface as AuthorizationInterface; use Magento\Integration\Model\Integration\Factory as IntegrationFactory; -use Magento\Authz\Model\UserIdentifier\Factory as UserIdentifierFactory; use Magento\Integration\Model\Integration as IntegrationModel; +use Magento\Integration\Service\OauthV1Interface as IntegrationOauthService; /** * Integration Service. @@ -39,27 +38,21 @@ class IntegrationV1 implements \Magento\Integration\Service\IntegrationV1Interfa /** @var IntegrationFactory */ protected $_integrationFactory; - /** @var AuthorizationInterface */ - protected $_authzService; - - /** @var UserIdentifierFactory */ - protected $_userIdentifierFactory; + /** @var IntegrationOauthService */ + protected $_oauthService; /** * Construct and initialize Integration Factory * * @param IntegrationFactory $integrationFactory - * @param AuthorizationInterface $authzService - * @param UserIdentifierFactory $userIdentifierFactory + * @param IntegrationOauthService $oauthService */ public function __construct( IntegrationFactory $integrationFactory, - AuthorizationInterface $authzService, - UserIdentifierFactory $userIdentifierFactory + IntegrationOauthService $oauthService ) { $this->_integrationFactory = $integrationFactory; - $this->_authzService = $authzService; - $this->_userIdentifierFactory = $userIdentifierFactory; + $this->_oauthService = $oauthService; } /** @@ -69,9 +62,13 @@ public function create(array $integrationData) { $this->_checkIntegrationByName($integrationData['name']); $integration = $this->_integrationFactory->create($integrationData); + // TODO: Think about double save issue $integration->save(); - $this->_saveApiPermissions($integration); - return $integration->getData(); + $consumerName = 'Integration' . $integration->getId(); + $consumer = $this->_oauthService->createConsumer(array('name' => $consumerName)); + $integration->setConsumerId($consumer->getId()); + $integration->save(); + return $integration; } /** @@ -86,8 +83,18 @@ public function update(array $integrationData) } $integration->addData($integrationData); $integration->save(); - $this->_saveApiPermissions($integration); - return $integration->getData(); + return $integration; + } + + /** + * {@inheritdoc} + */ + public function delete($integrationId) + { + $integration = $this->_loadIntegrationById($integrationId); + $data = $integration->getData(); + $integration->delete(); + return $data; } /** @@ -96,8 +103,9 @@ public function update(array $integrationData) public function get($integrationId) { $integration = $this->_loadIntegrationById($integrationId); - $this->_addAllowedResources($integration); - return $integration->getData(); + $this->_addOauthConsumerData($integration); + $this->_addOauthTokenData($integration); + return $integration; } /** @@ -105,14 +113,10 @@ public function get($integrationId) */ public function findByName($name) { - if (!isset($name) || trim($name) === '') { - return null; - } $integration = $this->_integrationFactory->create()->load($name, 'name'); - return $integration->getData(); + return $integration; } - /** * Check if an integration exists by the name * @@ -138,58 +142,38 @@ protected function _loadIntegrationById($integrationId) { $integration = $this->_integrationFactory->create()->load($integrationId); if (!$integration->getId()) { - throw new \Magento\Integration\Exception(__("Integration with ID '%1' doesn't exist.", $integrationId)); + throw new \Magento\Integration\Exception(__("Integration with ID '%1' does not exist.", $integrationId)); } return $integration; } /** - * Persist API permissions. - * - * Permissions are expected to be set to integration object by 'resource' key. - * If 'all_resources' is set and is evaluated to true, permissions to all resources will be granted. + * Add oAuth consumer key and secret. * * @param IntegrationModel $integration */ - protected function _saveApiPermissions(IntegrationModel $integration) + protected function _addOauthConsumerData(IntegrationModel $integration) { if ($integration->getId()) { - $userIdentifier = $this->_createUserIdentifier($integration->getId()); - if ($integration->getData('all_resources')) { - $this->_authzService->grantAllPermissions($userIdentifier); - } else if (is_array($integration->getData('resource'))) { - $this->_authzService->grantPermissions($userIdentifier, $integration->getData('resource')); - } else { - $this->_authzService->grantPermissions($userIdentifier, array()); - } + $consumer = $this->_oauthService->loadConsumer($integration->getConsumerId()); + $integration->setData('consumer_key', $consumer->getKey()); + $integration->setData('consumer_secret', $consumer->getSecret()); } } /** - * Add the list of allowed resources to the integration object data by 'resource' key. + * Add oAuth token and token secret. * * @param IntegrationModel $integration */ - protected function _addAllowedResources(IntegrationModel $integration) + protected function _addOauthTokenData(IntegrationModel $integration) { if ($integration->getId()) { - $userIdentifier = $this->_createUserIdentifier($integration->getId()); - $integration->setData('resource', $this->_authzService->getAllowedResources($userIdentifier)); + $accessToken = $this->_oauthService->getAccessToken($integration->getConsumerId()); + if ($accessToken) { + $integration->setData('token', $accessToken->getToken()); + $integration->setData('token_secret', $accessToken->getSecret()); + } } } - - /** - * Instantiate new user identifier for an integration. - * - * @param int $integrationId - * @return UserIdentifier - */ - protected function _createUserIdentifier($integrationId) - { - $userIdentifier = $this->_userIdentifierFactory->create( - UserIdentifier::USER_TYPE_INTEGRATION, - (int)$integrationId - ); - return $userIdentifier; - } } diff --git a/app/code/Magento/Integration/Service/IntegrationV1Interface.php b/app/code/Magento/Integration/Service/IntegrationV1Interface.php index 75a8b4e6bd56e..d5c47a0d47a65 100644 --- a/app/code/Magento/Integration/Service/IntegrationV1Interface.php +++ b/app/code/Magento/Integration/Service/IntegrationV1Interface.php @@ -21,19 +21,21 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Integration\Service; +use \Magento\Integration\Model\Integration as IntegrationModel; + /** * Integration Service Interface */ interface IntegrationV1Interface { - /** * Create a new Integration * * @param array $integrationData - * @return array Integration data + * @return IntegrationModel * @throws \Magento\Integration\Exception */ public function create(array $integrationData); @@ -42,7 +44,7 @@ public function create(array $integrationData); * Get the details of a specific Integration. * * @param int $integrationId - * @return array Integration data + * @return IntegrationModel * @throws \Magento\Integration\Exception */ public function get($integrationId); @@ -50,20 +52,26 @@ public function get($integrationId); /** * Find Integration by name. * - * @param int $integrationName + * @param string $integrationName * @return array|null Integration data or null if not found - * @throws \Magento\Integration\Exception */ public function findByName($integrationName); - /** - * Update a Integration. + * Update an Integration. * * @param array $integrationData - * @return array Integration data + * @return IntegrationModel * @throws \Magento\Integration\Exception */ public function update(array $integrationData); + /** + * Delete an Integration. + * + * @param int $integrationId + * @return array Integration data + * @throws \Magento\Integration\Exception if the integration does not exist or cannot be deleted + */ + public function delete($integrationId); } diff --git a/app/code/Magento/Integration/Service/OauthV1.php b/app/code/Magento/Integration/Service/OauthV1.php new file mode 100644 index 0000000000000..a4e8d7ec2db8d --- /dev/null +++ b/app/code/Magento/Integration/Service/OauthV1.php @@ -0,0 +1,234 @@ +_storeManager = $storeManager; + $this->_consumerFactory = $consumerFactory; + $this->_tokenFactory = $tokenFactory; + $this->_dataHelper = $dataHelper; + $this->_httpClient = $httpClient; + $this->_logger = $logger; + $this->_oauthHelper = $oauthHelper; + $this->_tokenProvider = $tokenProvider; + } + + /** + * {@inheritdoc} + */ + public function createConsumer($consumerData) + { + try { + $consumerData['key'] = $this->_oauthHelper->generateConsumerKey(); + $consumerData['secret'] = $this->_oauthHelper->generateConsumerSecret(); + $consumer = $this->_consumerFactory->create($consumerData); + $consumer->save(); + return $consumer; + } catch (\Magento\Core\Exception $exception) { + throw $exception; + } catch (\Exception $exception) { + throw new \Magento\Oauth\Exception(__('Unexpected error. Unable to create oAuth consumer account.')); + } + } + + /** + * {@inheritdoc} + */ + public function createAccessToken($consumerId) + { + // TODO: This implementation is temporary and should be changed after requirements clarification + try { + $consumer = $this->_consumerFactory->create()->load($consumerId); + $existingToken = $this->_tokenProvider->getTokenByConsumerId($consumer->getId()); + } catch (\Exception $e) { + } + if (!isset($existingToken)) { + $consumer = $this->_consumerFactory->create()->load($consumerId); + $this->_tokenFactory->create()->createVerifierToken($consumerId); + $this->_tokenProvider->createRequestToken($consumer); + $this->_tokenProvider->getAccessToken($consumer); + return true; + } + return false; + } + + /** + * {@inheritdoc} + */ + public function getAccessToken($consumerId) + { + try { + $consumer = $this->_consumerFactory->create()->load($consumerId); + $token = $this->_tokenProvider->getTokenByConsumerId($consumer->getId()); + if ($token->getType() != Token::TYPE_ACCESS) { + return false; + } + } catch (\Exception $e) { + return false; + } + return $token; + } + + /** + * {@inheritdoc} + */ + public function loadConsumer($consumerId) + { + try { + return $this->_consumerFactory->create()->load($consumerId); + } catch (\Magento\Core\Exception $exception) { + throw $exception; + } catch (\Exception $exception) { + throw new \Magento\Oauth\Exception(__('Unexpected error. Unable to load oAuth consumer account.')); + } + } + + /** + * {@inheritdoc} + */ + public function postToConsumer($consumerId, $endpointUrl) + { + try { + $consumer = $this->_consumerFactory->create()->load($consumerId); + if (!$consumer->getId()) { + throw new \Magento\Oauth\Exception( + __('A consumer with ID %1 does not exist', $consumerId), OauthInterface::ERR_PARAMETER_REJECTED); + } + $consumerData = $consumer->getData(); + $verifier = $this->_tokenFactory->create()->createVerifierToken($consumerId); + $storeBaseUrl = $this->_storeManager->getStore()->getBaseUrl(); + $this->_httpClient->setUri($endpointUrl); + $this->_httpClient->setParameterPost( + array( + 'oauth_consumer_key' => $consumerData['key'], + 'oauth_consumer_secret' => $consumerData['secret'], + 'store_base_url' => $storeBaseUrl, + 'oauth_verifier' => $verifier->getVerifier() + ) + ); + $maxredirects = $this->_dataHelper->getConsumerPostMaxRedirects(); + $timeout = $this->_dataHelper->getConsumerPostTimeout(); + $this->_httpClient->setConfig(array('maxredirects' => $maxredirects, 'timeout' => $timeout)); + $this->_httpClient->request(\Magento\HTTP\ZendClient::POST); + return $verifier->getVerifier(); + } catch (\Magento\Core\Exception $exception) { + throw $exception; + } catch (\Magento\Oauth\Exception $exception) { + throw $exception; + } catch (\Exception $exception) { + $this->_logger->logException($exception); + throw new \Magento\Oauth\Exception(__('Unable to post data to consumer due to an unexpected error')); + } + } + + /** + * {@inheritdoc} + */ + public function deleteConsumer($consumerId) + { + $consumer = $this->_loadConsumerById($consumerId); + $data = $consumer->getData(); + $consumer->delete(); + return $data; + } + + /** + * Load consumer by id. + * + * @param int $consumerId + * @return ConsumerModel + * @throws \Magento\Integration\Exception + */ + protected function _loadConsumerById($consumerId) + { + $consumer = $this->_consumerFactory->create()->load($consumerId); + if (!$consumer->getId()) { + throw new \Magento\Integration\Exception(__("Consumer with ID '%1' does not exist.", $consumerId)); + } + return $consumer; + } +} diff --git a/app/code/Magento/Integration/Service/OauthV1Interface.php b/app/code/Magento/Integration/Service/OauthV1Interface.php new file mode 100644 index 0000000000000..4f1593d2d1d61 --- /dev/null +++ b/app/code/Magento/Integration/Service/OauthV1Interface.php @@ -0,0 +1,94 @@ + + * array( + * 'name' => 'Integration Name', + * '...' => '...', // Other consumer data can be passed as well + * ) + * + * @return \Magento\Integration\Model\Oauth\Consumer + * @throws \Magento\Core\Exception + * @throws \Magento\Oauth\Exception + */ + public function createConsumer($consumerData); + + /** + * Create access token for provided consumer. + * + * @param int $consumerId + * @return bool If token was created + */ + public function createAccessToken($consumerId); + + /** + * Retrieve access token assigned to the consumer. + * + * @param int $consumerId + * @return Token|bool Return false if no access token is available. + */ + public function getAccessToken($consumerId); + + /** + * Load consumer by its ID. + * + * @param int $consumerId + * @return \Magento\Integration\Model\Oauth\Consumer + * @throws \Magento\Oauth\Exception + * @throws \Magento\Core\Exception + */ + public function loadConsumer($consumerId); + + /** + * Execute post to integration (consumer) HTTP Post URL. Generate and return oauth_verifier. + * + * @param int $consumerId - The consumer Id. + * @param string $endpointUrl - The integration endpoint Url (for HTTP Post) + * @return string - The oauth_verifier. + * @throws \Magento\Core\Exception + * @throws \Magento\Oauth\Exception + */ + public function postToConsumer($consumerId, $endpointUrl); + + /** + * Delete the consumer data associated with the integration including its token and nonce + * + * @param int $consumerId + * @return array Consumer data array + */ + public function deleteConsumer($consumerId); +} diff --git a/app/code/Magento/Integration/etc/cache.xml b/app/code/Magento/Integration/etc/cache.xml index a2d8b29b6a613..40469997ae8a0 100644 --- a/app/code/Magento/Integration/etc/cache.xml +++ b/app/code/Magento/Integration/etc/cache.xml @@ -24,7 +24,7 @@ */ --> - + Integration configuration file. diff --git a/app/code/Magento/Integration/etc/di.xml b/app/code/Magento/Integration/etc/di.xml index 15c3df5d0ffc5..88e74ce49e8d1 100644 --- a/app/code/Magento/Integration/etc/di.xml +++ b/app/code/Magento/Integration/etc/di.xml @@ -25,6 +25,7 @@ --> + diff --git a/app/code/Magento/Integration/view/adminhtml/integration.css b/app/code/Magento/Integration/view/adminhtml/integration.css index f303d5503fb1c..bd8e90ef861a6 100644 --- a/app/code/Magento/Integration/view/adminhtml/integration.css +++ b/app/code/Magento/Integration/view/adminhtml/integration.css @@ -68,6 +68,10 @@ content: '\e05b'; } +#integrationGrid_table .action.info:before { + content: '\e07e'; /* TOFIX: Need to get the proper character code */ +} + #integrationGrid_table .action.delete:before { content: '\e07f'; } @@ -86,6 +90,10 @@ text-align: right; } +.no-close .ui-dialog-titlebar-close { + display: none; +} + #integration_token_base_fieldset input[readonly] { cursor: copy; } diff --git a/app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml b/app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml index 59fc19b33e690..d4696852e62eb 100644 --- a/app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml +++ b/app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml @@ -28,10 +28,13 @@ ?> + diff --git a/app/code/Magento/Integration/view/adminhtml/js/integration.js b/app/code/Magento/Integration/view/adminhtml/js/integration.js index 6e4e805e34f28..e67ff6f9db41a 100644 --- a/app/code/Magento/Integration/view/adminhtml/js/integration.js +++ b/app/code/Magento/Integration/view/adminhtml/js/integration.js @@ -24,6 +24,80 @@ /*global FORM_KEY*/ /*global integration*/ (function($, window) { + "use strict"; + $.widget('mage.integration', { + /** + * Options common to all instances of this widget. + * @type {Object} + */ + options: { + /** + * URL of the integration grid. + * @type {String} + */ + gridUrl: '' + }, + + /** + * Bind event handler for the action when admin clicks "Save & Activate" button. + * @private + */ + _create: function () { + if ($('#save-split-button-activate').length) { + // We're on the "New integration" page - bind related handler + this._form = $('#edit_form'); + this._form.on('saveAndActivate', $.proxy(this._saveAndActivate, this)); + } + }, + + /** + * Save new integration, then kick off the activate dialog. + * @private + */ + _saveAndActivate: function () { + if (this._form.validation && !this._form.validation('isValid')) { + return false; + } + + $.ajax({ + url: this._form.prop('action'), + type: 'post', + data: this._form.serialize(), + dataType: 'json', + context: this, + beforeSend: function () { + $('body').trigger('processStart'); + }, + success: function (data) { + if (data['_redirect']) { + window.location.href = data['_redirect']; + } else if (data['integrationId']) { + window.integration.popup.show($('').attr({ + 'data-row-dialog': 'permissions', + 'data-row-id': data['integrationId'], + 'data-row-name': $('#integration_properties_name').val() + })); + var that = this; + $('#integration-popup-container').on('dialogclose', function () { + $('body').trigger('processStart'); + window.location.href = that.options.gridUrl; + return false; + }); + } + }, + error: function (jqXHR, status, error) { + alert($.mage.__('Sorry, something went wrong. Please try again later.')); + console && console.log(status + ': ' + error + "\nResponse text:\n" + jqXHR.responseText); + }, + complete: function () { + jQuery('body').trigger('processStop'); + } + }); + + return true; + } + }); + window.Integration = function (permissionsDialogUrl, tokensDialogUrl, deactivateDialogUrl, reauthorizeDialogUrl) { var url = { permissions: permissionsDialogUrl, @@ -33,8 +107,6 @@ }; var _showPopup = function (dialog, title, okButton, url) { - var that = this; - $.ajax({ url: url, cache: false, @@ -53,7 +125,7 @@ var buttons = [{ text: $.mage.__('Cancel'), click: function() { - $(this).dialog('destroy'); + $(this).dialog('close'); } }]; @@ -135,4 +207,32 @@ } }; }; + + /** + * Confirm dialog for delete integration action + */ + $(function() { + $('#integrationGrid_table').on('click', 'button#delete', function(e){ + $('#integration-delete-container').dialog({ + modal: true, + autoOpen: true, + resizable: false, + minHeight: 200, + minWidth: 300, + dialogClass: "no-close", + position: {at: 'top'}, + buttons: { + Cancel: function() { + $(this).dialog( "close" ); + }, + Delete: function() { + $(this).dialog( "close" ); + window.location.href = $(e.target).data('url'); + } + } + }); + e.stopPropagation(); + }); + }); + })(jQuery, window); diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml index 65c4a96273902..d5b1ef54043d3 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -27,7 +27,9 @@ - + + + info_section integration_edit_tab_info diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml index bc2a4f7d68ec5..eb8d6917d6b27 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml @@ -30,7 +30,7 @@ integrationGrid - \Magento\Integration\Model\Resource\Integration\Collection + Magento\Integration\Model\Resource\Integration\Collection 1 integration_id asc @@ -83,7 +83,6 @@ Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button\Edit - action edit edit edit 0 diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml index 718ae1d6e803d..16d10cc498bbe 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml @@ -38,11 +38,9 @@
    + - - - - +
    diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml index dadd55f1a451a..2329a5b3cde44 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml @@ -24,5 +24,20 @@ */ --> + + + + Magento_Integration::integration.css + + + + + Magento_Integration::js/integration.js + + + + + + diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_permissions_popup.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml similarity index 100% rename from app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_permissions_popup.xml rename to app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_tokens_popup.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml similarity index 95% rename from app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_tokens_popup.xml rename to app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml index e06c57704e8b9..e10db94acdfd9 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_tokens_popup.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml @@ -25,5 +25,5 @@ --> - + diff --git a/app/code/Magento/Log/Model/Shell.php b/app/code/Magento/Log/Model/Shell.php index 8172d9c5d1c15..c3e4b8c75e9ea 100644 --- a/app/code/Magento/Log/Model/Shell.php +++ b/app/code/Magento/Log/Model/Shell.php @@ -41,16 +41,16 @@ class Shell extends \Magento\Core\Model\AbstractShell protected $_commandFactory; /** - * @param \Magento\Log\Model\Shell\Command\Factory $commandFactory * @param \Magento\Filesystem $filesystem - * @param \Magento\App\Dir $entryPoint + * @param string $entryPoint * @param \Magento\App\Dir $dir + * @param \Magento\Log\Model\Shell\Command\Factory $commandFactory */ public function __construct( - \Magento\Log\Model\Shell\Command\Factory $commandFactory, \Magento\Filesystem $filesystem, $entryPoint, - \Magento\App\Dir $dir + \Magento\App\Dir $dir, + \Magento\Log\Model\Shell\Command\Factory $commandFactory ) { parent::__construct($filesystem, $entryPoint, $dir); $this->_commandFactory = $commandFactory; diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview/Form.php b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview/Form.php index 3933ff50c68ad..13b54900a8c6f 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview/Form.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview/Form.php @@ -44,7 +44,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'preview_form', 'action' => $this->getUrl('*/*/drop', array('_current' => true)), 'method' => 'post', @@ -56,7 +56,7 @@ protected function _prepareForm() $mapper = array('preview_store_id' => 'store_id'); foreach ($data as $key => $value) { - if(array_key_exists($key, $mapper)) { + if (array_key_exists($key, $mapper)) { $name = $mapper[$key]; } else { $name = $key; diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php index a5ec8f0576c4b..15e20aaa19290 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php @@ -85,7 +85,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview/Form.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview/Form.php index 77d8a9abe3799..2b6963970d75e 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview/Form.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview/Form.php @@ -44,7 +44,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'preview_form', 'action' => $this->getUrl('*/*/drop', array('_current' => true)), 'method' => 'post', diff --git a/app/code/Magento/Newsletter/Model/Session.php b/app/code/Magento/Newsletter/Model/Session.php index fc51c6bed0a0d..a8f1eff995183 100644 --- a/app/code/Magento/Newsletter/Model/Session.php +++ b/app/code/Magento/Newsletter/Model/Session.php @@ -40,15 +40,15 @@ class Session extends \Magento\Core\Model\Session\AbstractSession * @param \Magento\Core\Model\Session\Context $context * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig - * @param array $data * @param null $sessionName + * @param array $data */ public function __construct( \Magento\Core\Model\Session\Context $context, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\Session\Config\ConfigInterface $sessionConfig, - array $data = array(), - $sessionName = null + \Magento\Session\Config\ConfigInterface $sessionConfig, + $sessionName = null, + array $data = array() ) { parent::__construct($context, $sidResolver, $sessionConfig, $data); $this->start('newsletter', $sessionName); diff --git a/app/code/Magento/Newsletter/view/frontend/subscribe.phtml b/app/code/Magento/Newsletter/view/frontend/subscribe.phtml index c33c07b7907da..6aea243e96ffc 100644 --- a/app/code/Magento/Newsletter/view/frontend/subscribe.phtml +++ b/app/code/Magento/Newsletter/view/frontend/subscribe.phtml @@ -30,7 +30,7 @@ diff --git a/app/code/Magento/Shipping/Model/Shipping/Labels.php b/app/code/Magento/Shipping/Model/Shipping/Labels.php index 61f6c4e97283a..dbfdb0d62c7cf 100644 --- a/app/code/Magento/Shipping/Model/Shipping/Labels.php +++ b/app/code/Magento/Shipping/Model/Shipping/Labels.php @@ -41,23 +41,23 @@ class Labels extends \Magento\Shipping\Model\Shipping * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Shipping\Model\Config $shippingConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Backend\Model\Auth\Session $authSession * @param \Magento\Shipping\Model\Carrier\Factory $carrierFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory * @param \Magento\Directory\Model\RegionFactory $regionFactory * @param \Magento\Math\Division $mathDivision + * @param \Magento\Backend\Model\Auth\Session $authSession */ public function __construct( \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Shipping\Model\Config $shippingConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Backend\Model\Auth\Session $authSession, \Magento\Shipping\Model\Carrier\Factory $carrierFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory, \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Math\Division $mathDivision + \Magento\Math\Division $mathDivision, + \Magento\Backend\Model\Auth\Session $authSession ) { $this->_authSession = $authSession; parent::__construct( diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php index 6e212c8d2eeb0..d53b5f9313f04 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php @@ -75,7 +75,7 @@ protected function _prepareForm() /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Title/Fieldset.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Title/Fieldset.php index e567043788844..a7606aacbf5c4 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Title/Fieldset.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Title/Fieldset.php @@ -40,21 +40,21 @@ class Fieldset extends \Magento\Data\Form\Element\Fieldset protected $_title; /** - * @param \Magento\Tax\Block\Adminhtml\Rate\Title $title - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection - * @param array $attributes + * @param \Magento\Escaper $escaper + * @param \Magento\Tax\Block\Adminhtml\Rate\Title $title + * @param array $data */ public function __construct( - \Magento\Tax\Block\Adminhtml\Rate\Title $title, - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, - $attributes = array() + \Magento\Escaper $escaper, + \Magento\Tax\Block\Adminhtml\Rate\Title $title, + $data = array() ) { $this->_title = $title; - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } public function getBasicChildrenHtml() diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php index 1c8123db9a962..4b12e0d03d5f4 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php @@ -80,7 +80,7 @@ protected function _prepareForm() $model = $this->_coreRegistry->registry('tax_rule'); /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Tax/Model/Sales/Pdf/Grandtotal.php b/app/code/Magento/Tax/Model/Sales/Pdf/Grandtotal.php index 661343417a31d..b14be6d406a97 100644 --- a/app/code/Magento/Tax/Model/Sales/Pdf/Grandtotal.php +++ b/app/code/Magento/Tax/Model/Sales/Pdf/Grandtotal.php @@ -36,15 +36,15 @@ class Grandtotal extends \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal /** * @param \Magento\Tax\Helper\Data $taxHelper * @param \Magento\Tax\Model\Calculation $taxCalculation - * @param \Magento\Tax\Model\Config $taxConfig * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $ordersFactory + * @param \Magento\Tax\Model\Config $taxConfig * @param array $data */ public function __construct( \Magento\Tax\Helper\Data $taxHelper, \Magento\Tax\Model\Calculation $taxCalculation, - \Magento\Tax\Model\Config $taxConfig, \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $ordersFactory, + \Magento\Tax\Model\Config $taxConfig, array $data = array() ) { $this->_taxConfig = $taxConfig; diff --git a/app/code/Magento/Tax/Model/Sales/Pdf/Shipping.php b/app/code/Magento/Tax/Model/Sales/Pdf/Shipping.php index 20bb2cce621b3..e8e194aa5780a 100644 --- a/app/code/Magento/Tax/Model/Sales/Pdf/Shipping.php +++ b/app/code/Magento/Tax/Model/Sales/Pdf/Shipping.php @@ -36,15 +36,15 @@ class Shipping extends \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal /** * @param \Magento\Tax\Helper\Data $taxHelper * @param \Magento\Tax\Model\Calculation $taxCalculation - * @param \Magento\Tax\Model\Config $taxConfig * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $ordersFactory + * @param \Magento\Tax\Model\Config $taxConfig * @param array $data */ public function __construct( \Magento\Tax\Helper\Data $taxHelper, \Magento\Tax\Model\Calculation $taxCalculation, - \Magento\Tax\Model\Config $taxConfig, \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $ordersFactory, + \Magento\Tax\Model\Config $taxConfig, array $data = array() ) { $this->_taxConfig = $taxConfig; diff --git a/app/code/Magento/Tax/Model/Sales/Pdf/Tax.php b/app/code/Magento/Tax/Model/Sales/Pdf/Tax.php index 312bb933203b2..80c9236e051aa 100644 --- a/app/code/Magento/Tax/Model/Sales/Pdf/Tax.php +++ b/app/code/Magento/Tax/Model/Sales/Pdf/Tax.php @@ -36,15 +36,15 @@ class Tax extends \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal /** * @param \Magento\Tax\Helper\Data $taxHelper * @param \Magento\Tax\Model\Calculation $taxCalculation - * @param \Magento\Tax\Model\Config $taxConfig * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $ordersFactory + * @param \Magento\Tax\Model\Config $taxConfig * @param array $data */ public function __construct( \Magento\Tax\Helper\Data $taxHelper, \Magento\Tax\Model\Calculation $taxCalculation, - \Magento\Tax\Model\Config $taxConfig, \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $ordersFactory, + \Magento\Tax\Model\Config $taxConfig, array $data = array() ) { $this->_taxConfig = $taxConfig; diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form.php index 707ac75b23919..f7a8ef145bce7 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form.php @@ -42,7 +42,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getUrl('adminhtml/*/save'), 'enctype' => 'multipart/form-data', diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php index 8329c8fef99e7..b4afdb98794e0 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Image.php @@ -37,23 +37,23 @@ class Image extends \Magento\Data\Form\Element\Image protected $_imagePath; /** - * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection + * @param \Magento\Escaper $escaper * @param \Magento\UrlInterface $urlBuilder * @param \Magento\View\Design\Theme\Image\PathInterface $imagePath - * @param array $attributes + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Escaper $escaper, \Magento\UrlInterface $urlBuilder, \Magento\View\Design\Theme\Image\PathInterface $imagePath, - $attributes = array() + $data = array() ) { $this->_imagePath = $imagePath; - parent::__construct($escaper, $factoryElement, $factoryCollection, $urlBuilder, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $urlBuilder, $data); } /** diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Links.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Links.php index 713751ad80ef1..536f8c4bc495a 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Links.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Form/Element/Links.php @@ -35,18 +35,18 @@ class Links 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 array $attributes + * @param \Magento\Escaper $escaper + * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, - $attributes = array() + \Magento\Escaper $escaper, + $data = array() ) { - parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); $this->setType('links'); } diff --git a/app/code/Magento/Theme/Model/Config.php b/app/code/Magento/Theme/Model/Config.php index 171aa7b00dda7..1d23ca2bd6651 100644 --- a/app/code/Magento/Theme/Model/Config.php +++ b/app/code/Magento/Theme/Model/Config.php @@ -150,7 +150,7 @@ protected function _getAssignedScopesCollection($scope, $configPath) */ protected function _unassignThemeFromStores($themeId, $stores, $scope, &$isReassigned) { - $configPath = \Magento\Core\Model\View\Design::XML_PATH_THEME_ID; + $configPath = \Magento\View\DesignInterface::XML_PATH_THEME_ID; foreach ($this->_getAssignedScopesCollection($scope, $configPath) as $config) { if ($config->getValue() == $themeId && !in_array($config->getScopeId(), $stores)) { $this->_configWriter->delete($configPath, $scope, $config->getScopeId()); @@ -171,7 +171,7 @@ protected function _unassignThemeFromStores($themeId, $stores, $scope, &$isReass */ protected function _assignThemeToStores($themeId, $stores, $scope, &$isReassigned) { - $configPath = \Magento\Core\Model\View\Design::XML_PATH_THEME_ID; + $configPath = \Magento\View\DesignInterface::XML_PATH_THEME_ID; if (count($stores) > 0) { foreach ($stores as $storeId) { $this->_configWriter->save($configPath, $themeId, $scope, $storeId); @@ -190,7 +190,7 @@ protected function _assignThemeToStores($themeId, $stores, $scope, &$isReassigne */ protected function _assignThemeToDefaultScope($themeId, &$isReassigned) { - $configPath = \Magento\Core\Model\View\Design::XML_PATH_THEME_ID; + $configPath = \Magento\View\DesignInterface::XML_PATH_THEME_ID; $this->_configWriter->save($configPath, $themeId, \Magento\Core\Model\Config::SCOPE_DEFAULT); $isReassigned = true; return $this; diff --git a/app/code/Magento/Core/Model/Theme/CopyService.php b/app/code/Magento/Theme/Model/CopyService.php similarity index 99% rename from app/code/Magento/Core/Model/Theme/CopyService.php rename to app/code/Magento/Theme/Model/CopyService.php index 8f09b2ed3dcfd..7e02081280acc 100644 --- a/app/code/Magento/Core/Model/Theme/CopyService.php +++ b/app/code/Magento/Theme/Model/CopyService.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Core + * @package Magento_Theme * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,7 +27,7 @@ /** * Service of copying customizations from one theme to another */ -namespace Magento\Core\Model\Theme; +namespace Magento\Theme\Model; class CopyService { diff --git a/app/code/Magento/Theme/view/frontend/1column.phtml b/app/code/Magento/Theme/view/frontend/1column.phtml index 59049a4971927..ef57baf178a64 100644 --- a/app/code/Magento/Theme/view/frontend/1column.phtml +++ b/app/code/Magento/Theme/view/frontend/1column.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; - + getChildHtml('head') ?> getBodyClass() ? $this->getBodyClass() : ''; - + getChildHtml('head') ?> getBodyClass() ? $this->getBodyClass() : ''; - + getChildHtml('head') ?> getBodyClass() ? $this->getBodyClass() : ''; - + getChildHtml('head') ?> getBodyClass() ? $this->getBodyClass() : ''; - + getChildHtml('head') ?> - - - - mage/calendar.css - - - - - jquery/jquery.js - - - - - mage/jquery-no-conflict.js - - - - - head.load.min.js - - - - - mage/mage.js - - - - - mage/decorate.js - - - - - mage/translate.js - - - - - mage/cookies.js - - - - - jquery/jquery-ui.js - - - - - jquery/jquery.tmpl.min.js - - - - - mage/bootstrap.js - - - - - Magento_Theme::js/truncate.js - - - - - mage/common.js - - - - - mage/toggle.js - - - - - mage/popup-window.js - - - - diff --git a/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml index 256b3256ab040..b1c2031d5a6bf 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml @@ -103,14 +103,6 @@ mage/popup-window.js - - - Magento_Theme::css/tabs.css - - - - - mage/loader.js diff --git a/app/code/Magento/Theme/view/frontend/link.phtml b/app/code/Magento/Theme/view/frontend/link.phtml index 793bb875c7e64..2f02a13e381d0 100644 --- a/app/code/Magento/Theme/view/frontend/link.phtml +++ b/app/code/Magento/Theme/view/frontend/link.phtml @@ -25,10 +25,11 @@ * @var $this \Magento\View\Element\Html\Link */ ?> +getIsDisabled()): ?>
  • getTitle()):?> title="escapeHtml(__($title))?>" - > + getTitle()):?> title="escapeHtml(__($title))?>"> escapeHtml(__($this->getLabel()))?>
  • + diff --git a/app/code/Magento/Theme/view/frontend/page.phtml b/app/code/Magento/Theme/view/frontend/page.phtml index 031b34fbbdef0..914a512e0abc2 100644 --- a/app/code/Magento/Theme/view/frontend/page.phtml +++ b/app/code/Magento/Theme/view/frontend/page.phtml @@ -34,7 +34,7 @@ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; - + getChildHtml('head') ?> getBodyClass() ? $this->getBodyClass() : ''; - + getChildHtml('head') ?> _xmlElFactory = $xmlElFactory; diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php index 192ef5a119903..ee182bdc33204 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php @@ -126,9 +126,9 @@ class Dhl protected $string; /** - * Dhl constructor - * - * @param \Magento\Usa\Helper\Data $usaData + * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory + * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory @@ -139,16 +139,16 @@ class Dhl * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData - * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Usa\Helper\Data $usaData * @param \Magento\Stdlib\String $string * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Usa\Helper\Data $usaData, + \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, + \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory, @@ -159,18 +159,27 @@ public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, - \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Usa\Helper\Data $usaData, \Magento\Stdlib\String $string, array $data = array() ) { $this->string = $string; $this->_usaData = $usaData; parent::__construct( - $xmlElFactory, $rateFactory, $rateMethodFactory, $trackFactory, $trackErrorFactory, $trackStatusFactory, - $regionFactory, $countryFactory, $currencyFactory, $directoryData, $coreStoreConfig, $rateErrorFactory, - $logAdapterFactory, $data + $coreStoreConfig, + $rateErrorFactory, + $logAdapterFactory, + $xmlElFactory, + $rateFactory, + $rateMethodFactory, + $trackFactory, + $trackErrorFactory, + $trackStatusFactory, + $regionFactory, + $countryFactory, + $currencyFactory, + $directoryData, + $data ); } diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php index fd811e79562ba..6cab061aa38a0 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -196,15 +196,9 @@ class International protected $dateTime; /** - * Dhl International Class constructor - * - * Sets necessary data - * - * @param \Magento\Usa\Helper\Data $usaData - * @param \Magento\Core\Model\Date $coreDate - * @param \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\PdfFactory $pdfFactory - * @param \Magento\Module\Dir\Reader $configReader - * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory + * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory @@ -215,21 +209,22 @@ class International * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData - * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Usa\Helper\Data $usaData + * @param \Magento\Core\Model\Date $coreDate + * @param \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\PdfFactory $pdfFactory + * @param \Magento\Module\Dir\Reader $configReader + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Stdlib\String $string * @param \Magento\Math\Division $mathDivision * @param \Magento\Stdlib\DateTime $dateTime * @param array $data + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Usa\Helper\Data $usaData, - \Magento\Core\Model\Date $coreDate, - \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\PdfFactory $pdfFactory, - \Magento\Module\Dir\Reader $configReader, - \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, + \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory, @@ -240,9 +235,11 @@ public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, - \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Usa\Helper\Data $usaData, + \Magento\Core\Model\Date $coreDate, + \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\PdfFactory $pdfFactory, + \Magento\Module\Dir\Reader $configReader, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Stdlib\String $string, \Magento\Math\Division $mathDivision, \Magento\Stdlib\DateTime $dateTime, @@ -257,9 +254,20 @@ public function __construct( $this->mathDivision = $mathDivision; $this->dateTime = $dateTime; parent::__construct( - $xmlElFactory, $rateFactory, $rateMethodFactory, $trackFactory, $trackErrorFactory, $trackStatusFactory, - $regionFactory, $countryFactory, $currencyFactory, $directoryData, $coreStoreConfig, $rateErrorFactory, - $logAdapterFactory, $data + $coreStoreConfig, + $rateErrorFactory, + $logAdapterFactory, + $xmlElFactory, + $rateFactory, + $rateMethodFactory, + $trackFactory, + $trackErrorFactory, + $trackStatusFactory, + $regionFactory, + $countryFactory, + $currencyFactory, + $directoryData, + $data ); if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_DOC) { $this->_freeMethod = 'free_method_doc'; diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php index 29135f27d94e5..40288288bd639 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php @@ -131,10 +131,9 @@ class Fedex protected $_productCollFactory; /** - * @param \Magento\Logger $logger - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Module\Dir\Reader $configReader - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory + * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory + * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory @@ -145,17 +144,18 @@ class Fedex * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData - * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger $logger + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Module\Dir\Reader $configReader + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory * @param array $data + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Logger $logger, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Module\Dir\Reader $configReader, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory, + \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, + \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory, @@ -166,17 +166,29 @@ public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, - \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger $logger, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Module\Dir\Reader $configReader, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory, array $data = array() ) { $this->_storeManager = $storeManager; $this->_productCollFactory = $productCollFactory; parent::__construct( - $xmlElFactory, $rateFactory, $rateMethodFactory, $trackFactory, $trackErrorFactory, $trackStatusFactory, - $regionFactory, $countryFactory, $currencyFactory, $directoryData, $coreStoreConfig, $rateErrorFactory, - $logAdapterFactory, $data + $coreStoreConfig, + $rateErrorFactory, + $logAdapterFactory, + $xmlElFactory, + $rateFactory, + $rateMethodFactory, + $trackFactory, + $trackErrorFactory, + $trackStatusFactory, + $regionFactory, + $countryFactory, + $currencyFactory, + $directoryData, + $data ); $wsdlBasePath = $configReader->getModuleDir('etc', 'Magento_Usa') . DS . 'wsdl' . DS . 'FedEx' . DS; $this->_shipServiceWsdl = $wsdlBasePath . 'ShipService_v10.wsdl'; diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php index d9ddc32b262d9..013bd558b7e09 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Ups.php @@ -135,9 +135,9 @@ class Ups protected $_logger; /** - * @param \Magento\Logger $logger - * @param \Magento\Usa\Model\Simplexml\ElementFactory $simpleXmlElementFactory - * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory + * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory @@ -148,16 +148,16 @@ class Ups * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData - * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Logger $logger + * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Logger $logger, - \Magento\Core\Model\LocaleInterface $locale, + \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, + \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory, @@ -168,17 +168,27 @@ public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, - \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Logger $logger, + \Magento\Core\Model\LocaleInterface $locale, array $data = array() ) { $this->_logger = $logger; $this->_locale = $locale; parent::__construct( - $xmlElFactory, $rateFactory, $rateMethodFactory, $trackFactory, $trackErrorFactory, $trackStatusFactory, - $regionFactory, $countryFactory, $currencyFactory, $directoryData, $coreStoreConfig, $rateErrorFactory, - $logAdapterFactory, $data + $coreStoreConfig, + $rateErrorFactory, + $logAdapterFactory, + $xmlElFactory, + $rateFactory, + $rateMethodFactory, + $trackFactory, + $trackErrorFactory, + $trackStatusFactory, + $regionFactory, + $countryFactory, + $currencyFactory, + $directoryData, + $data ); } diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php index 0afc2ecacad9d..7ee88457929e6 100644 --- a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php @@ -136,10 +136,9 @@ class Usps protected $_productCollFactory; /** - * Usps constructor - * - * @param \Magento\Usa\Helper\Data $usaData - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory + * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory + * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory * @param \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory @@ -150,15 +149,16 @@ class Usps * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData - * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory - * @param \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory + * @param \Magento\Usa\Helper\Data $usaData + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory * @param array $data + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Usa\Helper\Data $usaData, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory, + \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, + \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, \Magento\Usa\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Shipping\Model\Rate\Result\MethodFactory $rateMethodFactory, @@ -169,18 +169,28 @@ public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, - \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory, - \Magento\Core\Model\Log\AdapterFactory $logAdapterFactory, + \Magento\Usa\Helper\Data $usaData, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory, array $data = array() ) { $this->_usaData = $usaData; $this->_productCollFactory = $productCollFactory; $this->_xmlElFactory = $xmlElFactory; parent::__construct( - $xmlElFactory, $rateFactory, $rateMethodFactory, $trackFactory, $trackErrorFactory, $trackStatusFactory, - $regionFactory, $countryFactory, $currencyFactory, $directoryData, $coreStoreConfig, $rateErrorFactory, - $logAdapterFactory, $data + $coreStoreConfig, + $rateErrorFactory, + $logAdapterFactory, + $xmlElFactory, + $rateFactory, + $rateMethodFactory, + $trackFactory, + $trackErrorFactory, + $trackStatusFactory, + $regionFactory, + $countryFactory, + $currencyFactory, + $directoryData, + $data ); } diff --git a/app/code/Magento/User/Block/User/Edit/Form.php b/app/code/Magento/User/Block/User/Edit/Form.php index 34233d7db7880..514353f23a141 100644 --- a/app/code/Magento/User/Block/User/Edit/Form.php +++ b/app/code/Magento/User/Block/User/Edit/Form.php @@ -43,7 +43,7 @@ protected function _prepareForm() { /** @var \Magento\Data\Form $form */ $form = $this->_formFactory->create(array( - 'attributes' => array( + 'data' => array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php index 8db34a694650c..39c0b328e9556 100644 --- a/app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php +++ b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php @@ -24,58 +24,68 @@ namespace Magento\Webapi\Block\Adminhtml\Integration\Activate\Permissions\Tab; -use Magento\Backend\Block\Widget\Tab\TabInterface; -use Magento\View\Element\Template; -use Magento\Acl\Resource\ProviderInterface; -use Magento\Core\Helper\Data as CoreHelper; -use Magento\Core\Model\Acl\RootResource; -use Magento\View\Element\Template\Context; -use Magento\Integration\Helper\Data as IntegrationHelper; +use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; +use Magento\Integration\Controller\Adminhtml\Integration as IntegrationController; +use Magento\Integration\Model\Integration as IntegrationModel; use Magento\Webapi\Helper\Data as WebapiHelper; /** * API permissions tab for integration activation dialog. + * + * TODO: Fix warnings suppression + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Webapi extends Template implements TabInterface +class Webapi extends \Magento\Backend\Block\Widget\Form\Generic + implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** @var string[] */ protected $_selectedResources; - /** @var RootResource */ + /** @var \Magento\Core\Model\Acl\RootResource */ protected $_rootResource; - /** @var ProviderInterface */ + /** @var \Magento\Acl\Resource\ProviderInterface */ protected $_resourceProvider; - /** @var IntegrationHelper */ + /** @var \Magento\Integration\Helper\Data */ protected $_integrationData; /** @var WebapiHelper */ protected $_webapiHelper; + /** @var \Magento\Core\Helper\Data */ + protected $_coreHelper; + /** * Initialize dependencies. * - * @param Context $context - * @param RootResource $rootResource - * @param ProviderInterface $resourceProvider - * @param IntegrationHelper $integrationData - * @param WebapiHelper $webapiData + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Helper\Data $coreHelper + * @param \Magento\Core\Model\Acl\RootResource $rootResource + * @param \Magento\Acl\Resource\ProviderInterface $resourceProvider + * @param \Magento\Integration\Helper\Data $integrationData + * @param \Magento\Webapi\Helper\Data $webapiData * @param array $data */ public function __construct( - Context $context, - RootResource $rootResource, - ProviderInterface $resourceProvider, - IntegrationHelper $integrationData, - WebapiHelper $webapiData, + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Helper\Data $coreHelper, + \Magento\Core\Model\Acl\RootResource $rootResource, + \Magento\Acl\Resource\ProviderInterface $resourceProvider, + \Magento\Integration\Helper\Data $integrationData, + \Magento\Webapi\Helper\Data $webapiData, array $data = array() ) { $this->_rootResource = $rootResource; - $this->_webapiHelper = $webapiData; $this->_resourceProvider = $resourceProvider; $this->_integrationData = $integrationData; - parent::__construct($context, $data); + $this->_webapiHelper = $webapiData; + $this->_coreHelper = $coreHelper; + parent::__construct($context, $registry, $formFactory, $data); } /** @@ -93,7 +103,9 @@ protected function _construct() */ public function canShowTab() { - return true; + $integrationData = $this->_coreRegistry->registry(IntegrationController::REGISTRY_KEY_CURRENT_INTEGRATION); + return isset($integrationData[Info::DATA_SETUP_TYPE]) + && ($integrationData[Info::DATA_SETUP_TYPE] == IntegrationModel::TYPE_CONFIG); } /** @@ -140,7 +152,7 @@ public function getResourcesTreeJson() $resources = $this->_resourceProvider->getAclResources(); $aclResourcesTree = $this->_integrationData->mapResources($resources[1]['children']); - return $this->_coreData->jsonEncode($aclResourcesTree); + return $this->_coreHelper->jsonEncode($aclResourcesTree); } /** @@ -157,7 +169,17 @@ public function getSelectedResourcesJson() $resources = $this->_resourceProvider->getAclResources(); $selectedResources = $this->_getAllResourceIds($resources[1]['children']); } - return $this->_coreData->jsonEncode($selectedResources); + return $this->_coreHelper->jsonEncode($selectedResources); + } + + /** + * Whether tree has any resources. + * + * @return bool + */ + public function isTreeEmpty() + { + return $this->_selectedResources === []; } /** diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php index 41c41975ca46b..65c695e4f2c47 100644 --- a/app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php +++ b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php @@ -24,12 +24,14 @@ namespace Magento\Webapi\Block\Adminhtml\Integration\Edit\Tab; +use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; use Magento\Integration\Controller\Adminhtml\Integration as IntegrationController; +use Magento\Integration\Model\Integration as IntegrationModel; /** * Class for handling API section within integration. */ -class Webapi extends \Magento\Backend\Block\Widget\Form +class Webapi extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** @@ -60,9 +62,14 @@ class Webapi extends \Magento\Backend\Block\Widget\Form protected $_webapiData; /** - * Construct + * Initialize dependencies. + * + * TODO: Fix excessive number of arguments + * @SuppressWarnings(PHPMD.ExcessiveParameterList) * * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Acl\RootResource $rootResource * @param \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollFactory * @param \Magento\Acl\Resource\ProviderInterface $aclResourceProvider @@ -72,6 +79,8 @@ class Webapi extends \Magento\Backend\Block\Widget\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Acl\RootResource $rootResource, \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollFactory, \Magento\Acl\Resource\ProviderInterface $aclResourceProvider, @@ -84,7 +93,7 @@ public function __construct( $this->_aclResourceProvider = $aclResourceProvider; $this->_webapiData = $webapiData; $this->_integrationData = $integrationData; - parent::__construct($context, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** @@ -114,7 +123,9 @@ public function getTabTitle() */ public function canShowTab() { - return true; + $integrationData = $this->_coreRegistry->registry(IntegrationController::REGISTRY_KEY_CURRENT_INTEGRATION); + return !isset($integrationData[Info::DATA_SETUP_TYPE]) + || ($integrationData[Info::DATA_SETUP_TYPE] != IntegrationModel::TYPE_CONFIG); } /** diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role.php b/app/code/Magento/Webapi/Block/Adminhtml/Role.php deleted file mode 100644 index 9621b888e43bc..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role.php +++ /dev/null @@ -1,60 +0,0 @@ -_headerText = __('API Roles'); - $this->_updateButton('add', 'label', __('Add New API Role')); - } - - /** - * Get create URL. - * - * @return string - */ - public function getCreateUrl() - { - return $this->getUrl('adminhtml/*/edit'); - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit.php b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit.php deleted file mode 100644 index fd2d4756cdb4c..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit.php +++ /dev/null @@ -1,92 +0,0 @@ -_formScripts[] = "function saveAndContinueEdit(url)" . - "{var tagForm = new varienForm('edit_form'); tagForm.submit(url);}"; - - $this->_addButton('save_and_continue', array( - 'label' => __('Save and Continue Edit'), - 'onclick' => "saveAndContinueEdit('" . $this->getSaveAndContinueUrl() . "')", - 'class' => 'save' - ), 100); - - $this->_updateButton('save', 'label', __('Save API Role')); - $this->_updateButton('delete', 'label', __('Delete API Role')); - } - - /** - * Retrieve role SaveAndContinue URL. - * - * @return string - */ - public function getSaveAndContinueUrl() - { - return $this->getUrl('adminhtml/*/save', array('_current' => true, 'continue' => true)); - } - - /** - * Get header text. - * - * @return string - */ - public function getHeaderText() - { - if ($this->getApiRole()->getId()) { - return __("Edit API Role '%1'", $this->escapeHtml($this->getApiRole()->getRoleName())); - } else { - return __('New API Role'); - } - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Form.php b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Form.php deleted file mode 100644 index 64d5dc215b276..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Form.php +++ /dev/null @@ -1,50 +0,0 @@ -_formFactory->create(array( - 'attributes' => array( - 'action' => $this->getUrl('adminhtml/*/save'), - 'id' => 'edit_form', - 'method' => 'post', - )) - ); - $form->setUseContainer(true); - $this->setForm($form); - - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Main.php b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Main.php deleted file mode 100644 index 118f4b91538ac..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Main.php +++ /dev/null @@ -1,88 +0,0 @@ -_formFactory->create(); - - $fieldset = $form->addFieldset('base_fieldset', array( - 'legend' => __('Role Information')) - ); - - $role = $this->getApiRole(); - if ($role && $role->getId()) { - $fieldset->addField('role_id', 'hidden', array( - 'name' => 'role_id', - 'value' => $role->getId() - )); - } - - $fieldset->addField('role_name', 'text', array( - 'name' => 'role_name', - 'id' => 'role_name', - 'class' => 'required-entry', - 'required' => true, - 'label' => __('Role Name'), - 'title' => __('Role Name'), - )); - - $fieldset->addField('in_role_user', 'hidden', - array( - 'name' => 'in_role_user', - 'id' => 'in_role_user', - ) - ); - - $fieldset->addField('in_role_user_old', 'hidden', - array( - 'name' => 'in_role_user_old' - ) - ); - - if ($role) { - $form->setValues($role->getData()); - } - $this->setForm($form); - - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Resource.php b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Resource.php deleted file mode 100644 index 21ba797846a72..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Resource.php +++ /dev/null @@ -1,157 +0,0 @@ -_resourceProvider = $resourceProvider; - $this->_ruleResource = $ruleResource; - $this->_rootResource = $rootResource; - } - - /** - * Prepare Form. - * - * @return \Magento\Webapi\Block\Adminhtml\Role\Edit\Tab\Resource - */ - protected function _prepareForm() - { - $resources = $this->_resourceProvider->getAclResources(); - $this->_aclResourcesTree = $this->_mapResources($resources[1]['children']); - return parent::_prepareForm(); - } - - /** - * Map resources - * - * @param array $resources - * @return array - */ - protected function _mapResources(array $resources) - { - $output = array(); - foreach ($resources as $resource) { - $item = array(); - $item['id'] = $resource['id']; - $item['text'] = __($resource['title']); - if (in_array($item['id'], $this->_getSelectedResourcesIds())) { - $item['checked'] = true; - } - $item['children'] = array(); - if (isset($resource['children'])) { - $item['children'] = $this->_mapResources($resource['children']); - } - $output[] = $item; - } - return $output; - } - - /** - * Check whether resource access is set to "All". - * - * @return bool - */ - public function isEverythingAllowed() - { - return in_array($this->_rootResource->getId(), $this->_getSelectedResourcesIds()); - } - - /** - * Get ACL resources tree. - * - * @return string - */ - public function getResourcesTree() - { - return $this->_aclResourcesTree; - } - - /** - * Get selected ACL resources of given API role. - * - * @return array - */ - protected function _getSelectedResourcesIds() - { - $apiRole = $this->getApiRole(); - if (null === $this->_selResourcesIds && $apiRole && $apiRole->getId()) { - $this->_selResourcesIds = $this->_ruleResource->getResourceIdsByRole($apiRole->getRoleId()); - } - return (array)$this->_selResourcesIds; - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tabs.php b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tabs.php deleted file mode 100644 index 3751f76b55cf7..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tabs.php +++ /dev/null @@ -1,83 +0,0 @@ -setId('page_tabs'); - $this->setDestElementId('edit_form'); - $this->setTitle(__('Role Information')); - } - - /** - * Prepare child blocks. - * - * @return \Magento\View\Element\AbstractBlock - */ - protected function _beforeToHtml() - { - /** @var \Magento\Webapi\Block\Adminhtml\Role\Edit\Tab\Main $mainBlock */ - $mainBlock = $this->getLayout()->getBlock('webapi.role.edit.tab.main'); - $mainBlock->setApiRole($this->getApiRole()); - $this->addTab('main_section', array( - 'label' => __('Role Info'), - 'title' => __('Role Info'), - 'content' => $mainBlock->toHtml(), - 'active' => true - )); - - /** @var \Magento\Webapi\Block\Adminhtml\Role\Edit\Tab\Resource $resourceBlock */ - $resourceBlock = $this->getLayout()->getBlock('webapi.role.edit.tab.resource'); - $resourceBlock->setApiRole($this->getApiRole()); - $this->addTab('resource_section', array( - 'label' => __('Resources'), - 'title' => __('Resources'), - 'content' => $resourceBlock->toHtml() - )); - - if ($this->getApiRole() && $this->getApiRole()->getRoleId() > 0) { - $usersGrid = $this->getLayout()->getBlock('webapi.role.edit.tab.users.grid'); - $this->addTab('user_section', array( - 'label' => __('Users'), - 'title' => __('Users'), - 'content' => $usersGrid->toHtml() - )); - } - - return parent::_beforeToHtml(); - } - -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/User.php b/app/code/Magento/Webapi/Block/Adminhtml/User.php deleted file mode 100644 index e0d6e19b8903d..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/User.php +++ /dev/null @@ -1,50 +0,0 @@ -_headerText = __('API Users'); - $this->_updateButton('add', 'label', __('Add New API User')); - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit.php b/app/code/Magento/Webapi/Block/Adminhtml/User/Edit.php deleted file mode 100644 index 7062ca31e77e2..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit.php +++ /dev/null @@ -1,96 +0,0 @@ -_addButton('save_and_continue', array( - 'label' => __('Save and Continue Edit'), - 'class' => 'save', - 'data_attribute' => array( - 'mage-init' => array( - 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form'), - ), - ), - ), 100); - - $this->_updateButton('save', 'label', __('Save API User')); - $this->_updateButton('save', 'id', 'save_button'); - $this->_updateButton('delete', 'label', __('Delete API User')); - } - - /** - * Set Web API user to child form block. - * - * @return \Magento\Webapi\Block\Adminhtml\User\Edit - */ - protected function _beforeToHtml() - { - /** @var $formBlock \Magento\Webapi\Block\Adminhtml\User\Edit\Form */ - $formBlock = $this->getChildBlock('form'); - $formBlock->setApiUser($this->getApiUser()); - return parent::_beforeToHtml(); - } - - /** - * Get header text. - * - * @return string - */ - public function getHeaderText() - { - if ($this->getApiUser()->getId()) { - return __("Edit API User '%1'", $this->escapeHtml($this->getApiUser()->getApiKey())); - } else { - return __('New API User'); - } - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Form.php b/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Form.php deleted file mode 100644 index 35ee61a5e8a70..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Form.php +++ /dev/null @@ -1,54 +0,0 @@ -_formFactory->create(); - $form->setId('edit_form'); - $form->setAction($this->getUrl('adminhtml/*/save')); - $form->setMethod('post'); - $form->setUseContainer(true); - $this->setForm($form); - - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tab/Main.php b/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tab/Main.php deleted file mode 100644 index 164d36abf588b..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tab/Main.php +++ /dev/null @@ -1,99 +0,0 @@ -_formFactory->create(); - - $fieldset = $form->addFieldset('base_fieldset', array( - 'legend' => __('Account Information')) - ); - - $user = $this->getApiUser(); - if ($user->getId()) { - $fieldset->addField('user_id', 'hidden', array( - 'name' => 'user_id', - 'value' => $user->getId() - )); - } - - $fieldset->addField('company_name', 'text', array( - 'name' => 'company_name', - 'id' => 'company_name', - 'required' => false, - 'label' => __('Company Name'), - 'title' => __('Company Name'), - )); - - $fieldset->addField('contact_email', 'text', array( - 'name' => 'contact_email', - 'id' => 'contact_email', - 'class' => 'validate-email', - 'required' => true, - 'label' => __('Contact Email'), - 'title' => __('Contact Email'), - )); - - $fieldset->addField('api_key', 'text', array( - 'name' => 'api_key', - 'id' => 'api_key', - 'required' => true, - 'label' => __('API Key'), - 'title' => __('API Key'), - )); - - $fieldset->addField('secret', 'text', array( - 'name' => 'secret', - 'id' => 'secret', - 'required' => true, - 'label' => __('API Secret'), - 'title' => __('API Secret'), - )); - - if ($user) { - $form->setValues($user->getData()); - } - $this->setForm($form); - - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tabs.php b/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tabs.php deleted file mode 100644 index 8188dd1af9987..0000000000000 --- a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tabs.php +++ /dev/null @@ -1,70 +0,0 @@ -setId('page_tabs'); - $this->setDestElementId('edit_form'); - $this->setTitle(__('User Information')); - } - - /** - * Before to HTML. - * - * @return \Magento\View\Element\AbstractBlock - */ - protected function _beforeToHtml() - { - /** @var \Magento\Webapi\Block\Adminhtml\User\Edit\Tab\Main $mainTab */ - $mainTab = $this->getLayout()->getBlock('webapi.user.edit.tab.main'); - $mainTab->setApiUser($this->getApiUser()); - $this->addTab('main_section', array( - 'label' => __('User Info'), - 'title' => __('User Info'), - 'content' => $mainTab->toHtml(), - 'active' => true - )); - - $rolesGrid = $this->getLayout()->getBlock('webapi.user.edit.tab.roles.grid'); - $this->addTab('roles_section', array( - 'label' => __('User Role'), - 'title' => __('User Role'), - 'content' => $rolesGrid->toHtml(), - )); - return parent::_beforeToHtml(); - } -} diff --git a/app/code/Magento/Webapi/Controller/Adminhtml/Webapi/Role.php b/app/code/Magento/Webapi/Controller/Adminhtml/Webapi/Role.php deleted file mode 100644 index dab630543d104..0000000000000 --- a/app/code/Magento/Webapi/Controller/Adminhtml/Webapi/Role.php +++ /dev/null @@ -1,321 +0,0 @@ -_validatorFactory = $validatorFactory; - parent::__construct($context); - } - - /** - * Init. - * - * @return \Magento\Webapi\Controller\Adminhtml\Webapi\Role - */ - protected function _initAction() - { - $this->_view->loadLayout(); - $this->_setActiveMenu('Magento_Webapi::system_api_webapi_roles'); - $this->_addBreadcrumb( - __('Web Api'), - __('Web Api') - ); - $this->_addBreadcrumb( - __('API Roles'), - __('API Roles') - ); - return $this; - } - - /** - * Web API roles grid. - */ - public function indexAction() - { - $this->_title->add(__('API Roles')); - $this->_initAction(); - $this->_view->renderLayout(); - } - - /** - * AJAX Web API roles grid. - */ - public function rolegridAction() - { - $this->_view->loadLayout(false); - $this->_view->renderLayout(); - } - - /** - * Grid in edit role form. - */ - public function usersgridAction() - { - $this->_view->loadLayout(false); - $this->_view->renderLayout(); - } - - /** - * Edit Web API role. - */ - public function editAction() - { - $this->_initAction(); - $this->_title->add(__('API Roles')); - - $roleId = $this->getRequest()->getParam('role_id'); - - /** @var \Magento\Webapi\Model\Acl\Role $role */ - $role = $this->_objectManager->create('Magento\Webapi\Model\Acl\Role'); - if ($roleId) { - $role->load($roleId); - if (!$role->getId()) { - $this->_getSession()->addError( - __('This API role no longer exists.') - ); - $this->_redirect('adminhtml/*/'); - return; - } - $this->_addBreadcrumb( - __('Edit API Role'), - __('Edit API Role') - ); - $this->_title->add(__('Edit API Role')); - } else { - $this->_addBreadcrumb( - __('Add New API Role'), - __('Add New API Role') - ); - $this->_title->add(__('New API Role')); - } - - // Restore previously entered form data from session - $data = $this->_getSession()->getWebapiUserData(true); - if (!empty($data)) { - $role->setData($data); - } - - /** @var \Magento\Webapi\Block\Adminhtml\Role\Edit $editBlock */ - $editBlock = $this->_view->getLayout()->getBlock('webapi.role.edit'); - if ($editBlock) { - $editBlock->setApiRole($role); - } - - /** @var \Magento\Webapi\Block\Adminhtml\Role\Edit\Tabs $tabsBlock */ - $tabsBlock = $this->_view->getLayout()->getBlock('webapi.role.edit.tabs'); - if ($tabsBlock) { - $tabsBlock->setApiRole($role); - } - - $this->_view->renderLayout(); - } - - /** - * Remove role. - */ - public function deleteAction() - { - $roleId = $this->getRequest()->getParam('role_id', false); - - try { - $this->_objectManager->create('Magento\Webapi\Model\Acl\Role')->load($roleId)->delete(); - $this->_getSession()->addSuccess( - __('The API role has been deleted.') - ); - } catch (\Exception $e) { - $this->_getSession()->addError( - __('An error occurred while deleting this role.') - ); - } - - $this->_redirect("*/*/"); - } - - /** - * Save role. - */ - public function saveAction() - { - $data = $this->getRequest()->getPost(); - if ($data) { - $roleId = $this->getRequest()->getPost('role_id', false); - /** @var \Magento\Webapi\Model\Acl\Role $role */ - $role = $this->_objectManager->create('Magento\Webapi\Model\Acl\Role')->load($roleId); - if (!$role->getId() && $roleId) { - $this->_getSession()->addError( - __('This role no longer exists.') - ); - $this->_redirect('adminhtml/*/'); - return; - } - $role->setData($data); - - try { - $this->_validateRole($role); - $role->save(); - - $isNewRole = empty($roleId); - $this->_saveResources($role->getId(), $isNewRole); - $this->_saveUsers($role->getId()); - - $this->_getSession()->addSuccess( - __('The API role has been saved.') - ); - $this->_getSession()->setWebapiRoleData(false); - - if ($roleId && !$this->getRequest()->has('continue')) { - $this->_redirect('adminhtml/*/'); - } else { - $this->_redirect('adminhtml/*/edit', array('role_id' => $role->getId())); - } - } catch (\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - $this->_getSession()->setWebapiRoleData($data); - $this->_redirect('adminhtml/*/edit', array('role_id' => $role->getId())); - } - } - } - - /** - * Validate Web API role data. - * - * @param \Magento\Webapi\Model\Acl\Role $role - * @throws \Magento\Validator\ValidatorException - */ - protected function _validateRole($role) - { - $group = $role->isObjectNew() ? 'create' : 'update'; - $validator = $this->_validatorFactory->createValidator('api_role', $group); - if (!$validator->isValid($role)) { - throw new \Magento\Validator\ValidatorException($validator->getMessages()); - } - } - - /** - * Save role resources. - * - * @param integer $roleId - * @param boolean $isNewRole - */ - protected function _saveResources($roleId, $isNewRole) - { - // parse resource list - $resources = explode(',', $this->getRequest()->getParam('resource', false)); - $isAll = $this->getRequest()->getParam('all'); - $rootResource = $this->_objectManager->get('Magento\Core\Model\Acl\RootResource'); - if ($isAll) { - $resources = array($rootResource->getId()); - } elseif (in_array($rootResource->getId(), $resources)) { - unset($resources[array_search( - $rootResource->getId(), - $resources - )]); - } - - $saveResourcesFlag = true; - if (!$isNewRole) { - // Check changes - /** @var \Magento\Webapi\Model\Resource\Acl\Rule $ruleResource */ - $ruleResource = $this->_objectManager->get('Magento\Webapi\Model\Resource\Acl\Rule'); - $oldResources = $ruleResource->getResourceIdsByRole($roleId); - if (count($oldResources) == count($resources) && !array_diff($oldResources, $resources)) { - $saveResourcesFlag = false; - } - } - - if ($saveResourcesFlag) { - $this->_objectManager->create('Magento\Webapi\Model\Acl\Rule') - ->setRoleId($roleId) - ->setResources($resources) - ->saveResources(); - } - } - - /** - * Save linked users. - * - * @param integer $roleId - */ - protected function _saveUsers($roleId) - { - // parse users list - $roleUsers = $this->_parseRoleUsers($this->getRequest()->getParam('in_role_user')); - $oldRoleUsers = $this->_parseRoleUsers($this->getRequest()->getParam('in_role_user_old')); - - if ($roleUsers != $oldRoleUsers) { - foreach ($oldRoleUsers as $userId) { - $user = $this->_objectManager->create('Magento\Webapi\Model\Acl\User')->load($userId); - $user->setRoleId(null)->save(); - } - - foreach ($roleUsers as $userId) { - $user = $this->_objectManager->create('Magento\Webapi\Model\Acl\User')->load($userId); - $user->setRoleId($roleId)->save(); - } - } - } - - /** - * Parse request string with users. - * - * @param string $roleUsers - * @return array - */ - protected function _parseRoleUsers($roleUsers) - { - parse_str($roleUsers, $roleUsers); - if ($roleUsers && count($roleUsers)) { - return array_keys($roleUsers); - } - - return array(); - } - - /** - * Check access rights. - * - * @return boolean - */ - protected function _isAllowed() - { - return $this->_authorization->isAllowed('Magento_Webapi::webapi_roles'); - } - -} diff --git a/app/code/Magento/Webapi/Controller/Adminhtml/Webapi/User.php b/app/code/Magento/Webapi/Controller/Adminhtml/Webapi/User.php deleted file mode 100644 index 73f27d6810073..0000000000000 --- a/app/code/Magento/Webapi/Controller/Adminhtml/Webapi/User.php +++ /dev/null @@ -1,266 +0,0 @@ -_validatorFactory = $validatorFactory; - parent::__construct($context); - } - - /** - * Initialize breadcrumbs. - * - * @return \Magento\Webapi\Controller\Adminhtml\Webapi\User - */ - protected function _initAction() - { - $this->_view->loadLayout(); - $this->_setActiveMenu('Magento_Webapi::system_api_webapi_users') - ->_addBreadcrumb( - __('Web Services'), - __('Web Services') - ) - ->_addBreadcrumb( - __('API Users'), - __('API Users') - ); - - return $this; - } - - /** - * Show web API users grid. - */ - public function indexAction() - { - $this->_initAction(); - $this->_title->add(__('API Users')); - - $this->_view->renderLayout(); - } - - /** - * Create New Web API user. - */ - public function newAction() - { - $this->getRequest()->setParam('user_id', null); - $this->_forward('edit'); - } - - /** - * Edit Web API user. - */ - public function editAction() - { - $this->_initAction(); - $this->_title->add(__('API Users')); - - $userId = (int)$this->getRequest()->getParam('user_id'); - $user = $this->_loadApiUser($userId); - if (!$user) { - return; - } - - // Update title and breadcrumb record. - $actionTitle = $user->getId() - ? $this->_objectManager->get('Magento\Escaper')->escapeHtml($user->getApiKey()) - : __('New API User'); - $this->_title->add($actionTitle); - $this->_addBreadcrumb($actionTitle, $actionTitle); - - // Restore previously entered form data from session. - $data = $this->_getSession()->getWebapiUserData(true); - if (!empty($data)) { - $user->setData($data); - } - - /** @var \Magento\Webapi\Block\Adminhtml\User\Edit $editBlock */ - $editBlock = $this->_view->getLayout()->getBlock('webapi.user.edit'); - if ($editBlock) { - $editBlock->setApiUser($user); - } - /** @var \Magento\Webapi\Block\Adminhtml\User\Edit\Tabs $tabsBlock */ - $tabsBlock = $this->_view->getLayout()->getBlock('webapi.user.edit.tabs'); - if ($tabsBlock) { - $tabsBlock->setApiUser($user); - } - - $this->_view->renderLayout(); - } - - /** - * Save Web API user. - */ - public function saveAction() - { - $userId = (int)$this->getRequest()->getPost('user_id'); - $data = $this->getRequest()->getPost(); - $redirectBack = false; - if ($data) { - $user = $this->_loadApiUser($userId); - if (!$user) { - return; - } - - $user->setData($data); - try { - $this->_validateUserData($user); - $user->save(); - $userId = $user->getId(); - - $this->_getSession() - ->setWebapiUserData(null) - ->addSuccess(__('The API user has been saved.')); - $redirectBack = $this->getRequest()->has('back'); - } catch (\Magento\Core\Exception $e) { - $this->_getSession() - ->setWebapiUserData($data) - ->addError($e->getMessage()); - $redirectBack = true; - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Logger')->logException($e); - $this->_getSession() - ->setWebapiUserData($data) - ->addError($e->getMessage()); - $redirectBack = true; - } - } - if ($redirectBack) { - $this->_redirect('adminhtml/*/edit', array('user_id' => $userId)); - } else { - $this->_redirect('adminhtml/*/'); - } - } - - /** - * Delete user. - */ - public function deleteAction() - { - $userId = (int)$this->getRequest()->getParam('user_id'); - if ($userId) { - $user = $this->_loadApiUser($userId); - if (!$user) { - return; - } - try { - $user->delete(); - - $this->_getSession()->addSuccess( - __('The API user has been deleted.') - ); - $this->_redirect('adminhtml/*/'); - return; - } catch (\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - $this->_redirect('adminhtml/*/edit', array('user_id' => $userId)); - return; - } - } - $this->_getSession()->addError( - __('Unable to find a user to be deleted.') - ); - $this->_redirect('adminhtml/*/'); - } - - /** - * AJAX Web API users grid. - */ - public function gridAction() - { - $this->_view->loadLayout(false); - $this->_view->renderLayout(); - } - - /** - * Web API user roles grid. - */ - public function rolesgridAction() - { - $this->_view->loadLayout(false); - $this->_view->renderLayout(); - } - - /** - * Check ACL. - * - * @return boolean - */ - protected function _isAllowed() - { - return $this->_authorization->isAllowed('Magento_Webapi::webapi_users'); - } - - /** - * Validate Web API user data. - * - * @param \Magento\Webapi\Model\Acl\User $user - * @throws \Magento\Validator\ValidatorException - */ - protected function _validateUserData($user) - { - $group = $user->isObjectNew() ? 'create' : 'update'; - $validator = $this->_validatorFactory->createValidator('api_user', $group); - if (!$validator->isValid($user)) { - throw new \Magento\Validator\ValidatorException($validator->getMessages()); - } - } - - /** - * Load Web API user. - * - * @param int $userId - * @return bool|\Magento\Webapi\Model\Acl\User - */ - protected function _loadApiUser($userId) - { - /** @var \Magento\Webapi\Model\Acl\User $user */ - $user = $this->_objectManager->create('Magento\Webapi\Model\Acl\User')->load($userId); - if (!$user->getId() && $userId) { - $this->_getSession()->addError( - __('This user no longer exists.') - ); - $this->_redirect('adminhtml/*/'); - return false; - } - return $user; - } -} diff --git a/app/code/Magento/Webapi/Controller/Request.php b/app/code/Magento/Webapi/Controller/Request.php index 0e951a658b319..78645513aace8 100644 --- a/app/code/Magento/Webapi/Controller/Request.php +++ b/app/code/Magento/Webapi/Controller/Request.php @@ -27,6 +27,9 @@ class Request extends \Zend_Controller_Request_Http implements \Magento\App\RequestInterface { + /** @var int */ + protected $_consumerId = 0; + /** * Modify pathInfo: strip down the front name and query parameters. * @@ -47,4 +50,24 @@ public function __construct( /** Remove GET parameters from path */ $this->_pathInfo = preg_replace('#\?.*#', '', $this->_pathInfo); } + + /** + * Set consumer ID. + * + * @param int $consumerId + */ + public function setConsumerId($consumerId) + { + $this->_consumerId = $consumerId; + } + + /** + * Get consumer ID. + * + * @return int + */ + public function getConsumerId() + { + return $this->_consumerId; + } } diff --git a/app/code/Magento/Webapi/Controller/Rest.php b/app/code/Magento/Webapi/Controller/Rest.php index ab2be5435ad97..a65933a313cc2 100644 --- a/app/code/Magento/Webapi/Controller/Rest.php +++ b/app/code/Magento/Webapi/Controller/Rest.php @@ -1,7 +1,5 @@ _router = $router; $this->_request = $request; @@ -73,6 +85,7 @@ public function __construct( $this->_appState = $appState; $this->_oauthService = $oauthService; $this->_oauthHelper = $oauthHelper; + $this->_authorizationService = $authorizationService; } /** @@ -100,15 +113,30 @@ public function dispatch(\Magento\App\RequestInterface $request) if (!$this->_appState->isInstalled()) { throw new \Magento\Webapi\Exception(__('Magento is not yet installed')); } + // TODO: Consider changing service interface to operate with objects to avoid overhead $requestUrl = $this->_oauthHelper->getRequestUrl($this->_request); $oauthRequest = $this->_oauthHelper->prepareRequest( $this->_request, $requestUrl, $this->_request->getRequestData() ); - $this->_oauthService->validateAccessTokenRequest( + $consumerId = $this->_oauthService->validateAccessTokenRequest( $oauthRequest, $requestUrl, $this->_request->getMethod() ); + $this->_request->setConsumerId($consumerId); + $route = $this->_router->match($this->_request); + if (!$this->_authorizationService->isAllowed($route->getAclResources())) { + // TODO: Consider passing Integration ID instead of Consumer ID + throw new \Magento\Service\AuthorizationException( + "Not Authorized.", + 0, + null, + array(), + 'authorization', + "Consumer ID = {$consumerId}", + implode($route->getAclResources(), ', ')); + } + if ($route->isSecure() && !$this->_request->isSecure()) { throw new \Magento\Webapi\Exception(__('Operation allowed only in HTTPS')); } diff --git a/app/code/Magento/Webapi/Controller/Rest/Router/Route.php b/app/code/Magento/Webapi/Controller/Rest/Router/Route.php index 50b5b8964ba5f..3d6018838a179 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Router/Route.php +++ b/app/code/Magento/Webapi/Controller/Rest/Router/Route.php @@ -36,6 +36,9 @@ class Route extends \Zend_Controller_Router_Route /** @var boolean */ protected $_secure; + /** @var array */ + protected $_aclResources = array(); + /** * Set service class. * @@ -102,6 +105,26 @@ public function isSecure() return $this->_secure; } + /** + * Set ACL resources list. + * + * @param array $aclResources + */ + public function setAclResources($aclResources) + { + $this->_aclResources = $aclResources; + } + + /** + * Get ACL resources list. + * + * @return array + */ + public function getAclResources() + { + return $this->_aclResources; + } + /** * Matches a Request with parts defined by a map. Assigns and * returns an array of variables on a successful match. diff --git a/app/code/Magento/Webapi/Controller/Soap.php b/app/code/Magento/Webapi/Controller/Soap.php index b326d47dc3a32..0250903e6e514 100644 --- a/app/code/Magento/Webapi/Controller/Soap.php +++ b/app/code/Magento/Webapi/Controller/Soap.php @@ -25,6 +25,9 @@ */ namespace Magento\Webapi\Controller; +use Magento\Webapi\Exception as WebapiException; +use Magento\Service\AuthorizationException; + /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -114,7 +117,7 @@ public function dispatch(\Magento\App\RequestInterface $request) $request->setPathInfo('/' . implode('/', $pathParts)); try { if (!$this->_appState->isInstalled()) { - throw new \Magento\Webapi\Exception(__('Magento is not yet installed')); + throw new WebapiException(__('Magento is not yet installed')); } if ($this->_isWsdlRequest()) { $responseBody = $this->_wsdlGenerator->generate( @@ -123,7 +126,8 @@ public function dispatch(\Magento\App\RequestInterface $request) ); $this->_setResponseContentType(self::CONTENT_TYPE_WSDL_REQUEST); } else { - $this->_oauthService->validateAccessToken($this->_getAccessToken()); + $consumerId = $this->_oauthService->validateAccessToken($this->_getAccessToken()); + $this->_request->setConsumerId($consumerId); $responseBody = $this->_soapServer->handle(); $this->_setResponseContentType(self::CONTENT_TYPE_SOAP_CALL); } @@ -145,15 +149,21 @@ protected function _isWsdlRequest() } /** - * Parse the Authorization header and return the access token - * eg Authorization: Bearer + * Parse the Authorization header and return the access token e.g. Authorization: Bearer * * @return string Access token + * @throws AuthorizationException */ protected function _getAccessToken() { - $token = explode(' ', $_SERVER['HTTP_AUTHORIZATION']); - return $token[1]; + if (isset($_SERVER['HTTP_AUTHORIZATION'])) { + $token = explode(' ', $_SERVER['HTTP_AUTHORIZATION']); + if (isset($token[1]) && is_string($token[1])) { + return $token[1]; + } + throw new AuthorizationException(__('Authentication header format is invalid.')); + } + throw new AuthorizationException(__('Authentication header is absent.')); } /** diff --git a/app/code/Magento/Webapi/Controller/Soap/Handler.php b/app/code/Magento/Webapi/Controller/Soap/Handler.php index ec4a301ceed13..d06fc11c2bcba 100644 --- a/app/code/Magento/Webapi/Controller/Soap/Handler.php +++ b/app/code/Magento/Webapi/Controller/Soap/Handler.php @@ -1,9 +1,5 @@ _request = $request; $this->_objectManager = $objectManager; $this->_apiConfig = $apiConfig; + $this->_authorizationService = $authorizationService; } /** @@ -63,20 +77,33 @@ public function __construct( * @param string $operation * @param array $arguments * @return \stdClass|null - * @throws \Magento\Webapi\Exception|\LogicException + * @throws WebapiException + * @throws \LogicException + * @throws AuthorizationException */ public function __call($operation, $arguments) { $requestedServices = $this->_request->getRequestedServices(); $serviceMethodInfo = $this->_apiConfig->getServiceMethodInfo($operation, $requestedServices); - $serviceClass = $serviceMethodInfo[\Magento\Webapi\Model\Soap\Config::KEY_CLASS]; - $serviceMethod = $serviceMethodInfo[\Magento\Webapi\Model\Soap\Config::KEY_METHOD]; + $serviceClass = $serviceMethodInfo[SoapConfig::KEY_CLASS]; + $serviceMethod = $serviceMethodInfo[SoapConfig::KEY_METHOD]; // check if the operation is a secure operation & whether the request was made in HTTPS - if ($serviceMethodInfo[\Magento\Webapi\Model\Soap\Config::KEY_IS_SECURE] && !$this->_request->isSecure()) { - throw new \Magento\Webapi\Exception(__("Operation allowed only in HTTPS")); + if ($serviceMethodInfo[SoapConfig::KEY_IS_SECURE] && !$this->_request->isSecure()) { + throw new WebapiException(__("Operation allowed only in HTTPS")); } + if (!$this->_authorizationService->isAllowed($serviceMethodInfo[SoapConfig::KEY_ACL_RESOURCES])) { + // TODO: Consider passing Integration ID instead of Consumer ID + throw new AuthorizationException( + "Not Authorized.", + 0, + null, + array(), + 'authorization', + "Consumer ID = {$this->_request->getConsumerId()}", + implode($serviceMethodInfo[SoapConfig::KEY_ACL_RESOURCES], ', ')); + } $service = $this->_objectManager->get($serviceClass); $outputData = $service->$serviceMethod($this->_prepareParameters($arguments)); if (!is_array($outputData)) { diff --git a/app/code/Magento/Webapi/Model/Acl/Builder.php b/app/code/Magento/Webapi/Model/Acl/Builder.php deleted file mode 100644 index 06692277d7920..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Builder.php +++ /dev/null @@ -1,46 +0,0 @@ -query('/config/mapping/resource') as $mappingNode) { - $mappingData = array(); - $mappingAttributes = $mappingNode->attributes; - $idNode = $mappingAttributes->getNamedItem('id'); - if (is_null($idNode)) { - throw new \Exception('Attribute "id" is required for ACL resource mapping.'); - } - $mappingData['id'] = $idNode->nodeValue; - - $parentNode = $mappingAttributes->getNamedItem('parent'); - if (is_null($parentNode)) { - throw new \Exception('Attribute "parent" is required for ACL resource mapping.'); - } - $mappingData['parent'] = $parentNode->nodeValue; - $aclResourceConfig['config']['mapping'][] = $mappingData; - } - return $aclResourceConfig; - } -} - diff --git a/app/code/Magento/Webapi/Model/Acl/Resource/Config/Reader/Filesystem.php b/app/code/Magento/Webapi/Model/Acl/Resource/Config/Reader/Filesystem.php deleted file mode 100644 index 833ba2a45c410..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Resource/Config/Reader/Filesystem.php +++ /dev/null @@ -1,51 +0,0 @@ -_schema = $moduleReader->getModuleDir('etc', 'Magento_Webapi') . DIRECTORY_SEPARATOR . 'acl.xsd'; - } - - /** - * Get path to merged config schema - * - * @return string|null - */ - public function getSchema() - { - return $this->_schema; - } - - /** - * Get path to pre file validation schema - * - * @return string|null - */ - public function getPerFileSchema() - { - return $this->_perFileSchema; - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/Resource/Provider.php b/app/code/Magento/Webapi/Model/Acl/Resource/Provider.php deleted file mode 100644 index f700a4c825182..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Resource/Provider.php +++ /dev/null @@ -1,78 +0,0 @@ -_configReader = $configReader; - $this->_scope = $scope; - $this->_resourceTreeBuilder = $resourceTreeBuilder; - } - - /** - * {@inheritdoc} - */ - public function getAclResources() - { - $aclResourceConfig = $this->_configReader->read(); - if (!empty($aclResourceConfig['config']['acl']['resources'])) { - return $this->_resourceTreeBuilder->build($aclResourceConfig['config']['acl']['resources']); - } - return array(); - } - - /** - * {@inheritdoc} - */ - public function getAclVirtualResources() - { - $aclResourceConfig = $this->_configReader->read(); - return isset($aclResourceConfig['config']['mapping']) ? $aclResourceConfig['config']['mapping'] : array(); - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/Resource/ProviderInterface.php b/app/code/Magento/Webapi/Model/Acl/Resource/ProviderInterface.php deleted file mode 100644 index 76ab71017bdd3..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Resource/ProviderInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -_init('Magento\Webapi\Model\Resource\Acl\Role'); - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/Role/Factory.php b/app/code/Magento/Webapi/Model/Acl/Role/Factory.php deleted file mode 100644 index eb23babb62278..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Role/Factory.php +++ /dev/null @@ -1,55 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create ACL role model. - * - * @param array $arguments - * @return \Magento\Webapi\Model\Acl\Role - */ - public function create(array $arguments = array()) - { - return $this->_objectManager->create(self::CLASS_NAME, $arguments); - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/Role/InRoleUserUpdater.php b/app/code/Magento/Webapi/Model/Acl/Role/InRoleUserUpdater.php deleted file mode 100644 index 76b6d57ce5b58..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Role/InRoleUserUpdater.php +++ /dev/null @@ -1,67 +0,0 @@ -_roleId = (int)$request->getParam('role_id'); - $this->_userResource = $userResource; - } - - /** - * Init values with users assigned to role. - * - * @param array|null $values - * @return array|null - */ - public function update($values) - { - if ($this->_roleId) { - $values = $this->_userResource->getRoleUsers($this->_roleId); - } - return $values; - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/Role/UsersUpdater.php b/app/code/Magento/Webapi/Model/Acl/Role/UsersUpdater.php deleted file mode 100644 index cefc4bfa97039..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Role/UsersUpdater.php +++ /dev/null @@ -1,111 +0,0 @@ -_roleId = (int)$request->getParam('role_id'); - $this->_inRoleUsersFilter = $this->_parseInRoleUsersFilter($request, $backendHelper); - } - - /** - * Parse $_inRoleUsersFilter value from request - * - * @param \Magento\App\RequestInterface $request - * @param \Magento\Backend\Helper\Data $backendHelper - * @return int - */ - protected function _parseInRoleUsersFilter( - \Magento\App\RequestInterface $request, - \Magento\Backend\Helper\Data $backendHelper - ) { - $result = self::IN_ROLE_USERS_ANY; - $filter = $backendHelper->prepareFilterString($request->getParam('filter', '')); - if (isset($filter[self::IN_ROLE_USERS_PARAMETER])) { - $result = $filter[self::IN_ROLE_USERS_PARAMETER] ? self::IN_ROLE_USERS_YES : self::IN_ROLE_USERS_NO; - } elseif (!$request->isAjax()) { - $result = self::IN_ROLE_USERS_YES; - } - return $result; - } - - /** - * Add filtering users by role. - * - * @param \Magento\Webapi\Model\Resource\Acl\User\Collection $collection - * @return \Magento\Webapi\Model\Resource\Acl\User\Collection - */ - public function update($collection) - { - if ($this->_roleId) { - switch ($this->_inRoleUsersFilter) { - case self::IN_ROLE_USERS_YES: - $collection->addFieldToFilter('role_id', $this->_roleId); - break; - case self::IN_ROLE_USERS_NO: - $collection->addFieldToFilter('role_id', array( - array('neq' => $this->_roleId), - array('is' => new \Zend_Db_Expr('NULL')) - )); - break; - } - } - return $collection; - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/Rule.php b/app/code/Magento/Webapi/Model/Acl/Rule.php deleted file mode 100644 index 5bfd02e78003e..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Rule.php +++ /dev/null @@ -1,62 +0,0 @@ -_init('Magento\Webapi\Model\Resource\Acl\Rule'); - } - - /** - * Save role resources. - * - * @return \Magento\Webapi\Model\Acl\Rule - */ - public function saveResources() - { - $this->getResource()->saveResources($this); - return $this; - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/Rule/Factory.php b/app/code/Magento/Webapi/Model/Acl/Rule/Factory.php deleted file mode 100644 index abac37a3fc7c8..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/Rule/Factory.php +++ /dev/null @@ -1,55 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create a new instance of \Magento\Webapi\Model\Acl\Rule - * - * @param array $arguments fed into constructor - * @return \Magento\Webapi\Model\Acl\Rule - */ - public function create(array $arguments = array()) - { - return $this->_objectManager->create('Magento\Webapi\Model\Acl\Rule', $arguments); - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/User.php b/app/code/Magento/Webapi/Model/Acl/User.php deleted file mode 100644 index a7765f45acfa5..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/User.php +++ /dev/null @@ -1,106 +0,0 @@ -_init('Magento\Webapi\Model\Resource\Acl\User'); - } - - /** - * Get role users. - * - * @param integer $roleId - * @return array - */ - public function getRoleUsers($roleId) - { - return $this->getResource()->getRoleUsers($roleId); - } - - /** - * Load user by key. - * - * @param string $key - * @return \Magento\Webapi\Model\Acl\User - */ - public function loadByKey($key) - { - return $this->load($key, 'api_key'); - } - - /** - * Get consumer key. - * - * @return string - */ - public function getKey() - { - return $this->getData('key'); - } - - /** - * Get consumer secret. - * - * @return string - */ - public function getSecret() - { - return $this->getData('secret'); - } - - /** - * Get consumer callback URL. - * - * @return string - */ - public function getCallBackUrl() - { - return ''; - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/User/Factory.php b/app/code/Magento/Webapi/Model/Acl/User/Factory.php deleted file mode 100644 index 142afb7de4437..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/User/Factory.php +++ /dev/null @@ -1,55 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create ACL user model. - * - * @param array $arguments - * @return \Magento\Webapi\Model\Acl\User - */ - public function create(array $arguments = array()) - { - return $this->_objectManager->create(self::CLASS_NAME, $arguments); - } -} diff --git a/app/code/Magento/Webapi/Model/Acl/User/RoleUpdater.php b/app/code/Magento/Webapi/Model/Acl/User/RoleUpdater.php deleted file mode 100644 index 5e3b3e310098b..0000000000000 --- a/app/code/Magento/Webapi/Model/Acl/User/RoleUpdater.php +++ /dev/null @@ -1,67 +0,0 @@ -_userId = (int)$request->getParam('user_id'); - $this->_userFactory = $userFactory; - } - - /** - * Initialize value with role assigned to user. - * - * @param int|null $value - * @return int|null - */ - public function update($value) - { - if ($this->_userId) { - $value = $this->_userFactory->create()->load($this->_userId)->getRoleId(); - } - return $value; - } -} diff --git a/app/code/Magento/Webapi/Model/Authorization/Loader/Resource.php b/app/code/Magento/Webapi/Model/Authorization/Loader/Resource.php deleted file mode 100644 index 5f8268c04bbda..0000000000000 --- a/app/code/Magento/Webapi/Model/Authorization/Loader/Resource.php +++ /dev/null @@ -1,87 +0,0 @@ -getResources() as $aclResource) { - $acl->deny(null, $aclResource); - } - } - - /** - * Load virtual resources as sub-resources of existing one. - * - * @param \Magento\Acl $acl - */ - protected function _loadVirtualResources(\Magento\Acl $acl) - { - $virtualResources = $this->_resourceProvider->getAclVirtualResources(); - foreach ($virtualResources as $virtualResource) { - $resourceParent = $virtualResource['parent']; - $resourceId = $virtualResource['id']; - if ($acl->has($resourceParent) && !$acl->has($resourceId)) { - /** @var $resource \Magento\Acl\Resource */ - $resource = $this->_resourceFactory->createResource(array('resourceId' => $resourceId)); - $acl->addResource($resource, $resourceParent); - } - } - } - - /** - * Populate ACL with resources from external storage. - * - * @param \Magento\Acl $acl - * @throws \Magento\Core\Exception - */ - public function populateAcl(\Magento\Acl $acl) - { - parent::populateAcl($acl); - $this->_denyResources($acl); - $this->_loadVirtualResources($acl); - } -} diff --git a/app/code/Magento/Webapi/Model/Authorization/Loader/Role.php b/app/code/Magento/Webapi/Model/Authorization/Loader/Role.php deleted file mode 100644 index b7ef7cb2db90f..0000000000000 --- a/app/code/Magento/Webapi/Model/Authorization/Loader/Role.php +++ /dev/null @@ -1,72 +0,0 @@ -_roleResource = $roleResource; - $this->_roleFactory = $roleFactory; - } - - /** - * Populate ACL with roles from external storage. - * - * @param \Magento\Acl $acl - */ - public function populateAcl(\Magento\Acl $acl) - { - $roleList = $this->_roleResource->getRolesIds(); - foreach ($roleList as $roleId) { - /** @var $aclRole \Magento\Webapi\Model\Authorization\Role */ - $aclRole = $this->_roleFactory->createRole(array('roleId' => $roleId)); - $acl->addRole($aclRole); - //Deny all privileges to Role. Some of them could be allowed later by whitelist - $acl->deny($aclRole); - } - } -} diff --git a/app/code/Magento/Webapi/Model/Authorization/Loader/Rule.php b/app/code/Magento/Webapi/Model/Authorization/Loader/Rule.php deleted file mode 100644 index ab355186a9b65..0000000000000 --- a/app/code/Magento/Webapi/Model/Authorization/Loader/Rule.php +++ /dev/null @@ -1,59 +0,0 @@ -_ruleResource = $ruleResource; - } - - /** - * Populate ACL with rules from external storage. - * - * @param \Magento\Acl $acl - */ - public function populateAcl(\Magento\Acl $acl) - { - $ruleList = $this->_ruleResource->getRuleList(); - foreach ($ruleList as $rule) { - $role = $rule['role_id']; - $resource = $rule['resource_id']; - if ($acl->hasRole($role) && $acl->has($resource)) { - $acl->allow($role, $resource); - } - } - } -} diff --git a/app/code/Magento/Webapi/Model/Authorization/Policy/Acl.php b/app/code/Magento/Webapi/Model/Authorization/Policy/Acl.php deleted file mode 100644 index cd41a0c046cef..0000000000000 --- a/app/code/Magento/Webapi/Model/Authorization/Policy/Acl.php +++ /dev/null @@ -1,37 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Return new ACL role model. - * - * @param array $arguments - * @return \Magento\Webapi\Model\Authorization\Role - */ - public function createRole(array $arguments = array()) - { - return $this->_objectManager->create(self::ROLE_CLASS_NAME, $arguments); - } -} diff --git a/app/code/Magento/Webapi/Model/Authorization/Role/Locator/Factory.php b/app/code/Magento/Webapi/Model/Authorization/Role/Locator/Factory.php deleted file mode 100644 index f097c59156eea..0000000000000 --- a/app/code/Magento/Webapi/Model/Authorization/Role/Locator/Factory.php +++ /dev/null @@ -1,55 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create a new instance of \Magento\Webapi\Model\Authorization\RoleLocator - * - * @param array $arguments fed into constructor - * @return \Magento\Webapi\Model\Authorization\RoleLocator - */ - public function create(array $arguments = array()) - { - return $this->_objectManager->create('Magento\Webapi\Model\Authorization\RoleLocator', $arguments); - } -} diff --git a/app/code/Magento/Webapi/Model/Authorization/RoleLocator.php b/app/code/Magento/Webapi/Model/Authorization/RoleLocator.php deleted file mode 100644 index 807e21789f740..0000000000000 --- a/app/code/Magento/Webapi/Model/Authorization/RoleLocator.php +++ /dev/null @@ -1,64 +0,0 @@ -_roleId = isset($data['roleId']) ? $data['roleId'] : null; - } - - /** - * Set role ID into role locator. - * - * @param string $roleId - */ - public function setRoleId($roleId) - { - $this->_roleId = $roleId; - } - - /** - * Retrieve current role. - * - * @return string|null - */ - public function getAclRoleId() - { - return $this->_roleId; - } -} diff --git a/app/code/Magento/Webapi/Model/Authz/UserLocator.php b/app/code/Magento/Webapi/Model/Authz/UserLocator.php new file mode 100644 index 0000000000000..b21568822c710 --- /dev/null +++ b/app/code/Magento/Webapi/Model/Authz/UserLocator.php @@ -0,0 +1,72 @@ +_request = $request; + $this->_integrationFactory = $integrationFactory; + } + + /** + * {@inheritdoc} + */ + public function getUserId() + { + $consumerId = $this->_request->getConsumerId(); + $integration = $this->_integrationFactory->create()->loadByConsumerId($consumerId); + return $integration->getId() ? (int)$integration->getId() : 0; + } + + /** + * {@inheritdoc} + */ + public function getUserType() + { + return UserIdentifier::USER_TYPE_INTEGRATION; + } +} diff --git a/app/code/Magento/Webapi/Model/Config/Converter.php b/app/code/Magento/Webapi/Model/Config/Converter.php index 9a513f7420877..b237fe0fbe1b6 100644 --- a/app/code/Magento/Webapi/Model/Config/Converter.php +++ b/app/code/Magento/Webapi/Model/Config/Converter.php @@ -38,6 +38,7 @@ class Converter implements \Magento\Config\ConverterInterface const KEY_HTTP_METHOD = 'httpMethod'; const KEY_SERVICE_METHODS = 'methods'; const KEY_METHOD_ROUTE = 'route'; + const KEY_ACL_RESOURCES = 'resources'; /**#@-*/ /** @@ -74,6 +75,12 @@ public function convert($source) } $httpMethod = $restRoute->attributes->getNamedItem('httpMethod')->nodeValue; $method = $restRoute->attributes->getNamedItem('method')->nodeValue; + + $resources = $restRoute->attributes->getNamedItem('resources')->nodeValue; + /** Allow whitespace usage after comma. */ + $resources = str_replace(', ', ',', $resources); + $resources = explode(',', $resources); + $isSecureAttribute = $restRoute->attributes->getNamedItem('isSecure'); $isSecure = $isSecureAttribute ? true : false; $path = (string)$restRoute->nodeValue; @@ -82,7 +89,8 @@ public function convert($source) self::KEY_HTTP_METHOD => $httpMethod, self::KEY_SERVICE_METHOD => $method, self::KEY_METHOD_ROUTE => $path, - self::KEY_IS_SECURE => $isSecure + self::KEY_IS_SECURE => $isSecure, + self::KEY_ACL_RESOURCES => $resources ); } } diff --git a/app/code/Magento/Webapi/Model/Config/Integration/Reader.php b/app/code/Magento/Webapi/Model/Config/Integration/Reader.php index 8464c16404f54..7a8637f50d7f9 100644 --- a/app/code/Magento/Webapi/Model/Config/Integration/Reader.php +++ b/app/code/Magento/Webapi/Model/Config/Integration/Reader.php @@ -40,18 +40,33 @@ class Reader extends \Magento\Config\Reader\Filesystem /** * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Webapi\Model\Config\Integration\Converter $converter - * @param \Magento\Webapi\Model\Config\Integration\SchemaLocator $schemeLocator + * @param Converter $converter + * @param SchemaLocator $schemaLocator * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, \Magento\Webapi\Model\Config\Integration\Converter $converter, - \Magento\Webapi\Model\Config\Integration\SchemaLocator $schemeLocator, + \Magento\Webapi\Model\Config\Integration\SchemaLocator $schemaLocator, \Magento\Config\ValidationStateInterface $validationState, - $fileName = 'integration\api.xml' + $fileName = 'integration\api.xml', + $idAttributes = array(), + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { - parent::__construct($fileResolver, $converter, $schemeLocator, $validationState, $fileName); + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope + ); } } diff --git a/app/code/Magento/Webapi/Model/Config/Reader.php b/app/code/Magento/Webapi/Model/Config/Reader.php index 345ba22dc3b69..95131fb9493f0 100644 --- a/app/code/Magento/Webapi/Model/Config/Reader.php +++ b/app/code/Magento/Webapi/Model/Config/Reader.php @@ -40,18 +40,33 @@ class Reader extends \Magento\Config\Reader\Filesystem /** * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Webapi\Model\Config\Converter $converter - * @param \Magento\Webapi\Model\Config\SchemaLocator $schemeLocator + * @param Converter $converter + * @param SchemaLocator $schemaLocator * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, \Magento\Webapi\Model\Config\Converter $converter, - \Magento\Webapi\Model\Config\SchemaLocator $schemeLocator, + \Magento\Webapi\Model\Config\SchemaLocator $schemaLocator, \Magento\Config\ValidationStateInterface $validationState, - $fileName = 'webapi.xml' + $fileName = 'webapi.xml', + $idAttributes = array(), + $domDocumentClass = 'Magento\Config\Dom', + $defaultScope = 'global' ) { - parent::__construct($fileResolver, $converter, $schemeLocator, $validationState, $fileName); + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope + ); } } diff --git a/app/code/Magento/Webapi/Model/Plugin/IntegrationServiceV1.php b/app/code/Magento/Webapi/Model/Plugin/IntegrationServiceV1.php new file mode 100644 index 0000000000000..2c132adb41942 --- /dev/null +++ b/app/code/Magento/Webapi/Model/Plugin/IntegrationServiceV1.php @@ -0,0 +1,157 @@ +_authzService = $authzService; + $this->_userIdentifierFactory = $userIdentifierFactory; + } + + /** + * Persist API permissions. + * + * @param IntegrationModel $integration + * @return IntegrationModel + */ + public function afterCreate($integration) + { + $this->_saveApiPermissions($integration); + return $integration; + } + + /** + * Persist API permissions. + * + * @param IntegrationModel $integration + * @return IntegrationModel + */ + public function afterUpdate($integration) + { + $this->_saveApiPermissions($integration); + return $integration; + } + + /** + * Add API permissions to integration data. + * + * @param IntegrationModel $integration + * @return IntegrationModel + */ + public function afterGet($integration) + { + $this->_addAllowedResources($integration); + return $integration; + } + + /** + * Add the list of allowed resources to the integration object data by 'resource' key. + * + * @param IntegrationModel $integration + */ + protected function _addAllowedResources(IntegrationModel $integration) + { + if ($integration->getId()) { + $userIdentifier = $this->_createUserIdentifier($integration->getId()); + $integration->setData('resource', $this->_authzService->getAllowedResources($userIdentifier)); + } + } + + /** + * Persist API permissions. + * + * Permissions are expected to be set to integration object by 'resource' key. + * If 'all_resources' is set and is evaluated to true, permissions to all resources will be granted. + * + * @param IntegrationModel $integration + */ + protected function _saveApiPermissions(IntegrationModel $integration) + { + if ($integration->getId()) { + $userIdentifier = $this->_createUserIdentifier($integration->getId()); + if ($integration->getData('all_resources')) { + $this->_authzService->grantAllPermissions($userIdentifier); + } else if (is_array($integration->getData('resource'))) { + $this->_authzService->grantPermissions($userIdentifier, $integration->getData('resource')); + } else { + $this->_authzService->grantPermissions($userIdentifier, array()); + } + } + } + + /** + * Instantiate new user identifier for an integration. + * + * @param int $integrationId + * @return UserIdentifier + */ + protected function _createUserIdentifier($integrationId) + { + $userIdentifier = $this->_userIdentifierFactory->create( + UserIdentifier::USER_TYPE_INTEGRATION, + (int)$integrationId + ); + return $userIdentifier; + } + + /** + * Process integration resource permissions after the integration is created + * + * @param array $integrationData Data of integration deleted + * @return array $integrationData + */ + public function afterDelete(array $integrationData) + { + //No check needed for integration data since it cannot be empty in the parent invocation - delete + $userIdentifier = $this->_userIdentifierFactory->create( + UserIdentifier::USER_TYPE_INTEGRATION, + (int)$integrationData[IntegrationModel::ID] + ); + $this->_authzService->removePermissions($userIdentifier); + return $integrationData; + } +} diff --git a/app/code/Magento/Webapi/Model/Plugin/Setup.php b/app/code/Magento/Webapi/Model/Plugin/Setup.php index cd58f6141dc22..3a8d2bfe8be6d 100644 --- a/app/code/Magento/Webapi/Model/Plugin/Setup.php +++ b/app/code/Magento/Webapi/Model/Plugin/Setup.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Webapi\Model\Plugin; use Magento\Authz\Model\UserIdentifier; @@ -65,8 +66,8 @@ class Setup * Construct Setup plugin instance * * @param \Magento\Webapi\Model\IntegrationConfig $integrationConfig - * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService * @param \Magento\Authz\Service\AuthorizationV1 $authzService + * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService * @param \Magento\Authz\Model\UserIdentifier\Factory $userIdentifierFactory */ public function __construct( @@ -96,11 +97,11 @@ public function afterInitIntegrationProcessing($integrationNames) $integrations = $this->_integrationConfig->getIntegrations(); foreach ($integrationNames as $name) { if (isset($integrations[$name])) { - $integrationData = $this->_integrationService->findByName($name); - if (isset($integrationData[Integration::ID])) { + $integration = $this->_integrationService->findByName($name); + if ($integration->getId()) { $userIdentifier = $this->_userIdentifierFactory->create( UserIdentifier::USER_TYPE_INTEGRATION, - (int)$integrationData[Integration::ID] + $integration->getId() ); $this->_authzService->grantPermissions( $userIdentifier, @@ -111,4 +112,4 @@ public function afterInitIntegrationProcessing($integrationNames) } return $integrationNames; } -} \ No newline at end of file +} diff --git a/app/code/Magento/Webapi/Model/Resource/Acl/Role.php b/app/code/Magento/Webapi/Model/Resource/Acl/Role.php deleted file mode 100644 index 91191d8f165f6..0000000000000 --- a/app/code/Magento/Webapi/Model/Resource/Acl/Role.php +++ /dev/null @@ -1,89 +0,0 @@ -_init('webapi_role', 'role_id'); - } - - /** - * Initialize unique fields. - * - * @return \Magento\Webapi\Model\Resource\Acl\Role - */ - protected function _initUniqueFields() - { - $this->_uniqueFields = array( - array( - 'field' => 'role_name', - 'title' => __('Role Name') - ), - ); - return $this; - } - - /** - * Get roles list for selects. - * - * @return array - */ - public function getRolesList() - { - $adapter = $this->getReadConnection(); - $select = $adapter->select() - ->from($this->getMainTable(), array($this->getIdFieldName(), 'role_name')) - ->order('role_name'); - return $adapter->fetchPairs($select); - } - - /** - * Get all roles IDs. - * - * @return array - */ - public function getRolesIds() - { - $adapter = $this->getReadConnection(); - $select = $adapter->select()->from($this->getMainTable(), array($this->getIdFieldName())); - return $adapter->fetchCol($select); - } -} diff --git a/app/code/Magento/Webapi/Model/Resource/Acl/Role/Collection.php b/app/code/Magento/Webapi/Model/Resource/Acl/Role/Collection.php deleted file mode 100644 index 82fbacd4c1e51..0000000000000 --- a/app/code/Magento/Webapi/Model/Resource/Acl/Role/Collection.php +++ /dev/null @@ -1,37 +0,0 @@ -_init('Magento\Webapi\Model\Acl\Role', 'Magento\Webapi\Model\Resource\Acl\Role'); - } -} diff --git a/app/code/Magento/Webapi/Model/Resource/Acl/Rule.php b/app/code/Magento/Webapi/Model/Resource/Acl/Rule.php deleted file mode 100644 index 6c448970dde7e..0000000000000 --- a/app/code/Magento/Webapi/Model/Resource/Acl/Rule.php +++ /dev/null @@ -1,109 +0,0 @@ -_init('webapi_rule', 'rule_id'); - } - - /** - * Get all rules from DB. - * - * @return array - */ - public function getRuleList() - { - $adapter = $this->getReadConnection(); - $select = $adapter->select()->from($this->getMainTable(), array('resource_id', 'role_id')); - return $adapter->fetchAll($select); - } - - /** - * Get resource IDs assigned to role. - * - * @param integer $roleId Web api user role ID - * @return array - */ - public function getResourceIdsByRole($roleId) - { - $adapter = $this->getReadConnection(); - $select = $adapter->select() - ->from($this->getMainTable(), array('resource_id')) - ->where('role_id = ?', (int)$roleId); - return $adapter->fetchCol($select); - } - - /** - * Save resources. - * - * @param \Magento\Webapi\Model\Acl\Rule $rule - * @throws \Exception - */ - public function saveResources(\Magento\Webapi\Model\Acl\Rule $rule) - { - $roleId = $rule->getRoleId(); - if ($roleId > 0) { - $adapter = $this->_getWriteAdapter(); - $adapter->beginTransaction(); - - try { - $adapter->delete($this->getMainTable(), array('role_id = ?' => (int)$roleId)); - - $resources = $rule->getResources(); - if ($resources) { - $resourcesToInsert = array(); - foreach ($resources as $resName) { - $resourcesToInsert[] = array( - 'role_id' => $roleId, - 'resource_id' => trim($resName) - ); - } - $adapter->insertArray( - $this->getMainTable(), - array('role_id', 'resource_id'), - $resourcesToInsert - ); - } - - $adapter->commit(); - } catch (\Exception $e) { - $adapter->rollBack(); - throw $e; - } - } - } -} diff --git a/app/code/Magento/Webapi/Model/Resource/Acl/Rule/Collection.php b/app/code/Magento/Webapi/Model/Resource/Acl/Rule/Collection.php deleted file mode 100644 index eb456d94c1624..0000000000000 --- a/app/code/Magento/Webapi/Model/Resource/Acl/Rule/Collection.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -namespace Magento\Webapi\Model\Resource\Acl\Rule; - -class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection -{ - /** - * Resource collection initialization. - */ - protected function _construct() - { - $this->_init('Magento\Webapi\Model\Acl\Rule', 'Magento\Webapi\Model\Resource\Acl\Rule'); - } - - /** - * Retrieve rules by role. - * - * @param int $roleId - * @return \Magento\Webapi\Model\Resource\Acl\Rule\Collection - */ - public function getByRole($roleId) - { - $this->getSelect()->where("role_id = ?", (int)$roleId); - return $this; - } -} diff --git a/app/code/Magento/Webapi/Model/Resource/Acl/User.php b/app/code/Magento/Webapi/Model/Resource/Acl/User.php deleted file mode 100644 index 19c31bbe61a9c..0000000000000 --- a/app/code/Magento/Webapi/Model/Resource/Acl/User.php +++ /dev/null @@ -1,78 +0,0 @@ -_init('webapi_user', 'user_id'); - } - - /** - * Initialize unique fields. - * - * @return \Magento\Webapi\Model\Resource\Acl\User - */ - protected function _initUniqueFields() - { - $this->_uniqueFields = array( - array( - 'field' => 'api_key', - 'title' => __('API Key') - ), - ); - return $this; - } - - /** - * Get role users. - * - * @param integer $roleId - * @return array - */ - public function getRoleUsers($roleId) - { - $adapter = $this->_getReadAdapter(); - $select = $adapter->select() - ->from($this->getMainTable(), array('user_id')) - ->where('role_id = ?', (int)$roleId); - return $adapter->fetchCol($select); - } -} diff --git a/app/code/Magento/Webapi/Model/Resource/Acl/User/Collection.php b/app/code/Magento/Webapi/Model/Resource/Acl/User/Collection.php deleted file mode 100644 index 626a4968ab674..0000000000000 --- a/app/code/Magento/Webapi/Model/Resource/Acl/User/Collection.php +++ /dev/null @@ -1,37 +0,0 @@ -_init('Magento\Webapi\Model\Acl\User', 'Magento\Webapi\Model\Resource\Acl\User'); - } -} diff --git a/app/code/Magento/Webapi/Model/Rest/Config.php b/app/code/Magento/Webapi/Model/Rest/Config.php index a9945dd7603de..0d4bf38d2769f 100644 --- a/app/code/Magento/Webapi/Model/Rest/Config.php +++ b/app/code/Magento/Webapi/Model/Rest/Config.php @@ -46,6 +46,7 @@ class Config const KEY_CLASS = 'class'; const KEY_METHOD = 'method'; const KEY_ROUTE_PATH = 'routePath'; + const KEY_ACL_RESOURCES = 'resources'; /*#@-*/ /** @var \Magento\Webapi\Model\Config */ @@ -88,7 +89,8 @@ protected function _createRoute($routeData) $route->setServiceClass($routeData[self::KEY_CLASS]) ->setServiceMethod($routeData[self::KEY_METHOD]) - ->setSecure($routeData[self::KEY_IS_SECURE]); + ->setSecure($routeData[self::KEY_IS_SECURE]) + ->setAclResources($routeData[self::KEY_ACL_RESOURCES]); return $route; } @@ -130,12 +132,14 @@ public function getRestRoutes(\Magento\Webapi\Controller\Rest\Request $request) if (strtoupper($methodInfo[Converter::KEY_HTTP_METHOD]) == strtoupper($httpMethod)) { $secure = $methodInfo[Converter::KEY_IS_SECURE]; $methodRoute = $methodInfo[Converter::KEY_METHOD_ROUTE]; + $aclResources = $methodInfo[Converter::KEY_ACL_RESOURCES]; $routes[] = $this->_createRoute( array( self::KEY_ROUTE_PATH => $serviceData[Converter::KEY_BASE_URL] . $methodRoute, self::KEY_CLASS => $serviceName, self::KEY_METHOD => $methodName, - self::KEY_IS_SECURE => $secure + self::KEY_IS_SECURE => $secure, + self::KEY_ACL_RESOURCES => $aclResources ) ); } diff --git a/app/code/Magento/Webapi/Model/Soap/Config.php b/app/code/Magento/Webapi/Model/Soap/Config.php index ba7e4285cfa6b..6dae7df7070f1 100644 --- a/app/code/Magento/Webapi/Model/Soap/Config.php +++ b/app/code/Magento/Webapi/Model/Soap/Config.php @@ -37,6 +37,7 @@ class Config const KEY_IS_SECURE = 'isSecure'; const KEY_METHOD = 'method'; const KEY_IS_REQUIRED = 'inputRequired'; + const KEY_ACL_RESOURCES = 'resources'; /**#@-*/ /** @var \Magento\Filesystem */ @@ -110,7 +111,8 @@ protected function _getSoapOperations($requestedService) $this->_soapOperations[$operationName] = array( self::KEY_CLASS => $class, self::KEY_METHOD => $method, - self::KEY_IS_SECURE => $methodData[Converter::KEY_IS_SECURE] + self::KEY_IS_SECURE => $methodData[Converter::KEY_IS_SECURE], + self::KEY_ACL_RESOURCES => $methodData[Converter::KEY_ACL_RESOURCES] ); } } @@ -132,16 +134,14 @@ protected function _getSoapServices() $this->_soapServices = array(); foreach ($this->_config->getServices() as $serviceData) { $serviceClass = $serviceData[Converter::KEY_SERVICE_CLASS]; - $reflection = new \ReflectionClass($serviceClass); - foreach ($reflection->getMethods() as $method) { - // find if method is secure, assume operation is not secure by default - $methodName = $method->getName(); - $isSecure = $serviceData[Converter::KEY_SERVICE_METHODS][$methodName][Converter::KEY_IS_SECURE]; + foreach ($serviceData[Converter::KEY_SERVICE_METHODS] as $methodMetadata) { // TODO: Simplify the structure in SOAP. Currently it is unified in SOAP and REST + $methodName = $methodMetadata[Converter::KEY_SERVICE_METHOD]; $this->_soapServices[$serviceClass]['methods'][$methodName] = array( self::KEY_METHOD => $methodName, - self::KEY_IS_REQUIRED => (bool)$method->getNumberOfParameters(), - self::KEY_IS_SECURE => $isSecure + self::KEY_IS_REQUIRED => (bool)$methodMetadata[Converter::KEY_IS_SECURE], + self::KEY_IS_SECURE => $methodMetadata[Converter::KEY_IS_SECURE], + self::KEY_ACL_RESOURCES => $methodMetadata[Converter::KEY_ACL_RESOURCES] ); $this->_soapServices[$serviceClass][self::KEY_CLASS] = $serviceClass; }; @@ -171,7 +171,8 @@ public function getServiceMethodInfo($soapOperation, $requestedServices) return array( self::KEY_CLASS => $soapOperations[$soapOperation][self::KEY_CLASS], self::KEY_METHOD => $soapOperations[$soapOperation][self::KEY_METHOD], - self::KEY_IS_SECURE => $soapOperations[$soapOperation][self::KEY_IS_SECURE] + self::KEY_IS_SECURE => $soapOperations[$soapOperation][self::KEY_IS_SECURE], + self::KEY_ACL_RESOURCES => $soapOperations[$soapOperation][self::KEY_ACL_RESOURCES] ); } diff --git a/app/code/Magento/Webapi/Model/Source/Acl/Role.php b/app/code/Magento/Webapi/Model/Source/Acl/Role.php deleted file mode 100644 index 7bbf690618429..0000000000000 --- a/app/code/Magento/Webapi/Model/Source/Acl/Role.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ -namespace Magento\Webapi\Model\Source\Acl; - -class Role implements \Magento\Core\Model\Option\ArrayInterface -{ - /** - * @var \Magento\Webapi\Model\Resource\Acl\Role - */ - protected $_resource = null; - - /** - * @param \Magento\Webapi\Model\Resource\Acl\RoleFactory $roleFactory - */ - public function __construct( - \Magento\Webapi\Model\Resource\Acl\RoleFactory $roleFactory - ) { - $this->_resource = $roleFactory->create(); - } - - /** - * Retrieve option hash of Web API Roles. - * - * @param bool $addEmpty - * @return array - */ - public function toOptionHash($addEmpty = true) - { - $options = $this->_resource->getRolesList(); - if ($addEmpty) { - $options = array('' => '') + $options; - } - return $options; - } - - /** - * Return option array. - * - * @return array - */ - public function toOptionArray() - { - $options = $this->_resource->getRolesList(); - return $options; - } -} diff --git a/app/code/Magento/Webapi/etc/acl.xsd b/app/code/Magento/Webapi/etc/acl.xsd deleted file mode 100644 index 88ff6a0b0e866..0000000000000 --- a/app/code/Magento/Webapi/etc/acl.xsd +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Attribute ID is unique under all ACL resources - - - - - - - - - - - - - - - - - - Attribute ID is unique under all mapped ACL resources - - - - - - - - - - - - - - - - - ACL Resource. Recursive complex type - - - - - - - - - - - - - - - - - ACL Resource mapping. - - - - - - - - - - - Item ID attribute can have only [A-Za-z0-9_]/[A-Za-z0-9_]. Minimal length is 3 symbols. Case insensitive. - - - - - - - - - - - - Item title attribute minimal length is 3 symbols - - - - - - - - - diff --git a/app/code/Magento/Webapi/etc/adminhtml/acl.xml b/app/code/Magento/Webapi/etc/adminhtml/acl.xml deleted file mode 100644 index c83409123c48a..0000000000000 --- a/app/code/Magento/Webapi/etc/adminhtml/acl.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webapi/etc/adminhtml/menu.xml b/app/code/Magento/Webapi/etc/adminhtml/menu.xml deleted file mode 100644 index 1bc1d041c30ec..0000000000000 --- a/app/code/Magento/Webapi/etc/adminhtml/menu.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Webapi/etc/adminhtml/routes.xml b/app/code/Magento/Webapi/etc/adminhtml/routes.xml deleted file mode 100644 index 1e67b3e7da102..0000000000000 --- a/app/code/Magento/Webapi/etc/adminhtml/routes.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Webapi/etc/config.xml b/app/code/Magento/Webapi/etc/config.xml deleted file mode 100644 index 95d7c45372b2f..0000000000000 --- a/app/code/Magento/Webapi/etc/config.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - diff --git a/app/code/Magento/Webapi/etc/di.xml b/app/code/Magento/Webapi/etc/di.xml index 4e87c64decd3c..3bb8d5606daeb 100644 --- a/app/code/Magento/Webapi/etc/di.xml +++ b/app/code/Magento/Webapi/etc/di.xml @@ -36,4 +36,11 @@ + + + + + + + diff --git a/app/code/Magento/Webapi/etc/module.xml b/app/code/Magento/Webapi/etc/module.xml index c1f25d2ac17c4..42ebeefa5ed0c 100755 --- a/app/code/Magento/Webapi/etc/module.xml +++ b/app/code/Magento/Webapi/etc/module.xml @@ -24,7 +24,7 @@ */ --> - + diff --git a/app/code/Magento/Webapi/etc/validation.xml b/app/code/Magento/Webapi/etc/validation.xml deleted file mode 100644 index 4b48169973820..0000000000000 --- a/app/code/Magento/Webapi/etc/validation.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webapi/etc/webapi.xsd b/app/code/Magento/Webapi/etc/webapi.xsd index 25017998aa7a6..05f6994271804 100644 --- a/app/code/Magento/Webapi/etc/webapi.xsd +++ b/app/code/Magento/Webapi/etc/webapi.xsd @@ -29,12 +29,12 @@ - + - + @@ -53,8 +53,14 @@ + + + + + + diff --git a/app/code/Magento/Webapi/etc/webapi_rest/di.xml b/app/code/Magento/Webapi/etc/webapi_rest/di.xml index e09556f0e5c8e..6e6562d31b7b1 100644 --- a/app/code/Magento/Webapi/etc/webapi_rest/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_rest/di.xml @@ -24,70 +24,14 @@ */ --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - api_acl_resources - - - - - Magento_Webapi + + + + + - - - - - - - - - - - - - - - - - - - @@ -149,5 +93,8 @@ + + + diff --git a/app/code/Magento/Webapi/etc/webapi_soap/di.xml b/app/code/Magento/Webapi/etc/webapi_soap/di.xml index d701f2aa35bdb..922a5cf8290e6 100644 --- a/app/code/Magento/Webapi/etc/webapi_soap/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_soap/di.xml @@ -24,70 +24,14 @@ */ --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - api_acl_resources - - - - - Magento_Webapi + + + + + - - - - - - - - - - - - - - - - - - - @@ -96,4 +40,9 @@ + + + + + diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/FormTest.php b/app/code/Magento/Webapi/sql/webapi_setup/upgrade-1.0.0.3-1.0.0.4.php similarity index 71% rename from dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/FormTest.php rename to app/code/Magento/Webapi/sql/webapi_setup/upgrade-1.0.0.3-1.0.0.4.php index a437ec65a01c5..6c4fb1191c118 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/FormTest.php +++ b/app/code/Magento/Webapi/sql/webapi_setup/upgrade-1.0.0.3-1.0.0.4.php @@ -1,6 +1,6 @@ startSetup(); +$connection = $installer->getConnection(); - /** - * @var \Magento\Webapi\Block\Adminhtml\Role\Edit\Form - */ - protected $_block; -} +$connection->dropTable($this->getTable('webapi_user')); +$connection->dropTable($this->getTable('webapi_rule')); +$connection->dropTable($this->getTable('webapi_role')); + +$installer->endSetup(); diff --git a/app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml b/app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml index ca5af5665540d..307cecb1194e6 100644 --- a/app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml +++ b/app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml @@ -27,29 +27,35 @@ */ ?>
    -
    -
    -
    + isTreeEmpty()): ?> +

    + +
    +
    +
    +
    -
    +
    - + }); + + diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml index a034a0812f23d..8750b4f826288 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -32,6 +32,12 @@ integration_edit_tab_webapi info_section + + + api_config_section + integration_config_edit_tab_webapi + api_section + diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit.xml deleted file mode 100644 index 148849bdee87b..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - 1 - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit_tab_users_grid_block.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit_tab_users_grid_block.xml deleted file mode 100644 index bde870c4131b2..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit_tab_users_grid_block.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - Magento\Webapi\Model\Acl\Role\UsersUpdater - - - - - - - roleUserGrid - Magento\Webapi\Model\Resource\Acl\User\Collection - true - role_user_id - ASC - - 1 - - - - Role Users Information - - - - 1 - - - - - - in_role_users - in_role_users - a-center - checkbox - - Magento\Webapi\Model\Acl\Role\InRoleUserUpdater - - - in_role_users - center - user_id - - - - - role_name - User ID - 20 - left - 1 - user_id - - - - - role_user_contactemail - Contact Email - left - contact_email - - - - - role_user_apikey - API Key - left - api_key - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_grid_block.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_grid_block.xml deleted file mode 100644 index 061a0cd186177..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_grid_block.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - webapiRoleGrid - Magento\Webapi\Model\Resource\Acl\Role\Collection - true - role_id - asc - - 1 - - - - - - */*/edit - - getId - - - No Roles Found - - - - ID - 80px - text - role_id - - - - - Role Name - role_name - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_index.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_index.xml deleted file mode 100644 index f817b2ceacb99..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_index.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_rolegrid.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_rolegrid.xml deleted file mode 100644 index 403d7ed6347d7..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_rolegrid.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_usersgrid.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_usersgrid.xml deleted file mode 100644 index de882e9a0779e..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_usersgrid.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit.xml deleted file mode 100644 index 06509e2bffc1b..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit_tab_roles_grid_block.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit_tab_roles_grid_block.xml deleted file mode 100644 index 3097b6eb3afa9..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit_tab_roles_grid_block.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - permissionsUserRolesGrid - Magento\Webapi\Model\Resource\Acl\Role\Collection - true - sort_order - ASC - - 1 - - - - User Roles Information - - - - permissionsUserRolesGrid - - - - role_id - role_id - role_id - Assigned - radio - a-center - center - 0 - 0 - 0 - - Magento\Webapi\Model\Acl\User\RoleUpdater - - - - - - - role_name - Role Name - role_name - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_grid.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_grid.xml deleted file mode 100644 index cebca6e0fdcc0..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_grid.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_grid_block.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_grid_block.xml deleted file mode 100644 index 226f096fa7f53..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_grid_block.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - permissionsUserGrid - Magento\Webapi\Model\Resource\Acl\User\Collection - true - user_name - asc - - 1 - - - - - - */*/edit - - getId - - - No Users Found - - - - ID - 80px - text - user_id - - - - - Contact Email - contact_email - - - - - API Key - api_key - - - - - Role Name - role_id - 200px - options - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_index.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_index.xml deleted file mode 100644 index 95ea54783ea90..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_index.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_rolesgrid.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_rolesgrid.xml deleted file mode 100644 index 61107e416f042..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_rolesgrid.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/rolesedit.phtml b/app/code/Magento/Webapi/view/adminhtml/rolesedit.phtml deleted file mode 100644 index 1dab3938ea5f2..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/rolesedit.phtml +++ /dev/null @@ -1,149 +0,0 @@ - - -
    - - - - -
    - -
    - - -
    - -
    -
    - -
    - - -
    -
    -
    -
    -
    - - - diff --git a/app/code/Magento/Webapi/view/adminhtml/rolesusersgridjs.phtml b/app/code/Magento/Webapi/view/adminhtml/rolesusersgridjs.phtml deleted file mode 100644 index 3399d3e9e0dfb..0000000000000 --- a/app/code/Magento/Webapi/view/adminhtml/rolesusersgridjs.phtml +++ /dev/null @@ -1,122 +0,0 @@ - -getLayout()->getBlock('webapi.role.edit.tab.users.grid'); ?> -getLayout()->getBlock('webapi.role.edit.tab.users.grid.columnSet.in_role_users'); ?> -getJsObjectName()): ?> - - diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webhook.php b/app/code/Magento/Webhook/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webhook.php deleted file mode 100644 index 3b71bab910f85..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webhook.php +++ /dev/null @@ -1,64 +0,0 @@ -_subscriptionData = $registry->registry(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION); - } - - /** - * Gets accept url - * - * @return string - */ - public function getAcceptUrl() - { - return $this->getUrl('adminhtml/*/accept', array('id' => $this->_subscriptionData[self::DATA_SUBSCRIPTION_ID])); - } - - /** - * Get subscription name - * - * @return string - */ - public function getSubscriptionName() - { - return $this->_subscriptionData[self::DATA_NAME]; - } - - /** - * Get list of topics for subscription - * - * @return string[] - */ - public function getSubscriptionTopics() - { - return $this->_subscriptionData[self::DATA_TOPICS]; - } -} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form.php b/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form.php deleted file mode 100644 index 1c63171b3fac6..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form.php +++ /dev/null @@ -1,122 +0,0 @@ -_coreRegistry->registry(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION); - $apiKey = $this->_generateRandomString(self::API_KEY_LENGTH); - $apiSecret = $this->_generateRandomString(self::API_SECRET_LENGTH); - $inputLength = max(self::API_KEY_LENGTH, self::API_SECRET_LENGTH, self::MIN_TEXT_INPUT_LENGTH); - - $form = $this->_formFactory->create(array( - 'attributes' => array( - 'id' => 'api_user', - 'action' => $this->getUrl( - 'adminhtml/*/register', array('id' => $subscription[self::DATA_SUBSCRIPTION_ID]) - ), - 'method' => 'post', - )) - ); - - $fieldset = $form; - - $fieldset->addField('company', 'text', array( - 'label' => __('Company'), - 'name' => 'company', - 'size' => $inputLength, - )); - - $fieldset->addField('email', 'text', array( - 'label' => __('Contact Email'), - 'name' => 'email', - 'class' => 'email', - 'required' => true, - 'size' => $inputLength, - )); - - $fieldset->addField('apikey', 'text', array( - 'label' => __('API Key'), - 'name' => 'apikey', - 'value' => $apiKey, - 'class' => 'monospace', - 'required' => true, - 'size' => $inputLength, - )); - - $fieldset->addField('apisecret', 'text', array( - 'label' => __('API Secret'), - 'name' => 'apisecret', - 'value' => $apiSecret, - 'class' => 'monospace', - 'required' => true, - 'size' => $inputLength, - )); - - $form->setUseContainer(true); - - $this->setForm($form); - - return parent::_prepareForm(); - } - - /** - * Generates a random alphanumeric string - * - * @param int $length - * @return string - */ - private function _generateRandomString($length) - { - return $this->mathRandom->getRandomString( - $length, \Magento\Math\Random::CHARS_DIGITS . \Magento\Math\Random::CHARS_LOWERS - ); - } -} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/Container.php b/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/Container.php deleted file mode 100644 index bac3dfadbab2e..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/Container.php +++ /dev/null @@ -1,77 +0,0 @@ -_subscriptionData = $registry->registry(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION);; - } - - /** - * Gets submit url - * - * @return string Form url - */ - public function getSubmitUrl() - { - return $this->getUrl( - 'adminhtml/*/register', array('id' => $this->_subscriptionData[self::DATA_SUBSCRIPTION_ID]) - ); - } - - /** - * Get subscription name - * - * @return string - */ - public function getSubscriptionName() - { - return $this->_subscriptionData[self::DATA_NAME]; - } -} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Failed.php b/app/code/Magento/Webhook/Block/Adminhtml/Registration/Failed.php deleted file mode 100644 index 7e0bbb610a88c..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Failed.php +++ /dev/null @@ -1,42 +0,0 @@ -_backendSession->getMessages(true)->getLastAddedMessage(); - return $lastAdded ? $lastAdded->toString() : null; - } -} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Subscription.php b/app/code/Magento/Webhook/Block/Adminhtml/Subscription.php deleted file mode 100644 index 8cc0a4728c628..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Subscription.php +++ /dev/null @@ -1,52 +0,0 @@ -_headerText = __('Subscriptions'); - $this->_addButtonLabel = __('Add Subscription'); - } -} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit.php b/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit.php deleted file mode 100644 index fb57603916ae0..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit.php +++ /dev/null @@ -1,102 +0,0 @@ -_objectId = 'id'; - $this->_blockGroup = 'Magento_Webhook'; - $this->_controller = 'adminhtml_subscription'; - $this->_subscriptionData = $registry->registry(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION); - // Don't allow the merchant to delete subscriptions that were generated by config file. - if ($this->_isCreatedByConfig()) { - $this->_removeButton('delete'); - $this->_removeButton('reset'); - $this->_removeButton('save'); - } - } - - /** - * Gets header text - * - * @return string - */ - public function getHeaderText() - { - if ($this->_isExistingSubscription()) { - return __('Edit Subscription'); - } else { - return __('Add Subscription'); - } - } - - /** - * Returns true is subscription exists - * - * @return bool - */ - protected function _isExistingSubscription() - { - return $this->_subscriptionData - && isset($this->_subscriptionData[self::DATA_SUBSCRIPTION_ID]) - && $this->_subscriptionData[self::DATA_SUBSCRIPTION_ID]; - } - - /** - * Check whether subscription was generated from configuration. - * - * Return false if subscription created within UI. - * - * @return bool - */ - protected function _isCreatedByConfig() - { - return $this->_subscriptionData && isset($this->_subscriptionData['alias']); - } -} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit/Form.php b/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit/Form.php deleted file mode 100644 index 53585d4d4bd82..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit/Form.php +++ /dev/null @@ -1,164 +0,0 @@ -_formFactory = $formFactory; - $this->_registry = $registry; - $this->_format = $format; - $this->_authentication = $authentication; - $this->_hook = $hook; - } - - /** - * Prepares subscription editor form - * - * @return \Magento\Backend\Block\Widget\Form - */ - protected function _prepareForm() - { - $subscriptionData = $this->_registry->registry(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION); - - $subscriptionId = isset($subscriptionData[self::DATA_SUBSCRIPTION_ID]) - ? $subscriptionData[self::DATA_SUBSCRIPTION_ID] - : 0; - $form = $this->_formFactory->create(array( - 'attributes' => array( - 'id' => 'edit_form', - 'action' => $this->getUrl('adminhtml/*/save', array('id' => $subscriptionId)), - 'method' => 'post', - )) - ); - - // We don't want to allow subscriptions defined in config to be edited by the user. - $disabled = isset($subscriptionData[self::DATA_ALIAS]) && !empty($subscriptionData[self::DATA_ALIAS]); - - $fieldset = $form->addFieldset('subscription_fieldset', array('legend' => __('Subscription'))); - - $fieldset->addField( - 'name', 'text', - array( - 'label' => __('Name'), - 'class' => 'required-entry', - 'required' => true, - 'name' => 'name', - 'disabled' => $disabled, - ) - ); - - $fieldset->addField( - 'endpoint_url', 'text', - array( - 'label' => __('Endpoint URL'), - 'class' => 'required-entry', - 'required' => true, - 'name' => 'endpoint_url', - 'disabled' => $disabled, - ) - ); - - $fieldset->addField( - 'format', 'select', - array( - 'name' => 'format', - 'label' => __('Format'), - 'title' => __('Format'), - 'values' => $this->_format->getFormatsForForm(), - 'disabled' => $disabled, - ) - ); - - $fieldset->addField( - 'authentication_type', 'select', - array( - 'name' => 'authentication_type', - 'label' => __('Authentication Types'), - 'title' => __('Authentication Types'), - 'values' => $this->_authentication->getAuthenticationsForForm(), - 'disabled' => $disabled, - ) - ); - - $fieldset->addField( - 'topics', 'multiselect', - array( - 'name' => 'topics[]', - 'label' => __('Topics'), - 'title' => __('Topics'), - 'required' => true, - 'values' => $this->_hook->getTopicsForForm(), - 'disabled' => $disabled, - ) - ); - - $form->setUseContainer(true); - $form->setValues($subscriptionData); - $this->setForm($form); - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Grid/Renderer/Action.php b/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Grid/Renderer/Action.php deleted file mode 100644 index b7e0b767db937..0000000000000 --- a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Grid/Renderer/Action.php +++ /dev/null @@ -1,62 +0,0 @@ -getStatus()) { - case \Magento\Webhook\Model\Subscription::STATUS_ACTIVE : - return '' . __('Revoke') . ''; - case \Magento\Webhook\Model\Subscription::STATUS_REVOKED : - return '' . __('Activate') . ''; - case \Magento\Webhook\Model\Subscription::STATUS_INACTIVE : - $url = $this->getUrl('adminhtml/webhook_registration/activate', array('id' => $row->getId())); - return '' - . __('Activate') . ''; - default : - return ''; - } - } -} diff --git a/app/code/Magento/Webhook/Controller/Adminhtml/Webhook/Registration.php b/app/code/Magento/Webhook/Controller/Adminhtml/Webhook/Registration.php deleted file mode 100644 index 436a8cddb5891..0000000000000 --- a/app/code/Magento/Webhook/Controller/Adminhtml/Webhook/Registration.php +++ /dev/null @@ -1,239 +0,0 @@ -_userFactory = $userFactory; - $this->_subscriptionService = $subscriptionService; - $this->_registry = $registry; - } - - /** - * Activate subscription - * Step 1 - display subscription required resources - */ - public function activateAction() - { - try { - $this->_initSubscription(); - $this->_view->loadLayout(); - $this->_view->renderLayout(); - } catch (\Magento\Core\Exception $e) { - $this->_redirectFailed($e->getMessage()); - } - } - - /** - * Agree to provide required subscription resources - * Step 2 - redirect to specified auth action - */ - public function acceptAction() - { - try { - $subscriptionData = $this->_initSubscription(); - - $route = '*/webhook_registration/user'; - $this->_redirect( - $route, - array(self::PARAM_SUBSCRIPTION_ID => $subscriptionData[self::DATA_SUBSCRIPTION_ID]) - ); - } catch (\Magento\Core\Exception $e) { - $this->_redirectFailed($e->getMessage()); - } - } - - /** - * Displays form for gathering api user data - */ - public function userAction() - { - try { - $this->_initSubscription(); - $this->_view->loadLayout(); - $this->_view->renderLayout(); - } catch (\Magento\Core\Exception $e) { - $this->_redirectFailed($e->getMessage()); - } - } - - /** - * Continue createApiUser - */ - public function registerAction() - { - try { - $subscriptionData = $this->_initSubscription(); - /** @var string $key */ - $key = $this->getRequest()->getParam(self::PARAM_APIKEY); - /** @var string $secret */ - $secret = $this->getRequest()->getParam(self::PARAM_APISECRET); - /** @var string $email */ - $email = $this->getRequest()->getParam(self::PARAM_EMAIL); - /** @var string $company */ - $company = $this->getRequest()->getParam(self::PARAM_COMPANY); - - if (empty($key) || empty($secret) || empty($email)) { - throw new \Magento\Webhook\Exception( - __('API Key, API Secret and Contact Email are required fields.') - ); - } - - if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { - $this->_redirectFailed(__('Invalid Email address provided')); - return; - } - - $userContext = array( - 'email' => $email, - 'key' => $key, - 'secret' => $secret, - 'company' => $company, - ); - - /** @var string[] $topics */ - $topics = $subscriptionData[self::DATA_TOPICS]; - $userId = $this->_userFactory->createUser($userContext, $topics); - - $subscriptionData['api_user_id'] = $userId; - $subscriptionData['status'] = \Magento\Webhook\Model\Subscription::STATUS_ACTIVE; - $subscriptionData = $this->_subscriptionService->update($subscriptionData); - - $this->_redirectSucceeded($subscriptionData); - - } catch (\Magento\Core\Exception $e) { - $this->_redirectFailed($e->getMessage()); - } - } - - /** - * Redirect to this page when the authentication process is completed successfully - */ - public function succeededAction() - { - try { - $this->_view->loadLayout(); - $this->_view->renderLayout(); - $subscriptionData = $this->_initSubscription(); - - $this->_getSession()->addSuccess( - __('The subscription \'%1\' has been activated.', - $subscriptionData[self::DATA_NAME]) - ); - } catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - } - } - - /** - * Redirect to this action when the authentication process fails for any reason. - */ - public function failedAction() - { - $this->_view->loadLayout(); - $this->_view->renderLayout(); - } - - /** - * Initialize general settings for subscription - * - * @throws \Exception|\Magento\Core\Exception if subscription can't be found - * @return array - */ - protected function _initSubscription() - { - $subscriptionId = (int) $this->getRequest()->getParam(self::PARAM_SUBSCRIPTION_ID); - $subscriptionData = $this->_subscriptionService->get($subscriptionId); - - $this->_registry->register(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION, $subscriptionData); - return $subscriptionData; - } - - /** - * Log successful subscription and redirect to success page - * - * @param array $subscriptionData - */ - protected function _redirectSucceeded(array $subscriptionData) - { - $this->_getSession()->addSuccess( - __('The subscription \'%1\' has been activated.', $subscriptionData[self::DATA_NAME]) - ); - $this->_redirect('adminhtml/webhook_registration/succeeded', - array(self::PARAM_SUBSCRIPTION_ID => $subscriptionData[self::DATA_SUBSCRIPTION_ID])); - } - - /** - * Add error and redirect to failure page - * - * @param string $errorMessage - */ - protected function _redirectFailed($errorMessage) - { - $this->_getSession()->addError($errorMessage); - $this->_redirect('adminhtml/webhook_registration/failed'); - } -} diff --git a/app/code/Magento/Webhook/Controller/Adminhtml/Webhook/Subscription.php b/app/code/Magento/Webhook/Controller/Adminhtml/Webhook/Subscription.php deleted file mode 100644 index e3afc24564330..0000000000000 --- a/app/code/Magento/Webhook/Controller/Adminhtml/Webhook/Subscription.php +++ /dev/null @@ -1,295 +0,0 @@ -_registry = $registry; - $this->_subscriptionService = $subscriptionService; - } - - /** - * Loads and renders subscription controller layout - */ - public function indexAction() - { - $this->_view->loadLayout(); - $this->_setActiveMenu('Magento_Webhook::system_api_webapi_webhook'); - $this->_title->add(__('System')); - $this->_title->add(__('Web Services')); - $this->_title->add(__('WebHook Subscriptions')); - - $this->_view->renderLayout(); - } - - /** - * Register new action and throw control to 'edit' action - */ - public function newAction() - { - $this->_forward('edit'); - } - - /** - * Initialize subscription and render action layout - */ - public function editAction() - { - try { - $subscriptionData = $this->_initSubscriptionData(); - - if ($this->_registry->registry(self::REGISTRY_KEY_WEBHOOK_ACTION) !== self::ACTION_NEW) { - $data = $this->_session->getFormData(true); - if (!empty($data)) { - $subscriptionData = $this->_updateSubscriptionData($subscriptionData, $data); - } - $this->_registry->unregister(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION); - $this->_registry->register(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION, $subscriptionData); - } - - $this->_view->loadLayout(); - $this->_setActiveMenu('Magento_Webapi::system_webapi'); - $this->_title->add(__('System')); - $this->_title->add(__('Web Services')); - $this->_title->add(__('WebHook Subscriptions')); - if ($this->_registry->registry(self::REGISTRY_KEY_WEBHOOK_ACTION) === self::ACTION_NEW) { - $this->_title->add(__('Add Subscription')); - } else { - $this->_title->add(__('Edit Subscription')); - } - - $this->_view->renderLayout(); - } catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - $this->_redirect('adminhtml/*/'); - } - } - - /** - * Save subscription action - */ - public function saveAction() - { - try { - /** @var array $data */ - $data = $this->getRequest()->getPost(); - $subscriptionData = $this->_initSubscriptionData(); - if ($data) { - $subscriptionData = $this->_updateSubscriptionData($subscriptionData, $data); - if ($this->_registry->registry(self::REGISTRY_KEY_WEBHOOK_ACTION) === self::ACTION_NEW) { - $this->_subscriptionService->create($subscriptionData); - } else if ( - isset($subscriptionData[self::DATA_SUBSCRIPTION_ID]) - && $subscriptionData[self::DATA_SUBSCRIPTION_ID] - ) { - $this->_subscriptionService->update($subscriptionData); - } else { - $this->_subscriptionService->create($subscriptionData); - } - $this->_getSession()->addSuccess( - __('The subscription \'%1\' has been saved.', - $subscriptionData[self::DATA_NAME]) - ); - $this->_redirect('adminhtml/*/'); - } else { - $this->_getSession()->addError( - __('The subscription \'%1\' has not been saved, as no data was provided.', - $subscriptionData[self::DATA_NAME]) - ); - $this->_redirect( - '*/*/edit', - array(self::PARAM_SUBSCRIPTION_ID => $this->getRequest()->getParam(self::PARAM_SUBSCRIPTION_ID)) - ); - } - } catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - $this->_redirect('adminhtml/*/'); - } - } - - /** - * Delete subscription action - */ - public function deleteAction() - { - try { - $subscriptionData = $this->_initSubscriptionData(); - if ($this->_isCreatedByUser($subscriptionData)) { - try { - $subscriptionId = isset($subscriptionData[self::DATA_SUBSCRIPTION_ID]) - ? $subscriptionData[self::DATA_SUBSCRIPTION_ID] - : null; - $this->_subscriptionService->delete($subscriptionId); - $this->_getSession()->addSuccess( - __('The subscription \'%1\' has been removed.', - $subscriptionData[self::DATA_NAME]) - ); - } - catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - } - } else { - $this->_getSession()->addError( - __('The subscription \'%1\' can not be removed.', - $subscriptionData[self::DATA_NAME]) - ); - } - } catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - } - $this->_redirect('adminhtml/*/'); - } - - /** - * Revoke subscription - */ - public function revokeAction() - { - try { - $subscriptionId = $this->getRequest()->getParam(self::PARAM_SUBSCRIPTION_ID); - if ($subscriptionId) { - $subscriptionData = $this->_subscriptionService->revoke($subscriptionId); - $this->_getSession()->addSuccess( - __('The subscription \'%1\' has been revoked.', - $subscriptionData[self::DATA_NAME]) - ); - } else { - $this->_getSession()->addError(__('No Subscription ID was provided with the request.')); - } - } catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - } - - $this->_redirect('adminhtml/webhook_subscription/index'); - } - - /** - * Activate subscription. Step 1 - display subscription required resources - */ - public function activateAction() - { - try { - $subscriptionId = $this->getRequest()->getParam(self::PARAM_SUBSCRIPTION_ID); - if ($subscriptionId) { - $subscriptionData = $this->_subscriptionService->activate($subscriptionId); - $this->_getSession()->addSuccess( - __('The subscription \'%1\' has been activated.', - $subscriptionData[self::DATA_NAME]) - ); - } else { - $this->_getSession()->addError(__('No Subscription ID was provided with the request.')); - } - } catch (\Magento\Core\Exception $e) { - $this->_getSession()->addError($e->getMessage()); - } - - $this->_redirect('adminhtml/webhook_subscription/index'); - } - - /** - * Initialize general settings for subscription - * - * @return array - * @throws \Magento\Webhook\Exception - */ - protected function _initSubscriptionData() - { - $subscriptionId = (int) $this->getRequest()->getParam(self::PARAM_SUBSCRIPTION_ID); - if ($subscriptionId) { - $subscriptionData = $this->_subscriptionService->get($subscriptionId); - } else { - $subscriptionData = array(); - $this->_registry->register(self::REGISTRY_KEY_WEBHOOK_ACTION, self::ACTION_NEW); - } - - $this->_registry->register(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION, $subscriptionData); - return $subscriptionData; - } - - /** - * Helper function that returns updated subscription data with data gathered from a Form post. - * - * We need to make sure that only authorized data is being updated. For example we disable the 'Version' field - * in the UI for subscriptions generated by config, we don't want a user to be able to bypass this by performing - * a manual POST. - * - * @param array $subscriptionData - * @param array $data - * @return array - */ - protected function _updateSubscriptionData($subscriptionData, $data) - { - return array_merge($subscriptionData, $data); - } - - /** - * Determine if a subscription was created by a user or not, by looking at the data. - * - * @param array $subscriptionData - * @return bool true if the subscription was created by a user - */ - protected function _isCreatedByUser($subscriptionData) - { - return !isset($subscriptionData[self::DATA_ALIAS]); - } -} diff --git a/app/code/Magento/Webhook/Helper/Data.php b/app/code/Magento/Webhook/Helper/Data.php deleted file mode 100644 index 7e4241d29cdf4..0000000000000 --- a/app/code/Magento/Webhook/Helper/Data.php +++ /dev/null @@ -1,34 +0,0 @@ -_userFactory = $userFactory; - $this->_dateTime = $dateTime; - } - - /** - * Initialize model - */ - public function _construct() - { - parent::_construct(); - $this->_init('Magento\Webhook\Model\Resource\Endpoint'); - } - - /** - * Return subscription endpoint url for compatibility with interface - * - * @return string - */ - public function getEndpointUrl() - { - return $this->getData('endpoint_url'); - } - - /** - * Return subscription timeout in secs for compatibility with interface - * - * @return string - */ - public function getTimeoutInSecs() - { - return $this->getData('timeout_in_secs'); - } - - /** - * Prepare data to be saved to database - * - * @return \Magento\Core\Model\AbstractModel - * @throws \Magento\Webhook\Exception - */ - protected function _beforeSave() - { - parent::_beforeSave(); - - if (!$this->hasAuthenticationType()) { - $this->setAuthenticationType(\Magento\Outbound\EndpointInterface::AUTH_TYPE_NONE); - } - - if ($this->hasDataChanges()) { - $this->setUpdatedAt($this->_dateTime->formatDate(time())); - } - - return $this; - } - - /** - * Returns the format this message should be sent in (JSON, XML, etc.) - * - * @return string - */ - public function getFormat() - { - return $this->getData('format'); - } - - /** - * Returns the user abstraction associated with this subscription or null if no user has been associated yet. - * - * @return \Magento\Outbound\UserInterface|null - */ - public function getUser() - { - if ($this->getApiUserId() === null) { - return null; - } - return $this->_userFactory->create($this->getApiUserId()); - } - - /** - * Returns the type of authentication to use when attaching authentication to a message - * - * @return string - */ - public function getAuthenticationType() - { - return $this->getData('authentication_type'); - } -} diff --git a/app/code/Magento/Webhook/Model/Event.php b/app/code/Magento/Webhook/Model/Event.php deleted file mode 100644 index 1d3f9ef91578b..0000000000000 --- a/app/code/Magento/Webhook/Model/Event.php +++ /dev/null @@ -1,192 +0,0 @@ -_dateTime = $dateTime; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Initialize Model - */ - public function _construct() - { - parent::_construct(); - $this->_init('Magento\Webhook\Model\Resource\Event'); - $this->setStatus(\Magento\PubSub\EventInterface::STATUS_READY_TO_SEND); - } - - /** - * Prepare data to be saved to database - * - * @return \Magento\Webhook\Model\Event - */ - protected function _beforeSave() - { - parent::_beforeSave(); - if ($this->isObjectNew()) { - $this->setCreatedAt($this->_dateTime->formatDate(true)); - } elseif ($this->getId() && !$this->hasData('updated_at')) { - $this->setUpdatedAt($this->_dateTime->formatDate(true)); - } - return $this; - } - - /** - * Prepare data before set - * - * @param array $data - * @return \Magento\Webhook\Model\Event - */ - public function setBodyData(array $data) - { - return $this->setData('body_data', serialize($data)); - } - - /** - * Prepare data before return - * - * @return array - */ - public function getBodyData() - { - $data = $this->getData('body_data'); - if (!is_null($data)) { - return unserialize($data); - } - return array(); - } - - /** - * Prepare headers before set - * - * @param array $headers - * @return \Magento\Webhook\Model\Event - */ - public function setHeaders(array $headers) - { - return $this->setData('headers', serialize($headers)); - } - - /** - * Prepare headers before return - * - * @return array - */ - public function getHeaders() - { - $headers = $this->getData('headers'); - if (!is_null($headers)) { - return unserialize($headers); - } - return array(); - } - - /** - * Prepare options before set - * - * @param array $options - * @return \Magento\Webhook\Model\Event - */ - public function setOptions(array $options) - { - return $this->setData('options', serialize($options)); - } - - /** - * Return status. Enable compatibility with interface - * - * @return null|int - */ - public function getStatus() - { - return $this->getData('status'); - } - - /** - * Return topic and enable compatibility with interface - * - * @return null|string - */ - public function getTopic() - { - return $this->getData('topic'); - } - - /** - * Mark event as processed - * - * @return \Magento\Webhook\Model\Event - */ - public function complete() - { - $this->setData('status', \Magento\PubSub\EventInterface::STATUS_PROCESSED) - ->save(); - return $this; - } - - /** - * Mark event as processed - * - * @return \Magento\Webhook\Model\Event - */ - public function markAsInProgress() - { - $this->setData('status', \Magento\PubSub\EventInterface::STATUS_IN_PROGRESS); - return $this; - } -} diff --git a/app/code/Magento/Webhook/Model/Event/Factory.php b/app/code/Magento/Webhook/Model/Event/Factory.php deleted file mode 100644 index 38cacbbe5b3bb..0000000000000 --- a/app/code/Magento/Webhook/Model/Event/Factory.php +++ /dev/null @@ -1,80 +0,0 @@ -_objectManager = $objectManager; - $this->_arrayConverter = $arrayConverter; - } - - /** - * Create event - * - * @param string $topic Topic on which to publish data - * @param array $data Data to be published. Should only contain primitives - * @return \Magento\Webhook\Model\Event - */ - public function create($topic, $data) - { - return $this->_objectManager->create('Magento\Webhook\Model\Event', array( - 'data' => array( - 'topic' => $topic, - 'body_data' => serialize($this->_arrayConverter->convertDataToArray($data)) - ) - ))->setDataChanges(true); - } - - /** - * Return the empty instance of Event - * - * @return \Magento\Webhook\Model\Event - */ - public function createEmpty() - { - return $this->_objectManager->create('Magento\Webhook\Model\Event'); - } -} diff --git a/app/code/Magento/Webhook/Model/Event/QueueReader.php b/app/code/Magento/Webhook/Model/Event/QueueReader.php deleted file mode 100644 index 8d8c488506102..0000000000000 --- a/app/code/Magento/Webhook/Model/Event/QueueReader.php +++ /dev/null @@ -1,61 +0,0 @@ -_iterator = $collection->getIterator(); - } - - /** - * Get the top event from the queue. - * - * @return \Magento\PubSub\EventInterface|null - */ - public function poll() - { - if ($this->_iterator->valid()) { - /** @var \Magento\Webhook\Model\Event $event */ - $event = $this->_iterator->current(); - $this->_iterator->next(); - return $event; - } - return null; - } -} diff --git a/app/code/Magento/Webhook/Model/Event/QueueWriter.php b/app/code/Magento/Webhook/Model/Event/QueueWriter.php deleted file mode 100644 index 8f119a246c9e3..0000000000000 --- a/app/code/Magento/Webhook/Model/Event/QueueWriter.php +++ /dev/null @@ -1,59 +0,0 @@ -_eventFactory = $eventFactory; - } - - /** - * Adds event to the queue. - * - * @param \Magento\PubSub\EventInterface $event - * @return null - */ - public function offer(\Magento\PubSub\EventInterface $event) - { - if ($event instanceof \Magento\Webhook\Model\Event) { - $event->save(); - } else { - $magentoEvent = $this->_eventFactory->create($event->getTopic(), $event->getBodyData()); - $magentoEvent->save(); - } - } -} diff --git a/app/code/Magento/Webhook/Model/Job.php b/app/code/Magento/Webhook/Model/Job.php deleted file mode 100644 index aa31958ff8e25..0000000000000 --- a/app/code/Magento/Webhook/Model/Job.php +++ /dev/null @@ -1,225 +0,0 @@ - 1, - 2 => 2, - 3 => 4, - 4 => 10, - 5 => 30, - 6 => 60, - 7 => 120, - 8 => 240, - ); - - /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Webhook\Model\Event\Factory $eventFactory - * @param \Magento\Webhook\Model\Subscription\Factory $subscriptionFactory - * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Core\Model\Resource\AbstractResource $resource - * @param \Magento\Data\Collection\Db $resourceCollection - * @param array $data - */ - public function __construct( - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Webhook\Model\Event\Factory $eventFactory, - \Magento\Webhook\Model\Subscription\Factory $subscriptionFactory, - \Magento\Stdlib\DateTime $dateTime, - \Magento\Core\Model\Resource\AbstractResource $resource = null, - \Magento\Data\Collection\Db $resourceCollection = null, - array $data = array() - ) { - $this->_eventFactory = $eventFactory; - $this->_subscriptionFactory = $subscriptionFactory; - $this->_dateTime = $dateTime; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Initialize model - */ - public function _construct() - { - parent::_construct(); - $this->_init('Magento\Webhook\Model\Resource\Job'); - - if ($this->hasEvent()) { - $this->setEventId($this->getEvent()->getId()); - } - - if ($this->hasSubscription()) { - $this->setSubscriptionId($this->getSubscription()->getId()); - } - $this->setStatus(\Magento\PubSub\JobInterface::STATUS_READY_TO_SEND); - } - - /** - * Prepare data to be saved to database - * - * @return \Magento\Webhook\Model\Job - */ - protected function _beforeSave() - { - parent::_beforeSave(); - if ($this->isObjectNew()) { - $this->setCreatedAt($this->_dateTime->formatDate(true)); - } elseif ($this->getId() && !$this->hasData('updated_at')) { - $this->setUpdatedAt($this->_dateTime->formatDate(true)); - } - return $this; - } - - /** - * Get event - * - * @return \Magento\PubSub\EventInterface|\Magento\Webhook\Model\Event|null - */ - public function getEvent() - { - if ($this->hasData('event')) { - return $this->getData('event'); - } - - if ($this->hasData('event_id')) { - $event = $this->_eventFactory->createEmpty() - ->load($this->getEventId()); - $this->setData('event', $event); - return $event; - } - - return null; - } - - /** - * Get subscription - * - * @return \Magento\Webhook\Model\Subscription|null - */ - public function getSubscription() - { - if ($this->hasData('subscription')) { - return $this->getData('subscription'); - } - - if ($this->hasData('subscription_id')) { - $subscription = $this->_subscriptionFactory->create() - ->load($this->getSubscriptionId()); - - $this->setData('subscription', $subscription); - return $subscription; - } - - return null; - } - - /** - * Update the Job status to indicate it has completed successfully - * - * @return \Magento\Webhook\Model\Job - */ - public function complete() - { - $this->setStatus(\Magento\PubSub\JobInterface::STATUS_SUCCEEDED) - ->save(); - return $this; - } - - /** - * Handles failed HTTP response - * - * @return \Magento\Webhook\Model\Job - */ - public function handleFailure() - { - $retryCount = $this->getRetryCount(); - if ($retryCount < count($this->_retryTimeToAdd)) { - $addedTimeInMinutes = $this->_retryTimeToAdd[$retryCount + 1] * 60 + time(); - $this->setRetryCount($retryCount + 1); - $this->setRetryAt($this->_dateTime->formatDate($addedTimeInMinutes)); - $this->setUpdatedAt($this->_dateTime->formatDate(time(), true)); - $this->setStatus(\Magento\PubSub\JobInterface::STATUS_RETRY); - } else { - $this->setStatus(\Magento\PubSub\JobInterface::STATUS_FAILED); - } - return $this; - } - - /** - * Retrieve the status of the Job - * - * @return int - */ - public function getStatus() - { - return $this->getData('status'); - } - - /** - * Set the status of the Job - * - * @param int $status - * @return \Magento\Webhook\Model\Job - */ - public function setStatus($status) - { - $this->setData('status', $status); - return $this; - } -} diff --git a/app/code/Magento/Webhook/Model/Job/Factory.php b/app/code/Magento/Webhook/Model/Job/Factory.php deleted file mode 100644 index e7fe8728cb45e..0000000000000 --- a/app/code/Magento/Webhook/Model/Job/Factory.php +++ /dev/null @@ -1,63 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create Job - * - * @param \Magento\PubSub\SubscriptionInterface $subscription - * @param \Magento\PubSub\EventInterface $event - * @return \Magento\PubSub\JobInterface - */ - public function create(\Magento\PubSub\SubscriptionInterface $subscription, \Magento\PubSub\EventInterface $event) - { - return $this->_objectManager->create('Magento\Webhook\Model\Job', array( - 'data' => array( - 'event' => $event, - 'subscription' => $subscription - ) - )); - } -} diff --git a/app/code/Magento/Webhook/Model/Job/QueueReader.php b/app/code/Magento/Webhook/Model/Job/QueueReader.php deleted file mode 100644 index 7890ba840dc80..0000000000000 --- a/app/code/Magento/Webhook/Model/Job/QueueReader.php +++ /dev/null @@ -1,64 +0,0 @@ -_collection = $collection; - $this->_iterator = $this->_collection->getIterator(); - } - - /** - * Return the top job from the queue. - * - * @return \Magento\PubSub\JobInterface|null - */ - public function poll() - { - if ($this->_iterator->valid()) { - /** @var $job \Magento\PubSub\JobInterface */ - $job = $this->_iterator->current(); - $this->_iterator->next(); - return $job; - } - return null; - } -} diff --git a/app/code/Magento/Webhook/Model/Job/QueueWriter.php b/app/code/Magento/Webhook/Model/Job/QueueWriter.php deleted file mode 100644 index 82a37ba37a8ec..0000000000000 --- a/app/code/Magento/Webhook/Model/Job/QueueWriter.php +++ /dev/null @@ -1,61 +0,0 @@ -_jobFactory = $jobFactory; - } - - /** - * Adds the job to the queue. - * - * @param \Magento\PubSub\JobInterface $job - * @return null - */ - public function offer(\Magento\PubSub\JobInterface $job) - { - if ($job instanceof \Magento\Webhook\Model\Job) { - $job->save(); - } else { - /** @var \Magento\Webhook\Model\Job $magentoJob */ - $magentoJob = $this->_jobFactory->create($job->getSubscription(), $job->getEvent()); - $magentoJob->save(); - } - } -} diff --git a/app/code/Magento/Webhook/Model/Observer.php b/app/code/Magento/Webhook/Model/Observer.php deleted file mode 100644 index c36abfac7b5f4..0000000000000 --- a/app/code/Magento/Webhook/Model/Observer.php +++ /dev/null @@ -1,105 +0,0 @@ -_webapiEventHandler = $webapiEventHandler; - $this->_subscriptionSet = $subscriptionSet; - $this->_logger = $logger; - } - - /** - * Triggered after webapi user deleted. It updates status of the activated subscriptions - * associated with this webapi user to inactive - */ - public function afterWebapiUserDelete() - { - try { - $subscriptions = $this->_subscriptionSet->getActivatedSubscriptionsWithoutApiUser(); - /** @var \Magento\Webhook\Model\Subscription $subscription */ - foreach ($subscriptions as $subscription) { - $subscription->setStatus(\Magento\Webhook\Model\Subscription::STATUS_INACTIVE) - ->save(); - } - } catch (\Exception $exception) { - $this->_logger->logException($exception); - } - } - - /** - * Triggered after webapi user change - * - * @param \Magento\Event\Observer $observer - */ - public function afterWebapiUserChange(\Magento\Event\Observer $observer) - { - try { - $model = $observer->getEvent()->getObject(); - - $this->_webapiEventHandler->userChanged($model); - } catch (\Exception $exception) { - $this->_logger->logException($exception); - } - } - - /** - * Triggered after webapi role change - * - * @param \Magento\Event\Observer $observer - */ - public function afterWebapiRoleChange(\Magento\Event\Observer $observer) - { - try { - $model = $observer->getEvent()->getObject(); - - $this->_webapiEventHandler->roleChanged($model); - } catch (\Exception $exception) { - $this->_logger->logException($exception); - } - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Endpoint.php b/app/code/Magento/Webhook/Model/Resource/Endpoint.php deleted file mode 100644 index 093d7c5426f26..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Endpoint.php +++ /dev/null @@ -1,68 +0,0 @@ -_init('outbound_endpoint', 'endpoint_id'); - } - - /** - * Get endpoints associated with a given api user id. - * - * @param int|int[] $apiUserIds - * @return array - */ - public function getApiUserEndpoints($apiUserIds) - { - $adapter = $this->_getReadAdapter(); - $select = $adapter->select() - ->from($this->getMainTable(), array('endpoint_id')) - ->where('api_user_id IN (?)', $apiUserIds); - return $adapter->fetchCol($select); - } - - /** - * Get endpoints that do not have an associated api user - * - * @return array - */ - public function getEndpointsWithoutApiUser() - { - $adapter = $this->_getReadAdapter(); - $select = $adapter->select() - ->from($this->getMainTable(), array('endpoint_id')) - ->where('api_user_id IS NULL'); - return $adapter->fetchCol($select); - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Event.php b/app/code/Magento/Webhook/Model/Resource/Event.php deleted file mode 100644 index d43694e2d797a..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Event.php +++ /dev/null @@ -1,39 +0,0 @@ -_init('webhook_event', 'event_id'); - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Event/Collection.php b/app/code/Magento/Webhook/Model/Resource/Event/Collection.php deleted file mode 100644 index 1acca1484ad2c..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Event/Collection.php +++ /dev/null @@ -1,181 +0,0 @@ -_dateTime = $dateTime; - parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); - $this->_timeoutIdling = is_null($timeoutIdling) ? - self::DEFAULT_TIMEOUT_IDLING_EVENTS : $timeoutIdling; - } - - public function _construct() - { - parent::_construct(); - $this->_init('Magento\Webhook\Model\Event', 'Magento\Webhook\Model\Resource\Event'); - } - - /** - * Adds FOR UPDATE lock on retrieved rows and filter status - * - * @return \Magento\Webhook\Model\Resource\Event\Collection - */ - protected function _initSelect() - { - parent::_initSelect(); - $this->getSelect()->forUpdate(true); - $this->addFieldToFilter('status', \Magento\PubSub\EventInterface::STATUS_READY_TO_SEND) - ->setOrder('created_at', \Magento\Data\Collection::SORT_ORDER_ASC) - ->setPageSize(self::PAGE_SIZE); - return $this; - } - - /** - * Start transaction before executing the query in order to update the status atomically - * - * @return \Magento\Webhook\Model\Resource\Event\Collection - */ - protected function _beforeLoad() - { - parent::_beforeLoad(); - $this->getConnection()->beginTransaction(); - return $this; - } - - /** - * Update the status and commit transaction in case of success - * - * @return \Magento\Webhook\Model\Resource\Event\Collection - * @throws \Exception - */ - protected function _afterLoad() - { - parent::_afterLoad(); - try { - $loadedIds = $this->_getLoadedIds(); - if (!empty($loadedIds)) { - $this->getConnection()->update($this->getMainTable(), - array('status' => \Magento\PubSub\EventInterface::STATUS_IN_PROGRESS), - array('event_id IN (?)' => $loadedIds)); - } - $this->getConnection()->commit(); - } catch (\Exception $e) { - $this->getConnection()->rollBack(); - $this->clear(); - throw $e; - } - - return $this; - } - - /** - * Retrieve ids of all loaded records - * - * @return array - */ - protected function _getLoadedIds() - { - $result = array(); - foreach ($this->getItems() as $item) { - $result[] = $item->getId(); - } - return $result; - } - - /** - * Change event status back to STATUS_READY_TO_SEND if stays in STATUS_IN_PROGRESS longer than defined delay - * - * Regularly run by scheduling mechanism - * - * @throws \Exception - * @return null - */ - public function revokeIdlingInProgress() - { - $this->getConnection()->beginTransaction(); - try { - /* if event is in progress state for less than hour we do nothing with it*/ - $okUpdatedTime = time() - $this->_timeoutIdling; - $this->addFieldToFilter('status', \Magento\PubSub\EventInterface::STATUS_IN_PROGRESS) - ->addFieldToFilter('updated_at', array('to' => $this->_dateTime->formatDate($okUpdatedTime), - 'datetime' => true)); - $idsToRevoke = $this->_getLoadedIds(); - if (count($idsToRevoke)) { - $this->getConnection()->update($this->getMainTable(), - array('status' => \Magento\PubSub\EventInterface::STATUS_READY_TO_SEND), - array('event_id IN (?)' => $idsToRevoke)); - } - } catch (\Exception $e) { - $this->getConnection()->rollBack(); - $this->clear(); - throw $e; - } - $this->getConnection()->commit(); - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Job.php b/app/code/Magento/Webhook/Model/Resource/Job.php deleted file mode 100644 index 45b7bcb165236..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Job.php +++ /dev/null @@ -1,39 +0,0 @@ -_init('webhook_dispatch_job', 'dispatch_job_id'); - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Job/Collection.php b/app/code/Magento/Webhook/Model/Resource/Job/Collection.php deleted file mode 100644 index 56d6bb022ffc2..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Job/Collection.php +++ /dev/null @@ -1,193 +0,0 @@ -dateTime = $dateTime; - parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); - $this->_timeoutIdling = is_null($timeoutIdling) ? - self::DEFAULT_TIMEOUT_IDLING_JOBS : $timeoutIdling; - } - - /** - * Initialize Collection - */ - public function _construct() - { - parent::_construct(); - $this->_init('Magento\Webhook\Model\Job', 'Magento\Webhook\Model\Resource\Job'); - } - - /** - * Adds FOR UPDATE lock on retrieved rows and filter status - * - * @return \Magento\Webhook\Model\Resource\Job\Collection - */ - protected function _initSelect() - { - parent::_initSelect(); - $this->getSelect()->forUpdate(true); - - $this->addFieldToFilter('status', array( - 'in' => array( - \Magento\PubSub\JobInterface::STATUS_READY_TO_SEND, - \Magento\PubSub\JobInterface::STATUS_RETRY - ))) - ->addFieldToFilter( - 'retry_at', - array('to' => $this->dateTime->formatDate(true), 'datetime' => true) - ) - ->setOrder('updated_at', \Magento\Data\Collection::SORT_ORDER_ASC) - ->setPageSize(self::PAGE_SIZE); - return $this; - } - - /** - * Start transaction before executing the query in order to update the status atomically - * - * @return \Magento\Webhook\Model\Resource\Job\Collection - */ - protected function _beforeLoad() - { - parent::_beforeLoad(); - $this->getConnection()->beginTransaction(); - return $this; - } - - /** - * Update the status and commit transaction in case of success - * - * @return \Magento\Webhook\Model\Resource\Job\Collection - * @throws \Exception - */ - protected function _afterLoad() - { - parent::_afterLoad(); - try { - $loadedIds = $this->_getLoadedIds(); - if (!empty($loadedIds)) { - $this->getConnection()->update($this->getMainTable(), - array('status' => \Magento\PubSub\JobInterface::STATUS_IN_PROGRESS), - array('dispatch_job_id IN (?)' => $loadedIds)); - } - $this->getConnection()->commit(); - } catch (\Exception $e) { - $this->getConnection()->rollBack(); - $this->clear(); - throw $e; - } - - return $this; - } - - - /** - * Retrieve ids of all loaded records - * - * @return array - */ - protected function _getLoadedIds() - { - $result = array(); - foreach ($this->getItems() as $item) { - $result[] = $item->getId(); - } - return $result; - } - - /** - * Change job status back to STATUS_READY_TO_SEND if stays in STATUS_IN_PROGRESS longer than defined delay - * - * Regularly run by scheduling mechanism - * - * @throws \Exception - * @return null - */ - public function revokeIdlingInProgress() - { - $this->getConnection()->beginTransaction(); - try { - /* if event is in progress state for less than defined delay we do nothing with it */ - $okUpdatedTime = time() - $this->_timeoutIdling; - $this->addFieldToFilter('status', \Magento\PubSub\JobInterface::STATUS_IN_PROGRESS) - ->addFieldToFilter('updated_at', array('to' => $this->dateTime->formatDate($okUpdatedTime), - 'datetime' => true)); - - if (!count($this->getItems())) { - $this->getConnection()->commit(); - return; - } - - /** @var \Magento\Webhook\Model\Job $job */ - foreach ($this->getItems() as $job) { - $job->handleFailure() - ->save(); - } - - } catch (\Exception $e) { - $this->getConnection()->rollBack(); - $this->clear(); - throw $e; - } - $this->getConnection()->commit(); - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Subscription.php b/app/code/Magento/Webhook/Model/Resource/Subscription.php deleted file mode 100644 index f6c7ce8e088da..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Subscription.php +++ /dev/null @@ -1,193 +0,0 @@ -_webHookList = $config->getWebhooks(); - parent::__construct($resource); - } - - /** - * Pseudo-constructor for resource model initialization - */ - public function _construct() - { - $this->_init('webhook_subscription', 'subscription_id'); - } - - - /** - * Perform actions after subscription load - * - * @param \Magento\Core\Model\AbstractModel $subscription - * @return \Magento\Core\Model\Resource\Db\AbstractDb - */ - protected function _afterLoad(\Magento\Core\Model\AbstractModel $subscription) - { - $this->loadTopics($subscription); - return parent::_afterLoad($subscription); - } - - /** - * Perform actions after subscription save - * - * @param \Magento\Core\Model\AbstractModel $subscription - * @return \Magento\Core\Model\Resource\Db\AbstractDb - */ - protected function _afterSave(\Magento\Core\Model\AbstractModel $subscription) - { - $oldTopics = $this->_getTopics($subscription->getId()); - $this->_updateTopics($oldTopics, $subscription); - return parent::_afterSave($subscription); - } - - /** - * Gets list of topics for subscription - * - * @param int $subscriptionId - * @return string[] - */ - protected function _getTopics($subscriptionId) - { - $adapter = $this->_getReadAdapter(); - $select = $adapter->select() - ->from($this->getTable('webhook_subscription_hook'), 'topic') - ->where('subscription_id = ?', $subscriptionId); - return $adapter->fetchCol($select); - } - - /** - * Load topics of given subscription - * - * @param \Magento\Core\Model\AbstractModel $subscription - */ - public function loadTopics(\Magento\Core\Model\AbstractModel $subscription) - { - $subscription->setData('topics', $this->_getTopics($subscription->getId())); - } - /** - * Updates list of topics for subscription - * - * @param array $oldTopics - * @param \Magento\Core\Model\AbstractModel $subscription - * @return \Magento\Webhook\Model\Resource\Subscription - */ - protected function _updateTopics($oldTopics, \Magento\Core\Model\AbstractModel $subscription) - { - $newTopics = $subscription->getData('topics'); - $supportedTopics = $this->_getSupportedTopics(); - $subscriptionId = $subscription->getId(); - if (!empty($newTopics) && is_array($newTopics)) { - if (!empty($supportedTopics) && is_array($supportedTopics)) { - $newTopics = array_intersect($newTopics, $supportedTopics); - } - $intersection = array(); - if (!empty($oldTopics) && is_array($oldTopics)) { - $intersection = array_intersect($newTopics, $oldTopics); - $oldTopics = array_diff($oldTopics, $intersection); - } else { - $oldTopics = array(); - } - $newTopics = array_diff($newTopics, $intersection); - - $this->_performTopicUpdates($oldTopics, $newTopics, $subscriptionId); - } - return $this; - } - - /** - * Get list of webhook topics defined in webhook.xml - * - * @return string[] - */ - protected function _getSupportedTopics() - { - $availableHooks = array(); - foreach ($this->_webHookList as $key => $configData) { - foreach ($configData as $name => $hook) { - if (is_array($hook)) { - $availableHooks[] = $key . '/' . $name; - } - } - if (isset($configData['label'])) { - $availableHooks[] = $key; - } - } - return $availableHooks; - } - - /** - * Update topics for a specific subscription - * - * @param array $oldTopics - * @param array $newTopics - * @param string $subscriptionId - */ - protected function _performTopicUpdates($oldTopics, $newTopics, $subscriptionId) - { - $insertData = array(); - - foreach ($newTopics as $topic) { - $insertData[] = array( - 'subscription_id' => $subscriptionId, - 'topic' => $topic - ); - } - - if (count($oldTopics) > 0) { - $this->_getWriteAdapter()->delete( - $this->getTable('webhook_subscription_hook'), - array( - 'subscription_id = ?' => $subscriptionId, - 'topic in (?)' => $oldTopics - ) - ); - } - - if (count($insertData) > 0) { - $this->_getWriteAdapter()->insertMultiple( - $this->getTable('webhook_subscription_hook'), - $insertData - ); - } - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Subscription/Collection.php b/app/code/Magento/Webhook/Model/Resource/Subscription/Collection.php deleted file mode 100644 index 77165d8b8e6a0..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Subscription/Collection.php +++ /dev/null @@ -1,214 +0,0 @@ -_endpointResource = $endpointResource; - } - - /** - * Initialization here - */ - public function _construct() - { - parent::_construct(); - $this->_init('Magento\Webhook\Model\Subscription', 'Magento\Webhook\Model\Resource\Subscription'); - } - - - /** - * Return all subscriptions by topic - * - * @param string $topic - * @return \Magento\PubSub\SubscriptionInterface[] - */ - public function getSubscriptionsByTopic($topic) - { - return $this->clearFilters() - ->addTopicFilter($topic) - ->addIsActiveFilter(true) - ->clear() - ->getItems(); - } - - /** - * Returns all subscriptions that match a given alias - * - * @param string $alias - * @return \Magento\Webhook\Model\Subscription[] - */ - public function getSubscriptionsByAlias($alias) - { - return $this->clearFilters() - ->addAliasFilter($alias) - ->clear() - ->getItems(); - } - - /** - * Get subscriptions whose endpoint has no api user - * - * @return \Magento\Webhook\Model\Subscription[] - */ - public function getActivatedSubscriptionsWithoutApiUser() - { - $endpointIds = $this->_endpointResource->getEndpointsWithoutApiUser(); - - return $this->clearFilters() - ->addEndpointIdsFilter($endpointIds) - ->addNotInactiveFilter() - ->clear() - ->getItems(); - } - - /** - * Get api user subscriptions - * - * @param int|int[] $apiUserIds - * @return \Magento\Webhook\Model\Subscription[] - */ - public function getApiUserSubscriptions($apiUserIds) - { - $endpointIds = $this->_endpointResource->getApiUserEndpoints($apiUserIds); - - return $this->clearFilters() - ->addEndpointIdsFilter($endpointIds) - ->clear() - ->getItems(); - } - - /** - * Clear the select object - * - * @return \Magento\Webhook\Model\Resource\Subscription\Collection - */ - public function clearFilters() - { - $this->_select = $this->_conn->select(); - $this->_initSelect(); - return $this; - } - - /** - * Select subscriptions whose endpoint's id is in given array - * - * @param array $endpointIds - * @return \Magento\Webhook\Model\Resource\Subscription\Collection - */ - public function addEndpointIdsFilter($endpointIds) - { - $this->getSelect()->where('endpoint_id IN (?)', $endpointIds); - - return $this; - } - - /** - * Add filter by topic field to collection - * - * @param string $topic - * @return \Magento\Webhook\Model\Resource\Subscription\Collection - */ - public function addTopicFilter($topic) - { - $this->getSelect() - ->joinInner(array('hooks' => $this->getTable('webhook_subscription_hook')), - $this->getConnection() - ->quoteInto('hooks.subscription_id=main_table.subscription_id AND hooks.topic=?', $topic) - ); - return $this; - } - - /** - * Add filter by alias field to collection - * - * @param string|array $alias - * @return \Magento\Webhook\Model\Resource\Subscription\Collection - */ - public function addAliasFilter($alias) - { - $this->addFieldToFilter('alias', $alias); - return $this; - } - - /** - * Adds filter by status field to collection based on parameter - * - * @param bool $isActive - * @return \Magento\Webhook\Model\Resource\Subscription\Collection - */ - public function addIsActiveFilter($isActive) - { - if ($isActive) { - $this->addFieldToFilter('status', \Magento\PubSub\SubscriptionInterface::STATUS_ACTIVE); - } else { - $this->addFieldToFilter('status', \Magento\PubSub\SubscriptionInterface::STATUS_INACTIVE); - } - return $this; - } - - /** - * Filter out anything in the INACTIVE state - * - * @return \Magento\Webhook\Model\Resource\Subscription\Collection - */ - public function addNotInactiveFilter() - { - $this->getSelect()->where('status IN (?)', array( - \Magento\Webhook\Model\Subscription::STATUS_ACTIVE, - \Magento\Webhook\Model\Subscription::STATUS_REVOKED)); - - return $this; - } -} diff --git a/app/code/Magento/Webhook/Model/Resource/Subscription/Grid/Collection.php b/app/code/Magento/Webhook/Model/Resource/Subscription/Grid/Collection.php deleted file mode 100644 index 445f890b54d7c..0000000000000 --- a/app/code/Magento/Webhook/Model/Resource/Subscription/Grid/Collection.php +++ /dev/null @@ -1,64 +0,0 @@ -updateSubscriptionCollection(); - } -} diff --git a/app/code/Magento/Webhook/Model/Source/Authentication.php b/app/code/Magento/Webhook/Model/Source/Authentication.php deleted file mode 100644 index 3f57f077da959..0000000000000 --- a/app/code/Magento/Webhook/Model/Source/Authentication.php +++ /dev/null @@ -1,73 +0,0 @@ -_authenticationTypes = $authenticationTypes; - } - - /** - * Get available authentication types - * - * @return array - */ - public function toOptionArray() - { - return $this->_authenticationTypes; - - } - - /** - * Return authentications for use by a form - * - * @return array - */ - public function getAuthenticationsForForm() - { - $elements = array(); - foreach ($this->_authenticationTypes as $authName => $authentication) { - $elements[] = array( - 'label' => __($authentication), - 'value' => $authName, - ); - } - - return $elements; - } -} diff --git a/app/code/Magento/Webhook/Model/Source/Format.php b/app/code/Magento/Webhook/Model/Source/Format.php deleted file mode 100644 index bef1bf1a15572..0000000000000 --- a/app/code/Magento/Webhook/Model/Source/Format.php +++ /dev/null @@ -1,77 +0,0 @@ -_formats = $formats; - } - - /** - * Get available formats - * - * @return string[] - */ - public function toOptionArray() - { - return $this->_formats; - } - - /** - * Return non-empty formats for use by a form - * - * @return array - */ - public function getFormatsForForm() - { - $elements = array(); - foreach ($this->_formats as $formatName => $format) { - $elements[] = array( - 'label' => __($format), - 'value' => $formatName, - ); - } - - return $elements; - } -} diff --git a/app/code/Magento/Webhook/Model/Source/Hook.php b/app/code/Magento/Webhook/Model/Source/Hook.php deleted file mode 100644 index d450cfb56a9bc..0000000000000 --- a/app/code/Magento/Webhook/Model/Source/Hook.php +++ /dev/null @@ -1,104 +0,0 @@ -_options = $config->getWebhooks(); - } - - /** - * Get available topics - * - * @return array - */ - public function toOptionArray() - { - return $this->_options; - } - - /** - * Scan config element to retrieve topics - * - * @return array - */ - public function getTopicsForForm() - { - $elements = array(); - - // process groups - $elements = $this->_getTopicsForForm($this->toOptionArray(), array(), $elements); - - return $elements; - } - - /** - * Recursive helper function to dynamically build topic information for our form. - * Seeks out nodes under 'webhook' stopping when it finds a leaf that contains 'label' - * The value is constructed using the XML tree parents. - * @param array $node - * @param array $path - * @param array $elements - * @return array - */ - protected function _getTopicsForForm($node, $path, $elements) - { - if (!empty($node['label'])) { - $value = join('/', $path); - - $label = __($node['label']); - - $elements[] = array( - 'label' => $label, - 'value' => $value, - ); - - return $elements; - } - - foreach ($node as $group => $child) { - $path[] = $group; - $elements = $this->_getTopicsForForm($child, $path, $elements); - array_pop($path); - } - - return $elements; - } -} diff --git a/app/code/Magento/Webhook/Model/Subscription.php b/app/code/Magento/Webhook/Model/Subscription.php deleted file mode 100644 index 577a752b8bd0a..0000000000000 --- a/app/code/Magento/Webhook/Model/Subscription.php +++ /dev/null @@ -1,484 +0,0 @@ -_dateTime = $dateTime; - $this->_endpoint = $endpoint; - } - - /** - * Initialize model - */ - public function _construct() - { - parent::_construct(); - $this->_init('Magento\Webhook\Model\Resource\Subscription'); - } - - /** - * Prepare data to be saved to database - * - * @return \Magento\Core\Model\AbstractModel - */ - protected function _beforeSave() - { - // TODO: Can this ever be set to anything else, is it being used? - if (!$this->hasRegistrationMechanism()) { - $this->setRegistrationMechanism(self::REGISTRATION_MECHANISM_MANUAL); - } - - if ($this->_endpoint->hasDataChanges()) { - $this->_endpoint->save(); - if ($this->getEndpointId() === null) { - $this->setEndpointId($this->_endpoint->getId()); - } - } - - if ($this->hasDataChanges()) { - $this->setUpdatedAt($this->_dateTime->formatDate(time())); - } - - return parent::_beforeSave(); - } - - /** - * Processing object after delete data - * - * We need to be sure that related objects like Endpoint are also deleted. - * - * @return \Magento\Core\Model\AbstractModel|void - */ - protected function _afterDelete() - { - $this->getEndpoint()->delete(); - - return parent::_afterDelete(); - } - - /** - * Determines if the subscription is subscribed to a topic. - * - * @param string $topic The topic to check - * @return boolean True if subscribed, false otherwise - */ - public function hasTopic($topic) - { - return in_array($topic, $this->getTopics()); - } - - - /** - * Mark this subscription status to activated - */ - public function activate() - { - $this->setStatus(\Magento\PubSub\SubscriptionInterface::STATUS_ACTIVE); - } - - /** - * Mark this subscription status as deactivated - */ - public function deactivate() - { - $this->setStatus(\Magento\PubSub\SubscriptionInterface::STATUS_INACTIVE); - } - - /** - * Mark this subscription status to revoked - */ - public function revoke() - { - $this->setStatus(\Magento\PubSub\SubscriptionInterface::STATUS_REVOKED); - } - - /** - * Checks that the subscription has access to all the resources/topics it has subscribed to. - * - * @return string[] array of all invalid topics - */ - public function findRestrictedTopics() - { - $restrictedTopics = array(); - $user = $this->getUser(); - if (null === $user) { - return $restrictedTopics; - } - foreach ($this->getTopics() as $topic) { - if (!$user->hasPermission($topic)) { - $restrictedTopics[] = $topic; - } - } - - return $restrictedTopics; - } - - /** - * Returns the endpoint to which messages will be sent - * - * @return \Magento\Webhook\Model\Endpoint - */ - public function getEndpoint() - { - if (!$this->_endpointLoaded && $this->getEndpointId() !== null) { - $this->_endpoint->load($this->getEndpointId()); - $this->_endpointLoaded = true; - } - return $this->_endpoint; - } - - /** - * Overwrite data in the object. - * - * If $key is string, the attribute value will be overwritten by $value - * - * If $key is an array, it will overwrite all the data in the object. - * - * @param string|array $key - * @param mixed $value - * @return \Magento\Webhook\Model\Subscription - */ - public function setData($key, $value = null) - { - parent::setData($key, $value); - - if (is_array($key)) { - $this->_setDataArray($key); - } else { - switch ($key) { - case self::FIELD_ENDPOINT_URL: - $this->setEndpointUrl($value); - break; - case self::FIELD_FORMAT: - $this->setFormat($value); - break; - case self::FIELD_AUTHENTICATION_TYPE: - $this->setAuthenticationType($value); - break; - case self::FIELD_API_USER_ID: - $this->setApiUserId($value); - break; - case self::FIELD_TIMEOUT_IN_SECS: - $this->setTimeoutInSecs($value); - break; - } - } - - return $this; - } - - /** - * Set the endpoint URL for this Subscription - * - * @param string $url - * @return \Magento\Webhook\Model\Subscription - */ - public function setEndpointUrl($url) - { - $this->getEndpoint()->setEndpointUrl($url); - $this->setDataChanges(true); - return $this; - } - - /** - * Set the endpoint timeout in seconds. - * - * @param int $timeout - * @return \Magento\Webhook\Model\Subscription - */ - public function setTimeoutInSecs($timeout) - { - $this->getEndpoint()->setTimeoutInSecs($timeout); - $this->setDataChanges(true); - return $this; - } - - /** - * Set the format in which data should be sent (json, xml) - * - * @param string $format - * @return \Magento\Webhook\Model\Subscription - */ - public function setFormat($format) - { - $this->getEndpoint()->setFormat($format); - $this->setDataChanges(true); - return $this; - } - - /** - * Set the api user id that this subscription is associated with - * - * @param string $userId - * @return \Magento\Webhook\Model\Subscription - */ - public function setApiUserId($userId) - { - $this->getEndpoint()->setApiUserId($userId); - $this->setDataChanges(true); - return $this; - } - - /** - * Set the authentication type for this subscription - * - * @param string $authType - * @return \Magento\Webhook\Model\Subscription - */ - public function setAuthenticationType($authType) - { - $this->getEndpoint()->setAuthenticationType($authType); - $this->setDataChanges(true); - return $this; - } - - /** - * Returns the user abstraction associated with this subscription or null if no user has been associated yet. - * - * @return \Magento\Outbound\UserInterface|null - */ - public function getUser() - { - return $this->getEndpoint()->getUser(); - } - - /** - * Returns the type of authentication to use when attaching authentication to a message - * - * @return string - */ - public function getAuthenticationType() - { - return $this->getEndpoint()->getAuthenticationType(); - } - - /** - * Returns the format this message should be sent in (JSON, XML, etc.) - * - * @return string - */ - public function getFormat() - { - return $this->getEndpoint()->getFormat(); - } - - /** - * Returns the api user id that this subscriptions endpoint is associated with. - * - * @return string - */ - public function getApiUserId() - { - return $this->getEndpoint()->getApiUserId(); - } - - /** - * Returns the endpoint URL of this subscription - * - * @return string - */ - public function getEndpointUrl() - { - return $this->getEndpoint()->getEndpointUrl(); - } - - /** - * Returns the maximum time in seconds that this subscription is willing to wait before a retry should be attempted - * - * @return int - */ - public function getTimeoutInSecs() - { - return $this->getEndpoint()->getTimeoutInSecs(); - } - - /** - * Returns a list of topics that this Subscription is subscribed to - * - * @return array string[] - */ - public function getTopics() - { - if (!isset($this->_data['topics'])) { - $this->_getResource()->loadTopics($this); - } - /** if subscription doesn't have topics, $this->_data['topics'] can still be null. - * Therefore it is better to call _getData() to avoid exception - */ - return $this->_getData('topics'); - } - - /** - * Get the status of this endpoint, which should match one of the constants in \Magento\PubSub\SubscriptionInterface - * - * @return int - */ - public function getStatus() - { - return $this->_getData('status'); - } - - /** - * Object data getter - * - * If $key is not defined, method will return all the data as an array. - * Otherwise it will return value of the element specified by $key. - * It is possible to use keys like a/b/c for access nested array data. - * - * If $index is specified it will treat data as an array and retrieve - * corresponding member. If data is a string - it will be exploded by - * new line character and converted to array. - * - * @param string $key - * @param string|int $index - * @return mixed - */ - public function getData($key = '', $index = null) - { - $data = parent::getData($key, $index); - - switch ($key) { - case self::FIELD_ENDPOINT_URL: - return $this->getEndpointUrl(); - case self::FIELD_FORMAT: - return $this->getFormat(); - case self::FIELD_AUTHENTICATION_TYPE: - return $this->getAuthenticationType(); - case self::FIELD_API_USER_ID: - return $this->getApiUserId(); - case self::FIELD_TIMEOUT_IN_SECS: - return $this->getTimeoutInSecs(); - case '': - $data[self::FIELD_ENDPOINT_URL] = $this->getEndpointUrl(); - $data[self::FIELD_FORMAT] = $this->getFormat(); - $data[self::FIELD_AUTHENTICATION_TYPE] = $this->getAuthenticationType(); - $data[self::FIELD_API_USER_ID] = $this->getApiUserId(); - $data[self::FIELD_TIMEOUT_IN_SECS] = $this->getTimeoutInSecs(); - return $data; - default: - return $data; - } - } - - /** - * Set data by calling setter functions - * - * @param array $data - */ - protected function _setDataArray(array $data) - { - if (isset($data[self::FIELD_ENDPOINT_URL])) { - $this->setEndpointUrl($data[self::FIELD_ENDPOINT_URL]); - } - if (isset($data[self::FIELD_FORMAT])) { - $this->setFormat($data[self::FIELD_FORMAT]); - } - if (isset($data[self::FIELD_AUTHENTICATION_TYPE])) { - $this->setAuthenticationType($data[self::FIELD_AUTHENTICATION_TYPE]); - } - if (isset($data[self::FIELD_API_USER_ID])) { - $this->setApiUserId($data[self::FIELD_API_USER_ID]); - } - if (isset($data[self::FIELD_TIMEOUT_IN_SECS])) { - $this->setTimeoutInSecs($data[self::FIELD_TIMEOUT_IN_SECS]); - } - } -} diff --git a/app/code/Magento/Webhook/Model/Subscription/Config.php b/app/code/Magento/Webhook/Model/Subscription/Config.php deleted file mode 100644 index 638168d7eb1ae..0000000000000 --- a/app/code/Magento/Webhook/Model/Subscription/Config.php +++ /dev/null @@ -1,183 +0,0 @@ -_subscriptionSet = $subscriptionSet; - $this->_config = $config; - $this->_subscriptionFactory = $subscriptionFactory; - $this->_logger = $logger; - } - - /** - * Checks if new subscriptions need to be generated from config files - * - * @return \Magento\Webhook\Model\Subscription\Config - */ - public function updateSubscriptionCollection() - { - foreach ($this->_config->getSubscriptions() as $alias => $subscriptionData) { - try { - $this->_validateConfigData($subscriptionData, $alias); - $subscriptions = $this->_subscriptionSet->getSubscriptionsByAlias($alias); - if (empty($subscriptions)) { - // add new subscription - $subscription = $this->_subscriptionFactory->create() - ->setAlias($alias) - ->setStatus(\Magento\Webhook\Model\Subscription::STATUS_INACTIVE); - } else { - // get first subscription from array - $subscription = current($subscriptions); - } - - // update subscription from config - $this->_updateSubscriptionFromConfigData($subscription, $subscriptionData); - } catch (\LogicException $e){ - $this->_logger->logException(new \Magento\Webhook\Exception($e->getMessage())); - } - } - return $this; - } - - /** - * Validates config data by checking that $data is an array and that 'data' maps to some value - * - * @param mixed $data - * @param string $alias - * @throws \LogicException - */ - protected function _validateConfigData($data, $alias) - { - // We can't demand that every possible value be supplied as some of these can be supplied - // at a later point in time using the web API - if (!( is_array($data) && isset($data['name']))) { - throw new \LogicException(__( - "Invalid config data for subscription '%1'.", $alias - )); - } - } - - /** - * Configures a subscription - * - * @param \Magento\Webhook\Model\Subscription $subscription - * @param array $rawConfigData - * @return \Magento\Core\Model\AbstractModel - */ - protected function _updateSubscriptionFromConfigData( - \Magento\Webhook\Model\Subscription $subscription, - array $rawConfigData - ) { - // Set defaults for unset values - $configData = $this->_processConfigData($rawConfigData); - - $subscription->setName($configData['name']) - ->setFormat($configData['format']) - ->setEndpointUrl($configData['endpoint_url']) - ->setTopics($configData['topics']) - ->setAuthenticationType($configData['authentication_type']) - ->setRegistrationMechanism($configData['registration_mechanism']); - - return $subscription->save(); - } - - /** - * Sets defaults for unset values - * - * @param array $configData - * @return array - */ - private function _processConfigData($configData) - { - $defaultData = array( - 'name' => null, - 'format' => \Magento\Outbound\EndpointInterface::FORMAT_JSON, - 'endpoint_url' => null, - 'topics' => array(), - 'authentication_type' => \Magento\Outbound\EndpointInterface::AUTH_TYPE_NONE, - 'registration_mechanism' => \Magento\Webhook\Model\Subscription::REGISTRATION_MECHANISM_MANUAL, - ); - - if (isset($configData['topics'])) { - $configData['topics'] = $this->_getTopicsFlatList($configData['topics']); - } - - return array_merge($defaultData, $configData); - } - - /** - * Convert topics into acceptable form for subscription - * - * @param array $topics - * @return array - */ - protected function _getTopicsFlatList(array $topics) - { - $flatList = array(); - - foreach ($topics as $topicGroup => $topicNames) { - $topicNamesKeys = array_keys($topicNames); - foreach ($topicNamesKeys as $topicName) { - $flatList[] = $topicGroup . '/' . $topicName; - } - } - - return $flatList; - } -} diff --git a/app/code/Magento/Webhook/Model/Subscription/Options/Status.php b/app/code/Magento/Webhook/Model/Subscription/Options/Status.php deleted file mode 100644 index 92bba2a655493..0000000000000 --- a/app/code/Magento/Webhook/Model/Subscription/Options/Status.php +++ /dev/null @@ -1,59 +0,0 @@ -_translator = $translator; - } - - /** - * Return statuses array - * - * @return array - */ - public function toOptionArray() - { - return array( - \Magento\Webhook\Model\Subscription::STATUS_ACTIVE => __('Active'), - \Magento\Webhook\Model\Subscription::STATUS_REVOKED => __('Revoked'), - \Magento\Webhook\Model\Subscription::STATUS_INACTIVE => __('Inactive'), - ); - } -} diff --git a/app/code/Magento/Webhook/Model/User.php b/app/code/Magento/Webhook/Model/User.php deleted file mode 100644 index 1cb0c47ee9404..0000000000000 --- a/app/code/Magento/Webhook/Model/User.php +++ /dev/null @@ -1,88 +0,0 @@ -_user = $userFactory->create(); - $this->_user->load($webapiUserId); - $roleLocator = $roleLocatorFactory->create(array( - 'data' => array('roleId' => $this->_user->getRoleId()) - )); - - $this->_authorization = $authorizationFactory->create(array( - 'aclPolicy' => $aclPolicy, - 'roleLocator' => $roleLocator - )); - } - - /** - * Returns a shared secret known only by Magento and this user - * - * @return string A shared secret that both the user and Magento know about - */ - public function getSharedSecret() - { - return $this->_user->getSecret(); - } - - /** - * Checks whether this user has permission for the given topic - * - * @param string $topic Topic to check - * @return bool True if permissions exist - */ - public function hasPermission($topic) - { - return $this->_authorization->isAllowed($topic); - } -} diff --git a/app/code/Magento/Webhook/Model/User/Factory.php b/app/code/Magento/Webhook/Model/User/Factory.php deleted file mode 100644 index 7754604e98426..0000000000000 --- a/app/code/Magento/Webhook/Model/User/Factory.php +++ /dev/null @@ -1,57 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create a new instance of \Magento\Webhook\Model\User - * - * @param int $webapiUserId webapi user id - * @return \Magento\Webhook\Model\User - */ - public function create($webapiUserId) - { - return $this->_objectManager->create('Magento\Webhook\Model\User', array('webapiUserId' => $webapiUserId)); - } -} diff --git a/app/code/Magento/Webhook/Model/Webapi/EventHandler.php b/app/code/Magento/Webhook/Model/Webapi/EventHandler.php deleted file mode 100644 index e8039f0ff5944..0000000000000 --- a/app/code/Magento/Webhook/Model/Webapi/EventHandler.php +++ /dev/null @@ -1,94 +0,0 @@ -_subscriptionSet = $subscriptionSet; - $this->_resourceAclUser = $resourceAclUser; - } - - /** - * Notifies the event handler that a webapi user has changed - * - * @param \Magento\Webapi\Model\Acl\User $user User object that changed - */ - public function userChanged($user) - { - // call helper that finds and notifies subscription (user_id) - $this->_validateSubscriptionsForUsers(array($user->getId())); - } - - /** - * Notifies the event handler that a webapi role has changed - * - * @param \Magento\Webapi\Model\Acl\Role $role Role object that changed - */ - public function roleChanged($role) - { - // get all users that contain this role (role_id) - $users = $this->_resourceAclUser->getRoleUsers($role->getId()); - - // for each user, call helper that finds and notifies subscription (user_id) - $this->_validateSubscriptionsForUsers($users); - } - - /** - * Finds all Subscriptions for the given users, and validates that these subscriptions are still valid. - * - * @param array $userIds users to check against - */ - protected function _validateSubscriptionsForUsers(array $userIds) - { - $subscriptions = $this->_subscriptionSet->getApiUserSubscriptions($userIds); - - /** @var \Magento\Webhook\Model\Subscription $subscription */ - foreach ($subscriptions as $subscription) { - if ($subscription->findRestrictedTopics()) { - $subscription->deactivate(); - $subscription->save(); - } - } - } -} diff --git a/app/code/Magento/Webhook/Model/Webapi/EventHandler/Factory.php b/app/code/Magento/Webhook/Model/Webapi/EventHandler/Factory.php deleted file mode 100644 index 6411effef8f9c..0000000000000 --- a/app/code/Magento/Webhook/Model/Webapi/EventHandler/Factory.php +++ /dev/null @@ -1,57 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create a new instance of \Magento\Webhook\Model\Webapi\EventHandler - * - * @param array $arguments Fed into constructor - * @return \Magento\Webhook\Model\Webapi\EventHandler - */ - public function create(array $arguments = array()) - { - return $this->_objectManager->create('Magento\Webhook\Model\Webapi\EventHandler', $arguments); - } -} diff --git a/app/code/Magento/Webhook/Model/Webapi/User/Factory.php b/app/code/Magento/Webhook/Model/Webapi/User/Factory.php deleted file mode 100644 index 6283aa9f5a546..0000000000000 --- a/app/code/Magento/Webhook/Model/Webapi/User/Factory.php +++ /dev/null @@ -1,226 +0,0 @@ -_ruleFactory = $ruleFactory; - $this->_userFactory = $userFactory; - $this->_roleFactory = $roleFactory; - $this->_cache = $cache; - $this->_mathRandom = $mathRandom; - $this->_initVirtualResourceMapping($resourceProvider); - } - - /** - * Creates a new user and role for the subscription associated with this Webapi. - * - * @param array $userContext Information needed to create a user: email, company, secret, key - * @param array $topics Resources the user should have access to - * @return int Webapi user id - * @throws \Exception If a new user can't be created (because of DB issues for instance) - */ - public function createUser(array $userContext, array $topics) - { - // Company is an optional variable - $userContext[self::CONTEXT_COMPANY] = isset($userContext[self::CONTEXT_COMPANY]) - ? $userContext[self::CONTEXT_COMPANY] - : null; - - $role = $this->_createWebapiRole($userContext[self::CONTEXT_EMAIL], $userContext[self::CONTEXT_COMPANY]); - - try { - $this->_createWebapiRule($topics, $role->getId()); - $user = $this->_createWebapiUser($userContext, $role); - } catch (\Exception $e) { - $role->delete(); - throw $e; - } - - return $user->getId(); - } - - /** - * Creates a new \Magento\Webapi\Model\Acl\Role role with a unique name - * - * @param string $email - * @param string $company - * @return \Magento\Webapi\Model\Acl\Role - */ - protected function _createWebapiRole($email, $company) - { - $roleName = $this->_createRoleName($email, $company); - $role = $this->_roleFactory->create()->load($roleName, 'role_name'); - - // Check if a role with this name already exists, we need a new role with a unique name - if ($role->getId()) { - $uniqString = $this->_mathRandom->getUniqueHash(); - $roleName = $this->_createRoleName($email, $company, $uniqString); - } - - $role = $this->_roleFactory->create() - ->setRoleName($roleName) - ->save(); - - return $role; - } - - /** - * Creates a rule and associates it with a role - * - * @param array $topics - * @param int $roleId - * @return null - */ - public function _createWebapiRule(array $topics, $roleId) - { - $resources = array(); - foreach ($topics as $topic) { - $resources[] = isset($this->_topicMapping[$topic]) ? $this->_topicMapping[$topic] : $topic; - } - array_unique($resources); - - $resources = array_merge($resources, array( - 'webhook/create', - 'webhook/get', - 'webhook/update', - 'webhook/delete', - )); - - $this->_ruleFactory->create() - ->setRoleId($roleId) - ->setResources($resources) - ->saveResources(); - - /* Updating the ACL cache so that new role appears there */ - $this->_cache->clean(); - } - - /** - * Creates a webapi User in the DB - * - * @param array $userContext - * @param \Magento\Webapi\Model\Acl\Role $role - * @return \Magento\Core\Model\AbstractModel - */ - protected function _createWebapiUser(array $userContext, $role) - { - $user = $this->_userFactory->create() - ->setRoleId($role->getId()) - ->setApiKey($userContext[self::CONTEXT_KEY]) - ->setSecret($userContext[self::CONTEXT_SECRET]) - ->setCompanyName($userContext[self::CONTEXT_COMPANY]) - ->setContactEmail($userContext[self::CONTEXT_EMAIL]) - ->save(); - return $user; - } - - /** - * Create unique role name - * - * @param string $email - * @param string $prefix - * @param string $suffix - * @return string - */ - protected function _createRoleName($email, $prefix = null, $suffix = null) - { - $result = ''; - if ($prefix) { - $result = $prefix . self::NAME_DELIM; - } - - $result .= $email; - - if ($suffix) { - $result .= self::NAME_DELIM . $suffix; - } - return $result; - } - - /** - * Initialize our virtual resource to merchant visible resource mapping array. - * - * @param \Magento\Webapi\Model\Acl\Resource\Provider $resourceProvider - */ - protected function _initVirtualResourceMapping( - \Magento\Webapi\Model\Acl\Resource\Provider $resourceProvider - ) { - $virtualResources = $resourceProvider->getAclVirtualResources(); - foreach ($virtualResources as $resource) { - $virtualResource = $resource['id']; - $parentResource = $resource['parent']; - $this->_topicMapping[$virtualResource] = $parentResource; - } - } -} diff --git a/app/code/Magento/Webhook/Service/SubscriptionV1.php b/app/code/Magento/Webhook/Service/SubscriptionV1.php deleted file mode 100644 index ed4e82d273430..0000000000000 --- a/app/code/Magento/Webhook/Service/SubscriptionV1.php +++ /dev/null @@ -1,329 +0,0 @@ -_subscriptionFactory = $subscriptionFactory; - $this->_subscriptionSet = $subscriptionSet; - } - - /** - * Create a new Subscription - * - * @param array $subscriptionData - * @return array Subscription data - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - */ - public function create(array $subscriptionData) - { - try { - $subscription = $this->_subscriptionFactory->create($subscriptionData); - - $this->_validateTopics($subscription); - - $subscription->save(); - - return $subscription->getData(); - } catch (\Magento\Core\Exception $exception) { - // These messages are already translated, we can simply surface them. - throw $exception; - } catch (\Exception $exception) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * Get all Subscriptions associated with a given api user. - * - * @param int $apiUserId - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - * @return array of Subscription data arrays - */ - public function getAll($apiUserId) - { - try { - $result = array(); - $subscriptions = $this->_subscriptionSet->getApiUserSubscriptions($apiUserId); - - /** @var \Magento\Webhook\Model\Subscription $subscription*/ - foreach ($subscriptions as $subscription) { - $result[] = $subscription->getData(); - } - - return $result; - } catch (\Magento\Core\Exception $e) { - // These messages are already translated, we can simply surface them. - throw $e; - } catch (\Exception $e) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * Update a Subscription. - * - * @param array $subscriptionData - * @return array Subscription data - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - */ - public function update(array $subscriptionData) - { - try { - $subscription = $this->_loadSubscriptionById($subscriptionData['subscription_id']); - $subscription->addData($subscriptionData); - - $this->_validateTopics($subscription); - - $subscription->save(); - - return $subscription->getData(); - } catch (\Magento\Core\Exception $e) { - // These messages are already translated, we can simply surface them. - throw $e; - } catch (\Exception $e) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * Get the details of a specific Subscription. - * - * @param int $subscriptionId - * @return array Subscription data - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - */ - public function get($subscriptionId) - { - try { - $subscription = $this->_loadSubscriptionById($subscriptionId); - return $subscription->getData(); - } catch (\Magento\Core\Exception $e) { - // These messages are already translated, we can simply surface them. - throw $e; - } catch (\Exception $e) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * Delete a Subscription. - * - * @param int $subscriptionId - * @return array Subscription data - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - */ - public function delete($subscriptionId) - { - try { - $subscription = $this->_loadSubscriptionById($subscriptionId); - $subscriptionData = $subscription->getData(); - - $subscription->delete(); - - return $subscriptionData; - } catch (\Magento\Core\Exception $e) { - // These messages are already translated, we can simply surface them. - throw $e; - } catch (\Exception $e) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * Activate a subscription. - * - * @param int $subscriptionId - * @return array - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - */ - public function activate($subscriptionId) - { - try { - $subscription = $this->_loadSubscriptionById($subscriptionId); - - $subscription->activate(); - $subscription->save(); - return $subscription->getData(); - } catch (\Magento\Core\Exception $e) { - // These messages are already translated, we can simply surface them. - throw $e; - } catch (\Exception $e) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * De-activate a subscription. - * - * @param int $subscriptionId - * @return array - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - */ - public function deactivate($subscriptionId) - { - try { - $subscription = $this->_loadSubscriptionById($subscriptionId); - - $subscription->deactivate(); - $subscription->save(); - return $subscription->getData(); - } catch (\Magento\Core\Exception $e) { - // These messages are already translated, we can simply surface them. - throw $e; - } catch (\Exception $e) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * Revoke a subscription. - * - * @param int $subscriptionId - * @return array - * @throws \Exception|\Magento\Core\Exception - * @throws \Magento\Webhook\Exception - */ - public function revoke($subscriptionId) - { - try { - $subscription = $this->_loadSubscriptionById($subscriptionId); - - $subscription->revoke(); - $subscription->save(); - return $subscription->getData(); - } catch (\Magento\Core\Exception $e) { - // These messages are already translated, we can simply surface them. - throw $e; - } catch (\Exception $e) { - // These messages have no translation, we should not expose our internals but may consider logging them. - throw new \Magento\Webhook\Exception( - __('Unexpected error. Please contact the administrator.') - ); - } - } - - /** - * Returns trues if a given userId is associated with a subscription - * - * @param int $apiUserId - * @param int $subscriptionId - * @throws \Magento\Webhook\Exception - */ - public function validateOwnership($apiUserId, $subscriptionId) - { - $subscription = $this->_loadSubscriptionById($subscriptionId); - if ($subscription->getApiUserId() != $apiUserId) { - throw new \Magento\Webhook\Exception( - __("User with id %1 doesn't have permission to modify subscription %2", $apiUserId, $subscriptionId) - ); - } - } - - /** - * Validates all the topics for a Subscription are Authorized. - * - * If invalid topics exists, an exception will be thrown. - * - * @param \Magento\Webhook\Model\Subscription $subscription - * @throws \Magento\Webhook\Exception - */ - private function _validateTopics(\Magento\Webhook\Model\Subscription $subscription) - { - $invalidTopics = $subscription->findRestrictedTopics(); - if (!empty($invalidTopics)) { - $listOfTopics = implode(', ', $invalidTopics); - throw new \Magento\Webhook\Exception( - __('The following topics are not authorized: %1', $listOfTopics) - ); - } - } - - /** - * Load subscription by id. - * - * @param int $subscriptionId - * @throws \Magento\Webhook\Exception - * @return \Magento\Webhook\Model\Subscription - */ - protected function _loadSubscriptionById($subscriptionId) - { - $subscription = $this->_subscriptionFactory->create()->load($subscriptionId); - if (!$subscription->getId()) { - throw new \Magento\Webhook\Exception( - __("Subscription with ID '%1' doesn't exist.", $subscriptionId) - ); - } - return $subscription; - } - -} diff --git a/app/code/Magento/Webhook/Service/SubscriptionV1Interface.php b/app/code/Magento/Webhook/Service/SubscriptionV1Interface.php deleted file mode 100644 index 7c8596032832c..0000000000000 --- a/app/code/Magento/Webhook/Service/SubscriptionV1Interface.php +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webhook/etc/adminhtml/menu.xml b/app/code/Magento/Webhook/etc/adminhtml/menu.xml deleted file mode 100644 index 996ecfc759d11..0000000000000 --- a/app/code/Magento/Webhook/etc/adminhtml/menu.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Webhook/etc/adminhtml/routes.xml b/app/code/Magento/Webhook/etc/adminhtml/routes.xml deleted file mode 100644 index 504fa4f315b3b..0000000000000 --- a/app/code/Magento/Webhook/etc/adminhtml/routes.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/code/Magento/Webhook/etc/crontab.xml b/app/code/Magento/Webhook/etc/crontab.xml deleted file mode 100644 index 89e4e08a13933..0000000000000 --- a/app/code/Magento/Webhook/etc/crontab.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - * * * * * - - - * * * * * - - - */15 * * * * - - - */15 * * * * - - diff --git a/app/code/Magento/Webhook/etc/di.xml b/app/code/Magento/Webhook/etc/di.xml deleted file mode 100644 index 51dafbf59c884..0000000000000 --- a/app/code/Magento/Webhook/etc/di.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - Magento\Outbound\Formatter\Json - - - - - - - JSON - - - - - - - Magento\Outbound\Authentication\Hmac - - - - - - - HMAC SHA256 - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webhook/etc/events.xml b/app/code/Magento/Webhook/etc/events.xml deleted file mode 100644 index 94bf8bbb98088..0000000000000 --- a/app/code/Magento/Webhook/etc/events.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webhook/etc/frontend/routes.xml b/app/code/Magento/Webhook/etc/frontend/routes.xml deleted file mode 100644 index a6ea3884f0470..0000000000000 --- a/app/code/Magento/Webhook/etc/frontend/routes.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/code/Magento/Webhook/etc/module.xml b/app/code/Magento/Webhook/etc/module.xml deleted file mode 100755 index b18c83866ff35..0000000000000 --- a/app/code/Magento/Webhook/etc/module.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webhook/etc/webapi.xml b/app/code/Magento/Webhook/etc/webapi.xml deleted file mode 100644 index 91337f8f30d88..0000000000000 --- a/app/code/Magento/Webhook/etc/webapi.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - /:subscriptionId - /:subscriptionId - /:subscriptionId - - diff --git a/app/code/Magento/Webhook/etc/webapi/acl.xml b/app/code/Magento/Webhook/etc/webapi/acl.xml deleted file mode 100644 index 985a39ed7a9d5..0000000000000 --- a/app/code/Magento/Webhook/etc/webapi/acl.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Webhook/schema/service/SubscriptionV1.xsd b/app/code/Magento/Webhook/schema/service/SubscriptionV1.xsd deleted file mode 100644 index ab46c8a7b4962..0000000000000 --- a/app/code/Magento/Webhook/schema/service/SubscriptionV1.xsd +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Subscription ID - - - - - Subscription Alias - - - - - Subscription Name - - - - - Subscription subscribed topics - - - - - Subscription Status - - - - - Subscription Endpoint URL - - - - - Subscription Retry Timeout in Seconds - - - - - Subscription Authentication Type - - - - - Subscription Format - - - - - - - - - - Subscription Topic - - - - - - diff --git a/app/code/Magento/Webhook/sql/webhook_setup/install-1.0.0.0.php b/app/code/Magento/Webhook/sql/webhook_setup/install-1.0.0.0.php deleted file mode 100644 index 5f261019d9890..0000000000000 --- a/app/code/Magento/Webhook/sql/webhook_setup/install-1.0.0.0.php +++ /dev/null @@ -1,238 +0,0 @@ -startSetup(); - -/* @var $connection \Magento\DB\Adapter\AdapterInterface */ -$connection = $this->getConnection(); - -/** - * Create new table 'webhook_subscription' - */ -$subscriptionTable = $connection->newTable($this->getTable('webhook_subscription')) - ->addColumn('subscription_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, - array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), - 'Subscription Id') - ->addColumn('name', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, - array('nullable' =>false), - 'Subscription Name') - ->addColumn('registration_mechanism', \Magento\DB\Ddl\Table::TYPE_TEXT, 40, - array('nullable' =>false), - 'Registration Mechanism') - ->addColumn('status', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, - array('unsigned' => true, 'nullable' => false, 'default' => 0), - 'Status') - ->addColumn('alias', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array(), - 'Alias') - ->addColumn('updated_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array(), - 'Updated At') - ->addColumn('endpoint_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, - array('nullable' => true,'default' => NULL,'unsigned' => true), - 'Subscription Endpoint') - ->addForeignKey( - $this->getFkName('webhook_subscription', 'endpoint_id', 'outbound_endpoint', 'endpoint_id'), - 'endpoint_id', - $this->getTable('outbound_endpoint'), - 'endpoint_id', - \Magento\DB\Ddl\Table::ACTION_SET_NULL, - \Magento\DB\Ddl\Table::ACTION_CASCADE) - ->addIndex( - $this->getIdxName('webhook_subscription', array('alias')), - array('alias') - ) - ->addIndex( - $this->getIdxName('webhook_subscription', array('status')), - array('status') - ) - ->setOption('collate', null) - ->setOption('comment', 'Subscription'); -$connection->createTable($subscriptionTable); - -/** - * Create table 'webhook_subscription_hook' - */ -$hookTable = $connection->newTable($this->getTable('webhook_subscription_hook')) - ->addColumn('hook_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, array( - 'identity' => true, - 'unsigned' => true, - 'nullable' => false, - 'primary' => true, - ), 'Hook Id') - ->addColumn('subscription_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( - 'unsigned' => true, - 'nullable' => false, - ), 'Subscription Id') - ->addColumn('topic', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, array( - ), 'Hook Topic') - ->addIndex( - $this->getIdxName('webhook_subscription_hook', array('topic')), - array('topic')) - ->addForeignKey( - $this->getFkName('webhook_subscription_hook', 'subscription_id', 'webhook_subscription', 'subscription_id'), - 'subscription_id', - $this->getTable('webhook_subscription'), - 'subscription_id', - \Magento\DB\Ddl\Table::ACTION_CASCADE, - \Magento\DB\Ddl\Table::ACTION_CASCADE - ) - ->setOption('collate', null) - ->setOption('comment', 'Webhook'); -$connection->createTable($hookTable); - -/** - * Create table 'webhook_event' - */ -$eventTable = $connection->newTable($this->getTable('webhook_event')) - ->addColumn('event_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, - array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), - 'Event Id') - ->addColumn('topic', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, - array('nullable' => false), 'Hook Topic') - ->addColumn('body_data', \Magento\DB\Ddl\Table::TYPE_VARBINARY, '4M', - array('nullable' => false), - 'Serialized Data Array') - ->addColumn('headers', \Magento\DB\Ddl\Table::TYPE_TEXT, '16k', array(), - 'Headers') - ->addColumn('options', \Magento\DB\Ddl\Table::TYPE_TEXT, '16k', array(), - 'Options') - ->addColumn('status', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, array('nullable' => false), - 'Status') - ->addColumn('updated_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array('nullable' => false), - 'Updated At') - ->addColumn('created_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array('nullable' => false), - 'Created At') - ->addIndex($this->getIdxName('webhook_event', array('status')), array('status')) - ->setOption('collate', null) - ->setOption('comment', 'Queued Event Data'); -$connection->createTable($eventTable); - -/** - * Create table 'webhook_dispatch_job' - */ -$dispatchJobTable = $connection->newTable($this->getTable('webhook_dispatch_job')) - ->addColumn('dispatch_job_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, array( - 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), - 'Dispatch Job Id') - ->addColumn('event_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, - array('unsigned' => true, 'nullable' => false), - 'Event Id') - ->addColumn('subscription_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, - array('unsigned' => true, 'nullable' => false), - 'Subscription Id') - ->addColumn('status', \Magento\DB\Ddl\Table::TYPE_SMALLINT, null, - array('nullable' => false, 'default' => '0'), - 'Status') - ->addColumn('retry_count', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, - array('unsigned' => true, 'nullable' => false), - 'Retry Count') - ->addColumn('updated_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, - array('default' => \Magento\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE, 'nullable' => false), - 'Updated At') - ->addColumn('created_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, - array('default' => '0000-00-00 00:00:00', 'nullable' => false), - 'Created At') - ->addColumn('retry_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, - array('default' => '0000-00-00 00:00:00', 'nullable' => false), - 'Retry At') - ->addForeignKey( - $this->getFkName('webhook_dispatch_job', 'subscription_id', 'webhook_subscription', 'subscription_id'), - 'subscription_id', - $this->getTable('webhook_subscription'), - 'subscription_id', - \Magento\DB\Ddl\Table::ACTION_CASCADE, - \Magento\DB\Ddl\Table::ACTION_CASCADE - ) - ->addForeignKey( - $this->getFkName('webhook_dispatch_job', 'event_id', 'webhook_event', 'event_id'), - 'event_id', - $this->getTable('webhook_event'), - 'event_id', - \Magento\DB\Ddl\Table::ACTION_CASCADE, - \Magento\DB\Ddl\Table::ACTION_CASCADE - ) - ->addIndex( - $this->getIdxName('webhook_dispatch_job', array('status')), - array('status') - ) - ->addIndex( - $this->getIdxName('webhook_dispatch_job', array('retry_at')), - array('retry_at') - ) - ->setOption('collate', null) - ->setOption('comment', 'Dispatch Jobs'); -$connection->createTable($dispatchJobTable); - -/** - * Create table 'outbound_endpoint' * - */ -$outboundEndpointTbl = $connection->newTable($this->getTable('outbound_endpoint')) - ->addColumn('endpoint_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, 10, - array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), - 'Endpoint Id') - ->addColumn('name', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, - array('nullable' =>false), - 'Endpoint Name') - ->addColumn('endpoint_url', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, - array('nullable' =>false), - 'Endpoint URL') - ->addColumn('authentication_type', \Magento\DB\Ddl\Table::TYPE_TEXT, 40, - array('nullable' =>false), - 'Authentication Type') - ->addColumn('format', \Magento\DB\Ddl\Table::TYPE_TEXT, 40, - array('nullable' =>false), - 'Data Format') - ->addColumn('status', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, - array('unsigned' => true, 'nullable' => false, 'default' => 0), - 'Status') - ->addColumn('api_user_id', \Magento\DB\Ddl\Table::TYPE_INTEGER, null, array( - 'unsigned' => true, 'nullable' => true), - 'Webapi User Id') - ->addColumn('updated_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, null, array(), - 'Updated At') - ->addColumn( - 'timeout_in_secs', - \Magento\DB\Ddl\Table::TYPE_INTEGER, - null, - array( 'nullable' => false, 'default' => 5), - 'Timeout in seconds') - ->addIndex( - $this->getIdxName('outbound_endpoint', array('endpoint_id'), - \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE), - array('endpoint_id'), - array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) - ->addForeignKey( - $this->getFkName('outbound_endpoint', 'api_user_id', 'webapi_user', 'user_id'), - 'api_user_id', - $this->getTable('webapi_user'), - 'user_id', - \Magento\DB\Ddl\Table::ACTION_SET_NULL, - \Magento\DB\Ddl\Table::ACTION_CASCADE) - ->setOption('collate', null) - ->setOption('comment', 'Endpoint for outbound messages'); -$connection->createTable($outboundEndpointTbl); - -$this->endSetup(); diff --git a/app/code/Magento/Webhook/view/adminhtml/css/boxes.css b/app/code/Magento/Webhook/view/adminhtml/css/boxes.css deleted file mode 100644 index 23fa8bf7f02d7..0000000000000 --- a/app/code/Magento/Webhook/view/adminhtml/css/boxes.css +++ /dev/null @@ -1,1858 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -/***************** WIDGETS ****************** - Loading Indicator - Tables - Grid ( ubiquitous, massaction and dynamic) - Accordion - Tabs ( vertical and horizontal ) - Messages - Forms ( setter and elements) - Switcher - Space - Boxes - Scroller -*/ - -/**************** STRUCTURE ***************** - Layout - Header & Footer - Columns - Headings -*/ - -/************** PAGE-SPECIFIC *************** - Login - Sales - Catalog - Customers - Newsletter - System -*/ - -/********** ALIGNMENT AND CLEARS ***********/ - - -/******************************************************************/ -/**************************** WIDGETS *****************************/ -/******************************************************************/ - - -/* LOADING INDICATOR -*******************************************************************/ -#loading-process { - position:absolute; - top:45%; - left:50%; - margin-left:-60px; - border:2px solid #f1af73; - padding:15px 60px; - background:#fff4e9; - color:#d85909; - font-size:1.1em; - font-weight:bold; - text-align:center; - z-index:501; - } -#loading-mask, -.loading-mask { - background:background:url(../images/blank.gif) repeat; - position:absolute; - color:#d85909; - font-size:1.1em; - font-weight:bold; - text-align:center; - opacity:0.80; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE8 */ - z-index:500; - } -#loading-mask .loader, -.loading-mask .loader { - position:fixed; - top:45%; - left:50%; - width:150px; - margin-left:-105px; - padding:15px 30px; - background:#fff4e9; - border:2px solid #f1af73; - color:#d85909; - font-weight:bold; - text-align:center; - z-index:1000; - } -.loading-mask .loader { - position:absolute; - } -.loading-mask { - *filter:alpha(opacity=60); - -moz-opacity:.6; - opacity:.6; - -webkit-opacity:.6; - background: #ffffff; - } -#message-popup-window-mask { position:absolute; top:0; right:0; bottom:0; left:0; width:100%; height:100%; z-index:980; background-color:#efefef; opacity:.5; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";/*IE8*/ } -.message-popup { position:absolute; z-index:990; width:407px; top:-9999em; left:50%; margin:0 0 0 -203px; background:#f3bf8f; padding:0 4px 4px; } -.message-popup.show { top:280px; } -.message-popup .message-popup-head { padding:1px 0; } -.message-popup .message-popup-head h2 { padding:0 10px; margin:0; font:bold 12px/19px Arial, Helvetica, sans-serif; color:#644f3b; } -.message-popup .message-popup-head a { float:right; border:1px solid #ea7601; padding:0 12px 0 7px; background:url(../images/bkg_btn-close.gif) 0 50% repeat-x !important; font:normal 12px/17px Arial, Helvetica, sans-serif; color:#fff; text-decoration:none !important; cursor:pointer; } -.message-popup .message-popup-head a span { float:left; background:url(../images/bkg_btn-close2.gif) 0 50% no-repeat; padding-left:19px; } -.message-popup .message-popup-content { background:#fdf4eb; padding:21px 21px 10px; } -.message-popup .message-popup-content .message-icon { float:left; width:50px; padding:47px 0 0; background-position:50% 0; background-repeat:no-repeat; font-size:10px; line-height:12px; text-transform:uppercase; text-align:center; overflow:hidden; } -.message-popup .message-popup-content .message-critical { color:#e41101; } -.message-popup .message-popup-content .message-major { color:#f55600; } -.message-popup .message-popup-content .message-minor { color:#ff9e22; } -.message-popup .message-popup-content .message-notice { color:#659601; } -.message-popup .message-popup-content .message-text { float:right; width:295px; min-height:4.5em; overflow:hidden; color:#644f3b; } -.message-popup .message-popup-content .read-more { margin:7px 0 0; text-align:right; } -.message-popup .message-popup-content .read-more a { background:url(../images/more_arrow.gif) 0 50% no-repeat; padding-left:14px; text-decoration:underline; } -.message-popup .message-popup-content .read-more a:hover { text-decoration:none; } - -/* TABLES -*******************************************************************************/ - -/* Grid - General */ -.grid { border-bottom:0; padding-bottom:.5em; } -.grid table { width:100%; border:1px solid #cbd3d4; border-bottom:none; } -.grid table.border { border:1px solid #cbd3d4; } -.grid tbody { background:#fff; } /* Zebra odd-row */ -.grid tr.even, .grid tr.even tr { background:#f6f6f6; } /* Zebra even-row */ -.grid tr.on-mouse { background:#fcf5dd; cursor:pointer; } /* Rows mouse-over */ -.grid tr.invalid { background-color:#f5d6c7; } -.grid th, .grid td { padding:2px 4px 2px 4px; } -.grid th { white-space:nowrap; } -.grid td.editable input.input-text { width:50px !important; margin-left:4px !important; } -.grid td input.input-text { width:86%; } -.grid td input.input-text-export-filter { width:272px; } -.grid td input.input-text-range { width:104px; } -.grid td input.input-text-range-date { width:87px; } -.grid td input.input-inactive { background:#eee; } -.grid table td { border-width:0 1px 1px 0; border-color:#dadfe0; border-style:solid; } -.grid table.border td { background:#fff !important; } -.grid table td.first, -.grid table td.last { border-right:0; } -.grid table td.product { text-align:right; } -.grid table td.empty-text { padding:15px; } -.grid table td .action-select { width:100%; } -.grid .separator { padding:0 4px; color:#b9b9b9; } - -.grid tbody.odd tr { background:#fff !important; } -.grid tbody.even tr { background:#f6f6f6 !important; } -.grid tbody.odd tr td, -.grid tbody.even tr td { border-bottom:0; } -.grid tbody.odd tr.border td, -.grid tbody.even tr.border td { border-bottom:1px solid #dadfe0; } - - -/* Grid - Pager and Buttons row */ -table.actions { width:100%; margin:.5em 0; } -table.actions td { vertical-align:top; } -.pager select { width:4em!important; margin:0 4px; } -.pager input.page { width:2em !important; } -.pager .arrow { margin:0 3px; vertical-align:middle; } - - -/* Grid - Headings */ -.grid tr.headings { background:url(../images/sort_row_bg.gif) 0 50% repeat-x; } -.grid tr.headings th { border-width:1px; border-color:#f9f9f9 #d1cfcf #f9f9f9 #f9f9f9; border-style:solid; padding-top:1px; padding-bottom:0; font-size:.9em; } -.grid tr.headings th.last { border-right:0; } -.grid tr.headings th.no-link { /* Grid th with no sorting functionality */ padding-top:2px; padding-bottom:1px; color:#67767e; } -.grid tr.headings th span.nobr { display:block; /* FF3 fix */ } -.grid tr.headings th a { display:block; padding:2px 4px 1px 0; color:#2d444f; text-decoration:none; } -.grid tr.headings th a:hover { color:#d85909; text-decoration:none; } -.grid tr.headings th a.sort-arrow-desc, -.grid tr.headings th a.sort-arrow-asc { background:url(../images/sort_on_bg.gif) 0 0 no-repeat; border-bottom:1px solid #fff; border-right:1px solid #fff; padding-bottom:2px; } -.grid tr.headings th span.sort-title { display:block; padding:3px 12px 4px 0; line-height:1; } -.grid tr.headings th a.sort-arrow-desc span.sort-title, -.grid tr.headings th a.sort-arrow-asc span.sort-title { background-position:right 50%; background-repeat:no-repeat; padding:3px 12px 2px 8px; } -.grid tr.headings th a.sort-arrow-desc span.sort-title { background-image:url(../images/grid_sort_desc.gif); } -.grid tr.headings th a.sort-arrow-asc span.sort-title { background-image:url(../images/grid_sort_asc.gif); } - - -/* Grid - Mass Action */ -.massaction { width:100%; height:26px; border:1px solid #d1cfcf; border-bottom:none; background:url(../images/massaction_bg.gif) repeat-x 0 100% #ebebeb; font-size:.9em; } -.massaction td { width:50%; border-top:1px solid #fff; padding:1px 8px; vertical-align:middle; } -.massaction .entry-edit fieldset .select { width:auto; /*width:120px;*/ display:inline; } -.massaction .entry-edit fieldset select.validation-failed { border:1px dashed #eb340a !important; background:#faebe7 !important } -.massaction .entry-edit fieldset { margin:0; padding:0; background:none; border:none; } -.massaction .entry-edit fieldset .field-row { display:inline; } -.massaction .entry-edit .field-row label { float:none; width:auto; margin-left:13px; } -.massaction .entry-edit { margin:0 !important; padding:0; } -.massaction .entry-edit .validation-advice { display:none !important; } -.massaction a { text-decoration:none; } -.massaction .entry-edit fieldset span.form_row, -.massaction .entry-edit fieldset span.field-row { clear:none !important; display:inline; float:left !important; margin:0; padding:0 5px 0 0; } - -.massaction .entry-edit .outer-span { float:left; } - -/* Grid - Filter */ -.grid tr.filter { background:url(../images/filter_row_bg.gif) repeat-x #e3eff1; cursor:default; } -.grid tr.filter th { padding-top:5px; padding-bottom:5px; border:1px solid #bdbdbd; border-width:0 1px 1px 0; white-space:normal; } -.grid tr.filter th.last { border-right:0; } -.grid tr.filter input.input-text { width:85%; } -.grid tr.filter select { width:100%; } -.grid tr.filter .range .range-line { margin-bottom:3px; width:100px; } -.grid tr.filter .range div.date { min-width:121px; } -.grid tr.filter .range input { float:right; width:50px !important; margin-top:0; } -.grid tr.filter .range select { float:right; width:56px !important; margin-top:0; } -.grid tr.filter .range .label { display:block; width:36px; float:left; padding-left:2px; } -.grid tr.filter .date img { width:15px; height:15px; cursor:pointer; vertical-align:middle; } -.grid .head-massaction select { width:auto !important; max-width:90px; } -.grid select.select-export-filter, -.grid select.multiselect-export-filter { width:278px; } - -/* Grid Footer */ -.grid table tfoot tr { background:#D7E5EF; } -.grid table tfoot tr td { border-top:1px solid #9babb9; background:#e5ecf2; line-height:1.7em; } -.grid table.border tfoot tr td { background:#D7E5EF !important; } - - -/* Dynamic Grid */ /* Used in pages like Catalog -> Attributes */ -.dynamic-grid th { padding:2px;width:100px; } -.dynamic-grid td { padding:2px; } -.dynamic-grid td input { width:94px; } -tr.dynamic-grid td, -tr.dynamic-grid th { padding:2px 10px 2px 0; width:auto; } -tr.dynamic-grid input.input-text { width:154px; } -.available { color:#080; font-weight:bold; } -.not-available { color:#800; } - - -/* ACCORDION -*******************************************************************************/ -dl.accordion .grid { margin-bottom:0; } -dl.accordion dt, -.entry-edit .entry-edit-head { background:#6f8992; padding:2px 10px; } -dl.accordion dt, div.collapseable { margin-top:1px; } -dl.accordion dt a, div.collapseable a { background:url(../images/entry_edit_head_arrow_down.gif) 100% 50% no-repeat; color:#fff; display:block; font-weight:bold; text-decoration:none; } -div.disabled { background:#c6cbc9 !important; } -div.disabled a { background-image:url(../images/entry_edit_head_arrow_down2.gif) !important; color:#f6f6f6 !important; } - -.entry-edit fieldset.collapseable { margin-bottom:10px; } - -dl.accordion dt a:hover, div.collapseable a:hover { color:#fff; text-decoration:none; } -dl.accordion dt.open a, div.collapseable a.open { background:url(../images/entry_edit_head_arrow_up.gif) 100% 50% no-repeat; } -dl.accordion dd { display:none; } -dl.accordion dd.open { display:block; } -img.accordion-btn { float:right; margin-top:1px; margin-right:5px; } - -/* TABS -*******************************************************************************/ - -/* Vertical Tabs */ -ul.tabs { border-top:1px solid #bebebe; background-color:#e7efef; } -ul.tabs a, ul.tabs span { display:block; } -ul.tabs a, ul.tabs a:hover { text-decoration:none; } -/* ul.tabs a.notloaded { color:#999; } */ -ul.tabs a, ul.tabs a:hover { color:#000; } -ul.tabs, ul.tabs a { background:url(../images/tabs_link_bg.gif) repeat-y 100% #E7EFEF; } -ul.tabs a:hover { background-color:#D8E6E6; background-image:url(../images/tabs_link_over_bg.gif); } -ul.tabs a.active, -ul.tabs .ui-state-active a { padding:0; border-bottom:1px solid #bebebe; background:none; } -ul.tabs a:hover.active, -ul.tabs .ui-state-active a:hover { padding:0; } -ul.tabs span { background:url(../images/tabs_span_bg.gif) repeat-x 0 100%; padding:.3em 0.5em .28em 1.5em; cursor:pointer; } -ul.tabs span em { float:right; } -ul.tabs a.active span, -ul.tabs a:hover.active span, -ul.tabs .ui-state-active a span, -ul.tabs .ui-state-active a:hover span { background:#fff; font-weight:bold; } -ul.tabs a.subitem { padding-left:2.2em; } -ul.tabs span.changed, -ul.tabs span.error, -ul.tabs span.loading { float:right; background:0; padding:0; } -ul.tabs a.changed span.changed { background:url(../images/fam_bullet_disk.gif) 0 0 no-repeat !important; width:16px; height:16px; } -ul.tabs a.error span.error { background:url(../images/fam_bullet_error.gif) 0 0 no-repeat !important; width:16px; height:16px; } -ul.tabs a.ui-tabs-loading span.loading { background:url(../images/loader-small.gif) 0 0 no-repeat !important; width:16px; height:16px; } -ul.tabs a.changed { font-style:italic; } - -/* Horizontal Tabs */ -ul.tabs-horiz { margin:0 0 18px 0; background:url(../images/horiz_tabs_ul_bg.gif) repeat-x 0 100% #f8f8f8; padding:8px 0 0 5px; } -ul.tabs-horiz li { float:left; margin:0 4px; } -ul.tabs-horiz li a { display:block; background:#e2e2e2; border:1px solid #ccc; padding:2px 10px; color:#333 !important; text-decoration:none !important; } -ul.tabs-horiz li a.notloaded { /* not used for now */ } -ul.tabs-horiz li a.active, -ul.tabs-horiz .ui-state-active a { border-bottom:1px solid #fff; background:#fff; } - - -/* MESSAGES -*******************************************************************************/ -.notification-global { padding:5px 27px 5px 47px; background:#fff9e9 url(../images/error_msg_icon.gif) 27px 5px no-repeat; border-bottom:1px solid #eee2be; border-top:1px solid #eee2be; font-size:11px; line-height:16px; margin:0 0 -3px; color:#444; position:relative; } -.notification-global-notice { background-image:url(../images/note_msg_icon.gif); } -.notification-global .label { color:#eb5e00; } -.notification-global .clickable { cursor:pointer; } -.notification-global span.critical { color:#d20000; } -.notification-global a:hover { text-decoration:none; } - -.error, -a.error span, -.required, -.validation-advice, -label.mage-error { color:#D40707 !important; font-weight:bold !important; } -label.mage-error {width: auto !important; display: block;} -.notice { color:#ea7601} -.messages ul { border:0 !important; } -.messages li { min-height:23px !important; margin-bottom:11px !important; padding:8px 8px 2px 32px !important; font-size:.95em !important; font-weight:bold !important; } -.messages ul li { margin:0 0 3px 0 !important; border:0 !important; padding:0 !important; } -.error-msg { border:1px solid #f16048 !important; color:#df280a !important; background:#faebe7 url(../images/error_msg_icon.gif) no-repeat 10px 10px !important; } -.success-msg { border:1px solid #95a486 !important; color:#3d6611 !important; background:#eff5ea url(../images/success_msg_icon.gif) no-repeat 10px 10px !important; } -.notice-msg { border:1px solid #ffd967 !important; background:#fffbf0 url(../images/note_msg_icon.gif) no-repeat 10px 10px !important; color:#3d6611 !important; } -.warning-msg { border:1px solid #666e73 !important; background:#e6e6e6 url(../images/warning_msg_icon.gif) no-repeat 10px 10px !important; color:#000000 !important; } -.validation-advice, -label.mage-error { clear:both; min-height:15px; margin:3px 0 0 9px; background:url(../images/validation_advice_bg.gif) no-repeat 2px 1px; padding-left:16px; font-size:.95em; font-weight:bold; line-height:1.25em; } -input.validation-failed, textarea.validation-failed { background:#fef0ed; border:1px dashed #d6340e; } - -/* Noscript Notice */ -.noscript { border:1px solid #000; border-width:0 0 1px; background:#ffff90; font-size:12px; line-height:1.25; text-align:center; color:#2f2f2f; } -.noscript .noscript-inner { width:900px; margin:0 auto; padding:12px 0 12px; background:url(../images/i_notice.gif) 20px 50% no-repeat; } -.noscript p { margin:0; } - -/* For Demo store only */ -.demo-notice { margin:0; background:#d75f07; padding:5px 10px 6px 10px; color:#fff; line-height:1em; text-align:center; } - - -/* FORMS -*******************************************************************************/ -select.countries option { background-repeat:no-repeat; } -.entry-edit .fieldset .tree li, -.entry-edit .tree li { margin:0; } - - -/* Entry Edit */ /* Site-wide form fieldset */ -table.form-edit { width:100%; } -.box, -.entry-edit fieldset, -.entry-edit .fieldset { padding:10px 15px; margin-bottom:15px; } -.entry-edit .entry-edit-head h4 { float:left; padding:0; background:none; margin:0; color:#fff; font-size:1em; line-height:18px; min-height:0; } -.entry-edit .entry-edit-head .tools { float:right;} -.entry-edit .entry-edit-head strong, -.entry-edit .entry-edit-head a { color:#fff; font-size:1em; line-height:18px; min-height:0; font-weight:bold} -.entry-edit .entry-edit-head .entry-edit-head-link {height:41px; margin:-41px 0 0; position: absolute; visibility: hidden;} -.entry-edit .content { margin-left:0 !important; padding:10px 15px; } -.entry-edit fieldset li, -.entry-edit .fieldset li { margin:4px 0; } -.entry-edit fieldset span.form_row, -.entry-edit .fieldset span.form_row, -.entry-edit fieldset .field-row .hint, -.entry-edit .fieldset .field-row .hint { float:left; color:#999; padding-left:12em; } -.entry-edit .form-buttons { float:right; margin:2px -3px 2px 0pt; } -label.inline { float:none !important; width:auto !important; } -.nested-content .entry-edit { margin-left:2em; } -.nested-content .entry-edit .entry-edit { margin-left:0; } -#coupon_container .entry-edit { min-width:310px; } - -/* Form Elements */ -input.input-text,textarea,select { border-width:1px; border-style:solid; border-color:#aaa #c8c8c8 #c8c8c8 #aaa; background:#fff; font:12px arial, helvetica, sans-serif; } -select { min-height:17px; /* to set the height for empty selects */ } -input.input-text,textarea { padding:2px; } -input.qty { width:40px !important; } -input.item-qty { width:22px !important; } -input.price { width:50px !important; text-align:right; } -input[type=text].disabled { background:#eee; } -select optgroup { font-style:normal; } -select optgroup option { padding-left:10px; } -select optgroup option.even { background:#f6f6f6; } /* Zebra even-row */ -select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd; } -.checkboxes li { margin:0 0 5px !important; } -.field-100 { background-color:#fff; border-width:1px; border-style:solid; border-color:#aaa #c8c8c8 #c8c8c8 #aaa; padding:2px; } -.field-100 textarea, -.field-100 input.input-text { float:left; width:100% !important; border:0 !important; padding:0 !important; } -@media screen and (-webkit-min-device-pixel-ratio:0) { - select option:disabled, - select:disabled option { color:#c9c9c9!important;color:#cacaca!important; text-shadow:2px 2px 2px #000; } -} - -/* Form List */ /* Table for default form data */ -.form-list { width:auto; border:0 !important; } -.form-list td.label, -.form-list td.value, -.form-list td.value2, -.form-list td.note, -.form-list td.scope-label, -.form-list td.use-default { border:0 !important; padding-top:5px !important; padding-bottom:5px !important; padding-left:5px !important; background:0 !important; } -.form-list td.hidden { border:0 !important; padding:0 !important; background:0 !important; } -.form-list td.label { width:200px; } -.form-list td.label label { display:block; width:185px; padding-right:15px; } -.form-list td.value input.input-text, -.form-list td.value textarea { width:274px; } -.form-list td.value textarea { height:15em; } -.form-list td.value select { width:280px; } -.form-list td.value select.select-date { width:87px; } -.form-list td.note { background:url(../images/note_cell_bg.gif) 6px 10px no-repeat !important; padding-left:18px; } -.form-list td.scope-label { padding-left:5px; color:#6f8992; font-size:.9em; } -.form-list p.note { margin:0; padding:0 0 0 13px; background:url(../images/note_bg.gif) 1px 6px no-repeat; font-size:11px; } - -.columns .form-list { width:auto; } -.columns .form-list td.value { width:280px; padding-right:5px !important; } -.columns .form-list td.value .next-toinput { width:75px; display:inline; margin-right:5px; } -.columns .form-list td.value .next-toselect input.input-text { width:195px!important; display:inline; } - -.fieldset-wide .form-list { width:100% !important; } -.fieldset-wide .form-list td.value { width:auto !important; } -.fieldset-wide .form-list td.value input.input-text, -.fieldset-wide .form-list td.value textarea { width:98% !important; } -#weight {width: 110px !important; } -/*.fieldset-wide .form-list td.value select { display:block; }*/ -.fieldset-wide .form-list td.scope-label { white-space:nowrap; width:1px; } -.fieldset-wide .form-list td.note { width:120px; } - -.multi-input { margin-bottom:8px; } /* Example: Address fields with 2 input lines */ -.grid tr .form-list tr { background:#fff !important; } /* Follows grid row background-color */ -.grid tr.even .form-list tr { background:#f6f6f6 !important; } /* Follows grid row background-color */ -.grid tr.on-mouse .form-list tr { background:#fcf5dd !important; } /* Follows grid row background-color */ -.grid tr .form-list { margin:8px 0; } -.field-row { display:block; margin-bottom:5px; } -span.delete-image, -span.delete-file { display:block; white-space:nowrap; padding-left:25px; } -span.delete-file { padding:0; } - -/* Back compatibility with span forms */ -.entry-edit .field-row { display:block; } -.entry-edit .field-row label { float:left; width:150px; } - -/* Form Button */ -.content-buttons.form-buttons, -.content-header .form-buttons { text-align:right; margin-bottom:0; } -.content-header .content-buttons-placeholder { display:inline !important; } -.content-header .form-buttons { float:right; } -.content-header td.form-buttons { float:none; } -.content-header .form-buttons button { margin-bottom:3px; } -.sub-btn-set { border:1px solid #ddd; border-width:0 1px; background:url(../images/sub_button_bg.gif) repeat; padding:3px 10px; text-align:right; } -button, -.form-button { vertical-align:middle; border-width:1px; border-style:solid; border-color:#ed6502 #a04300 #a04300 #ed6502; padding:0 7px 1px 7px; background:#ffac47 url(../images/btn_bg.gif) repeat-x 0 100%; color:#fff; font:bold 12px arial, helvetica, sans-serif; cursor:pointer; text-align:center !important; white-space:nowrap; } -button:hover { background:#f77c16 url(../images/btn_over_bg.gif) repeat-x 0 0; } -button:active { background:#f77c16 url(../images/btn_on_bg.gif) repeat-x 0 0; } -button span { line-height:1.35em; background-repeat:no-repeat; background-position:0 50%; } -button span span { background:none !important; padding:0 !important; margin:0 !important; display:inline !important; } -button.delete, -button.save, -button.add { padding-left:6px; } -button.cancel span, -button.delete span, -button.save span, -button.add span, -button.back span, -button.add-image span, -button.add-widget span { padding-left:20px; } -/* Google Chrome specific fix for empty buttons */ -button.add span:after, -button.delete span:after { display:inline-block; clear:both; content:"."; font-size:0; line-height:0; height:0; overflow:hidden; } -button.back { border-color:#ccc #aaa #aaa #ccc; background-color:#fff; background-image:url(../images/btn_back_bg.gif); color:#555; } -button.back span { background-image:url(../images/icon_btn_back.gif); } -button.fail, -button.cancel, -button.delete { border-color:#d24403 #a92000 #a92000 #d24403; background-image:url(../images/cancel_btn_bg.gif); background-color:#fcaf81; color:#fff; } -button.fail:hover, -button.cancel:hover, -button.delete:hover { background-image:url(../images/cancel_btn_over_bg.gif); } -button.fail:active, -button.cancel:active, -button.delete:active { background-image:url(../images/cancel_btn_active_bg.gif); background-color:#e0612f; } -button.cancel span, -button.delete span { background-image:url(../images/cancel_btn_icon.gif); } -button.add span { background-image:url(../images/add_btn_icon.gif); } -button.save span { background-image:url(../images/save_btn_icon.gif); } -button.show-hide span { background-image:url(../images/btn_show-hide_icon.gif); padding-left:26px; } -button.add-image span { background-image:url(../images/btn_add-image_icon.gif); } -button.add-widget span { background-image:url(../images/btn_add-widget_icon2.gif); padding-left:24px; } -button.add-variable span { background-image:url(../images/btn_add-variable_icon.gif); padding-left:26px; } -button.go span { background-image:url(../images/btn_go.gif); padding-left:16px; } -button.btn-chooser { display:block; margin:0 0 10px; } -button.success { background-image:url(../images/btn_gr_bg.gif); border-color:#46745E; } -button.success:hover { background:url(../images/btn_gr_over.gif) #6cac46; } -button.success:active { background:url(../images/btn_gr_on.gif) repeat-x 0 0 #3fa05e; } - -button.disabled, -button.disabled:hover, -button.disabled:active { border-color:#777 #505050 #505050 #777; background:#919191 url(../images/btn_bg-disabled.gif) 0 0 repeat-x; color:#fff; cursor:default; opacity:.8; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"; } -button.add.disabled span { background-image:url(../images/add_btn_icon-disabled.gif); } - -button.loading > span { padding-left:20px; background-image: url(../images/btn_loading-icon.gif) !important;} - -button.icon-btn { width:32px !important; } -button.icon-btn span { text-indent:-999em; display:block; width:16px; padding:0; overflow:hidden; } - -.buttons-set { margin:0 0 10px; } -.buttons-set button { margin-right:5px; } - - -/* Buttons group */ - -.btn-add { padding-left:6px; } -.btn-add span { - background-image:url(../images/add_btn_icon.gif); - padding-left:20px; -} -div.button { - border-width:1px; - border-style:solid; - order-color:#ed6502 #a04300 #a04300 #ed6502; - padding:1px 7px 3px 7px; - background:#ffac47 url(../images/btn_bg.gif) repeat-x 0 100%; - color:#fff; - font:bold 12px arial, helvetica, sans-serif; - cursor:pointer; - text-align:center !important; - white-space:nowrap; -} -div.button:hover { - background:#f77c16 url(../images/btn_over_bg.gif) repeat-x 0 0; -} -div.button:active { - background:#f77c16 url(../images/btn_on_bg.gif) repeat-x 0 0; -} -div.button span { - line-height:1.25em; - background-repeat:no-repeat; - background-position:0 50%; -} -div.button { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.buttons-group { - position: relative; - display:inline-block; - vertical-align:middle; -} -.buttons-group:before, -.buttons-group:after { - display: table; - content: ""; -} -.buttons-group:after { - clear: both; -} -.buttons-group > .button { - position:relative; - float:left; - margin-left:-1px; - border-radius:0; -} -.buttons-group > .button:first-child { - margin-left:0; -} -.buttons-group > .button:last-child, -.buttons-group > [data-toggle="dropdown"] { -} - -/* Button toggle (with dropdown menu) */ -.dropdown-menu { - position:absolute; - display:none; - list-style:none; - margin:1px 0 0 0; - padding:0; - right:0; - top:100%; - min-width: 100%; - border-width:1px; border-style:solid; border-color:#ed6502 #a04300 #a04300 #ed6502; - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - white-space: nowrap; -} -.dropdown-menu li { - background:#ffac47; - background:rgba(255, 172, 71, .95); - text-align: left;color:#fff; font:bold 12px arial, helvetica, sans-serif; cursor:pointer; - padding:0; - position: relative; - z-index: 1; -} -.dropdown-menu li .item { - display: block; - padding:4px 25px 4px 8px; -} -.dropdown-menu li > .tooltip { - position: absolute; top:5px; right:3px; -} -.dropdown-menu li.selected { -} -.dropdown-menu li:hover { - background:#f77c16; - z-index: 2; -} -.dropdown-menu li:active { - background:#f77c16; -} -.dropdown-menu li:last-child { - -} -.dropdown-menu-top { - margin:0 0 3px 0; - top:auto; - bottom:100%; -} -.buttons-group.active { - z-index:20; -} -.buttons-group.active .dropdown-menu { - display:block; -} -.btn-toggle span { - width:6px; overflow: hidden; display: block; -} -.active .btn-toggle { - background:#f77c16 url(../images/btn_on_bg.gif) repeat-x 0 0; -} -.btn-toggle span:before { - display: inline-block; - content:''; - margin-left:100px; - /*position: absolute;*/ - text-indent: 0; - margin-left:0; - width: 0; - height: 0; - border-right:3px solid transparent; - border-left:3px solid transparent; - border-top: 6px solid #fff; -} - -/* ============================================================================= - Tooltip - ========================================================================== */ - -/* Styles for simple "css" tooltip */ -.tooltip { - display:inline-block; - vertical-align:middle; - line-height:1.1; -} -.tooltip > .help { - width:15px; - height: 15px; - line-height: 15px; - text-indent: -999em; - overflow: hidden; - display: block; - background: url(../images/icon-tooltip.png) no-repeat 0 0; - position: relative; z-index: 111; - cursor:help; -} -.tooltip-content { - display:none; - position:absolute; - max-width:200px; - margin-top:5px; - margin-left:-18px; - padding:8px; - border-radius:3px; - background:#000; - background:rgba(0,0,0,.8); - color:#fff; - text-shadow:none; - z-index:20; - font-weight: normal; - font-size: 11px; -} -.tooltip-content:before { - content:''; - position:absolute; - width:0; - height:0; - top:-5px; - left:20px; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-bottom: 5px solid #000; - opacity:.8; -} -.tooltip:hover { - z-index:20; -} -.tooltip:hover > .help { - background-position: 0 -15px; -} -.tooltip > .help:hover + .tooltip-content { - display:block; -} - - -/* SWITCHER -*******************************************************************************/ -.switcher { margin-bottom:10px; border:1px solid #cddddd; background:#e7efef; padding:10px; } -.side-col .switcher { padding-right:26px; } -.side-col .switcher label { display:block; } -.side-col .switcher .link-store-scope { float:right; margin-right:-19px; margin-left:3px; } -.side-col .switcher select { width:100%; float:left; } -/*.side-col .switcher { margin-right:20px; margin-bottom:20px; }*/ -.catalog-categories .side-col .switcher { margin-right:0; margin-bottom:15px; } -.link-store-scope { display:inline-block; vertical-align:middle; margin:0 0 1px; width:16px; height:16px; background:url(../images/i_question-mark.png) 0 0 no-repeat; text-decoration:none !important; text-indent:-999em; overflow:hidden; } -.store-scope .link-store-scope { float:left; margin-right:10px; } -.store-scope .tree-store-scope { float:left; padding:7px 10px; border:1px dotted #dedede; } -.store-scope table.stores-tree { float:left; width:auto !important; } -.form-list td.value .store-scope { white-space:nowrap; } -.form-list td.value .link-store-scope { float:none; margin-right:0; vertical-align:top; margin-top:6px; } - - -/* SPACE -*******************************************************************************/ -.box-left, .box-right { width:48.5%; } -.box-left { float:left; } -.box-right { float:right; } -.box-left .content, -.box-right .content { padding:6px 14px; } -.separator, .pipe { padding:0 6px; font-size:.9em; } /* vertical pipe */ -.divider { display:block; height:1px; margin:8px 0; background:#ddd; overflow:hidden; } /* horizontal pipe */ -td.divider { font-size:1px; line-height:0; } -.box, -.entry-edit fieldset, -.entry-edit .fieldset { border:1px solid #d6d6d6; background:#fafafa; } - - -/* SCOLLER */ /* Used primarily in Sales -> Order -> Create Order */ /* -*******************************************************************************/ -.scroll-cont { - position:absolute; - top:-25px; - left:503px; - width:16px; - height:265px; - background:transparent url(../images/db-scroll-bg.gif) no-repeat top; - z-index:10000; - } -.auto-scroll { overflow:auto; height:11em; } -.root { position:relative; height:260px; margin:0; width:1px; } -.thumb { position:absolute; height:40px; width:16px; margin-top:-28px; z-index:11000; } -.up { margin-top:254px; height:16px; } -.dn { margin-top:0; padding:0; height:15px; } -.up a, .up a img, -.dn a, .dn a img, -.thumb a , -.thumb a img { border:0; } -.up a:active, .dn a:active { outline:none; } -.scrollContainer { - position:absolute; - left:0; - top:19px; - clip:rect(0 467px 200px 0); - overflow:auto; - border:0; - } -.scrollContent { position:absolute; left:0; top:0; } - -/* Horizontal scroll */ -.hor-scroll { width:100%; padding-bottom:4px; margin-bottom:-4px; } /* IE has personal style, see iestyles.css */ - - -/**/ -.note-list { width:100%; overflow:hidden; } -.note-list li { border-top:1px solid #e3e3e3; margin-top:9px !important; background:url(../images/icon_note_list.gif) no-repeat 0 4px; padding-bottom:9px; padding-left:18px; } - - - -/******************************************************************************/ -/********************************** STRUCTURE *********************************/ -/******************************************************************************/ - -/* LAYOUT -*******************************************************************************/ -.wrapper { min-width:960px; } -.wrapper-popup { min-width:750px; } -.header { background:url(../images/header_top_bg.gif) repeat-x #425e66; text-align:right; } -.middle { min-height:450px; background:url(../images/simple_container_bg.gif) repeat-x #fff; padding:23px 27px 0 27px; } -.middle-popup { border-bottom:3px solid #fff; background:url(../images/middle_bg.gif) repeat-x 0 100% #fff; padding:0 0 0 0; background:yellow; } -.container-collapsed { padding:1.8em 2.2em 1.8em 2em; padding-top:0; } -.columns {background:url(../images/side_col_bg.gif) repeat-y 217px 0; } - -div.side-col { float:left; width:220px; margin-right:-220px; padding-bottom:25px; } -div.main-col { margin-left:220px; min-height:450px; padding:0 0 25px 25px; } -div.main-col-inner { float:left; /* Fixes some inner clears in the liquid main-col */ width:100%; } - -.footer { clear:both; background:url(../images/footer_bg.gif) repeat-x #e6e6e6; padding:105px 2.8em 2.8em 2.8em; font-size:.95em; text-align:center; } -.simple-container-popup { min-height:50px !important; padding:1.8em 2.3em 6em 2.3em; background:url(../images/simple_container_bg.gif) repeat-x; } - -.page-popup { background:#fff; } - - -/******************************************************************************/ -/************************************* BOXES **********************************/ -/******************************************************************************/ - -/* HEADER & FOOTER -*******************************************************************************/ - -.logo { float:left; margin:5px 20px 5px 27px; height:43px; } -.header-top { border-bottom:1px solid #5F767F; } - -/* Header right */ -.header-right { padding:10px 25px 0 15px; font-size:.95em; color:#fff; } -.header-right a, .header-right a:hover { color:#fcce77; } -.header-right .separator { color:#999; } -.header-right fieldset { display:inline; padding-left:10px; } -.header-right fieldset input.input-text { width:18em; } -.header-right .super { - float:right; - line-height:1.8em; - margin-bottom:14px; - margin-left:1.3em; - } - -/* Search autocomplete */ -div.autocomplete { - z-index:10000; - position:absolute; - width:250px; - background-color:white; - border:1px solid #888; - margin:0; - padding:0; - } -div.autocomplete ul { margin:0; padding:0; } -div.autocomplete ul li.selected { background-color:#dcebf0; } -div.autocomplete ul li { padding:.5em .7em; min-height:32px; cursor:pointer; text-align:left; color:#2f2f2f; line-height:1.3em; } - -/* Mage suggest */ -/*.mage-suggest { position:relative; display: inline-block; background: #fff; border-radius: 5px; box-shadow: 1px 0 2px #ddd; } -.mage-suggest .input-text { border-radius: 5px; margin: 7px; border: 1px solid #ddd; height: 20px; padding: 3px 25px 3px 10px; line-height: 26px; background: url(../images/bkg_search-magnifier.png) 98% 50% no-repeat; } -.mage-suggest-dropdown { overflow-x: hidden; position: absolute; top: 100%; margin-top:-4px; left: 0; min-width: 100%; background: #fff; border: solid #ddd; border-width: 0 1px 1px; padding: 10px 0; box-sizing: border-box; border-radius: 0 0 5px 5px; box-shadow: 1px 1px 2px #ddd; } -.mage-suggest-dropdown.overflow-y { overflow-y: scroll; } -.mage-suggest-dropdown .ui-menu-item a { display:block; padding: 0 10px; text-decoration: none; font:normal 12px/26px Arial, sans-serif; text-align: left; border-bottom: 1px solid #f2f2f2; color:#2d2d2d; } -.mage-suggest-dropdown .ui-state-active, -.mage-suggest-dropdown .ui-state-focus { background: #f2f2f2; color:#000; }*/ -.mage-suggest-inner {padding: 5px 0;} -.mage-suggest {position: relative;} -.mage-suggest-inner {position: absolute; background: #fff; top:0px; left:0px; border: 1px solid #ddd; border-radius: 5px; box-shadow: 1px 1px 2px #ddd;} -.mage-suggest-inner > input { - height: 22px; - margin: 0 5px; -} -.mage-suggest-dropdown > h2 { - font-size:0.8em; - text-transform: uppercase; - font-family:Arial, Helvetica, sans-serif; - color: #555555; - font-weight: normal; - padding: 0 8px; -} -.mage-suggest-dropdown .ui-menu-item a { display:block; padding: 0 10px; text-decoration: none; font:normal 12px/26px Arial, sans-serif; text-align: left; border-bottom: 1px solid #f2f2f2; color:#2d2d2d; } -.mage-suggest-dropdown .ui-state-active, -.mage-suggest-dropdown .ui-state-focus { background: #f2f2f2; color:#000; } -.mage-suggest-dropdown .ui-corner-all { - border-radius: 0px; -} -.mage-suggest-dropdown .ui-widget-content, .mage-suggest-dropdown .ui-menu .ui-menu-item a, .mage-suggest-dropdown .ui-menu .ui-menu-item a.ui-state-focus { - background: #ffffff; - border: none; - color: #000000; -} -.mage-suggest-dropdown .ui-menu .ui-menu-item a, .mage-suggest-dropdown .ui-menu .ui-menu-item a.ui-state-focus { - border-top: 1px solid #efefef; - margin: 0; - padding: 3px 8px; -} -.mage-suggest-dropdown .ui-menu { - padding: 0px; - width: 100%; -} -.mage-suggest-dropdown .ui-menu .ui-menu-item a.ui-state-focus { - background: #ebebeb; -} -.mage-suggest-dropdown .show-all { - padding: 5px 8px; - color: #555555; - font-family:Arial, Helvetica, sans-serif; - font-size: 0.8em; -} -.mage-suggest-dropdown { - overflow: auto; - max-height: 500px; - z-index: 1; -} -.mage-suggest.category-select .mage-suggest-inner {background: transparent; position: static; border: none; border-radius: 0px; box-shadow: none;} -.mage-suggest.category-select .mage-suggest-choices {background: #fff; border: 1px solid #ddd; border-radius: 5px; box-shadow: none; overflow: hidden;} -.mage-suggest.category-select .mage-suggest-choices li {float: left; margin: 5px 0 5px 7px;} -.mage-suggest.category-select .mage-suggest-search-field input { - background: none repeat scroll 0 0 transparent !important; - border: 0 none; - box-shadow: none; - font-family: sans-serif; - font-size: 100%; - height: 22px; - margin: 1px 0; - outline: 0 none; - padding: 0 5; -} -.mage-suggest.category-select .mage-suggest-dropdown { - position: absolute; - width: 100%; - background: #fff; border: 1px solid #ddd; border-radius: 5px; - margin-top: 2px; -} -.mage-suggest-dropdown .jstree-default.jstree-focused { - background: #ffffff; -} -.mage-suggest-dropdown .jstree li { - margin-left: 18px; -} -.mage-suggest-dropdown .jstree > ul > li { - margin-left: 0px; -} -.mage-suggest-dropdown .jstree a { - padding: 2px 3px; -} -.mage-suggest-dropdown .jstree .jstree-hovered { - border: none; - background: #efefef; -} -.mage-suggest-dropdown .jstree .jstree-clicked { - border: none; - background: #e5e5e5; -} -.mage-suggest-dropdown .category-path { - color: #777777; - margin-left: 7px; - font-size: 11px; -} -.mage-suggest-dropdown .ui-menu { - float: none; -} -.mage-suggest-dropdown .ui-menu .ui-menu-item{ - margin: 0px; -} - -/* Footer */ -.footer .bug-report { float:left; width:35%; text-align:left; } -.footer .legality { float:right; width:35%; min-height:19px; padding-left:22px; text-align:right; } - -/* COLUMNS -********************************************************************************************/ - -.catalog-categories .side-col { width:25em; padding-right:25px; } /* Catalog/Categories */ -.catalog-categories .main-col { padding-left:25px; margin-left:25em; } /* Catalog/Categories */ -.order-summary .side-col { padding-right:25px; } /* Order/Create */ -.order-summary .main-col { padding-left:25px; } /* Order/Create */ - - -/* HEADINGS -********************************************************************************************/ - -/* Content Header */ -.content-header { margin-bottom:18px; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; border-bottom:4px solid #dfdfdf; padding-bottom:.25em; padding-top: 6px; } -.content-header table { width:100%; } -.content-header h3 { float:left; margin:.3em .5em 0 0; color:#eb5e00; font-size:1.25em; line-height:1.2em; } -.content-header .head h3 { float:none; } -.content-header .button-set { white-space:nowrap; text-align:right; } -.content-header .content-buttons { white-space:nowrap!important; margin:0; } -.content-header td.content-buttons { width:13%;white-space:nowrap!important; margin:0; } -.content-buttons button, -.content-header button, -.filter-actions button { margin:0 0 0 5px; } -.side-col .content-header { border-bottom:0; margin-right:12px; margin-bottom:.6em; } -.catalog-categories .side-col .content-header { margin-right:0; } /* Catalog/Categories */ - -.left-col-block { width:200px; } - -.content-header.fixed { padding:6px 8px; margin-bottom:0; border:0; position:fixed; left:0; top:0; width:100%; border-bottom:solid 1px #988753; z-index:100; z-index:auto\9; background:#fdfaa4; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; opacity:.85; z-index: 100; } -.content-header.fixed button { margin-top:3px; } -.content-header.fixed .content-buttons { float:right; } -.content-buttons { margin-bottom:5px; float:right; display:inline; white-space:nowrap; } -.content-header.fixed .form-buttons { padding-right:20px; } -.content-header.fixed h3 { margin: 0 0 0 20px; display:inline; } - - -/* Box Head */ -.box-head { margin-bottom:.6em; text-align:right; } -.box-head h4 { float:left; margin-bottom:0; } - - -/* Icon Head */ /* Headings with icon preceding text*/ -.icon-head { min-height:18px; background-repeat:no-repeat; background-position:0 0; padding-left:22px; } -.head-customer-address-list { background-image:url(../images/fam_house.gif); } -.head-edit-form { background-image:url(../images/fam_page_white.gif); } -.head-customer-view { background-image:url(../images/fam_status_online.gif); padding-left:18px; } -.head-customer, -.head-customer-groups { background-image:url(../images/fam_group.gif); } -.head-user { background-image:url(../images/fam_user.gif); } -.head-user-edit { background-image:url(../images/fam_user_edit.gif); } -.head-user-comment { background-image:url(../images/fam_user_comment.gif); } -.head-comment { background-image:url(../images/fam_comment.gif); } -.head-cart { background-image:url(../images/fam_cart.gif); } -.head-account { background-image:url(../images/fam_account.gif); } -.head-online-visitors { background-image:url(../images/fam_monitor.gif); } -.head-products { background-image:url(../images/fam_package.gif); } -.head-catalog-product { background-image:url(../images/fam_package.gif); } -.head-newsletter-queue { background-image:url(../images/fam_newspaper_go.gif); } -.head-newsletter-list { background-image:url(../images/fam_newspaper.gif); } -.head-newsletter-report { background-image:url(../images/fam_newspaper_error.gif); } -.head-tag, .head-tag-product { background-image:url(../images/fam_tag_orange.gif); } -.head-sales-order, -.head-sales-invoice { background-image:url(../images/fam_folder_table.gif); } -.head-categories { background-image:url(../images/fam_folder_database.gif); padding-left:20px; color:#253033 !important; } -.head-catalog-product-attribute { background-image:url(../images/fam_rainbow.gif); padding-left:24px; } -.head-product-attribute-sets { background-image:url(../images/fam_folder_palette.gif); padding-left:23px; } -.head-tax { background-image:url(../images/fam_money_add.gif); } -.head-cms-page, .head-cms-block { background-image:url(../images/application_view_tile.gif); } -.head-backups-control { background-image:url(../images/fam_server_database.gif); } -.head-money, .head-promo-quote { background-image:url(../images/fam_money.gif); } -.head-shipping-address, -.head-billing-address { background-image:url(../images/fam_house.gif); } -.head-shipping-method { background-image:url(../images/fam_lorry.gif); } -.head-payment-method { background-image:url(../images/fam_creditcards.gif); } -.head-order-date { background-image:url(../images/fam_calendar.gif); } -.head-customer-sales-statistics { background-image:url(../images/fam_money.gif); } -.head-notification { background-image:url(../images/fam_folder_table.gif); } -.head-compilation { background-image:url(../images/fam_package_go.gif); } - - - -/******************************************************************************/ -/********************************* PAGE SPECIFIC ******************************/ -/******************************************************************************/ - - -/* LOGIN -*******************************************************************************/ -#page-login { background:#f8f8f8; text-align:center; } -.login-container { width:581px; margin:170px auto; padding-left:32px; background:url(../images/login_logo.gif) no-repeat; } -.login-form { padding:27px 57px 35px 57px; background:url(../images/login_box_bg.jpg) no-repeat; text-align:left; } -.login-form .input-left { float:left; } -.login-form .input-right { float:right; } -.login-form .input-box input.input-text { width:224px; } -.login-form h2 { font-size:1.7em; font-weight:normal; } -.login-form label { font-weight:bold; } -.login-form .form-buttons { margin:12px 0 0 0; clear:both; text-align:right; } -.login-box .bottom { width:581px; height:5px; background:url(../images/login_box_bottom.jpg) no-repeat; overflow:hidden; } -.login-container .legal { margin:0; background:url(../images/login_box_legal_bg.gif) no-repeat; padding:8px 8px 5px 8px; font-size:.95em; } -.login-form .validation-advice, -.login-form label.mage-error { margin:3px 0 0 0; } -.login-form .forgot-link { margin:0 17px 0 0; text-align:right; } -.login-form .captcha { padding:10px 0 0; } -.login-form .captcha-image { border:1px solid #aaa; margin:1.5em 0 0; position:relative; } -.login-form .captcha-image img { vertical-align:bottom; } -.login-form .captcha-reload { cursor:pointer; position: absolute; top:2px; right:2px; } -.login-form .captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } - -@-webkit-keyframes rotate { - 0% { -webkit-transform:rotate(0); } - 0% { -webkit-transform:rotate(360deg); } -} -@-moz-keyframes rotate { - 0% { -moz-transform:rotate(0); } - 0% { -moz-transform:rotate(360deg); } -} -@keyframes rotate { - 0% { transform:rotate(0); } - 0% { transform:rotate(360deg); } -} - - -/* DASHBOARD -*******************************************************************************/ -.dashboard-container { border:1px solid #ccc; } -.dashboard-container .switcher { margin-bottom:0; border:0; } - -/* STORE MANAGEMENT -*******************************************************************************/ -.adminhtml-system-store-deletestore .content-footer .content-buttons, -.adminhtml-system-store-deletegroup .content-footer .content-buttons, -.adminhtml-system-store-deletewebsite .content-footer .content-buttons { float:left; } - - -/* SALES -*******************************************************************************/ - -/* Disabled block */ -.overlay span { display:block; width:100%; text-align:center; position:absolute; top:50%; margin:-5px 0 0; color:#000; } - -/* Prices */ -.price { white-space:nowrap !important; } - -/* Incl tax (for order tables) */ -.price-incl-tax { display:block; } -.price-incl-tax .label { display:block; white-space:nowrap; } -.price-incl-tax .price { /*display:block;*/ font-weight:bold; } - -/* Excl tax (for order tables) */ -.price-excl-tax { display:block; } -.price-excl-tax .label { display:block; white-space:nowrap; } -.price-excl-tax .price { /*display:block;*/ font-weight:bold; } - -/* Orders / Invoices / Shipments / Credit Memos Table */ -.order-tables td h5.title { font-size:1em; font-weight:bold; } -.order-tables td .option-label { font-weight:bold; font-style:italic; } -.order-tables td .option-value { padding-left:10px; } -.order-tables td .qty-table { border:0 !important; width:100% } -.order-tables td .qty-table td { border:0 !important; padding:0 4px !important; } - -dl.item-options dt { font-weight:bold; font-style:italic; } -dl.item-options dd { padding-left:10px; } - -ul.item-options li { padding-left:.7em; } - - -/* Create Order */ -.page-create-order .side-col { width:260px; background:none; padding:0; } -.page-create-order .main-col { padding-left:28px; } -.page-create-order .switcher { margin-bottom:25px; } -.create-order-sidebar-container { border:1px solid #d6d6d6; background:#fafafa; } -.create-order-sidebar-block .content { margin:0 !important; padding:4px 6px; } -.create-order-sidebar-block .head { border-top:1px solid #ddd; background:#ececec; padding:2px 6px 1px; font-size:.9em; text-align:right; } -.create-order-sidebar-block .head h5 { float:left; margin:0; color:#2c464f; text-align:left; } -.create-order-sidebar-block .content table td, -.create-order-sidebar-block table th { padding:0 3px 0 0; } -.create-order-sidebar-block select { width:170px; } -.create-order-sidebar-block ul { margin-left:20px; } -.order-choose-address { margin:0 0 10px 0;padding:8px 15px;background:#e7efef; } /*Address Selector */ -.order-save-in-address-book { margin:0 0 0 0;padding:8px 15px;background:#e7efef; } /* Save in Address Book Checkbox */ -.entry-edit .content .form-list { width:100%; } - -.entry-edit .order-address td.label label { width:100px; } -.entry-edit .order-address input.input-text, -.entry-edit .order-address .textarea { width:95% !important; } -.entry-edit .order-address .select { width:96.5%; } -.entry-edit .order-address .validate-vat { text-align:right; padding:10px 0 0; width:96%; } -.order-search-items .entry-edit .grid { height:610px; overflow:auto; } -.order-search-items .entry-edit .grid table { width:99.9%; } -/* .create-order-totals { background:url(../images/bg_create_order_totals.gif) repeat-y 50% 0 !important; } */ - -/* Product Configuration Popup */ -#popup-window-mask, -.popup-window-mask { background:url(../images/bg_window_mask.png) repeat 0 0; background:rgba(239, 239, 239, 0.5); position:absolute; top:0; right:0; bottom:0; left:0; width:100%; height:100%; z-index:399; } -.product-configure-popup { background:#fafafa; border:1px solid #d6d6d6; left:50%; margin:0 0 0 -271px; position:fixed; top:50%; width:540px; z-index:400; } -.product-configure-popup .validation-advice, -.product-configure-popup label.mage-error { margin-left:0; } -#product_composite_configure_messages { margin-left:0 !important; padding:10px 15px; } -.product-configure-popup .content { max-height:400px; overflow:auto; } -.product-configure-popup .content .grid { padding:0; } -.product-configure-popup .content .grid table { border-bottom:1px solid #CBD3D4; } -.product-configure-popup .product-options { border-bottom:1px solid #e7e7e7; margin:0 0 15px; padding:0 0 12px; } -.product-configure-popup .product-options .required { color:#333 !important; font-weight:normal !important; } -.product-configure-popup .product-options .required em { color:#d40707; } -.product-configure-popup .last-fieldset .product-options { border:0 none; margin-bottom:0; padding-bottom:0; } -.product-configure-popup .buttons-set { margin:0; padding:10px; } -.product-configure-popup .buttons-set button { margin:0 0 0 5px; } - -/* Gift Card Product */ -.giftcard-form .availability { font-weight:bold; margin-bottom:1em; } -.giftcard-form .in-stock { color:#1b6800; } -.giftcard-form .out-of-stock { color:#cf3a00; } -.giftcard-form .price-box { margin:1em 0; } -.giftcard-form label { float:left; width:25%; } - -.giftcard-amount-form { margin:0 0 10px; } -.giftcard-amount-form li { overflow:hidden; width:100%; } -.giftcard-amount-form .field { overflow:hidden; margin-bottom:10px; width:100%; } -.giftcard-amount-form .form-list .input-text { width:70px; } -.giftcard-amount-form .form-list select { width:150px; } -.giftcard-amount-form .form-list .input-box { float:left; width:75%; } -.giftcard-amount-form .form-list .input-box .v-fix { white-space:nowrap; } -.giftcard-amount-form .form-list .input-box p.notice { margin:5px 0 0; font-size:11px; white-space:nowrap; } -.giftcard-amount-form .form-list .input-box p.notice span { display:block; margin-right:5px; } - -.giftcard-send-form .field { overflow:hidden; margin-bottom:10px; width:100%; } -.giftcard-send-form .field .input-text { width:98%; } -.giftcard-send-form .form-list .input-box { float:left; width:75%; } -.giftcard-send-form .form-list textarea { height:100px; width:98%; } - -/* Product Options */ -.product-options { margin:10px 0 0; } -.product-options dt label { font-weight:bold; font-size:12px; } -.product-options dt .qty-holder { float:right; } -.product-options dt .qty-holder label { vertical-align:middle; } -.product-options dt .qty-disabled { background:none; border:0; padding:3px; color:#000; } -.product-options dd { margin:5px 0 15px; padding:0 0 12px; border-bottom:1px solid #e7e7e7; } -.product-options dd.last { border-bottom:0; margin-bottom:0; padding-bottom:0; } -.product-options dd .input-box { display:block; } -.product-options dd input.input-text { width:98%; } -.product-options dd input.datetime-picker { width:150px; } -.product-options dd .time-picker { display:-moz-inline-box; display:inline-block; padding:2px 0; vertical-align:middle; } -.product-options dd .time-picker select { vertical-align:middle; } -.product-options dd textarea { width:98%; height:8em; } -.product-options dd select { width:100%; } -.product-options .options-list {} -.product-options .options-list li { vertical-align:middle; margin:0; padding:2px 0; line-height:1.315; } -.product-options .options-list input.radio { float:left; margin:2px -18px 0 0; } -.product-options .options-list input.checkbox { float:left; margin:2px -20px 0 0; } -.product-options .options-list .label { display:block; margin-left:20px; } -.product-options li { margin:3px 0; } - -/* Wishlist Bundle Product Options */ -.bundle-product-options { padding:5px 0 0 13px; } -.bundle-product-options dl { padding:5px 0 0 15px; } -.bundle-product-options dt { color:#111; } -.bundle-product-options dd { color:#5b5b5b; margin-bottom:10px; } - -/* Order Totals */ -.order-totals { margin-left:auto; border:1px solid #d7c699 !important; padding:12px 0; background:#fcfac9; text-align:right; } -.order-totals table { border:none; background:none; margin-left:auto; } -.order-totals table td { padding:3px 20px 3px 10px; } -.order-totals table td.label { white-space:normal; padding:3px 10px 3px 20px; } -.order-totals table td.last { padding:2px 6px; } -.order-totals-bottom { padding:0 20px; } -.order-totals table .validation-advice, -.order-totals table label.mage-error { text-align:right; white-space:nowrap; background-position:100% 1px; padding-right:14px; padding-left:0; } -.grand-total, .grand_total { font-size:1.2em; font-weight:bold; color:#eb4d00 !important; } - -/* Shopping cart total summary row expandable to details */ -.summary-total { cursor:pointer; } -.summary-total td { padding-top:5px !important; padding-bottom:5px !important; } -.summary-total .summary-collapse { float:right; padding-left:20px; background:url(../images/bg_collapse.gif) 0 4px no-repeat; text-align:right; cursor:pointer; } -.show-details .summary-collapse { background-position:0 -52px; } -.show-details td { border-top:1px solid #eae1b2; } -.summary-details td { font-size:11px; background-color:#fdfcdf; } -.summary-details-first td { border-top:1px solid #eae1b2; } - -/* Order Constants */ -.payment-methods dt { margin-bottom:3px; } -.payment-methods dd { margin-left:20px; } -.payment-methods .validation-advice, -.payment-methods label.mage-error { margin-left:2px; } - -/* Cards List */ -.cards-list .offset { margin-left:10px; } -.cards-list .info-table td { padding:2px 7px 2px 0; text-align:left; vertical-align:top; } - -.release-amounts { margin:0.5em 0; } - -/* Centinel */ -.centinel .authentication { background:#fff; } -.centinel .authentication iframe { width:99%; height:400px; background:transparent !important; margin:0 0 7px !important; padding:0 !important; border:1px solid #ddd !important; } - -/* Gift Messages */ -.giftmessage-order-create .entire-order, -.giftmessage-order-create .each-order-item { background-color:#eee; padding:6px 14px; height:275px; } -.giftmessage-order-create .entire-order .entry-edit, -.giftmessage-order-create .each-order-item .scroll { height:250px; overflow:auto; } -.giftmessage-order-create .single { width:100%; float:left; padding:1.2em 1.5em; } -.giftmessage-order-create h5 { font-size:12px; font-weight:normal; line-height:1.5; margin-bottom:10px; } -.giftmessage-order-create h6 { font-size:11px; font-weight:normal; line-height:1.55; background-color:#cfcfcf; margin-bottom:10px; padding:2px 6px; width:95%; } -.giftmessage-order-create .fieldset { padding:0; } -.giftmessage-order-create .form-list { width:100%; } -.giftmessage-order-create .form-list td.label label { width:100px; } -.giftmessage-order-create .form-list td.value input.input-text, -.giftmessage-order-create .form-list td.value textarea { width:95%; } - -.giftmessage-single-item { padding:0 !important; } -.giftmessage-single-item .item-container { cursor:auto; } -.giftmessage-single-item .item-text { padding:2px 4px; } -.giftmessage-single-item .gift-form { margin-top:3px; background:#f7f6f4 url(../images/gift-message-grid-column-bg.gif) 0 0 repeat-x; } -.giftmessage-single-item .gift-form .entry-edit fieldset { border:none !important; margin-bottom:0; background:none !important; padding:15px; } -.giftmessage-single-item .gift-form .entry-edit fieldset .last { margin-bottom:0; } -.giftmessage-single-item .gift-form .entry-edit input.input-text { width:75% !important; } -.giftmessage-single-item .gift-form .entry-edit textarea { width:96% !important; } -.giftmessage-single-item .action-link-holder {} -.giftmessage-single-item .action-link { padding-right:10px; background:url(../images/gift-message-expand.gif) 100% 50% no-repeat; cursor:pointer; } -.giftmessage-single-item .open { background:url(../images/gift-message-collapse.gif) 100% 50% no-repeat; } - -.giftmessage-whole-order-container .entry-edit input.input-text { width:280px !important; } -.giftmessage-whole-order-container .entry-edit textarea { width:99% !important; padding:2px 3px; } -.giftmessage-whole-order-container .entry-edit label { width:121px; } - -/* PayPal */ -ul.tabs a.paypal-section, -ul.tabs a.paypal-section:hover { background:url(../images/tabs_span_bg.gif) repeat-x 0 100%; border-bottom:none; padding:0.5em 0.5em 0.28em 1.5em; } - -/* Packaging for Shipping Popup */ -#popup-window-mask, -.popup-window-mask { background:url(../images/bg_window_mask.png) repeat 0 0; background:rgba(239, 239, 239, 0.5); position:absolute; top:0; right:0; bottom:0; left:0; width:100%; height:100%; z-index:399; } -.packaging-window, -.packed-window { background:#fafafa; border:1px solid #d6d6d6; left:50%; margin:-200px 0 0 -471px; position:fixed; top:50%; width:1100px; z-index:400; -webkit-box-shadow: 0px 3px 5px #ccc; -moz-box-shadow:0px 3px 5px #ccc; box-shadow:0px 3px 5px #ccc; z-index:400; } -.packaging-window .entry-edit-head { padding:3px 5px; } -.packaging-window .entry-edit-head button { float:right; } -.packaging-window .messages { border:1px solid #f16048; color:#df280a; background:#faebe7 url(../images/error_msg_icon.gif) no-repeat 10px 10px; font-weight:bold; margin-bottom:10px; padding:10px 10px 10px 35px; } -.packaging-window .validation-failed { background:#fef0eD; border:1px dashed #D6340E; } -.packaging-window .packaging-content { overflow:auto; height:400px; height:auto !important; max-height:400px; margin:0 0 10px; padding:10px 10px 0; } -.packaging-window .package-block { background:#f6f6f6; border:2px solid #d4d4d4; margin:0 0 10px; padding:10px; } -.packaging-window .package-options { width:100%; border-top:1px solid #ccc; padding:10px 0 0; margin:3px 0 0; } -.packaging-window .package-options td { vertical-align:middle; } -.packaging-window .package-options select { width:130px; } -.packaging-window .package-options .input-text { width:50px; } -.packaging-window .package_prapare { margin-bottom:15px; } -.packaging-window .package-options .customs-value { width:80px; } -.packaging-window .package-options .options-weight { width:75px; } -.packaging-window .package-options .options-units-weight { width:45px; } -.packaging-window .package-options .options-units-dimensions { width:45px; } -.packaging-window .package-options .options-content-type { width:120px; } -.packaging-window .package-options input[type=text].disabled { background:#eee; } -.packaging-window .package-options select.disabled { background:#eee; } -.packaging-window .package-options-contents { border-top:0; } -.packaging-window .package-add-products { border-top:1px solid #ccc; padding:10px 0 0; margin:10px 0 0; } -.packaging-window .package-add-products .grid { padding:0; } -.packaging-window .package-add-products .grid button { vertical-align:middle; } -.packaging-window .package-number {font-weight: bold;} -.packaging-window .package-number span {margin-left: 5px;} - -.packed-window .entry-edit-head { padding:3px 5px; } -.packed-window .packed-content { padding:10px 10px 0; overflow:auto; max-height:400px; } -.packed-window .package { background:#fefefe; border:7px solid #d5d5d5; margin-bottom:10px; padding:10px; } -.packed-window .package h4 { background:#fefefe; border:solid #ccc; border-width:0 0 1px 1px; float:right; color:#222; font-size:12px; margin:-10px -10px 0 0; padding:5px 10px; position:relative; z-index:100; } -.packed-window .package strong{ display:block; padding:0 0 3px; } -.packed-window .package .grid { padding:0; } -.packed-window .package-info { background:#f3f3f3; border-bottom:1px solid #ccc; margin:-10px -10px 10px; padding:5px 10px; position:relative; } -.packed-window .package-options { width:60%; } -.packed-window .package-options td, -.packed-window .package-options th { padding:1px 0; } -.packed-window .buttons-set { padding-right:5px; } - - -/* CATALOG -*******************************************************************************/ - -/* Category */ -.categories-side-col .content-header { padding:0; } -.categories-side-col .content-header h3 { float:none; } -.categories-side-col .content-header button { margin:5px 0 0; } -.categories-side-col .switcher { margin:10px 20px 0 0; } -.categories-side-col .tree-actions { text-align:center; margin:10px 20px 10px 0; } -.categories-side-col .tree-holder { margin-right:20px; } - -.no-active-category a span { color:#aaa !important; } - -#tree-div { overflow:auto!important; padding-bottom:15px; width:200px; } - -.x-tree-node { margin:0 !important; } -.x-tree-node .leaf .x-tree-node-icon { background-image:url(../images/fam_leaf.png); } -.x-tree-node .system-leaf .x-tree-node-icon { background-image:url(../images/fam_application_form_delete.png); } -.x-tree-node-ct { overflow:hidden; } - -/* Product - Websites */ -.website-name .checkbox { vertical-align:top; margin-top:2px; } -.webiste-groups { padding:10px 20px; } -.group-stores { padding:2px 10px; } - -/* Products - Bundles */ -.bundle-option-row table tbody td { white-space:nowrap; } -.bundle-option-row table tbody td label { float:left; } -.bundle-option-row input.option-label { width:50% !important; } -.bundle-option-row input.option-position{ width:70px !important; } -.catalog-categories .side-col { width:240px; } - -/* Products - Tier Price */ -.tier-price-input { margin-bottom:8px; } -.tier-price-input input.price { width:80px; margin-right:10px; } -.tier-price-input input.qty { width:80px; } -.tier-price-input .tier-container { position:relative; clear:both; } -.tier-price-input .tier-container div { float:left; } -.tier-price-input .tier-container label { width:30px; margin:0; padding:0; } -.tier-price-input .validation-advice, -.tier-price-input label.mage-error { margin:0; height:25px; } -.tier-price-input .custgroup-div select { width:auto; padding:0; } -.tier-price-input .qty-div { padding-left:20px; } -.tier-price-input .price-div { padding-left:20px; } -.tier-price-input .price-div .validation-advice, -.tier-price-input .price-div label.mage-error { margin:0; } -.btn-remove-tier-group { float:right; right:24px; top:5px; } - -/* Product - Gallery */ -.image-preview { position:absolute; cursor:pointer; } - -/* Attributes */ -.edit-attribute-set .form-list td.label { width:105px; } -.edit-attribute-set .form-list td.label label { width:105px; } -.edit-attribute-set .entry-edit fieldset input.input-text { width:200px; } -/* Review & Ratings */ -.ratings { margin:0; } -.rating-box { - float:left; - position:relative; - width:69px; - height:16px; - margin:0 5px 3px 0; - background:url(../images/product_rating_blank_star.gif) repeat-x; - } -.rating-box .rating { - position:absolute; - top:0; - left:0; - height:16px; - background:url(../images/product_rating_full_star.gif) repeat-x; - } -.field-row .ratings { width:120px; float:left; clear:right; } -.field-row .ratings-container { width:250px; float:left; } -.product-review-box { width:450px; } -.product-review-box table { width:100%; } -.product-review-box td, -.product-review-box th { text-align:center; padding-right:5px; } -.product-review-box td.label { width:100px; text-align:left; } - - -/* Price Rules */ -.rule-tree ul { padding-left:16px !important; border-left:dotted 1px #888; } -.rule-tree .x-tree ul { padding-left:0 !important; border-left:none !important; } -.rule-param .label { font-weight:bold; color:black; } -.rule-param .label:hover { font-weight:bold; color:blue; } -.rule-param .label-disabled { color:black; cursor:default; text-decoration:none; } -.rule-param .label-disabled:hover { color:black;} -.rule-param .element { display:none; } -.rule-param input, -.rule-param select { width:auto !important; min-width:170px; } -.rule-param select.multiselect { vertical-align:top; } -.rule-param-edit .label { display:none; } -.rule-param-edit .element { display:inline; } -.rule-param-add { font-weight:normal; color:green; text-decoration:none; } -.rule-param-add:hover { font-weight:normal; color:blue; text-decoration:none; } -.rule-param-apply { font-weight:normal; color:green; text-decoration:none; } -.rule-param-apply:hover { font-weight:normal; color:blue; text-decoration:none; } -.rule-param-remove { font-weight:normal; color:red; text-decoration:none; } -.rule-param-remove:hover { font-weight:normal; color:blue; text-decoration:none; } -.rule-chooser { border:solid 1px #CCC; margin:5px; padding:5px; display:none; } -.rule-param-wait { padding-left:20px; background-image:url(../images/rule-ajax-loader.gif); background-repeat:no-repeat; background-position:0 50%; } - -/* Product Customer Defined options */ -.custom-options .box {padding:0 1.5em; } -.custom-options .option-box {border:1px solid #cddddd; padding:1em; background:#e7efef; margin:1.5em 0; } - -.custom-options .option-header {border:0; width:100%; background:#e7efef; border-bottom:1em solid #e7efef; } -.custom-options .option-header .input-text, -.custom-options .option-header .select {width:95%; } -.custom-options .option-header th {padding:2px; } -.custom-options .option-header td {padding:5px 2px; } - -.custom-options .opt-title {width:175px; } -.custom-options .opt-type {width:150px; } -.custom-options .opt-req {width:80px; } -.custom-options .opt-order {width:60px; } - -.custom-options .option-box .border {width:615px; } - -.custom-options th {white-space:nowrap; } -.custom-options .type-title {width:auto; } -.custom-options .type-price {width:60px; } -.custom-options .type-type {width:80px; } -.custom-options .type-uqty {width:100px; } -.custom-options .type-sku {width:150px; } -.custom-options .type-order {width:60px; } -.custom-options .type-butt {width:33px; } -.custom-options .type-last {width:auto; } - -.custom-options .option-box .border input.input-text, -.custom-options .option-box .border select.select { width:90% !important; } - -.custom-options .option-box .border .type-last input.input-text { width:60px !important; } -.custom-options .option-box .border input.type-sku {width:150px !important; } - -/* Bundle product */ -.bundle .option-box {padding-bottom:2em; } -.bundle .option-box .border {width:100%; border-bottom:0; } -.bundle .option-box .border td {border-bottom:1px solid #dce5e6!important; } -.bundle .option-title {padding:0 0 10px; border-bottom:1px solid #cddddd; } -.bundle .option-title button {float:right; } -.bundle .option-title label {font-weight:bold; line-height:21px; padding-right:1em; float:left; } -.bundle .option-title .input-text {float:left; width:260px; vertical-align:middle; } -.bundle .option-header {clear:both; margin-top:5px; } - -.bundle .border .last {width:33px; } - -/* Downloadable Product */ -.files { width:195px; } -.files input.input-text { float:left; width:134px !important; } -.files-wide { width:355px; } -.files-wide input.input-text { float:left; width:294px !important; } -.files label, -.files-wide label { float:left; width:55px; } -.files .row, -.files-wide .row { margin-bottom:5px; } -/* Files Uploader */ -.files .flex, -.files-wide .flex { float:right !important; position:static !important; } -.files .uploader, -.files-wide .uploader { float:left; overflow:hidden; } -.files .uploader { width:100px; } -.files-wide .uploader { width:260px; } -.files .uploader .file-row-info, -.files-wide .uploader .file-row-info, -.files .uploader .file-row-narrow, -.files-wide .uploader .file-row-narrow { margin:0 !important; } -.progressbar { height: 20px; } -.upload-progress { background-color: #fcffac; } -.upload-success { background-color: #E4FFB1; } -.upload-failure { background-color: #FF7E77; } - -td.input-price { white-space:nowrap; } -td.input-price .validation-advice, -td.input-price label.mage-error { white-space:normal; } -td.input-price input.input-text { width:4em !important; } - -input.sort { width:4em !important; } -input.downloads { width:6.5em !important; } - -/* CUSTOMER -*******************************************************************************/ - -/* Addresses */ -.address-list { width:28em; padding-right:22px; } -.address-list address { width:100%; overflow:hidden; } -.address-list .btn-edit-address, -.address-list .btn-remove-address { position:absolute; top:8px; } -.address-list .btn-edit-address { right:8px; } -.address-list .btn-remove-address { right:27px; } -.address-list li { position:relative; padding:12px 14px; cursor:pointer; border-top:1px solid #e6e6e6; background:url(../images/address_list_li.gif) repeat; } -.address-list li.on { background:#e7efef; } -.address-list li.over { background-color:#fcf5dd; } -.address-list li table { width:100%; } -.delete-address { float:right; margin:0 0 10px 10px; } -.address-type .address-type-line { display:block; margin:2px 0; } -.address-type .address-type-line input { margin-right:3px; } - - - -/* NEWSLETTER -*******************************************************************************/ -.template-preview { width:100%; height:200px; background-color:#fff; } - - -/* SYSTEM -*******************************************************************************/ -.stores-tree td { padding-top:3px !important; padding-bottom:3px !important; } -.stores-tree td.label label { display:inline; width:auto; padding-right:10px; } -.stores-tree td.website-label label { font-weight:bold; } -.stores-tree td.store-group-label label { font-weight:bold; padding-left:15px; } -.stores-tree td.store-label label { padding-left:30px; } -.stores-tree .buttons-set { margin:10px 0; } - -.log-details { border:1px solid #d6d6d6; padding:15px; background:#fafafa; margin:0 0 15px; } -.log-details table { width:100%; } -.log-details table th, -.log-details table td { padding-top:4px; padding-bottom:4px; vertical-align:middle; } -.log-details table th { font-weight:bold; padding-right:30px; white-space:nowrap; } - -.sync-indicator { margin-left:5px; margin-right:5px; position:absolute; white-space:nowrap; } -.sync-indicator img, -.sync-indicator span { vertical-align:middle; } - -/* Configuration */ -/*fieldset.config td { padding-top:5px; padding-bottom:5px; } -fieldset.config input.input-text { width:250px; } -fieldset.config select.select { width:256px; }*/ -div.tree_item, -div.tree_item_last { background-position:left; background-repeat:no-repeat; padding-left:20px; } -div.tree_item { background-image:url(../images/tree_icons/join.gif); } -div.tree_item_last { background-image:url(../images/tree_icons/joinbottom.gif); } -div.tree_line { position:absolute; left:0; background-image:url(../images/tree_icons/line.gif); } -img.attribute-global { width:16px; height:16px; vertical-align:middle; } - -ul.config-tabs { border-top:none; } -ul.config-tabs dt { - border-top:1px solid #849ba3; - background:#d1dedf url(../images/config_tab_dt_bg.gif) no-repeat 0 50%; - padding:2px 0 2px 1.5em; - font-weight:bold; - text-transform:uppercase; - color:#306375; - } -ul.config-tabs dl { margin-bottom:16px; } -ul.config-tabs a.last span { background-image:none; } - -.inline-table { border:0 !important; } -.inline-table td { border:0 !important; padding:0 5px 5px !important; } - -.system-fieldset-sub-head td { padding:20px 5px 5px 5px; } -.system-fieldset-sub-head h4 { border-bottom:1px solid #ccc; margin:0; } - -.system-tooltip-wrap { float:left; } -.system-tooltip-box { border-left:1px solid #ccc; float:left; line-height:16px; margin-left:5px; padding-left:5px; width:180px; } -.system-tooltip-small { clear:both; border:none; margin:0; padding:5px; width:100%; } - -.comment { padding:5px; } - -/* Import/export */ - -#profile-generator select { width:207px; } -#profile-generator input.input-text { width:200px; } -.field-row .with-tip {display:block; margin-left:150px; } -.field-row .with-tip input {float:none; } -.field-row .with-tip small {display:block;padding-top:2px; } - -#profile-generator .field-row button.delete {vertical-align:middle; } -#profile-generator fieldset button.add {display:inline; margin:0; } - -/** Product mass attribute update **/ - -.attribute-change-checkbox { white-space:nowrap; clear:none; margin-left:5px; } - -.attribute-change-checkbox label{ margin-left:5px; float:none !important; } - -/* PopUp Calendar */ -.calendar { z-index:105; } - -/** Order view **/ -.order-history { width:70%; margin-right:27px; } - -ul.super-product-attributes { padding-left:15px; } - -/** Media Library **/ -.uploader .file-row { width:600px; padding:0.5em 0.6em; margin:0.5em 0.6em; border:1px solid #ccc; background-color:#f9f9f9; /*vertical-align:middle;*/ } -.uploader .file-row-narrow { width: auto; margin: 0 0 2px 40px; } -.uploader .file-row .file-info { float:left; } -/*.uploader .file-row .file-info-name { with: 80%; overflow: hidden; } -.uploader .file-row .file-info-size { width: 20%; }*/ -.uploader .file-row-info { margin: 0 0 0 10px; } -.uploader .file-row-info .file-info-name { font-weight:bold; } -.uploader .file-row .progress-text { float:right; font-weight:bold; } -.uploader .file-row .delete-button { float:right; } -.uploader .buttons { float:left; } -.uploader .flex { float:right; } -.uploader .progress { border:1px solid #f0e6b7; background-color:#feffcc; } -.uploader .error { border:1px solid #aa1717; background-color:#ffe6de; } -.uploader .error .progress-text { padding-right:10px; } -.uploader .complete { border:1px solid #90c898; background-color:#e5ffed; } - -.grid tr.read { background:#fff !important; } -.grid tr.unread { background:#fcf6f5 !important; } -.grid-row-title { color:#444; font-weight:bold; } - -.grid-severity-critical, -.grid-severity-critical span, -.grid-severity-major, -.grid-severity-major span, -.grid-severity-minor, -.grid-severity-minor span, -.grid-severity-notice, -.grid-severity-notice span { display:block; height:16px; background-image:url(../images/bg_notifications.gif); background-repeat:no-repeat; font:bold 10px/16px Arial, Helvetica, sans-serif; text-transform:uppercase; text-align:center; padding:0 0 0 7px; margin:1px 0; white-space:nowrap; color:#fff; } -.grid-severity-critical { background-position:0 0; } -.grid-severity-critical span { background-position:100% 0; padding:0 7px 0 0; } -.grid-severity-major { background-position:0 -16px; } -.grid-severity-major span { background-position:100% -16px; padding:0 7px 0 0; } -.grid-severity-minor { background-position:0 -32px; } -.grid-severity-minor span { background-position:100% -32px; padding:0 7px 0 0; } -.grid-severity-notice { background-position:0 -48px; } -.grid-severity-notice span { background-position:100% -48px; padding:0 7px 0 0; } - -.super-attributes { margin:0; padding:0; } -.super-attributes li.attribute { border:1px solid #dfdfdf; background-color:#ededed; margin:1px 0; } -.super-attributes li.attribute ul.attribute-values { margin:0; padding:0; } -.super-attributes li.attribute div.values-container { width:80%; margin-top:2px; margin-bottom:2px; } -.super-attributes li.attribute-value { display:block; margin:1px 0; } -.super-attributes li.attribute-value .validation-advice, -.super-attributes li.attribute-value label.mage-error { margin:0; white-space:normal; } -.super-attributes li.attribute-value .attribute-value-label-container { width:200px; } - -.super-attributes div.attribute-name-container, -.super-attributes li.attribute div.values-container, -.configurable-simple-product div.values-container, -.super-attributes li.attribute-value .attribute-values-container, -.configurable-simple-product .attribute-values-container, -.super-attributes li.attribute-value .attribute-values-container-main, -.configurable-simple-product .attribute-values-container-main, -.super-attributes li.attribute-value .attribute-value-label-container { display:block; } - -.super-attributes li.attribute-value .attribute-price, -.configurable-simple-product .attribute-price { width:70px !important; } - -.super-attributes li.attribute-value .attribute-price-type, -.configurable-simple-product .attribute-price-type { width:70px !important; } - -.super-attributes div.attribute-name-container { - cursor:move; - background-image:url(../images/arrow_sort_move.gif); - background-repeat:no-repeat; - background-position:4px 50%; - font-weight:bold; - padding-left:15px; - margin-top:2px; - margin-bottom:2px; - } - - -/** Product Gallery Image Previews **/ -.preview .cell-image .place-holder { border:1px solid #AEAEAE; width:100px; height:100px; text-align:center; } -.preview .cell-image .place-holder span { margin-top:30px;display:block; } -.preview .cell-position input.input-text { width:90% !important; } -.fieldset-wide .data .preview .cell-position input.input-text { width:90% !important; } - -.tier .data { width:465px; } -.tier .data select { width:99%; } -.tier .data input.qty { width:20px !important; } - -.weee .data { width:465px; } -.weee .data select { width:99%; } - -.giftcard-amounts .data { width:465px; } -.giftcard-amounts .data select { width:99%; } - -/* Links */ -.link-feed { background:url(../images/icon_feed.gif) no-repeat left 2px; padding-left:18px; } - -#page-help-link { - line-height:26px; - padding-left:20px; - color:#ebebff; - background:url(../images/fam_help.gif) no-repeat 0 50%; - } -#page-help-link:link, #page-help-link:visited { text-decoration:none; } -#page-help-link:hover { color:white; } - -/* Magento Connect Package Extensions */ -.table-editable { border:solid 1px #ccc; background:#fafafa; padding:5px; margin-bottom:5px; } -.table-editable th { border-bottom:solid 1px #ccc; text-align:center; } -.table-editable th, .table-editable td { padding:1px 3px; vertical-align:middle; } -.table-editable select { height:19px; } - - -/* CMS -*******************************************************************************/ -.breadcrumbs { margin: 0 0 10px; } -.breadcrumbs li { display:inline; } -.breadcrumbs li span { margin:0 2px; } - -/*table.mceLayout { width:100% !important; }*/ - -.cms-revision-preview { height:100%; } -.cms-revision-preview iframe { width:100%; height:91%; border:0; } - -/* CMS Widgets Instance */ -.options-box .option-box { border:1px solid #cddddd; padding:1em; background:#e7efef; margin:1.5em 0; } -.options-box .option-title { padding:0 0 10px; border-bottom:1px solid #cddddd; } -.options-box .option-title button { float:right; } -.options-box .option-title label {font-weight:bold; line-height:21px; padding-right:1em; float:left; } -.options-box .option-title select { float:left; width:260px; vertical-align:middle; } -.options-box .option-header { margin:5px 0 0; width:100%; border:0; background:#e7efef; border-bottom:1em solid #e7efef; } -.options-box .option-header .input-text, -.options-box .option-header select { width:95%; } -.options-box .option-header th { padding:2px; } -.options-box .option-header td { padding:5px 2px; } -.options-box .option-header .tree { margin:5px 0 0; } - -/* CMS Popup Window */ -.popup-window .magento_message { padding:0 18px; } -.popup-window .content-header { font-family:Arial, Helvetica, sans-serif; padding-top:9px; } -.popup-window .content-header h3 { color:#eb5e00; padding:0; } -.popup-window { height:auto !important; } -.popup-window .grid { position:static; } -.popup-window .table_window td.value2 .grid td, -.popup-window .table_window td.value2 .grid th { padding:2px 4px !important; } -.popup-window .table_window td.value2 .grid tr.headings th { padding:1px 4px 2px !important; } -.popup-window .columns { background-image:none; } -.popup-window .middle { background:none; padding:10px 0; } - -.popup-window .uploader .file-row { margin:16px 0; width:auto; } -.popup-window #contents-uploader { margin-bottom:10px; background:#d7e5ef; padding:5px 10px; } -.popup-window #contents-uploader .flex { font-size:0; line-height:0; height:20px; } -.popup-window #contents { margin-left:-3px; height:400px; overflow:auto; position:relative; } -.popup-window #contents .filecnt { float:left; border:1px solid #ccc; cursor:pointer; padding:3px; display:inline; margin:0 0 15px 4px; overflow:hidden; position:relative; width:100px; } -.popup-window #contents .selected { border:1px solid #f1af73; background:#f0f0f0; cursor:default; } -.popup-window #contents .nm { text-align:center; } -.popup-window #contents .nm img { vertical-align:bottom; } - -/* Widget Insert */ -#widget_window .magento_content { height:auto !important; min-height:450px; } - -/* CMS Widget Chooser */ -#widget-chooser .columns { background-image:none; } -#widget-chooser .magento_message { padding:10px 18px; } -#widget-chooser .grid th, -#widget-chooser .grid td { padding:2px 4px 2px 4px; } -#widget-chooser .grid tr.filter th { padding-top:5px; padding-bottom:5px; } -#widget-chooser .side-col { padding-top:0.5em; } -#widget-chooser .main-col { padding-right:4px; } - -/* CMS Variables Popup */ -#variables-chooser .magento_message { padding:10px 18px; } - -/* Product description WYSIWYG editor */ -#catalog-wysiwyg-editor .buttons-set { margin-top:10px; } -#catalog-wysiwyg-editor .magento_content { height:auto !important; overflow:hidden; } -#catalog-wysiwyg-editor .textarea { width:930px !important; } -#catalog-wysiwyg-editor .magento_message { padding:0 7px; } -#catalog-wysiwyg-editor .magento_buttons { padding-left:7px; padding-right:7px; } - -/* Backups */ -.backup-dialog { background-color:#6f8992; background:rgba(111, 137, 146, 0.5); cursor:default; left:50%; margin:0 0 0 -271px; position:fixed; top:50%; width:470px; padding:8px; z-index:400; -moz-box-shadow:0 0 100px #ccc; -webkit-box-shadow:0 0 100px #ccc; box-shadow:0 0 100px #ccc; } -.backup-dialog .entry-edit { border:1px solid #6f8992; } -.backup-dialog .content { background:#fff; border-bottom:1px solid #ccc; max-height:400px; overflow:auto; } -.backup-dialog .question {margin-top: 15px;} -.backup-dialog .buttons-set { border-top:1px solid #ddd; background:#eee; margin:0; overflow:hidden; padding:7px 10px 8px; width:448px; } -.backup-dialog .buttons-set button { margin:0 0 0 5px; } -.backup-dialog #ftp-credentials-container {margin-top: 25px;} -.backup-dialog .password-box-container {margin-top: 15px;} -.backup-dialog #ftp-credentials-container fieldset {margin-bottom: 0;} -.backup-dialog input[type=text], .backup-dialog input[type=password] {width: 180px} -.backup-dialog .exclude-media-checkbox-container {margin-top: 15px;} -.backup-dialog td.maintenance-checkbox-container {margin-top: 0; padding-top: 4px;} - -/*****************************************/ -/******** ALIGNMENTS AND CLEARS **********/ -/*****************************************/ - -/* Directional and spacial */ -.f-left, .left { float:left; } -.f-right, .right { float:right; } -.v-top { vertical-align:top; } -.v-middle { vertical-align:middle !important; } -.v-bottom { vertical-align:bottom; } -.a-left { text-align:left !important; } -.a-center { text-align:center !important; } -.a-right { text-align:right !important; } -.nm { margin:0 !important; } -.np { padding:0 !important; } -.no-display { display:none; } -.no-show { display:none; } -.nowrap, .nobr { white-space:nowrap; } -.wrap { white-space:normal !important; } -.no-float { float:none !important; } -.pointer { cursor:pointer; } - -/* Color */ -.emph, .accent { color:#eb5e00 !important; } -.subdue { color:#306375; } - -/* Font */ -.bold { font-weight:bold !important; } -.normal { font-weight:normal !important; } - -/* Clear */ /* This keeps our HTML free of buncha clearing elements */ -.side-col .switcher:after, -.message-popup .message-popup-head:after, -.message-popup .message-popup-content .message:after, -.login-form .form-buttons:after, -.wrapper:after, -.option-title:after, -.columns:after, -.main-col:after, -.content-header-floating:after, -.entry-edit .entry-edit-head:after, -.content-header:after, -.login-box .button-set:after, -ul.tabs-horiz:after, -.header-top:after, -dl.accordion dt:after, -.field-100:after, -.entry-edit fieldset li:after, -.entry-edit fieldset span.field-row:after, -.content:after, -#topnav:after, -.main:after, -.container:after, -.footer:after, -.middle:after, -.header:after, -.box-head:after, -div.actions:after, -.tier-container:after, -.clear:after, -.notification-global:after, -.files .row:after, -.files-wide .row:after, -.grid tr.filter .range .range-line:after, -.store-scope:after { display:block; clear:both; content:"."; font-size:0; line-height:0; height:0; overflow:hidden; } diff --git a/app/code/Magento/Webhook/view/adminhtml/css/modal.css b/app/code/Magento/Webhook/view/adminhtml/css/modal.css deleted file mode 100644 index a8912c8fb6271..0000000000000 --- a/app/code/Magento/Webhook/view/adminhtml/css/modal.css +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Webhook - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -@font-face { - font-family: 'Lucidia Sans Unicode'; - font-weight: normal; - font-style: normal; -} - -.inline { - display: inline-block; - vertical-align: middle; -} - -html, body { - height: 100%; -} - -.hide { - display: none !important; -} - -#activate-subscription>.sh { - background: transparent url("../images/ghost-dark.png") repeat 0% 0%; - padding: 10px; - border-radius: 15px; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - margin: 0 auto; - width: 450px; - height: 500px; - position: absolute; - z-index: 1000; -} - -#activate-subscription>.sh>.b { - height: 100%; - border-radius: 7px; - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - /*position: relative;*/ -} - -#activate-subscription>.sh>.b>.top { - position: relative; - -webkit-border-top-left-radius: 7px; - -webkit-border-top-right-radius: 7px; - -moz-border-radius-topleft: 7px; - -moz-border-radius-topright: 7px; - border-top-left-radius: 7px; - border-top-right-radius: 7px; - height: 20px; - background: #425e66; - background: -moz-linear-gradient(top, #092023 0%, #425e66 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #092023), color-stop(100%, #425e66)); - background: -webkit-linear-gradient(top, #092023 0%, #425e66 100%); - background: -o-linear-gradient(top, #092023 0%, #425e66 100%); - background: -ms-linear-gradient(top, #092023 0%, #425e66 100%); - filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = '#092023', endColorstr = '#425e66'); - background: linear-gradient(top, #092023 0%, #425e66 100%); -} - -#activate-subscription>.sh>.b>.top>.close { - display: block; - position: absolute; - top: 4px; - right: 10px; - font-family: Arial, Helvetica, Verdana, sans-serif; - font-size: 0.8em; - color: #f7f7f7; - text-decoration: none; -} - -#activate-subscription>.sh>.b>.top>.close:hover { - color: #fff; - text-decoration: underline; -} - -#activate-subscription>.sh>.b>iframe { - border-radius: 0px 0px 7px 7px; - -webkit-border-radius: 0px 0px 7px 7px; - -moz-border-radius: 0px 0px 7px 7px; - background: #FFF; - width: 450px; - height: 480px; - display: block; -} - diff --git a/app/code/Magento/Webhook/view/adminhtml/css/webhook.css b/app/code/Magento/Webhook/view/adminhtml/css/webhook.css deleted file mode 100644 index a6c209656c228..0000000000000 --- a/app/code/Magento/Webhook/view/adminhtml/css/webhook.css +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Webhook - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -html { - height: 100%; - overflow: hidden; -} - -body { - height: 100%; -} - -body>div:first-child { - height: 100%; -} - -div.outer { - height: 100%; -} - -.section.main { - padding: 1em; -} - -li { - margin-left: 1em; -} - -ul { - padding-left: 1em; -} - -em { - color: #EB5E00; -} - -.red { - color: #EB5E00; -} - -.section { - margin-top: 1em; -} - -div.center { - overflow: auto; - height: 90%; -} - -div.bottom { - border-top: 1px solid #2D444F; - background: #666E73; - width: 100%; - height: 10%; - position: absolute; - bottom: 0px; -} - -div.buttons { - width: 70%; - - margin: 1em auto; -} - -.buttons button { - margin-right: 2em; - margin-left: 2em; -} - -/*.buttons button:last-child,*/ -.buttons button.last-child { - margin-right: 25%; - float: right; -} - -.buttons button:first-child { - margin-left: 25%; - margin-right: 0px; - float: left; -} - -/* Using monospace to make it easier to see how long our keys/secrets really are */ -input.monospace { - font-family: Courier New, monospace; -} - -/* Need this so the form inputs look good in our modal window */ -.api_form input.input-text{ - width: 20em; -} - -.entry-edit .field-row label.error { - float: none; - width: auto; - margin-left: 2em; -} diff --git a/app/code/Magento/Webhook/view/adminhtml/images/accordion_close.gif b/app/code/Magento/Webhook/view/adminhtml/images/accordion_close.gif deleted file mode 100644 index 7463cfd06c6b5..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/accordion_close.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/accordion_close.png b/app/code/Magento/Webhook/view/adminhtml/images/accordion_close.png deleted file mode 100644 index 17f2f42358d64..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/accordion_close.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/accordion_open.gif b/app/code/Magento/Webhook/view/adminhtml/images/accordion_open.gif deleted file mode 100644 index aaea5003490e3..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/accordion_open.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/accordion_open.png b/app/code/Magento/Webhook/view/adminhtml/images/accordion_open.png deleted file mode 100644 index 9d5259955e920..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/accordion_open.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/add_btn_icon-disabled.gif b/app/code/Magento/Webhook/view/adminhtml/images/add_btn_icon-disabled.gif deleted file mode 100644 index 213541cabff77..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/add_btn_icon-disabled.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/add_btn_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/add_btn_icon.gif deleted file mode 100644 index 0c7645a983d3a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/add_btn_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/address_list_li.gif b/app/code/Magento/Webhook/view/adminhtml/images/address_list_li.gif deleted file mode 100644 index 5877676486019..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/address_list_li.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/address_list_on_arrow.gif b/app/code/Magento/Webhook/view/adminhtml/images/address_list_on_arrow.gif deleted file mode 100644 index a0afc67cfb248..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/address_list_on_arrow.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/address_list_over_arrow.gif b/app/code/Magento/Webhook/view/adminhtml/images/address_list_over_arrow.gif deleted file mode 100644 index c7728c6208220..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/address_list_over_arrow.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/address_list_over_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/address_list_over_bg.gif deleted file mode 100644 index d72815959aa3a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/address_list_over_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/ajax-loader-tr.gif b/app/code/Magento/Webhook/view/adminhtml/images/ajax-loader-tr.gif deleted file mode 100644 index efb7ba7704944..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/ajax-loader-tr.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/ajax-loader.gif b/app/code/Magento/Webhook/view/adminhtml/images/ajax-loader.gif deleted file mode 100644 index b525a23bdbb3f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/ajax-loader.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/application_view_tile.gif b/app/code/Magento/Webhook/view/adminhtml/images/application_view_tile.gif deleted file mode 100644 index 8965c0e108e08..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/application_view_tile.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/arrow_sort_move.gif b/app/code/Magento/Webhook/view/adminhtml/images/arrow_sort_move.gif deleted file mode 100644 index 9dcb050136e8c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/arrow_sort_move.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/bg_collapse.gif b/app/code/Magento/Webhook/view/adminhtml/images/bg_collapse.gif deleted file mode 100644 index 5d21686469609..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/bg_collapse.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/bg_create_order_totals.gif b/app/code/Magento/Webhook/view/adminhtml/images/bg_create_order_totals.gif deleted file mode 100644 index 3852cfcd1ee3f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/bg_create_order_totals.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/bg_notifications.gif b/app/code/Magento/Webhook/view/adminhtml/images/bg_notifications.gif deleted file mode 100644 index fb47f6ea7a71b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/bg_notifications.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/bg_window_mask.png b/app/code/Magento/Webhook/view/adminhtml/images/bg_window_mask.png deleted file mode 100644 index 1824283aa6446..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/bg_window_mask.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/bkg_btn-close.gif b/app/code/Magento/Webhook/view/adminhtml/images/bkg_btn-close.gif deleted file mode 100644 index 11299fabad214..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/bkg_btn-close.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/bkg_btn-close2.gif b/app/code/Magento/Webhook/view/adminhtml/images/bkg_btn-close2.gif deleted file mode 100644 index 24f6252a98eca..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/bkg_btn-close2.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/bkg_search-magnifier.png b/app/code/Magento/Webhook/view/adminhtml/images/bkg_search-magnifier.png deleted file mode 100644 index cc7a26f8b8f7b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/bkg_search-magnifier.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/blank.gif b/app/code/Magento/Webhook/view/adminhtml/images/blank.gif deleted file mode 100644 index d6e9b014cef67..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/blank.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/box_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/box_bg.gif deleted file mode 100644 index 8b51ee0882f8c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/box_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/breadcrumb_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/breadcrumb_bg.gif deleted file mode 100644 index 9e82a9099c0e6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/breadcrumb_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-image_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_add-image_icon.gif deleted file mode 100644 index 85d971ade82a5..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-image_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-variable_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_add-variable_icon.gif deleted file mode 100644 index 7f50e6fd7731a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-variable_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-widget_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_add-widget_icon.gif deleted file mode 100644 index 2c06933eebbc0..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-widget_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-widget_icon2.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_add-widget_icon2.gif deleted file mode 100644 index 75055bb714509..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_add-widget_icon2.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_back_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_back_bg.gif deleted file mode 100644 index 0824ca688214f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_back_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_bare_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_bare_bg.gif deleted file mode 100644 index 24fc5ba5a6303..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_bare_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_bg-disabled.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_bg-disabled.gif deleted file mode 100644 index 3ec0b3154e91a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_bg-disabled.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_bg.gif deleted file mode 100644 index 32d6ca84f3f54..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_bg.png b/app/code/Magento/Webhook/view/adminhtml/images/btn_bg.png deleted file mode 100644 index 09448f4ab3b0c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_cancel_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_cancel_bg.gif deleted file mode 100644 index a3d92e461f740..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_cancel_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_delete_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_delete_bg.gif deleted file mode 100644 index b0cbd8337dba2..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_delete_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_go.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_go.gif deleted file mode 100644 index 30f87d685dd3e..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_go.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_bg.gif deleted file mode 100644 index d91a78b537f48..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_on.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_on.gif deleted file mode 100644 index b9f7bdeedbf05..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_on.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_over.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_over.gif deleted file mode 100644 index 73afeb6200c4d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_gr_over.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_loading-icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_loading-icon.gif deleted file mode 100644 index 7735ef6e5798b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_loading-icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_login.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_login.gif deleted file mode 100644 index 93ed65b587745..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_login.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_on_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_on_bg.gif deleted file mode 100644 index fc478689f9aa3..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_on_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_over_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_over_bg.gif deleted file mode 100644 index 294ff2bfcff1a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_over_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_show-hide_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_show-hide_icon.gif deleted file mode 100644 index 6670833a41023..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_show-hide_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/btn_task_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/btn_task_bg.gif deleted file mode 100644 index 87280126cb087..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/btn_task_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/button-close.png b/app/code/Magento/Webhook/view/adminhtml/images/button-close.png deleted file mode 100644 index b02bc1d33bbb7..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/button-close.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_active_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_active_bg.gif deleted file mode 100644 index add491809bafe..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_active_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_bg.gif deleted file mode 100644 index d52fb2562c179..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_icon.gif deleted file mode 100644 index 976481765e1d6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_over_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_over_bg.gif deleted file mode 100644 index d24eb118385de..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/cancel_btn_over_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/cancel_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/cancel_icon.gif deleted file mode 100644 index 1fd7cfd6a23b7..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/cancel_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/config_tab_dt_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/config_tab_dt_bg.gif deleted file mode 100644 index 376d898333859..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/config_tab_dt_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/dashboard-close.gif b/app/code/Magento/Webhook/view/adminhtml/images/dashboard-close.gif deleted file mode 100644 index c4b6bbc9f7fa4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/dashboard-close.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-graph-bg.gif deleted file mode 100644 index 5781f67e63c0f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-bottom-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-graph-bottom-bg.gif deleted file mode 100644 index fca4780209568..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-bottom-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-line-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-graph-line-bg.gif deleted file mode 100644 index 17b2e7b23fb16..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-line-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-line2-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-graph-line2-bg.gif deleted file mode 100644 index c10bde98dba48..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-line2-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-x-bg.png b/app/code/Magento/Webhook/view/adminhtml/images/db-graph-x-bg.png deleted file mode 100644 index 1f983cd9f0786..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-graph-x-bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-header-bg.png b/app/code/Magento/Webhook/view/adminhtml/images/db-header-bg.png deleted file mode 100644 index 1dd4993fd49bc..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-header-bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg-hov.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg-hov.gif deleted file mode 100644 index ea7b7bd2d7a02..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg-hov.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg-up.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg-up.gif deleted file mode 100644 index 59ca66db0b856..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg-up.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg.gif deleted file mode 100644 index 5bba621a810b9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-sep-last.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-menu-sep-last.gif deleted file mode 100644 index 998916da9c8c4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-sep-last.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-sep.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-menu-sep.gif deleted file mode 100644 index c8974d8ca4db3..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-sep.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-start.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-menu-start.gif deleted file mode 100644 index 11ef78430b819..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-menu-start.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-bg.gif deleted file mode 100644 index 2208140ec50f8..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-bot-roll.png b/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-bot-roll.png deleted file mode 100644 index b52d7868e4b37..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-bot-roll.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-bot.png b/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-bot.png deleted file mode 100644 index 25f9da7ac2027..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-bot.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-top-roll.png b/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-top-roll.png deleted file mode 100644 index f3e5f229b82f9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-top-roll.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-top.png b/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-top.png deleted file mode 100644 index 51a1bcabcc0ba..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-but-top.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-roller.png b/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-roller.png deleted file mode 100644 index 55d53b9225b76..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-scroll-roller.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-left-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-left-bg.gif deleted file mode 100644 index e8725966d7d2e..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-left-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-mid-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-mid-bg.gif deleted file mode 100644 index 8464f9a182726..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-mid-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-right-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-right-bg.gif deleted file mode 100644 index d4cca0057dd7a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-bottom-right-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-footer.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-footer.gif deleted file mode 100644 index 615cb2ca21bd9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-footer.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-header-sep.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-header-sep.gif deleted file mode 100644 index 038f92c4a4819..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-header-sep.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-header.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-header.gif deleted file mode 100644 index 572aa19741ad5..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-header.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-left.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-left.gif deleted file mode 100644 index cf39fda5a86ff..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-left.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-right.gif b/app/code/Magento/Webhook/view/adminhtml/images/db-tab-right.gif deleted file mode 100644 index 435a9e572b478..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/db-tab-right.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/dotted_divider_dark.gif b/app/code/Magento/Webhook/view/adminhtml/images/dotted_divider_dark.gif deleted file mode 100644 index b4f6c700caf1b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/dotted_divider_dark.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/dotted_divider_light.gif b/app/code/Magento/Webhook/view/adminhtml/images/dotted_divider_light.gif deleted file mode 100644 index 538a9262ae8dd..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/dotted_divider_light.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/edit_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/edit_icon.gif deleted file mode 100644 index 8b277aa621877..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/edit_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_down.gif b/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_down.gif deleted file mode 100644 index ea3aba2a2c618..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_down.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_down2.gif b/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_down2.gif deleted file mode 100644 index 47ff52de0c6bb..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_down2.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_up.gif b/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_up.gif deleted file mode 100644 index 4f0f11cf45bd6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_arrow_up.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_bg.gif deleted file mode 100644 index 1f6d083278fbf..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/entry_edit_head_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/error-msg.png b/app/code/Magento/Webhook/view/adminhtml/images/error-msg.png deleted file mode 100644 index d9607f0e83875..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/error-msg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/error_msg_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/error_msg_icon.gif deleted file mode 100644 index 9db2351303341..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/error_msg_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_account.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_account.gif deleted file mode 100644 index 5ec10006ff205..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_account.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_application_form_delete.png b/app/code/Magento/Webhook/view/adminhtml/images/fam_application_form_delete.png deleted file mode 100644 index cd305ec83b6a7..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_application_form_delete.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_application_view_tile.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_application_view_tile.gif deleted file mode 100644 index 8965c0e108e08..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_application_view_tile.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_asterisk_orange.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_asterisk_orange.gif deleted file mode 100644 index 46d8baecbcc17..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_asterisk_orange.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_bin.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_bin.gif deleted file mode 100644 index 3cf0aaf9be82f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_bin.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_disk.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_disk.gif deleted file mode 100644 index d72c413e8ef94..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_disk.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_error.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_error.gif deleted file mode 100644 index 0d3b48ab3d34d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_error.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_success.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_success.gif deleted file mode 100644 index f1be07354b508..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_bullet_success.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_calendar.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_calendar.gif deleted file mode 100644 index 3721980f9effa..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_calendar.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_cart.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_cart.gif deleted file mode 100644 index 7612ea22cd3f6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_cart.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_comment.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_comment.gif deleted file mode 100644 index b2013a17f06ca..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_comment.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_creditcards.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_creditcards.gif deleted file mode 100644 index 86996b7b20425..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_creditcards.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_database.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_database.gif deleted file mode 100644 index 0d78a5a0cad03..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_database.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_palette.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_palette.gif deleted file mode 100644 index 9f170d1467acd..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_palette.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_table.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_table.gif deleted file mode 100644 index 13acdab3371e5..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_folder_table.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_group.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_group.gif deleted file mode 100644 index bef3d22b9c790..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_group.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_help.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_help.gif deleted file mode 100644 index b57481ff1bb85..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_help.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_house.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_house.gif deleted file mode 100644 index 3f9d5fc055343..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_house.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_layout.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_layout.gif deleted file mode 100644 index c2172ded0e10c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_layout.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_leaf.png b/app/code/Magento/Webhook/view/adminhtml/images/fam_leaf.png deleted file mode 100644 index 9cd988dfb177b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_leaf.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_link.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_link.gif deleted file mode 100644 index 42467ac442ae2..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_link.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_lorry.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_lorry.gif deleted file mode 100644 index b902ce12c782b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_lorry.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_money.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_money.gif deleted file mode 100644 index ab0babcbfe58c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_money.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_money_add.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_money_add.gif deleted file mode 100644 index 1f9dc6bf223a5..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_money_add.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_monitor.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_monitor.gif deleted file mode 100644 index 299ec4fb3c47d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_monitor.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper.gif deleted file mode 100644 index a0d25bb53601a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_delete.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_delete.gif deleted file mode 100644 index dd1fce9c454f3..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_delete.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_error.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_error.gif deleted file mode 100644 index 5a48a701cca2a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_error.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_go.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_go.gif deleted file mode 100644 index db3b7e32bdafe..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_newspaper_go.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_package.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_package.gif deleted file mode 100644 index b5d50708d8e80..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_package.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_package_go.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_package_go.gif deleted file mode 100644 index 70f05046d8d74..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_package_go.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_page_white.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_page_white.gif deleted file mode 100644 index a572f4589cee4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_page_white.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_page_white_edit.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_page_white_edit.gif deleted file mode 100644 index be24b456bc812..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_page_white_edit.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_rainbow.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_rainbow.gif deleted file mode 100644 index a0b0a53a48495..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_rainbow.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_refresh.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_refresh.gif deleted file mode 100644 index 14b878b452a21..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_refresh.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_server_database.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_server_database.gif deleted file mode 100644 index 6f4f4c7c04e25..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_server_database.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_status_online.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_status_online.gif deleted file mode 100644 index c77eb38b267f0..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_status_online.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_tag_orange.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_tag_orange.gif deleted file mode 100644 index e039fd2535cd6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_tag_orange.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_user.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_user.gif deleted file mode 100644 index 3ff9b77784d71..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_user.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_user_comment.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_user_comment.gif deleted file mode 100644 index eb244381421b0..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_user_comment.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/fam_user_edit.gif b/app/code/Magento/Webhook/view/adminhtml/images/fam_user_edit.gif deleted file mode 100644 index 338eed2173c62..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/fam_user_edit.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/filter_row_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/filter_row_bg.gif deleted file mode 100644 index d284f0f0a776a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/filter_row_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/footer_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/footer_bg.gif deleted file mode 100644 index d5b9d37c2d0d5..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/footer_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/ghost-dark.png b/app/code/Magento/Webhook/view/adminhtml/images/ghost-dark.png deleted file mode 100644 index 502eb75d35397..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/ghost-dark.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/ghost.png b/app/code/Magento/Webhook/view/adminhtml/images/ghost.png deleted file mode 100644 index 2fe0ecd61577f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/ghost.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/gift-message-collapse.gif b/app/code/Magento/Webhook/view/adminhtml/images/gift-message-collapse.gif deleted file mode 100644 index 8270754504773..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/gift-message-collapse.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/gift-message-expand.gif b/app/code/Magento/Webhook/view/adminhtml/images/gift-message-expand.gif deleted file mode 100644 index 888fde5f5ee7f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/gift-message-expand.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/gift-message-grid-column-bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/gift-message-grid-column-bg.gif deleted file mode 100644 index 7edcc8bb1a393..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/gift-message-grid-column-bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/green_button.png b/app/code/Magento/Webhook/view/adminhtml/images/green_button.png deleted file mode 100644 index bb69b64a0f257..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/green_button.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/green_circle_right.png b/app/code/Magento/Webhook/view/adminhtml/images/green_circle_right.png deleted file mode 100644 index a5a04e70a33ef..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/green_circle_right.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grey_button.png b/app/code/Magento/Webhook/view/adminhtml/images/grey_button.png deleted file mode 100644 index 94138c5582ffc..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grey_button.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grey_circle_right.png b/app/code/Magento/Webhook/view/adminhtml/images/grey_circle_right.png deleted file mode 100644 index 3b143f063eddd..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grey_circle_right.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grid-cal.gif b/app/code/Magento/Webhook/view/adminhtml/images/grid-cal.gif deleted file mode 100644 index d0235c7e023ca..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grid-cal.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grid_sort_asc.gif b/app/code/Magento/Webhook/view/adminhtml/images/grid_sort_asc.gif deleted file mode 100644 index 1136ddcfd69a9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grid_sort_asc.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grid_sort_desc.gif b/app/code/Magento/Webhook/view/adminhtml/images/grid_sort_desc.gif deleted file mode 100644 index d6349fefe91c4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grid_sort_desc.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grid_th_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/grid_th_bg.gif deleted file mode 100644 index 8ccc66e7ba9e9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grid_th_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grid_th_onclick_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/grid_th_onclick_bg.gif deleted file mode 100644 index 3bf5e263bdbfc..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grid_th_onclick_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/grouped_to_order_icon.png b/app/code/Magento/Webhook/view/adminhtml/images/grouped_to_order_icon.png deleted file mode 100644 index d7e92ab993518..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/grouped_to_order_icon.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/header_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/header_bg.gif deleted file mode 100644 index 591ae51eee222..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/header_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/header_top_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/header_top_bg.gif deleted file mode 100644 index 47e9a5762994c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/header_top_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/hor_arrow.png b/app/code/Magento/Webhook/view/adminhtml/images/hor_arrow.png deleted file mode 100644 index 177303f364633..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/hor_arrow.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/horiz_tabs_ul_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/horiz_tabs_ul_bg.gif deleted file mode 100644 index 672fbfb34d24c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/horiz_tabs_ul_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/i_notice.gif b/app/code/Magento/Webhook/view/adminhtml/images/i_notice.gif deleted file mode 100644 index 17733eff3fa73..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/i_notice.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/i_question-mark.png b/app/code/Magento/Webhook/view/adminhtml/images/i_question-mark.png deleted file mode 100644 index 889bf696e2fda..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/i_question-mark.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/ico_success.gif b/app/code/Magento/Webhook/view/adminhtml/images/ico_success.gif deleted file mode 100644 index f1bce8e97421c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/ico_success.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon-tooltip.png b/app/code/Magento/Webhook/view/adminhtml/images/icon-tooltip.png deleted file mode 100644 index c9b1ce706b28e..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon-tooltip.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_add.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_add.gif deleted file mode 100644 index 0c7645a983d3a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_add.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_back.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_back.gif deleted file mode 100644 index a59ed3984560b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_back.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_delete.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_delete.gif deleted file mode 100644 index 458068dfaa73d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_delete.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_save.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_save.gif deleted file mode 100644 index 87a9815b4975e..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_btn_save.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_edit_address.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_edit_address.gif deleted file mode 100644 index 78e7bbb1e5071..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_edit_address.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_export.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_export.gif deleted file mode 100644 index e9fcf7cc93e0b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_export.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_export.png b/app/code/Magento/Webhook/view/adminhtml/images/icon_export.png deleted file mode 100644 index 34a736f702613..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_export.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_feed.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_feed.gif deleted file mode 100644 index 6ed34f093bbf7..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_feed.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_feed.png b/app/code/Magento/Webhook/view/adminhtml/images/icon_feed.png deleted file mode 100644 index c20804da936c0..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_feed.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_note_list.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_note_list.gif deleted file mode 100644 index 5327e20055918..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_note_list.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/icon_remove_address.gif b/app/code/Magento/Webhook/view/adminhtml/images/icon_remove_address.gif deleted file mode 100644 index e9e3b92c2eaf9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/icon_remove_address.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/image-placeholder.png b/app/code/Magento/Webhook/view/adminhtml/images/image-placeholder.png deleted file mode 100644 index a355f94784148..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/image-placeholder.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/loader-small.gif b/app/code/Magento/Webhook/view/adminhtml/images/loader-small.gif deleted file mode 100644 index 62feaa6c3c85d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/loader-small.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg.gif deleted file mode 100644 index b15f180d93b76..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg.jpg b/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg.jpg deleted file mode 100644 index 3ad1f5d092895..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg.jpg and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg_auth.jpg b/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg_auth.jpg deleted file mode 100644 index 8f7f13689d091..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bg_auth.jpg and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bottom.jpg b/app/code/Magento/Webhook/view/adminhtml/images/login_box_bottom.jpg deleted file mode 100644 index 9db375bbe6d40..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/login_box_bottom.jpg and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/login_box_legal_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/login_box_legal_bg.gif deleted file mode 100644 index 79b1ad4f0e626..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/login_box_legal_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/login_logo.gif b/app/code/Magento/Webhook/view/adminhtml/images/login_logo.gif deleted file mode 100644 index 3141a687bc46c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/login_logo.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/logo-large.gif b/app/code/Magento/Webhook/view/adminhtml/images/logo-large.gif deleted file mode 100644 index 1aefe01b5bb60..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/logo-large.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/logo.gif b/app/code/Magento/Webhook/view/adminhtml/images/logo.gif deleted file mode 100644 index 822079d8fc66b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/logo.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/massaction_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/massaction_bg.gif deleted file mode 100644 index 3c29ce38edbc9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/massaction_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/massaction_button_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/massaction_button_bg.gif deleted file mode 100644 index b45618a99a2db..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/massaction_button_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/massaction_links_delimiter.gif b/app/code/Magento/Webhook/view/adminhtml/images/massaction_links_delimiter.gif deleted file mode 100644 index 489fce6932f94..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/massaction_links_delimiter.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/middle_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/middle_bg.gif deleted file mode 100644 index f44ad896d4390..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/middle_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/more_arrow.gif b/app/code/Magento/Webhook/view/adminhtml/images/more_arrow.gif deleted file mode 100644 index 38274038067bc..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/more_arrow.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav1_active.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav1_active.gif deleted file mode 100644 index cda58c6b3fdad..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav1_active.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav1_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav1_bg.gif deleted file mode 100644 index f04614925d0d4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav1_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav1_off.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav1_off.gif deleted file mode 100644 index 2284d977a6a1d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav1_off.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav1_on.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav1_on.gif deleted file mode 100644 index cda58c6b3fdad..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav1_on.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav1_over.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav1_over.gif deleted file mode 100644 index 2878e7fb750a2..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav1_over.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav1_sep.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav1_sep.gif deleted file mode 100644 index 2284d977a6a1d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav1_sep.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav2_last_li_bg.png b/app/code/Magento/Webhook/view/adminhtml/images/nav2_last_li_bg.png deleted file mode 100644 index 9d116872d15b8..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav2_last_li_bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav2_last_li_over_bg.png b/app/code/Magento/Webhook/view/adminhtml/images/nav2_last_li_over_bg.png deleted file mode 100644 index 7103bc8344313..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav2_last_li_over_bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_bg.gif deleted file mode 100644 index 7d89746e96792..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_bg.png b/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_bg.png deleted file mode 100644 index c943091ad9417..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_over_bg.png b/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_over_bg.png deleted file mode 100644 index 06822f953b3c9..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav2_li_over_bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav2_link_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav2_link_bg.gif deleted file mode 100644 index 0af1f607e5801..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav2_link_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav2_parent_arrow.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav2_parent_arrow.gif deleted file mode 100644 index 591c49a3036bb..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav2_parent_arrow.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav3_bg.png b/app/code/Magento/Webhook/view/adminhtml/images/nav3_bg.png deleted file mode 100644 index 96793a4007eb2..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav3_bg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav_bg.gif deleted file mode 100644 index e013b09f3bf48..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav_list_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav_list_bg.gif deleted file mode 100644 index cf42c6543d5e5..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav_list_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav_nest_link_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav_nest_link_bg.gif deleted file mode 100644 index 7dac4f1ff7307..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav_nest_link_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav_nest_link_over_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav_nest_link_over_bg.gif deleted file mode 100644 index 8d808d18d56f4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav_nest_link_over_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav_on_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav_on_bg.gif deleted file mode 100644 index 1ba0ba779557b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav_on_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/nav_parent_arrow.gif b/app/code/Magento/Webhook/view/adminhtml/images/nav_parent_arrow.gif deleted file mode 100644 index f790175fb9464..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/nav_parent_arrow.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/note_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/note_bg.gif deleted file mode 100644 index 9b2d91ad9c560..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/note_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/note_cell_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/note_cell_bg.gif deleted file mode 100644 index b8786a7b9d6a4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/note_cell_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/note_msg_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/note_msg_icon.gif deleted file mode 100644 index c9cacc27ae255..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/note_msg_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/notice-msg.png b/app/code/Magento/Webhook/view/adminhtml/images/notice-msg.png deleted file mode 100644 index 0bf433b7e7c14..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/notice-msg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_left.gif b/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_left.gif deleted file mode 100644 index c0bb54f39b37b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_left.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_left_off.gif b/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_left_off.gif deleted file mode 100644 index e057ce0e30cc4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_left_off.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_right.gif b/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_right.gif deleted file mode 100644 index f464481ba14c8..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_right.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_right_off.gif b/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_right_off.gif deleted file mode 100644 index 95f17d5face7d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/pager_arrow_right_off.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/process_spinner.gif b/app/code/Magento/Webhook/view/adminhtml/images/process_spinner.gif deleted file mode 100644 index 0ebe4d8430c58..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/process_spinner.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/product_rating_blank_star.gif b/app/code/Magento/Webhook/view/adminhtml/images/product_rating_blank_star.gif deleted file mode 100644 index 72d763388e235..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/product_rating_blank_star.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/product_rating_full_star.gif b/app/code/Magento/Webhook/view/adminhtml/images/product_rating_full_star.gif deleted file mode 100644 index ab252f8890a19..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/product_rating_full_star.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/red_button.png b/app/code/Magento/Webhook/view/adminhtml/images/red_button.png deleted file mode 100644 index df5ed85a0d2d6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/red_button.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/red_circle_right.png b/app/code/Magento/Webhook/view/adminhtml/images/red_circle_right.png deleted file mode 100644 index 9f423c867355c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/red_circle_right.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/rule-ajax-loader.gif b/app/code/Magento/Webhook/view/adminhtml/images/rule-ajax-loader.gif deleted file mode 100644 index f077a0b27947e..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/rule-ajax-loader.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/rule_chooser_trigger.gif b/app/code/Magento/Webhook/view/adminhtml/images/rule_chooser_trigger.gif deleted file mode 100644 index 673d31ad5e03c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/rule_chooser_trigger.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/rule_component_add.gif b/app/code/Magento/Webhook/view/adminhtml/images/rule_component_add.gif deleted file mode 100644 index 4032f76a2027f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/rule_component_add.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/rule_component_apply.gif b/app/code/Magento/Webhook/view/adminhtml/images/rule_component_apply.gif deleted file mode 100644 index 45c61c3247ae6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/rule_component_apply.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/rule_component_remove.gif b/app/code/Magento/Webhook/view/adminhtml/images/rule_component_remove.gif deleted file mode 100644 index 9f2f4edf9ced7..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/rule_component_remove.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/save_btn_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/save_btn_icon.gif deleted file mode 100644 index 87a9815b4975e..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/save_btn_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sec_nav_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/sec_nav_bg.gif deleted file mode 100644 index d1d4535534e10..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sec_nav_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/section_menu_bg.gif deleted file mode 100644 index 53ac32a24706c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_bottom.gif b/app/code/Magento/Webhook/view/adminhtml/images/section_menu_bottom.gif deleted file mode 100644 index 640214713f5dd..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_bottom.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_link_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/section_menu_link_bg.gif deleted file mode 100644 index 4f5b1e1f4305b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_link_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_link_over_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/section_menu_link_over_bg.gif deleted file mode 100644 index be6bc4eefa347..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_link_over_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_over_span_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/section_menu_over_span_bg.gif deleted file mode 100644 index 9f06882b424f4..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_over_span_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_span_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/section_menu_span_bg.gif deleted file mode 100644 index 627e9ec35ea28..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_span_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_ul_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/section_menu_ul_bg.gif deleted file mode 100644 index d1b4d718bd904..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/section_menu_ul_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/side_col_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/side_col_bg.gif deleted file mode 100644 index 33801a6aec488..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/side_col_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/simple_container_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/simple_container_bg.gif deleted file mode 100644 index 933999856de94..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/simple_container_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-down.gif b/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-down.gif deleted file mode 100644 index 825e492e761b3..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-down.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-down.png b/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-down.png deleted file mode 100644 index 74288ad241171..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-down.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-up.gif b/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-up.gif deleted file mode 100644 index ea2ee5ef59501..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-up.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-up.png b/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-up.png deleted file mode 100644 index 2863a05111d4a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sort-arrow-up.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sort_heading_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/sort_heading_bg.gif deleted file mode 100644 index c9642dfdaa9bc..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sort_heading_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sort_on_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/sort_on_bg.gif deleted file mode 100644 index be9ef00458c5c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sort_on_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sort_row_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/sort_row_bg.gif deleted file mode 100644 index a02c2c0205be6..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sort_row_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/spacer.gif b/app/code/Magento/Webhook/view/adminhtml/images/spacer.gif deleted file mode 100644 index 5bfd67a2d6f72..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/spacer.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/sub_button_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/sub_button_bg.gif deleted file mode 100644 index 17d1bf74d4a3e..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/sub_button_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/success-msg.png b/app/code/Magento/Webhook/view/adminhtml/images/success-msg.png deleted file mode 100644 index 24bfc750a218f..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/success-msg.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/success_msg_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/success_msg_icon.gif deleted file mode 100644 index 611faffbc5f42..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/success_msg_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tabs_link_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/tabs_link_bg.gif deleted file mode 100644 index 94506909fef67..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tabs_link_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tabs_link_over_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/tabs_link_over_bg.gif deleted file mode 100644 index 185af722bb46d..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tabs_link_over_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tabs_span_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/tabs_span_bg.gif deleted file mode 100644 index 4f5b1e1f4305b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tabs_span_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tag_blue_edit.gif b/app/code/Magento/Webhook/view/adminhtml/images/tag_blue_edit.gif deleted file mode 100644 index 6a9d3700b7125..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tag_blue_edit.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tn_cancel_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/tn_cancel_bg.gif deleted file mode 100644 index a3d92e461f740..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tn_cancel_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tooltip_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/tooltip_bg.gif deleted file mode 100644 index e4d9e99348ea7..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tooltip_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tooltip_corner.gif b/app/code/Magento/Webhook/view/adminhtml/images/tooltip_corner.gif deleted file mode 100644 index f49f64f7fa41b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tooltip_corner.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tooltip_top.gif b/app/code/Magento/Webhook/view/adminhtml/images/tooltip_top.gif deleted file mode 100644 index 0e7fd0fa283bf..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tooltip_top.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/join.gif b/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/join.gif deleted file mode 100644 index 34dd47610a5d7..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/join.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/joinbottom.gif b/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/joinbottom.gif deleted file mode 100644 index 48b81c80a9e25..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/joinbottom.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/line.gif b/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/line.gif deleted file mode 100644 index 1a259eea00c33..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/line.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/minus.gif b/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/minus.gif deleted file mode 100644 index 3d212a97ae0d8..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/minus.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/minusbottom.gif b/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/minusbottom.gif deleted file mode 100644 index dc3198be275d3..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/minusbottom.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/nolines_minus.gif b/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/nolines_minus.gif deleted file mode 100644 index 2592ac20f3f4c..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/nolines_minus.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/nolines_plus.gif b/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/nolines_plus.gif deleted file mode 100644 index f258ce211a0a1..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/tree_icons/nolines_plus.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/validation_advice_bg.gif b/app/code/Magento/Webhook/view/adminhtml/images/validation_advice_bg.gif deleted file mode 100644 index 46b1a2267ba5a..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/validation_advice_bg.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/varien_logo.gif b/app/code/Magento/Webhook/view/adminhtml/images/varien_logo.gif deleted file mode 100644 index f24f00c36ddf0..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/varien_logo.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/ver_arrow.png b/app/code/Magento/Webhook/view/adminhtml/images/ver_arrow.png deleted file mode 100644 index 9841f050b1b3b..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/ver_arrow.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/warning_msg_icon.gif b/app/code/Magento/Webhook/view/adminhtml/images/warning_msg_icon.gif deleted file mode 100644 index c29d6cfcbf748..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/warning_msg_icon.gif and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/window_close.png b/app/code/Magento/Webhook/view/adminhtml/images/window_close.png deleted file mode 100644 index 6e2b6dfb1d098..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/window_close.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/window_content.png b/app/code/Magento/Webhook/view/adminhtml/images/window_content.png deleted file mode 100644 index db3c448660b82..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/window_content.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/images/window_top.png b/app/code/Magento/Webhook/view/adminhtml/images/window_top.png deleted file mode 100644 index d30bc1c89e082..0000000000000 Binary files a/app/code/Magento/Webhook/view/adminhtml/images/window_top.png and /dev/null differ diff --git a/app/code/Magento/Webhook/view/adminhtml/js/validate_form.js b/app/code/Magento/Webhook/view/adminhtml/js/validate_form.js deleted file mode 100644 index c9ed76e087d5b..0000000000000 --- a/app/code/Magento/Webhook/view/adminhtml/js/validate_form.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Webhook - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -$j = jQuery.noConflict(); -$j(document).ready(function(){ - jQuery.validator.addClassRules("required-entry", { - required: true - }); -}) \ No newline at end of file diff --git a/app/code/Magento/Webhook/view/adminhtml/js/webhook.js b/app/code/Magento/Webhook/view/adminhtml/js/webhook.js deleted file mode 100644 index 8e18d9a6431ee..0000000000000 --- a/app/code/Magento/Webhook/view/adminhtml/js/webhook.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Webhook - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -function activateSubscription(url) -{ - $j = jQuery.noConflict(); - var activateSubscriptionDiv = $j('#activate-subscription'); - if (undefined === activateSubscriptionDiv[0]) { - activateSubscriptionDiv = $j('
    '); - $j('body').append(activateSubscriptionDiv); - } - activateSubscriptionDiv.html(''); - - activateSubscriptionDiv.append('