Exemple #1
0
 public static function loadLanguages()
 {
     $db = JFactory::getDBO();
     self::$_LANGUAGES = array();
     $query = " SELECT * FROM " . $db->quoteName('#__languages');
     $db->setQuery($query);
     $languages = $db->loadObjectList();
     $default_language = JFactory::getLanguage();
     foreach ($languages as $language) {
         if (!isset(self::$_LANGUAGES[(int) $language->lang_id])) {
             $lang = new JObject();
             $lang->lang_id = $language->lang_id;
             $lang->language_code = $language->lang_code;
             $lang->name = $language->title;
             $lang->iso_code = $language->sef;
             $lang->published = $language->published;
             $lang->language_code == $default_language->getTag() ? $lang->is_default = 1 : ($lang->is_default = 0);
             self::$_LANGUAGES[(int) $language->lang_id] = $lang;
         }
     }
 }