* @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 6594 $ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class AdminTabs extends AdminTab { public function __construct() { global $cookie; $this->table = 'tab'; $this->className = 'Tab'; $this->lang = true; $this->edit = true; $this->delete = true; $this->_select = '(SELECT stl.`name` FROM `'._DB_PREFIX_.'tab_lang` stl WHERE stl.`id_tab` = a.`id_parent` AND stl.`id_lang` = '.(int)($cookie->id_lang).' LIMIT 1) AS parent'; $this->fieldImageSettings = array('name' => 'icon', 'dir' => 't'); $this->imageType = 'gif'; $tabs = array(0 => $this->l('Home')); foreach (Tab::getTabs((int)$cookie->id_lang, 0) AS $tab) $tabs[$tab['id_tab']] = $tab['name']; $this->fieldsDisplay = array( 'id_tab' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 200), 'logo' => array('title' => $this->l('Icon'), 'align' => 'center', 'image' => 't', 'image_id' => 'class_name', 'orderby' => false, 'search' => false), 'parent' => array('title' => $this->l('Parent'), 'width' => 200, 'type' => 'select', 'select' => $tabs, 'filter_key' => 'a!id_parent'), 'module' => array('title' => $this->l('Module'))); parent::__construct(); } public function postProcess() { if (($id_tab = (int)(Tools::getValue('id_tab'))) AND ($direction = Tools::getValue('move')) AND Validate::isLoadedObject($tab = new Tab($id_tab))) { global $currentIndex; if ($tab->move($direction)) Tools::redirectAdmin($currentIndex.'&token='.$this->token); } else { if (!Tools::getValue('position')) $_POST['position'] = Tab::getNbTabs(Tools::getValue('id_parent')); parent::postProcess(); } } private function _posTabs($name, $arrayTabs) { global $currentIndex; if (sizeof($arrayTabs) > 1) { echo '
'.stripslashes($tab['name']).' '; if ($i) echo ' '; if ($i < sizeof($arrayTabs) - 1) echo ' | ';
}
echo '
---|