* @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->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')), '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 '
'.($obj->id ? '' : '').'
'.$this->l('Gender').'
'; foreach ($this->_languages as $language) echo '
* '.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%: 
'; $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name'); echo '
 
'; echo '
getFieldValue($obj, 'type') == 0 ? 'checked="checked" ' : '').'/> getFieldValue($obj, 'type') == 1 ? 'checked="checked" ' : '').'/>
'; echo '
'; echo ' '; if ($obj->getImage()) echo ''; echo '
'; echo '
* '.$this->l('Required field').'

'; } }