Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
include('../../config/config.inc.php');
if (!defined('_PS_VERSION_')) {
exit;
}
$tokenCheckage = Tools::getValue('token');
if (Tools::getToken(false) != $tokenCheckage) {
die('No Valid Token');
}
if (Tools::getValue('checkOK') && Tools::getValue('day') && Tools::getValue('month') && Tools::getValue('year')) {
if (Validate::isInt(Tools::getValue('day')) || (Validate::isInt(Tools::getValue('month'))) || (Validate::isInt(Tools::getValue('year')))) {
$context = Context::getContext();
$id_shop = (int)$context->shop->id;
$sql = 'SELECT `age_restriction` FROM `'._DB_PREFIX_.'checkage` WHERE `id_shop` ="'.(int)$id_shop.'"';
$minAge = Db::getInstance()->getValue($sql);
$instantMonth = date('n');
$instantDay = date('j');
$instantYear = date('Y');
$monthSubmit = (int)Tools::getValue('month');
$daySubmit = (int)Tools::getValue('day');
$yearSubmit = (int)Tools::getValue('year');
$ok = '';
$yearControl = $instantYear-$yearSubmit;
if ($yearControl>$minAge) {
$ok = '1';
} elseif ($yearControl==$minAge and $monthSubmit<$instantMonth) {
$ok = '1';
} elseif ($yearControl==$minAge and $monthSubmit==$instantMonth and $daySubmit<=$instantDay) {
$ok = '1';
}
if (Tools::getValue("checkOK") == '1' && $ok == '1') {
$context->cookie->checkOK = '1';
} else {
$context->cookie->checkOK = '0';
}
}
}

View File

@@ -0,0 +1,476 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class Checkage extends Module
{
protected $html = '';
public function __construct()
{
$this->name = 'checkage';
$this->tab = 'front_office_features';
$this->version = '1.2.0';
$this->author = 'Bondaty and Co';
$this->module_key = '09df8563ef7512d79032862d2c9bc346';
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->l('Checking age for access to the shop');
$this->description = $this->l('Checking age for full shop access or certain categories only.');
$this->ps_versions_compliancy = array('min' => '1.7.0.0', 'max' => _PS_VERSION_);
include_once dirname(__FILE__).'/classes/CheckageClass.php';
$this->bootstrap = true;
}
public function check()
{
$checkOK = $this->context->cookie->checkOK;
if ($checkOK) {
return '1';
} else {
return '0';
}
}
public function install()
{
return parent::install() &&
$this->registerHook('displayHeader') &&
$this->registerHook('displayTop') &&
$this->installDB();
}
public function installDB()
{
$res = Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'checkage` (
`id_checkage` int(10) unsigned NOT NULL auto_increment,
`id_shop` int(10) unsigned NOT NULL,
`id_restriction` text NOT NULL,
`age_restriction` varchar(3) NOT NULL,
`format_date` int(10) NOT NULL,
`show_logo` int(10) NOT NULL,
`all_restriction` int(10) NOT NULL,
`best_sales` int(10) NOT NULL,
`new_products` int(10) NOT NULL,
`discount` int(10) NOT NULL,
`manufacturer` int(10) NOT NULL,
`supplier` int(10) NOT NULL,
`cms` int(10) NOT NULL,
PRIMARY KEY (`id_checkage`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8');
if ($res) {
$res &= Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'checkage_lang` (
`id_checkage` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`checkage_message` text NOT NULL,
PRIMARY KEY (`id_checkage`, `id_lang`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8');
}
if ($res) {
foreach (Shop::getShops(false) as $shop) {
$res &= $this->createExampleCheckage($shop['id_shop']);
}
}
if (!$res) {
$res &= $this->uninstall();
}
return $res;
}
private function createExampleCheckage($id_shop)
{
$checkage = new CheckageClass();
$checkage->id_shop = (int)$id_shop;
$checkage->id_restriction = '';
$checkage->age_restriction = '18';
$checkage->format_date = '1';
$checkage->show_logo = '1';
$checkage->all_restriction = '1';
$checkage->best_sales = '0';
$checkage->new_products = '0';
$checkage->discount = '0';
$checkage->manufacturer = '0';
$checkage->supplier = '0';
$checkage->cms = '0';
foreach (Language::getLanguages(false) as $lang) {
$checkage->checkage_message[$lang['id_lang']] = '<p>Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore...</p>';
}
return $checkage->add();
}
public function uninstall()
{
$res = Db::getInstance()->execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'checkage`');
$res &= Db::getInstance()->execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'checkage_lang`');
if (!$res || !parent::uninstall()) {
return false;
}
return true;
}
public function initForm()
{
$languages = Language::getLanguages(false);
foreach ($languages as $k => $language) {
$languages[$k]['is_default'] = (int)($language['id_lang'] == Configuration::get('PS_LANG_DEFAULT'));
}
$id_shop = (int)$this->context->shop->id;
$sql = 'SELECT `id_restriction` FROM `'._DB_PREFIX_.'checkage` WHERE `id_shop` ="'.(int)$id_shop.'"';
$id_restriction = Db::getInstance()->getValue($sql);
$rootCategory_id = (Shop::getContext() == Shop::CONTEXT_SHOP ? Category::getRootCategory()->id_category : 0);
$id_rcategories = new HelperTreeCategories('id_restriction');
$id_rcategories->setRootCategory($rootCategory_id)->setUseCheckBox(true)->setInputName('rcategories')->setSelectedCategories(explode('-', $id_restriction));
$helper = new HelperForm();
$helper->module = $this;
$helper->name_controller = 'checkage';
$helper->identifier = $this->identifier;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->languages = $languages;
$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
$helper->default_form_language = (int)Configuration::get('PS_LANG_DEFAULT');
$helper->allow_employee_form_lang = true;
$helper->toolbar_scroll = true;
$helper->toolbar_btn = $this->initToolbar();
$helper->title = $this->displayName;
$helper->submit_action = 'submitUpdateCheckage';
$this->fields_form[0]['form'] = array(
'tinymce' => true,
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'submit'=> array(
'name' => 'submitUpdateCheckage',
'title' => $this->l('Save'),
),
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Age'),
'name' => 'age_restriction',
'class' => 'fixed-width-sm',
'desc' => $this->l('Minimum age'),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Show the logo of the shop'),
'name' => 'show_logo',
'desc' => $this->l('Yes = Show logo / No = Disable logo'),
'values' => array(
array(
'id' => 'show_logo_on',
'value' => 1,
),
array(
'id' => 'show_logo_off',
'value' => 0,
),
),
),
array(
'type' => 'textarea',
'label' => $this->l('Additional message'),
'name' => 'checkage_message',
'lang' => true,
'autoload_rte' => true,
'desc' => $this->l('Appears on top of the form under the logo of the shop'),
),
array(
'type' => 'radio',
'is_bool' => true,
'label' => $this->l('Date format'),
'name' => 'format_date',
'desc' => $this->l('Choice the date format to display'),
'values' => array(
array(
'id' => 'format_date',
'label' => $this->l('DD-MM-YYYY'),
'value' => 1,
),
array(
'id' => 'format_date',
'label' => $this->l('MM-DD-YYYY'),
'value' => 2,
),
array(
'id' => 'format_date',
'label' => $this->l('YYYY-MM-DD'),
'value' => 3,
),
),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Checking the age on the whole shop'),
'name' => 'all_restriction',
'desc' => $this->l('Yes = Checking the age on the whole shop (You do not need to select a category or page) / No = Select a category or page for checking'),
'values' => array(
array(
'id' => 'all_restriction_on',
'value' => 1,
),
array(
'id' => 'all_restriction_off',
'value' => 0,
),
),
),
array(
'type' => 'categories_select',
'label' => $this->l('Select a category'),
'name' => 'id_restriction',
'category_tree' => $id_rcategories->render(),
'desc' => $this->l('For verification only on certain categories check the desired categories, otherwise uncheck all categories for a check on the whole store'),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Checking the age on the best sales'),
'name' => 'best_sales',
'desc' => $this->l('Yes = Checking the age on the best sales / No = No checking'),
'values' => array(
array(
'id' => 'best_sales_on',
'value' => 1,
),
array(
'id' => 'best_sales_off',
'value' => 0,
),
),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Checking the age on the new products'),
'name' => 'new_products',
'desc' => $this->l('Yes = Checking the age on the new products / No = No checking'),
'values' => array(
array(
'id' => 'new_products_on',
'value' => 1,
),
array(
'id' => 'new_products_off',
'value' => 0,
),
),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Checking the age on the prices drop'),
'name' => 'discount',
'desc' => $this->l('Yes = Checking the age on the prices drop / No = No checking'),
'values' => array(
array(
'id' => 'discount_on',
'value' => 1,
),
array(
'id' => 'discount_off',
'value' => 0,
),
),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Checking the age on the manufacturer'),
'name' => 'manufacturer',
'desc' => $this->l('Yes = Checking the age on the manufacturer / No = No checking'),
'values' => array(
array(
'id' => 'manufacturer_on',
'value' => 1,
),
array(
'id' => 'manufacturer_off',
'value' => 0,
),
),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Checking the age on the supplier'),
'name' => 'supplier',
'desc' => $this->l('Yes = Checking the age on the supplier / No = No checking'),
'values' => array(
array(
'id' => 'supplier_on',
'value' => 1,
),
array(
'id' => 'supplier_off',
'value' => 0,
),
),
),
array(
'type' => 'switch',
'is_bool' => true,
'label' => $this->l('Checking the age on the cms pages'),
'name' => 'cms',
'desc' => $this->l('Yes = Checking the age on the cms pages / No = No checking'),
'values' => array(
array(
'id' => 'cms_on',
'value' => 1,
),
array(
'id' => 'cms_off',
'value' => 0,
),
),
),
),
);
return $helper;
}
private function initToolbar()
{
$this->toolbar_btn['save'] = array(
'href' => '#',
'desc' => $this->l('Save')
);
return $this->toolbar_btn;
}
public function getContent()
{
$this->html = '';
$this->context->controller->addjQueryPlugin('hoverIntent');
$this->context->controller->addJS($this->_path.'views/js/admin-app.js');
$this->postProcess();
$helper = $this->initForm();
$id_shop = (int)$this->context->shop->id;
$checkage = CheckageClass::getByIdShop((int)$id_shop);
if (!$checkage) {
$this->createExampleCheckage((int)$id_shop);
}
foreach ($this->fields_form[0]['form']['input'] as $input) {
$helper->fields_value[$input['name']] = $checkage->{$input['name']};
}
if ($checkage->all_restriction == '1') {
$this->html .= $this->allRestriction();
} else {
$this->html .= $this->selectRestriction();
}
$this->html .= $helper->generateForm($this->fields_form);
return $this->html;
}
public function postProcess()
{
$errors = array();
if (Tools::isSubmit('submitUpdateCheckage')) {
if (!Validate::isInt(Tools::getValue('age_restriction')) || (Tools::getValue('age_restriction') <= 0)) {
$errors[] = $this->l('Invalid minimum age.');
$this->html .= $this->displayError($errors);
} else {
$id_shop = (int)$this->context->shop->id;
$checkage = CheckageClass::getByIdShop((int)$id_shop);
$rcategories = Tools::getValue('rcategories', array());
$id_restriction = implode('-', $rcategories);
$checkage->copyFromPost();
$checkage->update();
$sql = 'UPDATE `'._DB_PREFIX_.'checkage` SET `id_restriction` = "'.(int)$id_restriction.'" WHERE `id_shop` = "'.(int)$id_shop.'"';
Db::getInstance()->execute($sql);
$this->html .= $this->displayConfirmation($this->l('Settings updated successfully.'));
}
}
}
public function allRestriction()
{
$tpl = $this->context->smarty->createTemplate(dirname(__FILE__).'/views/templates/admin/all-restriction.tpl');
return $tpl->fetch();
}
public function selectRestriction()
{
$tpl = $this->context->smarty->createTemplate(dirname(__FILE__).'/views/templates/admin/select-restriction.tpl');
return $tpl->fetch();
}
public function getPages()
{
$id_shop = (int)$this->context->shop->id;
$checkage = CheckageClass::getByIdShop((int)$id_shop);
$checkage = new CheckageClass((int)$checkage->id, (int)$this->context->language->id);
$page_name = Dispatcher::getInstance()->getController();
$page_restriction = '1';
if ($page_name == 'pricesdrop' && $checkage->discount == '1') {
return $page_restriction;
} elseif ($page_name == 'newproducts' && $checkage->new_products == '1') {
return $page_restriction;
} elseif ($page_name == 'bestsales' && $checkage->best_sales == '1') {
return $page_restriction;
} elseif ($page_name == 'manufacturer' && $checkage->manufacturer == '1') {
return $page_restriction;
} elseif ($page_name == 'supplier' && $checkage->supplier == '1') {
return $page_restriction;
} elseif ($page_name == 'cms' && $checkage->cms == '1') {
return $page_restriction;
}
}
public function getRestrictions()
{
$id_shop = (int)$this->context->shop->id;
$id_category = (int)Tools::getValue('id_category');
$id_product = (int)Tools::getValue('id_product');
$product = new Product((int)$id_product);
$show_restriction = '1';
$sql = 'SELECT `id_restriction` FROM `'._DB_PREFIX_.'checkage` WHERE `id_shop` ="'.(int)$id_shop.'"';
$ids_restrictions = Db::getInstance()->getValue($sql);
$id_restriction = explode('-', $ids_restrictions);
foreach ($id_restriction as $id_restriction) {
$restriction = $id_restriction;
if ($restriction && ($restriction == $id_category or $restriction == $product->id_category_default)) {
return $show_restriction;
}
}
}
public function hookdisplayTop($params)
{
$id_shop = (int)$this->context->shop->id;
$checkage = CheckageClass::getByIdShop((int)$id_shop);
$checkage = new CheckageClass((int)$checkage->id, (int)$this->context->language->id);
$id_restriction = $this->getRestrictions();
$page_restriction = $this->getPages();
$checkOK = $this->check();
if (Tools::usingSecureMode()) {
$urlbase = Tools::getShopDomainSsl(true);
} else {
$urlbase = Tools::getShopDomain(true);
}
$this->smarty->assign(array(
'checkage' => $checkage,
'id_restriction' => (int)$id_restriction,
'page_restriction' => (int)$page_restriction,
'checkOK' => (int)$checkOK,
'token' => Tools::getToken(false),
'url' => $urlbase.__PS_BASE_URI__,
'urlmodule' => $this->_path,
'default_lang' => (int)$this->context->language->id,
'id_lang' => (int)$this->context->language->id,
));
return $this->display(__FILE__, 'checkage.tpl');
}
public function hookdisplayHeader($params)
{
$this->context->controller->registerStylesheet('modules-checkage', 'modules/'.$this->name.'/views/css/checkage.css', ['media' => 'all', 'priority' => 150]);
}
}

View File

@@ -0,0 +1,76 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
class CheckageClass extends ObjectModel
{
public $id;
public $id_shop;
public $id_restriction;
public $is_tab;
public $ids_restrictions;
public $hook;
public $categories_ids;
public $age_restriction;
public $format_date;
public $show_logo;
public $all_restriction;
public $best_sales;
public $new_products;
public $discount;
public $manufacturer;
public $supplier;
public $cms;
public $checkage_message;
public static $definition = array(
'table' => 'checkage',
'primary' => 'id_checkage',
'multilang' => true,
'fields' => array(
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt', 'required' => true),
'id_restriction' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'age_restriction' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'format_date' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'show_logo' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'all_restriction' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'best_sales' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'new_products' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'discount' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'supplier' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'cms' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'checkage_message' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'),
)
);
public static function getByIdShop($id_shop)
{
$sql = 'SELECT `id_checkage` FROM `'._DB_PREFIX_.'checkage` WHERE `id_shop` ='.(int)$id_shop.'';
$id = Db::getInstance()->getValue($sql);
return new CheckageClass($id);
}
public function copyFromPost()
{
foreach ($_POST as $key => $value) {
if (key_exists($key, $this) && $key != 'id_'.$this->table) {
$this->{$key} = Tools::getValue($key);
}
}
if (count($this->fieldsValidateLang)) {
$languages = Language::getLanguages(false);
foreach ($languages as $language) {
foreach ($this->fieldsValidateLang as $field => $validation) {
if (Tools::getIsset($field.'_'.(int)$language['id_lang'])) {
$this->{$field}[(int)$language['id_lang']] =
Tools::getValue($field.'_'.(int)$language['id_lang']);
}
}
}
}
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>checkage</name>
<displayName><![CDATA[V&eacute;rifier l&#039;&acirc;ge avant acc&egrave;s &agrave; la boutique]]></displayName>
<version><![CDATA[1.2.0]]></version>
<description><![CDATA[V&eacute;rifier l&#039;&acirc;ge avant &agrave; la boutique compl&egrave;te, certaines cat&eacute;gories ou pages]]></description>
<author><![CDATA[Bondaty and Co]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,46 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{checkage}prestashop>checkage_bbad627c0c52d976abe6c0c36654d8dc'] = 'Vérifier l\'âge avant accès à la boutique';
$_MODULE['<{checkage}prestashop>checkage_25ddabe3d56364108ad5381313665e17'] = 'Vérifier l\'âge avant à la boutique complète, certaines catégories ou pages';
$_MODULE['<{checkage}prestashop>checkage_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration';
$_MODULE['<{checkage}prestashop>checkage_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
$_MODULE['<{checkage}prestashop>checkage_9d8d2d5ab12b515182a505f54db7f538'] = 'Age';
$_MODULE['<{checkage}prestashop>checkage_cf64c08eba74dcf03b8d6e5f8f264056'] = 'Age minimum pour accéder';
$_MODULE['<{checkage}prestashop>checkage_473f8ec2d51f9c73d2d5d92fcbb64eba'] = 'Afficher le logo de la boutique';
$_MODULE['<{checkage}prestashop>checkage_e8ed3951a0871e7ebe5efcb5f47ad7ed'] = 'Oui = logo affiché / Non = logo désactivé';
$_MODULE['<{checkage}prestashop>checkage_46332728ab663d6ebf83b1cf4e1d2b29'] = 'Message additionnel';
$_MODULE['<{checkage}prestashop>checkage_c36892f4294ac55454c24f3276fe9816'] = 'Apparait au dessus du formulaire et sous le logo de la boutique';
$_MODULE['<{checkage}prestashop>checkage_534fd46732986cba0efeda8701592427'] = 'Format de la date';
$_MODULE['<{checkage}prestashop>checkage_2a8ba982886a46c5b7b2f319771ccaba'] = 'Choisissez le format d\'affichage de la date dans le formulaire';
$_MODULE['<{checkage}prestashop>checkage_1cfaeb54488d1766a7cf9c9909fa7214'] = 'JJ-MM-AAAA';
$_MODULE['<{checkage}prestashop>checkage_262f85cc9967ff615cfa8de8e2d125f8'] = 'MM-JJ-AAAA';
$_MODULE['<{checkage}prestashop>checkage_70e7a6fcceb39a1e3ea3925182b85d18'] = 'AAAA-MM-DD';
$_MODULE['<{checkage}prestashop>checkage_52db9becb0ab4d5b93f611c2f0005fbf'] = 'Controler l\'âge sur l\'ensemble de la boutique';
$_MODULE['<{checkage}prestashop>checkage_030048322f39a4583bba938fb4154095'] = 'Oui = L\'âge sera vérifié pour l\'ensemble de la boutique ( Vous n\'avez pas besoin de sélectionner de catégories ou pages) / Non = Sélectionnez les catégorie ou pages où vous souhaitez activer le contrôle.';
$_MODULE['<{checkage}prestashop>checkage_b02d8b2c78dfd6cc791eff6f283e5008'] = 'Sélectionner une catégorie';
$_MODULE['<{checkage}prestashop>checkage_96d42c18bef22e1b7706e88b6ff6c836'] = 'Pour activer le contrôle d\'âge sur certaines catégories';
$_MODULE['<{checkage}prestashop>checkage_1fa04ea04d76a079e10252cd10c38904'] = 'Contrôle d\'âge sur la page Meilleurs Ventes';
$_MODULE['<{checkage}prestashop>checkage_b20389a3c13cedf5a27734a692b32e04'] = 'Oui = contrôle de l\'âge / Non = Pas de contrôle';
$_MODULE['<{checkage}prestashop>checkage_bc2cf1516209a7f56413e64df19307dc'] = 'Contrôle d\'âge sur la page Nouveaux Produits';
$_MODULE['<{checkage}prestashop>checkage_21281db2e6c34810f141608d46a37ad5'] = 'Oui = contrôle de l\'âge / Non = Pas de contrôle';
$_MODULE['<{checkage}prestashop>checkage_8c5cd84ce1133c7133a4106d64ca966b'] = 'Contrôle d\'âge sur la page Promotions';
$_MODULE['<{checkage}prestashop>checkage_172a4e513dad5d0938ee5bcbf6475559'] = 'Oui = contrôle de l\'âge / Non = Pas de contrôle';
$_MODULE['<{checkage}prestashop>checkage_e2bc298997224ab2240cbee557462090'] = 'Contrôle d\'âge sur la page Marque';
$_MODULE['<{checkage}prestashop>checkage_12704aaf8c9beced0cdc5ec0b9f92438'] = 'Oui = contrôle de l\'âge / Non = Pas de contrôle';
$_MODULE['<{checkage}prestashop>checkage_203a09472556b304391ea39ea267c109'] = 'Contrôle d\'âge sur la page Fournisseur';
$_MODULE['<{checkage}prestashop>checkage_973c77bccb999a953e60ff4ac4b7c972'] = 'Oui = contrôle de l\'âge / Non = Pas de contrôle';
$_MODULE['<{checkage}prestashop>checkage_9c85ce658f2a0cdd6e55433cbeffbfe8'] = 'Contrôle d\'âge sur les pages CMS';
$_MODULE['<{checkage}prestashop>checkage_c510a95af079ef0b1dc6d75ef7914fd2'] = 'Oui = contrôle de l\'âge / Non = Pas de contrôle';
$_MODULE['<{checkage}prestashop>checkage_d8a95203e53afc7b57f37fe5884388a7'] = 'L\'âge minimum n\'est pas valide';
$_MODULE['<{checkage}prestashop>checkage_8dd2f915acf4ec98006d11c9a4b0945b'] = 'Configuration effectuée avec succès.';
$_MODULE['<{checkage}prestashop>all-restriction_9c309e11fe98a5b4e7b022555d39cf04'] = 'La vérification de l\'âge est activée sur toute la boutique';
$_MODULE['<{checkage}prestashop>select-restriction_850d41a49ef7dffc3d2d9c356e60159a'] = 'La vérification de l\'âge est uniquement activée le catégories et pages sélectionnées';
$_MODULE['<{checkage}prestashop>checkage_1b240e2ea333fc537f494084e39d0d77'] = 'L\'âge minimum pour continuer est de';
$_MODULE['<{checkage}prestashop>checkage_75aeb98e5241592ad6a6c2c4c78a16ef'] = 'ans';
$_MODULE['<{checkage}prestashop>checkage_1e16e099eed5b0eb94a7422a83e6d9b5'] = 'Merci d\'indiquer votre date de naissance';
$_MODULE['<{checkage}prestashop>checkage_350bfcb1e3cfb28ddff48ce525d4f139'] = 'JJ';
$_MODULE['<{checkage}prestashop>checkage_ad05f78187c942f9dd521605fa81f1ba'] = 'MM';
$_MODULE['<{checkage}prestashop>checkage_8df34bb962577b90d574a51ed2ca757f'] = 'AAAA';
$_MODULE['<{checkage}prestashop>checkage_07bd7fe01df5aa87734bff5cab05523b'] = 'ou Retourner à la page d\'accueil';

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,72 @@
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
#checkageContent{
padding:15px;
max-width:100%;
}
#checkageContent #checkageTable{
width:100%;
}
#checkageContent input.dic{
border: 3px solid #696969;
font-size:25px;
text-align:center;
margin:5px;
font-weight:bold;
}
#checkageContent button.dic2{
font-size:26px;
font-weight:bold;
text-transform:uppercase;
background-color:#696969;
padding:8px;
margin:5px;
background-image:none;
border:none;
color:#fff
}
#checkageContent button:focus{
background:#000;
color:#fff;
}
#checkageContent button:hover{
background-color:#000;
background-image:none;
color:#fff;
border:none;
}
.infoCheckage{
text-align:center;
font-size:16px;
font-weight:bold;
}
.day , .month, .year {
float:left;
}
.popupCheckage{
display:table;
margin: 0 auto;
}
.no{
display:none;
}
.modal.fade.in {
display: flex !important;
justify-content: center;
align-items: center;
}
.modal.fade.in .modal-dialog {
width: 100%;
}
.modal-backdrop.in {
opacity: 0.9;
}
@media screen and (max-width: 768px) {
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,33 @@
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
var app = {
_path: null,
};
app.form = {
initialize: function()
{
var fieldset_2 = $('#fieldset_2 .form-wrapper').children();
this.id_restricted = $(fieldset_2[1]);
this.render();
},
render: function()
{
this.id_restricted.hide();
},
};
app.list = {
initialize: function()
{
this.render();
},
render: function()
{
},
};

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,31 @@
{*
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*}
<!-- START Module Checkage -->
<style>
div .alertes{
background:#fff;
border-radius:10px;
padding:15px;
font-size:16px;
font-weight:bold;
}
.red{
text-transform:uppercase;
color:red;
font-size:20px;
}
.green{
text-transform:uppercase;
color:green;
font-size:20px;
}
</style>
<div class="alertes"><i class="icon-exclamation-triangle green"></i> {l s='The age check is active throughout the shop' mod='checkage'}</div>
<!-- END Module Checkage -->

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,31 @@
{*
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*}
<!-- START Module Checkage -->
<style>
div .alertes{
background:#fff;
border-radius:10px;
padding:15px;
font-size:16px;
font-weight:bold;
}
.red{
text-transform:uppercase;
color:red;
font-size:20px;
}
.green{
text-transform:uppercase;
color:green;
font-size:20px;
}
</style>
<div class="alertes"><i class="icon-exclamation-triangle red"></i> {l s='The age check is only active on the selected categories or pages' mod='checkage'}</div>
<!-- END Module Checkage -->

View File

@@ -0,0 +1,95 @@
{*
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*}
<!-- START Module Checkage -->
{if $checkage->all_restriction == '1' OR $id_restriction == '1' OR $page_restriction == '1'}
{if !$checkOK OR $checkOK == '0' }
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#checkageModal').modal('toggle');
$("#TB4").on("focus click", function(){
$.post('{$url|escape:'htmlall':'UTF-8'}modules/checkage/check-checkage.php', {
checkOK: '1',
day: $('.TB1').val(),
month: $('.TB2').val(),
year: $('.TB3').val(),
token: '{$token|escape:'htmlall':'UTF-8'}'
},
function(data){
location.reload();
});
});
});
function Autotab(box, longueur, texte){
if (texte.length > longueur-1){
document.getElementById('TB'+box).focus();
}
};
</script>
<div class="modal fade" id="checkageModal" tabindex="-1" role="content" aria-hidden="true" data-keyboard="false" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div id="checkageContent" style="max-height:calc(100vh - 30px);min-height:calc(100vh - auto);overflow-y: auto;">
<table style="text-align:center;width:100%;">
{if $checkage->show_logo == '1'}
<tr>
<td style="text-align:center;">
<div id="checkageLogo" style="text-align:center;">
<img class="logo img-responsive" src="{$shop.logo|escape:'htmlall':'UTF-8'}" alt="{$shop.name|escape:'htmlall':'UTF-8'}"/>
</div>
</td>
</tr>
{/if}
{if $checkage->checkage_message}
<tr>
<td>
{$checkage->checkage_message|escape:'htmlall':'UTF-8' nofilter}
</td>
</tr>
{/if}
<tr>
<td style="text-align:center;">
<div class="infoCheckage">
{l s='The minimum age to continue is' mod='checkage'} {$checkage->age_restriction|escape:'htmlall':'UTF-8'} {l s='years' mod='checkage'}<br />{l s='Please enter your date of birth' mod='checkage'}
<div style="text-align:center;" class="popupCheckage">
{if $checkage->format_date == '1'}
<input class="dic TB1" maxlength="2" type="text" size="2" id="TB1" name="day" placeholder="{l s='DD' mod='checkage'}" onkeyup="Autotab(2, this.size, this.value)" onFocus="this.value=''">
<input class="dic TB2" maxlength="2" type="text" size="2" id="TB2" name="month" placeholder="{l s='MM' mod='checkage'}" onkeyup="Autotab(3, this.size, this.value)" onFocus="this.value=''">
<input class="dic TB3" maxlength="4" type="text" size="4" id="TB3" name="year" placeholder="{l s='YYYY' mod='checkage'}" onkeyup="Autotab(4, this.size, this.value)" onFocus="this.value=''">
{elseif $checkage->format_date == '2'}
<input class="dic TB2" maxlength="2" type="text" size="2" id="TB1" name="month" placeholder="{l s='MM' mod='checkage'}" onkeyup="Autotab(2, this.size, this.value)" onFocus="this.value=''">
<input class="dic TB1" maxlength="2" type="text" size="2" id="TB2" name="day" placeholder="{l s='DD' mod='checkage'}" onkeyup="Autotab(3, this.size, this.value)" onFocus="this.value=''">
<input class="dic TB3" maxlength="4" type="text" size="4" id="TB3" name="year" placeholder="{l s='YYYY' mod='checkage'}" onkeyup="Autotab(4, this.size, this.value)" onFocus="this.value=''">
{elseif $checkage->format_date == '3'}
<input class="dic TB3" maxlength="4" type="text" size="4" id="TB1" name="year" placeholder="{l s='YYYY' mod='checkage'}" onkeyup="Autotab(2, this.size, this.value)" onFocus="this.value=''">
<input class="dic TB2" maxlength="2" type="text" size="2" id="TB2" name="month" placeholder="{l s='MM' mod='checkage'}" onkeyup="Autotab(3, this.size, this.value)" onFocus="this.value=''">
<input class="dic TB1" maxlength="2" type="text" size="2" id="TB3" name="day" placeholder="{l s='DD' mod='checkage'}" onkeyup="Autotab(4, this.size, this.value)" onFocus="this.value=''">
{/if}
<button id="TB4" class="dic2">OK</button>
</div>
</td>
</tr>
{if $id_restriction == '1' OR $page_restriction == '1'}
<tr>
<td>
<div style="text-align:center;">
<a href="{$url|escape:'htmlall':'UTF-8'}">{l s='or Return to Home page' mod='checkage'}</a>
</div>
</td>
</tr>
{/if}
</table>
</div>
</div>
</div>
</div>
{/if}
{/if}
<!-- END Module Checkage -->

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,19 @@
<?php
/**
* 2017 Agence Bondaty and Co
*
* @author Agence Bondaty and Co <support@bondaty-and-co.fr>
* @copyright 2017 Agence Bondaty and Co
* @license single
* Agence Bondaty and Co
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;