[*] Project : Version 2 of Smarty has been removed for using only version 3
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8569 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -95,8 +95,7 @@ class AdminPreferences extends AdminTab
|
||||
'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'),
|
||||
'PRESTASTORE_LIVE' => array('title' => $this->l('Automatically check for module updates'), 'desc' => $this->l('New modules and updates are displayed on the modules page'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_HIDE_OPTIMIZATION_TIPS' => array('title' => $this->l('Hide optimization tips'), 'desc' => $this->l('Hide optimization tips on the back office homepage'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_FORCE_SMARTY_2' => array('title' => $this->l('Use Smarty 2 instead of 3'), 'desc' => $this->l('Enable if your theme is incompatible with Smarty 3 (you should update your theme, since Smarty 2 will be unsupported from PrestaShop v1.5)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')
|
||||
);
|
||||
if (function_exists('date_default_timezone_set'))
|
||||
$this->_fieldsGeneral['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name');
|
||||
|
||||
@@ -1032,11 +1032,6 @@ abstract class SelfModule
|
||||
{
|
||||
global $smarty;
|
||||
|
||||
if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */
|
||||
{
|
||||
$previousTemplate = $smarty->currentTemplate;
|
||||
$smarty->currentTemplate = substr(basename($template), 0, -4);
|
||||
}
|
||||
$smarty->assign('module_dir', __PS_BASE_URI__.'modules/'.basename($file, '.php').'/');
|
||||
if (($overloaded = self::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === NULL)
|
||||
$result = Tools::displayError('No template found for module').' '.basename($file,'.php');
|
||||
@@ -1045,8 +1040,6 @@ abstract class SelfModule
|
||||
$smarty->assign('module_template_dir', ($overloaded ? _THEME_DIR_ : __PS_BASE_URI__).'modules/'.basename($file, '.php').'/');
|
||||
$result = $smarty->fetch(($overloaded ? _PS_THEME_DIR_.'modules/'.basename($file, '.php') : _PS_MODULE_DIR_.basename($file, '.php')).'/'.$template, $cacheId, $compileId);
|
||||
}
|
||||
if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */
|
||||
$smarty->currentTemplate = $previousTemplate;
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1059,12 +1052,7 @@ abstract class SelfModule
|
||||
{
|
||||
global $smarty;
|
||||
|
||||
/* Use Smarty 3 API calls */
|
||||
if (!Configuration::get('PS_FORCE_SMARTY_2')) /* PHP version > 5.1.2 */
|
||||
return $smarty->isCached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId);
|
||||
/* or keep a backward compatibility if PHP version < 5.1.2 */
|
||||
else
|
||||
return $smarty->is_cached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId);
|
||||
return $smarty->isCached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId);
|
||||
}
|
||||
|
||||
protected function _clearCache($template, $cacheId = NULL, $compileId = NULL)
|
||||
|
||||
@@ -2006,19 +2006,6 @@ FileETag INode MTime Size
|
||||
return $version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc selection of Smarty depending on the version of php
|
||||
*
|
||||
*/
|
||||
public static function selectionVersionSmarty()
|
||||
{
|
||||
//Smarty 3 requirements PHP 5.2 +
|
||||
if (strnatcmp(self::checkPhpVersion(),'5.2.0') >= 0)
|
||||
Configuration::updateValue('PS_FORCE_SMARTY_2', 0);
|
||||
else
|
||||
Configuration::updateValue('PS_FORCE_SMARTY_2',1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc try to open a zip file in order to check if it's valid
|
||||
* @return bool success
|
||||
@@ -2150,10 +2137,7 @@ FileETag INode MTime Size
|
||||
*/
|
||||
public static function clearCache($smarty)
|
||||
{
|
||||
if (!Configuration::get('PS_FORCE_SMARTY_2'))
|
||||
$smarty->clearAllCache();
|
||||
else
|
||||
$smarty->clear_all_cache();
|
||||
$smarty->clearAllCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,11 +118,6 @@ abstract class AbsTrustedShops
|
||||
{
|
||||
$smarty = $this->context->smarty;
|
||||
|
||||
if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */
|
||||
{
|
||||
$previousTemplate = $smarty->currentTemplate;
|
||||
$smarty->currentTemplate = substr(basename($template), 0, -4);
|
||||
}
|
||||
$smarty->assign('module_dir', __PS_BASE_URI__.'modules/'.basename($file, '.php').'/');
|
||||
if (($overloaded = self::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === NULL)
|
||||
$result = Tools::displayError('No template found');
|
||||
@@ -131,8 +126,6 @@ abstract class AbsTrustedShops
|
||||
$smarty->assign('module_template_dir', ($overloaded ? _THEME_DIR_ : __PS_BASE_URI__).'modules/'.basename($file, '.php').'/');
|
||||
$result = $smarty->fetch(($overloaded ? _PS_THEME_DIR_.'modules/'.basename($file, '.php') : _PS_MODULE_DIR_.basename($file, '.php')).'/'.$template, $cacheId, $compileId);
|
||||
}
|
||||
if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */
|
||||
$smarty->currentTemplate = $previousTemplate;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user