コード例 #1
0
 function Load($id)
 {
     $sFileName = $this->GetFileName($id);
     if ($sFileName == "") {
         $sFileName = $this->GetFileName(EW_LANGUAGE_DEFAULT_ID);
     }
     if ($sFileName == "") {
         return;
     }
     if (EW_USE_DOM_XML) {
         $this->Phrases = new cXMLDocument();
         $this->Phrases->Load($sFileName);
     } else {
         if (is_array(@$_SESSION[EW_PROJECT_NAME . "_" . $sFileName])) {
             $this->Phrases = $_SESSION[EW_PROJECT_NAME . "_" . $sFileName];
         } else {
             $this->Phrases = ew_Xml2Array(ew_ReadFile($sFileName));
         }
     }
 }
コード例 #2
0
ファイル: ewshared12.php プロジェクト: NoSympathy/Dashboard
 function Load($id)
 {
     global $DEFAULT_DECIMAL_POINT, $DEFAULT_THOUSANDS_SEP, $DEFAULT_MON_DECIMAL_POINT, $DEFAULT_MON_THOUSANDS_SEP, $DEFAULT_CURRENCY_SYMBOL, $DEFAULT_POSITIVE_SIGN, $DEFAULT_NEGATIVE_SIGN, $DEFAULT_FRAC_DIGITS, $DEFAULT_P_CS_PRECEDES, $DEFAULT_P_SEP_BY_SPACE, $DEFAULT_N_CS_PRECEDES, $DEFAULT_N_SEP_BY_SPACE, $DEFAULT_P_SIGN_POSN, $DEFAULT_N_SIGN_POSN, $USE_DEFAULT_LOCALE, $DEFAULT_LOCALE, $DEFAULT_TIME_ZONE;
     $sFileName = $this->GetFileName($id);
     if ($sFileName == "") {
         $sFileName = $this->GetFileName(EW_LANGUAGE_DEFAULT_ID);
     }
     if ($sFileName == "") {
         return;
     }
     if (EW_USE_DOM_XML) {
         $this->Phrases = new cXMLDocument();
         $this->Phrases->Load($sFileName);
     } else {
         if (is_array(@$_SESSION[EW_PROJECT_NAME . "_" . $sFileName])) {
             $this->Phrases = $_SESSION[EW_PROJECT_NAME . "_" . $sFileName];
         } else {
             $this->Phrases = ew_Xml2Array(file_get_contents($sFileName));
         }
     }
     // Set up locale / currency format for language
     if ($this->LocalePhrase("use_system_locale") == "1") {
         // Use system locale
         $langLocale = $this->LocalePhrase("locale");
         if ($langLocale != "") {
             @setlocale(LC_ALL, $langLocale);
         }
         // Set language locale
         extract(ew_LocaleConv());
         if (!empty($decimal_point)) {
             $DEFAULT_DECIMAL_POINT = $decimal_point;
         }
         if (!empty($thousands_sep)) {
             $DEFAULT_THOUSANDS_SEP = $thousands_sep;
         }
         if (!empty($mon_decimal_point)) {
             $DEFAULT_MON_DECIMAL_POINT = $mon_decimal_point;
         }
         if (empty($DEFAULT_MON_DECIMAL_POINT)) {
             $DEFAULT_MON_DECIMAL_POINT = $DEFAULT_DECIMAL_POINT;
         }
         if (!empty($mon_thousands_sep)) {
             $DEFAULT_MON_THOUSANDS_SEP = $mon_thousands_sep;
         }
         if (empty($DEFAULT_MON_THOUSANDS_SEP)) {
             $DEFAULT_MON_THOUSANDS_SEP = $DEFAULT_THOUSANDS_SEP;
         }
         if (!empty($currency_symbol)) {
             if (EW_CHARSET == "utf-8") {
                 if ($int_curr_symbol == "EUR" && ord($currency_symbol) == 128) {
                     $currency_symbol = "€";
                 } elseif ($int_curr_symbol == "GBP" && ord($currency_symbol) == 163) {
                     $currency_symbol = "£";
                 } elseif ($int_curr_symbol == "JPY" && ord($currency_symbol) == 92) {
                     $currency_symbol = "¥";
                 }
             }
             $DEFAULT_CURRENCY_SYMBOL = $currency_symbol;
         }
         if (!empty($positive_sign)) {
             $DEFAULT_POSITIVE_SIGN = $positive_sign;
         }
         if (!empty($negative_sign)) {
             $DEFAULT_NEGATIVE_SIGN = $negative_sign;
         }
         if (!empty($frac_digits) && $frac_digits != CHAR_MAX) {
             $DEFAULT_FRAC_DIGITS = $frac_digits;
         }
         if (!empty($p_cs_precedes) && $p_cs_precedes != CHAR_MAX) {
             $DEFAULT_P_CS_PRECEDES = $p_cs_precedes;
         }
         if (!empty($p_sep_by_space) && $p_sep_by_space != CHAR_MAX) {
             $DEFAULT_P_SEP_BY_SPACE = $p_sep_by_space;
         }
         if (!empty($n_cs_precedes) && $n_cs_precedes != CHAR_MAX) {
             $DEFAULT_N_CS_PRECEDES = $n_cs_precedes;
         }
         if (!empty($n_sep_by_space) && $n_sep_by_space != CHAR_MAX) {
             $DEFAULT_N_SEP_BY_SPACE = $n_sep_by_space;
         }
         if (!empty($p_sign_posn) && $p_sign_posn != CHAR_MAX) {
             $DEFAULT_P_SIGN_POSN = $p_sign_posn;
         }
         if (!empty($n_sign_posn) && $n_sign_posn != CHAR_MAX) {
             $DEFAULT_N_SIGN_POSN = $n_sign_posn;
         }
     } else {
         // Use language file
         $ar = array("p_cs_precedes", "p_sep_by_space", "n_cs_precedes", "n_sep_by_space");
         foreach ($DEFAULT_LOCALE as $key => $value) {
             if ($this->LocalePhrase($key) != "") {
                 $DEFAULT_LOCALE[$key] = in_array($key, $ar) ? $this->LocalePhrase($key) == "1" : $this->LocalePhrase($key);
             }
         }
     }
 }
コード例 #3
0
ファイル: ewshared9.php プロジェクト: Rastrian/RBAC_Manager
 function Load($id)
 {
     global $DEFAULT_DECIMAL_POINT, $DEFAULT_THOUSANDS_SEP, $DEFAULT_MON_DECIMAL_POINT, $DEFAULT_MON_THOUSANDS_SEP;
     global $DEFAULT_CURRENCY_SYMBOL, $DEFAULT_POSITIVE_SIGN, $DEFAULT_NEGATIVE_SIGN, $DEFAULT_FRAC_DIGITS;
     global $DEFAULT_P_CS_PRECEDES, $DEFAULT_P_SEP_BY_SPACE, $DEFAULT_N_CS_PRECEDES, $DEFAULT_N_SEP_BY_SPACE, $DEFAULT_P_SIGN_POSN, $DEFAULT_N_SIGN_POSN;
     global $DEFAULT_LOCALE;
     global $DEFAULT_TIME_ZONE;
     $sFileName = $this->GetFileName($id);
     if ($sFileName == "") {
         $sFileName = $this->GetFileName(EW_LANGUAGE_DEFAULT_ID);
     }
     if ($sFileName == "") {
         return;
     }
     if (EW_USE_DOM_XML) {
         $this->Phrases = new cXMLDocument();
         $this->Phrases->Load($sFileName);
     } else {
         if (is_array(@$_SESSION[EW_PROJECT_NAME . "_" . $sFileName])) {
             $this->Phrases = $_SESSION[EW_PROJECT_NAME . "_" . $sFileName];
         } else {
             $this->Phrases = ew_Xml2Array(file_get_contents($sFileName));
         }
     }
     // Set up locale / currency format for language
     $bUseSystemLocale = $this->LocalePhrase("use_system_locale") == "1" ? TRUE : FALSE;
     $ar = array("p_cs_precedes", "p_sep_by_space", "n_cs_precedes", "n_sep_by_space");
     foreach ($DEFAULT_LOCALE as $key => $value) {
         if ($this->LocalePhrase($key) != "") {
             $DEFAULT_LOCALE[$key] = in_array($key, $ar) ? $this->LocalePhrase($key) == "1" : $this->LocalePhrase($key);
         }
     }
     if ($bUseSystemLocale) {
         $langLocale = $this->LocalePhrase("locale");
         if ($langLocale != "") {
             //$curLocale = @setlocale(LC_ALL, "0"); // Get current locale
             if (setlocale(LC_ALL, $langLocale) == TRUE) {
                 // Set language locale
                 extract(localeconv());
             }
             //@setlocale(LC_ALL, $curLocale); // Restore current locale
         } else {
             extract(localeconv());
         }
         if (!empty($decimal_point)) {
             $DEFAULT_DECIMAL_POINT = $decimal_point;
         }
         $DEFAULT_THOUSANDS_SEP = $thousands_sep;
         if (!empty($mon_decimal_point)) {
             $DEFAULT_MON_DECIMAL_POINT = $mon_decimal_point;
         }
         $DEFAULT_MON_THOUSANDS_SEP = $mon_thousands_sep;
         if (!empty($currency_symbol)) {
             if (EW_CHARSET == "utf-8") {
                 if ($int_curr_symbol == "EUR" && ord($currency_symbol) == 128) {
                     $currency_symbol = "€";
                 } elseif ($int_curr_symbol == "GBP" && ord($currency_symbol) == 163) {
                     $currency_symbol = "£";
                 } elseif ($int_curr_symbol == "JPY" && ord($currency_symbol) == 92) {
                     $currency_symbol = "¥";
                 }
             }
             $DEFAULT_CURRENCY_SYMBOL = $currency_symbol;
         }
         if (!empty($positive_sign)) {
             $DEFAULT_POSITIVE_SIGN = $positive_sign;
         }
         if (!empty($negative_sign)) {
             $DEFAULT_NEGATIVE_SIGN = $negative_sign;
         }
         if (!empty($frac_digits) && $frac_digits != CHAR_MAX) {
             $DEFAULT_FRAC_DIGITS = $frac_digits;
         }
         if (!empty($p_cs_precedes) && $p_cs_precedes != CHAR_MAX) {
             $DEFAULT_P_CS_PRECEDES = $p_cs_precedes;
         }
         if (!empty($p_sep_by_space) && $p_sep_by_space != CHAR_MAX) {
             $DEFAULT_P_SEP_BY_SPACE = $p_sep_by_space;
         }
         if (!empty($n_cs_precedes) && $n_cs_precedes != CHAR_MAX) {
             $DEFAULT_N_CS_PRECEDES = $n_cs_precedes;
         }
         if (!empty($n_sep_by_space) && $n_sep_by_space != CHAR_MAX) {
             $DEFAULT_N_SEP_BY_SPACE = $n_sep_by_space;
         }
         if (!empty($p_sign_posn) && $p_sign_posn != CHAR_MAX) {
             $DEFAULT_P_SIGN_POSN = $p_sign_posn;
         }
         if (!empty($n_sign_posn) && $n_sign_posn != CHAR_MAX) {
             $DEFAULT_N_SIGN_POSN = $n_sign_posn;
         }
     }
     /**
      * Time zone (Note: Requires PHP 5 >= 5.1.0)
      * Read http://www.php.net/date_default_timezone_set for details
      * and http://www.php.net/timezones for supported time zones
      */
     // Set up time zone from language file for multi-lanuage site
     if ($this->LocalePhrase("time_zone") != "") {
         $DEFAULT_TIME_ZONE = $this->LocalePhrase("time_zone");
     }
     if (function_exists("date_default_timezone_set") && $DEFAULT_TIME_ZONE != "") {
         date_default_timezone_set($DEFAULT_TIME_ZONE);
     }
 }