* @copyright PrestaShop * @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0 * @version 1.3 * */ include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminCountries extends AdminTab { public function __construct() { global $cookie; $this->table = 'country'; $this->className = 'Country'; $this->lang = true; $this->edit = true; $this->deleted = false; $this->_select = 'z.`name` AS zone'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; $this->fieldsDisplay = array( 'id_country' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Country'), 'width' => 130, 'filter_key' => 'b!name'), 'iso_code' => array('title' => $this->l('ISO code'), 'width' => 70, 'align' => 'center'), 'zone' => array('title' => $this->l('Zone'), 'width' => 100, 'filter_key' => 'z!name'), 'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active')); $this->optionTitle = $this->l('Countries options'); $this->_fieldsOptions = array( 'PS_COUNTRY_DEFAULT' => array('title' => $this->l('Default country:'), 'desc' => $this->l('The default country used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_country', 'list' => Country::getCountries(intval($cookie->id_lang))), ); parent::__construct(); } public function postProcess() { if (isset($_GET['delete'.$this->table]) OR Tools::getValue('submitDel'.$this->table)) $this->_errors[] = Tools::displayError('You cannot delete a country. If you do not want it available for customers, please disable it.'); else return parent::postProcess(); } public function displayForm($isMainTab = true) { global $currentIndex; parent::displayForm(); $obj = $this->loadObject(true); echo '
'; } } ?>