* @copyright 2007-2012 PrestaShop SA * @version Release: $Revision: 6844 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_CAN_LOAD_FILES_')) exit; class Blockcontact extends Module { public function __construct() { $this->name = 'blockcontact'; $this->tab = 'front_office_features'; $this->version = '1.0'; parent::__construct(); $this->displayName = $this->l('Block contact'); $this->description = $this->l('Allows you to add extra information about customer service'); } public function install() { return parent::install() && Configuration::updateValue('blockcontact_telnumber', '') && Configuration::updateValue('blockcontact_email', '') && $this->registerHook('displayRightColumn') && $this->registerHook('displayHeader'); } public function uninstall() { // Delete configuration return Configuration::deleteByName('blockcontact_telnumber') && Configuration::deleteByName('blockcontact_email') && parent::uninstall(); } public function getContent() { $html = ''; // If we try to update the settings if (Tools::isSubmit('submitModule')) { Configuration::updateValue('blockcontact_telnumber', Tools::getValue('telnumber')); Configuration::updateValue('blockcontact_email', Tools::getValue('email')); $html .= '
'.$this->l('Configuration updated').'
'; } $html .= '

'.$this->displayName.'

 
 
'; return $html; } public function hookDisplayHeader() { $this->context->controller->addCSS(($this->_path).'blockcontact.css', 'all'); } public function hookDisplayRightColumn() { global $smarty; $smarty->assign(array( 'telnumber' => Configuration::get('blockcontact_telnumber'), 'email' => Configuration::get('blockcontact_email') )); return $this->display(__FILE__, 'blockcontact.tpl'); } public function hookDisplayLeftColumn() { return $this->hookDisplayRightColumn(); } } ?>