* @copyright 2013-2014 Antadis * @version 1.0 */ if (!defined('_PS_VERSION_')) exit; class CookiesInfos extends Module { public function __construct() { $this->name = 'cookiesinfos'; $this->tab = 'font_office_featues'; $this->version = '1.0'; $this->author = 'Antadis'; parent::__construct(); $this->displayName = $this->l('Cookies Informatiosn'); $this->description = $this->l('Display a cookies informations top bar with link to redirect where you want'); if (!Configuration::get('COOKIESINFO_LINK') || !Configuration::get('COOKIESINFO_INTRO')) $this->warning = $this->l('Wrong settings'); } public function install() { if(!parent::install() || !$this->registerHook('header') || !$this->registerHook('footer') || !Configuration::updateValue('COOKIESINFO_LINK', '') || !Configuration::updateValue('COOKIESINFO_INTRO', '')) return false; return true; } public function uninstall() { if (!parent::uninstall() || !Configuration::updateValue('COOKIESINFO_LINK', '') || !Configuration::updateValue('COOKIESINFO_INTRO', '')) return false; return true; } public function getContent() { global $cookie; /* Language */ $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $languages = Language::getLanguages(FALSE); $divLangName = 'link¤intro'; if (Tools::isSubmit('submitConfig')) { foreach ($languages as $language) { Configuration::updateValue('COOKIESINFO_LINK'.'_'.$language['id_lang'], Tools::getValue('link'.'_'.$language['id_lang'])); Configuration::updateValue('COOKIESINFO_INTRO'.'_'.$language['id_lang'], Tools::getValue('intro'.'_'.$language['id_lang'])); } echo '