* @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 LiveZilla extends Module { public function __construct() { $this->name = 'livezilla'; $this->tab = 'front_office_features'; $this->version = 1.0; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); $this->displayName = 'LiveZilla'; $this->description = $this->l('Live support chat'); } public function install() { if (!Configuration::get('LIVEZILLA_URL')) Configuration::updateValue('LIVEZILLA_URL', Tools::htmlentitiesUTF8($_SERVER['HTTP_HOST']).'/LiveZilla/'); return (parent::install() AND $this->registerHook('rightColumn')); } public function getContent() { if (Tools::isSubmit('submitLiveZilla')) { Configuration::updateValue('LIVEZILLA_URL', Tools::getValue('LIVEZILLA_URL_TYPE').Tools::getValue('LIVEZILLA_URL')); Configuration::updateValue('LIVEZILLA_SCRIPT', Tools::getValue('LIVEZILLA_SCRIPT'), true); echo $this->displayConfirmation($this->l('Settings updated')); } $html = '

'.$this->displayName.'

'.$this->l('How-to').' '.$this->l('LiveZilla is not a hosted solution, which means that LiveZilla needs to be installed on your local computer (step 1) and on your webserver (step 2) as well.').' '.$this->l('The LiveZilla installation on your webserver is called the LiveZilla Server.').'

'.$this->l('Once you have finished step 1 & 2, you must fill in the URL of your LiveZilla installation below or directly copy / paste the script in the text area. This will integrate LiveZilla with your website (step 3).').'

'.$this->l('The full installation guide is available on').' '.$this->l('the official LiveZilla website').'.

'.$this->l('Download LiveZilla now!').'
 
'.$this->l('Configuration').'

'.$this->l('Absolute URL with the trailing slash, e.g.,').' '.Tools::getProtocol().Tools::htmlentitiesUTF8($_SERVER['HTTP_HOST']).'/LiveZilla/

 
'.$this->l('-- OR --').'
 
 
'; return $html; } private function displayBlock() { global $smarty; if ($livezilla_script = Configuration::get('LIVEZILLA_SCRIPT')) $smarty->assign('LIVEZILLA_SCRIPT', $livezilla_script); elseif ($livezilla_url = Configuration::get('LIVEZILLA_URL')) $smarty->assign('LIVEZILLA_URL', $livezilla_url); else $smarty->assign('LIVEZILLA_UNDEFINED', 1); return $this->display(__FILE__, 'livezilla.tpl'); } public function hookLeftColumn($params) { return $this->displayBlock(); } public function hookRightColumn($params) { return $this->displayBlock(); } }