git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9249 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -44,12 +44,42 @@ class AdminAliasesControllerCore extends AdminController
|
|||||||
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
||||||
|
|
||||||
$this->fieldsDisplay = array(
|
$this->fieldsDisplay = array(
|
||||||
'alias' => array('title' => $this->l('Aliases'), 'width' => 160),
|
'alias' => array('title' => $this->l('Aliases'), 'width' => 160),
|
||||||
'search' => array('title' => $this->l('Search'), 'width' => 40),
|
'search' => array('title' => $this->l('Search'), 'width' => 40),
|
||||||
'active' => array('title' => $this->l('Status'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
|
'active' => array('title' => $this->l('Status'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->template = 'adminAliases.tpl';
|
$this->fields_form = array(
|
||||||
|
'legend' => array(
|
||||||
|
'title' => $this->l('Aliases'),
|
||||||
|
'image' => '../img/admin/search.gif'
|
||||||
|
),
|
||||||
|
'input' => array(
|
||||||
|
array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Alias:'),
|
||||||
|
'name' => 'alias',
|
||||||
|
'size' => 40,
|
||||||
|
'required' => true,
|
||||||
|
'p' => array(
|
||||||
|
$this->l('Enter each alias separated by a comma (\',\') (e.g., \'prestshop,preztashop,prestasohp\')'),
|
||||||
|
$this->l('Forbidden characters: <>;=#{}')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Result:'),
|
||||||
|
'name' => 'search',
|
||||||
|
'size' => 15,
|
||||||
|
'required' => true,
|
||||||
|
'p' => $this->l('Search this word instead.')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'submit' => array(
|
||||||
|
'title' => $this->l(' Save '),
|
||||||
|
'class' => 'button'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
@@ -74,33 +104,21 @@ class AdminAliasesControllerCore extends AdminController
|
|||||||
foreach ($aliases as $alias)
|
foreach ($aliases as $alias)
|
||||||
{
|
{
|
||||||
$obj = new Alias(null, trim($alias), trim($search));
|
$obj = new Alias(null, trim($alias), trim($search));
|
||||||
$obj->save();
|
$obj->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
parent::postProcess();
|
parent::postProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayForm($is_main_tab = true)
|
public function initContent()
|
||||||
{
|
{
|
||||||
parent::displayForm($is_main_tab);
|
|
||||||
|
|
||||||
if (!($obj = $this->loadObject(true)))
|
if (!($obj = $this->loadObject(true)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->context->smarty->assign('tab_form', array(
|
$this->fields_value = array('alias' => $obj->getAliases());
|
||||||
'current' => self::$currentIndex,
|
|
||||||
'table' => $this->table,
|
|
||||||
'token' => $this->token,
|
|
||||||
'id' => $obj->id,
|
|
||||||
'alias' => Tools::getValue('alias', $obj->getAliases()),
|
|
||||||
'search' => $this->getFieldValue($obj, 'search')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function initContent()
|
|
||||||
{
|
|
||||||
if ($this->display != 'edit')
|
if ($this->display != 'edit')
|
||||||
$this->display = 'list';
|
$this->display = 'list';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user