/** * Create a form element with necessary controls * * @return \Magento\DesignEditor\Block\Adminhtml\Editor\Tools\QuickStyles\Header * @throws \Magento\Framework\Exception\LocalizedException */ protected function _prepareForm() { if (!$this->_formId || !$this->_tab) { throw new \Magento\Framework\Exception\LocalizedException(__('We found an invalid block of class "%1". Please define the required properties.', get_class($this))); } $form = $this->_formBuilder->create(['id' => $this->_formId, 'action' => '#', 'method' => 'post', 'tab' => $this->_tab, 'theme' => $this->_themeContext->getStagingTheme(), 'parent_theme' => $this->_themeContext->getEditableTheme()->getParentTheme()]); $form->setUseContainer(true); $this->setForm($form); parent::_prepareForm(); return $this; }
/** * @expectedException \Magento\Framework\Model\Exception * @expectedExceptionMessage Theme has not been set */ public function testGetEditableThemeNotSet() { $this->_model->getEditableTheme(); }
/** * Returns url to save action of image sizing * * @return string */ public function getImageSizingUrl() { return $this->getUrl('adminhtml/system_design_editor_tools/saveImageSizing', ['theme_id' => $this->_themeContext->getEditableTheme()->getId()]); }
/** * Get stores list * * @return \Magento\Store\Model\Store|null */ public function getStoresList() { $stores = $this->_customization->getStoresByThemes(); return isset($stores[$this->_themeContext->getEditableTheme()->getId()]) ? $stores[$this->_themeContext->getEditableTheme()->getId()] : null; }
/** * Get save url * * @return string */ public function getSaveUrl() { return $this->getUrl('adminhtml/system_design_editor_tools/saveQuickStyles', array('theme_id' => $this->_themeContext->getEditableTheme()->getId())); }
/** * Check themes by change time (compare staging and physical theme) * * @return bool */ protected function _isAbleRevertToDefault() { return $this->_hasThemeChanged($this->_themeContext->getStagingTheme(), $this->_themeContext->getEditableTheme()->getParentTheme()); }
/** * Get URL of remove image action * * @return string */ public function getImageRemoveUrl() { return $this->getUrl('adminhtml/system_design_editor_tools/removeQuickStyleImage', ['theme_id' => $this->_themeContext->getEditableTheme()->getId()]); }
/** * Get delete js url * * @return string */ public function getJsDeleteUrl() { return $this->getUrl('adminhtml/system_design_editor_tools/deleteCustomFiles', array('theme_id' => $this->_themeContext->getEditableTheme()->getId())); }
/** * Get theme custom css content * * @param string $targetElementId * @param string $contentType * @return string */ public function getMediaBrowserUrl($targetElementId, $contentType) { return $this->getUrl('adminhtml/system_design_editor_files/index', ['target_element_id' => $targetElementId, \Magento\Theme\Helper\Storage::PARAM_THEME_ID => $this->_themeContext->getEditableTheme()->getId(), \Magento\Theme\Helper\Storage::PARAM_CONTENT_TYPE => $contentType]); }