module suite
@ -1 +0,0 @@
|
||||
Subproject commit 429203debfcf0774d5b98acf44ca90de254459f9
|
5
modules/blockcontact/CHANGELOG.txt
Normal file
@ -0,0 +1,5 @@
|
||||
2014-04-22 18:57:04 +0200 // Changelog updated
|
||||
2014-03-24 12:18:44 +0100 [*] MO : Remove "toll free" from blockcontact strings.
|
||||
2014-03-24 11:43:28 +0100 / MO blockcontact : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:01:44 +0100 / MO blockcontact : ps_versions_compliancy added
|
||||
2014-03-20 14:21:10 +0100 Initial commit
|
37
modules/blockcontact/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Contact block
|
||||
|
||||
## About
|
||||
|
||||
Allows you to add additional information about your store\'s customer service.
|
||||
|
||||
## Contributing
|
||||
|
||||
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
|
||||
|
||||
### Requirements
|
||||
|
||||
Contributors **must** follow the following rules:
|
||||
|
||||
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
|
||||
* Do not update the module's version number.
|
||||
* Follow [the coding standards][1].
|
||||
|
||||
### Process in details
|
||||
|
||||
Contributors wishing to edit a module's files should follow the following process:
|
||||
|
||||
1. Create your GitHub account, if you do not have one already.
|
||||
2. Fork the blockcontact project to your GitHub account.
|
||||
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
|
||||
4. Create a branch in your local clone of the module for your changes.
|
||||
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
|
||||
6. Push your changed branch to your fork in your GitHub account.
|
||||
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
|
||||
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
|
||||
|
||||
That's it: you have contributed to this open-source project! Congratulations!
|
||||
|
||||
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
|
||||
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
|
||||
[3]: https://help.github.com/articles/using-pull-requests
|
||||
|
39
modules/blockcontact/blockcontact.css
Normal file
@ -0,0 +1,39 @@
|
||||
/* block CONTACT ******************************************************************************* */
|
||||
#contact_block .block_content {
|
||||
padding:10px 0 15px 0;
|
||||
background: url(images/block_contact_bg.jpg) no-repeat left bottom transparent
|
||||
}
|
||||
|
||||
#contact_block p {
|
||||
padding:0 5px 15px 5px;
|
||||
font-size: 13px;
|
||||
line-height: 18px
|
||||
}
|
||||
|
||||
#contact_block .title_block, #contact_block h4 {
|
||||
padding:6px 11px;
|
||||
font-size: 12px;
|
||||
line-height: auto
|
||||
}
|
||||
#contact_block p.tel {
|
||||
margin:0 0 0 60px;
|
||||
padding-left: 26px;
|
||||
font: bold 11px/20px Arial, Verdana, sans-serif;
|
||||
background: url(images/block_contact_pict_tel.png) no-repeat 0 0 transparent
|
||||
}
|
||||
#contact_block a {
|
||||
display:block;
|
||||
margin-left:60px;
|
||||
padding:6px 8px;
|
||||
font:bold 10px Arial,Verdana,sans-serif;
|
||||
color:#fff;
|
||||
text-shadow:0 -1px 0 #000;
|
||||
text-transform:uppercase;
|
||||
-moz-border-radius:3px;
|
||||
-webkit-border-radius:3px;
|
||||
border-radius:3px;
|
||||
background:url(images/bloc_contact_a_bg.png) repeat-x 0 0 #000
|
||||
}
|
||||
#contact_block a:hover {text-decoration:none}
|
||||
|
||||
#contact_block .label {display: none}
|
168
modules/blockcontact/blockcontact.php
Normal file
@ -0,0 +1,168 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class Blockcontact extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockcontact';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.3.3';
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Contact block');
|
||||
$this->description = $this->l('Allows you to add additional information about your store\'s customer service.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install()
|
||||
&& Configuration::updateValue('BLOCKCONTACT_TELNUMBER', '')
|
||||
&& Configuration::updateValue('BLOCKCONTACT_EMAIL', '')
|
||||
&& $this->registerHook('displayNav')
|
||||
&& $this->registerHook('displayHeader');
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
// Delete configuration
|
||||
return Configuration::deleteByName('BLOCKCONTACT_TELNUMBER') && Configuration::deleteByName('BLOCKCONTACT_EMAIL') && parent::uninstall();
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$html = '';
|
||||
// If we try to update the settings
|
||||
if (Tools::isSubmit('submitModule'))
|
||||
{
|
||||
Configuration::updateValue('BLOCKCONTACT_TELNUMBER', Tools::getValue('blockcontact_telnumber'));
|
||||
Configuration::updateValue('BLOCKCONTACT_EMAIL', Tools::getValue('blockcontact_email'));
|
||||
$this->_clearCache('blockcontact.tpl');
|
||||
$this->_clearCache('nav.tpl');
|
||||
$html .= $this->displayConfirmation($this->l('Configuration updated'));
|
||||
}
|
||||
|
||||
$html .= $this->renderForm();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockcontact.css', 'all');
|
||||
}
|
||||
|
||||
public function hookDisplayRightColumn($params)
|
||||
{
|
||||
global $smarty;
|
||||
$tpl = 'blockcontact';
|
||||
if (isset($params['blockcontact_tpl']) && $params['blockcontact_tpl'])
|
||||
$tpl = $params['blockcontact_tpl'];
|
||||
if (!$this->isCached($tpl.'.tpl', $this->getCacheId()))
|
||||
$smarty->assign(array(
|
||||
'telnumber' => Configuration::get('BLOCKCONTACT_TELNUMBER'),
|
||||
'email' => Configuration::get('BLOCKCONTACT_EMAIL')
|
||||
));
|
||||
return $this->display(__FILE__, $tpl.'.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookDisplayLeftColumn($params)
|
||||
{
|
||||
return $this->hookDisplayRightColumn($params);
|
||||
}
|
||||
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
$params['blockcontact_tpl'] = 'nav';
|
||||
return $this->hookDisplayRightColumn($params);
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'description' => $this->l('This block displays in the header your phone number (‘Call us now’), and a link to the ‘Contact us’ page.').'<br/><br/>'.
|
||||
$this->l('To edit the email addresses for the ‘Contact us’ page: you should go to the ‘Contacts’ page under the ‘Customer’ menu.').'<br/>'.
|
||||
$this->l('To edit the contact details in the footer: you should go to the ‘Contact Information Block’ module.'),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Telephone number'),
|
||||
'name' => 'blockcontact_telnumber',
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Email'),
|
||||
'name' => 'blockcontact_email',
|
||||
'desc' => $this->l('Enter here your customer service contact details.'),
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$helper->default_form_language = $lang->id;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
|
||||
$this->fields_form = array();
|
||||
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitModule';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
return array(
|
||||
'blockcontact_telnumber' => Tools::getValue('blockcontact_telnumber', Configuration::get('BLOCKCONTACT_TELNUMBER')),
|
||||
'blockcontact_email' => Tools::getValue('blockcontact_email', Configuration::get('BLOCKCONTACT_EMAIL')),
|
||||
);
|
||||
}
|
||||
}
|
33
modules/blockcontact/blockcontact.tpl
Normal file
@ -0,0 +1,33 @@
|
||||
{*
|
||||
* 2007-2014 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-2014 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="contact_block" class="block">
|
||||
<h4 class="title_block">{l s='Contact us' mod='blockcontact'}</h4>
|
||||
<div class="block_content clearfix">
|
||||
<p>{l s='Our support hotline is available 24/7.' mod='blockcontact'}</p>
|
||||
{if $telnumber != ''}<p class="tel"><span class="label">{l s='Phone:' mod='blockcontact'}</span><span itemprop="telephone"><a href="tel:{$telnumber|escape:'html':'UTF-8'}">{$telnumber|escape:'html':'UTF-8'}</a></span></p>{/if}
|
||||
{if $email != ''}<a href="mailto:{$email|escape:'html':'UTF-8'}" title="{l s='Contact our expert support team!' mod='blockcontact'}">{l s='Contact our expert support team!' mod='blockcontact'}</a>{/if}
|
||||
</div>
|
||||
</div>
|
12
modules/blockcontact/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcontact</name>
|
||||
<displayName><![CDATA[Contact block]]></displayName>
|
||||
<version><![CDATA[1.3.3]]></version>
|
||||
<description><![CDATA[Allows you to add additional information about your store's customer service.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
12
modules/blockcontact/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcontact</name>
|
||||
<displayName><![CDATA[Bloc contact]]></displayName>
|
||||
<version><![CDATA[1.3.3]]></version>
|
||||
<description><![CDATA[Permet d'ajouter des informations supplémentaires concernant le service client]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
BIN
modules/blockcontact/images/bloc_contact_a_bg.png
Normal file
After Width: | Height: | Size: 208 B |
BIN
modules/blockcontact/images/block_contact_bg.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
modules/blockcontact/images/block_contact_pict_tel.png
Normal file
After Width: | Height: | Size: 381 B |
35
modules/blockcontact/images/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
BIN
modules/blockcontact/img/bloc_contact_a_bg.png
Normal file
After Width: | Height: | Size: 208 B |
BIN
modules/blockcontact/img/block_contact_bg.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
modules/blockcontact/img/block_contact_pict_tel.png
Normal file
After Width: | Height: | Size: 381 B |
35
modules/blockcontact/img/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
35
modules/blockcontact/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
BIN
modules/blockcontact/logo.gif
Normal file
After Width: | Height: | Size: 983 B |
BIN
modules/blockcontact/logo.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
32
modules/blockcontact/nav.tpl
Normal file
@ -0,0 +1,32 @@
|
||||
{*
|
||||
* 2007-2014 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-2014 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="contact-link">
|
||||
<a href="{$link->getPageLink('contact', true)|escape:'html':'UTF-8'}" title="{l s='Contact us' mod='blockcontact'}">{l s='Contact us' mod='blockcontact'}</a>
|
||||
</div>
|
||||
{if $telnumber}
|
||||
<span class="shop-phone">
|
||||
<i class="icon-phone"></i>{l s='Call us now:' mod='blockcontact'} <strong>{$telnumber}</strong>
|
||||
</span>
|
||||
{/if}
|
26
modules/blockcontact/translations/fr.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_df8f3e2cd8d1acbb2d1aa46a45045ec5'] = 'Bloc contact';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_318ed85b9852475f24127167815e85d9'] = 'Permet d\'ajouter des informations supplémentaires concernant le service client';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_90a613a116f4bd9390ff7379a114f8d7'] = 'Ce bloc affiche dans l\'en-tête votre numéro de téléphone ("Appelez-nous au") et un lien vers la page Contact ("Contactez-nous").';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_5f6e75192756d3ad45cff4a1ee0a45ba'] = 'Vous pouvez modifier les adresses e-mail de votre page "Contact" dans la page "Contacts" du menu "Clients".';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_ccffe09c1cd18f73ad1f76762fded097'] = 'Vous pouvez modifier les contacts de votre pied de page grâce au module "Bloc Informations de contact".';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_7551cf1a985728fa2798db32c2ff7887'] = 'Numéro de téléphone';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_52e878b67e9d94d25425231162ef5133'] = 'Renseignez ici les informations relatives à votre service clients.';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_02d4482d332e1aef3437cd61c9bcc624'] = 'Contactez-nous';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_75858d311c84e7ba706b69bea5c71d36'] = 'Notre service client est disponible 24h/24, 7j/7';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_673ae02fffb72f0fe68a66f096a01347'] = 'Tél. :';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_736c5a7e834b7021bfa97180fc453115'] = 'Contacter notre service client';
|
||||
$_MODULE['<{blockcontact}prestashop>nav_02d4482d332e1aef3437cd61c9bcc624'] = 'Contactez-nous';
|
||||
$_MODULE['<{blockcontact}prestashop>nav_320abee94a07e976991e4df0d4afb319'] = 'Appelez-nous au :';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_9cfc9b74983d504ec71db33967591249'] = 'Contactez-nous';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockcontact/translations/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
9
modules/blockcontact/upgrade/install-1.1.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_1($object)
|
||||
{
|
||||
return ($object->registerHook('displayNav'));
|
||||
}
|
@ -1 +0,0 @@
|
||||
Subproject commit 695c1cfe91796ccc0d2ee7876c602832eb614ca9
|
4
modules/blockcontactinfos/CHANGELOG.txt
Normal file
@ -0,0 +1,4 @@
|
||||
2014-04-22 18:57:06 +0200 // Changelog updated
|
||||
2014-03-24 11:43:28 +0100 / MO blockcontactinfos : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:01:54 +0100 // MO blockcontactinfos/ : ps_versions_compliancy added
|
||||
2014-03-20 14:22:32 +0100 Initial commit
|
37
modules/blockcontactinfos/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Contact information block
|
||||
|
||||
## About
|
||||
|
||||
This module will allow you to display your e-store\'s contact information in a customizable block.
|
||||
|
||||
## Contributing
|
||||
|
||||
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
|
||||
|
||||
### Requirements
|
||||
|
||||
Contributors **must** follow the following rules:
|
||||
|
||||
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
|
||||
* Do not update the module's version number.
|
||||
* Follow [the coding standards][1].
|
||||
|
||||
### Process in details
|
||||
|
||||
Contributors wishing to edit a module's files should follow the following process:
|
||||
|
||||
1. Create your GitHub account, if you do not have one already.
|
||||
2. Fork the blockcontactinfos project to your GitHub account.
|
||||
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
|
||||
4. Create a branch in your local clone of the module for your changes.
|
||||
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
|
||||
6. Push your changed branch to your fork in your GitHub account.
|
||||
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
|
||||
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
|
||||
|
||||
That's it: you have contributed to this open-source project! Congratulations!
|
||||
|
||||
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
|
||||
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
|
||||
[3]: https://help.github.com/articles/using-pull-requests
|
||||
|
156
modules/blockcontactinfos/blockcontactinfos.php
Normal file
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class Blockcontactinfos extends Module
|
||||
{
|
||||
protected static $contact_fields = array(
|
||||
'BLOCKCONTACTINFOS_COMPANY',
|
||||
'BLOCKCONTACTINFOS_ADDRESS',
|
||||
'BLOCKCONTACTINFOS_PHONE',
|
||||
'BLOCKCONTACTINFOS_EMAIL',
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockcontactinfos';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.2';
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Contact information block');
|
||||
$this->description = $this->l('This module will allow you to display your e-store\'s contact information in a customizable block.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
Configuration::updateValue('BLOCKCONTACTINFOS_COMPANY', Configuration::get('PS_SHOP_NAME'));
|
||||
Configuration::updateValue('BLOCKCONTACTINFOS_ADDRESS', trim(preg_replace('/ +/', ' ', Configuration::get('PS_SHOP_ADDR1').' '.Configuration::get('PS_SHOP_ADDR2')."\n".Configuration::get('PS_SHOP_CODE').' '.Configuration::get('PS_SHOP_CITY')."\n".Country::getNameById(Configuration::get('PS_LANG_DEFAULT'), Configuration::get('PS_SHOP_COUNTRY_ID')))));
|
||||
Configuration::updateValue('BLOCKCONTACTINFOS_PHONE', Configuration::get('PS_SHOP_PHONE'));
|
||||
Configuration::updateValue('BLOCKCONTACTINFOS_EMAIL', Configuration::get('PS_SHOP_EMAIL'));
|
||||
$this->_clearCache('blockcontactinfos.tpl');
|
||||
return (parent::install() && $this->registerHook('header') && $this->registerHook('footer'));
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
foreach (Blockcontactinfos::$contact_fields as $field)
|
||||
Configuration::deleteByName($field);
|
||||
return (parent::uninstall());
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$html = '';
|
||||
if (Tools::isSubmit('submitModule'))
|
||||
{
|
||||
foreach (Blockcontactinfos::$contact_fields as $field)
|
||||
Configuration::updateValue($field, Tools::getValue($field));
|
||||
$this->_clearCache('blockcontactinfos.tpl');
|
||||
$html = $this->displayConfirmation($this->l('Configuration updated'));
|
||||
}
|
||||
|
||||
return $html.$this->renderForm();
|
||||
}
|
||||
|
||||
public function hookHeader()
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockcontactinfos.css', 'all');
|
||||
}
|
||||
|
||||
public function hookFooter($params)
|
||||
{
|
||||
if (!$this->isCached('blockcontactinfos.tpl', $this->getCacheId()))
|
||||
foreach (Blockcontactinfos::$contact_fields as $field)
|
||||
$this->smarty->assign(strtolower($field), Configuration::get($field));
|
||||
return $this->display(__FILE__, 'blockcontactinfos.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Company name'),
|
||||
'name' => 'BLOCKCONTACTINFOS_COMPANY',
|
||||
),
|
||||
array(
|
||||
'type' => 'textarea',
|
||||
'label' => $this->l('Address'),
|
||||
'name' => 'BLOCKCONTACTINFOS_ADDRESS',
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Phone number'),
|
||||
'name' => 'BLOCKCONTACTINFOS_PHONE',
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Email'),
|
||||
'name' => 'BLOCKCONTACTINFOS_EMAIL',
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save')
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$helper->default_form_language = $lang->id;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
|
||||
$this->fields_form = array();
|
||||
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitModule';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => array(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id
|
||||
);
|
||||
foreach (Blockcontactinfos::$contact_fields as $field)
|
||||
$helper->tpl_vars['fields_value'][$field] = Tools::getValue($field, Configuration::get($field));
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
}
|
37
modules/blockcontactinfos/blockcontactinfos.tpl
Normal file
@ -0,0 +1,37 @@
|
||||
{*
|
||||
* 2007-2014 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-2014 PrestaShop SA
|
||||
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- MODULE Block contact infos -->
|
||||
<div id="block_contact_infos">
|
||||
<h4 class="title_block">{l s='Contact us' mod='blockcontactinfos'}</h4>
|
||||
<ul>
|
||||
{if $blockcontactinfos_company != ''}<li><strong>{$blockcontactinfos_company|escape:'html':'UTF-8'}</strong></li>{/if}
|
||||
{if $blockcontactinfos_address != ''}<li><pre>{$blockcontactinfos_address|escape:'html':'UTF-8'|nl2br}</pre></li>{/if}
|
||||
{if $blockcontactinfos_phone != ''}<li>{l s='Tel' mod='blockcontactinfos'} {$blockcontactinfos_phone|escape:'html':'UTF-8'}</li>{/if}
|
||||
{if $blockcontactinfos_email != ''}<li>{l s='Email:' mod='blockcontactinfos'} {mailto address=$blockcontactinfos_email|escape:'html':'UTF-8' encode="hex"}</li>{/if}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /MODULE Block contact infos -->
|
12
modules/blockcontactinfos/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcontactinfos</name>
|
||||
<displayName><![CDATA[Contact information block]]></displayName>
|
||||
<version><![CDATA[1.1.2]]></version>
|
||||
<description><![CDATA[This module will allow you to display your e-store's contact information in a customizable block.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
12
modules/blockcontactinfos/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcontactinfos</name>
|
||||
<displayName><![CDATA[Bloc informations de contact]]></displayName>
|
||||
<version><![CDATA[1.1.2]]></version>
|
||||
<description><![CDATA[Ajoute un bloc permettant d'afficher des informations sur les moyens de contacter la boutique]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
35
modules/blockcontactinfos/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
BIN
modules/blockcontactinfos/logo.gif
Normal file
After Width: | Height: | Size: 222 B |
BIN
modules/blockcontactinfos/logo.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
22
modules/blockcontactinfos/translations/fr.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_fc02586aa99596947b184a01f43fb4ae'] = 'Bloc informations de contact';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_86458ae1631be34a6fcbf1a4584f5abe'] = 'Ajoute un bloc permettant d\'afficher des informations sur les moyens de contacter la boutique';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_c281f92b77ba329f692077d23636f5c9'] = 'Nom de la société';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_1f8261d17452a959e013666c5df45e07'] = 'Numéro de téléphone';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_02d4482d332e1aef3437cd61c9bcc624'] = 'Contactez-nous';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_2e006b735fbd916d8ab26978ae6714d4'] = 'Tél. :';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_6a1e265f92087bb6dd18194833fe946b'] = 'E-mail :';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_80a11d2a54a677f6fadd9c041c0d6b98'] = 'Informations sur votre boutique';
|
||||
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_320abee94a07e976991e4df0d4afb319'] = 'Appelez-nous au :';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockcontactinfos/translations/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
10
modules/blockcontactinfos/upgrade/install-1.1.2.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_1_2($object)
|
||||
{
|
||||
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'configuration SET `name` = UPPER(`name`) WHERE `name` LIKE "BLOCKCONTACTINFOS\_%"');
|
||||
return true;
|
||||
}
|
@ -1 +0,0 @@
|
||||
Subproject commit 7c642daa7f654fc4cc9a29cd72bc25dcec27e4e8
|
3
modules/blockcurrencies/CHANGELOG.txt
Normal file
@ -0,0 +1,3 @@
|
||||
2014-04-22 18:57:08 +0200 // Changelog updated
|
||||
2014-03-24 17:47:06 +0100 / MO blockcurrencies : ps_versions_compliancy added
|
||||
2014-03-20 14:22:35 +0100 Initial commit
|
37
modules/blockcurrencies/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Currency block
|
||||
|
||||
## About
|
||||
|
||||
Adds a block allowing customers to choose their preferred shopping currency.
|
||||
|
||||
## Contributing
|
||||
|
||||
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
|
||||
|
||||
### Requirements
|
||||
|
||||
Contributors **must** follow the following rules:
|
||||
|
||||
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
|
||||
* Do not update the module's version number.
|
||||
* Follow [the coding standards][1].
|
||||
|
||||
### Process in details
|
||||
|
||||
Contributors wishing to edit a module's files should follow the following process:
|
||||
|
||||
1. Create your GitHub account, if you do not have one already.
|
||||
2. Fork the blockcurrencies project to your GitHub account.
|
||||
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
|
||||
4. Create a branch in your local clone of the module for your changes.
|
||||
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
|
||||
6. Push your changed branch to your fork in your GitHub account.
|
||||
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
|
||||
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
|
||||
|
||||
That's it: you have contributed to this open-source project! Congratulations!
|
||||
|
||||
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
|
||||
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
|
||||
[3]: https://help.github.com/articles/using-pull-requests
|
||||
|
60
modules/blockcurrencies/blockcurrencies.css
Normal file
@ -0,0 +1,60 @@
|
||||
/* block top currencies */
|
||||
#header_right #currencies_block_top {
|
||||
float:right;
|
||||
margin: 0 6px 0 0;
|
||||
padding: 2px 6px;
|
||||
-moz-border-bottom-right-radius: 3px;
|
||||
-moz-border-bottom-left-radius: 3px;
|
||||
-webkit-border-bottom-right-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
background: none repeat scroll 0 0 #000;
|
||||
}
|
||||
#header_right #currencies_block_top p {
|
||||
clear: left;
|
||||
padding-right:16px;
|
||||
font: 11px Arial,Verdana,sans-serif;
|
||||
color: #ccc;
|
||||
text-align: right;
|
||||
background: url("img/block_languages_top_p_bg.png") no-repeat scroll right 1px transparent;
|
||||
}
|
||||
#currencies_block_top ul#first-currencies li {
|
||||
margin-right: 3px
|
||||
}
|
||||
#currencies_block_top ul#first-currencies li.selected {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
/*languages with jquery*/
|
||||
#setCurrency {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
#setCurrency p {
|
||||
position: relative;
|
||||
top: 0;
|
||||
margin-left: 5px;
|
||||
padding: 0;
|
||||
}
|
||||
#setCurrency p img {
|
||||
padding-left: 5px;
|
||||
}
|
||||
#setCurrency .currencies_ul{
|
||||
display:none;
|
||||
z-index: 10000;
|
||||
padding:10px;
|
||||
list-style-type:none;
|
||||
}
|
||||
#setCurrency .currencies_ul_hover{
|
||||
display:block;
|
||||
z-index: 5000;
|
||||
position:absolute;
|
||||
right:3px;
|
||||
padding:5px 10px;
|
||||
height:auto;
|
||||
text-align: center;
|
||||
width: auto;
|
||||
background:#000000;
|
||||
}
|
||||
#setCurrency .currencies_ul_hover a {color:#fff;}
|
90
modules/blockcurrencies/blockcurrencies.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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 BlockCurrencies extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockcurrencies';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '0.3.2';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Currency block');
|
||||
$this->description = $this->l('Adds a block allowing customers to choose their preferred shopping currency.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install() && $this->registerHook('displayNav') && $this->registerHook('displayHeader');
|
||||
}
|
||||
|
||||
protected function _prepareHook($params)
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return false;
|
||||
|
||||
if (!Currency::isMultiCurrencyActivated())
|
||||
return false;
|
||||
|
||||
$this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns module content for header
|
||||
*
|
||||
* @param array $params Parameters
|
||||
* @return string Content
|
||||
*/
|
||||
public function hookDisplayTop($params)
|
||||
{
|
||||
if ($this->_prepareHook($params))
|
||||
return $this->display(__FILE__, 'blockcurrencies.tpl');
|
||||
}
|
||||
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
return $this->hookDisplayTop($params);
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
$this->context->controller->addCSS(($this->_path).'blockcurrencies.css', 'all');
|
||||
}
|
||||
}
|
||||
|
||||
|
63
modules/blockcurrencies/blockcurrencies.tpl
Normal file
@ -0,0 +1,63 @@
|
||||
{*
|
||||
* 2007-2014 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-2014 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- Block currencies module -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$("#setCurrency").mouseover(function(){
|
||||
$(this).addClass("countries_hover");
|
||||
$(".currencies_ul").addClass("currencies_ul_hover");
|
||||
});
|
||||
$("#setCurrency").mouseout(function(){
|
||||
$(this).removeClass("countries_hover");
|
||||
$(".currencies_ul").removeClass("currencies_ul_hover");
|
||||
});
|
||||
|
||||
$('ul#first-currencies li:not(.selected)').css('opacity', 0.3);
|
||||
$('ul#first-currencies li:not(.selected)').hover(function(){
|
||||
$(this).css('opacity', 1);
|
||||
}, function(){
|
||||
$(this).css('opacity', 0.3);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="currencies_block_top">
|
||||
<form id="setCurrency" action="{$request_uri}" method="post">
|
||||
<p>
|
||||
<input type="hidden" name="id_currency" id="id_currency" value=""/>
|
||||
<input type="hidden" name="SubmitCurrency" value="" />
|
||||
{l s='Currency' mod='blockcurrencies'} : {$blockcurrencies_sign}
|
||||
</p>
|
||||
<ul id="first-currencies" class="currencies_ul">
|
||||
{foreach from=$currencies key=k item=f_currency}
|
||||
<li {if $cookie->id_currency == $f_currency.id_currency}class="selected"{/if}>
|
||||
<a href="javascript:setCurrency({$f_currency.id_currency});" title="{$f_currency.name}" rel="nofollow">{$f_currency.sign}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /Block currencies module -->
|
12
modules/blockcurrencies/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcurrencies</name>
|
||||
<displayName><![CDATA[Currency block]]></displayName>
|
||||
<version><![CDATA[0.3.2]]></version>
|
||||
<description><![CDATA[Adds a block allowing customers to choose their preferred shopping currency.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
12
modules/blockcurrencies/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcurrencies</name>
|
||||
<displayName><![CDATA[Bloc devises]]></displayName>
|
||||
<version><![CDATA[0.3.2]]></version>
|
||||
<description><![CDATA[Ajoute un bloc permettant au client de choisir sa devise]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
BIN
modules/blockcurrencies/img/block_languages_top_p_bg.png
Normal file
After Width: | Height: | Size: 151 B |
35
modules/blockcurrencies/img/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
35
modules/blockcurrencies/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
BIN
modules/blockcurrencies/logo.gif
Normal file
After Width: | Height: | Size: 383 B |
BIN
modules/blockcurrencies/logo.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
12
modules/blockcurrencies/translations/fr.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_f7a31ae8f776597d4282bd3b1013f08b'] = 'Bloc devises';
|
||||
$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_80ed40ee905b534ee85ce49a54380107'] = 'Ajoute un bloc permettant au client de choisir sa devise';
|
||||
$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_386c339d37e737a436499d423a77df0c'] = 'Devise';
|
||||
$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_98c4447ec6e8519bcddd95c02e5be814'] = '%s (%s)';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockcurrencies/translations/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
9
modules/blockcurrencies/upgrade/install-0.2.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_0_2($object)
|
||||
{
|
||||
return ($object->registerHook('displayNav'));
|
||||
}
|
@ -1 +0,0 @@
|
||||
Subproject commit 6328afe503ecf29a21d7952067fb4be9f73ba6be
|
4
modules/blockcustomerprivacy/CHANGELOG.txt
Normal file
@ -0,0 +1,4 @@
|
||||
2014-04-22 18:57:11 +0200 // Changelog updated
|
||||
2014-03-24 11:43:28 +0100 / MO blockcustomerprivacy : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:02:09 +0100 // MO blockcustomerprivacy/ : ps_versions_compliancy added
|
||||
2014-03-20 14:22:37 +0100 Initial commit
|
37
modules/blockcustomerprivacy/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Customer data privacy block
|
||||
|
||||
## About
|
||||
|
||||
Adds a block displaying a message about a customer\'s privacy data.
|
||||
|
||||
## Contributing
|
||||
|
||||
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
|
||||
|
||||
### Requirements
|
||||
|
||||
Contributors **must** follow the following rules:
|
||||
|
||||
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
|
||||
* Do not update the module's version number.
|
||||
* Follow [the coding standards][1].
|
||||
|
||||
### Process in details
|
||||
|
||||
Contributors wishing to edit a module's files should follow the following process:
|
||||
|
||||
1. Create your GitHub account, if you do not have one already.
|
||||
2. Fork the blockcustomerprivacy project to your GitHub account.
|
||||
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
|
||||
4. Create a branch in your local clone of the module for your changes.
|
||||
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
|
||||
6. Push your changed branch to your fork in your GitHub account.
|
||||
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
|
||||
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
|
||||
|
||||
That's it: you have contributed to this open-source project! Congratulations!
|
||||
|
||||
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
|
||||
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
|
||||
[3]: https://help.github.com/articles/using-pull-requests
|
||||
|
BIN
modules/blockcustomerprivacy/blockcustomerprivacy.jpg
Normal file
After Width: | Height: | Size: 1.9 KiB |
176
modules/blockcustomerprivacy/blockcustomerprivacy.php
Normal file
@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class Blockcustomerprivacy extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockcustomerprivacy';
|
||||
if (version_compare(_PS_VERSION_, '1.4.0.0') >= 0)
|
||||
$this->tab = 'front_office_features';
|
||||
else
|
||||
$this->tab = 'Blocks';
|
||||
$this->version = '1.1.2';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Customer data privacy block');
|
||||
$this->description = $this->l('Adds a block displaying a message about a customer\'s privacy data.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
$return = (parent::install() && $this->registerHook('createAccountForm') && $this->registerHook('header') && $this->registerHook('actionBeforeSubmitAccount'));
|
||||
Configuration::updateValue('CUSTPRIV_MESSAGE', array($this->context->language->id =>
|
||||
$this->l('The personal data you provide is used to answer queries, process orders or allow access to specific information.').' '.
|
||||
$this->l('You have the right to modify and delete all the personal information found in the "My Account" page.')
|
||||
));
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$id_lang_default = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
$languages = Language::getLanguages(false);
|
||||
$iso = $this->context->language->iso_code;
|
||||
|
||||
$output = '';
|
||||
if (Tools::isSubmit('submitCustPrivMess'))
|
||||
{
|
||||
$message_trads = array();
|
||||
foreach ($_POST as $key => $value)
|
||||
if (preg_match('/custpriv_message_/i', $key))
|
||||
{
|
||||
$id_lang = preg_split('/custpriv_message_/i', $key);
|
||||
$message_trads[(int)$id_lang[1]] = $value;
|
||||
}
|
||||
Configuration::updateValue('CUSTPRIV_MESSAGE', $message_trads, true);
|
||||
$this->_clearCache('blockcustomerprivacy.tpl');
|
||||
$output .= $this->displayConfirmation($this->l('Configuration updated'));
|
||||
}
|
||||
|
||||
return $output.$this->renderForm();
|
||||
}
|
||||
|
||||
public function checkConfig()
|
||||
{
|
||||
if (!$this->active)
|
||||
return false;
|
||||
|
||||
$message = Configuration::get('CUSTPRIV_MESSAGE', $this->context->language->id);
|
||||
if (empty($message))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
{
|
||||
if (!$this->checkConfig())
|
||||
return;
|
||||
$this->context->controller->addJS($this->_path.'blockcustomerprivacy.js');
|
||||
}
|
||||
|
||||
public function hookActionBeforeSubmitAccount($params)
|
||||
{
|
||||
if (!$this->checkConfig())
|
||||
return;
|
||||
|
||||
if (!Tools::getValue('customer_privacy'))
|
||||
$this->context->controller->errors[] = $this->l('If you agree to the terms in the Customer Data Privacy message, please click the check box below.');
|
||||
}
|
||||
|
||||
public function hookCreateAccountForm($params)
|
||||
{
|
||||
if (!$this->checkConfig())
|
||||
return;
|
||||
if (!$this->isCached('blockcustomerprivacy.tpl', $this->getCacheId()))
|
||||
$this->smarty->assign('privacy_message', Configuration::get('CUSTPRIV_MESSAGE', $this->context->language->id));
|
||||
|
||||
return $this->display(__FILE__, 'blockcustomerprivacy.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'textarea',
|
||||
'lang' => true,
|
||||
'autoload_rte' => true,
|
||||
'label' => $this->l('Customer data privacy message:'),
|
||||
'name' => 'custpriv_message',
|
||||
'desc' => $this->l('The customer data privacy message will be displayed in the account creation form.').'<br>'.$this->l('Tip: If the customer privacy message is too long to be written directly in the form, you can add a link to one of your pages. This can easily be created via the "CMS" page under the "Preferences" menu.')
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$helper->default_form_language = $lang->id;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
|
||||
$this->fields_form = array();
|
||||
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitCustPrivMess';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
$return = array();
|
||||
foreach (Language::getLanguages(false) as $lang)
|
||||
$return['custpriv_message'][(int)$lang['id_lang']] = Tools::getValue('custpriv_message_'.(int)$lang['id_lang'], Configuration::get('CUSTPRIV_MESSAGE', (int)$lang['id_lang']));
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
32
modules/blockcustomerprivacy/blockcustomerprivacy.tpl
Normal file
@ -0,0 +1,32 @@
|
||||
{* 2007-2014 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-2014 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 class="error_customerprivacy" style="color:red;"></div>
|
||||
<fieldset class="account_creation customerprivacy">
|
||||
<h3>{l s='Customer data privacy' mod='blockcustomerprivacy'}</h3>
|
||||
<p class="required">
|
||||
<input type="checkbox" value="1" id="customer_privacy" name="customer_privacy" style="float:left;margin: 15px;" autocomplete="off"/>
|
||||
</p>
|
||||
<label for="customer_privacy">{$privacy_message}</label>
|
||||
</fieldset>
|
12
modules/blockcustomerprivacy/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcustomerprivacy</name>
|
||||
<displayName><![CDATA[Customer data privacy block]]></displayName>
|
||||
<version><![CDATA[1.1.2]]></version>
|
||||
<description><![CDATA[Adds a block displaying a message about a customer's privacy data.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
12
modules/blockcustomerprivacy/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockcustomerprivacy</name>
|
||||
<displayName><![CDATA[Bloc confidentialité des données clients]]></displayName>
|
||||
<version><![CDATA[1.1.2]]></version>
|
||||
<description><![CDATA[Ajoute un bloc qui affiche un message concernant la confidentialité des données clients.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
35
modules/blockcustomerprivacy/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
BIN
modules/blockcustomerprivacy/logo.gif
Normal file
After Width: | Height: | Size: 1023 B |
BIN
modules/blockcustomerprivacy/logo.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
20
modules/blockcustomerprivacy/translations/fr.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_e0de5a06213f21c55ca3283c009e0907'] = 'Bloc confidentialité des données clients';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_f192f208f0bc97af4c5213eee3e78793'] = 'Ajoute un bloc qui affiche un message concernant la confidentialité des données clients.';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_d71315851e7e67cbacf5101c5c4ab83d'] = 'Les informations personnelles que nous collectons sont destinées à mieux répondre à vos demandes et traiter vos commandes.';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_d847e75da5489bbc525b6f6548d7f50a'] = 'Vous disposez à tout moment d’un droit d’accès, de modification et de suppression de vos informations personnelles que vous pouvez exercer via la page "Mon Compte" de ce site internet.';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_fb32badede7c8613fddb8502d847c18b'] = 'Veuillez accepter nos conditions concernant la confidentialité des données clients, en cochant la case ci-dessous.';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_aafe06caae02aee29775402368a6d22c'] = 'Message concernant la confidentialité des données clients';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_03e1a999dcdb904300ee1b1e767c83c9'] = 'Le message sera affiché sur le formulaire de création de compte.';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_b51d73fb490ad1245fa9b87042bbbbb7'] = 'Astuce : Si le message est trop long pour être affiché directement dans le formulaire, vous pouvez ajouter un lien vers l\'une de vos pages CMS et écrire le message sur cette page. Vous pouvez créer facilement des pages CMS via le menu "CMS" sous "Préférences".';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{blockcustomerprivacy}prestashop>blockcustomerprivacy_fb0440f9ca32a8b49eded51b09e70821'] = 'Confidentialité des données clients';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockcustomerprivacy/translations/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
@ -1 +0,0 @@
|
||||
Subproject commit 8b73a13b93e5f27fde063df9250e89b495452bec
|
5
modules/blocklanguages/CHANGELOG.txt
Normal file
@ -0,0 +1,5 @@
|
||||
2014-04-22 18:57:15 +0200 // Changelog updated
|
||||
2014-03-25 11:08:42 +0100 // Forgotten apostrophe
|
||||
2014-03-24 11:43:28 +0100 / MO blocklanguages : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:02:24 +0100 / MO blocklanguages : ps_versions_compliancy added
|
||||
2014-03-20 14:22:43 +0100 Initial commit
|
37
modules/blocklanguages/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Language block
|
||||
|
||||
## About
|
||||
|
||||
Adds a block allowing customers to select a language for your store\'s content.
|
||||
|
||||
## Contributing
|
||||
|
||||
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
|
||||
|
||||
### Requirements
|
||||
|
||||
Contributors **must** follow the following rules:
|
||||
|
||||
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
|
||||
* Do not update the module's version number.
|
||||
* Follow [the coding standards][1].
|
||||
|
||||
### Process in details
|
||||
|
||||
Contributors wishing to edit a module's files should follow the following process:
|
||||
|
||||
1. Create your GitHub account, if you do not have one already.
|
||||
2. Fork the blocklanguages project to your GitHub account.
|
||||
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
|
||||
4. Create a branch in your local clone of the module for your changes.
|
||||
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
|
||||
6. Push your changed branch to your fork in your GitHub account.
|
||||
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
|
||||
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
|
||||
|
||||
That's it: you have contributed to this open-source project! Congratulations!
|
||||
|
||||
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
|
||||
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
|
||||
[3]: https://help.github.com/articles/using-pull-requests
|
||||
|
58
modules/blocklanguages/blocklanguages.css
Normal file
@ -0,0 +1,58 @@
|
||||
/* block top languages */
|
||||
#header_right #languages_block_top {
|
||||
float:right;
|
||||
margin: 0;
|
||||
padding:2px 6px 1px 6px;
|
||||
-moz-border-bottom-right-radius: 3px;
|
||||
-moz-border-bottom-left-radius: 3px;
|
||||
-webkit-border-bottom-right-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
background: none repeat scroll 0 0 #000;
|
||||
}
|
||||
#header_right #languages_block_top p {
|
||||
clear: left;
|
||||
padding-right:20px;
|
||||
font: 11px Arial,Verdana,sans-serif;
|
||||
color: #ccc;
|
||||
text-align: right;
|
||||
background: url("img/block_languages_top_p_bg.png") no-repeat scroll right 1px transparent;
|
||||
}
|
||||
#languages_block_top ul#first-languages li {
|
||||
float: left;
|
||||
margin-right: 3px
|
||||
}
|
||||
#languages_block_top ul#first-languages li.selected_language {
|
||||
float: left;
|
||||
}
|
||||
/*languages with jquery*/
|
||||
#countries {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
#countries p {
|
||||
position: relative;
|
||||
top: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#countries p img {
|
||||
padding-left: 5px;
|
||||
}
|
||||
#countries .countries_ul{
|
||||
display:none;
|
||||
z-index: 10000;
|
||||
padding:10px;
|
||||
list-style-type:none;
|
||||
}
|
||||
#countries .countries_ul_hover{
|
||||
display:block;
|
||||
z-index: 5000;
|
||||
position:absolute;
|
||||
right:6px;
|
||||
padding:5px 10px;
|
||||
height:auto;
|
||||
width:20px;
|
||||
background:#000000;
|
||||
}
|
117
modules/blocklanguages/blocklanguages.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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 BlockLanguages extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocklanguages';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.3.3';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Language selector block');
|
||||
$this->description = $this->l('Adds a block allowing customers to select a language for your store\'s content.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() && $this->registerHook('displayNav') && $this->registerHook('displayHeader'));
|
||||
}
|
||||
|
||||
protected function _prepareHook($params)
|
||||
{
|
||||
$languages = Language::getLanguages(true, $this->context->shop->id);
|
||||
if (!count($languages))
|
||||
return false;
|
||||
$link = new Link();
|
||||
|
||||
if ((int)Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
{
|
||||
$default_rewrite = array();
|
||||
if (Dispatcher::getInstance()->getController() == 'product' && ($id_product = (int)Tools::getValue('id_product')))
|
||||
{
|
||||
$rewrite_infos = Product::getUrlRewriteInformations((int)$id_product);
|
||||
foreach ($rewrite_infos as $infos)
|
||||
$default_rewrite[$infos['id_lang']] = $link->getProductLink((int)$id_product, $infos['link_rewrite'], $infos['category_rewrite'], $infos['ean13'], (int)$infos['id_lang']);
|
||||
}
|
||||
|
||||
if (Dispatcher::getInstance()->getController() == 'category' && ($id_category = (int)Tools::getValue('id_category')))
|
||||
{
|
||||
$rewrite_infos = Category::getUrlRewriteInformations((int)$id_category);
|
||||
foreach ($rewrite_infos as $infos)
|
||||
$default_rewrite[$infos['id_lang']] = $link->getCategoryLink((int)$id_category, $infos['link_rewrite'], $infos['id_lang']);
|
||||
}
|
||||
|
||||
if (Dispatcher::getInstance()->getController() == 'cms' && (($id_cms = (int)Tools::getValue('id_cms')) || ($id_cms_category = (int)Tools::getValue('id_cms_category'))))
|
||||
{
|
||||
$rewrite_infos = (isset($id_cms) && !isset($id_cms_category)) ? CMS::getUrlRewriteInformations($id_cms) : CMSCategory::getUrlRewriteInformations($id_cms_category);
|
||||
foreach ($rewrite_infos as $infos)
|
||||
{
|
||||
$arr_link = (isset($id_cms) && !isset($id_cms_category)) ?
|
||||
$link->getCMSLink($id_cms, $infos['link_rewrite'], null, $infos['id_lang']) :
|
||||
$link->getCMSCategoryLink($id_cms_category, $infos['link_rewrite'], $infos['id_lang']);
|
||||
$default_rewrite[$infos['id_lang']] = $arr_link;
|
||||
}
|
||||
}
|
||||
$this->smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns module content for header
|
||||
*
|
||||
* @param array $params Parameters
|
||||
* @return string Content
|
||||
*/
|
||||
public function hookDisplayTop($params)
|
||||
{
|
||||
if (!$this->_prepareHook($params))
|
||||
return;
|
||||
return $this->display(__FILE__, 'blocklanguages.tpl');
|
||||
}
|
||||
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
|
||||
return $this->hookDisplayTop($params);
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path.'blocklanguages.css', 'all');
|
||||
}
|
||||
}
|
||||
|
||||
|
74
modules/blocklanguages/blocklanguages.tpl
Normal file
@ -0,0 +1,74 @@
|
||||
{*
|
||||
* 2007-2014 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-2014 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- Block languages module -->
|
||||
{if count($languages) > 1}
|
||||
<div id="languages_block_top">
|
||||
<div id="countries">
|
||||
{* @todo fix display current languages, removing the first foreach loop *}
|
||||
{foreach from=$languages key=k item=language name="languages"}
|
||||
{if $language.iso_code == $lang_iso}
|
||||
<p class="selected_language">
|
||||
<img src="{$img_lang_dir}{$language.id_lang}.jpg" alt="{$language.iso_code}" width="16" height="11" />
|
||||
</p>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<ul id="first-languages" class="countries_ul">
|
||||
{foreach from=$languages key=k item=language name="languages"}
|
||||
<li {if $language.iso_code == $lang_iso}class="selected_language"{/if}>
|
||||
{if $language.iso_code != $lang_iso}
|
||||
{assign var=indice_lang value=$language.id_lang}
|
||||
{if isset($lang_rewrite_urls.$indice_lang)}
|
||||
<a href="{$lang_rewrite_urls.$indice_lang|escape:htmlall}" title="{$language.name}">
|
||||
{else}
|
||||
<a href="{$link->getLanguageLink($language.id_lang)|escape:htmlall}" title="{$language.name}">
|
||||
|
||||
{/if}
|
||||
{/if}
|
||||
<img src="{$img_lang_dir}{$language.id_lang}.jpg" alt="{$language.iso_code}" width="16" height="11" />
|
||||
{if $language.iso_code != $lang_iso}
|
||||
</a>
|
||||
{/if}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$("#countries").mouseover(function(){
|
||||
$(this).addClass("countries_hover");
|
||||
$(".countries_ul").addClass("countries_ul_hover");
|
||||
});
|
||||
$("#countries").mouseout(function(){
|
||||
$(this).removeClass("countries_hover");
|
||||
$(".countries_ul").removeClass("countries_ul_hover");
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
<!-- /Block languages module -->
|
12
modules/blocklanguages/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocklanguages</name>
|
||||
<displayName><![CDATA[Language block]]></displayName>
|
||||
<version><![CDATA[1.3.3]]></version>
|
||||
<description><![CDATA[Adds a block allowing customers to select a language for your stores content.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
12
modules/blocklanguages/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocklanguages</name>
|
||||
<displayName><![CDATA[Bloc sélecteur de langue]]></displayName>
|
||||
<version><![CDATA[1.3.3]]></version>
|
||||
<description><![CDATA[Ajoute un bloc permettant à vos clients de sélectionner la langue de votre boutique.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
BIN
modules/blocklanguages/img/block_languages_top_p_bg.png
Normal file
After Width: | Height: | Size: 151 B |
35
modules/blocklanguages/img/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
35
modules/blocklanguages/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
BIN
modules/blocklanguages/logo.gif
Normal file
After Width: | Height: | Size: 616 B |
BIN
modules/blocklanguages/logo.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
10
modules/blocklanguages/translations/fr.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blocklanguages}prestashop>blocklanguages_d33f69bfa67e20063a8905c923d9cf59'] = 'Bloc sélecteur de langue';
|
||||
$_MODULE['<{blocklanguages}prestashop>blocklanguages_5bc2cbadb5e09b5ef9b9d1724072c4f9'] = 'Ajoute un bloc permettant à vos clients de sélectionner la langue de votre boutique.';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blocklanguages/translations/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
9
modules/blocklanguages/upgrade/install-1.2.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_2($object)
|
||||
{
|
||||
return ($object->registerHook('displayNav'));
|
||||
}
|