16 require_once
"./Services/Object/classes/class.ilObject.php";
69 public function __construct($a_id, $a_call_by_reference =
true)
72 $lng = $DIC->language();
75 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;
100 $lng = $DIC->language();
102 $lng->loadLanguageModule(
"meta");
105 $d = dir($this->lang_path);
107 chdir($this->lang_path);
110 while ($entry =
$d->read()) {
111 if (is_file($entry) && (preg_match(
"~(^ilias_.{2}\.lang$)~", $entry))) {
112 $lang_key = substr($entry, 6, 2);
120 $tmp_array = array();
124 $lang_keys = array();
128 foreach ($lang_db as
$lang) {
130 $lang_key = $lang[
"title"];
132 $lang_keys[] = $lang_key;
135 if ($lang_key == $this->lang_user) {
139 if ($lang_key == $this->lang_default) {
140 $languages[$lang_key][
"status"] =
"system_language";
144 if ((count($tmp_array) > 0) && (!in_array($lang_key, $tmp_array))) {
145 $languages[$lang_key][
"info"] =
"file_not_found";
151 foreach (
$languages as $lang_key => $lang_data) {
152 if (!in_array($lang_key, $lang_keys)) {
154 $languages[$lang_key][
"info"] =
"new_language";
168 foreach (
$languages as $lang_key => $lang_data) {
189 if (count($a_languages) > 0) {
190 foreach ($a_languages as $lang_key => $lang_data) {
191 if ($lang_data[
"info"] ==
"new_language") {
192 include_once(
"./Services/Language/classes/class.ilObjLanguage.php");
194 $lngObj->setTitle($lang_key);
195 $lngObj->setDescription(
"not_installed");
200 $a_languages[$lang_key] = array(
"obj_id" => $lngObj->getId(),
201 "type" => $lngObj->getType(),
202 "description" => $lngObj->getDescription(),
203 "desc" => $lngObj->getDescription(),
204 "owner" => $lngObj->getOwner(),
205 "create_date" => $lngObj->getCreateDate(),
206 "last_update" => $lngObj->getLastUpdateDate());
208 $a_languages[$lang_key][
"info"] =
"new_language";
230 $ilDB = $DIC->database();
232 foreach ($a_languages as $lang_key => $lang_data) {
233 if ($lang_data[
"desc"] ==
"not_installed" && $lang_data[
"info"] ==
"file_not_found") {
235 unset($a_languages[$lang_key]);
238 $query =
"DELETE FROM object_data " .
239 "WHERE type = " .
$ilDB->quote(
"lng",
"text") .
" " .
240 "AND title = " .
$ilDB->quote($lang_key,
"text");
260 $lng = $DIC->language();
263 $d = dir($this->lang_path);
265 chdir($this->lang_path);
271 while ($entry =
$d->read()) {
272 if (is_file($entry) && (preg_match(
"~(^ilias_.{2}\.lang$)~", $entry))) {
274 $output .=
"<br/><br/>" .
$lng->txt(
"langfile_found") .
": " . $entry;
275 $content = file($entry);
281 foreach ($content as
$key => $val) {
282 $separated = explode($this->separator, trim($val));
283 $num = count($separated);
289 $output .=
"<br/><b/>" .
$lng->txt(
"err_in_line") .
" " . $line .
" !</b> ";
290 $output .=
$lng->txt(
"module") .
": " . $separated[0];
291 $output .=
", " .
$lng->txt(
"identifier") .
": " . $separated[1];
292 $output .=
", " .
$lng->txt(
"value") .
": " . $separated[2];
296 if (empty($separated[0])) {
297 $output .=
"<br/>" .
$lng->txt(
"err_no_param") .
" " .
$lng->txt(
"check_langfile");
299 $output .=
"<br/>" .
$lng->txt(
"err_1_param") .
" " .
$lng->txt(
"check_langfile");
304 $output .=
"<br/>" .
$lng->txt(
"err_2_param") .
" " .
$lng->txt(
"check_langfile");
308 $output .=
"<br/>" .
$lng->txt(
"err_over_3_param") .
" " .
$lng->txt(
"check_langfile");
315 $output .=
"<br/>" .
$lng->txt(
"file_not_valid") .
" " .
$lng->txt(
"err_count_param");
320 $output .=
"<br/>" .
$lng->txt(
"file_not_valid") .
" " .
$lng->txt(
"err_wrong_header");
328 $output .=
"<br/>" .
$lng->txt(
"err_no_langfile_found");
__construct($a_id, $a_call_by_reference=true)
Constructor public.
addNewLanguages($a_languages)
add new languages
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
getLanguages()
gather all information about available languages
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
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
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