/** * Smarty {sessionlang} function plugin * * Type: function * Name: getUrl * Date: September 11, 2009 * Purpose: Récupère la langue en cours. * Examples: {sessionlang} * Output: * @link * @author Gerits Aurelien * @version 1.0 * @param array * @param Smarty * @return string */ function smarty_function_sessionlang($params, $template) { if (!$_GET['strLangue']) { $_SESSION['strLangue'] = 'fr'; } return !empty($_SESSION['strLangue']) ? magixcjquery_filter_join::getCleanAlpha($_SESSION['strLangue'], 3) : 'fr'; }
/** * function construct */ function __construct() { if (magixcjquery_filter_request::isGet('strLangue')) { $this->getlang = magixcjquery_filter_join::getCleanAlpha($_GET['strLangue'], 3); } else { $this->getlang = frontend_model_template::current_Language(); } }
/** * Retourne la langue en cours de session sinon retourne fr par défaut * @return string * @access public * @static */ public static function current_Language() { if (isset(self::$adminLanguage)) { if (!empty(self::$adminLanguage)) { $lang = magixcjquery_filter_join::getCleanAlpha($_SESSION['adminLanguage'], 3); } else { $lang = 'fr'; } } else { if (magixcjquery_filter_request::isSession('adminLanguage')) { $lang = magixcjquery_filter_join::getCleanAlpha($_SESSION['adminLanguage'], 3); } else { $lang = 'fr'; } } return $lang; }
/** * function construct class * */ function __construct() { if (isset($_GET['strLangue'])) { $this->loadlang = magixcjquery_filter_join::getCleanAlpha($_GET['strLangue'], 3); } }
/** * Retourne la langue en cours de session sinon retourne fr par défaut * @return string * @access public * @static */ public static function current_Language() { if (magixcjquery_filter_request::isGet('strLangue')) { $lang = self::getLanguage(); } else { $db = frontend_db_lang::s_default_language(); if ($db != null) { $lang = $db['iso']; } else { if (magixcjquery_filter_request::isSession('strLangue')) { $lang = magixcjquery_filter_join::getCleanAlpha($_SESSION['strLangue'], 3); } } } return $lang; }
/** * Retourne la langue courante * @return string * @access public * @static */ public function getLanguage() { if (isset($_GET['strLangue'])) { if (!empty($_GET['strLangue'])) { return magixcjquery_filter_join::getCleanAlpha($_GET['strLangue'], 3); } } }