1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
$domaine = 'traduction';
$langue = Conf::$lang;
$supported_locales = $langue['autorise'];
$sessionLang = $this->Session->read('langue');
$locale = (isset($sessionLang))? $sessionLang : $langue['default'];
T_setlocale(LC_MESSAGES, $locale);
bindtextdomain($domaine, ROOT.DS.'locale'.DS.'traduit'.DS.'layout');
bindtextdomain('controller', ROOT.DS.'locale'.DS.'traduit'.DS.$this->request->controller);
bind_textdomain_codeset($domaine, 'UTF-8');
textdomain($domaine);
header("Content-type: text/html; charset=UTF-8");
ob_start();
$langueLayout = ROOT.DS.'locale'.DS.'default'.DS.'layout'.DS.$tpl.'.php';
$langueAction = ROOT.DS.'locale'.DS.'default'.DS.$this->request->controller.DS.$this->request->action.'.php';
if(file_exists($langueLayout)) require_once($langueLayout);
if(file_exists($langueAction)) require_once($langueAction);
$this->request->smarty->display($view);
$content_for_layout = ob_get_clean();
$this->request->smarty->assign("SessionFlash", $this->Session->flash());
$this->request->smarty->assign("content_for_layout", $content_for_layout);
$this->request->smarty->assign("default_style", $style);
$this->request->smarty->assign("controller", $this->request->controller);
$this->request->smarty->display('layout'.DS.$tpl.'.tpl');
$this->rendered = true; |
Partager