Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
Jerome Nadaud
2013-11-05 16:39:12 +01:00
59 changed files with 171 additions and 110 deletions
@@ -92,7 +92,7 @@
<tr id="image_id">
<td style="padding: 4px;">
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-{$imageType}.jpg" alt="image_id" title="image_id" />
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-{$imageType}.jpg" alt="legend" title="legend" />
</a>
</td>
<td>legend</td>
@@ -332,7 +332,7 @@
function imageLine(id, path, position, cover, shops, legend)
{
line = $("#lineType").html();
line = line.replace(/image_id/g, legend);
line = line.replace(/image_id/g, id);
line = line.replace(/[a-z]{0,2}-default/g, path);
line = line.replace(/image_path/g, path);
line = line.replace(/image_position/g, position);
+9 -15
View File
@@ -137,24 +137,18 @@ class Autoload
// Write classes index on disc to cache it
$filename = $this->root_dir.Autoload::INDEX_FILE;
if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename)))
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
if ($filename_tmp !== false && file_put_contents($filename_tmp, $content, LOCK_EX) !== false)
{
header('HTTP/1.1 503 temporarily overloaded');
// Cannot use PrestaShopException in this context
die('/cache/class_index.php is not writable, please give write permissions (chmod 666) on this file.');
}
else
{
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE)
{
@rename($filename_tmp, $filename);
@chmod($filename, 0666);
}
if (!rename($filename_tmp, $filename))
unlink($filename_tmp);
else
// $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), no need to die.
error_log('Cannot write temporary file '.$filename_tmp);
@chmod($filename, 0666);
}
// $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), no need to die.
else
error_log('Cannot write temporary file '.$filename_tmp);
$this->index = $classes;
}
+6 -2
View File
@@ -390,6 +390,10 @@ class HookCore extends ObjectModel
*/
public static function exec($hook_name, $hook_args = array(), $id_module = null, $array_return = false, $check_exceptions = true)
{
static $disable_non_native_modules = null;
if ($disable_non_native_modules === null)
$disable_non_native_modules = (bool)Configuration::get('PS_DISABLE_NON_NATIVE_MODULE');
// Check arguments validity
if (($id_module && !is_numeric($id_module)) || !Validate::isHookName($hook_name))
throw new PrestaShopException('Invalid id_module or hook_name');
@@ -419,7 +423,7 @@ class HookCore extends ObjectModel
$altern = 0;
$output = '';
if (!isset(Hook::$native_module))
if ($disable_non_native_modules && !isset(Hook::$native_module))
Hook::$native_module = Module::getNativeModuleList();
foreach ($module_list as $array)
@@ -428,7 +432,7 @@ class HookCore extends ObjectModel
if ($id_module && $id_module != $array['id_module'])
continue;
if ((bool)Configuration::get('PS_DISABLE_NON_NATIVE_MODULE') && !in_array($array['module'], self::$native_module))
if ((bool)$disable_non_native_modules && Hook::$native_module && count(Hook::$native_module) && !in_array($array['module'], self::$native_module))
continue;
if (!($moduleInstance = Module::getInstanceByName($array['module'])))
+2 -4
View File
@@ -672,10 +672,8 @@ class ToolsCore
public static function htmlentitiesUTF8($string, $type = ENT_QUOTES)
{
if (is_array($string))
{
$string = array_map(array('Tools', 'htmlentitiesUTF8'), $string);
return (string)array_shift($string);
}
return array_map(array('Tools', 'htmlentitiesUTF8'), $string);
return htmlentities((string)$string, $type, 'utf-8');
}
+2 -2
View File
@@ -44,7 +44,7 @@ class ValidateCore
*/
public static function isEmail($email)
{
return !empty($email) && preg_match(Tools::cleanNonUnicodeSupport('/^[a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z\p{L}0-9]+[._a-z\p{L}0-9-]*\.[a-z0-9]+$/ui'), $email);
return !empty($email) && preg_match(Tools::cleanNonUnicodeSupport('/^[a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z\p{L}0-9]+[._a-z\p{L}0-9-]*\.[a-z\p{L}0-9]+$/ui'), $email);
}
/**
@@ -1067,4 +1067,4 @@ class ValidateCore
{
return (preg_match('/^[0-1]\.[0-9]{1,2}(\.[0-9]{1,2}){0,2}$/', $version) && ip2long($version));
}
}
}
+2 -2
View File
@@ -175,8 +175,8 @@ abstract class ControllerCore
// then using displayAjax[action]
if ($this->ajax)
{
$action = Tools::getValue('action');
if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true)))
$action = Tools::toCamelCase(Tools::getValue('action'), true);
if (!empty($action) && method_exists($this, 'displayAjax'.$action))
$this->{'displayAjax'.$action}();
elseif (method_exists($this, 'displayAjax'))
$this->displayAjax();
+2 -2
View File
@@ -850,7 +850,7 @@ class FrontControllerCore extends Controller
if (!is_numeric(Tools::getValue('p', 1)) || Tools::getValue('p', 1) < 0)
Tools::redirect(self::$link->getPaginationLink(false, false, $this->n, false, 1, false));
$current_url = tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
$current_url = Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
//delete parameter page
$current_url = preg_replace('/(\?)?(&amp;)?p=\d+/', '$1', $current_url);
@@ -919,7 +919,7 @@ class FrontControllerCore extends Controller
$ips = array_map('trim', $ips);
if (is_array($ips) && count($ips))
foreach ($ips as $ip)
if (!empty($ip) && strpos($user_ip, $ip) === 0)
if (!empty($ip) && preg_match('/^'.$ip.'.*/', $user_ip))
$allowed = true;
return $allowed;
}
+3
View File
@@ -1296,6 +1296,9 @@ abstract class ModuleCore
public static function getNativeModuleList()
{
$module_list_xml = _PS_ROOT_DIR_.self::CACHE_FILE_MODULES_LIST;
if (!file_exists($module_list_xml))
return false;
$native_modules = simplexml_load_file($module_list_xml);
$native_modules = $native_modules->modules;
$modules = array();
@@ -128,6 +128,8 @@ class AdminCartRulesControllerCore extends AdminController
$this->errors[] = Tools::displayError('Reduction amount cannot be lower than zero.');
if (Tools::getValue('code') && ($same_code = (int)CartRule::getIdByCode(Tools::getValue('code'))) && $same_code != Tools::getValue('id_cart_rule'))
$this->errors[] = sprintf(Tools::displayError('This cart rule code is already used (conflict with cart rule %d)'), $same_code);
if (Tools::getValue('apply_discount') == 'off' && !Tools::getValue('free_shipping') && !Tools::getValue('free_gift'))
$this->errors[] = Tools::displayError('An action is required for this cart rule.');
}
return parent::postProcess();
@@ -320,12 +320,15 @@ class AdminCustomerThreadsControllerCore extends AdminController
$cm = new CustomerMessage();
$cm->id_employee = (int)$this->context->employee->id;
$cm->id_customer_thread = (int)Tools::getValue('id_customer_thread');
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
$cm->ip_address = ip2long(Tools::getRemoteAddr());
$current_employee = $this->context->employee;
$id_employee = (int)Tools::getValue('id_employee_forward');
$employee = new Employee($id_employee);
$email = Tools::getValue('email');
if ($id_employee && $employee && Validate::isLoadedObject($employee))
$message = Tools::getValue('message_forward');
if (($error = $cm->validateField('message', $message, null, array(), true)) !== true)
$this->errors[] = $error;
elseif ($id_employee && $employee && Validate::isLoadedObject($employee))
{
$params = array(
'{messages}' => Tools::nl2br(stripslashes($output)),
@@ -344,7 +347,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
null, null, _PS_MAIL_DIR_, true))
{
$cm->private = 1;
$cm->message = $this->l('Message forwarded to').' '.$employee->firstname.' '.$employee->lastname."\n".$this->l('Comment:').' '.$_POST['message_forward'];
$cm->message = $this->l('Message forwarded to').' '.$employee->firstname.' '.$employee->lastname."\n".$this->l('Comment:').' '.$message;
$cm->add();
}
}
@@ -363,7 +366,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$current_employee->email, $current_employee->firstname.' '.$current_employee->lastname,
null, null, _PS_MAIL_DIR_, true))
{
$cm->message = $this->l('Message forwarded to').' '.$email."\n".$this->l('Comment:').' '.$_POST['message_forward'];
$cm->message = $this->l('Message forwarded to').' '.$email."\n".$this->l('Comment:').' '.$message;
$cm->add();
}
}
@@ -379,10 +382,11 @@ class AdminCustomerThreadsControllerCore extends AdminController
$cm = new CustomerMessage();
$cm->id_employee = (int)$this->context->employee->id;
$cm->id_customer_thread = $ct->id;
$cm->ip_address = ip2long(Tools::getRemoteAddr());
$cm->message = Tools::getValue('reply_message');
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
if (isset($_FILES) && !empty($_FILES['joinFile']['name']) && $_FILES['joinFile']['error'] != 0)
if (($error = $cm->validateField('message', $cm->message, null, array(), true)) !== true)
$this->errors[] = $error;
elseif (isset($_FILES) && !empty($_FILES['joinFile']['name']) && $_FILES['joinFile']['error'] != 0)
$this->errors[] = Tools::displayError('An error occurred during the file upload process.');
elseif ($cm->add())
{
@@ -718,6 +718,11 @@ class AdminManufacturersControllerCore extends AdminController
(int)$image_type['height']
);
}
$current_logo_file = _PS_TMP_IMG_DIR_.'manufacturer_mini_'.$id_manufacturer.'_'.$this->context->shop->id.'.jpg';
if ($res && file_exists($current_logo_file))
unlink($current_logo_file);
}
if (!$res)
@@ -725,7 +730,7 @@ class AdminManufacturersControllerCore extends AdminController
return $res;
}
protected function beforeDelete($object)
{
return true;
@@ -539,4 +539,20 @@ class AdminStatusesControllerCore extends AdminController
$this->initOrdersReturnsList();
return parent::filterToField($key, $filter);
}
protected function afterImageUpload()
{
parent::afterImageUpload();
if (($id_order_state = (int)Tools::getValue('id_order_state')) &&
isset($_FILES) && count($_FILES) && file_exists(_PS_ORDER_STATE_IMG_DIR_.$id_order_state.'.gif'))
{
$current_file = _PS_TMP_IMG_DIR_.'order_state_mini_'.$id_order_state.'_'.$this->context->shop->id.'.gif';
if (file_exists($current_file))
unlink($current_file);
}
return true;
}
}
@@ -354,6 +354,11 @@ class AdminSuppliersControllerCore extends AdminController
if (!ImageManager::resize($file, _PS_SUPP_IMG_DIR_.$id_supplier.'-'.stripslashes($image_type['name']).'.jpg', (int)$image_type['width'], (int)$image_type['height']))
$return = false;
}
$current_logo_file = _PS_TMP_IMG_DIR_.'supplier_mini_'.$id_supplier.'_'.$this->context->shop->id.'.jpg';
if (file_exists($current_logo_file))
unlink($current_logo_file);
}
return $return;
}
+1 -1
View File
@@ -147,7 +147,7 @@ class ContactControllerCore extends FrontController
$cm->message = $message;
if (isset($fileAttachment['rename']) && !empty($fileAttachment['rename']) && rename($fileAttachment['tmp_name'], _PS_MODULE_DIR_.'../upload/'.basename($fileAttachment['rename'])))
$cm->file_name = $fileAttachment['rename'];
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
$cm->ip_address = ip2long(Tools::getRemoteAddr());
$cm->user_agent = $_SERVER['HTTP_USER_AGENT'];
if (!$cm->add())
$this->errors[] = Tools::displayError('An error occurred while sending the message.');
+2 -2
View File
@@ -529,8 +529,8 @@ class OrderOpcControllerCore extends ParentOrderController
$minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency);
if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase)
return '<p class="warning">'.sprintf(
Tools::displayError('A minimum purchase total of %s is required in order to validate your order.'),
Tools::displayPrice($minimalPurchase, $currency)
Tools::displayError('A minimum purchase total of %1s (tax excl.) is required in order to validate your order, current purchase total is %2s (tax excl.).'),
Tools::displayPrice($minimal_purchase, $currency), Tools::displayPrice($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS), $currency)
).'</p>';
/* Bypass payment step if total is 0 */
+1 -1
View File
@@ -45,7 +45,7 @@ class InstallSession
session_name('install_'.md5($_SERVER['HTTP_HOST']));
$session_started = session_start();
if (!($session_started)
|| (!isset($_SESSION['session_mode']) && (isset($_POST['submitNext']) || isset($_POST['submitPrevious']) || isset($_POST['language']))))
|| (!isset($_SESSION['session_mode']) && (isset($_GET['_']) || isset($_POST['submitNext']) || isset($_POST['submitPrevious']) || isset($_POST['language']))))
{
InstallSession::$_cookie_mode = true;
InstallSession::$_cookie = new Cookie('ps_install', null, time() + 7200, null, true);
+2
View File
@@ -7,3 +7,5 @@ ALTER TABLE `PREFIX_currency` CHANGE `conversion_rate` `conversion_rate` DECIMAL
UPDATE `PREFIX_orders` SET conversion_rate = 1 WHERE conversion_rate = 0;
ALTER TABLE `PREFIX_cms` ADD `indexation` tinyint(1) UNSIGNED NULL DEFAULT '1' AFTER `active`;
/* PHP:update_order_messages(); */;
+1 -1
View File
@@ -33,7 +33,7 @@ class BlockCart extends Module
{
$this->name = 'blockcart';
$this->tab = 'front_office_features';
$this->version = '1.2';
$this->version = '1.3';
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blockcart</name>
<displayName><![CDATA[Cart block]]></displayName>
<version><![CDATA[1.2]]></version>
<version><![CDATA[1.3]]></version>
<description><![CDATA[Adds a block containing the customer&#039;s shopping cart.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+24 -21
View File
@@ -176,6 +176,7 @@ class BlockCategories extends Module
$resultParents = array();
$resultIds = array();
$isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false);
foreach ($result as &$row)
{
@@ -186,27 +187,6 @@ class BlockCategories extends Module
$blockCategTree = $this->getTree($resultParents, $resultIds, Configuration::get('BLOCK_CATEG_MAX_DEPTH'));
unset($resultParents, $resultIds);
$id_category = (int)Tools::getValue('id_category');
$id_product = (int)Tools::getValue('id_product');
$isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false);
if (Tools::isSubmit('id_category'))
{
$this->context->cookie->last_visited_category = $id_category;
$this->smarty->assign('currentCategoryId', $this->context->cookie->last_visited_category);
}
if (Tools::isSubmit('id_product'))
{
if (!isset($this->context->cookie->last_visited_category)
|| !Product::idIsOnCategoryId($id_product, array('0' => array('id_category' => $this->context->cookie->last_visited_category)))
|| !Category::inShopStatic($this->context->cookie->last_visited_category, $this->context->shop))
{
$product = new Product($id_product);
if (isset($product) && Validate::isLoadedObject($product))
$this->context->cookie->last_visited_category = (int)$product->id_category_default;
}
$this->smarty->assign('currentCategoryId', (int)$this->context->cookie->last_visited_category);
}
$this->smarty->assign('blockCategTree', $blockCategTree);
if (file_exists(_PS_THEME_DIR_.'modules/blockcategories/blockcategories.tpl'))
@@ -215,6 +195,29 @@ class BlockCategories extends Module
$this->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl');
$this->smarty->assign('isDhtml', $isDhtml);
}
$id_category = (int)Tools::getValue('id_category');
$id_product = (int)Tools::getValue('id_product');
if (Tools::isSubmit('id_category'))
{
$this->context->cookie->last_visited_category = (int)$id_category;
$this->smarty->assign('currentCategoryId', $this->context->cookie->last_visited_category);
}
if (Tools::isSubmit('id_product'))
{
if (!isset($this->context->cookie->last_visited_category)
|| !Product::idIsOnCategoryId($id_product, array('0' => array('id_category' => $this->context->cookie->last_visited_category)))
|| !Category::inShopStatic($this->context->cookie->last_visited_category, $this->context->shop))
{
$product = new Product((int)$id_product);
if (isset($product) && Validate::isLoadedObject($product))
$this->context->cookie->last_visited_category = (int)$product->id_category_default;
}
$this->smarty->assign('currentCategoryId', (int)$this->context->cookie->last_visited_category);
}
$display = $this->display(__FILE__, 'blockcategories.tpl', $this->getCacheId());
return $display;
}
+21 -4
View File
@@ -38,7 +38,7 @@ class BlockLayered extends Module
{
$this->name = 'blocklayered';
$this->tab = 'front_office_features';
$this->version = '1.8.9';
$this->version = '1.9.0';
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -1186,7 +1186,6 @@ class BlockLayered extends Module
$this->context->controller->addJS(($this->_path).'blocklayered.js');
$this->context->controller->addJS(_PS_JS_DIR_.'jquery/jquery-ui-1.8.10.custom.min.js');
$this->context->controller->addJQueryUI('ui.slider');
$this->context->controller->addCSS(($this->_path).'blocklayered-15.css', 'all');
$this->context->controller->addJQueryPlugin('scrollTo');
@@ -1686,7 +1685,6 @@ class BlockLayered extends Module
</fieldset><br />
<fieldset class="width4">
<legend><img src="../img/admin/cog.gif" alt="" />'.$this->l('Build your own filter template').'</legend>
<link rel="stylesheet" href="'._PS_CSS_DIR_.'jquery-ui-1.8.10.custom.css" />
<style type="text/css">
#error-filter-name { display: none; }
#layered_container_left ul, #layered_container_right ul { list-style-type: none; padding-left: 0px; }
@@ -2657,7 +2655,7 @@ class BlockLayered extends Module
AND '.$alias.'.active = 1 AND '.$alias.'.`visibility` IN ("both", "catalog")';
$sql_query['group'] = ') count_products
FROM '._DB_PREFIX_.'category c
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category AND cl.id_lang = '.$id_lang.')
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category AND cl.`id_shop` = '.(int)Context::getContext()->shop->id.' and cl.id_lang = '.$id_lang.')
WHERE c.nleft > '.(int)$parent->nleft.'
AND c.nright < '.(int)$parent->nright.'
'.($depth ? 'AND c.level_depth <= '.($parent->level_depth+(int)$depth) : '').'
@@ -2960,6 +2958,25 @@ class BlockLayered extends Module
if (isset($selected_filters['id_feature'][$feature['id_feature_value']]))
$feature_array[$feature['id_feature']]['values'][$feature['id_feature_value']]['checked'] = true;
}
// features are now sorted by natural sort
foreach ($feature_array as $key => $value)
{
$temp = array();
foreach ($feature_array[$key]['values'] as $key_int => $value_int)
$temp[$key_int] = $value_int['name'];
natcasesort($temp);
$temp2 = array();
foreach ($temp as $key_temp => $value_temp)
$temp2[$key_temp] = $feature_array[$key]['values'][$key_temp];
$feature_array[$key]['values'] = $temp2;
}
// end feature natural sorting
$filter_blocks = array_merge($filter_blocks, $feature_array);
}
break;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blocklayered</name>
<displayName><![CDATA[Layered navigation block]]></displayName>
<version><![CDATA[1.8.9]]></version>
<version><![CDATA[1.9.0]]></version>
<description><![CDATA[Displays a block with layered navigation filters.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
@@ -33,7 +33,7 @@ class BlockNewProducts extends Module
{
$this->name = 'blocknewproducts';
$this->tab = 'front_office_features';
$this->version = '1.4';
$this->version = '1.5';
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blocknewproducts</name>
<displayName><![CDATA[New products block]]></displayName>
<version><![CDATA[1.4]]></version>
<version><![CDATA[1.5]]></version>
<description><![CDATA[Displays a block featuring your store&#039;s newest products.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+2 -2
View File
@@ -29,7 +29,7 @@
<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="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{$search_query|escape:'htmlall':'UTF-8'|stripslashes}" />
</form>
</div>
{else}
@@ -41,7 +41,7 @@
<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="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{$search_query|escape:'htmlall':'UTF-8'|stripslashes}" />
<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
</p>
</form>
+12 -3
View File
@@ -33,7 +33,7 @@ class BlockSearch extends Module
{
$this->name = 'blocksearch';
$this->tab = 'search_filter';
$this->version = 1.2;
$this->version = 1.3;
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -84,7 +84,11 @@ public function hookDisplayMobileHeader($params)
if (Tools::getValue('search_query') || !$this->isCached('blocksearch.tpl', $this->getCacheId()))
{
$this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'block');
$this->smarty->assign(array(
'blocksearch_type' => 'block',
'search_query' => (string)Tools::getValue('search_query')
)
);
}
return $this->display(__FILE__, 'blocksearch.tpl', Tools::getValue('search_query') ? null : $this->getCacheId());
}
@@ -94,7 +98,12 @@ public function hookDisplayMobileHeader($params)
if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
{
$this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'top');
$this->smarty->assign(array(
'blocksearch_type' => 'top',
'search_query' => (string)Tools::getValue('search_query')
)
);
}
return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $this->getCacheId('blocksearch-top'));
+1 -1
View File
@@ -32,7 +32,7 @@
<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="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{$search_query|escape:'htmlall':'UTF-8'|stripslashes}" />
<input type="submit" id="search_button" class="button_mini" value="{l s='Go!' mod='blocksearch'}" />
</p>
</form>
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blocksearch</name>
<displayName><![CDATA[Quick search block]]></displayName>
<version><![CDATA[1.2]]></version>
<version><![CDATA[1.3]]></version>
<description><![CDATA[Adds a quick search field to your website.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[search_filter]]></tab>
+1 -1
View File
@@ -37,7 +37,7 @@ class blocksharefb extends Module
$this->tab = 'front_office_features';
else
$this->tab = 'Blocks';
$this->version = '1.0';
$this->version = '1.1';
parent::__construct();
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blocksharefb</name>
<displayName><![CDATA[Facebook sharing block.]]></displayName>
<version><![CDATA[1.0]]></version>
<version><![CDATA[1.1]]></version>
<description><![CDATA[Allows customers to share your products -- or website content -- on Facebook. ]]></description>
<author><![CDATA[]]></author>
<tab><![CDATA[front_office_features]]></tab>
+1 -1
View File
@@ -36,7 +36,7 @@ class BlockSpecials extends Module
{
$this->name = 'blockspecials';
$this->tab = 'pricing_promotion';
$this->version = '0.9';
$this->version = '1.0';
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blockspecials</name>
<displayName><![CDATA[Specials block]]></displayName>
<version><![CDATA[0.9]]></version>
<version><![CDATA[1.0]]></version>
<description><![CDATA[Adds a block displaying current product specials.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[pricing_promotion]]></tab>
+1 -1
View File
@@ -52,7 +52,7 @@ class Blocktopmenu extends Module
{
$this->name = 'blocktopmenu';
$this->tab = 'front_office_features';
$this->version = 1.6;
$this->version = 1.7;
$this->author = 'PrestaShop';
parent::__construct();
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blocktopmenu</name>
<displayName><![CDATA[Top horizontal menu]]></displayName>
<version><![CDATA[1.6]]></version>
<version><![CDATA[1.7]]></version>
<description><![CDATA[Add a new horizontal menu to the top of your e-commerce website.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>crossselling</name>
<displayName><![CDATA[Cross Selling]]></displayName>
<version><![CDATA[0.7]]></version>
<version><![CDATA[0.8]]></version>
<description><![CDATA[Customers who bought this product also bought:]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+1 -1
View File
@@ -35,7 +35,7 @@ class CrossSelling extends Module
{
$this->name = 'crossselling';
$this->tab = 'front_office_features';
$this->version = 0.7;
$this->version = 0.8;
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>dateofdelivery</name>
<displayName><![CDATA[Date of delivery]]></displayName>
<version><![CDATA[1.1]]></version>
<version><![CDATA[1.2]]></version>
<description><![CDATA[Displays an approximate date of delivery]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab>
+1 -1
View File
@@ -35,7 +35,7 @@ class DateOfDelivery extends Module
{
$this->name = 'dateofdelivery';
$this->tab = 'shipping_logistics';
$this->version = '1.1';
$this->version = '1.2';
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>feeder</name>
<displayName><![CDATA[RSS products feed.]]></displayName>
<version><![CDATA[0.3]]></version>
<version><![CDATA[0.4]]></version>
<description><![CDATA[Generate an RSS products feed.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+1 -1
View File
@@ -35,7 +35,7 @@ class Feeder extends Module
{
$this->name = 'feeder';
$this->tab = 'front_office_features';
$this->version = 0.3;
$this->version = 0.4;
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>homeslider</name>
<displayName><![CDATA[Image slider for your homepage.]]></displayName>
<version><![CDATA[1.2.1]]></version>
<version><![CDATA[1.2.2]]></version>
<description><![CDATA[Adds an image slider to your homepage.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+1 -1
View File
@@ -42,7 +42,7 @@ class HomeSlider extends Module
{
$this->name = 'homeslider';
$this->tab = 'front_office_features';
$this->version = '1.2.1';
$this->version = '1.2.2';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->secure_key = Tools::encrypt($this->name);
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>loyalty</name>
<displayName><![CDATA[Customer loyalty and rewards]]></displayName>
<version><![CDATA[1.8]]></version>
<version><![CDATA[1.9]]></version>
<description><![CDATA[Provide a loyalty program to your customers.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[pricing_promotion]]></tab>
+1 -1
View File
@@ -42,7 +42,7 @@ class Loyalty extends Module
{
$this->name = 'loyalty';
$this->tab = 'pricing_promotion';
$this->version = '1.8';
$this->version = '1.9';
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>productcomments</name>
<displayName><![CDATA[Product Comments]]></displayName>
<version><![CDATA[2.3]]></version>
<version><![CDATA[2.4]]></version>
<description><![CDATA[Allows users to post reviews.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+1 -1
View File
@@ -41,7 +41,7 @@ class ProductComments extends Module
{
$this->name = 'productcomments';
$this->tab = 'front_office_features';
$this->version = '2.3';
$this->version = '2.4';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->secure_key = Tools::encrypt($this->name);
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>productscategory</name>
<displayName><![CDATA[Products Category]]></displayName>
<version><![CDATA[1.4]]></version>
<version><![CDATA[1.5]]></version>
<description><![CDATA[Display products of the same category on the product page.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
@@ -34,7 +34,7 @@ class productsCategory extends Module
public function __construct()
{
$this->name = 'productscategory';
$this->version = '1.4';
$this->version = '1.5';
$this->author = 'PrestaShop';
$this->tab = 'front_office_features';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>pscleaner</name>
<displayName><![CDATA[PrestaShop Cleaner]]></displayName>
<version><![CDATA[0.9]]></version>
<version><![CDATA[1.0]]></version>
<description><![CDATA[Check and fix functional integrity constraints and remove default data]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
+1 -1
View File
@@ -34,7 +34,7 @@ class PSCleaner extends Module
{
$this->name = 'pscleaner';
$this->tab = 'administration';
$this->version = '0.9';
$this->version = '1.0';
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>referralprogram</name>
<displayName><![CDATA[Customer referral program]]></displayName>
<version><![CDATA[1.5.1]]></version>
<version><![CDATA[1.5.2]]></version>
<description><![CDATA[Integrate a referral program system into your shop.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[advertising_marketing]]></tab>
+1 -1
View File
@@ -33,7 +33,7 @@ class ReferralProgram extends Module
{
$this->name = 'referralprogram';
$this->tab = 'advertising_marketing';
$this->version = '1.5.1';
$this->version = '1.5.2';
$this->author = 'PrestaShop';
parent::__construct();
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>trackingfront</name>
<displayName><![CDATA[Tracking - Front office]]></displayName>
<version><![CDATA[1]]></version>
<version><![CDATA[1.1]]></version>
<description><![CDATA[Enable your affiliates to access their own statistics.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab>
+1 -1
View File
@@ -33,7 +33,7 @@ class TrackingFront extends Module
{
$this->name = 'trackingfront';
$this->tab = 'shipping_logistics';
$this->version = 1.0;
$this->version = 1.1;
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>watermark</name>
<displayName><![CDATA[Watermark]]></displayName>
<version><![CDATA[0.3]]></version>
<version><![CDATA[0.4]]></version>
<description><![CDATA[Protect image by watermark.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
+1 -1
View File
@@ -43,7 +43,7 @@ class Watermark extends Module
{
$this->name = 'watermark';
$this->tab = 'administration';
$this->version = '0.3';
$this->version = '0.4';
$this->author = 'PrestaShop';
parent::__construct();
@@ -32,7 +32,7 @@
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{$search_query|escape:'htmlall':'UTF-8'|stripslashes}" />
<input type="submit" id="search_button" class="button_mini" value="{l s='go' mod='blocksearch'}" />
</p>
</form>
+2 -2
View File
@@ -766,7 +766,7 @@ class Services_JSON
function isError($data, $code = null)
{
if (class_exists('pear')) {
return PEAR::isError($data, $code);
return @PEAR::isError($data, $code);
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
is_subclass_of($data, 'services_json_error'))) {
return true;
@@ -801,4 +801,4 @@ if (class_exists('PEAR_Error')) {
}
}
}
}
-1
View File
@@ -176,7 +176,6 @@ abstract class Controller extends ControllerCore
public function __construct()
{
parent::__construct();
// error management
set_error_handler('developpementErrorHandler');