123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- /**
- * Backend Catalog Price Rules controller
- *
- * @author Magento Core Team <core@magentocommerce.com>
- */
- namespace Magento\CatalogRule\Controller\Adminhtml\Promo;
- use Magento\Backend\App\Action;
- use Magento\Backend\App\Action\Context;
- use Magento\Framework\Registry;
- use Magento\Framework\Stdlib\DateTime\Filter\Date;
- abstract class Catalog extends Action
- {
- /**
- * Authorization level of a basic admin session
- *
- * @see _isAllowed()
- */
- const ADMIN_RESOURCE = 'Magento_CatalogRule::promo_catalog';
- /**
- * Dirty rules notice message
- *
- *
- * @var string
- */
- protected $_dirtyRulesNoticeMessage;
- /**
- * Core registry
- *
- * @var Registry
- */
- protected $_coreRegistry = null;
- /**
- * Date filter instance
- *
- * @var \Magento\Framework\Stdlib\DateTime\Filter\Date
- */
- protected $_dateFilter;
- /**
- * Constructor
- *
- * @param Context $context
- * @param Registry $coreRegistry
- * @param Date $dateFilter
- */
- public function __construct(Context $context, Registry $coreRegistry, Date $dateFilter)
- {
- parent::__construct($context);
- $this->_coreRegistry = $coreRegistry;
- $this->_dateFilter = $dateFilter;
- }
- /**
- * Init action
- *
- * @return $this
- */
- protected function _initAction()
- {
- $this->_view->loadLayout();
- $this->_setActiveMenu(
- 'Magento_CatalogRule::promo_catalog'
- )->_addBreadcrumb(
- __('Promotions'),
- __('Promotions')
- );
- return $this;
- }
- /**
- * Set dirty rules notice message
- *
- * @param string $dirtyRulesNoticeMessage
- * @return void
- * @codeCoverageIgnore
- */
- public function setDirtyRulesNoticeMessage($dirtyRulesNoticeMessage)
- {
- $this->_dirtyRulesNoticeMessage = $dirtyRulesNoticeMessage;
- }
- /**
- * Get dirty rules notice message
- *
- * @return string
- */
- public function getDirtyRulesNoticeMessage()
- {
- $defaultMessage = __(
- 'We found updated rules that are not applied. Please click "Apply Rules" to update your catalog.'
- );
- return $this->_dirtyRulesNoticeMessage ? $this->_dirtyRulesNoticeMessage : $defaultMessage;
- }
- }
|