* @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 */ include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminCMS extends AdminTab { private $_category; public function __construct() { $this->table = 'cms'; $this->className = 'CMS'; $this->lang = true; $this->edit = true; $this->view = true; $this->delete = true; $this->fieldsDisplay = array( 'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'link_rewrite' => array('title' => $this->l('URL'), 'width' => 200), 'meta_title' => array('title' => $this->l('Title'), 'width' => 300), 'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) ); $this->_category = AdminCMSContent::getCurrentCMSCategory(); $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)'; $this->_select = 'a.position '; $this->_filter = 'AND c.id_cms_category = '.(int)($this->_category->id); parent::__construct(); } private function _displayDraftWarning($active) { return '
'; } public function displayForm($isMainTab = true) { global $currentIndex, $cookie; parent::displayForm(); $obj = $this->loadObject(true); $iso = Language::getIsoById((int)($cookie->id_lang)); $divLangName = 'meta_title¤meta_description¤meta_keywords¤ccontent¤link_rewrite'; echo ' '; // TinyMCE global $cookie; $iso = Language::getIsoById((int)($cookie->id_lang)); $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); $ad = dirname($_SERVER["PHP_SELF"]); echo ' '; } public function display($token = NULL) { global $currentIndex, $cookie; if (($id_cms_category = (int)Tools::getValue('id_cms_category'))) $currentIndex .= '&id_cms_category='.$id_cms_category; $this->getList((int)($cookie->id_lang), !$cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$cookie->__get($this->table.'Orderway') ? 'ASC' : NULL); //$this->getList((int)($cookie->id_lang)); if (!$id_cms_category) $id_cms_category = 1; echo '