示例#1
0
 /**
  * Loads the language config from the database
  *
  * This used to be in __construct but is also
  * called from core/language.class.php to reload
  * the config, so core/settings.class.php can
  * rewrite .htaccess (virtual lang dirs).
  */
 static function init()
 {
     global $_CONFIG, $objDatabase;
     $objResult = $objDatabase->Execute("\n            SELECT id, lang, name, charset, themesid,\n                   frontend, backend, is_default\n              FROM " . DBPREFIX . "languages\n             ORDER BY id ASC");
     if ($objResult) {
         // setting full to true for update
         $full = true;
         while (!$objResult->EOF) {
             self::$arrLanguages[$objResult->fields['id']] = array('id' => $objResult->fields['id'], 'lang' => $objResult->fields['lang'], 'name' => $objResult->fields['name'], 'charset' => $objResult->fields['charset'], 'themesid' => $objResult->fields['themesid'], 'frontend' => $objResult->fields['frontend'], 'backend' => $objResult->fields['backend'], 'is_default' => $objResult->fields['is_default'], 'fallback' => '');
             if (!$full && $objResult->fields['is_default'] != 'true') {
                 self::$arrLanguages[$objResult->fields['id']]['frontend'] = 0;
                 self::$arrLanguages[$objResult->fields['id']]['backend'] = 0;
             }
             if ($objResult->fields['is_default'] == 'true') {
                 self::$defaultLangId = $objResult->fields['id'];
             }
             $objResult->MoveNext();
         }
     }
 }
示例#2
0
 /**
  * Loads the language config from the database
  *
  * This used to be in __construct but is also
  * called from core/language.class.php to reload
  * the config, so core/settings.class.php can
  * rewrite .htaccess (virtual lang dirs).
  */
 static function init()
 {
     global $_CONFIG, $objDatabase;
     $objResult = $objDatabase->Execute("\n            SELECT id, lang, name, charset, themesid,\n                   frontend, backend, is_default, fallback\n              FROM " . DBPREFIX . "languages\n             ORDER BY id ASC");
     if ($objResult) {
         $license = \Cx\Core_Modules\License\License::getCached($_CONFIG, $objDatabase);
         $license->check();
         $full = $license->isInLegalComponents('fulllanguage');
         while (!$objResult->EOF) {
             self::$arrLanguages[$objResult->fields['id']] = array('id' => $objResult->fields['id'], 'lang' => $objResult->fields['lang'], 'name' => $objResult->fields['name'], 'charset' => $objResult->fields['charset'], 'themesid' => $objResult->fields['themesid'], 'frontend' => $objResult->fields['frontend'], 'backend' => $objResult->fields['backend'], 'is_default' => $objResult->fields['is_default'], 'fallback' => $objResult->fields['fallback']);
             if (!$full && $objResult->fields['is_default'] != 'true') {
                 self::$arrLanguages[$objResult->fields['id']]['frontend'] = 0;
                 self::$arrLanguages[$objResult->fields['id']]['backend'] = 0;
             }
             if ($objResult->fields['is_default'] == 'true') {
                 self::$defaultLangId = $objResult->fields['id'];
             }
             $objResult->MoveNext();
         }
     }
 }