Beispiel #1
1
 /**
  * @return AbstractBlock|void
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->getToolbar()->addChild('createSnapshotButton', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('System Backup'), 'onclick' => "return backup.backup('" . \Magento\Framework\Backup\Factory::TYPE_SYSTEM_SNAPSHOT . "')", 'class' => 'primary system-backup']);
     $this->getToolbar()->addChild('createMediaBackupButton', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Database and Media Backup'), 'onclick' => "return backup.backup('" . \Magento\Framework\Backup\Factory::TYPE_MEDIA . "')", 'class' => 'primary database-media-backup']);
     $this->getToolbar()->addChild('createButton', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Database Backup'), 'onclick' => "return backup.backup('" . \Magento\Framework\Backup\Factory::TYPE_DB . "')", 'class' => 'task primary database-backup']);
     $this->addChild('dialogs', 'Magento\\Backup\\Block\\Adminhtml\\Dialogs');
 }
Beispiel #2
1
 /**
  * @return AbstractBlock
  */
 protected function _prepareLayout()
 {
     if ($this->getToolbar()) {
         $this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Save Attribute Set'), 'class' => 'save primary save-attribute-set', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'save', 'target' => '#set-prop-form')))));
         $this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/') . '\')', 'class' => 'back'));
     }
     $this->addChild('setForm', 'Magento\\Catalog\\Block\\Adminhtml\\Product\\Attribute\\Set\\Main\\Formset');
     return parent::_prepareLayout();
 }
 public function testGetItemPrice()
 {
     $html = '$34.28';
     $this->layoutMock->expects($this->once())->method('getBlock')->with('item_price')->will($this->returnValue($this->priceRenderBlock));
     $this->priceRenderBlock->expects($this->once())->method('setItem')->with($this->itemMock);
     $this->priceRenderBlock->expects($this->once())->method('toHtml')->will($this->returnValue($html));
     $this->assertEquals($html, $this->block->getItemPrice($this->itemMock));
 }
Beispiel #4
0
 public function testGetItemRowTotalAfterDiscountHtml()
 {
     $html = '$34.28';
     $this->layoutMock->expects($this->once())->method('getBlock')->with('item_row_total_after_discount')->will($this->returnValue($this->priceRenderBlock));
     $this->priceRenderBlock->expects($this->once())->method('setItem')->with($this->itemMock);
     $this->priceRenderBlock->expects($this->once())->method('toHtml')->will($this->returnValue($html));
     $this->assertEquals($html, $this->block->getItemRowTotalAfterDiscountHtml($this->itemMock));
 }
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Framework\App\ProductMetadataInterface $productMetaData
  * @param \Magento\Framework\Module\ModuleList\Loader $loader
  * @param \Ebizmarts\Mandrill\Helper\Data $mandrillHelper
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\App\ProductMetadataInterface $productMetaData, \Magento\Framework\Module\ModuleList\Loader $loader, \Ebizmarts\Mandrill\Helper\Data $mandrillHelper, array $data = [])
 {
     parent::__construct($context, $data);
     $this->_metaData = $productMetaData;
     $this->_loader = $loader;
     $this->_mandrillHelper = $mandrillHelper;
 }
Beispiel #6
0
 /**
  * {@inheritdoc}
  */
 protected function _beforeToHtml()
 {
     $this->assign('form', $this->_form);
     $this->assign('element', $this->_element);
     $this->assign('formBlock', $this->_formBlock);
     return parent::_beforeToHtml();
 }
Beispiel #7
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $defaultColumnRenderer
  * @param TaxHelper $taxHelper
  * @param ItemPriceRenderer $itemPriceRenderer
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $defaultColumnRenderer, TaxHelper $taxHelper, ItemPriceRenderer $itemPriceRenderer, array $data = array())
 {
     $this->defaultColumnRenderer = $defaultColumnRenderer;
     $this->itemPriceRenderer = $itemPriceRenderer;
     $this->itemPriceRenderer->setZone('sales');
     parent::__construct($context, $data);
 }
 /**
  * Initialize review data
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     if ($this->_coreRegistry->registry('review_data')) {
         $this->setReviewId($this->_coreRegistry->registry('review_data')->getReviewId());
     }
 }
 /**
  * @inheritDoc
  */
 public function toHtml()
 {
     if ($this->_storeManager->isSingleStoreMode()) {
         return '';
     }
     return parent::toHtml();
 }
Beispiel #10
0
 /**
  * Block constructor.
  *
  * @param \Magento\Backend\Block\Template\Context          $context        Templating context.
  * @param \Magento\Framework\Data\Form\Element\Factory     $elementFactory Form element factory.
  * @param \Magento\Rule\Block\Conditions                   $conditions     Rule conditions block.
  * @param \Smile\ElasticsuiteCatalogRule\Model\RuleFactory $ruleFactory    Search rule factory.
  * @param array                                            $data           Additional data.
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Data\Form\Element\Factory $elementFactory, \Magento\Rule\Block\Conditions $conditions, \Smile\ElasticsuiteCatalogRule\Model\RuleFactory $ruleFactory, array $data = [])
 {
     $this->elementFactory = $elementFactory;
     $this->conditions = $conditions;
     $this->rule = $ruleFactory->create();
     parent::__construct($context, $data);
 }
Beispiel #11
0
 /**
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->getActiveMenu()) {
         return parent::_toHtml();
     }
     return false;
 }
Beispiel #12
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param ConfigInterface $securityConfig
  * @param \Magento\Security\Model\AdminSessionsManager $sessionsManager
  * @param RemoteAddress $remoteAddress
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, ConfigInterface $securityConfig, \Magento\Security\Model\AdminSessionsManager $sessionsManager, RemoteAddress $remoteAddress)
 {
     parent::__construct($context);
     $this->securityConfig = $securityConfig;
     $this->sessionsManager = $sessionsManager;
     $this->remoteAddress = $remoteAddress;
 }
 /**
  * @return AbstractBlock|void
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Back'), 'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'", 'class' => 'action-back']);
     $this->getToolbar()->addChild('reset_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Reset'), 'onclick' => 'window.location.href = window.location.href', 'class' => 'reset']);
     $this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Generate Module'), 'class' => 'save primary create-module', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'save', 'target' => '#module-creator-form']]]]);
 }
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param \Magento\Framework\Registry $registry
  * @param DataObjectHelper $dataObjectHelper
  * @param \Magento\Framework\ObjectManagerInterface $objectManager
  * @param array $data
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Registry $registry, DataObjectHelper $dataObjectHelper, \Magento\Framework\ObjectManagerInterface $objectManager, array $data = [])
 {
     parent::__construct($context, $data);
     $this->coreRegistry = $registry;
     $this->dateTime = $dateTime;
     $this->objectManager = $objectManager;
 }
Beispiel #15
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Store\Model\Resource\Website\Collection $websiteCollection
  * @param \Magento\Theme\Model\Config\Customization $customizationConfig
  * @param \Magento\Framework\Json\Helper\Data $jsonHelper
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Store\Model\Resource\Website\Collection $websiteCollection, \Magento\Theme\Model\Config\Customization $customizationConfig, \Magento\Framework\Json\Helper\Data $jsonHelper, array $data = [])
 {
     $this->jsonHelper = $jsonHelper;
     $this->_websiteCollection = $websiteCollection;
     $this->_customizationConfig = $customizationConfig;
     parent::__construct($context, $data);
 }
Beispiel #16
0
 /**
  * Preparing global layout
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     $onclick = "submitAndReloadArea(\$('order_history_block').parentNode, '" . $this->getSubmitUrl() . "')";
     $button = $this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Button')->setData(['label' => __('Submit Comment'), 'class' => 'action-save action-secondary', 'onclick' => $onclick]);
     $this->setChild('submit_button', $button);
     return parent::_prepareLayout();
 }
Beispiel #17
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Review\Model\ResourceModel\Rating\Option\Vote\CollectionFactory $votesFactory
  * @param \Magento\Review\Model\RatingFactory $ratingFactory
  * @param \Magento\Framework\Registry $registry
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Review\Model\ResourceModel\Rating\Option\Vote\CollectionFactory $votesFactory, \Magento\Review\Model\RatingFactory $ratingFactory, \Magento\Framework\Registry $registry, array $data = [])
 {
     $this->_votesFactory = $votesFactory;
     $this->_ratingFactory = $ratingFactory;
     $this->_coreRegistry = $registry;
     parent::__construct($context, $data);
 }
 /**
  * Render block
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (count($this->_messages->getUnread())) {
         return parent::_toHtml();
     }
     return '';
 }
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
  * @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration
  * @param \Magento\Framework\Registry $registry
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, \Magento\Framework\Registry $registry, array $data = [])
 {
     $this->stockRegistry = $stockRegistry;
     $this->stockConfiguration = $stockConfiguration;
     $this->_coreRegistry = $registry;
     parent::__construct($context, $data);
 }
Beispiel #20
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory
  * @param \Magento\Framework\Validator\UniversalFactory $universalFactory
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory, \Magento\Framework\Validator\UniversalFactory $universalFactory, array $data = [])
 {
     parent::__construct($context, $data);
     $this->_registry = $registry;
     $this->_attrOptionCollectionFactory = $attrOptionCollectionFactory;
     $this->_universalFactory = $universalFactory;
 }
Beispiel #21
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Framework\Locale\ListsInterface $localeLists
  * @param \Magento\Framework\Locale\ResolverInterface $localeResolver
  * @param \Magento\Core\Helper\Url $urlHelper
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Locale\ListsInterface $localeLists, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Core\Helper\Url $urlHelper, array $data = array())
 {
     $this->_localeLists = $localeLists;
     $this->_localeResolver = $localeResolver;
     $this->_urlHelper = $urlHelper;
     parent::__construct($context, $data);
 }
Beispiel #22
0
 /**
  * @param \Magento\Backend\Block\Template\Context   $context
  * @param \Wyomind\SimpleGoogleShopping\Model\Feeds $sgsModel
  * @param \Wyomind\SimpleGoogleShopping\Helper\Data $sgsHelper
  * @param array                                     $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Wyomind\SimpleGoogleShopping\Model\Feeds $sgsModel, \Wyomind\SimpleGoogleShopping\Helper\Data $sgsHelper, \Wyomind\Core\Helper\Data $coreHelper, array $data = [])
 {
     $this->_sgsModel = $sgsModel;
     $this->_sgsHelper = $sgsHelper;
     $this->_coreHelper = $coreHelper;
     parent::__construct($context, $data);
 }
Beispiel #23
0
 /**
  * {@inheritdoc}
  */
 protected function _prepareLayout()
 {
     $this->setTemplate('Magento_Backend::system/design/index.phtml');
     $this->getToolbar()->addChild('add_new_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Add Design Change'), 'onclick' => "setLocation('" . $this->getUrl('adminhtml/*/new') . "')", 'class' => 'add primary add-design-change'));
     $this->getLayout()->getBlock('page-title')->setPageTitle('Store Design Schedule');
     return parent::_prepareLayout();
 }
Beispiel #24
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Log\Model\CustomerFactory $logFactory
  * @param \Magento\Log\Model\Log $modelLog
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Log\Model\CustomerFactory $logFactory, \Magento\Log\Model\Log $modelLog, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder, array $data = [])
 {
     $this->logFactory = $logFactory;
     $this->modelLog = $modelLog;
     $this->dateTime = $dateTime;
     $this->customerBuilder = $customerBuilder;
     parent::__construct($context, $data);
 }
Beispiel #25
0
 /**
  * Retrieve required options from parent
  *
  * @return void
  * @throws \Magento\Framework\Model\Exception
  */
 protected function _beforeToHtml()
 {
     if (!$this->getParentBlock()) {
         throw new \Magento\Framework\Model\Exception(__('Invalid parent block for this block'));
     }
     $this->setPayment($this->getParentBlock()->getOrder()->getPayment());
     parent::_beforeToHtml();
 }
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
  * @param \Magento\Shipping\Model\Carrier\Source\GenericInterface $sourceSizeModel
  * @param \Magento\Framework\Registry $coreRegistry
  * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Json\EncoderInterface $jsonEncoder, \Magento\Shipping\Model\Carrier\Source\GenericInterface $sourceSizeModel, \Magento\Framework\Registry $coreRegistry, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = [])
 {
     $this->_jsonEncoder = $jsonEncoder;
     $this->_coreRegistry = $coreRegistry;
     $this->_sourceSizeModel = $sourceSizeModel;
     $this->_carrierFactory = $carrierFactory;
     parent::__construct($context, $data);
 }
Beispiel #27
0
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $datetime, \Wyomind\Watchlog\Model\ResourceModel\Attempts\CollectionFactory $attemptsCollectionFactory, \Wyomind\Watchlog\Helper\Data $watchlogHelper, array $data = [])
 {
     $this->_datetime = $datetime;
     $this->_attemptsCollectionFactory = $attemptsCollectionFactory;
     $this->watchlogHelper = $watchlogHelper;
     parent::__construct($context, $data);
     $this->setTemplate('chart.phtml');
 }
Beispiel #28
0
 /**
  * @param \Magento\Backend\Block\Template\Context $context
  * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, \Magento\Framework\Registry $registry, \Magento\Catalog\Model\CategoryFactory $categoryFactory, array $data = array())
 {
     $this->_categoryTree = $categoryTree;
     $this->_coreRegistry = $registry;
     $this->_categoryFactory = $categoryFactory;
     $this->_withProductCount = true;
     parent::__construct($context, $data);
 }
 /**
  * @param \Magento\Framework\Data\Form\Element\Factory $elementFactory
  * @param \Magento\Rule\Block\Conditions $conditions
  * @param \Magento\CatalogWidget\Model\Rule $rule
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\Backend\Block\Template\Context $context
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Data\Form\Element\Factory $elementFactory, \Magento\Rule\Block\Conditions $conditions, \Magento\CatalogWidget\Model\Rule $rule, \Magento\Framework\Registry $registry, array $data = [])
 {
     $this->elementFactory = $elementFactory;
     $this->conditions = $conditions;
     $this->rule = $rule;
     $this->registry = $registry;
     parent::__construct($context, $data);
 }
 /**
  * constructor
  *
  * @param \Magento\Framework\Registry $coreRegistry
  * @param \Mageplaza\Blog\Model\ResourceModel\Category\Tree $categoryTree
  * @param \Mageplaza\Blog\Model\CategoryFactory $categoryFactory
  * @param \Mageplaza\Blog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory
  * @param \Magento\Backend\Block\Widget\Context $context
  * @param array $data
  */
 public function __construct(\Magento\Framework\Registry $coreRegistry, \Mageplaza\Blog\Model\ResourceModel\Category\Tree $categoryTree, \Mageplaza\Blog\Model\CategoryFactory $categoryFactory, \Mageplaza\Blog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory, \Magento\Backend\Block\Widget\Context $context, array $data = [])
 {
     $this->coreRegistry = $coreRegistry;
     $this->categoryTree = $categoryTree;
     $this->categoryFactory = $categoryFactory;
     $this->categoryCollectionFactory = $categoryCollectionFactory;
     parent::__construct($context, $data);
 }