Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * @expectedException \Magento\Framework\Model\Exception
  * @expectedExceptionMessage Theme has not been set
  */
 public function testGetEditableThemeNotSet()
 {
     $this->_model->getEditableTheme();
 }
Ejemplo n.º 3
0
 /**
  * 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()]);
 }
Ejemplo n.º 4
0
 /**
  * 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;
 }
Ejemplo n.º 5
0
 /**
  * Get save url
  *
  * @return string
  */
 public function getSaveUrl()
 {
     return $this->getUrl('adminhtml/system_design_editor_tools/saveQuickStyles', array('theme_id' => $this->_themeContext->getEditableTheme()->getId()));
 }
Ejemplo n.º 6
0
 /**
  * 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()]);
 }
Ejemplo n.º 8
0
 /**
  * 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()));
 }
Ejemplo n.º 9
0
 /**
  * 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]);
 }