* @copyright 2007-2011 PrestaShop SA * @version Release: $Revision$ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class AdminGenders extends AdminTab { public function __construct() { $this->table = 'gender'; $this->className = 'Gender'; $this->lang = true; $this->edit = true; $this->delete = true; $this->defaultImageHeight = 16; $this->defaultImageWidth = 16; $this->fieldImageSettings = array('name' => 'image', 'dir' => 'genders'); $this->fieldsDisplay = array( 'id_gender' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 150, 'filter_key' => 'b!name'), 'type' => array( 'title' => $this->l('Type'), 'width' => 100, 'orderby' => false, 'type' => 'select', 'select' => array(0 => $this->l('Male'), 1 => $this->l('Female'), 2 => $this->l('Neutral')), 'filter_key' => 'a!type', 'callback' => 'displayGenderType', 'callback_object' => $this, ), 'image' => array('title' => $this->l('Image'), 'align' => 'center', 'image' => 'genders', 'orderby' => false, 'search' => false), ); parent::__construct(); } public function displayGenderType($value, $tr) { return $this->fieldsDisplay['type']['select'][$value]; } public function displayForm($isMainTab = true) { parent::displayForm(); if (!($obj = $this->loadObject(true))) return; echo '