* @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 AdminContacts extends AdminTab { public function __construct() { $this->table = 'contact'; $this->className = 'Contact'; $this->lang = true; $this->edit = true; $this->delete = true; $this->fieldsDisplay = array( 'id_contact' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Title'), 'width' => 130), 'email' => array('title' => $this->l('E-mail address'), 'width' => 130), 'description' => array('title' => $this->l('Description'), 'width' => 150)); $this->optionTitle = $this->l('Contact options'); $this->_fieldsOptions = array( 'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array('title' => $this->l('Allow file upload'), 'desc' => $this->l('Allow customers to upload file using contact page'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array( '0' => array('value' => 0, 'name' => $this->l('No')), '1' => array('value' => 1, 'name' => $this->l('Yes')) )), 'PS_CUSTOMER_SERVICE_SIGNATURE' => array('title' => $this->l('Pre-defined message'), 'desc' => $this->l('Please fill the message that appears by default when you answer a thread on the customer service page'), 'cast' => 'pSQL', 'type' => 'textareaLang', 'identifier' => 'value', 'cols' => 40, 'rows' => 8 )); parent::__construct(); } public function displayForm($isMainTab = true) { global $currentIndex; parent::displayForm(); if (!($obj = $this->loadObject(true))) return; echo '
'.($obj->id ? '' : '').'
'.$this->l('Contacts').'
'; foreach ($this->_languages as $language) echo '
*
'; $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤description', 'name'); echo '

'.$this->l('Contact name, e.g., Technical Support').'

'.$this->l('E-mails will be sent to this address').'

getFieldValue($obj, 'customer_service') ? 'checked="checked" ' : '').'/> getFieldValue($obj, 'customer_service') ? 'checked="checked" ' : '').'/>

'.$this->l('The messages will be saved in the Customer Service tab').'

 
'; foreach ($this->_languages as $language) echo '
'; $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤description', 'description'); echo '

'.$this->l('Additional information about this contact').'

* '.$this->l('Required field').'
'; } }