Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -724,7 +724,7 @@ class ValidateCore
|
|||||||
*/
|
*/
|
||||||
public static function isTrackingNumber($tracking_number)
|
public static function isTrackingNumber($tracking_number)
|
||||||
{
|
{
|
||||||
return preg_match('/^[~:#,%&_=\(\)\.\? \+\-@\/a-zA-Z0-9]+$/', $tracking_number);
|
return preg_match('/^[~:#,%&_=\(\)\[\]\.\? \+\-@\/a-zA-Z0-9]+$/', $tracking_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -747,7 +747,7 @@ class ValidateCore
|
|||||||
public static function isAbsoluteUrl($url)
|
public static function isAbsoluteUrl($url)
|
||||||
{
|
{
|
||||||
if (!empty($url))
|
if (!empty($url))
|
||||||
return preg_match('/^https?:\/\/[,:#%&_=\(\)\.\? \+\-@\/a-zA-Z0-9]+$/', $url);
|
return preg_match('/^https?:\/\/[~:#,%&_=\(\)\[\]\.\? \+\-@\/a-zA-Z0-9]+$/', $url);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ abstract class ModuleCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if module is installed
|
// Check if module is installed
|
||||||
$result = Db::getInstance()->getRow('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($this->name).'\'');
|
$result = Module::isInstalled($this->name);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$this->_errors[] = $this->l('This module has already been installed.');
|
$this->_errors[] = $this->l('This module has already been installed.');
|
||||||
@@ -1543,7 +1543,7 @@ abstract class ModuleCore
|
|||||||
{
|
{
|
||||||
if (!Cache::isStored('Module::isInstalled'.$module_name))
|
if (!Cache::isStored('Module::isInstalled'.$module_name))
|
||||||
{
|
{
|
||||||
$id_module = Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($module_name).'\'');
|
$id_module = Module::getModuleIdByName($module_name);
|
||||||
Cache::store('Module::isInstalled'.$module_name, (bool)$id_module);
|
Cache::store('Module::isInstalled'.$module_name, (bool)$id_module);
|
||||||
}
|
}
|
||||||
return Cache::retrieve('Module::isInstalled'.$module_name);
|
return Cache::retrieve('Module::isInstalled'.$module_name);
|
||||||
@@ -1554,7 +1554,7 @@ abstract class ModuleCore
|
|||||||
if (!Cache::isStored('Module::isEnabled'.$module_name))
|
if (!Cache::isStored('Module::isEnabled'.$module_name))
|
||||||
{
|
{
|
||||||
$active = false;
|
$active = false;
|
||||||
$id_module = Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($module_name).'\'');
|
$id_module = Module::getModuleIdByName($module_name);
|
||||||
if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.(int)$id_module.' AND `id_shop` = '.(int)Context::getContext()->shop->id))
|
if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.(int)$id_module.' AND `id_shop` = '.(int)Context::getContext()->shop->id))
|
||||||
$active = true;
|
$active = true;
|
||||||
Cache::store('Module::isEnabled'.$module_name, (bool)$active);
|
Cache::store('Module::isEnabled'.$module_name, (bool)$active);
|
||||||
|
|||||||
@@ -28,7 +28,8 @@
|
|||||||
define('_PS_MODE_DEV_', true);
|
define('_PS_MODE_DEV_', true);
|
||||||
if (_PS_MODE_DEV_)
|
if (_PS_MODE_DEV_)
|
||||||
{
|
{
|
||||||
@ini_set('display_errors', 'on');
|
@ini_set('display_errors', 'on');
|
||||||
|
@error_reporting(E_ALL | E_STRICT);
|
||||||
define('_PS_DEBUG_SQL_', true);
|
define('_PS_DEBUG_SQL_', true);
|
||||||
/* Compatibility warning */
|
/* Compatibility warning */
|
||||||
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);
|
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);
|
||||||
|
|||||||
@@ -669,7 +669,7 @@ class AdminCustomersControllerCore extends AdminController
|
|||||||
'count_better_customers' => $count_better_customers,
|
'count_better_customers' => $count_better_customers,
|
||||||
'shop_is_feature_active' => Shop::isFeatureActive(),
|
'shop_is_feature_active' => Shop::isFeatureActive(),
|
||||||
'name_shop' => $shop->name,
|
'name_shop' => $shop->name,
|
||||||
'customer_birthday' => Tools::displayDate($customer->birthday, $this->default_form_language),
|
'customer_birthday' => Tools::displayDate($customer->birthday),
|
||||||
'last_update' => Tools::displayDate($customer->date_upd,null , true),
|
'last_update' => Tools::displayDate($customer->date_upd,null , true),
|
||||||
'customer_exists' => Customer::customerExists($customer->email),
|
'customer_exists' => Customer::customerExists($customer->email),
|
||||||
'id_lang' => $customer->id_lang,
|
'id_lang' => $customer->id_lang,
|
||||||
|
|||||||
@@ -139,6 +139,9 @@ class AuthControllerCore extends FrontController
|
|||||||
'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')
|
'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// Just set $this->template value here in case it's used by Ajax
|
||||||
|
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
|
||||||
|
|
||||||
if ($this->ajax)
|
if ($this->ajax)
|
||||||
{
|
{
|
||||||
// Call a hook to display more information on form
|
// Call a hook to display more information on form
|
||||||
@@ -150,12 +153,11 @@ class AuthControllerCore extends FrontController
|
|||||||
$return = array(
|
$return = array(
|
||||||
'hasError' => !empty($this->errors),
|
'hasError' => !empty($this->errors),
|
||||||
'errors' => $this->errors,
|
'errors' => $this->errors,
|
||||||
'page' => $this->context->smarty->fetch(_PS_THEME_DIR_.'authentication.tpl'),
|
'page' => $this->context->smarty->fetch($this->template),
|
||||||
'token' => Tools::getToken(false)
|
'token' => Tools::getToken(false)
|
||||||
);
|
);
|
||||||
die(Tools::jsonEncode($return));
|
die(Tools::jsonEncode($return));
|
||||||
}
|
}
|
||||||
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ class ContactControllerCore extends FrontController
|
|||||||
$tmp = $order->getProducts();
|
$tmp = $order->getProducts();
|
||||||
foreach ($tmp as $key => $val)
|
foreach ($tmp as $key => $val)
|
||||||
$products[$row['id_order']][$val['product_id']] = array('value' => $val['product_id'], 'label' => $val['product_name']);
|
$products[$row['id_order']][$val['product_id']] = array('value' => $val['product_id'], 'label' => $val['product_name']);
|
||||||
$orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0],null , 'selected' => (int)Tools::getValue('id_order') == $order->id);
|
$orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0],null) , 'selected' => (int)Tools::getValue('id_order') == $order->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->context->smarty->assign('orderList', $orders);
|
$this->context->smarty->assign('orderList', $orders);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ abstract class InstallControllerHttp
|
|||||||
/**
|
/**
|
||||||
* @var array List of installer steps
|
* @var array List of installer steps
|
||||||
*/
|
*/
|
||||||
protected static $steps = array('welcome', 'license', 'system', 'database', 'configure', 'process');
|
protected static $steps = array('welcome', 'license', 'system', 'configure', 'database', 'process');
|
||||||
|
|
||||||
protected static $instances = array();
|
protected static $instances = array();
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
return array(
|
return array(
|
||||||
'informations' => array(
|
'informations' => array(
|
||||||
'phone' => '+1 888.947.6543',
|
'phone' => '+1 888.947.6543',
|
||||||
'support' => 'http://support.prestashop.com/en/',
|
'support' => 'https://www.prestashop.com/pt/support',
|
||||||
),
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
'menu_welcome' => 'Escolha seu idioma',
|
'menu_welcome' => 'Escolha seu idioma',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
return array(
|
return array(
|
||||||
'informations' => array(
|
'informations' => array(
|
||||||
'phone' => '+33 (0)1.40.18.30.04',
|
'phone' => '+33 (0)1.40.18.30.04',
|
||||||
|
'support' => 'https://www.prestashop.com/de/support',
|
||||||
),
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
'menu_welcome' => 'Sprachauswahl',
|
'menu_welcome' => 'Sprachauswahl',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return array(
|
|||||||
'documentation_upgrade' => 'http://docs.prestashop.com/display/PS15/Updating+PrestaShop',
|
'documentation_upgrade' => 'http://docs.prestashop.com/display/PS15/Updating+PrestaShop',
|
||||||
'forum' => 'http://www.prestashop.com/forums/',
|
'forum' => 'http://www.prestashop.com/forums/',
|
||||||
'blog' => 'http://www.prestashop.com/blog/',
|
'blog' => 'http://www.prestashop.com/blog/',
|
||||||
'support' => 'http://support.prestashop.com/en/',
|
'support' => 'https://www.prestashop.com/en/support',
|
||||||
),
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
'menu_welcome' => 'Choose your language',
|
'menu_welcome' => 'Choose your language',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
return array(
|
return array(
|
||||||
'informations' => array(
|
'informations' => array(
|
||||||
'phone' => '+1 (888) 947-6543',
|
'phone' => '+1 (888) 947-6543',
|
||||||
|
'support' => 'https://www.prestashop.com/es/support',
|
||||||
),
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
'menu_welcome' => 'Elegir el idioma',
|
'menu_welcome' => 'Elegir el idioma',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
return array(
|
return array(
|
||||||
'informations' => array(
|
'informations' => array(
|
||||||
'phone' => '+33 (0)1.40.18.30.04',
|
'phone' => '+33 (0)1.40.18.30.04',
|
||||||
|
'support' => 'https://www.prestashop.com/it/support',
|
||||||
),
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
'menu_welcome' => 'Scelta della lingua',
|
'menu_welcome' => 'Scelta della lingua',
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
return array(
|
return array(
|
||||||
|
'informations' => array(
|
||||||
|
'phone' => '+33 (0)1.40.18.30.04',
|
||||||
|
'support' => 'https://www.prestashop.com/pl/wsparcie-techniczne',
|
||||||
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
'An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>' => 'Wystąpił błąd SQL w rekordzie <i>%1$s</i>: <i>%2$s</i>',
|
'An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>' => 'Wystąpił błąd SQL w rekordzie <i>%1$s</i>: <i>%2$s</i>',
|
||||||
'Cannot create image "%1$s" for entity "%2$s"' => 'Nie można utworzyć obrazu "%1$s" dla rekordu "%2$s"',
|
'Cannot create image "%1$s" for entity "%2$s"' => 'Nie można utworzyć obrazu "%1$s" dla rekordu "%2$s"',
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
return array(
|
return array(
|
||||||
|
'informations' => array(
|
||||||
|
'phone' => '+33 (0)1.40.18.30.04',
|
||||||
|
'support' => 'https://www.prestashop.com/en/support',
|
||||||
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
'An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>' => 'В SQL произошла ошибка для значения <i>%1$s</i>: <i>%2$s</i>',
|
'An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>' => 'В SQL произошла ошибка для значения <i>%1$s</i>: <i>%2$s</i>',
|
||||||
'Cannot create image "%1$s" for entity "%2$s"' => 'Невозможно создать изображение "%1$s" для значения "%2$s"',
|
'Cannot create image "%1$s" for entity "%2$s"' => 'Невозможно создать изображение "%1$s" для значения "%2$s"',
|
||||||
@@ -183,7 +187,7 @@ return array(
|
|||||||
'menu_license' => 'Лицензионное соглашение',
|
'menu_license' => 'Лицензионное соглашение',
|
||||||
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => 'Ядро PrestaShop разработано на OSL 3.0, а модули и шаблоны PrestaShop разработаны на AFL 3.0.',
|
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => 'Ядро PrestaShop разработано на OSL 3.0, а модули и шаблоны PrestaShop разработаны на AFL 3.0.',
|
||||||
'I agree to the above terms and conditions.' => 'Я принимаю правила и условия.',
|
'I agree to the above terms and conditions.' => 'Я принимаю правила и условия.',
|
||||||
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'Внесите свой вклад в улучшение программного обеспечения, отравив анонимное сообщене о Вашей конфгурации.',
|
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'Внесите свой вклад в улучшение программного обеспечения, отправив анонимное сообщение о Вашей конфигурации.',
|
||||||
'PHP 5.1.2 or later is not enabled' => 'PHP 5.1.2 или более поздняя версия не активирована',
|
'PHP 5.1.2 or later is not enabled' => 'PHP 5.1.2 или более поздняя версия не активирована',
|
||||||
'Cannot upload files' => 'Невозможно загрузить файлы',
|
'Cannot upload files' => 'Невозможно загрузить файлы',
|
||||||
'Cannot create new files and folders' => 'Невозможно создать новые файлы и папки',
|
'Cannot create new files and folders' => 'Невозможно создать новые файлы и папки',
|
||||||
|
|||||||
@@ -7,4 +7,10 @@ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VAL
|
|||||||
ALTER TABLE `PREFIX_webservice_account` CHANGE `class_name` `class_name` VARCHAR(64) NOT NULL DEFAULT 'WebserviceRequest',
|
ALTER TABLE `PREFIX_webservice_account` CHANGE `class_name` `class_name` VARCHAR(64) NOT NULL DEFAULT 'WebserviceRequest',
|
||||||
CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL;
|
CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL;
|
||||||
|
|
||||||
/* PHP:add_module_to_hook(blockcart, actionCartListOverride); */;
|
/* PHP:add_module_to_hook(blockcart, actionCartListOverride); */;
|
||||||
|
/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerDeleteAfter); */;
|
||||||
|
/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerAddAfter); */;
|
||||||
|
/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerUpdateAfter); */;
|
||||||
|
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierDeleteAfter); */;
|
||||||
|
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierAddAfter); */;
|
||||||
|
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierUpdateAfter); */;
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ var ajaxCart = {
|
|||||||
.animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000)
|
.animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000)
|
||||||
.fadeOut(100, function() {
|
.fadeOut(100, function() {
|
||||||
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
||||||
|
$(this).remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -443,7 +444,7 @@ var ajaxCart = {
|
|||||||
var content = '<dt class="hidden" id="cart_block_product_' + domIdProduct + '">';
|
var content = '<dt class="hidden" id="cart_block_product_' + domIdProduct + '">';
|
||||||
content += '<span class="quantity-formated"><span class="quantity">' + this.quantity + '</span>x</span>';
|
content += '<span class="quantity-formated"><span class="quantity">' + this.quantity + '</span>x</span>';
|
||||||
var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name);
|
var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name);
|
||||||
content += '<a href="' + this.link + '" title="' + this.name + '">' + name + '</a>';
|
content += '<a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a>';
|
||||||
|
|
||||||
if (parseFloat(this.price_float) > 0)
|
if (parseFloat(this.price_float) > 0)
|
||||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||||
|
|||||||
@@ -48,19 +48,25 @@ class BlockManufacturer extends Module
|
|||||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', true);
|
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', true);
|
||||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', 5);
|
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', 5);
|
||||||
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', true);
|
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', true);
|
||||||
return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header');
|
return parent::install() &&
|
||||||
|
$this->registerHook('leftColumn') &&
|
||||||
|
$this->registerHook('header') &&
|
||||||
|
$this->registerHook('actionObjectManufacturerDeleteAfter') &&
|
||||||
|
$this->registerHook('actionObjectManufacturerAddAfter') &&
|
||||||
|
$this->registerHook('actionObjectManufacturerUpdateAfter');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookLeftColumn($params)
|
public function hookLeftColumn($params)
|
||||||
{
|
{
|
||||||
$this->smarty->assign(array(
|
if (!$this->isCached('blockmanufacturer.tpl', $this->getCacheId()))
|
||||||
'manufacturers' => Manufacturer::getManufacturers(),
|
$this->smarty->assign(array(
|
||||||
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
|
'manufacturers' => Manufacturer::getManufacturers(),
|
||||||
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
|
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
|
||||||
'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'),
|
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
|
||||||
'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
|
'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'),
|
||||||
));
|
'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
|
||||||
return $this->display(__FILE__, 'blockmanufacturer.tpl');
|
));
|
||||||
|
return $this->display(__FILE__, 'blockmanufacturer.tpl', $this->getCacheId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookRightColumn($params)
|
public function hookRightColumn($params)
|
||||||
@@ -85,6 +91,7 @@ class BlockManufacturer extends Module
|
|||||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', $text_list);
|
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', $text_list);
|
||||||
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', $text_nb);
|
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', $text_nb);
|
||||||
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', $form_list);
|
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', $form_list);
|
||||||
|
$this->_clearCache('blockmanufacturer.tpl');
|
||||||
}
|
}
|
||||||
if (isset($errors) && count($errors))
|
if (isset($errors) && count($errors))
|
||||||
$output .= $this->displayError(implode('<br />', $errors));
|
$output .= $this->displayError(implode('<br />', $errors));
|
||||||
@@ -126,4 +133,19 @@ class BlockManufacturer extends Module
|
|||||||
{
|
{
|
||||||
$this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all');
|
$this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hookActionObjectManufacturerUpdateAfter($params)
|
||||||
|
{
|
||||||
|
$this->_clearCache('blockmanufacturer.tpl');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hookActionObjectManufacturerAddAfter($params)
|
||||||
|
{
|
||||||
|
$this->_clearCache('blockmanufacturer.tpl');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hookActionObjectManufacturerDeleteAfter($params)
|
||||||
|
{
|
||||||
|
$this->_clearCache('blockmanufacturer.tpl');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,12 @@ class BlockSupplier extends Module
|
|||||||
{
|
{
|
||||||
if (!parent::install())
|
if (!parent::install())
|
||||||
return false;
|
return false;
|
||||||
if (!$this->registerHook('displayLeftColumn'))
|
if (!$this->registerHook('displayLeftColumn') ||
|
||||||
return false;
|
!$this->registerHook('displayHeader') ||
|
||||||
if (!$this->registerHook('displayHeader'))
|
!$this->registerHook('actionObjectSupplierDeleteAfter') ||
|
||||||
|
!$this->registerHook('actionObjectSupplierAddAfter') ||
|
||||||
|
!$this->registerHook('actionObjectSupplierUpdateAfter')
|
||||||
|
)
|
||||||
return false;
|
return false;
|
||||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', true);
|
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', true);
|
||||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', 5);
|
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', 5);
|
||||||
@@ -73,16 +76,16 @@ class BlockSupplier extends Module
|
|||||||
function hookDisplayLeftColumn($params)
|
function hookDisplayLeftColumn($params)
|
||||||
{
|
{
|
||||||
$id_lang = (int)Context::getContext()->language->id;
|
$id_lang = (int)Context::getContext()->language->id;
|
||||||
|
if (!$this->isCached('blocksupplier.tpl', $this->getCacheId()))
|
||||||
$this->smarty->assign(array(
|
$this->smarty->assign(array(
|
||||||
'suppliers' => Supplier::getSuppliers(false, $id_lang),
|
'suppliers' => Supplier::getSuppliers(false, $id_lang),
|
||||||
'link' => $this->context->link,
|
'link' => $this->context->link,
|
||||||
'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'),
|
'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'),
|
||||||
'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'),
|
'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'),
|
||||||
'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'),
|
'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'),
|
||||||
'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')
|
'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')
|
||||||
));
|
));
|
||||||
return $this->display(__FILE__, 'blocksupplier.tpl');
|
return $this->display(__FILE__, 'blocksupplier.tpl', $this->getCacheId());
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContent()
|
function getContent()
|
||||||
@@ -102,6 +105,7 @@ class BlockSupplier extends Module
|
|||||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', $text_list);
|
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', $text_list);
|
||||||
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', $text_nb);
|
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', $text_nb);
|
||||||
Configuration::updateValue('SUPPLIER_DISPLAY_FORM', $form_list);
|
Configuration::updateValue('SUPPLIER_DISPLAY_FORM', $form_list);
|
||||||
|
$this->_clearCache('blocksupplier.tpl');
|
||||||
}
|
}
|
||||||
if (isset($errors) AND sizeof($errors))
|
if (isset($errors) AND sizeof($errors))
|
||||||
$output .= $this->displayError(implode('<br />', $errors));
|
$output .= $this->displayError(implode('<br />', $errors));
|
||||||
@@ -139,14 +143,29 @@ class BlockSupplier extends Module
|
|||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hookDisplayRightColumn($params)
|
public function hookDisplayRightColumn($params)
|
||||||
{
|
{
|
||||||
return $this->hookDisplayLeftColumn($params);
|
return $this->hookDisplayLeftColumn($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hookDisplayHeader($params)
|
public function hookDisplayHeader($params)
|
||||||
{
|
{
|
||||||
$this->context->controller->addCSS(($this->_path).'blocksupplier.css', 'all');
|
$this->context->controller->addCSS(($this->_path).'blocksupplier.css', 'all');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hookActionObjectSupplierUpdateAfter($params)
|
||||||
|
{
|
||||||
|
$this->_clearCache('blocksupplier.tpl');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hookActionObjectSupplierAddAfter($params)
|
||||||
|
{
|
||||||
|
$this->_clearCache('blocksupplier.tpl');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hookActionObjectSupplierDeleteAfter($params)
|
||||||
|
{
|
||||||
|
$this->_clearCache('blocksupplier.tpl');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user