[*] Project : Version 2 of Smarty has been removed for using only version 3

This commit is contained in:
aFolletete
2011-09-14 13:27:32 +00:00
parent 0d2e025bc1
commit 48f666d29d
89 changed files with 19 additions and 9888 deletions

View File

@@ -998,11 +998,6 @@ abstract class Module
{
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');
@@ -1011,8 +1006,6 @@ abstract class Module
$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;
}
@@ -1025,24 +1018,14 @@ abstract class Module
{
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)
{
global $smarty;
/* Use Smarty 3 API calls */
if (!Configuration::get('PS_FORCE_SMARTY_2')) /* PHP version > 5.1.2 */
return $smarty->clearCache($template ? $this->_getApplicableTemplateDir($template).$template : NULL, $cacheId, $compileId);
/* or keep a backward compatibility if PHP version < 5.1.2 */
else
return $smarty->clear_cache($template ? $this->_getApplicableTemplateDir($template).$template : NULL, $cacheId, $compileId);
return $smarty->clearCache($template ? $this->_getApplicableTemplateDir($template).$template : NULL, $cacheId, $compileId);
}
protected function _generateConfigXml()