/** * Load Wysiwyg on demand and Prepare layout * * @return void */ protected function _prepareLayout() { parent::_prepareLayout(); if ($this->_wysiwygConfig->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } }
/** * Load Wysiwyg on demand and prepare layout * * @return void */ protected function _prepareLayout() { parent::_prepareLayout(); if ($this->_catalogData->isModuleEnabled('Magento_Cms') && $this->_wysiwygConfig->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } }
/** * @covers \Magento\Cms\Model\Wysiwyg\Config::isEnabled * @param string $wysiwygState * @param boolean $expectedResult * * @dataProvider isEnabledDataProvider */ public function testIsEnabled($wysiwygState, $expectedResult) { $storeId = 1; $this->wysiwygConfig->setStoreId($storeId); $this->scopeConfigMock->expects($this->atLeastOnce())->method('getValue')->with('cms/wysiwyg/enabled', 'store', $storeId)->willReturn($wysiwygState); $this->assertEquals($expectedResult, $this->wysiwygConfig->isEnabled()); }
/** * Check whether wysiwyg enabled or not * * @return bool * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ public function getIsWysiwygEnabled() { if ($this->_moduleManager->isEnabled('Magento_Cms')) { return (bool) ($this->_wysiwygConfig->isEnabled() && $this->getEntityAttribute()->getIsWysiwygEnabled()); } return false; }
/** * Preparing block layout * * @return $this */ protected function _prepareLayout() { // Load Wysiwyg on demand and Prepare layout $block = $this->getLayout()->getBlock('head'); if ($this->_wysiwygConfig->isEnabled() && $block) { $block->setCanLoadTinyMce(true); } $this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Back'), 'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'", 'class' => 'action-back')); $this->getToolbar()->addChild('reset_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Reset'), 'onclick' => 'window.location.href = window.location.href', 'class' => 'reset')); if (!$this->isTextType()) { $this->getToolbar()->addChild('to_plain_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Convert to Plain Text'), 'onclick' => 'templateControl.stripTags();', 'id' => 'convert_button', 'class' => 'convert')); $this->getToolbar()->addChild('to_html_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Return HTML Version'), 'onclick' => 'templateControl.unStripTags();', 'id' => 'convert_button_back', 'style' => 'display:none', 'class' => 'return')); } $this->getToolbar()->addChild('preview_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Preview Template'), 'onclick' => 'templateControl.preview();', 'class' => 'preview')); if ($this->getEditMode()) { $this->getToolbar()->addChild('delete_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Delete Template'), 'onclick' => 'templateControl.deleteTemplate();', 'class' => 'delete')); $this->getToolbar()->addChild('save_as_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Save As'), 'onclick' => 'templateControl.saveAs();', 'class' => 'save-as')); } $this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Save Template'), 'onclick' => 'templateControl.save();', 'class' => 'save primary')); return parent::_prepareLayout(); }
/** * Prepare for the layout * * @return AbstractBlock */ protected function _prepareLayout() { // Load Wysiwyg on demand and Prepare layout if ($this->_wysiwygConfig->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } $this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Back'), 'onclick' => "window.location.href = '" . $this->getUrl($this->getTemplateId() ? '*/template' : '*/*') . "'", 'class' => 'action-back')); $this->getToolbar()->addChild('reset_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Reset'), 'class' => 'reset', 'onclick' => 'window.location = window.location')); $this->getToolbar()->addChild('preview_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Preview Template'), 'onclick' => 'queueControl.preview();', 'class' => 'preview')); $this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Save Newsletter'), 'class' => 'save primary', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'save', 'target' => '#queue_edit_form'))))); $this->getToolbar()->addChild('save_and_resume', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Save and Resume'), 'class' => 'save', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'save', 'target' => '#queue_edit_form', 'eventData' => array('action' => array('args' => array('_resume' => 1)))))))); return parent::_prepareLayout(); }