* @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 6594 $ * @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 iAdvize extends Module { function __construct() { $this->name = 'iadvize'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->displayName = 'iAdvize'; $this->need_instance = 0; parent::__construct(); $this->description = $this->l('Offer an interactive live chat to your customers'); } function install() { if (!parent::install() OR !$this->registerHook('footer') OR !$this->registerHook('leftColumn') OR !$this->registerHook('rightColumn')) return false; return true; } function uninstall() { if (!Configuration::deleteByName('IADVIZE_SID') OR !Configuration::deleteByName('IADVIZE_BID') OR !parent::uninstall()) return false; return true; } public function getContent() { global $cookie; $lang = new Language((int)($cookie->id_lang)); if (!in_array($lang->iso_code, array('fr', 'en', 'es'))) $lang->iso_code = 'en'; $output = '

'; if (Tools::isSubmit('submitiAdvize')) { Configuration::updateValue('IADVIZE_SID', (int)(Tools::getValue('iadvize_sid'))); Configuration::updateValue('IADVIZE_BID', (int)(Tools::getValue('iadvize_bid'))); Configuration::updateValue('IADVIZE_BUTTON', (int)(Tools::getValue('iadvize_button'))); $output .= '
'.$this->l('Settings updated').'
'; } $output .= '

'.$this->l('iAdvize is an interactive live chat').' '.$this->l('allowing you to respond directly to your visitors and direct them towards the product that meets their needs.').'
'.$this->l('For more information, click here').'

'.$this->l('Settings').'
*

'.$this->l('Leave empty if you do not want to enable this feature.').'

'.$this->l('No call button').'  '.$this->l('Left column').'  '.$this->l('Right column').'

* '.$this->l('Required fields').'

'.(file_exists(dirname(__FILE__).'/offer-'.$lang->iso_code.'.jpg') ? '

' : '').'
'; return $output; } private function _displayCallButton() { return "\n".'
'."\n"; } public function hookLeftColumn($params) { if (Configuration::get('IADVIZE_BUTTON') == 1) return $this->_displayCallButton(); } public function hookRightColumn($params) { if (Configuration::get('IADVIZE_BUTTON') == 2) return $this->_displayCallButton(); } public function hookFooter($params) { return "\n".' '."\n"; } }