[*] PDF : PDF is now rendered by TCPDF throught HTML template
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10231 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -29,8 +29,9 @@ $smarty->template_dir = _PS_THEME_DIR_.'tpl';
|
||||
|
||||
function smartyTranslate($params, &$smarty)
|
||||
{
|
||||
global $_LANG, $_MODULES, $cookie, $_MODULE;
|
||||
global $_LANG, $_MODULES, $cookie, $_MODULE, $_LANGPDF;
|
||||
if (!isset($params['js'])) $params['js'] = 0;
|
||||
if (!isset($params['pdf'])) $params['pdf'] = false;
|
||||
if (!isset($params['mod'])) $params['mod'] = false;
|
||||
|
||||
$string = str_replace('\'', '\\\'', $params['s']);
|
||||
@@ -58,7 +59,18 @@ function smartyTranslate($params, &$smarty)
|
||||
if(is_array($_MODULE))
|
||||
$_MODULES = array_merge($_MODULES, $_MODULE);
|
||||
$lang_array = $_MODULES;
|
||||
}
|
||||
}
|
||||
else if ($params['pdf'])
|
||||
{
|
||||
$iso = Language::getIsoById($cookie->id_lang);
|
||||
$translationsFile = _PS_THEME_DIR_.'pdf/lang/'.$iso.'.php';
|
||||
|
||||
if (Tools::file_exists_cache($translationsFile))
|
||||
@include_once($translationsFile);
|
||||
|
||||
$key = 'PDF'.md5($string);
|
||||
$lang_array = $_LANGPDF;
|
||||
}
|
||||
|
||||
if (is_array($lang_array) AND key_exists($key, $lang_array))
|
||||
$msg = $lang_array[$key];
|
||||
@@ -69,5 +81,6 @@ function smartyTranslate($params, &$smarty)
|
||||
|
||||
if ($msg != $params['s'])
|
||||
$msg = $params['js'] ? addslashes($msg) : stripslashes($msg);
|
||||
|
||||
return $params['js'] ? $msg : Tools::htmlentitiesUTF8($msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user