public function getLang() { /* * Charge le fichier de lang par defaut et celui lié au controller * puis les stock dans un même tableau * Si la variable $_POST['LangToJs'] est définie, * alors on envoie le contenue de la langue en json */ $sRequestLang = isset($_POST['PhpLangToJs']) ? strtolower($_POST['PhpLangToJs']) : strtolower($_SESSION['class']); $sRequestLang = ucfirst($sRequestLang); DebugAppModel::logThis(__FILE__, __LINE__, 'Langue chargé: ' . $_SESSION['lang'] . ' - sRequestLang: ' . $sRequestLang); if (!is_dir($this->sLangPath)) { DebugAppModel::logThis(__FILE__, __LINE__, 'Dossier introuvable: ' . $this->sLangPath); return false; } if (!is_file($this->sLangPath . 'DefautLang.php')) { $DefautLang = array(); } else { require_once $this->sLangPath . 'DefautLang.php'; } if (!is_file($this->sLangPath . $sRequestLang . 'Lang.php')) { ${$sRequestLang . 'Lang'} = array(); } else { require_once $this->sLangPath . $sRequestLang . 'Lang.php'; } /* * Merge les deux table de lang */ $this->aLang = array_merge($DefautLang, ${$sRequestLang . 'Lang'}); if (AUTO_HTMLENTITIES_LANG) { foreach ($this->aLang as $sKey => $sValue) { $this->aLang[$sKey] = htmlentities($sValue); } } }
public function logThis() { DebugAppModel::logThis(__FILE__, __LINE__, 'Class: [ ' . $_SESSION['class'] . ' ] - Method: [ ' . $_SESSION['method'] . ' ]'); }
public function logThis() { /* * Converti les variables $this->mSetLayout et $this->mSetView * afin de les inscrire dans le fichier de log */ if (is_bool($this->mSetLayout)) { $sSetLayout = $this->mSetLayout ? 'true' : 'false'; } else { $sSetLayout = $this->mSetLayout; } if (is_bool($this->mSetView)) { $sSetView = $this->mSetView ? 'true' : 'false'; } else { $sSetView = $this->mSetView; } $mSetView = $this->mSetView; $sAView = empty($this->aView) ? 'empty' : 'not empty'; DebugAppModel::logThis(__FILE__, __LINE__, 'mSetLayout: ' . $sSetLayout . ' - mSetView: ' . $sSetView . ' - aView: ' . $sAView); }