17 require_once
"./Services/Language/classes/class.ilObjLanguage.php";
18 require_once
"./classes/class.ilObjectGUI.php";
30 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
31 $_GET[
"sort_by"] =
"language";
43 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
45 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
49 if ($ilSetting->get(
"lang_ext_maintenance") ==
"1")
51 $ilToolbar->addButton($lng->txt(
"refresh_languages"),
52 $this->ctrl->getLinkTarget($this,
"confirmRefresh"));
56 $ilToolbar->addButton($lng->txt(
"refresh_languages"),
57 $this->ctrl->getLinkTarget($this,
"refresh"));
61 $ilToolbar->addButton($lng->txt(
"check_languages"),
62 $this->ctrl->getLinkTarget($this,
"checkLanguage"));
65 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
67 if ($ilSetting->get(
"lang_ext_maintenance") ==
"1")
69 $ilToolbar->addButton($lng->txt(
"disable_ext_lang_maint"),
70 $this->ctrl->getLinkTarget($this,
"disableExtendedLanguageMaintenance"));
74 $ilToolbar->addButton($lng->txt(
"enable_ext_lang_maint"),
75 $this->ctrl->getLinkTarget($this,
"enableExtendedLanguageMaintenance"));
79 include_once(
"./Services/Language/classes/class.ilLanguageTableGUI.php");
81 $tpl->setContent($ltab->getHTML());
91 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
97 $key = $langObj->install();
101 $lang_installed[] =
$key;
107 if (isset($lang_installed))
109 if (count($lang_installed) == 1)
111 $this->data = $this->lng->txt(
"lang_" . $lang_installed[0]) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
115 foreach ($lang_installed as $lang_key)
117 $langnames[] = $this->lng->txt(
"lang_" . $lang_key);
119 $this->data = implode(
", ",$langnames) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
124 $this->data = $this->lng->txt(
"languages_already_installed");
138 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
144 $key = $langObj->install();
148 $lang_installed[] =
$key;
154 $key = $langObj->install(
'local');
158 $local_installed[] =
$key;
164 if (isset($lang_installed))
166 if (count($lang_installed) == 1)
168 $this->data = $this->lng->txt(
"lang_" . $lang_installed[0]) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
172 foreach ($lang_installed as $lang_key)
174 $langnames[] = $this->lng->txt(
"lang_" . $lang_key);
176 $this->data = implode(
", ",$langnames) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
180 if (isset($local_installed))
182 if (count($local_installed) == 1)
184 $this->data .=
" " . $this->lng->txt(
"lang_" . $local_installed[0]) .
" " . $this->lng->txt(
"local_language_file") .
" " . strtolower($this->lng->txt(
"installed")) .
".";
188 foreach ($local_installed as $lang_key)
190 $langnames[] = $this->lng->txt(
"lang_" . $lang_key);
192 $this->data .=
" " . implode(
", ",$langnames) .
" " . $this->lng->txt(
"local_language_files") .
" " . strtolower($this->lng->txt(
"installed")) .
".";
197 $this->data .=
" " . $this->lng->txt(
"local_languages_already_installed");
211 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
218 if (!($sys_lang = $langObj->isSystemLanguage()))
219 if (!($usr_lang = $langObj->isUserLanguage()))
221 $key = $langObj->uninstall();
223 $lang_uninstalled[] =
$key;
229 if (isset($lang_uninstalled))
231 if (count($lang_uninstalled) == 1)
233 $this->data = $this->lng->txt(
"lang_".$lang_uninstalled[0]).
" ".$this->lng->txt(
"uninstalled");
237 foreach ($lang_uninstalled as $lang_key)
239 $langnames[] = $this->lng->txt(
"lang_".$lang_key);
242 $this->data = implode(
", ",$langnames).
" ".$this->lng->txt(
"uninstalled");
247 $this->data = $this->lng->txt(
"cannot_uninstall_systemlanguage");
251 $this->data = $this->lng->txt(
"cannot_uninstall_language_in_use");
255 $this->data = $this->lng->txt(
"languages_already_uninstalled");
267 $this->data = $this->lng->txt(
"languages_updated");
279 $this->data = $this->lng->txt(
"selected_languages_updated");
280 $lng->loadLanguageModule(
"meta");
286 if ($langObj->isInstalled() ==
true)
288 if ($langObj->check())
290 $langObj->flush(
'keep_local');
292 $langObj->setTitle($langObj->getKey());
293 $langObj->setDescription($langObj->getStatus());
295 $langObj->optimizeData();
297 if ($langObj->isLocal() ==
true)
299 if ($langObj->check(
'local'))
301 $langObj->insert(
'local');
302 $langObj->setTitle($langObj->getKey());
303 $langObj->setDescription($langObj->getStatus());
305 $langObj->optimizeData();
309 $this->data .=
"<br />". $lng->txt(
"meta_l_".$langObj->getKey());
324 require_once
'./Services/User/classes/class.ilObjUser.php';
328 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
331 if (count(
$_POST[
"id"]) != 1)
333 $this->ilias->raiseError($this->lng->txt(
"choose_only_one_language").
"<br/>".$this->lng->txt(
"action_aborted"),$this->ilias->error_obj->MESSAGE);
340 if ($newUserLangObj->isUserLanguage())
342 $this->ilias->raiseError($this->lng->txt(
"lang_".$newUserLangObj->getKey()).
" ".$this->lng->txt(
"is_already_your").
" ".$this->lng->txt(
"user_language").
"<br/>".$this->lng->txt(
"action_aborted"),$this->ilias->error_obj->MESSAGE);
345 if ($newUserLangObj->isInstalled() ==
false)
347 $this->ilias->raiseError($this->lng->txt(
"lang_".$newUserLangObj->getKey()).
" ".$this->lng->txt(
"language_not_installed").
"<br/>".$this->lng->txt(
"action_aborted"),$this->ilias->error_obj->MESSAGE);
351 $curUser->setLanguage($newUserLangObj->getKey());
355 $this->data = $this->lng->txt(
"user_language").
" ".$this->lng->txt(
"changed_to").
" ".$this->lng->txt(
"lang_".$newUserLangObj->getKey()).
".";
368 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
371 if (count(
$_POST[
"id"]) != 1)
373 $this->ilias->raiseError($this->lng->txt(
"choose_only_one_language").
"<br/>".$this->lng->txt(
"action_aborted"),$this->ilias->error_obj->MESSAGE);
380 if ($newSysLangObj->isSystemLanguage())
382 $this->ilias->raiseError($this->lng->txt(
"lang_".$newSysLangObj->getKey()).
" is already the system language!<br>Action aborted!",$this->ilias->error_obj->MESSAGE);
385 if ($newSysLangObj->isInstalled() ==
false)
387 $this->ilias->raiseError($this->lng->txt(
"lang_".$newSysLangObj->getKey()).
" is not installed. Please install that language first.<br>Action aborted!",$this->ilias->error_obj->MESSAGE);
390 $this->ilias->setSetting(
"language", $newSysLangObj->getKey());
393 $this->ilias->ini->setVariable(
"language",
"default",$newSysLangObj->getKey());
394 $this->ilias->ini->write();
396 $this->data = $this->lng->txt(
"system_language").
" ".$this->lng->txt(
"changed_to").
" ".$this->lng->txt(
"lang_".$newSysLangObj->getKey()).
".";
409 $this->data = $this->
object->checkAllLanguages();
417 $this->ctrl->redirect($this,
"view");
434 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
436 $tabs_gui->addTarget(
"settings",
437 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
""),
"",
"");
440 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
442 $tabs_gui->addTarget(
"perm_settings",
443 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
449 $next_class = $this->ctrl->getNextClass($this);
450 $cmd = $this->ctrl->getCmd();
455 case 'ilpermissiongui':
456 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
458 $ret =& $this->ctrl->forwardCommand($perm_gui);
481 $ilSetting->set(
"lang_ext_maintenance", 1);
482 $ilCtrl->redirect($this,
"view");
492 $ilSetting->set(
"lang_ext_maintenance", 0);
493 $ilCtrl->redirect($this,
"view");
500 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
502 $conf_screen->setFormAction($ilCtrl->getFormAction($this));
503 $conf_screen->setHeaderText($lng->txt(
"lang_refresh_confirm"));
504 $conf_screen->addItem(
"d",
"d", $lng->txt(
"lang_refresh_confirm_info"));
505 $conf_screen->setCancel($lng->txt(
"cancel"),
"view");
506 $conf_screen->setConfirm($lng->txt(
"ok"),
"refresh");
508 $this->tpl->setContent($conf_screen->getHTML());
517 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
520 $lng->loadLanguageModule(
"meta");
521 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
523 $conf_screen->setFormAction($ilCtrl->getFormAction($this));
524 $conf_screen->setHeaderText($lng->txt(
"lang_refresh_confirm_selected"));
528 $conf_screen->addItem(
"id[]", $id, $lng->txt(
"meta_l_".$lang_title));
530 $conf_screen->addItem(
"d",
"d", $lng->txt(
"lang_refresh_confirm_info"));
531 $conf_screen->setCancel($lng->txt(
"cancel"),
"view");
532 $conf_screen->setConfirm($lng->txt(
"ok"),
"refreshSelected");
533 $this->tpl->setContent($conf_screen->getHTML());
545 "install" => array(
"name" =>
"install",
"lng" =>
"install"),
546 "installLocal" => array(
"name" =>
"installLocal",
"lng" =>
"install_local"),
547 "uninstall" => array(
"name" =>
"uninstall",
"lng" =>
"uninstall"),
548 "refresh" => $ilSetting->get(
"lang_ext_maintenance") ==
"1" ?
549 array(
"name" =>
"confirmRefreshSelected",
"lng" =>
"refresh") :
550 array(
"name" =>
"RefreshSelected",
"lng" =>
"refresh"),
551 "setSystemLanguage" => array(
"name" =>
"setSystemLanguage",
"lng" =>
"setSystemLanguage"),
552 "setUserLanguage" => array(
"name" =>
"setUserLanguage",
"lng" =>
"setUserLanguage")