16 require_once
"./Services/Object/classes/class.ilObject.php";
72 parent::__construct($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) && (preg_match(
"~(^ilias_.{2}\.lang$)~", $entry)))
113 $lang_key = substr($entry,6,2);
114 $languages[$lang_key] =
"";
119 if (!
array($languages))
122 $tmp_array =
array();
125 $tmp_array = array_keys($languages);
126 $lang_keys =
array();
131 foreach ($lang_db as
$lang)
134 $lang_key = $lang[
"title"];
135 $languages[$lang_key] =
$lang;
136 $lang_keys[] = $lang_key;
139 if ($lang_key == $this->lang_user)
141 $languages[$lang_key][
"status"] =
"in_use";
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) && (preg_match(
"~(^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");
__construct($a_id, $a_call_by_reference=true)
Constructor public.
Class ilObject Basic functions for all objects.
addNewLanguages($a_languages)
add new languages
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
for($col=0; $col< 50; $col++) $d
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
getLanguages()
gather all information about available languages
Reload workbook from saved file
Create styles array
The data for the language used.
Class ilObjLanguageFolder contains all function to manage language support for ILIAS3 install...
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
removeLanguages($a_languages)
remove languages which are not installed AND has no lang-file
static cut_header($content)
remove lang-file haeder information from '$content' This function seeks for a special keyword where t...
checkAllLanguages()
validate the logical structure of a lang-file