36 require_once
"./classes/class.ilObject.php";
92 $this->
ilObject($a_id,$a_call_by_reference);
97 $this->lang_path = $lng->lang_path;
98 $this->lang_default = $lng->lang_default;
99 $this->lang_user = $lng->lang_user;
100 $this->separator = $lng->separator;
121 $lng->loadLanguageModule(
"meta");
124 $d = dir($this->lang_path);
126 chdir ($this->lang_path);
129 while ($entry =
$d->read())
131 if (is_file($entry) && (ereg (
"(^ilias_.{2}\.lang$)", $entry)))
133 $lang_key = substr($entry,6,2);
142 $tmp_array = array();
146 $lang_keys = array();
151 foreach ($lang_db as
$lang)
154 $lang_key = $lang[
"title"];
156 $lang_keys[] = $lang_key;
159 if ($lang_key == $this->lang_user)
164 if ($lang_key == $this->lang_default)
166 $languages[$lang_key][
"status"] =
"system_language";
170 if ((count($tmp_array) > 0) && (!in_array($lang_key,$tmp_array)))
172 $languages[$lang_key][
"info"] =
"file_not_found";
178 foreach (
$languages as $lang_key => $lang_data)
180 if (!in_array($lang_key,$lang_keys))
182 $languages[$lang_key][
"info"] =
"new_language";
196 foreach (
$languages as $lang_key => $lang_data)
198 $languages[$lang_key][
"name"] = $lng->txt(
"meta_l_".$lang_key);
218 if (count($a_languages) > 0)
220 foreach ($a_languages as $lang_key => $lang_data)
222 if ($lang_data[
"info"] ==
"new_language")
224 include_once(
"./Services/Language/classes/class.ilObjLanguage.php");
226 $lngObj->setTitle($lang_key);
227 $lngObj->setDescription(
"not_installed");
232 $a_languages[$lang_key] = array(
"obj_id" => $lngObj->getId(),
233 "type" => $lngObj->getType(),
234 "description" => $lngObj->getDescription(),
235 "desc" => $lngObj->getDescription(),
236 "owner" => $lngObj->getOwner(),
237 "create_date" => $lngObj->getCreateDate(),
238 "last_update" => $lngObj->getLastUpdateDate());
240 $a_languages[$lang_key][
"info"] =
"new_language";
263 foreach ($a_languages as $lang_key => $lang_data)
265 if ($lang_data[
"desc"] ==
"not_installed" && $lang_data[
"info"] ==
"file_not_found")
268 unset($a_languages[$lang_key]);
271 $query =
"DELETE FROM object_data ".
272 "WHERE type = 'lng' ".
273 "AND title = ".$ilDB->quote($lang_key);
274 $this->ilias->db->query($query);
295 $d = dir($this->lang_path);
297 chdir ($this->lang_path);
303 while ($entry =
$d->read())
305 if (is_file($entry) && (ereg (
"(^ilias_.{2}\.lang$)", $entry)))
308 $output .=
"<br/><br/>".$lng->txt(
"langfile_found").
": ".$entry;
309 $content = file ($entry);
316 foreach ($content as $key => $val)
318 $separated = explode ($this->separator,trim($val));
319 $num = count($separated);
326 $output .=
"<br/><b/>".$lng->txt(
"err_in_line").
" ".$line.
" !</b> ";
327 $output .= $lng->txt(
"module").
": ".$separated[0];
328 $output .=
", ".$lng->txt(
"identifier").
": ".$separated[1];
329 $output .=
", ".$lng->txt(
"value").
": ".$separated[2];
334 if (empty($separated[0]))
336 $output .=
"<br/>".$lng->txt(
"err_no_param").
" ".$lng->txt(
"check_langfile");
340 $output .=
"<br/>".$lng->txt(
"err_1_param").
" ".$lng->txt(
"check_langfile");
345 $output .=
"<br/>".$lng->txt(
"err_2_param").
" ".$lng->txt(
"check_langfile");
349 $output .=
"<br/>".$lng->txt(
"err_over_3_param").
" ".$lng->txt(
"check_langfile");
356 $output .=
"<br/>".$lng->txt(
"file_not_valid").
" ".$lng->txt(
"err_count_param");
359 $output .=
"<br/>".$lng->txt(
"file_valid");
363 $output .=
"<br/>".$lng->txt(
"file_not_valid").
" ".$lng->txt(
"err_wrong_header");
371 $output .=
"<br/>".$lng->txt(
"err_no_langfile_found");