module suite
@ -1 +0,0 @@
|
||||
Subproject commit 8d38b1eecc56ccf8187c32a3610c194ad50d50d2
|
4
modules/blockpaymentlogo/CHANGELOG.txt
Normal file
@ -0,0 +1,4 @@
|
||||
2014-04-22 18:57:32 +0200 // Changelog updated
|
||||
2014-03-24 11:43:28 +0100 / MO blockpaymentlogo : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:03:15 +0100 / MO blockpaymentlogo : ps_versions_compliancy added
|
||||
2014-03-20 14:23:14 +0100 Initial commit
|
37
modules/blockpaymentlogo/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Payment logos block.
|
||||
|
||||
## About
|
||||
|
||||
Adds a block which displays all of your payment logos.
|
||||
|
||||
## 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 blockpaymentlogo 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
|
||||
|
178
modules/blockpaymentlogo/blockpaymentlogo.php
Normal file
@ -0,0 +1,178 @@
|
||||
<?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 BlockPaymentLogo extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockpaymentlogo';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '0.3.3';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Payment logos block');
|
||||
$this->description = $this->l('Adds a block which displays all of your payment logos.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', 0);
|
||||
return (parent::install() && $this->registerHook('header') && $this->registerHook('leftColumn'));
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
Configuration::deleteByName('PS_PAYMENT_LOGO_CMS_ID');
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$html = '';
|
||||
|
||||
if (Tools::isSubmit('submitConfiguration'))
|
||||
if (Validate::isUnsignedInt(Tools::getValue('PS_PAYMENT_LOGO_CMS_ID')))
|
||||
{
|
||||
Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', (int)(Tools::getValue('PS_PAYMENT_LOGO_CMS_ID')));
|
||||
$this->_clearCache('blockpaymentlogo.tpl');
|
||||
$html .= $this->displayConfirmation($this->l('The settings have been updated.'));
|
||||
}
|
||||
|
||||
$cmss = CMS::listCms($this->context->language->id);
|
||||
|
||||
if (!count($cmss))
|
||||
$html .= $this->displayError($this->l('No CMS page is available.'));
|
||||
else
|
||||
$html .= $this->renderForm();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns module content
|
||||
*
|
||||
* @param array $params Parameters
|
||||
* @return string Content
|
||||
*/
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
|
||||
if (!$this->isCached('blockpaymentlogo.tpl', $this->getCacheId()))
|
||||
{
|
||||
if (!Configuration::get('PS_PAYMENT_LOGO_CMS_ID'))
|
||||
return;
|
||||
$cms = new CMS(Configuration::get('PS_PAYMENT_LOGO_CMS_ID'), $this->context->language->id);
|
||||
if (!Validate::isLoadedObject($cms))
|
||||
return;
|
||||
$this->smarty->assign('cms_payement_logo', $cms);
|
||||
}
|
||||
|
||||
return $this->display(__FILE__, 'blockpaymentlogo.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
return $this->hookLeftColumn($params);
|
||||
}
|
||||
|
||||
public function hookFooter($params)
|
||||
{
|
||||
return $this->hookLeftColumn($params);
|
||||
}
|
||||
public function hookHeader($params)
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
$this->context->controller->addCSS(($this->_path).'blockpaymentlogo.css', 'all');
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Destination page for the block\'s link'),
|
||||
'name' => 'PS_PAYMENT_LOGO_CMS_ID',
|
||||
'required' => false,
|
||||
'default_value' => (int)$this->context->country->id,
|
||||
'options' => array(
|
||||
'query' => CMS::listCms($this->context->language->id),
|
||||
'id' => 'id_cms',
|
||||
'name' => 'meta_title'
|
||||
)
|
||||
),
|
||||
),
|
||||
'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;
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitConfiguration';
|
||||
$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(
|
||||
'PS_PAYMENT_LOGO_CMS_ID' => Tools::getValue('PS_PAYMENT_LOGO_CMS_ID', Configuration::get('PS_PAYMENT_LOGO_CMS_ID')),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
34
modules/blockpaymentlogo/blockpaymentlogo.tpl
Normal file
@ -0,0 +1,34 @@
|
||||
{*
|
||||
* 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 payment logo module -->
|
||||
<div id="paiement_logo_block_left" class="paiement_logo_block">
|
||||
<a href="{$link->getCMSLink($cms_payement_logo)|escape:'html'}">
|
||||
<img src="{$img_dir}logo_paiement_visa.jpg" alt="visa" width="33" height="21" />
|
||||
<img src="{$img_dir}logo_paiement_mastercard.jpg" alt="mastercard" width="32" height="21" />
|
||||
<img src="{$img_dir}logo_paiement_paypal.jpg" alt="paypal" width="61" height="21" />
|
||||
</a>
|
||||
</div>
|
||||
<!-- /Block payment logo module -->
|
12
modules/blockpaymentlogo/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockpaymentlogo</name>
|
||||
<displayName><![CDATA[Payment logos block.]]></displayName>
|
||||
<version><![CDATA[0.3.3]]></version>
|
||||
<description><![CDATA[Adds a block which displays all of your payment logos.]]></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/blockpaymentlogo/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockpaymentlogo</name>
|
||||
<displayName><![CDATA[Bloc des logos de paiement]]></displayName>
|
||||
<version><![CDATA[0.3.3]]></version>
|
||||
<description><![CDATA[Ajoute un bloc qui affiche tous vos logos de paiement.]]></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/blockpaymentlogo/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/blockpaymentlogo/logo.gif
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
modules/blockpaymentlogo/logo.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
15
modules/blockpaymentlogo/translations/fr.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_eaaf494f0c90a2707d768a9df605e94b'] = 'Bloc des logos de paiement';
|
||||
$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_3fd11fa0ede1bd0ace9b3fcdbf6a71c9'] = 'Ajoute un bloc qui affiche tous vos logos de paiement.';
|
||||
$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_efc226b17e0532afff43be870bff0de7'] = 'Paramètres mis à jour';
|
||||
$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_5c5e5371da7ab2c28d1af066a1a1cc0d'] = 'Aucune page CMS n\'est disponible';
|
||||
$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_829cb250498661a9f98a58dc670a9675'] = 'Page de destination pour le lien du bloc';
|
||||
$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockpaymentlogo/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 6c1b5ec72e0c1d2f29960ac9d025af6a48caf519
|
4
modules/blockpermanentlinks/CHANGELOG.txt
Normal file
@ -0,0 +1,4 @@
|
||||
2014-04-22 18:57:34 +0200 // Changelog updated
|
||||
2014-03-24 11:43:28 +0100 / MO blockpermanentlinks : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:03:21 +0100 / MO blockpermanentlinks : ps_versions_compliancy added
|
||||
2014-03-20 14:23:25 +0100 Initial commit
|
37
modules/blockpermanentlinks/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Permanent links block
|
||||
|
||||
## About
|
||||
|
||||
Adds a block which displays permanent links such as sitemap, contact, etc.
|
||||
|
||||
## 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 blockpermanentlinks 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
|
||||
|
44
modules/blockpermanentlinks/blockpermanentlinks-footer.tpl
Normal file
@ -0,0 +1,44 @@
|
||||
{*
|
||||
* 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 permanent links module -->
|
||||
<div id="permanent_links">
|
||||
<!-- Sitemap -->
|
||||
<div class="sitemap">
|
||||
<a href="{$link->getPageLink('sitemap')|escape:'html'}"><img src="{$img_dir}icon/sitemap.gif" alt="{l s='Sitemap' mod='blockpermanentlinks'}"/></a>
|
||||
<a href="{$link->getPageLink('sitemap')|escape:'html'}" title="{l s='Sitemap' mod='blockpermanentlinks'}">{l s='Sitemap' mod='blockpermanentlinks'}</a>
|
||||
</div>
|
||||
<!-- Contact -->
|
||||
<div class="contact">
|
||||
<a href="{$link->getPageLink('contact', true)|escape:'html'}"><img src="{$img_dir}icon/contact.gif" alt="{l s='Contact' mod='blockpermanentlinks'}"/></a>
|
||||
<a href="{$link->getPageLink('contact', true)|escape:'html'}" title="{l s='Contact' mod='blockpermanentlinks'}">{l s='Contact' mod='blockpermanentlinks'}</a>
|
||||
</div>
|
||||
<!-- Bookmark -->
|
||||
<div class="add_bookmark">
|
||||
<script type="text/javascript">
|
||||
writeBookmarkLink('{$come_from}', '{$shop_name|addslashes|addslashes}', '{l s='Bookmark this page.' mod='blockpermanentlinks' js=1}', '{$img_dir}icon/star.gif');</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Block permanent links module -->
|
34
modules/blockpermanentlinks/blockpermanentlinks-header.tpl
Normal file
@ -0,0 +1,34 @@
|
||||
{*
|
||||
* 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 permanent links module HEADER -->
|
||||
<ul id="header_links">
|
||||
<li id="header_link_contact"><a href="{$link->getPageLink('contact', true)|escape:'html'}" title="{l s='contact' mod='blockpermanentlinks'}">{l s='contact' mod='blockpermanentlinks'}</a></li>
|
||||
<li id="header_link_sitemap"><a href="{$link->getPageLink('sitemap')|escape:'html'}" title="{l s='sitemap' mod='blockpermanentlinks'}">{l s='sitemap' mod='blockpermanentlinks'}</a></li>
|
||||
<li id="header_link_bookmark">
|
||||
<script type="text/javascript">writeBookmarkLink('{$come_from}', '{$meta_title|addslashes|addslashes}', '{l s='bookmark' mod='blockpermanentlinks' js=1}');</script>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- /Block permanent links module HEADER -->
|
35
modules/blockpermanentlinks/blockpermanentlinks.css
Normal file
@ -0,0 +1,35 @@
|
||||
/* block top links */
|
||||
ul#header_links {
|
||||
list-style-type: none;
|
||||
float: right;
|
||||
margin-top:5px
|
||||
}
|
||||
#header_links li {
|
||||
float: left;
|
||||
padding: 0 8px;
|
||||
border-left:1px solid #333;
|
||||
line-height:11px;
|
||||
}
|
||||
#header_links li:first-child {border:none;}
|
||||
#header_links a {text-decoration: none}
|
||||
#header_links a:hover {text-decoration:underline}
|
||||
|
||||
/*block permanent links right and left columns*/
|
||||
#permanent_links div {border-bottom: 1px dotted #eee}
|
||||
#permanent_links div a {
|
||||
display: block;
|
||||
padding: 7px 11px 5px 22px;
|
||||
color: #333;
|
||||
background:url(img/arrow_right_2.png) no-repeat 10px 10px;
|
||||
}
|
||||
|
||||
/* block footer links */
|
||||
ul#footer_links{
|
||||
clear:both;
|
||||
text-align: center;
|
||||
padding-bottom:6px
|
||||
}
|
||||
ul#footer_links li{
|
||||
display: inline;
|
||||
padding:0 10px
|
||||
}
|
95
modules/blockpermanentlinks/blockpermanentlinks.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?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 BlockPermanentLinks extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockpermanentlinks';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '0.2.1';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Permanent links block');
|
||||
$this->description = $this->l('Adds a block which displays permanent links such as sitemap, contact, etc.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() && $this->registerHook('top') && $this->registerHook('header'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns module content for header
|
||||
*
|
||||
* @param array $params Parameters
|
||||
* @return string Content
|
||||
*/
|
||||
public function hookTop($params)
|
||||
{
|
||||
return $this->display(__FILE__, 'blockpermanentlinks-header.tpl', $this->getCacheId('blockpermanentlinks-header'));
|
||||
}
|
||||
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
return $this->hookTop($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns module content for left column
|
||||
*
|
||||
* @param array $params Parameters
|
||||
* @return string Content
|
||||
*/
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
return $this->display(__FILE__, 'blockpermanentlinks.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
return $this->hookLeftColumn($params);
|
||||
}
|
||||
|
||||
public function hookFooter($params)
|
||||
{
|
||||
return $this->display(__FILE__, 'blockpermanentlinks-footer.tpl', $this->getCacheId('blockpermanentlinks-footer'));
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockpermanentlinks.css', 'all');
|
||||
}
|
||||
}
|
||||
|
||||
|
42
modules/blockpermanentlinks/blockpermanentlinks.tpl
Normal file
@ -0,0 +1,42 @@
|
||||
{*
|
||||
* 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 permanent links module -->
|
||||
<div id="permanent_links">
|
||||
<!-- Sitemap -->
|
||||
<div class="sitemap">
|
||||
<a href="{$link->getPageLink('sitemap')|escape:'html'}" title="{l s='Shop sitemap' mod='blockpermanentlinks'}">{l s='Sitemap' mod='blockpermanentlinks'}</a>
|
||||
</div>
|
||||
<!-- Contact -->
|
||||
<div class="contact">
|
||||
<a href="{$link->getPageLink('contact', true)|escape:'html'}" title="{l s='Contact form' mod='blockpermanentlinks'}">{l s='Contact' mod='blockpermanentlinks'}</a>
|
||||
</div>
|
||||
<!-- Bookmark -->
|
||||
<div class="add_bookmark" style="height:30px;">
|
||||
<script type="text/javascript">
|
||||
writeBookmarkLink('{$come_from}', '{$shop_name|addslashes|addslashes}', '{l s='Bookmark this page' mod='blockpermanentlinks' js=1}');</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Block permanent links module -->
|
12
modules/blockpermanentlinks/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockpermanentlinks</name>
|
||||
<displayName><![CDATA[Permanent links block]]></displayName>
|
||||
<version><![CDATA[0.2.1]]></version>
|
||||
<description><![CDATA[Adds a block which displays permanent links such as sitemap, contact, etc.]]></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/blockpermanentlinks/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockpermanentlinks</name>
|
||||
<displayName><![CDATA[Bloc liens permanents]]></displayName>
|
||||
<version><![CDATA[0.2.1]]></version>
|
||||
<description><![CDATA[Ajoute un bloc qui affiche des liens permanents (contact, plan du site, etc.).]]></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/blockpermanentlinks/img/arrow_right_2.png
Normal file
After Width: | Height: | Size: 90 B |
35
modules/blockpermanentlinks/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/blockpermanentlinks/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/blockpermanentlinks/logo.gif
Normal file
After Width: | Height: | Size: 938 B |
BIN
modules/blockpermanentlinks/logo.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
21
modules/blockpermanentlinks/translations/fr.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_39355c36cfd8f1d048a1f84803963534'] = 'Bloc liens permanents';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_6c5b993889148d10481569e55f8f7c6d'] = 'Ajoute un bloc qui affiche des liens permanents (contact, plan du site, etc.).';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-footer_5813ce0ec7196c492c97596718f71969'] = 'sitemap';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-footer_bbaff12800505b22a853e8b7f4eb6a22'] = 'Contact';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-footer_714814d37531916c293a8a4007e8418c'] = 'Mettre cette page en favori';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'contact';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_e1da49db34b0bdfdddaba2ad6552f848'] = 'plan du site';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_fad9383ed4698856ed467fd49ecf4820'] = 'favoris';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_c46000dc35dcefd6cc33237fa52acc48'] = 'plan de la boutique';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_5813ce0ec7196c492c97596718f71969'] = 'sitemap';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_c661cf76442d8d2cb318d560285a2a57'] = 'Formulaire de contact';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_bbaff12800505b22a853e8b7f4eb6a22'] = 'Contact';
|
||||
$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_2d29fbe96aaeb9737b355192f4683690'] = 'Mettre cette page en favori';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockpermanentlinks/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 fab85ee0756cf0d50b0878e2f92e1735a69b4ff3
|
5
modules/blockreinsurance/CHANGELOG.txt
Normal file
@ -0,0 +1,5 @@
|
||||
2014-04-22 18:57:37 +0200 // Changelog updated
|
||||
2014-03-24 14:40:18 +0100 // fix configuration layout
|
||||
2014-03-24 11:43:28 +0100 / MO blockreinsurance : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:03:28 +0100 / MO blockreinsurance : ps_versions_compliancy added
|
||||
2014-03-20 14:23:28 +0100 Initial commit
|
37
modules/blockreinsurance/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Customer reassurance block
|
||||
|
||||
## About
|
||||
|
||||
Adds an information block aimed at offering helpful information to reassure customers that your store is trustworthy.
|
||||
|
||||
## 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 blockreinsurance 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
|
||||
|
366
modules/blockreinsurance/blockreinsurance.php
Normal file
@ -0,0 +1,366 @@
|
||||
<?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;
|
||||
|
||||
include_once _PS_MODULE_DIR_.'blockreinsurance/reinsuranceClass.php';
|
||||
|
||||
class Blockreinsurance extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockreinsurance';
|
||||
if (version_compare(_PS_VERSION_, '1.4.0.0') >= 0)
|
||||
$this->tab = 'front_office_features';
|
||||
else
|
||||
$this->tab = 'Blocks';
|
||||
$this->version = '2.1.1';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Customer reassurance block');
|
||||
$this->description = $this->l('Adds an information block aimed at offering helpful information to reassure customers that your store is trustworthy.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install() &&
|
||||
$this->installDB() &&
|
||||
Configuration::updateValue('BLOCKREINSURANCE_NBBLOCKS', 5) &&
|
||||
$this->registerHook('footer') && $this->installFixtures() &&
|
||||
// Disable on mobiles and tablets
|
||||
$this->disableDevice(Context::DEVICE_TABLET | Context::DEVICE_MOBILE);
|
||||
}
|
||||
|
||||
public function installDB()
|
||||
{
|
||||
$return = true;
|
||||
$return &= Db::getInstance()->execute('
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'reinsurance` (
|
||||
`id_reinsurance` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_shop` int(10) unsigned NOT NULL ,
|
||||
`file_name` VARCHAR(100) NOT NULL,
|
||||
PRIMARY KEY (`id_reinsurance`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;');
|
||||
|
||||
$return &= Db::getInstance()->execute('
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'reinsurance_lang` (
|
||||
`id_reinsurance` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_lang` int(10) unsigned NOT NULL ,
|
||||
`text` VARCHAR(300) NOT NULL,
|
||||
PRIMARY KEY (`id_reinsurance`, `id_lang`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
// Delete configuration
|
||||
return Configuration::deleteByName('BLOCKREINSURANCE_NBBLOCKS') &&
|
||||
$this->uninstallDB() &&
|
||||
parent::uninstall();
|
||||
}
|
||||
|
||||
public function uninstallDB()
|
||||
{
|
||||
return Db::getInstance()->execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'reinsurance`') && Db::getInstance()->execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'reinsurance_lang`');
|
||||
}
|
||||
|
||||
public function addToDB()
|
||||
{
|
||||
if (isset($_POST['nbblocks']))
|
||||
{
|
||||
for ($i = 1; $i <= (int)$_POST['nbblocks']; $i++)
|
||||
{
|
||||
$filename = explode('.', $_FILES['info'.$i.'_file']['name']);
|
||||
if (isset($_FILES['info'.$i.'_file']) && isset($_FILES['info'.$i.'_file']['tmp_name']) && !empty($_FILES['info'.$i.'_file']['tmp_name']))
|
||||
{
|
||||
if ($error = ImageManager::validateUpload($_FILES['info'.$i.'_file']))
|
||||
return false;
|
||||
elseif (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['info'.$i.'_file']['tmp_name'], $tmpName))
|
||||
return false;
|
||||
elseif (!ImageManager::resize($tmpName, dirname(__FILE__).'/img/'.$filename[0].'.jpg'))
|
||||
return false;
|
||||
unlink($tmpName);
|
||||
}
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'reinsurance` (`filename`,`text`)
|
||||
VALUES ("'.((isset($filename[0]) && $filename[0] != '') ? pSQL($filename[0]) : '').
|
||||
'", "'.((isset($_POST['info'.$i.'_text']) && $_POST['info'.$i.'_text'] != '') ? pSQL($_POST['info'.$i.'_text']) : '').'")');
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
public function removeFromDB()
|
||||
{
|
||||
$dir = opendir(dirname(__FILE__).'/img');
|
||||
while (false !== ($file = readdir($dir)))
|
||||
{
|
||||
$path = dirname(__FILE__).'/img/'.$file;
|
||||
if ($file != '..' && $file != '.' && !is_dir($file))
|
||||
unlink($path);
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
return Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'reinsurance`');
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$html = '';
|
||||
$id_reinsurance = (int)Tools::getValue('id_reinsurance');
|
||||
|
||||
if (Tools::isSubmit('saveblockreinsurance'))
|
||||
{
|
||||
if ($id_reinsurance = Tools::getValue('id_reinsurance'))
|
||||
$reinsurance = new reinsuranceClass((int)$id_reinsurance);
|
||||
else
|
||||
$reinsurance = new reinsuranceClass();
|
||||
$reinsurance->copyFromPost();
|
||||
$reinsurance->id_shop = $this->context->shop->id;
|
||||
|
||||
if ($reinsurance->validateFields(false) && $reinsurance->validateFieldsLang(false))
|
||||
{
|
||||
$reinsurance->save();
|
||||
if (isset($_FILES['image']) && isset($_FILES['image']['tmp_name']) && !empty($_FILES['image']['tmp_name']))
|
||||
{
|
||||
if ($error = ImageManager::validateUpload($_FILES['image']))
|
||||
return false;
|
||||
elseif (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['image']['tmp_name'], $tmpName))
|
||||
return false;
|
||||
elseif (!ImageManager::resize($tmpName, dirname(__FILE__).'/img/reinsurance-'.(int)$reinsurance->id.'-'.(int)$reinsurance->id_shop.'.jpg'))
|
||||
return false;
|
||||
unlink($tmpName);
|
||||
$reinsurance->file_name = 'reinsurance-'.(int)$reinsurance->id.'-'.(int)$reinsurance->id_shop.'.jpg';
|
||||
$reinsurance->save();
|
||||
}
|
||||
$this->_clearCache('blockreinsurance.tpl');
|
||||
}
|
||||
else
|
||||
$html .= '<div class="conf error">'.$this->l('An error occurred while attempting to save.').'</div>';
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('updateblockreinsurance') || Tools::isSubmit('addblockreinsurance'))
|
||||
{
|
||||
$helper = $this->initForm();
|
||||
foreach (Language::getLanguages(false) as $lang)
|
||||
if ($id_reinsurance)
|
||||
{
|
||||
$reinsurance = new reinsuranceClass((int)$id_reinsurance);
|
||||
$helper->fields_value['text'][(int)$lang['id_lang']] = $reinsurance->text[(int)$lang['id_lang']];
|
||||
}
|
||||
else
|
||||
$helper->fields_value['text'][(int)$lang['id_lang']] = Tools::getValue('text_'.(int)$lang['id_lang'], '');
|
||||
if ($id_reinsurance = Tools::getValue('id_reinsurance'))
|
||||
{
|
||||
$this->fields_form[0]['form']['input'][] = array('type' => 'hidden', 'name' => 'id_reinsurance');
|
||||
$helper->fields_value['id_reinsurance'] = (int)$id_reinsurance;
|
||||
}
|
||||
|
||||
return $html.$helper->generateForm($this->fields_form);
|
||||
}
|
||||
else if (Tools::isSubmit('deleteblockreinsurance'))
|
||||
{
|
||||
$reinsurance = new reinsuranceClass((int)$id_reinsurance);
|
||||
if (file_exists(dirname(__FILE__).'/img/'.$reinsurance->file_name))
|
||||
unlink(dirname(__FILE__).'/img/'.$reinsurance->file_name);
|
||||
$reinsurance->delete();
|
||||
$this->_clearCache('blockreinsurance.tpl');
|
||||
Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$helper = $this->initList();
|
||||
return $html.$helper->generateList($this->getListContent((int)Configuration::get('PS_LANG_DEFAULT')), $this->fields_list);
|
||||
}
|
||||
|
||||
if (isset($_POST['submitModule']))
|
||||
{
|
||||
Configuration::updateValue('BLOCKREINSURANCE_NBBLOCKS', ((isset($_POST['nbblocks']) && $_POST['nbblocks'] != '') ? (int)$_POST['nbblocks'] : ''));
|
||||
if ($this->removeFromDB() && $this->addToDB())
|
||||
{
|
||||
$this->_clearCache('blockreinsurance.tpl');
|
||||
$output = '<div class="conf confirm">'.$this->l('The block configuration has been updated.').'</div>';
|
||||
}
|
||||
else
|
||||
$output = '<div class="conf error"><img src="../img/admin/disabled.gif"/>'.$this->l('An error occurred while attempting to save.').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
protected function getListContent($id_lang)
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT r.`id_reinsurance`, r.`id_shop`, r.`file_name`, rl.`text`
|
||||
FROM `'._DB_PREFIX_.'reinsurance` r
|
||||
LEFT JOIN `'._DB_PREFIX_.'reinsurance_lang` rl ON (r.`id_reinsurance` = rl.`id_reinsurance`)
|
||||
WHERE `id_lang` = '.(int)$id_lang.' '.Shop::addSqlRestrictionOnLang());
|
||||
}
|
||||
|
||||
protected function initForm()
|
||||
{
|
||||
$default_lang = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
|
||||
$this->fields_form[0]['form'] = array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('New reassurance block'),
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Image'),
|
||||
'name' => 'image',
|
||||
'value' => true
|
||||
),
|
||||
array(
|
||||
'type' => 'textarea',
|
||||
'label' => $this->l('Text'),
|
||||
'lang' => true,
|
||||
'name' => 'text',
|
||||
'cols' => 40,
|
||||
'rows' => 10
|
||||
)
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->module = $this;
|
||||
$helper->name_controller = 'blockreinsurance';
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
foreach (Language::getLanguages(false) as $lang)
|
||||
$helper->languages[] = array(
|
||||
'id_lang' => $lang['id_lang'],
|
||||
'iso_code' => $lang['iso_code'],
|
||||
'name' => $lang['name'],
|
||||
'is_default' => ($default_lang == $lang['id_lang'] ? 1 : 0)
|
||||
);
|
||||
|
||||
$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
|
||||
$helper->default_form_language = $default_lang;
|
||||
$helper->allow_employee_form_lang = $default_lang;
|
||||
$helper->toolbar_scroll = true;
|
||||
$helper->title = $this->displayName;
|
||||
$helper->submit_action = 'saveblockreinsurance';
|
||||
$helper->toolbar_btn = array(
|
||||
'save' =>
|
||||
array(
|
||||
'desc' => $this->l('Save'),
|
||||
'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'),
|
||||
),
|
||||
'back' =>
|
||||
array(
|
||||
'href' => AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'),
|
||||
'desc' => $this->l('Back to list')
|
||||
)
|
||||
);
|
||||
return $helper;
|
||||
}
|
||||
|
||||
protected function initList()
|
||||
{
|
||||
$this->fields_list = array(
|
||||
'id_reinsurance' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'width' => 120,
|
||||
'type' => 'text',
|
||||
'search' => false,
|
||||
'orderby' => false
|
||||
),
|
||||
'text' => array(
|
||||
'title' => $this->l('Text'),
|
||||
'width' => 140,
|
||||
'type' => 'text',
|
||||
'search' => false,
|
||||
'orderby' => false
|
||||
),
|
||||
);
|
||||
|
||||
if (Shop::isFeatureActive())
|
||||
$this->fields_list['id_shop'] = array('title' => $this->l('ID Shop'), 'align' => 'center', 'width' => 25, 'type' => 'int');
|
||||
|
||||
$helper = new HelperList();
|
||||
$helper->shopLinkType = '';
|
||||
$helper->simple_header = false;
|
||||
$helper->identifier = 'id_reinsurance';
|
||||
$helper->actions = array('edit', 'delete');
|
||||
$helper->show_toolbar = true;
|
||||
$helper->imageType = 'jpg';
|
||||
$helper->toolbar_btn['new'] = array(
|
||||
'href' => AdminController::$currentIndex.'&configure='.$this->name.'&add'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'),
|
||||
'desc' => $this->l('Add new')
|
||||
);
|
||||
|
||||
$helper->title = $this->displayName;
|
||||
$helper->table = $this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
|
||||
return $helper;
|
||||
}
|
||||
|
||||
public function hookFooter($params)
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path.'style.css', 'all');
|
||||
if (!$this->isCached('blockreinsurance.tpl', $this->getCacheId()))
|
||||
{
|
||||
$infos = $this->getListContent($this->context->language->id);
|
||||
$this->context->smarty->assign(array('infos' => $infos, 'nbblocks' => count($infos)));
|
||||
}
|
||||
return $this->display(__FILE__, 'blockreinsurance.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function installFixtures()
|
||||
{
|
||||
$return = true;
|
||||
$tab_texts = array(
|
||||
array('text' => $this->l('Money back guarantee.'), 'file_name' => 'reinsurance-1-1.jpg'),
|
||||
array('text' => $this->l('In-store exchange.'), 'file_name' => 'reinsurance-2-1.jpg'),
|
||||
array('text' => $this->l('Payment upon shipment.'), 'file_name' => 'reinsurance-3-1.jpg'),
|
||||
array('text' => $this->l('Free Shipping.'), 'file_name' => 'reinsurance-4-1.jpg'),
|
||||
array('text' => $this->l('100% secure payment processing.'), 'file_name' => 'reinsurance-5-1.jpg')
|
||||
);
|
||||
|
||||
foreach($tab_texts as $tab)
|
||||
{
|
||||
$reinsurance = new reinsuranceClass();
|
||||
foreach (Language::getLanguages(false) as $lang)
|
||||
$reinsurance->text[$lang['id_lang']] = $tab['text'];
|
||||
$reinsurance->file_name = $tab['file_name'];
|
||||
$reinsurance->id_shop = $this->context->shop->id;
|
||||
$return &= $reinsurance->save();
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
35
modules/blockreinsurance/blockreinsurance.tpl
Normal file
@ -0,0 +1,35 @@
|
||||
{*
|
||||
* 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 $infos|@count > 0}
|
||||
<!-- MODULE Block reinsurance -->
|
||||
<div id="reinsurance_block" class="clearfix">
|
||||
<ul class="width{$nbblocks}">
|
||||
{foreach from=$infos item=info}
|
||||
<li><img src="{$link->getMediaLink("`$module_dir`img/`$info.file_name|escape:'htmlall':'UTF-8'`")}" alt="{$info.text|escape:html:'UTF-8'}" /> <span>{$info.text|escape:html:'UTF-8'}</span></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /MODULE Block reinsurance -->
|
||||
{/if}
|
12
modules/blockreinsurance/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockreinsurance</name>
|
||||
<displayName><![CDATA[Customer reassurance block]]></displayName>
|
||||
<version><![CDATA[2.1.1]]></version>
|
||||
<description><![CDATA[Adds an information block aimed at offering helpful information to reassure customers that your store is trustworthy.]]></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/blockreinsurance/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockreinsurance</name>
|
||||
<displayName><![CDATA[Bloc réassurance]]></displayName>
|
||||
<version><![CDATA[2.1.1]]></version>
|
||||
<description><![CDATA[Ajoute un bloc pour afficher des informations pour rassurer vos clients]]></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/blockreinsurance/img/bg_reinsurance_block.gif
Normal file
After Width: | Height: | Size: 299 B |
35
modules/blockreinsurance/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;
|
BIN
modules/blockreinsurance/img/reinsurance-1-1.jpg
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
modules/blockreinsurance/img/reinsurance-2-1.jpg
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
modules/blockreinsurance/img/reinsurance-5-1.jpg
Normal file
After Width: | Height: | Size: 1.2 KiB |
35
modules/blockreinsurance/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/blockreinsurance/logo.gif
Normal file
After Width: | Height: | Size: 222 B |
BIN
modules/blockreinsurance/logo.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
74
modules/blockreinsurance/reinsuranceClass.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
class reinsuranceClass extends ObjectModel
|
||||
{
|
||||
/** @var integer reinsurance id*/
|
||||
public $id;
|
||||
|
||||
/** @var integer reinsurance id shop*/
|
||||
public $id_shop;
|
||||
|
||||
/** @var string reinsurance file name icon*/
|
||||
public $file_name;
|
||||
|
||||
/** @var string reinsurance text*/
|
||||
public $text;
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
public static $definition = array(
|
||||
'table' => 'reinsurance',
|
||||
'primary' => 'id_reinsurance',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt', 'required' => true),
|
||||
'file_name' => array('type' => self::TYPE_STRING, 'validate' => 'isFileName'),
|
||||
// Lang fields
|
||||
'text' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true),
|
||||
)
|
||||
);
|
||||
|
||||
public function copyFromPost()
|
||||
{
|
||||
/* Classical fields */
|
||||
foreach ($_POST AS $key => $value)
|
||||
if (array_key_exists($key, $this) AND $key != 'id_'.$this->table)
|
||||
$this->{$key} = $value;
|
||||
|
||||
/* Multilingual fields */
|
||||
if (sizeof($this->fieldsValidateLang))
|
||||
{
|
||||
$languages = Language::getLanguages(false);
|
||||
foreach ($languages AS $language)
|
||||
foreach ($this->fieldsValidateLang AS $field => $validation)
|
||||
if (isset($_POST[$field.'_'.(int)($language['id_lang'])]))
|
||||
$this->{$field}[(int)($language['id_lang'])] = $_POST[$field.'_'.(int)($language['id_lang'])];
|
||||
}
|
||||
}
|
||||
}
|
24
modules/blockreinsurance/style.css
Normal file
@ -0,0 +1,24 @@
|
||||
/* BLOCK #reinsurance_block ******************************************************************** */
|
||||
#reinsurance_block {background:url(../blockreinsurance/img/bg_reinsurance_block.gif) repeat-x 0 0 #c3c7cb}
|
||||
#reinsurance_block li {
|
||||
float:left;
|
||||
padding:15px 10px !important;
|
||||
font-size:13px;
|
||||
color:#333;
|
||||
text-transform:uppercase;
|
||||
text-shadow:0 1px 0 #fff
|
||||
}
|
||||
#reinsurance_block .width1 li {width:960px}
|
||||
#reinsurance_block .width2 li {width:470px}
|
||||
#reinsurance_block .width3 li {width:305px}
|
||||
#reinsurance_block .width4 li {width:224px}
|
||||
#reinsurance_block .width5 li {width:175px}
|
||||
#reinsurance_block li img{
|
||||
float:left;
|
||||
margin-right:10px;
|
||||
}
|
||||
#reinsurance_block li span {
|
||||
float:left;
|
||||
padding-top:12px;
|
||||
width:65%;
|
||||
}
|
25
modules/blockreinsurance/translations/fr.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_873330fc1881555fffe2bc471d04bf5d'] = 'Bloc réassurance';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_7e7f70db3c75e428db8e2d0a1765c4e9'] = 'Ajoute un bloc pour afficher des informations pour rassurer vos clients';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_d52eaeff31af37a4a7e0550008aff5df'] = 'Une erreur est survenue lors de la sauvegarde';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_0366c7b2ea1bb228cd44aec7e3e26a3e'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_8363eee01f4da190a4cef9d26a36750c'] = 'Nouveau bloc de réassurance';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_be53a0541a6d36f6ecb879fa2c584b08'] = 'Image';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_9dffbf69ffba8bc38bc4e01abf4b1675'] = 'Texte';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_630f6dc397fe74e52d5189e2c80f282b'] = 'Retour à la liste';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_23498d91b6017e5d7f4ddde70daba286'] = 'ID de la boutique';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_ef61fb324d729c341ea8ab9901e23566'] = 'Ajouter';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_f3295a93167b56c5a19030e91823f7bf'] = 'Satisfait ou remboursé';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_56e140ebd6f399c22c8859a694b247f3'] = 'Échange en magasin';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_597ce11744f9bbf116ec9e4a719ec9d3'] = 'Paiement à l\'expédition.';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_3aca7ac5cf7e462b658960931946f824'] = 'Livraison gratuite';
|
||||
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_d05244e0e410a6b85ed53a014908c657'] = 'Paiement 100% sécurisé';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockreinsurance/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 108bfbc363e7640b71d2d52423839af661a20e7c
|
4
modules/blockrss/CHANGELOG.txt
Normal file
@ -0,0 +1,4 @@
|
||||
2014-04-22 18:57:39 +0200 // Changelog updated
|
||||
2014-03-24 11:43:28 +0100 / MO blockrss : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:03:34 +0100 // MO blockrss/ : ps_versions_compliancy added
|
||||
2014-03-20 14:24:52 +0100 Initial commit
|
37
modules/blockrss/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# RSS feed block
|
||||
|
||||
## About
|
||||
|
||||
Adds a block displaying a RSS feed.
|
||||
|
||||
## 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 blockrss 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
|
||||
|
249
modules/blockrss/blockrss.php
Normal file
@ -0,0 +1,249 @@
|
||||
<?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;
|
||||
|
||||
include_once(_PS_CLASS_DIR_.'../tools/pear/PEAR.php');
|
||||
include_once(_PS_PEAR_XML_PARSER_PATH_.'Parser.php');
|
||||
|
||||
class Blockrss extends Module
|
||||
{
|
||||
|
||||
private static $xmlFields = array('title', 'guid', 'description', 'author', 'comments', 'pubDate', 'source', 'link', 'content');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->name = 'blockrss';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('RSS feed block');
|
||||
$this->description = $this->l('Adds a block displaying a RSS feed.');
|
||||
|
||||
$this->version = '1.2.3';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->error = false;
|
||||
$this->valid = false;
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
function install()
|
||||
{
|
||||
if (!parent::install())
|
||||
return false;
|
||||
|
||||
Configuration::updateValue('RSS_FEED_TITLE', $this->l('RSS feed'));
|
||||
Configuration::updateValue('RSS_FEED_NBR', 5);
|
||||
|
||||
return ($this->registerHook('header') && $this->registerHook('leftColumn'));
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$output = '';
|
||||
|
||||
if (Tools::isSubmit('submitBlockRss'))
|
||||
{
|
||||
$errors = array();
|
||||
$urlfeed = Tools::getValue('RSS_FEED_URL');
|
||||
$title = Tools::getValue('RSS_FEED_TITLE');
|
||||
$nbr = (int)Tools::getValue('RSS_FEED_NBR');
|
||||
|
||||
if ($urlfeed AND !Validate::isAbsoluteUrl($urlfeed))
|
||||
$errors[] = $this->l('Invalid feed URL');
|
||||
elseif (!$title OR empty($title) OR !Validate::isGenericName($title))
|
||||
$errors[] = $this->l('Invalid title');
|
||||
elseif (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr))
|
||||
$errors[] = $this->l('Invalid number of feeds');
|
||||
elseif (stristr($urlfeed, $_SERVER['HTTP_HOST'].__PS_BASE_URI__))
|
||||
$errors[] = $this->l('You have selected a feed URL from your own website. Please choose another URL.');
|
||||
elseif (!($contents = Tools::file_get_contents($urlfeed)))
|
||||
$errors[] = $this->l('Feed is unreachable, check your URL');
|
||||
/* Even if the feed was reachable, We need to make sure that the feed is well formated */
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
$xmlFeed = new XML_Feed_Parser($contents);
|
||||
}
|
||||
catch (XML_Feed_Parser_Exception $e)
|
||||
{
|
||||
$errors[] = $this->l('Invalid feed:').' '.$e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if (!sizeof($errors))
|
||||
{
|
||||
Configuration::updateValue('RSS_FEED_URL', $urlfeed);
|
||||
Configuration::updateValue('RSS_FEED_TITLE', $title);
|
||||
Configuration::updateValue('RSS_FEED_NBR', $nbr);
|
||||
|
||||
$output .= $this->displayConfirmation($this->l('Settings updated'));
|
||||
}
|
||||
else
|
||||
$output .= $this->displayError(implode('<br />', $errors));
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors = array();
|
||||
if (stristr(Configuration::get('RSS_FEED_URL'), $_SERVER['HTTP_HOST'].__PS_BASE_URI__))
|
||||
$errors[] = $this->l('You have selected a feed URL from your own website. Please choose another URL.');
|
||||
|
||||
if (sizeof($errors))
|
||||
$output .= $this->displayError(implode('<br />', $errors));
|
||||
}
|
||||
return $output.$this->renderForm();
|
||||
}
|
||||
|
||||
function hookLeftColumn($params)
|
||||
{
|
||||
// Conf
|
||||
$title = strval(Configuration::get('RSS_FEED_TITLE'));
|
||||
$url = strval(Configuration::get('RSS_FEED_URL'));
|
||||
$nb = (int)(Configuration::get('RSS_FEED_NBR'));
|
||||
|
||||
$cacheId = $this->getCacheId($this->name.'-'.date("YmdH"));
|
||||
if (!$this->isCached('blockrss.tpl', $cacheId))
|
||||
{
|
||||
// Getting data
|
||||
$rss_links = array();
|
||||
if ($url && ($contents = Tools::file_get_contents($url)))
|
||||
try
|
||||
{
|
||||
if (@$src = new XML_Feed_Parser($contents))
|
||||
for ($i = 0; $i < ($nb ? $nb : 5); $i++)
|
||||
if (@$item = $src->getEntryByOffset($i))
|
||||
{
|
||||
$xmlValues = array();
|
||||
foreach (self::$xmlFields as $xmlField)
|
||||
$xmlValues[$xmlField] = $item->__get($xmlField);
|
||||
$xmlValues['enclosure'] = $item->getEnclosure();
|
||||
|
||||
// First image
|
||||
if (isset($xmlValues['content']) && $xmlValues['content'])
|
||||
{
|
||||
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/', $xmlValues['content'], $image);
|
||||
if (array_key_exists(1, $image) && $image[1])
|
||||
{
|
||||
// Try if distant image exist : timeout 0.3s
|
||||
$context = stream_context_create(array('http' => array('timeout' => 0.3)));
|
||||
if (file_get_contents($image[1], false, $context, -1, 1) !== false)
|
||||
$xmlValues['image'] = $image[1];
|
||||
}
|
||||
}
|
||||
|
||||
// Compatibility
|
||||
$xmlValues['url'] = $xmlValues['link'];
|
||||
$rss_links[] = $xmlValues;
|
||||
}
|
||||
}
|
||||
catch (XML_Feed_Parser_Exception $e)
|
||||
{
|
||||
Tools::dieOrLog(sprintf($this->l('Error: invalid RSS feed in "blockrss" module: %s'), $e->getMessage()), false);
|
||||
}
|
||||
// Display smarty
|
||||
$this->smarty->assign(array('title' => ($title ? $title : $this->l('RSS feed')), 'rss_links' => $rss_links));
|
||||
}
|
||||
return $this->display(__FILE__, 'blockrss.tpl', $cacheId);
|
||||
}
|
||||
|
||||
function hookRightColumn($params)
|
||||
{
|
||||
return $this->hookLeftColumn($params);
|
||||
}
|
||||
|
||||
function hookHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockrss.css', 'all');
|
||||
}
|
||||
|
||||
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('Block title'),
|
||||
'name' => 'RSS_FEED_TITLE',
|
||||
'desc' => $this->l('Create a title for the block (default: \'RSS feed\').'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Add a feed URL'),
|
||||
'name' => 'RSS_FEED_URL',
|
||||
'desc' => $this->l('Add the URL of the feed you want to use (sample: http://news.google.com/?output=rss).'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Number of threads displayed'),
|
||||
'name' => 'RSS_FEED_NBR',
|
||||
'class' => 'fixed-width-sm',
|
||||
'desc' => $this->l('Number of threads displayed in the block (default value: 5).'),
|
||||
),
|
||||
),
|
||||
'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;
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitBlockRss';
|
||||
$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(
|
||||
'RSS_FEED_TITLE' => Tools::getValue('RSS_FEED_TITLE', Configuration::get('RSS_FEED_TITLE')),
|
||||
'RSS_FEED_URL' => Tools::getValue('RSS_FEED_URL', Configuration::get('RSS_FEED_URL')),
|
||||
'RSS_FEED_NBR' => Tools::getValue('RSS_FEED_NBR', Configuration::get('RSS_FEED_NBR')),
|
||||
);
|
||||
}
|
||||
}
|
41
modules/blockrss/blockrss.tpl
Normal file
@ -0,0 +1,41 @@
|
||||
{*
|
||||
* 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 RSS module-->
|
||||
<div id="rss_block_left" class="block">
|
||||
<h4 class="title_block">{$title}</h4>
|
||||
<div class="block_content list-block">
|
||||
{if $rss_links}
|
||||
<ul>
|
||||
{foreach from=$rss_links item='rss_link'}
|
||||
<li><a href="{$rss_link.url}" title="{$rss_link.title}">{$rss_link.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
<p>{l s='No RSS feed added' mod='blockrss'}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Block RSS module-->
|
12
modules/blockrss/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockrss</name>
|
||||
<displayName><![CDATA[RSS feed block]]></displayName>
|
||||
<version><![CDATA[1.2.3]]></version>
|
||||
<description><![CDATA[Adds a block displaying a RSS feed.]]></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/blockrss/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blockrss</name>
|
||||
<displayName><![CDATA[Bloc flux RSS]]></displayName>
|
||||
<version><![CDATA[1.2.3]]></version>
|
||||
<description><![CDATA[Ajoute un bloc affichant un flux RSS.]]></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>
|
BIN
modules/blockrss/img/arrow_right_2.png
Normal file
After Width: | Height: | Size: 90 B |
35
modules/blockrss/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/blockrss/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/blockrss/logo.gif
Normal file
After Width: | Height: | Size: 1009 B |
BIN
modules/blockrss/logo.png
Normal file
After Width: | Height: | Size: 937 B |
28
modules/blockrss/translations/fr.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_2516c13a12d3dbaf4efa88d9fce2e7da'] = 'Bloc flux RSS';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_4bb9f05422c5afbb84ed1eeb39beb8c6'] = 'Ajoute un bloc affichant un flux RSS.';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_9680162225162baf2a085dfdc2814deb'] = 'Flux RSS';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_6706b6d8ba45cc4f0eda0506ba1dc3c8'] = 'URL non valable pour le flux';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_36ed65ce17306e812fd68d9f634c0c57'] = 'Titre non valable';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_1b3d34e25aef32a3c8daddfff856577f'] = 'Nombre de flux non valable';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_549a15a569b4e5e250275db17712cd91'] = 'Vous avez sélectionné le flux RSS de votre propre boutique. Veuillez en choisir un autre.';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_bef637cd0e222a8b56676cb64ce75258'] = 'Le flux est inaccessible, vérifiez votre URL';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_1844ef1bfaa030dc8423c4645a43525c'] = 'Flux non valable :';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_c888438d14855d7d96a2724ee9c306bd'] = 'Mise à jour réussie';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_0a1c629f0e86804a9e165f4b1ee399b7'] = 'Erreur: Flux RSS invalide dans le module \\"blockrss\\" : %s';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_b22c8f9ad7db023c548c3b8e846cb169'] = 'Titre du bloc';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_5a33009bfebd22448e4265f65f8a7d98'] = 'Créer un titre pour le bloc (par défaut : "RSS feed").';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_402d00ca8e4f0fff26fc24ee9ab8e82b'] = 'Ajouter une URL';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_3117d1276345461366a62c6950c186ed'] = 'Ajoutez l\'URL du flux que vous voulez utiliser (exemple : http://news.google.com/?output=rss).';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_ff9aa540e20285875ac8b190a3cb7ccf'] = 'Nombre de messages affichés';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_0b4c4685f03f258492af3705a03b619b'] = 'Nombre de fils affichés dans le bloc (par défaut : 5).';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{blockrss}prestashop>blockrss_10fd25dcd3353c0ba3731d4a23657f2e'] = 'Aucun flux RSS ajouté';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blockrss/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 d788ccb494f33e375033434a287560cd6d7c50cf
|
4
modules/blocksearch/CHANGELOG.txt
Normal file
@ -0,0 +1,4 @@
|
||||
2014-04-22 18:57:41 +0200 // Changelog updated
|
||||
2014-03-24 11:43:29 +0100 / MO blocksearch : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:03:45 +0100 / MO blocksearch : ps_versions_compliancy added
|
||||
2014-03-20 14:25:08 +0100 Initial commit
|
37
modules/blocksearch/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Quick search block
|
||||
|
||||
## About
|
||||
|
||||
Adds a quick search field to your website.
|
||||
|
||||
## 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 blocksearch 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
|
||||
|
109
modules/blocksearch/blocksearch-instantsearch.tpl
Normal file
@ -0,0 +1,109 @@
|
||||
{if $ajaxsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
$('document').ready(function() {
|
||||
|
||||
var $input = $("#search_query_{$blocksearch_type}");
|
||||
|
||||
$input.autocomplete(
|
||||
'{if $search_ssl == 1}{$link->getPageLink('search', true)|addslashes}{else}{$link->getPageLink('search')|addslashes}{/if}',
|
||||
{
|
||||
minChars: 3,
|
||||
max: 10,
|
||||
width: 500,
|
||||
selectFirst: false,
|
||||
scroll: false,
|
||||
dataType: "json",
|
||||
formatItem: function(data, i, max, value, term) {
|
||||
return value;
|
||||
},
|
||||
parse: function(data) {
|
||||
var mytab = [];
|
||||
for (var i = 0; i < data.length; i++)
|
||||
mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
ajaxSearch: 1,
|
||||
id_lang: {$cookie->id_lang}
|
||||
}
|
||||
})
|
||||
.result(function(event, data, formatted) {
|
||||
$input.val(data.pname);
|
||||
document.location.href = data.product_link;
|
||||
});
|
||||
});
|
||||
// ]]>
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{if $instantsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
function tryToCloseInstantSearch()
|
||||
{
|
||||
var $oldCenterColumn = $('#old_center_column');
|
||||
if ($oldCenterColumn.length > 0)
|
||||
{
|
||||
$('#center_column').remove();
|
||||
$oldCenterColumn.attr('id', 'center_column').show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
instantSearchQueries = [];
|
||||
function stopInstantSearchQueries()
|
||||
{
|
||||
for(var i=0; i<instantSearchQueries.length; i++) {
|
||||
instantSearchQueries[i].abort();
|
||||
}
|
||||
instantSearchQueries = [];
|
||||
}
|
||||
|
||||
$('document').ready(function() {
|
||||
|
||||
var $input = $("#search_query_{$blocksearch_type}");
|
||||
|
||||
$input.on('keyup', function() {
|
||||
if ($(this).val().length > 4)
|
||||
{
|
||||
stopInstantSearchQueries();
|
||||
instantSearchQuery = $.ajax({
|
||||
url: '{if $search_ssl == 1}{$link->getPageLink('search', true)|addslashes}{else}{$link->getPageLink('search')|addslashes}{/if}',
|
||||
data: {
|
||||
instantSearch: 1,
|
||||
id_lang: {$cookie->id_lang},
|
||||
q: $(this).val()
|
||||
},
|
||||
dataType: 'html',
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function(data){
|
||||
if($input.val().length > 0)
|
||||
{
|
||||
tryToCloseInstantSearch();
|
||||
$('#center_column').attr('id', 'old_center_column');
|
||||
$('#old_center_column').after('<div id="center_column" class="' + $('#old_center_column').attr('class') + '">'+data+'</div>').hide();
|
||||
// Button override
|
||||
ajaxCart.overrideButtonsInThePage();
|
||||
$("#instant_search_results a.close").on('click', function() {
|
||||
$input.val('');
|
||||
return tryToCloseInstantSearch();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
}
|
||||
});
|
||||
instantSearchQueries.push(instantSearchQuery);
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
});
|
||||
});
|
||||
// ]]>
|
||||
</script>
|
||||
{/if}
|
51
modules/blocksearch/blocksearch-top.tpl
Normal file
@ -0,0 +1,51 @@
|
||||
{*
|
||||
* 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 seach mobile -->
|
||||
{if isset($hook_mobile)}
|
||||
<div class="input_search" data-role="fieldcontain">
|
||||
<form method="get" action="{$link->getPageLink('search', true)|escape:'html'}" id="searchbox">
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{$search_query|escape:'html':'UTF-8'|stripslashes}" />
|
||||
</form>
|
||||
</div>
|
||||
{else}
|
||||
<!-- Block search module TOP -->
|
||||
<div id="search_block_top">
|
||||
<form method="get" action="{$link->getPageLink('search', true)|escape:'html'}" id="searchbox">
|
||||
<p>
|
||||
<label for="search_query_top"><!-- image on background --></label>
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{$search_query|escape:'html':'UTF-8'|stripslashes}" />
|
||||
<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{include file="$self/blocksearch-instantsearch.tpl"}
|
||||
{/if}
|
||||
<!-- /Block search module TOP -->
|
40
modules/blocksearch/blocksearch.css
Normal file
@ -0,0 +1,40 @@
|
||||
/* block top search */
|
||||
#search_block_top {
|
||||
position:absolute;
|
||||
right: 26%;
|
||||
top: 34px;
|
||||
}
|
||||
#search_block_top p {padding:0;}
|
||||
#search_block_top #search_query_top {
|
||||
padding:0 5px;
|
||||
height:23px;
|
||||
width:300px;/* 310 */
|
||||
border:1px solid #666;
|
||||
border-right: 0 !important;
|
||||
color:#666;
|
||||
background:url(img/bg_search_input.png) repeat-x 0 0 #fff;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#search_block_top .button {
|
||||
border:none;
|
||||
border-radius:0;
|
||||
color:#fff;
|
||||
text-transform:uppercase;
|
||||
background:url(img/bg_search_submit.png) repeat-x 0 0 #101010;
|
||||
float: left;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
form#searchbox{padding-top:5px}
|
||||
form#searchbox label{color:#333;margin-bottom:1px}
|
||||
form#searchbox input#search_query_block{
|
||||
border: 1px solid #CCCCCC;
|
||||
-webkit-border-radius:3px !important;
|
||||
-moz-border-radius:3px !important;
|
||||
border-radius:3px !important;
|
||||
height: 18px;
|
||||
margin-top:10px;
|
||||
}
|
||||
form#searchbox input#search_button{padding: 1px 4px;}
|
||||
|
0
modules/blocksearch/blocksearch.js
Normal file
141
modules/blocksearch/blocksearch.php
Normal file
@ -0,0 +1,141 @@
|
||||
<?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 BlockSearch extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocksearch';
|
||||
$this->tab = 'search_filter';
|
||||
$this->version = '1.5.3';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Quick search block');
|
||||
$this->description = $this->l('Adds a quick search field to your website.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install() || !$this->registerHook('top') || !$this->registerHook('header') || !$this->registerHook('displayMobileTopSiteMap'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hookdisplayMobileTopSiteMap($params)
|
||||
{
|
||||
$this->smarty->assign(array('hook_mobile' => true, 'instantsearch' => false));
|
||||
$params['hook_mobile'] = true;
|
||||
return $this->hookTop($params);
|
||||
}
|
||||
|
||||
/*
|
||||
public function hookDisplayMobileHeader($params)
|
||||
{
|
||||
if (Configuration::get('PS_SEARCH_AJAX'))
|
||||
$this->context->controller->addJqueryPlugin('autocomplete');
|
||||
$this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
*/
|
||||
|
||||
public function hookHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blocksearch.css', 'all');
|
||||
|
||||
if (Configuration::get('PS_SEARCH_AJAX'))
|
||||
$this->context->controller->addJqueryPlugin('autocomplete');
|
||||
|
||||
if (Configuration::get('PS_INSTANT_SEARCH'))
|
||||
$this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
|
||||
if (Configuration::get('PS_SEARCH_AJAX') || Configuration::get('PS_INSTANT_SEARCH'))
|
||||
{
|
||||
Media::addJsDef(array('search_url' => $this->context->link->getPageLink('search', Tools::usingSecureMode())));
|
||||
$this->context->controller->addJS(($this->_path).'blocksearch.js');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
return $this->hookRightColumn($params);
|
||||
}
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
if (Tools::getValue('search_query') || !$this->isCached('blocksearch.tpl', $this->getCacheId()))
|
||||
{
|
||||
$this->calculHookCommon($params);
|
||||
$this->smarty->assign(array(
|
||||
'blocksearch_type' => 'block',
|
||||
'search_query' => (string)Tools::getValue('search_query')
|
||||
)
|
||||
);
|
||||
}
|
||||
Media::addJsDef(array('blocksearch_type' => 'block'));
|
||||
return $this->display(__FILE__, 'blocksearch.tpl', Tools::getValue('search_query') ? null : $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookTop($params)
|
||||
{
|
||||
$key = $this->getCacheId('blocksearch-top'.((!isset($params['hook_mobile']) || !$params['hook_mobile']) ? '' : '-hook_mobile'));
|
||||
if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $key))
|
||||
{
|
||||
$this->calculHookCommon($params);
|
||||
$this->smarty->assign(array(
|
||||
'blocksearch_type' => 'top',
|
||||
'search_query' => (string)Tools::getValue('search_query')
|
||||
)
|
||||
);
|
||||
}
|
||||
Media::addJsDef(array('blocksearch_type' => 'top'));
|
||||
return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $key);
|
||||
}
|
||||
|
||||
public function hookDisplayNav($params)
|
||||
{
|
||||
return $this->hookTop($params);
|
||||
}
|
||||
|
||||
private function calculHookCommon($params)
|
||||
{
|
||||
$this->smarty->assign(array(
|
||||
'ENT_QUOTES' => ENT_QUOTES,
|
||||
'search_ssl' => Tools::usingSecureMode(),
|
||||
'ajaxsearch' => Configuration::get('PS_SEARCH_AJAX'),
|
||||
'instantsearch' => Configuration::get('PS_INSTANT_SEARCH'),
|
||||
'self' => dirname(__FILE__),
|
||||
));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
41
modules/blocksearch/blocksearch.tpl
Normal file
@ -0,0 +1,41 @@
|
||||
{*
|
||||
* 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 search module -->
|
||||
<div id="search_block_left" class="block exclusive">
|
||||
<h4 class="title_block">{l s='Search' mod='blocksearch'}</h4>
|
||||
<form method="get" action="{$link->getPageLink('search', true)|escape:'html'}" id="searchbox">
|
||||
<p class="block_content">
|
||||
<label for="search_query_block">{l s='Search products:' mod='blocksearch'}</label>
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{$search_query|escape:'html':'UTF-8'|stripslashes}" />
|
||||
<input type="submit" id="search_button" class="button_mini" value="{l s='Go' mod='blocksearch'}" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{include file="$self/blocksearch-instantsearch.tpl"}
|
||||
<!-- /Block search module -->
|
12
modules/blocksearch/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocksearch</name>
|
||||
<displayName><![CDATA[Quick search block]]></displayName>
|
||||
<version><![CDATA[1.5.3]]></version>
|
||||
<description><![CDATA[Adds a quick search field to your website.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[search_filter]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
12
modules/blocksearch/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocksearch</name>
|
||||
<displayName><![CDATA[Bloc recherche rapide]]></displayName>
|
||||
<version><![CDATA[1.5.3]]></version>
|
||||
<description><![CDATA[Ajoute un bloc avec un champ de recherche rapide]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[search_filter]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
BIN
modules/blocksearch/img/bg_search_input.png
Normal file
After Width: | Height: | Size: 102 B |
BIN
modules/blocksearch/img/bg_search_submit.png
Normal file
After Width: | Height: | Size: 192 B |
35
modules/blocksearch/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/blocksearch/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/blocksearch/logo.gif
Normal file
After Width: | Height: | Size: 615 B |
BIN
modules/blocksearch/logo.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
14
modules/blocksearch/translations/fr.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_e2ca130372651672ba285abd796412ed'] = 'Bloc recherche rapide';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_be305c865235f417d9b4d22fcdf9f1c5'] = 'Ajoute un bloc avec un champ de recherche rapide';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Rechercher';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Rechercher';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_ce1b00a24b52e74de46971b174d2aaa6'] = 'Rechercher un produit';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_5f075ae3e1f9d0382bb8c4632991f96f'] = 'Go';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blocksearch/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 79be3174bb57cfc125a41cb8ca7416f8a36f0d65
|
4
modules/blocksharefb/CHANGELOG.txt
Normal file
@ -0,0 +1,4 @@
|
||||
2014-04-22 18:57:44 +0200 // Changelog updated
|
||||
2014-03-24 11:43:29 +0100 / MO blocksharefb : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:03:50 +0100 / MO blocksharefb : ps_versions_compliancy added
|
||||
2014-03-20 14:25:24 +0100 Initial commit
|
37
modules/blocksharefb/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Facebook sharing block
|
||||
|
||||
## About
|
||||
|
||||
Allows customers to share your products or content on Facebook.
|
||||
|
||||
## 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 blocksharefb 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
|
||||
|
81
modules/blocksharefb/blocksharefb.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?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 blocksharefb extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocksharefb';
|
||||
if(version_compare(_PS_VERSION_, '1.4.0.0') >= 0)
|
||||
$this->tab = 'front_office_features';
|
||||
else
|
||||
$this->tab = 'Blocks';
|
||||
$this->version = '1.2.2';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Facebook Share Button');
|
||||
$this->description = $this->l('Allows customers to share products or content on Facebook.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() AND $this->registerHook('extraLeft'));
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
//Delete configuration
|
||||
return (parent::uninstall() AND $this->unregisterHook(Hook::getIdByName('extraLeft')));
|
||||
}
|
||||
|
||||
public function hookExtraLeft($params)
|
||||
{
|
||||
global $smarty, $cookie, $link;
|
||||
|
||||
$id_product = Tools::getValue('id_product');
|
||||
|
||||
if (isset($id_product) && $id_product != '')
|
||||
{
|
||||
$product_infos = $this->context->controller->getProduct();
|
||||
$smarty->assign(array(
|
||||
'product_link' => urlencode($link->getProductLink($product_infos)),
|
||||
'product_title' => urlencode($product_infos->name),
|
||||
));
|
||||
|
||||
return $this->display(__FILE__, 'blocksharefb.tpl');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
modules/blocksharefb/blocksharefb.tpl
Normal file
@ -0,0 +1,29 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
<li id="left_share_fb">
|
||||
<a href="http://www.facebook.com/sharer.php?u={$product_link}&t={$product_title}" class="_blank">{l s='Share on Facebook!' mod='blocksharefb'}</a>
|
||||
</li>
|
12
modules/blocksharefb/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocksharefb</name>
|
||||
<displayName><![CDATA[Facebook sharing block]]></displayName>
|
||||
<version><![CDATA[1.2.2]]></version>
|
||||
<description><![CDATA[Allows customers to share your products or content on Facebook.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
12
modules/blocksharefb/config_fr.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocksharefb</name>
|
||||
<displayName><![CDATA[Bouton de Partage Facebook]]></displayName>
|
||||
<version><![CDATA[1.2.2]]></version>
|
||||
<description><![CDATA[Permet à vos clients de partager vos produits ou contenus sur Facebook.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
35
modules/blocksharefb/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/blocksharefb/logo.gif
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
modules/blocksharefb/logo.png
Normal file
After Width: | Height: | Size: 732 B |
11
modules/blocksharefb/translations/fr.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
|
||||
$_MODULE['<{blocksharefb}prestashop>blocksharefb_d5d8d3eab66d27ce437e210d0ce31fce'] = 'Bouton de Partage Facebook';
|
||||
$_MODULE['<{blocksharefb}prestashop>blocksharefb_1c32abb67032ad28e8613bb67f6e9867'] = 'Permet à vos clients de partager vos produits ou contenus sur Facebook.';
|
||||
$_MODULE['<{blocksharefb}prestashop>blocksharefb_353005a70db1e1dac3aadedec7596bd7'] = 'Partager sur Facebook !';
|
||||
|
||||
|
||||
return $_MODULE;
|
35
modules/blocksharefb/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 8394691162ea1d67b31cd43d6154f021fcfd4274
|
6
modules/blocksocial/CHANGELOG.txt
Normal file
@ -0,0 +1,6 @@
|
||||
2014-04-22 18:57:46 +0200 // Changelog updated
|
||||
2014-03-26 17:55:24 +0100 Show youtube, google+ and Pinterest links
|
||||
2014-03-26 17:34:00 +0100 install and uninstall default values fixed
|
||||
2014-03-24 11:43:29 +0100 / MO blocksocial : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:03:56 +0100 // MO blocksocial/ : ps_versions_compliancy added
|
||||
2014-03-20 14:25:27 +0100 Initial commit
|
37
modules/blocksocial/Readme.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Social networking block
|
||||
|
||||
## About
|
||||
|
||||
Allows you to add information about your brand\'s social networking accounts.
|
||||
|
||||
## 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 blocksocial 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/blocksocial/blocksocial.jpg
Normal file
After Width: | Height: | Size: 1.9 KiB |
215
modules/blocksocial/blocksocial.php
Normal file
@ -0,0 +1,215 @@
|
||||
<?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 blocksocial extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocksocial';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.5';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Social networking block');
|
||||
$this->description = $this->l('Allows you to add information about your brand\'s social networking accounts.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() AND Configuration::updateValue('BLOCKSOCIAL_FACEBOOK', '') &&
|
||||
Configuration::updateValue('BLOCKSOCIAL_TWITTER', '') &&
|
||||
Configuration::updateValue('BLOCKSOCIAL_RSS', '') &&
|
||||
Configuration::updateValue('BLOCKSOCIAL_YOUTUBE', '') &&
|
||||
Configuration::updateValue('BLOCKSOCIAL_GOOGLE_PLUS', '') &&
|
||||
Configuration::updateValue('BLOCKSOCIAL_PINTEREST', '') &&
|
||||
Configuration::updateValue('BLOCKSOCIAL_VIMEO', '') &&
|
||||
Configuration::updateValue('BLOCKSOCIAL_INSTAGRAM', '') &&
|
||||
$this->registerHook('displayHeader') &&
|
||||
$this->registerHook('displayFooter'));
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
//Delete configuration
|
||||
return (Configuration::deleteByName('BLOCKSOCIAL_FACEBOOK') AND
|
||||
Configuration::deleteByName('BLOCKSOCIAL_TWITTER') AND
|
||||
Configuration::deleteByName('BLOCKSOCIAL_RSS') AND
|
||||
Configuration::deleteByName('BLOCKSOCIAL_YOUTUBE') AND
|
||||
Configuration::deleteByName('BLOCKSOCIAL_GOOGLE_PLUS') AND
|
||||
Configuration::deleteByName('BLOCKSOCIAL_PINTEREST') AND
|
||||
Configuration::deleteByName('BLOCKSOCIAL_VIMEO') AND
|
||||
Configuration::deleteByName('BLOCKSOCIAL_INSTAGRAM') AND
|
||||
parent::uninstall());
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
// If we try to update the settings
|
||||
$output = '';
|
||||
if (Tools::isSubmit('submitModule'))
|
||||
{
|
||||
Configuration::updateValue('BLOCKSOCIAL_FACEBOOK', Tools::getValue('blocksocial_facebook', ''));
|
||||
Configuration::updateValue('BLOCKSOCIAL_TWITTER', Tools::getValue('blocksocial_twitter', ''));
|
||||
Configuration::updateValue('BLOCKSOCIAL_RSS', Tools::getValue('blocksocial_rss', ''));
|
||||
Configuration::updateValue('BLOCKSOCIAL_YOUTUBE', Tools::getValue('blocksocial_youtube', ''));
|
||||
Configuration::updateValue('BLOCKSOCIAL_GOOGLE_PLUS', Tools::getValue('blocksocial_google_plus', ''));
|
||||
Configuration::updateValue('BLOCKSOCIAL_PINTEREST', Tools::getValue('blocksocial_pinterest', ''));
|
||||
Configuration::updateValue('BLOCKSOCIAL_VIMEO', Tools::getValue('blocksocial_vimeo', ''));
|
||||
Configuration::updateValue('BLOCKSOCIAL_INSTAGRAM', Tools::getValue('blocksocial_instagram', ''));
|
||||
$this->_clearCache('blocksocial.tpl');
|
||||
Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules').'&configure='.$this->name.'&tab_module='.$this->tab.'&conf=4&module_name='.$this->name);
|
||||
}
|
||||
|
||||
return $output.$this->renderForm();
|
||||
}
|
||||
|
||||
public function hookDisplayHeader()
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blocksocial.css', 'all');
|
||||
}
|
||||
|
||||
public function hookDisplayFooter()
|
||||
{
|
||||
if (!$this->isCached('blocksocial.tpl', $this->getCacheId()))
|
||||
$this->smarty->assign(array(
|
||||
'facebook_url' => Configuration::get('BLOCKSOCIAL_FACEBOOK'),
|
||||
'twitter_url' => Configuration::get('BLOCKSOCIAL_TWITTER'),
|
||||
'rss_url' => Configuration::get('BLOCKSOCIAL_RSS'),
|
||||
'youtube_url' => Configuration::get('BLOCKSOCIAL_YOUTUBE'),
|
||||
'google_plus_url' => Configuration::get('BLOCKSOCIAL_GOOGLE_PLUS'),
|
||||
'pinterest_url' => Configuration::get('BLOCKSOCIAL_PINTEREST'),
|
||||
'vimeo_url' => Configuration::get('BLOCKSOCIAL_VIMEO'),
|
||||
'instagram_url' => Configuration::get('BLOCKSOCIAL_INSTAGRAM'),
|
||||
));
|
||||
|
||||
return $this->display(__FILE__, 'blocksocial.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('Facebook URL'),
|
||||
'name' => 'blocksocial_facebook',
|
||||
'desc' => $this->l('Your Facebook fan page.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Twitter URL'),
|
||||
'name' => 'blocksocial_twitter',
|
||||
'desc' => $this->l('Your official Twitter account.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('RSS URL'),
|
||||
'name' => 'blocksocial_rss',
|
||||
'desc' => $this->l('The RSS feed of your choice (your blog, your store, etc.).'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('YouTube URL'),
|
||||
'name' => 'blocksocial_youtube',
|
||||
'desc' => $this->l('Your official YouTube account.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Google+ URL:'),
|
||||
'name' => 'blocksocial_google_plus',
|
||||
'desc' => $this->l('Your official Google+ page.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Pinterest URL:'),
|
||||
'name' => 'blocksocial_pinterest',
|
||||
'desc' => $this->l('Your official Pinterest account.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Vimeo URL:'),
|
||||
'name' => 'blocksocial_vimeo',
|
||||
'desc' => $this->l('Your official Vimeo account.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Instagram URL:'),
|
||||
'name' => 'blocksocial_instagram',
|
||||
'desc' => $this->l('Your official Instagram account.'),
|
||||
),
|
||||
),
|
||||
'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;
|
||||
$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(
|
||||
'blocksocial_facebook' => Tools::getValue('blocksocial_facebook', Configuration::get('BLOCKSOCIAL_FACEBOOK')),
|
||||
'blocksocial_twitter' => Tools::getValue('blocksocial_twitter', Configuration::get('BLOCKSOCIAL_TWITTER')),
|
||||
'blocksocial_rss' => Tools::getValue('blocksocial_rss', Configuration::get('BLOCKSOCIAL_RSS')),
|
||||
'blocksocial_youtube' => Tools::getValue('blocksocial_youtube', Configuration::get('BLOCKSOCIAL_YOUTUBE')),
|
||||
'blocksocial_google_plus' => Tools::getValue('blocksocial_google_plus', Configuration::get('BLOCKSOCIAL_GOOGLE_PLUS')),
|
||||
'blocksocial_pinterest' => Tools::getValue('blocksocial_pinterest', Configuration::get('BLOCKSOCIAL_PINTEREST')),
|
||||
'blocksocial_vimeo' => Tools::getValue('blocksocial_vimeo', Configuration::get('BLOCKSOCIAL_VIMEO')),
|
||||
'blocksocial_instagram' => Tools::getValue('blocksocial_instagram', Configuration::get('BLOCKSOCIAL_INSTAGRAM')),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
39
modules/blocksocial/blocksocial.tpl
Normal file
@ -0,0 +1,39 @@
|
||||
{*
|
||||
* 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="social_block">
|
||||
<h4 class="title_block">{l s='Follow us' mod='blocksocial'}</h4>
|
||||
<ul>
|
||||
{if $facebook_url != ''}<li class="facebook"><a class="_blank" href="{$facebook_url|escape:html:'UTF-8'}">{l s='Facebook' mod='blocksocial'}</a></li>{/if}
|
||||
{if $twitter_url != ''}<li class="twitter"><a class="_blank" href="{$twitter_url|escape:html:'UTF-8'}">{l s='Twitter' mod='blocksocial'}</a></li>{/if}
|
||||
{if $rss_url != ''}<li class="rss"><a class="_blank" href="{$rss_url|escape:html:'UTF-8'}">{l s='RSS' mod='blocksocial'}</a></li>{/if}
|
||||
{if $youtube_url != ''}<li class="youtube"><a class="_blank" href="{$youtube_url|escape:html:'UTF-8'}">{l s='YouTube' mod='blocksocial'}</a></li>{/if}
|
||||
{if $google_plus_url != ''}<li class="google_plus"><a class="_blank" href="{$google_plus_url|escape:html:'UTF-8'}">{l s='Google+' mod='blocksocial'}</a></li>{/if}
|
||||
{if $pinterest_url != ''}<li class="pinterest"><a class="_blank" href="{$pinterest_url|escape:html:'UTF-8'}">{l s='Pinterest' mod='blocksocial'}</a></li>{/if}
|
||||
{if $vimeo_url != ''}<li class="vimeo"><a href="{$vimeo_url|escape:html:'UTF-8'}">{l s='Vimeo' mod='blocksocial'}</a></li>{/if}
|
||||
{if $instagram_url != ''}<li class="instagram"><a class="_blank" href="{$instagram_url|escape:html:'UTF-8'}">{l s='Instagram' mod='blocksocial'}</a></li>{/if}
|
||||
</ul>
|
||||
</div>
|
12
modules/blocksocial/config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocksocial</name>
|
||||
<displayName><![CDATA[Social networking block]]></displayName>
|
||||
<version><![CDATA[1.1.5]]></version>
|
||||
<description><![CDATA[Allows you to add information about your brand's social networking accounts.]]></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>
|