// fix AdminMeta options form and toolbar
This commit is contained in:
@@ -119,7 +119,7 @@ class AdminControllerCore extends Controller
|
||||
/** @var array list of toolbar buttons */
|
||||
protected $toolbar_btn = null;
|
||||
|
||||
/** @var array list of toolbar buttons */
|
||||
/** @var boolean scrolling toolbar */
|
||||
protected $toolbar_fix = true;
|
||||
|
||||
/** @var boolean set to false to hide toolbar and page title */
|
||||
@@ -984,7 +984,6 @@ class AdminControllerCore extends Controller
|
||||
{
|
||||
switch ($this->display)
|
||||
{
|
||||
// @todo defining default buttons
|
||||
case 'add':
|
||||
case 'edit':
|
||||
// Default save button - action dynamically handled in javascript
|
||||
@@ -1440,7 +1439,6 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
|
||||
$list = $helper->generateList($this->_list, $this->fieldsDisplay);
|
||||
$this->toolbar_fix = false;
|
||||
|
||||
return $list;
|
||||
}
|
||||
@@ -1455,7 +1453,6 @@ class AdminControllerCore extends Controller
|
||||
$helper->tpl_vars = $this->tpl_view_vars;
|
||||
!is_null($this->base_tpl_view) ? $helper->base_tpl = $this->base_tpl_view : '';
|
||||
$view = $helper->generateView();
|
||||
$this->toolbar_fix = false;
|
||||
|
||||
return $view;
|
||||
}
|
||||
@@ -1490,7 +1487,6 @@ class AdminControllerCore extends Controller
|
||||
$helper->tpl_vars['back'] = Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token));
|
||||
}
|
||||
$form = $helper->generateForm($this->fields_form);
|
||||
$this->toolbar_fix = false;
|
||||
|
||||
return $form;
|
||||
}
|
||||
@@ -1511,7 +1507,6 @@ class AdminControllerCore extends Controller
|
||||
$helper->id = $this->id;
|
||||
$helper->tpl_vars = $this->tpl_option_vars;
|
||||
$options = $helper->generateOptions($this->options);
|
||||
$this->toolbar_fix = false;
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ class AdminMetaControllerCore extends AdminController
|
||||
public $table = 'meta';
|
||||
public $className = 'Meta';
|
||||
public $lang = true;
|
||||
protected $toolbar_fix = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -85,10 +86,17 @@ class AdminMetaControllerCore extends AdminController
|
||||
$this->addFieldRoute('cms_rule', $this->l('Route to CMS page'));
|
||||
$this->addFieldRoute('cms_category_rule', $this->l('Route to CMS category'));
|
||||
$this->addFieldRoute('module', $this->l('Route to modules'));
|
||||
$this->options['routes']['submit'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function initProcess()
|
||||
{
|
||||
parent::initProcess();
|
||||
// This is a composite page, we don't want the "options" display mode
|
||||
if ($this->display == 'options')
|
||||
$this->display = '';
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
@@ -174,6 +182,7 @@ class AdminMetaControllerCore extends AdminController
|
||||
'label' => $this->l('Rewritten URL:'),
|
||||
'name' => 'url_rewrite',
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'hint' => $this->l('Invalid characters:').' <>;=#{}',
|
||||
'desc' => $this->l('Example : "contacts" for http://mysite.com/shop/contacts to redirect to http://mysite.com/shop/contact-form.php'),
|
||||
'size' => 50
|
||||
@@ -297,4 +306,29 @@ class AdminMetaControllerCore extends AdminController
|
||||
{
|
||||
$this->checkAndUpdateRoute('cms_category_rule');
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to render the options for this controller
|
||||
*/
|
||||
public function renderOptions()
|
||||
{
|
||||
if (!Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
unset($this->options['routes']);
|
||||
|
||||
if ($this->options && is_array($this->options))
|
||||
{
|
||||
$helper = new HelperOptions($this);
|
||||
$this->setHelperDisplay($helper);
|
||||
$helper->toolbar_fix = true;
|
||||
$helper->toolbar_btn = array('save' => array(
|
||||
'href' => '#',
|
||||
'desc' => $this->l('Save')
|
||||
));
|
||||
$helper->id = $this->id;
|
||||
$helper->tpl_vars = $this->tpl_option_vars;
|
||||
$options = $helper->generateOptions($this->options);
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user