コード例 #1
0
ファイル: Language.php プロジェクト: rvanbaalen/bili
 public static function get($strName, $strCategory = "global", $blnReturnError = true)
 {
     //*** Get a translation from the language file.
     $strReturn = $blnReturnError ? sprintf(self::$error, $strName, $strCategory) : "";
     if (isset(self::$languages[$strCategory][$strName])) {
         $strReturn = self::$languages[$strCategory][$strName];
     }
     //*** Output sanitisation?
     switch (self::$sanitizeType) {
         case "xhtml":
             if (class_exists("Bili\\Sanitize", true)) {
                 $strReturn = Sanitize::toXhtml($strReturn);
             }
             break;
         case "entities":
             if (class_exists("Bili\\Sanitize", true)) {
                 $strReturn = Sanitize::toEntities($strReturn);
             }
             break;
     }
     return $strReturn;
 }