* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_PS_VERSION_')) exit; class Blockcustomerprivacy extends Module { public function __construct() { $this->name = 'blockcustomerprivacy'; if (version_compare(_PS_VERSION_, '1.4.0.0') >= 0) $this->tab = 'front_office_features'; else $this->tab = 'Blocks'; $this->version = '1.0'; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Customer data privacy block.'); $this->description = $this->l('Adds a block displaying a message about a customer\'s privacy data. '); } public function install() { $return = (parent::install() && $this->registerHook('createAccountForm') && $this->registerHook('header') && $this->registerHook('actionBeforeSubmitAccount')); Configuration::updateValue('CUSTPRIV_MESSAGE', array($this->context->language->id => $this->l('The personal data you provide is used to answer queries, process orders or allow access to specific information.').' '. $this->l('You have the right to modify and delete all the personal information found in the "My Account" page. ') )); return $return; } public function getContent() { $id_lang_default = (int)Configuration::get('PS_LANG_DEFAULT'); $languages = Language::getLanguages(false); $iso = $this->context->language->iso_code; $output = ''; if (Tools::isSubmit('submitCustPrivMess')) { $message_trads = array(); foreach ($_POST as $key => $value) if (preg_match('/custpriv_message_/i', $key)) { $id_lang = preg_split('/custpriv_message_/i', $key); $message_trads[(int)$id_lang[1]] = $value; } Configuration::updateValue('CUSTPRIV_MESSAGE', $message_trads, true); $this->_clearCache('blockcustomerprivacy.tpl'); $output = '