updates and fixes 14.11.2013

This commit is contained in:
TMMeilleur
2013-11-14 18:08:05 +02:00
parent 051ed32133
commit 0d1c113be1
39 changed files with 999 additions and 194 deletions
+184
View File
@@ -0,0 +1,184 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_'))
exit;
class BlockBanner extends Module
{
public function __construct()
{
$this->name = 'blockbanner';
$this->tab = 'other';
$this->version = 1.0;
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Banner block');
$this->description = $this->l('Displays banner at the top of the store.');
}
public function install()
{
Configuration::updateValue('BLOCKBANNER_IMG', 'store.jpg');
Configuration::updateValue('BLOCKBANNER_LINK', '');
Configuration::updateValue('BLOCKBANNER_DESC', '');
return parent::install() && $this->registerHook('displayTop') && $this->registerHook('header');
}
public function uninstall()
{
Configuration::deleteByName('BLOCKBANNER_IMG');
Configuration::deleteByName('BLOCKBANNER_LINK');
Configuration::deleteByName('BLOCKBANNER_DESC');
return parent::uninstall();
}
public function hookDisplayTop($params)
{
if (!$this->isCached('blockbanner.tpl', $this->getCacheId()))
{
$this->smarty->assign('banner_img', Configuration::get('BLOCKBANNER_IMG'));
$this->smarty->assign('banner_link', Configuration::get('BLOCKBANNER_LINK'));
$this->smarty->assign('banner_desc', Configuration::get('BLOCKBANNER_DESC'));
$sql = 'SELECT COUNT(*)
FROM '._DB_PREFIX_.'store s'
.Shop::addSqlAssociation('store', 's');
$total = Db::getInstance()->getValue($sql);
if ($total <= 0)
return;
}
return $this->display(__FILE__, 'blockbanner.tpl', $this->getCacheId());
}
public function hookHeader($params)
{
$this->context->controller->addCSS($this->_path.'blockbanner.css', 'all');
}
public function postProcess()
{
if (Tools::isSubmit('submitStoreConf'))
{
if (isset($_FILES['BLOCKBANNER_IMG']) && isset($_FILES['BLOCKBANNER_IMG']['tmp_name']) && !empty($_FILES['BLOCKBANNER_IMG']['tmp_name']))
{
if ($error = ImageManager::validateUpload($_FILES['BLOCKBANNER_IMG'], 4000000))
return $this->displayError($this->l('Invalid image'));
else
{
$ext = substr($_FILES['BLOCKBANNER_IMG']['name'], strrpos($_FILES['BLOCKBANNER_IMG']['name'], '.') + 1);
$file_name = md5($_FILES['BLOCKBANNER_IMG']['name']).'.'.$ext;
if (!move_uploaded_file($_FILES['BLOCKBANNER_IMG']['tmp_name'], dirname(__FILE__).'/'.$file_name))
return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
else
{
if (Configuration::hasContext('BLOCKBANNER_IMG', null, Shop::getContext()) && Configuration::get('BLOCKBANNER_IMG') != $file_name)
@unlink(dirname(__FILE__).'/'.Configuration::get('BLOCKBANNER_IMG'));
Configuration::updateValue('BLOCKBANNER_IMG', $file_name);
$this->_clearCache('blockbanner.tpl');
return $this->displayConfirmation($this->l('The settings have been updated.'));
}
}
}
Configuration::updateValue('BLOCKBANNER_LINK', Tools::getValue('BLOCKBANNER_LINK'));
Configuration::updateValue('BLOCKBANNER_DESC', Tools::getValue('BLOCKBANNER_DESC'));
}
return '';
}
public function getContent()
{
return $this->postProcess().$this->renderForm();
return $output;
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'file',
'label' => $this->l('Block image'),
'name' => 'BLOCKBANNER_IMG',
'desc' => $this->l('Please upload banner image'),
'thumb' => '../modules/'.$this->name.'/'.Configuration::get('BLOCKBANNER_IMG'),
),
array(
'type' => 'text',
'label' => $this->l('Image Link'),
'name' => 'BLOCKBANNER_LINK',
'desc' => $this->l('Please input banner link')
),
array(
'type' => 'text',
'label' => $this->l('Image description'),
'name' => 'BLOCKBANNER_DESC',
'desc' => $this->l('Please input banner image description')
)
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'btn btn-default')
),
);
$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 = 'submitStoreConf';
$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(
'BLOCKBANNER_IMG' => Tools::getValue('BLOCKBANNER_IMG', Configuration::get('BLOCKBANNER_IMG')),
'BLOCKBANNER_LINK' => Tools::getValue('BLOCKBANNER_LINK', Configuration::get('BLOCKBANNER_LINK')),
'BLOCKBANNER_DESC' => Tools::getValue('BLOCKBANNER_DESC', Configuration::get('BLOCKBANNER_DESC')),
);
}
}
+36
View File
@@ -0,0 +1,36 @@
{*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<!-- Block stores module -->
<div id="banner_block_top">
<div class="banner-top">
<div class="container">
<a href="{$banner_link}" title="{$banner_desc}">
<img src="{$module_dir}{$banner_img}" alt="{$banner_desc}"/>
</a>
</div>
</div>
</div>
<!-- /Block stores module -->
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blockbanner</name>
<displayName><![CDATA[Banner block]]></displayName>
<version><![CDATA[1]]></version>
<description><![CDATA[Displays banner at the top of the store.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[other]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>
+35
View File
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>productpaymentlogos</name>
<displayName><![CDATA[Product payment logos block]]></displayName>
<version><![CDATA[1]]></version>
<description><![CDATA[Displays payment system logos at the product page.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[other]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+35
View File
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@@ -0,0 +1,184 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_'))
exit;
class ProductPaymentLogos extends Module
{
public function __construct()
{
$this->name = 'productpaymentlogos';
$this->tab = 'other';
$this->version = 1.0;
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Product payment logos block');
$this->description = $this->l('Displays payment system logos at the product page.');
}
public function install()
{
Configuration::updateValue('PRODUCTPAYMENTLOGOS_IMG', 'payment-logo.png');
Configuration::updateValue('PRODUCTPAYMENTLOGOS_LINK', '');
Configuration::updateValue('PRODUCTPAYMENTLOGOS_TITLE', '');
return parent::install() && $this->registerHook('displayProductButtons') && $this->registerHook('header');
}
public function uninstall()
{
Configuration::deleteByName('PRODUCTPAYMENTLOGOS_IMG');
Configuration::deleteByName('PRODUCTPAYMENTLOGOS_LINK');
Configuration::deleteByName('PRODUCTPAYMENTLOGOS_TITLE');
return parent::uninstall();
}
public function hookDisplayProductButtons($params)
{
if (!$this->isCached('productpaymentlogos.tpl', $this->getCacheId()))
{
$this->smarty->assign('banner_img', Configuration::get('PRODUCTPAYMENTLOGOS_IMG'));
$this->smarty->assign('banner_link', Configuration::get('PRODUCTPAYMENTLOGOS_LINK'));
$this->smarty->assign('banner_title', Configuration::get('PRODUCTPAYMENTLOGOS_TITLE'));
$sql = 'SELECT COUNT(*)
FROM '._DB_PREFIX_.'store s'
.Shop::addSqlAssociation('store', 's');
$total = Db::getInstance()->getValue($sql);
if ($total <= 0)
return;
}
return $this->display(__FILE__, 'productpaymentlogos.tpl', $this->getCacheId());
}
public function hookHeader($params)
{
$this->context->controller->addCSS($this->_path.'productpaymentlogos.css', 'all');
}
public function postProcess()
{
if (Tools::isSubmit('submitStoreConf'))
{
if (isset($_FILES['PRODUCTPAYMENTLOGOS_IMG']) && isset($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name']) && !empty($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name']))
{
if ($error = ImageManager::validateUpload($_FILES['PRODUCTPAYMENTLOGOS_IMG'], 4000000))
return $this->displayError($this->l('Invalid image'));
else
{
$ext = substr($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name'], strrpos($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name'], '.') + 1);
$file_name = md5($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name']).'.'.$ext;
if (!move_uploaded_file($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name'], dirname(__FILE__).'/'.$file_name))
return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
else
{
if (Configuration::hasContext('PRODUCTPAYMENTLOGOS_IMG', null, Shop::getContext()) && Configuration::get('PRODUCTPAYMENTLOGOS_IMG') != $file_name)
@unlink(dirname(__FILE__).'/'.Configuration::get('PRODUCTPAYMENTLOGOS_IMG'));
Configuration::updateValue('PRODUCTPAYMENTLOGOS_IMG', $file_name);
$this->_clearCache('productpaymentlogos.tpl');
return $this->displayConfirmation($this->l('The settings have been updated.'));
}
}
}
Configuration::updateValue('PRODUCTPAYMENTLOGOS_LINK', Tools::getValue('PRODUCTPAYMENTLOGOS_LINK'));
Configuration::updateValue('PRODUCTPAYMENTLOGOS_TITLE', Tools::getValue('PRODUCTPAYMENTLOGOS_TITLE'));
}
return '';
}
public function getContent()
{
return $this->postProcess().$this->renderForm();
return $output;
}
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('Logos heading'),
'name' => 'PRODUCTPAYMENTLOGOS_TITLE',
'desc' => $this->l('Please input logos heading')
),
array(
'type' => 'file',
'label' => $this->l('Block image'),
'name' => 'PRODUCTPAYMENTLOGOS_IMG',
'desc' => $this->l('Please upload banner image'),
'thumb' => '../modules/'.$this->name.'/'.Configuration::get('PRODUCTPAYMENTLOGOS_IMG'),
),
array(
'type' => 'text',
'label' => $this->l('Image Link'),
'name' => 'PRODUCTPAYMENTLOGOS_LINK',
'desc' => $this->l('Please input banner link')
)
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'btn btn-default')
),
);
$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 = 'submitStoreConf';
$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(
'PRODUCTPAYMENTLOGOS_IMG' => Tools::getValue('PRODUCTPAYMENTLOGOS_IMG', Configuration::get('PRODUCTPAYMENTLOGOS_IMG')),
'PRODUCTPAYMENTLOGOS_LINK' => Tools::getValue('PRODUCTPAYMENTLOGOS_LINK', Configuration::get('PRODUCTPAYMENTLOGOS_LINK')),
'PRODUCTPAYMENTLOGOS_TITLE' => Tools::getValue('PRODUCTPAYMENTLOGOS_TITLE', Configuration::get('PRODUCTPAYMENTLOGOS_TITLE')),
);
}
}
@@ -0,0 +1,38 @@
{*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<!-- Block stores module -->
{if !$content_only}
</div>
<div id="product_payment_logos">
<div class="box-security">
<h5 class="product-heading-h5">{$banner_title}</h5>
<a href="{$banner_link}" title="{$banner_title}"><img src="{$module_dir}{$banner_img}" alt="{$banner_title}"/></a>
</div>
{/if}
<!-- /Block stores module -->
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;
@@ -37,6 +37,7 @@ class ThemeConfigurator extends Module
parent::__construct();
$this->displayName = $this->l('Theme configurator');
$this->description = $this->l('Configure elements of your theme');
$this->bootstrap = true;
}
@@ -187,6 +188,20 @@ class ThemeConfigurator extends Module
'label' => $this->l('Enable Quick view'),
'name' => 'quick_view',
'value' => (int)Tools::getValue('PS_QUICK_VIEW', Configuration::get('PS_QUICK_VIEW'))
),
array(
'label' => $this->l('Enable top banner'),
'name' => 'blockbanner',
'desc' => '<a href="#">'.$this->l('Configure').'</a>',
'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockbanner')) && $module->active),
'is_module' => true,
),
array(
'label' => $this->l('Enable product payment logos'),
'name' => 'productpaymentlogos',
'desc' => '<a href="#">'.$this->l('Configure').'</a>',
'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('productpaymentlogos')) && $module->active),
'is_module' => true,
)
);
}
+1
View File
@@ -15,6 +15,7 @@ class TmHtmlContent extends Module {
$this->author = 'TemplateMonster'; // Defines module author
$this->version = '1.0'; // Defines module version
$this->secure_key = Tools::encrypt($this->name);
$this->bootstrap = true;
$this->_defaultLanguage = Language::getLanguage(Configuration::get('PS_LANG_DEFAULT'));
$this->_languages = Language::getLanguages();
+10 -48
View File
@@ -27,33 +27,13 @@
font-size:16px;
color:#090;
}
.new-item .languages {
float:left;
overflow:hidden;
}
.new-item .languages li {
float:left;
margin-right:5px;
padding:5px;
width:26px;
height:18px;
text-align:center;
}
.new-item .languages li.active {
background:#d1d1d1;
}
.lang-tabs {
position:relative;
z-index:99;
clear:both;
overflow:hidden;
margin-top:20px;
}
.lang-tabs li {
border:1px solid #f3f3f3;
border-bottom:1px solid #e9e9e9;
border-bottom:none;
background:#FAFAFA;
float:left;
padding:15px;
@@ -61,6 +41,7 @@
line-height:24px;
margin-right:5px;
cursor:pointer;
margin-bottom:0;
}
.lang-tabs li img {
vertical-align:baseline;
@@ -83,19 +64,22 @@
}
h3.hook-title {
h4.hook-title {
border:1px solid #d1d1d1;
background:#e5e5e5;
padding:10px 10px;
margin:20px 0 !important;
text-transform:capitalize;
clear:both;
}
#items {
padding-left:0;
}
.item {
margin:0 0 5px;
padding:10px;
border:1px solid #e5e5e5;
background:#F1F1F1;
background:#fff;
line-height:25px;
font-weight:bold;
color:#444;
@@ -125,15 +109,6 @@ h3.hook-title {
padding-left:10px;
font-size:18px;
}
.item .button{
float:right;
margin-left:10px;
cursor:pointer;
font-size:14px;
line-height:18px;
vertical-align: bottom;
}
.item .button i{
margin-right:5px;
font-size:16px;
@@ -175,26 +150,13 @@ h3.hook-title {
line-height:normal;
position:relative;
overflow:hidden;
padding-top:10px;
}
.new-item .item-container {
display:none;
padding:10px;
border:1px solid #ccc;
background:#F1F1F1;
line-height:normal;
position:relative;
overflow:hidden;
clear:both;
}
.item .item-field, .new-item .item-field {
padding:10px 0;
clear:both;
overflow:hidden;
}
.item .image-display, .new-item .image-display {
position:absolute;
top:20px;
right:20px;
text-align:center;
}
.item .image-display img, .new-item .image-display img {
max-width:400px;
+1 -1
View File
@@ -1,6 +1,6 @@
jQuery(document).ready(function() {
$('.button.new-item').click(function() {
var item_container = $(this).parent('.new-item');
var item_container = $(this).parent().parent('.new-item');
item_container.toggleClass('active').children('.item-container').slideToggle();
});
$('.button-edit').click(function() {
@@ -1,4 +1,4 @@
<ul class="lang-tabs">
<ul class="lang-tabs nav nav-tabs">
{foreach from=$htmlitems.lang.all item=lang}
<li id="lang-{$lang.id_lang}" class="lang-flag{if $lang.id_lang == $htmlitems.lang.default.id_lang} active{/if}"><img src="../img/l/{$lang.id_lang}.jpg" class="pointer" alt="{$lang.name}" title="{$lang.name}" /> {$lang.name}</li>
{/foreach}
@@ -9,73 +9,97 @@
<div id="items-{$lang}" class="lang-content" style="display:{if $lang == $htmlitems.lang.default.id_lang}block{else}none{/if};">
{foreach name=hooks from=$langItems key=hook item=hookItems}
<h3 class="hook-title">{l s='Hook' mod='tmhtmlcontent'} "{$hook}"</h3>
<h4 class="hook-title">{l s='Hook' mod='tmhtmlcontent'} "{$hook}"</h4>
{if $hookItems}
<ul id="items">
{foreach name=items from=$hookItems item=hItem}
<li id="item-{$hItem.id_item}" class="item">
<li id="item-{$hItem.id_item}" class="item panel">
<span class="item-order">{if $hItem.item_order le 9}0{/if}{$hItem.item_order}</span>
<!--<i class="icon-sort"></i>-->
<span class="item-title">{$hItem.title}</span>
<span class="button button-edit"><i class="icon-edit"></i>{l s='Edit' mod='tmhtmlcontent'}</span>
<span class="button button-close"><i class="icon-remove"></i>{l s='Close' mod='tmhtmlcontent'}</span>
<span class="button btn btn-default button-edit pull-right"><i class="icon-edit"></i>{l s='Edit' mod='tmhtmlcontent'}</span>
<span class="button btn btn-default button-close pull-right"><i class="icon-remove"></i>{l s='Close' mod='tmhtmlcontent'}</span>
<div class="item-container">
<form method="post" action="{$htmlitems.postAction}" enctype="multipart/form-data" class="item-form">
<input type="hidden" name="lang_id" value="{$lang}" />
<input type="hidden" name="item_id" value="{$hItem.id_item}" />
<input type="hidden" name="item_order" value="{$hItem.item_order}" />
<div class="active item-field">
<label>{l s='Active' mod='tmhtmlcontent'}</label>
<input type="checkbox" name="item_active" value="1"{if $hItem.active == 1} checked="checked"{/if} />
</div>
<div class="title item-field">
<label>{l s='Title' mod='tmhtmlcontent'}</label>
<input type="text" name="item_title" size="48" value="{$hItem.title}" />
</div>
<div class="title_use item-field">
<label>{l s='Use title in front' mod='tmhtmlcontent'}</label>
<input type="checkbox" name="item_title_use" value="1"{if $hItem.title_use == 1} checked="checked"{/if} />
</div>
<div class="hook item-field">
<label>{l s='Hook' mod='tmhtmlcontent'}</label>
<select name="item_hook" default="home">
<option value="home"{if $hItem.hook == 'home'} selected="selected"{/if}>home</option>
<option value="top"{if $hItem.hook == 'top'} selected="selected"{/if}>top</option>
<option value="left"{if $hItem.hook == 'left'} selected="selected"{/if}>left</option>
<option value="right"{if $hItem.hook == 'right'} selected="selected"{/if}>right</option>
<option value="footer"{if $hItem.hook == 'footer'} selected="selected"{/if}>footer</option>
</select>
</div>
<div class="image item-field">
<label>{l s='Image' mod='tmhtmlcontent'}</label>
<input type="file" name="item_img" />
</div>
<div class="image-display item-field">
<form method="post" action="{$htmlitems.postAction}" enctype="multipart/form-data" class="item-form defaultForm form-horizontal">
<input type="hidden" name="lang_id" value="{$lang}" />
<input type="hidden" name="item_id" value="{$hItem.id_item}" />
<input type="hidden" name="item_order" value="{$hItem.item_order}" />
<div class="image-display item-field form-group">
<img src="{$module_dir}images/{$hItem.image}" alt="" title="" style="width:{$hItem.image_w}px; height:{$hItem.image_h}px;{if !$hItem.image} display:none;{/if}" class="preview" />
</div>
<div class="image_w item-field">
<label>{l s='Image width' mod='tmhtmlcontent'}</label>
<input name="item_img_w" type="text" maxlength="4" size="4" value="{$hItem.image_w}"/></br>
<div class="active item-field form-group">
<label class="control-label col-lg-3">{l s='Active' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="checkbox" name="item_active" value="1"{if $hItem.active == 1} checked="checked"{/if} />
</div>
</div>
<div class="image_h item-field">
<label>{l s='Image height' mod='tmhtmlcontent'}</label>
<input name="item_img_h" type="text" maxlength="4" size="4" value="{$hItem.image_h}"/>
<div class="title item-field form-group">
<label class="control-label col-lg-3">{l s='Title' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="text" name="item_title" size="48" value="{$hItem.title}" />
</div>
</div>
<div class="url item-field">
<label>{l s='URL' mod='tmhtmlcontent'}</label>
<input type="text" name="item_url" size="48" value="{$hItem.url}" />
<div class="title_use item-field form-group">
<label class="control-label col-lg-3">{l s='Use title in front' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="checkbox" name="item_title_use" value="1"{if $hItem.title_use == 1} checked="checked"{/if} />
</div>
</div>
<div class="target item-field">
<label>{l s='Target blank' mod='tmhtmlcontent'}</label>
<input type="checkbox" name="item_target" value="1"{if $hItem.target == 1} checked="checked"{/if} />
<div class="hook item-field form-group">
<label class="control-label col-lg-3">{l s='Hook' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<select name="item_hook" default="home">
<option value="home"{if $hItem.hook == 'home'} selected="selected"{/if}>home</option>
<option value="top"{if $hItem.hook == 'top'} selected="selected"{/if}>top</option>
<option value="left"{if $hItem.hook == 'left'} selected="selected"{/if}>left</option>
<option value="right"{if $hItem.hook == 'right'} selected="selected"{/if}>right</option>
<option value="footer"{if $hItem.hook == 'footer'} selected="selected"{/if}>footer</option>
</select>
</div>
</div>
<div class="html item-field">
<label>{l s='HTML' mod='tmhtmlcontent'}</label>
<textarea name="item_html" cols="65" rows="12">{$hItem.html}</textarea>
<div class="image item-field form-group">
<label class="control-label col-lg-3">{l s='Image' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="file" name="item_img" />
</div>
</div>
<div class="image_w item-field form-group">
<label class="control-label col-lg-3">{l s='Image width' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input name="item_img_w" type="text" maxlength="4" size="4" value="{$hItem.image_w}"/>
</div>
</div>
<div class="image_h item-field form-group">
<label class="control-label col-lg-3">{l s='Image height' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input name="item_img_h" type="text" maxlength="4" size="4" value="{$hItem.image_h}"/>
</div>
</div>
<div class="url item-field form-group">
<label class="control-label col-lg-3">{l s='URL' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="text" name="item_url" size="48" value="{$hItem.url}" />
</div>
</div>
<div class="target item-field form-group">
<label class="control-label col-lg-3">{l s='Target blank' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="checkbox" name="item_target" value="1"{if $hItem.target == 1} checked="checked"{/if} />
</div>
</div>
<div class="html item-field form-group">
<label class="control-label col-lg-3">{l s='HTML' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<textarea name="item_html" cols="65" rows="12">{$hItem.html}</textarea>
</div>
</div>
<div class="form-group">
<div class="col-lg-9 col-lg-offset-3">
<button type="submit" name="removeItem" class="button btn btn-default button-remove" onClick="this.form.submit();"><i class="icon-remove-sign"></i>{l s='Remove' mod='tmhtmlcontent'}</button>
<button type="submit" name="updateItem" class="button btn btn-default button-save" onClick="this.form.submit();"><i class="icon-save"></i>{l s='Save' mod='tmhtmlcontent'}</button>
</div>
</div>
<button type="submit" name="removeItem" class="button button-remove" onClick="this.form.submit();"><i class="icon-remove-sign"></i>{l s='Remove' mod='tmhtmlcontent'}</button>
<button type="submit" name="updateItem" class="button button-save" onClick="this.form.submit();"><i class="icon-save"></i>{l s='Save' mod='tmhtmlcontent'}</button>
</form>
</div>
</li>
@@ -1,3 +1,3 @@
<div id="{$id}-response" {if !isset($text)}style="display:none;"{/if} class="message {if isset($class)}{$class}{/if}">
<div class="content">{if isset($text)}{$text}{/if}</div>
<div id="{$id}-response" {if !isset($text)}style="display:none;"{/if} class="message alert alert-{if isset($class) && $class=='error'}danger{else}success{/if}">
<div>{if isset($text)}{$text}{/if}</div>
</div>
@@ -1,57 +1,91 @@
<div class="new-item">
<span class="button new-item"><i class="icon-plus-sign"></i>{l s='Add item' mod='tmhtmlcontent'}</span>
<div class="form-group clearfix">
<span class="button btn btn-default new-item"><i class="icon-plus-sign"></i>{l s='Add item' mod='tmhtmlcontent'}</span>
</div>
<div class="item-container">
<form method="post" action="{$htmlitems.postAction}" enctype="multipart/form-data" class="item-form">
<div class="language item-field">
<label>{l s='Language' mod='tmhtmlcontent'}</label>
<ul class="languages">
{foreach from=$htmlitems.lang.all item=lang}
<li id="lang-{$lang.id_lang}" class="new-lang-flag{if $lang.id_lang == $htmlitems.lang.default.id_lang} active{/if}"><img src="../img/l/{$lang.id_lang}.jpg" class="pointer" alt="{$lang.name}" title="{$lang.name}" /></li>
{/foreach}
</ul>
<input type="hidden" id="lang-id" name="lang_id" value="{$htmlitems.lang.default.id_lang}" />
<form method="post" action="{$htmlitems.postAction}" enctype="multipart/form-data" class="item-form defaultForm form-horizontal">
<div class="panel">
<div class="language item-field form-group">
<label class="control-label col-lg-3">{l s='Language' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" >
{foreach from=$htmlitems.lang.all item=lang}
{if $lang.id_lang == $htmlitems.lang.default.id_lang} {$lang.iso_code}{/if}
{/foreach}
<span class="caret">&nbsp;</span>
</button>
<ul class="languages dropdown-menu">
{foreach from=$htmlitems.lang.all item=lang}
<li id="lang-{$lang.id_lang}" class="new-lang-flag"><a href="javascript:hideOtherLanguage({$lang.id_lang});">{$lang.name}</a></li>
{/foreach}
</ul>
<input type="hidden" id="lang-id" name="lang_id" value="{$htmlitems.lang.default.id_lang}" />
</div>
</div>
<div class="title item-field form-group">
<label class="control-label col-lg-3 ">{l s='Title' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input class="form-control" type="text" name="item_title" size="48" value="" />
</div>
</div>
<div class="title_use item-field form-group">
<label class="control-label col-lg-3">{l s='Use title in front' mod='tmhtmlcontent'}</label>
<input type="checkbox" name="item_title_use" value="1" />
</div>
<div class="hook item-field form-group">
<label class="control-label col-lg-3">{l s='Hook' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<select class="form-control" name="item_hook" default="home">
<option value="home">home</option>
<option value="top">top</option>
<option value="left">left</option>
<option value="right">right</option>
<option value="footer">footer</option>
</select>
</div>
</div>
<div class="image item-field form-group">
<label class="control-label col-lg-3">{l s='Image' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="file" name="item_img" />
</div>
</div>
<div class="image_w item-field form-group">
<label class="control-label col-lg-3">{l s='Image width' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input name="item_img_w" type="text" maxlength="4" size="4" value=""/>
</div>
</div>
<div class="image_h item-field form-group">
<label class="control-label col-lg-3">{l s='Image height' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input name="item_img_h" type="text" maxlength="4" size="4" value=""/>
</div>
</div>
<div class="url item-field form-group">
<label class="control-label col-lg-3">{l s='URL' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="text" name="item_url" size="48" value="http://" />
</div>
</div>
<div class="target item-field form-group">
<label class="control-label col-lg-3">{l s='Target blank' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<input type="checkbox" name="item_target" value="1" />
</div>
</div>
<div class="html item-field form-group">
<label class="control-label col-lg-3">{l s='HTML' mod='tmhtmlcontent'}</label>
<div class="col-lg-7">
<textarea name="item_html" cols="65" rows="12"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-lg-9 col-lg-offset-3">
<button type="submit" name="newItem" class="button-save btn btn-default" onClick="this.form.submit();">{l s='Save' mod='tmhtmlcontent'}</button>
</div>
</div>
</div>
<div class="title item-field">
<label>{l s='Title' mod='tmhtmlcontent'}</label>
<input type="text" name="item_title" size="48" value="" />
</div>
<div class="title_use item-field">
<label>{l s='Use title in front' mod='tmhtmlcontent'}</label>
<input type="checkbox" name="item_title_use" value="1" />
</div>
<div class="hook item-field">
<label>{l s='Hook' mod='tmhtmlcontent'}</label>
<select name="item_hook" default="home">
<option value="home">home</option>
<option value="top">top</option>
<option value="left">left</option>
<option value="right">right</option>
<option value="footer">footer</option>
</select>
</div>
<div class="image item-field">
<label>{l s='Image' mod='tmhtmlcontent'}</label>
<input type="file" name="item_img" />
</div>
<div class="image_w item-field">
<label>{l s='Image width' mod='tmhtmlcontent'}</label><input name="item_img_w" type="text" maxlength="4" size="4" value=""/></br>
</div>
<div class="image_h item-field">
<label>{l s='Image height' mod='tmhtmlcontent'}</label><input name="item_img_h" type="text" maxlength="4" size="4" value=""/>
</div>
<div class="url item-field">
<label>{l s='URL' mod='tmhtmlcontent'}</label>
<input type="text" name="item_url" size="48" value="http://" />
</div>
<div class="target item-field">
<label>{l s='Target blank' mod='tmhtmlcontent'}</label>
<input type="checkbox" name="item_target" value="1" />
</div>
<div class="html item-field">
<label>{l s='HTML' mod='tmhtmlcontent'}</label>
<textarea name="item_html" cols="65" rows="12"></textarea>
</div>
<button type="submit" name="newItem" class="button button-save" onClick="this.form.submit();"><i class="icon-save"></i>{l s='Save' mod='tmhtmlcontent'}</button>
</form>
</div>
</div>