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,45 @@
<?php
/**
* 2007-2018 PrestaShop
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
* International Registered Trademark & Property of PrestaShop SA
*/
class APIFAQ
{
public function getData($module_key, $version)
{
if (function_exists('curl_init') == false) {
return false;
}
$context = Context::getContext();
$iso_code = Language::getIsoById($context->language->id);
$url = 'http://api.addons.prestashop.com/request/faq/'.$module_key.'/'.$version.'/'.$iso_code;
$options = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false
);
$CURL = curl_init();
curl_setopt_array($CURL, $options);
$content = curl_exec($CURL);
curl_close($CURL);
if (!$content) {
return false;
}
$content = Tools::jsonDecode($content);
if (!$content || empty($content->categories)) {
return false;
}
return $content->categories;
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_faviconnotificationbo</name>
<displayName><![CDATA[Order Notifications on the Favicon]]></displayName>
<version><![CDATA[1.0.0]]></version>
<description><![CDATA[Get notified when you get new order, new client or new message directly on your browser tab of your back office even if you are working on another page]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall this module?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,24 @@
<?php
/**
* 2007-2018 PrestaShop
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
* International Registered Trademark & Property of PrestaShop SA
*/
class AdminAjaxFaviconBOController extends ModuleAdminController
{
public function ajaxProcessGetNotifications()
{
$notification = new Notification;
$this->ajaxDie(json_encode($notification->getLastElements()));
}
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* 2007-2018 PrestaShop
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
* International Registered Trademark & Property of PrestaShop SA
*/
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,25 @@
<?php
/**
* 2007-2018 PrestaShop
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
* International Registered Trademark & Property of PrestaShop SA
*/
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,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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: 1.8 KiB

View File

@@ -0,0 +1,284 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 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 Ps_faviconnotificationbo extends Module
{
protected static $conf_fields = array(
'BACKGROUND_COLOR_FAVICONBO',
'TEXT_COLOR_FAVICONBO',
'CHECKBOX_ORDER',
'CHECKBOX_CUSTOMER',
'CHECKBOX_MESSAGE'
);
public function __construct()
{
$this->name = 'ps_faviconnotificationbo';
$this->tab = 'administration';
$this->version = '1.0.0';
$this->author = 'PrestaShop';
$this->bootstrap = true;
$this->module_key = '91315ca88851b6c2852ee4be0c59b7b1';
$this->author_address = '0x64aa3c1e4034d07015f639b0e171b0d7b27d01aa';
$this->controllers = array(
'adminAjax' => 'AdminAjaxFaviconBO',
);
parent::__construct();
$this->displayName = $this->l('Order Notifications on the Favicon');
$this->description = $this->l('Get notified when you get new order, new client or new message directly on your browser tab of your back office even if you are working on another page');
// Settings paths
$this->js_path = $this->_path.'views/js/';
$this->css_path = $this->_path.'views/css/';
$this->img_path = $this->_path.'views/img/';
$this->docs_path = $this->_path.'docs/';
$this->logo_path = $this->_path.'logo.png';
$this->module_path = $this->_path;
$this->ps_version = (bool)version_compare(_PS_VERSION_, '1.7', '>=');
// Confirm uninstall
$this->confirmUninstall = $this->l('Are you sure you want to uninstall this module?');
$this->ps_versions_compliancy = array('min' => '1.5', 'max' => _PS_VERSION_);
}
/**
*
*
* @param none
* @return bool
*/
public function install()
{
Configuration::updateValue('CHECKBOX_ORDER', '1');
Configuration::updateValue('CHECKBOX_CUSTOMER', '1');
Configuration::updateValue('CHECKBOX_MESSAGE', '1');
Configuration::updateValue('BACKGROUND_COLOR_FAVICONBO', '#DF0067');
Configuration::updateValue('TEXT_COLOR_FAVICONBO', '#ffffff');
return (parent::install() && $this->registerHook('BackOfficeHeader') && $this->installTab());
}
public function uninstall()
{
foreach (Ps_faviconnotificationbo::$conf_fields as $field) {
Configuration::deleteByName($field);
}
if (parent::uninstall() &&
$this->uninstallTab()) {
return true;
} else {
$this->_errors[] = $this->l('There was an error during the uninstallation.');
return false;
}
}
/**
* This method is often use to create an ajax controller
*
* @param none
* @return bool
*/
public function installTab()
{
$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminAjaxFaviconBO';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = $this->name;
}
$tab->id_parent = -1;
$tab->module = $this->name;
return $tab->add();
}
/**
* uninstall tab
*
* @param none
* @return bool
*/
public function uninstallTab()
{
$id_tab = (int)Tab::getIdFromClassName('AdminAjaxFaviconBO');
if ($id_tab) {
$tab = new Tab($id_tab);
if (Validate::isLoadedObject($tab)) {
return ($tab->delete());
} else {
$return = false;
}
} else {
$return = true;
}
return $return;
}
/**
* load dependencies in the configuration of the module
*/
public function loadAsset()
{
// Load CSS
$css = array(
$this->css_path.'faq.css',
$this->css_path.'menu.css',
$this->css_path.'back.css',
$this->css_path.'fontawesome-all.min',
);
$this->context->controller->addCSS($css, 'all');
// Load JS
$jss = array(
$this->js_path.'vue.min.js',
$this->js_path.'faq.js',
$this->js_path.'menu.js',
);
$this->context->controller->addJqueryPlugin('colorpicker');
$this->context->controller->addJS($jss);
}
/**
* FAQ API
*/
public function loadFaq()
{
include_once('classes/APIFAQClass.php');
$api = new APIFAQ();
$faq = $api->getData($this->module_key, $this->version);
return $faq;
}
/**
* Load the configuration form
*/
public function getContent()
{
if ($this->ps_version) {
$params = array('configure' => $this->name);
$moduleAdminLink = Context::getContext()->link->getAdminLink('AdminModules', true, false, $params);
} else {
$moduleAdminLink = Context::getContext()->link->getAdminLink('AdminModules', true).'&configure='.$this->name.'&module_name='.$this->name;
}
$faq = $this->loadFaq(); // load faq from addons api
$this->loadAsset(); // load js and css
$id_lang = $this->context->language->id;
$iso_lang = Language::getIsoById($id_lang);
// get readme
switch ($iso_lang) {
case 'fr':
$doc = $this->docs_path.'readme_fr.pdf';
break;
default:
$doc = $this->docs_path.'readme_en.pdf';
break;
}
// get current page
$currentPage = 'faviconConfiguration';
$page = Tools::getValue('page');
if (!empty($page)) {
$currentPage = Tools::getValue('page');
}
// assign var to smarty
$this->context->smarty->assign(array(
'module_name' => $this->name,
'module_version' => $this->version,
'moduleAdminLink' => $moduleAdminLink,
'module_display' => $this->displayName,
'apifaq' => $faq,
'doc' => $doc,
'logo_path' => $this->logo_path,
'languages' => $this->context->controller->getLanguages(),
'defaultFormLanguage' => (int) $this->context->employee->id_lang,
'currentPage' => $currentPage,
'ps_base_dir' => Tools::getHttpHost(true),
'ps_version' => _PS_VERSION_,
'isPs17' => $this->ps_version,
));
return $this->context->smarty->fetch($this->local_path.'views/templates/admin/menu.tpl');
}
/**
* return parameters saved during the favicon configuration
* @return array parameters saved
*/
public function getParams()
{
$params = array('BACKGROUND_COLOR_FAVICONBO', 'TEXT_COLOR_FAVICONBO', 'CHECKBOX_ORDER', 'CHECKBOX_CUSTOMER', 'CHECKBOX_MESSAGE');
return Configuration::getMultiple($params);
}
/**
* load the javascript who is used in all the backoffice
*/
public function loadGlobalAsset()
{
$jss = array(
$this->js_path.'favico.js',
);
$this->context->controller->addJS($jss);
}
public function hookBackOfficeHeader($params)
{
if (!$this->active) {
return;
}
$this->loadGlobalAsset();
if (Tools::isSubmit('submitFavIconConf')) {
$this->saveForm();
}
$params = $this->getParams();
// controller url
$adminController = $this->context->link->getAdminLink('AdminAjaxFaviconBO');
$this->context->smarty->assign(array(
'bofavicon_params' => $params,
'adminController' => $adminController,
));
return $this->context->smarty->fetch($this->local_path.'views/templates/hook/faviconbo.tpl');
}
public function saveForm()
{
Configuration::updateValue('BACKGROUND_COLOR_FAVICONBO', Tools::getValue('BACKGROUND_COLOR_FAVICONBO'));
Configuration::updateValue('TEXT_COLOR_FAVICONBO', Tools::getValue('TEXT_COLOR_FAVICONBO'));
Configuration::updateValue('CHECKBOX_ORDER', Tools::getValue('CHECKBOX_ORDER'));
Configuration::updateValue('CHECKBOX_CUSTOMER', Tools::getValue('CHECKBOX_CUSTOMER'));
Configuration::updateValue('CHECKBOX_MESSAGE', Tools::getValue('CHECKBOX_MESSAGE'));
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,89 @@
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*
* Don't forget to prefix your containers with your own identifier
* to avoid any conflicts with others containers.
*/
.notransition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
transition: none !important;
}
.addons-title {
margin: 1em 0;
padding-left: 20px;
/* background-color: #e8faff; */
border-left: 4px solid #2eacce;
font-size: 18px !important;
text-decoration: underline;
}
.addons-number-fields {
display: block;
width: 22%;
height: 31px;
padding: 6px 8px;
font-size: 12px;
line-height: 1.42857;
color: #555;
background-color: #F5F8F9;
background-image: none;
border: 1px solid #C7D6DB;
border-radius: 3px;
-webkit-transition: border-color ease-in-out 0.15s,box-shadow ease-in-out 0.15s;
-o-transition: border-color ease-in-out 0.15s,box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s,box-shadow ease-in-out 0.15s
}
.addons-inline-block {
display: inline-block;
}
.addons-text {
padding: 14px;
font-size: 13px;
}
.addons-hide {
display: none;
}
.title {
padding-bottom: 10px;
}
.labelbutton {
padding-right: 15px;
}
.divcolorpicker {
margin-left: -15px;
}
.panel-footer {
margin-top: 125px !important;
}

View File

@@ -0,0 +1,79 @@
#faq span.faq-h1 {
font-size: 16px;
font-weight: bold;
display: block;
margin-bottom: 10px;
}
#faq span.faq-h2 {
font-size: 14px;
display: block;
cursor: pointer;
}
#faq span.faq-h2:hover {
color: #25B9D7;
}
#faq span.faq-h2.faq-open {
color: #25B9D7;
font-weight: bold;
}
#faq span.faq-h2 i {
font-size: 13px;
margin-right: 2px;
}
#faq > ul {
list-style: none;
}
#faq > ul > li {
list-style: none;
padding: 5px
}
#faq .faq-text {
padding: 15px 15px;
background: #f7f7f7;
margin: 10px 0;
}
.helpContentParent {
overflow:hidden;
}
.helpContentLeft {
float:left;
width:30%;
border-right:1px solid #555;
overflow:hidden;
}
.helpContentLeft > .left {
float:left;
width:20%;
}
.helpContentLeft > .right {
float:left;
width:66%;
text-align: justify;
text-justify: inter-word;
}
.helpContentRight {
float:right;
width:70%;
/*border-left:1px solid #16222c;*/
}
.helpContentRight-sub{
margin-left:50px;
}
.numberCircle {
border-radius: 50%;
float:left;
margin-right: 10px;
width: 20px;
height: 20px;
/*padding: 8px;*/
background: #fff;
border: 2px solid #666;
color: #555;
text-align: center;
font: 14px Arial, sans-serif;
}
.numberCircleText {
margin-left: 30px;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,39 @@
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*
* Don't forget to prefix your containers with your own identifier
* to avoid any conflicts with others containers.
*/
$(window).load(function() {
$('#faq .faq-h2').on('click', function() {
$('#faq .faq-h2').removeClass('faq-open');
if (!$(this).next().hasClass('hide')) {
$('#faq .faq-text').addClass('hide');
} else {
$('#faq .faq-text').addClass('hide');
$(this).next().removeClass('hide');
$(this).addClass('faq-open');
}
});
});

View File

@@ -0,0 +1,903 @@
/**
* @license MIT or GPL-2.0
* @fileOverview Favico animations
* @author Miroslav Magda, http://blog.ejci.net
* @source: https://github.com/ejci/favico.js
* @version 0.3.10
*/
/**
* Create new favico instance
* @param {Object} Options
* @return {Object} Favico object
* @example
* var favico = new Favico({
* bgColor : '#d00',
* textColor : '#fff',
* fontFamily : 'sans-serif',
* fontStyle : 'bold',
* type : 'circle',
* position : 'down',
* animation : 'slide',
* elementId: false,
* element: null,
* dataUrl: function(url){},
* win: window
* });
*/
(function () {
var Favico = (function (opt) {
'use strict';
opt = (opt) ? opt : {};
var _def = {
bgColor: '#d00',
textColor: '#fff',
fontFamily: 'sans-serif', //Arial,Verdana,Times New Roman,serif,sans-serif,...
fontStyle: 'bold', //normal,italic,oblique,bold,bolder,lighter,100,200,300,400,500,600,700,800,900
type: 'circle',
position: 'down', // down, up, left, leftup (upleft)
animation: 'slide',
elementId: false,
element: null,
dataUrl: false,
win: window
};
var _opt, _orig, _h, _w, _canvas, _context, _img, _ready, _lastBadge, _running, _readyCb, _stop, _browser, _animTimeout, _drawTimeout, _doc;
_browser = {};
_browser.ff = typeof InstallTrigger != 'undefined';
_browser.chrome = !!window.chrome;
_browser.opera = !!window.opera || navigator.userAgent.indexOf('Opera') >= 0;
_browser.ie = /*@cc_on!@*/false;
_browser.safari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
_browser.supported = (_browser.chrome || _browser.ff || _browser.opera);
var _queue = [];
_readyCb = function () {
};
_ready = _stop = false;
/**
* Initialize favico
*/
var init = function () {
//merge initial options
_opt = merge(_def, opt);
_opt.bgColor = hexToRgb(_opt.bgColor);
_opt.textColor = hexToRgb(_opt.textColor);
_opt.position = _opt.position.toLowerCase();
_opt.animation = (animation.types['' + _opt.animation]) ? _opt.animation : _def.animation;
_doc = _opt.win.document;
var isUp = _opt.position.indexOf('up') > -1;
var isLeft = _opt.position.indexOf('left') > -1;
//transform the animations
if (isUp || isLeft) {
for (var a in animation.types) {
for (var i = 0; i < animation.types[a].length; i++) {
var step = animation.types[a][i];
if (isUp) {
if (step.y < 0.6) {
step.y = step.y - 0.4;
} else {
step.y = step.y - 2 * step.y + (1 - step.w);
}
}
if (isLeft) {
if (step.x < 0.6) {
step.x = step.x - 0.4;
} else {
step.x = step.x - 2 * step.x + (1 - step.h);
}
}
animation.types[a][i] = step;
}
}
}
_opt.type = (type['' + _opt.type]) ? _opt.type : _def.type;
_orig = link. getIcons();
//create temp canvas
_canvas = document.createElement('canvas');
//create temp image
_img = document.createElement('img');
var lastIcon = _orig[_orig.length - 1];
if (lastIcon.hasAttribute('href')) {
_img.setAttribute('crossOrigin', 'anonymous');
//get width/height
_img.onload = function () {
_h = (_img.height > 0) ? _img.height : 32;
_w = (_img.width > 0) ? _img.width : 32;
_canvas.height = _h;
_canvas.width = _w;
_context = _canvas.getContext('2d');
icon.ready();
};
_img.setAttribute('src', lastIcon.getAttribute('href'));
} else {
_h = 32;
_w = 32;
_img.height = _h;
_img.width = _w;
_canvas.height = _h;
_canvas.width = _w;
_context = _canvas.getContext('2d');
icon.ready();
}
};
/**
* Icon namespace
*/
var icon = {};
/**
* Icon is ready (reset icon) and start animation (if ther is any)
*/
icon.ready = function () {
_ready = true;
icon.reset();
_readyCb();
};
/**
* Reset icon to default state
*/
icon.reset = function () {
//reset
if (!_ready) {
return;
}
_queue = [];
_lastBadge = false;
_running = false;
_context.clearRect(0, 0, _w, _h);
_context.drawImage(_img, 0, 0, _w, _h);
//_stop=true;
link.setIcon(_canvas);
//webcam('stop');
//video('stop');
window.clearTimeout(_animTimeout);
window.clearTimeout(_drawTimeout);
};
/**
* Start animation
*/
icon.start = function () {
if (!_ready || _running) {
return;
}
var finished = function () {
_lastBadge = _queue[0];
_running = false;
if (_queue.length > 0) {
_queue.shift();
icon.start();
} else {
}
};
if (_queue.length > 0) {
_running = true;
var run = function () {
// apply options for this animation
['type', 'animation', 'bgColor', 'textColor', 'fontFamily', 'fontStyle'].forEach(function (a) {
if (a in _queue[0].options) {
_opt[a] = _queue[0].options[a];
}
});
animation.run(_queue[0].options, function () {
finished();
}, false);
};
if (_lastBadge) {
animation.run(_lastBadge.options, function () {
run();
}, true);
} else {
run();
}
}
};
/**
* Badge types
*/
var type = {};
var options = function (opt) {
opt.n = ((typeof opt.n) === 'number') ? Math.abs(opt.n | 0) : opt.n;
opt.x = _w * opt.x;
opt.y = _h * opt.y;
opt.w = _w * opt.w;
opt.h = _h * opt.h;
opt.len = ("" + opt.n).length;
return opt;
};
/**
* Generate circle
* @param {Object} opt Badge options
*/
type.circle = function (opt) {
opt = options(opt);
var more = false;
if (opt.len === 2) {
opt.x = opt.x - opt.w * 0.4;
opt.w = opt.w * 1.4;
more = true;
} else if (opt.len >= 3) {
opt.x = opt.x - opt.w * 0.65;
opt.w = opt.w * 1.65;
more = true;
}
_context.clearRect(0, 0, _w, _h);
_context.drawImage(_img, 0, 0, _w, _h);
_context.beginPath();
_context.font = _opt.fontStyle + " " + Math.floor(opt.h * (opt.n > 99 ? 0.85 : 1)) + "px " + _opt.fontFamily;
_context.textAlign = 'center';
if (more) {
_context.moveTo(opt.x + opt.w / 2, opt.y);
_context.lineTo(opt.x + opt.w - opt.h / 2, opt.y);
_context.quadraticCurveTo(opt.x + opt.w, opt.y, opt.x + opt.w, opt.y + opt.h / 2);
_context.lineTo(opt.x + opt.w, opt.y + opt.h - opt.h / 2);
_context.quadraticCurveTo(opt.x + opt.w, opt.y + opt.h, opt.x + opt.w - opt.h / 2, opt.y + opt.h);
_context.lineTo(opt.x + opt.h / 2, opt.y + opt.h);
_context.quadraticCurveTo(opt.x, opt.y + opt.h, opt.x, opt.y + opt.h - opt.h / 2);
_context.lineTo(opt.x, opt.y + opt.h / 2);
_context.quadraticCurveTo(opt.x, opt.y, opt.x + opt.h / 2, opt.y);
} else {
_context.arc(opt.x + opt.w / 2, opt.y + opt.h / 2, opt.h / 2, 0, 2 * Math.PI);
}
_context.fillStyle = 'rgba(' + _opt.bgColor.r + ',' + _opt.bgColor.g + ',' + _opt.bgColor.b + ',' + opt.o + ')';
_context.fill();
_context.closePath();
_context.beginPath();
_context.stroke();
_context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')';
//_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
if ((typeof opt.n) === 'number' && opt.n > 999) {
_context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000)) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2));
} else {
_context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
}
_context.closePath();
};
/**
* Generate rectangle
* @param {Object} opt Badge options
*/
type.rectangle = function (opt) {
opt = options(opt);
var more = false;
if (opt.len === 2) {
opt.x = opt.x - opt.w * 0.4;
opt.w = opt.w * 1.4;
more = true;
} else if (opt.len >= 3) {
opt.x = opt.x - opt.w * 0.65;
opt.w = opt.w * 1.65;
more = true;
}
_context.clearRect(0, 0, _w, _h);
_context.drawImage(_img, 0, 0, _w, _h);
_context.beginPath();
_context.font = _opt.fontStyle + " " + Math.floor(opt.h * (opt.n > 99 ? 0.9 : 1)) + "px " + _opt.fontFamily;
_context.textAlign = 'center';
_context.fillStyle = 'rgba(' + _opt.bgColor.r + ',' + _opt.bgColor.g + ',' + _opt.bgColor.b + ',' + opt.o + ')';
_context.fillRect(opt.x, opt.y, opt.w, opt.h);
_context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')';
//_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
if ((typeof opt.n) === 'number' && opt.n > 999) {
_context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000)) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2));
} else {
_context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
}
_context.closePath();
};
/**
* Set badge
*/
var badge = function (number, opts) {
opts = ((typeof opts) === 'string' ? {
animation: opts
} : opts) || {};
_readyCb = function () {
try {
if (typeof (number) === 'number' ? (number > 0) : (number !== '')) {
var q = {
type: 'badge',
options: {
n: number
}
};
if ('animation' in opts && animation.types['' + opts.animation]) {
q.options.animation = '' + opts.animation;
}
if ('type' in opts && type['' + opts.type]) {
q.options.type = '' + opts.type;
}
['bgColor', 'textColor'].forEach(function (o) {
if (o in opts) {
q.options[o] = hexToRgb(opts[o]);
}
});
['fontStyle', 'fontFamily'].forEach(function (o) {
if (o in opts) {
q.options[o] = opts[o];
}
});
_queue.push(q);
if (_queue.length > 100) {
throw new Error('Too many badges requests in queue.');
}
icon.start();
} else {
icon.reset();
}
} catch (e) {
throw new Error('Error setting badge. Message: ' + e.message);
}
};
if (_ready) {
_readyCb();
}
};
/**
* Set image as icon
*/
var image = function (imageElement) {
_readyCb = function () {
try {
var w = imageElement.width;
var h = imageElement.height;
var newImg = document.createElement('img');
var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
newImg.setAttribute('crossOrigin', 'anonymous');
newImg.onload=function(){
_context.clearRect(0, 0, _w, _h);
_context.drawImage(newImg, 0, 0, _w, _h);
link.setIcon(_canvas);
};
newImg.setAttribute('src', imageElement.getAttribute('src'));
newImg.height = (h / ratio);
newImg.width = (w / ratio);
} catch (e) {
throw new Error('Error setting image. Message: ' + e.message);
}
};
if (_ready) {
_readyCb();
}
};
/**
* Set the icon from a source url. Won't work with badges.
*/
var rawImageSrc = function (url) {
_readyCb = function() {
link.setIconSrc(url);
};
if (_ready) {
_readyCb();
}
};
/**
* Set video as icon
*/
var video = function (videoElement) {
_readyCb = function () {
try {
if (videoElement === 'stop') {
_stop = true;
icon.reset();
_stop = false;
return;
}
//var w = videoElement.width;
//var h = videoElement.height;
//var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
videoElement.addEventListener('play', function () {
drawVideo(this);
}, false);
} catch (e) {
throw new Error('Error setting video. Message: ' + e.message);
}
};
if (_ready) {
_readyCb();
}
};
/**
* Set video as icon
*/
var webcam = function (action) {
//UR
if (!window.URL || !window.URL.createObjectURL) {
window.URL = window.URL || {};
window.URL.createObjectURL = function (obj) {
return obj;
};
}
if (_browser.supported) {
var newVideo = false;
navigator.getUserMedia = navigator.getUserMedia || navigator.oGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia || navigator.webkitGetUserMedia;
_readyCb = function () {
try {
if (action === 'stop') {
_stop = true;
icon.reset();
_stop = false;
return;
}
newVideo = document.createElement('video');
newVideo.width = _w;
newVideo.height = _h;
navigator.getUserMedia({
video: true,
audio: false
}, function (stream) {
newVideo.src = URL.createObjectURL(stream);
newVideo.play();
drawVideo(newVideo);
}, function () {
});
} catch (e) {
throw new Error('Error setting webcam. Message: ' + e.message);
}
};
if (_ready) {
_readyCb();
}
}
};
var setOpt = function (key, value) {
var opts = key;
if (!(value == null && Object.prototype.toString.call(key) == '[object Object]')) {
opts = {};
opts[key] = value;
}
var keys = Object.keys(opts);
for (var i = 0; i < keys.length; i++) {
if (keys[i] == 'bgColor' || keys[i] == 'textColor') {
_opt[keys[i]] = hexToRgb(opts[keys[i]]);
} else {
_opt[keys[i]] = opts[keys[i]];
}
}
_queue.push(_lastBadge);
icon.start();
};
/**
* Draw video to context and repeat :)
*/
function drawVideo(video) {
if (video.paused || video.ended || _stop) {
return false;
}
//nasty hack for FF webcam (Thanks to Julian Ćwirko, kontakt@redsunmedia.pl)
try {
_context.clearRect(0, 0, _w, _h);
_context.drawImage(video, 0, 0, _w, _h);
} catch (e) {
}
_drawTimeout = setTimeout(function () {
drawVideo(video);
}, animation.duration);
link.setIcon(_canvas);
}
var link = {};
/**
* Get icons from HEAD tag or create a new <link> element
*/
link.getIcons = function () {
var elms = [];
//get link element
var getLinks = function () {
var icons = [];
var links = _doc.getElementsByTagName('head')[0].getElementsByTagName('link');
for (var i = 0; i < links.length; i++) {
if ((/(^|\s)icon(\s|$)/i).test(links[i].getAttribute('rel'))) {
icons.push(links[i]);
}
}
return icons;
};
if (_opt.element) {
elms = [_opt.element];
} else if (_opt.elementId) {
//if img element identified by elementId
elms = [_doc.getElementById(_opt.elementId)];
elms[0].setAttribute('href', elms[0].getAttribute('src'));
} else {
//if link element
elms = getLinks();
if (elms.length === 0) {
elms = [_doc.createElement('link')];
elms[0].setAttribute('rel', 'icon');
_doc.getElementsByTagName('head')[0].appendChild(elms[0]);
}
}
elms.forEach(function(item) {
item.setAttribute('type', 'image/png');
});
return elms;
};
link.setIcon = function (canvas) {
var url = canvas.toDataURL('image/png');
link.setIconSrc(url);
};
link.setIconSrc = function (url) {
if (_opt.dataUrl) {
//if using custom exporter
_opt.dataUrl(url);
}
if (_opt.element) {
_opt.element.setAttribute('href', url);
_opt.element.setAttribute('src', url);
} else if (_opt.elementId) {
//if is attached to element (image)
var elm = _doc.getElementById(_opt.elementId);
elm.setAttribute('href', url);
elm.setAttribute('src', url);
} else {
//if is attached to fav icon
if (_browser.ff || _browser.opera) {
//for FF we need to "recreate" element, atach to dom and remove old <link>
//var originalType = _orig.getAttribute('rel');
var old = _orig[_orig.length - 1];
var newIcon = _doc.createElement('link');
_orig = [newIcon];
//_orig.setAttribute('rel', originalType);
if (_browser.opera) {
newIcon.setAttribute('rel', 'icon');
}
newIcon.setAttribute('rel', 'icon');
newIcon.setAttribute('type', 'image/png');
_doc.getElementsByTagName('head')[0].appendChild(newIcon);
newIcon.setAttribute('href', url);
if (old.parentNode) {
old.parentNode.removeChild(old);
}
} else {
_orig.forEach(function(icon) {
icon.setAttribute('href', url);
});
}
}
};
//http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb#answer-5624139
//HEX to RGB convertor
function hexToRgb(hex) {
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function (m, r, g, b) {
return r + r + g + g + b + b;
});
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : false;
}
/**
* Merge options
*/
function merge(def, opt) {
var mergedOpt = {};
var attrname;
for (attrname in def) {
mergedOpt[attrname] = def[attrname];
}
for (attrname in opt) {
mergedOpt[attrname] = opt[attrname];
}
return mergedOpt;
}
/**
* Cross-browser page visibility shim
* http://stackoverflow.com/questions/12536562/detect-whether-a-window-is-visible
*/
function isPageHidden() {
return _doc.hidden || _doc.msHidden || _doc.webkitHidden || _doc.mozHidden;
}
/**
* @namespace animation
*/
var animation = {};
/**
* Animation "frame" duration
*/
animation.duration = 40;
/**
* Animation types (none,fade,pop,slide)
*/
animation.types = {};
animation.types.fade = [{
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.0
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.1
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.2
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.3
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.4
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.5
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.6
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.7
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.8
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 0.9
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 1.0
}];
animation.types.none = [{
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 1
}];
animation.types.pop = [{
x: 1,
y: 1,
w: 0,
h: 0,
o: 1
}, {
x: 0.9,
y: 0.9,
w: 0.1,
h: 0.1,
o: 1
}, {
x: 0.8,
y: 0.8,
w: 0.2,
h: 0.2,
o: 1
}, {
x: 0.7,
y: 0.7,
w: 0.3,
h: 0.3,
o: 1
}, {
x: 0.6,
y: 0.6,
w: 0.4,
h: 0.4,
o: 1
}, {
x: 0.5,
y: 0.5,
w: 0.5,
h: 0.5,
o: 1
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 1
}];
animation.types.popFade = [{
x: 0.75,
y: 0.75,
w: 0,
h: 0,
o: 0
}, {
x: 0.65,
y: 0.65,
w: 0.1,
h: 0.1,
o: 0.2
}, {
x: 0.6,
y: 0.6,
w: 0.2,
h: 0.2,
o: 0.4
}, {
x: 0.55,
y: 0.55,
w: 0.3,
h: 0.3,
o: 0.6
}, {
x: 0.50,
y: 0.50,
w: 0.4,
h: 0.4,
o: 0.8
}, {
x: 0.45,
y: 0.45,
w: 0.5,
h: 0.5,
o: 0.9
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 1
}];
animation.types.slide = [{
x: 0.4,
y: 1,
w: 0.6,
h: 0.6,
o: 1
}, {
x: 0.4,
y: 0.9,
w: 0.6,
h: 0.6,
o: 1
}, {
x: 0.4,
y: 0.9,
w: 0.6,
h: 0.6,
o: 1
}, {
x: 0.4,
y: 0.8,
w: 0.6,
h: 0.6,
o: 1
}, {
x: 0.4,
y: 0.7,
w: 0.6,
h: 0.6,
o: 1
}, {
x: 0.4,
y: 0.6,
w: 0.6,
h: 0.6,
o: 1
}, {
x: 0.4,
y: 0.5,
w: 0.6,
h: 0.6,
o: 1
}, {
x: 0.4,
y: 0.4,
w: 0.6,
h: 0.6,
o: 1
}];
/**
* Run animation
* @param {Object} opt Animation options
* @param {Object} cb Callabak after all steps are done
* @param {Object} revert Reverse order? true|false
* @param {Object} step Optional step number (frame bumber)
*/
animation.run = function (opt, cb, revert, step) {
var animationType = animation.types[isPageHidden() ? 'none' : _opt.animation];
if (revert === true) {
step = (typeof step !== 'undefined') ? step : animationType.length - 1;
} else {
step = (typeof step !== 'undefined') ? step : 0;
}
cb = (cb) ? cb : function () {
};
if ((step < animationType.length) && (step >= 0)) {
type[_opt.type](merge(opt, animationType[step]));
_animTimeout = setTimeout(function () {
if (revert) {
step = step - 1;
} else {
step = step + 1;
}
animation.run(opt, cb, revert, step);
}, animation.duration);
link.setIcon(_canvas);
} else {
cb();
return;
}
};
//auto init
init();
return {
badge: badge,
video: video,
image: image,
rawImageSrc: rawImageSrc,
webcam: webcam,
setOpt: setOpt,
reset: icon.reset,
browser: {
supported: _browser.supported
}
};
});
// AMD / RequireJS
if (typeof define !== 'undefined' && define.amd) {
define([], function () {
return Favico;
});
}
// CommonJS
else if (typeof module !== 'undefined' && module.exports) {
module.exports = Favico;
}
// included directly via <script> tag
else {
this.Favico = Favico;
}
})();

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,54 @@
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
$(window).ready(function() {
moduleAdminLink = moduleAdminLink.replace(/\amp;/g,'');
window.vMenu = new Vue({
el: '#faviconbo-menu',
data: {
selectedTabName : currentPage,
},
methods: {
makeActive: function(item){
this.selectedTabName = item;
if (ps_version) { // if on 1.7
window.history.pushState({} , '', moduleAdminLink+'&page='+item );
} else { // if on 1.6
window.history.pushState({} , '', moduleAdminLink+'&configure='+moduleName+'&module_name='+moduleName+'&page='+item );
}
},
isActive : function(item){
if (this.selectedTabName == item) {
$('.faviconbo_menu').addClass('addons-hide');
$('#'+item).removeClass('addons-hide');
return true;
}
}
}
});
//Because mColorPicker doesn't care about the passed parameters
$('#mColorPicker').remove();
$('.mColorPickerFaviconInput').mColorPicker({imageFolder: baseAdminDir + '../img/admin/'});
});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,55 @@
{*
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div id="modulecontent" class="clearfix">
<div id="faviconbo-menu">
<div class="col-lg-2">
<div class="list-group" v-on:click.prevent>
<a href="#" class="list-group-item" v-bind:class="{ 'active': isActive('faviconConfiguration') }" v-on:click="makeActive('faviconConfiguration')"><i class="fa fa-gavel"></i> {l s='Get started' d='Modules.Faviconnotificationbo.Admin'}</a>
</div>
<div class="list-group" v-on:click.prevent>
<a class="list-group-item" style="text-align:center"><i class="icon-info"></i> {l s='Version' d='Admin.Global'} {$module_version|escape:'htmlall':'UTF-8'} | <i class="icon-info"></i> PrestaShop {$ps_version|escape:'htmlall':'UTF-8'}</a>
</div>
</div>
</div>
{* list your admin tpl *}
<div id="faviconConfiguration" class="faviconbo_menu addons-hide">
{include file="./tabs/faviconConfiguration.tpl"}
</div>
</div>
{* Use this if you want to send php var to your js *}
{literal}
<script type="text/javascript">
var base_url = "{/literal}{$ps_base_dir|escape:'htmlall':'UTF-8'}{literal}";
var isPs17 = "{/literal}{$isPs17|escape:'htmlall':'UTF-8'}{literal}";
var currentPage = "{/literal}{$currentPage|escape:'htmlall':'UTF-8'}{literal}";
var moduleAdminLink = "{/literal}{$moduleAdminLink|escape:'htmlall':'UTF-8'}{literal}";
var moduleName = "{/literal}{$module_name|escape:'htmlall':'UTF-8'}{literal}";
var ps_version = "{/literal}{$isPs17|escape:'htmlall':'UTF-8'}{literal}";
</script>
{/literal}

View File

@@ -0,0 +1,103 @@
{*
* 2007-2018 PrestaShop
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="panel col-lg-10 right-panel">
<form method="post" action="{$moduleAdminLink|escape:'htmlall':'UTF-8'}&page=faviconConfiguration" class="form-horizontal">
<h3>
{l s='Configuration' d='Admin.Global'}
</h3>
<div class="form-group row">
<div class="title">
{l s='Display notifications in the browser tab for:' d='Modules.Faviconnotificationbo.Admin'}
</div>
<ol>
<div class="col-lg-5 col-md-4 col-xs-10">
<div class="form-group">
<div class="control-label col-lg-5 col-md-4 col-xs-10">
<label class="labelbutton">{l s='New orders' d='Modules.Faviconnotificationbo.Admin'}</label>
</div>
<div>
<div class="input-group fixed-width-lg">
<span class="switch prestashop-switch fixed-width-lg">
<input class="yes" type="radio" name="CHECKBOX_ORDER" id="checkbox_track_new_orders_on" value="1" {if $bofavicon_params.CHECKBOX_ORDER eq 1}checked="checked"{/if}>
<label for="checkbox_track_new_orders_on" class="radioCheck">{l s='Yes' d='Admin.Global'}</label>
<input class="no" type="radio" name="CHECKBOX_ORDER" id="checkbox_track_new_orders_off" value="0" {if $bofavicon_params.CHECKBOX_ORDER eq 0}checked="checked"{/if}>
<label for="checkbox_track_new_orders_off" class="radioCheck">{l s='No' d='Admin.Global'}</label>
<a class="slide-button btn"></a>
</span>
</div>
</div>
</div>
<div class="form-group">
<div class="control-label col-lg-5 col-md-4 col-xs-10">
<label class="labelbutton">{l s='New customers' d='Admin.Navigation.Header'}</label>
</div>
<div>
<div class="input-group fixed-width-lg">
<span class="switch prestashop-switch fixed-width-lg">
<input class="yes" type="radio" name="CHECKBOX_CUSTOMER" id="checkbox_track_new_customers_on" value="1" {if $bofavicon_params.CHECKBOX_CUSTOMER eq 1}checked="checked"{/if}>
<label for="checkbox_track_new_customers_on" class="radioCheck">{l s='Yes' d='Admin.Global'}</label>
<input class="no" type="radio" name="CHECKBOX_CUSTOMER" id="checkbox_track_new_customers_off" value="0" {if $bofavicon_params.CHECKBOX_CUSTOMER eq 0}checked="checked"{/if}>
<label for="checkbox_track_new_customers_off" class="radioCheck">{l s='No' d='Admin.Global'}</label>
<a class="slide-button btn"></a>
</span>
</div>
</div>
</div>
<div class="form-group">
<div class="control-label col-lg-5 col-md-4 col-xs-10">
<label class="labelbutton">{l s='New messages' d='Admin.Orderscustomers.Feature'}</label>
</div>
<div>
<div class="input-group fixed-width-lg">
<span class="switch prestashop-switch fixed-width-lg">
<input class="yes" type="radio" name="CHECKBOX_MESSAGE" id="checkbox_track_new_messages_on" value="1" {if $bofavicon_params.CHECKBOX_MESSAGE eq 1}checked="checked"{/if}>
<label for="checkbox_track_new_messages_on" class="radioCheck">{l s='Yes' d='Admin.Global'}</label>
<input class="no" type="radio" name="CHECKBOX_MESSAGE" id="checkbox_track_new_messages_off" value="0" {if $bofavicon_params.CHECKBOX_MESSAGE eq 0}checked="checked"{/if}>
<label for="checkbox_track_new_messages_off" class="radioCheck">{l s='No' d='Admin.Global'}</label>
<a class="slide-button btn"></a>
</span>
</div>
</div>
</div>
</div>
</ol>
</div>
<div class="col-lg-5">
<div class="form-group">
<div class="divcolorpicker control-label col-lg-6 col-md-4 col-xs-10">
<label class="labelbutton" for="faviconbo_input_backgroundcolor">{l s='Notification background color' d='Modules.Faviconnotificationbo.Admin'}</label>
</div>
<div>
<div class="input-group fixed-width-lg">
<input id="BACKGROUND_COLOR_FAVICONBO" type="text" data-hex="true" class="mColorPickerFaviconInput" value="{if isset($bofavicon_params.BACKGROUND_COLOR_FAVICONBO)}{$bofavicon_params.BACKGROUND_COLOR_FAVICONBO|escape:'quotes'}{/if}" name="BACKGROUND_COLOR_FAVICONBO"/>
</div>
</div>
</div>
<div class="form-group">
<div class="divcolorpicker control-label col-lg-6 col-md-4 col-xs-10">
<label class="labelbutton" for="faviconbo_input_textcolor">{l s='Notification text color' d='Modules.Faviconnotificationbo.Admin'}</label>
</div>
<div>
<div class="input-group fixed-width-lg">
<input id="TEXT_COLOR_FAVICONBO" type="text" data-hex="true" class="mColorPickerFaviconInput" value="{if isset($bofavicon_params.TEXT_COLOR_FAVICONBO)}{$bofavicon_params.TEXT_COLOR_FAVICONBO|escape:'quotes'}{/if}" name="TEXT_COLOR_FAVICONBO"/>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<button type="submit" value="1" id="module_form_submit_btn" name="submitFavIconConf" class="btn btn-default pull-right"><i class="process-icon-save"></i>{l s='Save' d='Admin.Actions'}</button>
</div>
</form>
</div>

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,118 @@
{*
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
/*
* Return total of notification per checkbox checked
* @param int nbNewCustomer
* @param int nbNewOrder
* @param int nbNewMessage
* @return int result Total of Notification
*/
function getNotification(nbNewCustomer, nbNewOrder, nbNewMessage) {
let result = 0;
//if radiobutton is checked
{if $bofavicon_params.CHECKBOX_ORDER eq 1} result += nbNewOrder; {/if}
{if $bofavicon_params.CHECKBOX_CUSTOMER eq 1} result += nbNewCustomer; {/if}
{if $bofavicon_params.CHECKBOX_MESSAGE eq 1} result += nbNewMessage; {/if}
return result;
}
function loadAjax(adminController) {
$.ajax({
type: 'POST',
dataType: 'JSON',
url: adminController,
data: {
ajax: true,
action: "GetNotifications",
},
success: function(data) {
let nbNewCustomers = parseInt(data.customer.total);
let nbNewOrders = parseInt(data.order.total);
let nbNewCustomerMessages = parseInt(data.customer_message.total);
let nbTotalNotification = getNotification(nbNewCustomers, nbNewOrders, nbNewCustomerMessages);
favicon.badge(nbTotalNotification);
},
error: function(err) {
console.log(err);
console.log(adminController);
},
});
}
function updateNotifications(type) {
$.post(
baseAdminDir + "ajax.php",
{
"updateElementEmployee": "1",
"updateElementEmployeeType": type
}
);
}
$(document).ready(function() {
adminController = adminController.replace(/\amp;/g, '');
//set the configuration of the favicon
window.favicon = new Favico({
animation: 'popFade',
bgColor: BgColor,
textColor: TxtColor,
});
loadAjax(adminController)
setInterval(function() {
loadAjax(adminController);
}, 60000); //refresh notification every 60 seconds
//update favicon when you click on the customer tab into your backoffice
$(document).on('click', '#subtab-AdminCustomers', function (e) {
updateNotifications('customer');
});
//update favicon when you click on the customer service tab into your backoffice
$(document).on('click', '#subtab-AdminCustomerThreads', function (e) {
updateNotifications('customer_message');
});
//update favicon when you click on the order tab into your backoffice
$(document).on('click', '#subtab-AdminOrders', function (e) {
updateNotifications('order');
});
});
</script>
{* Use this if you want to send php var to your js *}
{literal}
<script type="text/javascript">
let BgColor = "{/literal}{$bofavicon_params.BACKGROUND_COLOR_FAVICONBO|escape:'html':'UTF-8'}{literal}";
let TxtColor = "{/literal}{$bofavicon_params.TEXT_COLOR_FAVICONBO|escape:'html':'UTF-8'}{literal}";
let CheckBoxOrder = "{/literal}{$bofavicon_params.CHECKBOX_ORDER|escape:'html':'UTF-8'}{literal}";
let CheckBoxCustomer = "{/literal}{$bofavicon_params.CHECKBOX_CUSTOMER|escape:'html':'UTF-8'}{literal}";
let CheckBoxMessage = "{/literal}{$bofavicon_params.CHECKBOX_MESSAGE|escape:'html':'UTF-8'}{literal}";
let adminController = "{/literal}{$adminController|escape:'htmlall':'UTF-8'}{literal}";
</script>
{/literal}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;