16 require_once
"./classes/class.ilObject.php";
72 $this->
ilObject($a_id,$a_call_by_reference);
77 $this->lang_path = $lng->lang_path;
78 $this->lang_default = $lng->lang_default;
79 $this->lang_user = $lng->lang_user;
80 $this->separator = $lng->separator;
101 $lng->loadLanguageModule(
"meta");
104 $d = dir($this->lang_path);
106 chdir ($this->lang_path);
109 while ($entry =
$d->read())
111 if (is_file($entry) && (ereg (
"(^ilias_.{2}\.lang$)", $entry)))
113 $lang_key = substr($entry,6,2);
122 $tmp_array = array();
126 $lang_keys = array();
131 foreach ($lang_db as
$lang)
134 $lang_key = $lang[
"title"];
136 $lang_keys[] = $lang_key;
139 if ($lang_key == $this->lang_user)
144 if ($lang_key == $this->lang_default)
146 $languages[$lang_key][
"status"] =
"system_language";
150 if ((count($tmp_array) > 0) && (!in_array($lang_key,$tmp_array)))
152 $languages[$lang_key][
"info"] =
"file_not_found";
158 foreach (
$languages as $lang_key => $lang_data)
160 if (!in_array($lang_key,$lang_keys))
162 $languages[$lang_key][
"info"] =
"new_language";
176 foreach (
$languages as $lang_key => $lang_data)
178 $languages[$lang_key][
"name"] = $lng->txt(
"meta_l_".$lang_key);
198 if (count($a_languages) > 0)
200 foreach ($a_languages as $lang_key => $lang_data)
202 if ($lang_data[
"info"] ==
"new_language")
204 include_once(
"./Services/Language/classes/class.ilObjLanguage.php");
206 $lngObj->setTitle($lang_key);
207 $lngObj->setDescription(
"not_installed");
212 $a_languages[$lang_key] = array(
"obj_id" => $lngObj->getId(),
213 "type" => $lngObj->getType(),
214 "description" => $lngObj->getDescription(),
215 "desc" => $lngObj->getDescription(),
216 "owner" => $lngObj->getOwner(),
217 "create_date" => $lngObj->getCreateDate(),
218 "last_update" => $lngObj->getLastUpdateDate());
220 $a_languages[$lang_key][
"info"] =
"new_language";
243 foreach ($a_languages as $lang_key => $lang_data)
245 if ($lang_data[
"desc"] ==
"not_installed" && $lang_data[
"info"] ==
"file_not_found")
248 unset($a_languages[$lang_key]);
251 $query =
"DELETE FROM object_data ".
252 "WHERE type = ".$ilDB->quote(
"lng",
"text").
" ".
253 "AND title = ".$ilDB->quote($lang_key,
"text");
254 $ilDB->manipulate(
$query);
275 $d = dir($this->lang_path);
277 chdir ($this->lang_path);
283 while ($entry =
$d->read())
285 if (is_file($entry) && (ereg (
"(^ilias_.{2}\.lang$)", $entry)))
288 $output .=
"<br/><br/>".$lng->txt(
"langfile_found").
": ".$entry;
289 $content = file ($entry);
296 foreach ($content as
$key => $val)
298 $separated = explode ($this->separator,trim($val));
299 $num = count($separated);
306 $output .=
"<br/><b/>".$lng->txt(
"err_in_line").
" ".$line.
" !</b> ";
307 $output .= $lng->txt(
"module").
": ".$separated[0];
308 $output .=
", ".$lng->txt(
"identifier").
": ".$separated[1];
309 $output .=
", ".$lng->txt(
"value").
": ".$separated[2];
314 if (empty($separated[0]))
316 $output .=
"<br/>".$lng->txt(
"err_no_param").
" ".$lng->txt(
"check_langfile");
320 $output .=
"<br/>".$lng->txt(
"err_1_param").
" ".$lng->txt(
"check_langfile");
325 $output .=
"<br/>".$lng->txt(
"err_2_param").
" ".$lng->txt(
"check_langfile");
329 $output .=
"<br/>".$lng->txt(
"err_over_3_param").
" ".$lng->txt(
"check_langfile");
336 $output .=
"<br/>".$lng->txt(
"file_not_valid").
" ".$lng->txt(
"err_count_param");
339 $output .=
"<br/>".$lng->txt(
"file_valid");
343 $output .=
"<br/>".$lng->txt(
"file_not_valid").
" ".$lng->txt(
"err_wrong_header");
351 $output .=
"<br/>".$lng->txt(
"err_no_langfile_found");