[+] Add a route system to personalize rewrited URL

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7876 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-03 16:02:49 +00:00
parent 3e298ba94f
commit 6f08bcb12e
7 changed files with 343 additions and 187 deletions
+24 -9
View File
@@ -149,6 +149,9 @@ abstract class AdminTabCore
/** @var bool Redirect or not ater a creation */
protected $_redirect = true;
/** @var bool If false, don't add form tags in options forms */
protected $formOptions = true;
protected $_languages = NULL;
protected $_defaultFormLanguage = NULL;
@@ -1666,28 +1669,39 @@ abstract class AdminTabCore
/**
* Options lists
*
* @param array $fieldsOptions Since 1.5.0
* @param string $optionTitle Since 1.5.0
*/
public function displayOptionsList()
public function displayOptionsList($fieldsOptions = null, $optionTitle = null, $optionDescription = null)
{
if (!isset($this->_fieldsOptions) OR !sizeof($this->_fieldsOptions))
if (is_null($fieldsOptions))
$fieldsOptions = $this->_fieldsOptions;
if (is_null($optionTitle))
$optionTitle = $this->optionTitle;
if (!isset($fieldsOptions) OR !sizeof($fieldsOptions))
return false;
$defaultLanguage = (int)$this->context->language->id;
$this->_languages = Language::getLanguages(false);
$tab = Tab::getTab($defaultLanguage, $this->id);
echo '<br /><br />';
echo (isset($this->optionTitle) ? '<h2>'.$this->optionTitle.'</h2>' : '');
echo (isset($optionTitle) ? '<h2>'.$optionTitle.'</h2>' : '');
echo '
<script type="text/javascript">
id_language = Number('.$defaultLanguage.');
</script>
<form action="'.self::$currentIndex.'" id="'.$tab['name'].'" name="'.$tab['name'].'" method="post">
'.(($this->formOptions) ? '<form action="'.self::$currentIndex.'" id="'.$tab['name'].'" name="'.$tab['name'].'" method="post">' : '').'
<fieldset>';
echo (isset($this->optionTitle) ? '<legend>
echo (isset($optionTitle) ? '<legend>
<img src="'.(!empty($tab['module']) && file_exists($_SERVER['DOCUMENT_ROOT']._MODULE_DIR_.$tab['module'].'/'.$tab['class_name'].'.gif') ? _MODULE_DIR_.$tab['module'].'/' : '../img/t/').$tab['class_name'].'.gif" />'
.$this->optionTitle.'</legend>' : '');
.$optionTitle.'</legend>' : '');
if ($optionDescription)
echo '<p class="optionsDescription">'.$optionDescription.'</p>';
foreach ($this->_fieldsOptions AS $key => $field)
foreach ($fieldsOptions AS $key => $field)
{
$val = Tools::getValue($key, Configuration::get($key));
if ($field['type'] != 'textLang')
@@ -1767,8 +1781,9 @@ abstract class AdminTabCore
<input type="submit" value="'.$this->l(' Save ').'" name="submitOptions'.$this->table.'" class="button" />
</div>
</fieldset>
<input type="hidden" name="token" value="'.$this->token.'" />
</form>';
<input type="hidden" name="token" value="'.$this->token.'" />';
if ($this->formOptions)
echo '</form>';
}
/**