diff --git a/admin-dev/tabs/AdminTabs.php b/admin-dev/tabs/AdminTabs.php deleted file mode 100644 index ff2079abd..000000000 --- a/admin-dev/tabs/AdminTabs.php +++ /dev/null @@ -1,180 +0,0 @@ - -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 6844 $ -* @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() - { - $this->context = Context::getContext(); - $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)$this->context->language->id.' LIMIT 1) AS parent'; - - $this->fieldImageSettings = array('name' => 'icon', 'dir' => 't'); - $this->imageType = 'gif'; - - $tabs = array(0 => $this->l('Home')); - foreach (Tab::getTabs($this->context->language->id, 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() - { - /* PrestaShop demo mode */ - if (_PS_MODE_DEMO_) - { - $this->_errors[] = Tools::displayError('This functionnality has been disabled.'); - return; - } - /* PrestaShop demo mode*/ - - if (($id_tab = (int)(Tools::getValue('id_tab'))) AND ($direction = Tools::getValue('move')) AND Validate::isLoadedObject($tab = new Tab($id_tab))) - { - if ($tab->move($direction)) - Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); - } - else - { - if (!Tools::getValue('position')) - $_POST['position'] = Tab::getNbTabs(Tools::getValue('id_parent')); - parent::postProcess(); - } - } - - private function _posTabs($name, $arrayTabs) - { - if (sizeof($arrayTabs) > 1) - { - echo ' - - '; - for ($i = 0; $i < sizeof($arrayTabs); $i++) - { - $tab = $arrayTabs[$i]; - echo ''; - } - echo ' - -
'.stripslashes($tab['name']).'
'; - if ($i) - echo ' '; - if ($i < sizeof($arrayTabs) - 1) - echo '
'; - } - } - - public function displayList() - { - $this->context = Context::getContext(); - parent::displayList(); - - $tabs = Tab::getTabs($this->context->language->id, 0); - echo '

'.$this->l('Positions').'

-

'.$this->l('Level').' 1

'; - $this->_posTabs($this->l('Main'), $tabs); - echo '

'.$this->l('Level').' 2

'; - foreach ($tabs AS $t) - $this->_posTabs(stripslashes($t['name']), Tab::getTabs($this->context->language->id, $t['id_tab'])); - } - - public function displayForm($isMainTab = true) - { - parent::displayForm(); - - if (!($obj = $this->loadObject(true))) - return; - - echo ' -
- '.($obj->id ? '' : '').' - '.($obj->position ? '' : '').' -
'.$this->l('Tabs').' - -
'; - foreach ($this->_languages as $language) - echo ' -
- * - '.$this->l('Invalid characters:').' <>;=#{}  -
'; - $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name'); - echo ' -
-
 
- -
- * -
-
 
- -
- -
-
 
- -
- '.($obj->id ? ' /img/t/'.$obj->class_name.'.gif' : '').' -

-

'.$this->l('Upload logo from your computer').' (.gif, .jpg, .jpeg '.$this->l('or').' .png)

-
-
 
- -
- -
-
 
-
- -
-
* '.$this->l('Required field').'
-
-
'; - } - - public function afterImageUpload() - { - if (!($obj = $this->loadObject(true))) - return; - @rename(_PS_IMG_DIR_.'t/'.$obj->id.'.gif', _PS_IMG_DIR_.'t/'.$obj->class_name.'.gif'); - } -}