Exemplo n.º 1
0
 /**
  * Parses a language configuration file, can also parse a language config
  * for any addon.
  *
  * @param string $addonName
  * @access public
  */
 public static function parseLanguageConfigFile($addonName = null)
 {
     $default = $addonName ? FLUX_ADDON_DIR . "/{$addonName}/lang/en_us.php" : FLUX_LANG_DIR . '/en_us.php';
     $current = $default;
     if ($lang = self::config('DefaultLanguage')) {
         $current = $addonName ? FLUX_ADDON_DIR . "/{$addonName}/lang/{$lang}.php" : FLUX_LANG_DIR . "/{$lang}.php";
     }
     if (file_exists($default)) {
         $def = self::parseConfigFile($default);
     } else {
         $tmp = array();
         $def = new Flux_Config($tmp);
     }
     if ($current != $default && file_exists($current)) {
         $cur = self::parseConfigFile($current);
         $def->merge($cur, false);
     }
     return $def;
 }