Ajoute de la phrase du ticket N°9891

This commit is contained in:
Dylan Travers 2016-06-06 17:57:47 +02:00
parent bec4b56f27
commit 6816b0d944
6 changed files with 0 additions and 795 deletions

View File

@ -1,60 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2011 PrestaShop SA
* @version Release: $Revision: 6874 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function __autoload($className)
{
if (function_exists('smartyAutoload') AND smartyAutoload($className))
return true;
$className = str_replace(chr(0), '', $className);
$classDir = dirname(__FILE__).'/../classes/';
$overrideDir = dirname(__FILE__).'/../override/classes/';
$file_in_override = file_exists($overrideDir.$className.'.php');
$file_in_classes = file_exists($classDir.$className.'.php');
// This is a Core class and its name is the same as its declared name
if (substr($className, -4) == 'Core')
require_once($classDir.substr($className, 0, -4).'.php');
else
{
if ($file_in_override && $file_in_classes)
{
require_once($classDir.str_replace(chr(0), '', $className).'.php');
require_once($overrideDir.$className.'.php');
}
elseif (!$file_in_override && $file_in_classes)
{
require_once($classDir.str_replace(chr(0), '', $className).'.php');
$classInfos = new ReflectionClass($className.((interface_exists($className, false) or class_exists($className, false)) ? '' : 'Core'));
if (!$classInfos->isInterface() && substr($classInfos->name, -4) == 'Core')
eval(($classInfos->isAbstract() ? 'abstract ' : '').'class '.$className.' extends '.$className.'Core {}');
}
elseif ($file_in_override && !$file_in_classes)
require_once($overrideDir.$className.'.php');
}
}

View File

@ -1,199 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2011 PrestaShop SA
* @version Release: $Revision: 8937 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/* Debug only */
@ini_set('display_errors', 'off');
define('_PS_DEBUG_SQL_', false);
$start_time = microtime(true);
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);
/* SSL configuration */
define('_PS_SSL_PORT_', 443);
/* Improve PHP configuration to prevent issues */
ini_set('upload_max_filesize', '100M');
ini_set('default_charset', 'utf-8');
ini_set('magic_quotes_runtime', 0);
// correct Apache charset (except if it's too late
if (!headers_sent())
header('Content-Type: text/html; charset=utf-8');
/* No settings file? goto installer...*/
if (!file_exists(dirname(__FILE__).'/settings.inc.php'))
{
$dir = ((is_dir($_SERVER['REQUEST_URI']) OR substr($_SERVER['REQUEST_URI'], -1) == '/') ? $_SERVER['REQUEST_URI'] : dirname($_SERVER['REQUEST_URI']).'/');
if (!file_exists(dirname(__FILE__).'/../install'))
die('Error: \'install\' directory is missing');
header('Location: install/');
exit;
}
require_once(dirname(__FILE__).'/settings.inc.php');
define('_PS_OPEN_SHOP_', 0);
/* Include all defines */
require_once(dirname(__FILE__).'/defines.inc.php');
if (!defined('_PS_MAGIC_QUOTES_GPC_'))
define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc());
if (!defined('_PS_MODULE_DIR_'))
define('_PS_MODULE_DIR_', _PS_ROOT_DIR_.'/modules/');
if (!defined('_PS_MYSQL_REAL_ESCAPE_STRING_'))
define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string'));
/* Autoload */
require_once(dirname(__FILE__).'/autoload.php');
/* Redefine REQUEST_URI if empty (on some webservers...) */
if (!isset($_SERVER['REQUEST_URI']) OR empty($_SERVER['REQUEST_URI']))
{
if (substr($_SERVER['SCRIPT_NAME'], -9) == 'index.php' && empty($_SERVER['QUERY_STRING']))
$_SERVER['REQUEST_URI'] = dirname($_SERVER['SCRIPT_NAME']).'/';
else
{
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['QUERY_STRING']) AND !empty($_SERVER['QUERY_STRING']))
$_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
}
}
/* Trying to redefine HTTP_HOST if empty (on some webservers...) */
if (!isset($_SERVER['HTTP_HOST']) OR empty($_SERVER['HTTP_HOST']))
$_SERVER['HTTP_HOST'] = @getenv('HTTP_HOST');
/* aliases */
function p($var) {
return (Tools::p($var));
}
function d($var) {
Tools::d($var);
}
function ppp($var) {
return (Tools::p($var));
}
function ddd($var) {
Tools::d($var);
}
global $_MODULES;
$_MODULES = array();
/* Load all configuration keys */
Configuration::loadConfiguration();
/* Load all language definitions */
Language::loadLanguages();
/* Define order state */
// DEPRECATED : these defines are going to be deleted on 1.6 version of Prestashop
// USE : Configuration::get() method in order to getting the id of order state
define('_PS_OS_CHEQUE_', Configuration::get('PS_OS_CHEQUE'));
define('_PS_OS_PAYMENT_', Configuration::get('PS_OS_PAYMENT'));
define('_PS_OS_PREPARATION_', Configuration::get('PS_OS_PREPARATION'));
define('_PS_OS_SHIPPING_', Configuration::get('PS_OS_SHIPPING'));
define('_PS_OS_DELIVERED_', Configuration::get('PS_OS_DELIVERED'));
define('_PS_OS_CANCELED_', Configuration::get('PS_OS_CANCELED'));
define('_PS_OS_REFUND_', Configuration::get('PS_OS_REFUND'));
define('_PS_OS_ERROR_', Configuration::get('PS_OS_ERROR'));
define('_PS_OS_OUTOFSTOCK_', Configuration::get('PS_OS_OUTOFSTOCK'));
define('_PS_OS_BANKWIRE_', Configuration::get('PS_OS_BANKWIRE'));
define('_PS_OS_PAYPAL_', Configuration::get('PS_OS_PAYPAL'));
define('_PS_OS_WS_PAYMENT_', Configuration::get('PS_OS_WS_PAYMENT'));
/* It is not safe to rely on the system's timezone settings, and this would generate a PHP Strict Standards notice. */
if (function_exists('date_default_timezone_set'))
@date_default_timezone_set(Configuration::get('PS_TIMEZONE'));
/* Smarty */
require_once(dirname(__FILE__).'/smarty.config.inc.php');
/* Possible value are true, false, 'URL'
(for 'URL' append SMARTY_DEBUG as a parameter to the url)
default is false for production environment */
define('SMARTY_DEBUG_CONSOLE', false);
// INTERNATIONALISATION
global $site_versions, $site_version;
$site_versions = array('com', 'es', /*'it'*/);
$domain_chunks = explode('.bebeboutik.', strtolower($_SERVER['HTTP_HOST']));
if(count($domain_chunks) !== 2) {
$extensions = explode('.', $domain_chunks[0]);
if(in_array($extensions[1], $site_versions)) {
header('Location: http://www.bebeboutik.'.$extensions[1]);
exit;
} else {
header('Location: http://www.bebeboutik.com');
exit;
}
}
$cookie_version = (
isset($_COOKIE['site_version']) && in_array(strtolower($_COOKIE['site_version']), $site_versions)
? strtolower($_COOKIE['site_version'])
: FALSE
);
if(!in_array($domain_chunks[0], array('www', 'm',/*'dev'*/))
|| ($domain_chunks[1] !== 'com' && !in_array($domain_chunks[1], $site_versions))
|| ($domain_chunks[1] === 'com' && $domain_chunks[0] !== 'bo' && $cookie_version !== FALSE)) {
/*
* Security check in case of a misconfigured web server
* If the selected domain is not allowed, redirect to default site
*/
header('Location: http://'
.(in_array($domain_chunks[0], array('www', 'm', 'bo'))? $domain_chunks[0]: 'www')
.'.bebeboutik.'
.($cookie_version
? $cookie_version
: (in_array($domain_chunks[1], $site_versions)
? $domain_chunks[1]
: 'com'
)
)
.$_SERVER['REQUEST_URI']
);
exit;
}
$_COOKIE['site_version'] = $domain_chunks[1];
$_GET['isolang'] = $domain_chunks[1];
$site_version = $domain_chunks[1];
if ($site_version == 'com') {
$site_version_front = 'fr';
} else {
$site_version_front = $site_version;
}
if(isset($site_version)) {
global $smarty;
$smarty->assign('site_version', $site_version);
}

View File

@ -1,164 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2011 PrestaShop SA
* @version Release: $Revision: 9584 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
define('_PS_MODE_DEV_', false);
define('_PS_MODE_DEMO_', false);
$currentDir = dirname(__FILE__);
if (!defined('PHP_VERSION_ID'))
{
$version = explode('.', PHP_VERSION);
define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}
/* Theme URLs */
define('_THEMES_DIR_', __PS_BASE_URI__.'themes/');
define('_THEME_DIR_', _THEMES_DIR_._THEME_NAME_.'/');
define('_THEME_IMG_DIR_', _THEME_DIR_.'img/');
define('_THEME_CSS_DIR_', _THEME_DIR_.'css/');
define('_THEME_JS_DIR_', _THEME_DIR_.'js/');
/* Image URLs */
define('_PS_IMG_', __PS_BASE_URI__.'img/');
define('_PS_ADMIN_IMG_', _PS_IMG_.'admin/');
define('_PS_TMP_IMG_', _PS_IMG_.'tmp/');
define('_THEME_CAT_DIR_', _PS_IMG_.'c/');
define('_THEME_PROD_DIR_', _PS_IMG_.'p/');
define('_THEME_MANU_DIR_', _PS_IMG_.'m/');
define('_THEME_SCENE_DIR_', _PS_IMG_.'scenes/');
define('_THEME_SCENE_THUMB_DIR_', _PS_IMG_.'scenes/thumbs');
define('_THEME_SUP_DIR_', _PS_IMG_.'su/');
define('_THEME_SHIP_DIR_', _PS_IMG_.'s/');
define('_THEME_STORE_DIR_', _PS_IMG_.'st/');
define('_THEME_LANG_DIR_', _PS_IMG_.'l/');
define('_THEME_COL_DIR_', _PS_IMG_.'co/');
define('_SUPP_DIR_', _PS_IMG_.'su/');
define('_PS_PROD_IMG_', 'img/p/');
/* Other URLs */
define('_PS_JS_DIR_', __PS_BASE_URI__.'js/');
define('_PS_CSS_DIR_', __PS_BASE_URI__.'css/');
define('_THEME_PROD_PIC_DIR_', __PS_BASE_URI__.'upload/');
define('_MAIL_DIR_', __PS_BASE_URI__.'mails/');
define('_MODULE_DIR_', __PS_BASE_URI__.'modules/');
/* Directories */
define('_PS_ROOT_DIR_', realpath($currentDir.'/..'));
define('_PS_CLASS_DIR_', _PS_ROOT_DIR_.'/classes/');
define('_PS_CONTROLLER_DIR_', _PS_ROOT_DIR_.'/controllers/');
define('_PS_TRANSLATIONS_DIR_', _PS_ROOT_DIR_.'/translations/');
define('_PS_DOWNLOAD_DIR_', _PS_ROOT_DIR_.'/download/');
define('_PS_MAIL_DIR_', _PS_ROOT_DIR_.'/mails/');
define('_PS_ALL_THEMES_DIR_', _PS_ROOT_DIR_.'/themes/');
define('_PS_THEME_DIR_', _PS_ROOT_DIR_.'/themes/'._THEME_NAME_.'/');
define('_PS_IMG_DIR_', _PS_ROOT_DIR_.'/img/');
if (!defined('_PS_MODULE_DIR_'))
define('_PS_MODULE_DIR_', _PS_ROOT_DIR_.'/modules/');
define('_PS_CAT_IMG_DIR_', _PS_IMG_DIR_.'c/');
define('_PS_STORE_IMG_DIR_', _PS_IMG_DIR_.'st/');
define('_PS_PROD_IMG_DIR_', _PS_IMG_DIR_.'p/');
define('_PS_SCENE_IMG_DIR_', _PS_IMG_DIR_.'scenes/');
define('_PS_SCENE_THUMB_IMG_DIR_', _PS_IMG_DIR_.'scenes/thumbs/');
define('_PS_MANU_IMG_DIR_', _PS_IMG_DIR_.'m/');
define('_PS_SHIP_IMG_DIR_', _PS_IMG_DIR_.'s/');
define('_PS_SUPP_IMG_DIR_', _PS_IMG_DIR_.'su/');
define('_PS_COL_IMG_DIR_', _PS_IMG_DIR_.'co/');
define('_PS_TMP_IMG_DIR_', _PS_IMG_DIR_.'tmp/');
define('_PS_UPLOAD_DIR_', _PS_ROOT_DIR_.'/upload/');
define('_PS_TOOL_DIR_', _PS_ROOT_DIR_.'/tools/');
define('_PS_GEOIP_DIR_', _PS_TOOL_DIR_.'geoip/');
define('_PS_SWIFT_DIR_', _PS_TOOL_DIR_.'swift/');
define('_PS_FPDF_PATH_', _PS_TOOL_DIR_.'fpdf/');
define('_PS_TAASC_PATH_', _PS_TOOL_DIR_.'taasc/');
define('_PS_PEAR_XML_PARSER_PATH_', _PS_TOOL_DIR_.'pear_xml_parser/');
/* settings php */
define('_PS_TRANS_PATTERN_', '(.*[^\\\\])');
define('_PS_MIN_TIME_GENERATE_PASSWD_', '360');
if (!defined('_PS_MAGIC_QUOTES_GPC_'))
define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc());
if (!defined('_PS_MYSQL_REAL_ESCAPE_STRING_'))
define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string'));
define('_CAN_LOAD_FILES_', 1);
/* Order states */
// Order states has been moved in config.inc.php file for backward compatibility reasons
/* Tax behavior */
define('PS_PRODUCT_TAX', 0);
define('PS_STATE_TAX', 1);
define('PS_BOTH_TAX', 2);
define('_PS_PRICE_DISPLAY_PRECISION_', 2);
define('PS_TAX_EXC', 1);
define('PS_TAX_INC', 0);
define('PS_ORDER_PROCESS_STANDARD', 0);
define('PS_ORDER_PROCESS_OPC', 1);
define('PS_ROUND_UP', 0);
define('PS_ROUND_DOWN', 1);
define('PS_ROUND_HALF', 2);
/* Carrier::getCarriers() filter */
// these defines are DEPRECATED since 1.4.5 version
define('PS_CARRIERS_ONLY', 1);
define('CARRIERS_MODULE', 2);
define('CARRIERS_MODULE_NEED_RANGE', 3);
define('PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE', 4);
define('ALL_CARRIERS', 5);
/* SQL Replication management */
define('_PS_USE_SQL_SLAVE_', 0);
/* PS Technical configuration */
define('_PS_ADMIN_PROFILE_', 1);
/* Stock Movement */
define('_STOCK_MOVEMENT_ORDER_REASON_', 3);
define('_STOCK_MOVEMENT_MISSING_REASON_', 4);
define('_PS_DEFAULT_CUSTOMER_GROUP_', 1);
define('_PS_CACHEFS_DIRECTORY_', dirname(__FILE__).'/../cache/cachefs/');
/* Geolocation */
define('_PS_GEOLOCATION_NO_CATALOG_', 0);
define('_PS_GEOLOCATION_NO_ORDER_', 1);
if (!defined('_PS_CACHE_ENABLED_'))
define('_PS_CACHE_ENABLED_', 0);
/* Consumable */
if (!defined('_SHOP_CATEGORYROOT'))
define('_SHOP_CATEGORYROOT', 8720307);
if (!defined('_SHOP_CATEGORYENABLED'))
define('_SHOP_CATEGORYENABLED', 1);
if (!defined('_SHOP_PRIVATESALES_CONSUMABLE'))
define('_SHOP_PRIVATESALES_CONSUMABLE', 5158);

View File

@ -1,37 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2011 PrestaShop SA
* @version Release: $Revision: 6594 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
?>

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<modules_list>
<modules type="native">
<module name="autoupgrade"/>
<module name="bankwire"/>
<module name="birthdaypresent"/>
<module name="blockadvertising"/>
<module name="blockbestsellers"/>
<module name="blockcart"/>
<module name="blockcategories"/>
<module name="blockcms"/>
<module name="blockcurrencies"/>
<module name="blocklanguages"/>
<module name="blocklayered"/>
<module name="blocklink"/>
<module name="blockmanufacturer"/>
<module name="blockmyaccount"/>
<module name="blocknewproducts"/>
<module name="blocknewsletter"/>
<module name="blockpaymentlogo"/>
<module name="blockpermanentlinks"/>
<module name="blockrss"/>
<module name="blocksearch"/>
<module name="blockspecials"/>
<module name="blockstore"/>
<module name="blocksupplier"/>
<module name="blocktags"/>
<module name="blockuserinfo"/>
<module name="blockviewed"/>
<module name="blockwishlist"/>
<module name="cashondelivery"/>
<module name="carriercompare"/>
<module name="cheque"/>
<module name="crossselling"/>
<module name="dateofdelivery"/>
<module name="editorial"/>
<module name="feeder"/>
<module name="followup"/>
<module name="gadsense"/>
<module name="ganalytics"/>
<module name="gcheckout"/>
<module name="graphartichow"/>
<module name="graphgooglechart"/>
<module name="graphvisifire"/>
<module name="graphxmlswfcharts"/>
<module name="gridhtml"/>
<module name="gsitemap"/>
<module name="homefeatured"/>
<module name="importerosc"/>
<module name="livezilla"/>
<module name="loyalty"/>
<module name="mailalerts"/>
<module name="newsletter"/>
<module name="pagesnotfound"/>
<module name="prestafraud"/>
<module name="productcomments"/>
<module name="productscategory"/>
<module name="producttooltip"/>
<module name="referralprogram"/>
<module name="sekeywords"/>
<module name="sendtoafriend"/>
<module name="shopimporter"/>
<module name="statsbestcategories"/>
<module name="statsbestcustomers"/>
<module name="statsbestmanufacturers"/>
<module name="statsbestproducts"/>
<module name="statsbestsuppliers"/>
<module name="statsbestvouchers"/>
<module name="statscarrier"/>
<module name="statscatalog"/>
<module name="statscheckup"/>
<module name="statsdata"/>
<module name="statsequipment"/>
<module name="statsforecast"/>
<module name="statsgeolocation"/>
<module name="statslive"/>
<module name="statsnewsletter"/>
<module name="statsorigin"/>
<module name="statspersonalinfos"/>
<module name="statsproduct"/>
<module name="statsregistrations"/>
<module name="statssales"/>
<module name="statssearch"/>
<module name="statsstock"/>
<module name="statsvisits"/>
<module name="themeinstallator"/>
<module name="tm4b"/>
<module name="trackingfront"/>
<module name="upscarrier"/>
<module name="vatnumber"/>
<module name="watermark"/>
</modules>
<modules type="partner">
<module name="authorizeaim"/>
<module name="cashticket"/>
<module name="criteo"/>
<module name="dejala"/>
<module name="dibs"/>
<module name="ebay"/>
<module name="envoimoinscher"/>
<module name="ekomi"/>
<module name="fedexcarrier"/>
<module name="fianetfraud"/>
<module name="fianetsceau"/>
<module name="hipay"/>
<module name="iadvize"/>
<module name="moneybookers"/>
<module name="mondialrelay"/>
<module name="ogone"/>
<module name="paysafecard"/>
<module name="paypal"/>
<module name="reverso"/>
<module name="secuvad"/>
<module name="socolissimo"/>
<module name="treepodia"/>
<module name="trustedshops"/>
<module name="twenga"/>
<module name="uspscarrier"/>
</modules>
</modules_list>

View File

@ -1,215 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2011 PrestaShop SA
* @version Release: $Revision: 10094 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (Configuration::get('PS_FORCE_SMARTY_2'))
define('_PS_SMARTY_DIR_', _PS_TOOL_DIR_.'smarty_v2/');
else
define('_PS_SMARTY_DIR_', _PS_TOOL_DIR_.'smarty/');
require_once(_PS_SMARTY_DIR_.'Smarty.class.php');
global $smarty;
$smarty = new Smarty();
$smarty->template_dir = _PS_THEME_DIR_.'tpl';
$smarty->compile_dir = _PS_SMARTY_DIR_.'compile';
$smarty->cache_dir = _PS_SMARTY_DIR_.'cache';
$smarty->config_dir = _PS_SMARTY_DIR_.'configs';
$smarty->caching = false;
$smarty->force_compile = (bool)Configuration::get('PS_SMARTY_FORCE_COMPILE');
$smarty->compile_check = false;
$smarty->debugging = false;
$smarty->debugging_ctrl = 'NONE'; // 'NONE' on production
$smarty->deprecation_notices = false; // so many depreciated yet not migrated smarty calls
if (Configuration::get('PS_FORCE_SMARTY_2'))
{
$smarty->debug_tpl = _PS_ALL_THEMES_DIR_.'debug.tpl';
if (Configuration::get('PS_HTML_THEME_COMPRESSION'))
$smarty->register_outputfilter('smartyMinifyHTML');
if (Configuration::get('PS_JS_HTML_THEME_COMPRESSION'))
$smarty->register_outputfilter('smartyPackJSinHTML');
}
else
{
if (Configuration::get('PS_HTML_THEME_COMPRESSION'))
$smarty->registerFilter('output', 'smartyMinifyHTML');
if (Configuration::get('PS_JS_HTML_THEME_COMPRESSION'))
$smarty->registerFilter('output', 'smartyPackJSinHTML');
}
smartyRegisterFunction($smarty, 'modifier', 'truncate', 'smarty_modifier_truncate');
smartyRegisterFunction($smarty, 'modifier', 'secureReferrer', array('Tools', 'secureReferrer'));
smartyRegisterFunction($smarty, 'function', 't', 'smartyTruncate'); // unused
smartyRegisterFunction($smarty, 'function', 'm', 'smartyMaxWords'); // unused
smartyRegisterFunction($smarty, 'function', 'p', 'smartyShowObject'); // Debug only
smartyRegisterFunction($smarty, 'function', 'd', 'smartyDieObject'); // Debug only
smartyRegisterFunction($smarty, 'function', 'l', 'smartyTranslate');
smartyRegisterFunction($smarty, 'function', 'dateFormat', array('Tools', 'dateFormat'));
smartyRegisterFunction($smarty, 'function', 'productPrice', array('Product', 'productPrice')); // unused
smartyRegisterFunction($smarty, 'function', 'convertPrice', array('Product', 'convertPrice'));
smartyRegisterFunction($smarty, 'function', 'convertPriceWithoutDisplay', array('Product', 'productPriceWithoutDisplay')); // unused
smartyRegisterFunction($smarty, 'function', 'convertPriceWithCurrency', array('Product', 'convertPriceWithCurrency'));
smartyRegisterFunction($smarty, 'function', 'displayWtPrice', array('Product', 'displayWtPrice'));
smartyRegisterFunction($smarty, 'function', 'displayWtPriceWithCurrency', array('Product', 'displayWtPriceWithCurrency'));
smartyRegisterFunction($smarty, 'function', 'displayPrice', array('Tools', 'displayPriceSmarty'));
smartyRegisterFunction($smarty, 'modifier', 'convertAndFormatPrice', array('Product', 'convertAndFormatPrice')); // used twice
function smartyTranslate($params, &$smarty)
{
/*
* Warning in Smarty-v2 : 2 lines have been added to the Smarty class.
* "public $currentTemplate = null;" into the class itself
* "$this->currentTemplate = Tools::substr(basename($resource_name), 0, -4);" into the "fetch" method
* Notice : before 1.4.2.5, this modification was in the display method
*
* In Smarty-v3 : No modifications, using the existing var $this->smarty->_current_file instead
*/
global $_LANG, $_MODULES, $cookie, $_MODULE;
if (!isset($params['js'])) $params['js'] = 0;
if (!isset($params['mod'])) $params['mod'] = false;
$string = str_replace('\'', '\\\'', $params['s']);
$key = '';
if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */
$key = $smarty->currentTemplate.'_'.md5($string);
else
{
$filename = ((!isset($smarty->compiler_object) OR !is_object($smarty->compiler_object->template)) ? $smarty->template_filepath : $smarty->compiler_object->template->getTemplateFilepath());
$key = Tools::substr(basename($filename), 0, -4).'_'.md5($string);
}
$lang_array = $_LANG;
if ($params['mod'])
{
$iso = Language::getIsoById($cookie->id_lang);
if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$params['mod'].'/'.$iso.'.php'))
{
$translationsFile = _PS_THEME_DIR_.'modules/'.$params['mod'].'/'.$iso.'.php';
$key = '<{'.$params['mod'].'}'._THEME_NAME_.'>'.$key;
}
else
{
$translationsFile = _PS_MODULE_DIR_.$params['mod'].'/'.$iso.'.php';
$key = '<{'.$params['mod'].'}prestashop>'.$key;
}
if(!is_array($_MODULES))
$_MODULES = array();
if (@include_once($translationsFile))
if(is_array($_MODULE))
$_MODULES = array_merge($_MODULES, $_MODULE);
$lang_array = $_MODULES;
}
if (is_array($lang_array) AND key_exists($key, $lang_array))
$msg = $lang_array[$key];
elseif (is_array($lang_array) AND key_exists(Tools::strtolower($key), $lang_array))
$msg = $lang_array[Tools::strtolower($key)];
else
$msg = $params['s'];
if ($msg != $params['s'])
$msg = $params['js'] ? addslashes($msg) : stripslashes($msg);
return $params['js'] ? $msg : Tools::htmlentitiesUTF8($msg);
}
function smartyDieObject($params, &$smarty)
{
return Tools::d($params['var']);
}
function smartyShowObject($params, &$smarty)
{
return Tools::p($params['var']);
}
function smartyMaxWords($params, &$smarty)
{
Tools::displayAsDeprecated();
$params['s'] = str_replace('...', ' ...', html_entity_decode($params['s'], ENT_QUOTES, 'UTF-8'));
$words = explode(' ', $params['s']);
foreach($words AS &$word)
if(Tools::strlen($word) > $params['n'])
$word = Tools::substr(trim(chunk_split($word, $params['n']-1, '- ')), 0, -1);
return implode(' ', Tools::htmlentitiesUTF8($words));
}
function smartyTruncate($params, &$smarty)
{
Tools::displayAsDeprecated();
$text = isset($params['strip']) ? strip_tags($params['text']) : $params['text'];
$length = $params['length'];
$sep = isset($params['sep']) ? $params['sep'] : '...';
if (Tools::strlen($text) > $length + Tools::strlen($sep))
$text = Tools::substr($text, 0, $length).$sep;
return (isset($params['encode']) ? Tools::htmlentitiesUTF8($text, ENT_NOQUOTES) : $text);
}
function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false, $charset = 'UTF-8')
{
if (!$length)
return '';
if (Tools::strlen($string) > $length)
{
$length -= min($length, Tools::strlen($etc));
if (!$break_words && !$middle)
$string = preg_replace('/\s+?(\S+)?$/u', '', Tools::substr($string, 0, $length+1, $charset));
return !$middle ? Tools::substr($string, 0, $length, $charset).$etc : Tools::substr($string, 0, $length/2, $charset).$etc.Tools::substr($string, -$length/2, $length, $charset);
}
else
return $string;
}
function smartyMinifyHTML($tpl_output, &$smarty)
{
$tpl_output = Tools::minifyHTML($tpl_output);
return $tpl_output;
}
function smartyPackJSinHTML($tpl_output, &$smarty)
{
$tpl_output = Tools::packJSinHTML($tpl_output);
return $tpl_output;
}
function smartyRegisterFunction($smarty, $type, $function, $params)
{
if (!in_array($type, array('function', 'modifier')))
return false;
if (!Configuration::get('PS_FORCE_SMARTY_2'))
$smarty->registerPlugin($type, $function, $params); // Use Smarty 3 API calls, only if PHP version > 5.1.2
else
$smarty->{'register_'.$type}($function, $params); // or keep a backward compatibility if PHP version < 5.1.2
}