17 require_once
"./Services/Language/classes/class.ilObjLanguage.php";
18 require_once
"./Services/Object/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());
89 $this->lng->loadLanguageModule(
"meta");
93 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
99 $key = $langObj->install();
103 $lang_installed[] = $key;
109 if (isset($lang_installed))
111 if (count($lang_installed) == 1)
113 $this->data = $this->lng->txt(
"meta_l_" . $lang_installed[0]) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
117 foreach ($lang_installed as $lang_key)
119 $langnames[] = $this->lng->txt(
"meta_l_" . $lang_key);
121 $this->data = implode(
", ",$langnames) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
126 $this->data = $this->lng->txt(
"languages_already_installed");
138 $this->lng->loadLanguageModule(
"meta");
142 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
148 $key = $langObj->install();
152 $lang_installed[] = $key;
158 $key = $langObj->install(
'local');
162 $local_installed[] = $key;
168 if (isset($lang_installed))
170 if (count($lang_installed) == 1)
172 $this->data = $this->lng->txt(
"meta_l_" . $lang_installed[0]) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
176 foreach ($lang_installed as $lang_key)
178 $langnames[] = $this->lng->txt(
"meta_l_" . $lang_key);
180 $this->data = implode(
", ",$langnames) .
" " . strtolower($this->lng->txt(
"installed")) .
".";
184 if (isset($local_installed))
186 if (count($local_installed) == 1)
188 $this->data .=
" " . $this->lng->txt(
"meta_l_" . $local_installed[0]) .
" " . $this->lng->txt(
"local_language_file") .
" " . strtolower($this->lng->txt(
"installed")) .
".";
192 foreach ($local_installed as $lang_key)
194 $langnames[] = $this->lng->txt(
"meta_l_" . $lang_key);
196 $this->data .=
" " . implode(
", ",$langnames) .
" " . $this->lng->txt(
"local_language_files") .
" " . strtolower($this->lng->txt(
"installed")) .
".";
201 $this->data .=
" " . $this->lng->txt(
"local_languages_already_installed");
213 $this->lng->loadLanguageModule(
"meta");
217 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
224 if (!($sys_lang = $langObj->isSystemLanguage()))
225 if (!($usr_lang = $langObj->isUserLanguage()))
227 $key = $langObj->uninstall();
229 $lang_uninstalled[] = $key;
235 if (isset($lang_uninstalled))
237 if (count($lang_uninstalled) == 1)
239 $this->data = $this->lng->txt(
"meta_l_".$lang_uninstalled[0]).
" ".$this->lng->txt(
"uninstalled");
243 foreach ($lang_uninstalled as $lang_key)
245 $langnames[] = $this->lng->txt(
"meta_l_".$lang_key);
248 $this->data = implode(
", ",$langnames).
" ".$this->lng->txt(
"uninstalled");
253 $this->data = $this->lng->txt(
"cannot_uninstall_systemlanguage");
257 $this->data = $this->lng->txt(
"cannot_uninstall_language_in_use");
261 $this->data = $this->lng->txt(
"languages_already_uninstalled");
273 $this->data = $this->lng->txt(
"languages_updated");
285 $this->data = $this->lng->txt(
"selected_languages_updated");
286 $lng->loadLanguageModule(
"meta");
292 if ($langObj->isInstalled() ==
true)
294 if ($langObj->check())
296 $langObj->flush(
'keep_local');
298 $langObj->setTitle($langObj->getKey());
299 $langObj->setDescription($langObj->getStatus());
301 $langObj->optimizeData();
303 if ($langObj->isLocal() ==
true)
305 if ($langObj->check(
'local'))
307 $langObj->insert(
'local');
308 $langObj->setTitle($langObj->getKey());
309 $langObj->setDescription($langObj->getStatus());
311 $langObj->optimizeData();
315 $this->data .=
"<br />". $lng->txt(
"meta_l_".$langObj->getKey());
330 $this->lng->loadLanguageModule(
"meta");
332 require_once
'./Services/User/classes/class.ilObjUser.php';
336 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
339 if (count(
$_POST[
"id"]) != 1)
341 $this->
ilias->raiseError($this->lng->txt(
"choose_only_one_language").
"<br/>".$this->lng->txt(
"action_aborted"),$this->
ilias->error_obj->MESSAGE);
348 if ($newUserLangObj->isUserLanguage())
350 $this->
ilias->raiseError($this->lng->txt(
"meta_l_".$newUserLangObj->getKey()).
" ".$this->lng->txt(
"is_already_your").
" ".$this->lng->txt(
"user_language").
"<br/>".$this->lng->txt(
"action_aborted"),$this->
ilias->error_obj->MESSAGE);
353 if ($newUserLangObj->isInstalled() ==
false)
355 $this->
ilias->raiseError($this->lng->txt(
"meta_l_".$newUserLangObj->getKey()).
" ".$this->lng->txt(
"language_not_installed").
"<br/>".$this->lng->txt(
"action_aborted"),$this->
ilias->error_obj->MESSAGE);
359 $curUser->setLanguage($newUserLangObj->getKey());
363 $this->data = $this->lng->txt(
"user_language").
" ".$this->lng->txt(
"changed_to").
" ".$this->lng->txt(
"meta_l_".$newUserLangObj->getKey()).
".";
374 $this->lng->loadLanguageModule(
"meta");
378 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
381 if (count(
$_POST[
"id"]) != 1)
383 $this->
ilias->raiseError($this->lng->txt(
"choose_only_one_language").
"<br/>".$this->lng->txt(
"action_aborted"),$this->
ilias->error_obj->MESSAGE);
390 if ($newSysLangObj->isSystemLanguage())
392 $this->
ilias->raiseError($this->lng->txt(
"meta_l_".$newSysLangObj->getKey()).
" is already the system language!<br>Action aborted!",$this->
ilias->error_obj->MESSAGE);
395 if ($newSysLangObj->isInstalled() ==
false)
397 $this->
ilias->raiseError($this->lng->txt(
"meta_l_".$newSysLangObj->getKey()).
" is not installed. Please install that language first.<br>Action aborted!",$this->
ilias->error_obj->MESSAGE);
400 $this->
ilias->setSetting(
"language", $newSysLangObj->getKey());
403 $this->
ilias->ini->setVariable(
"language",
"default",$newSysLangObj->getKey());
404 $this->
ilias->ini->write();
406 $this->data = $this->lng->txt(
"system_language").
" ".$this->lng->txt(
"changed_to").
" ".$this->lng->txt(
"meta_l_".$newSysLangObj->getKey()).
".";
419 $this->data = $this->
object->checkAllLanguages();
427 $this->ctrl->redirect($this,
"view");
444 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
446 $tabs_gui->addTarget(
"settings",
447 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
""),
"",
"");
450 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
452 $tabs_gui->addTarget(
"perm_settings",
453 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
459 $next_class = $this->ctrl->getNextClass($this);
460 $cmd = $this->ctrl->getCmd();
465 case 'ilpermissiongui':
466 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
468 $ret =& $this->ctrl->forwardCommand($perm_gui);
491 $ilSetting->set(
"lang_ext_maintenance", 1);
492 $ilCtrl->redirect($this,
"view");
502 $ilSetting->set(
"lang_ext_maintenance", 0);
503 $ilCtrl->redirect($this,
"view");
510 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
512 $conf_screen->setFormAction($ilCtrl->getFormAction($this));
513 $conf_screen->setHeaderText($lng->txt(
"lang_refresh_confirm"));
514 $conf_screen->addItem(
"d",
"d", $lng->txt(
"lang_refresh_confirm_info"));
515 $conf_screen->setCancel($lng->txt(
"cancel"),
"view");
516 $conf_screen->setConfirm($lng->txt(
"ok"),
"refresh");
518 $this->tpl->setContent($conf_screen->getHTML());
527 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
530 $lng->loadLanguageModule(
"meta");
531 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
533 $conf_screen->setFormAction($ilCtrl->getFormAction($this));
534 $conf_screen->setHeaderText($lng->txt(
"lang_refresh_confirm_selected"));
538 $conf_screen->addItem(
"id[]", $id, $lng->txt(
"meta_l_".$lang_title));
540 $conf_screen->addItem(
"d",
"d", $lng->txt(
"lang_refresh_confirm_info"));
541 $conf_screen->setCancel($lng->txt(
"cancel"),
"view");
542 $conf_screen->setConfirm($lng->txt(
"ok"),
"refreshSelected");
543 $this->tpl->setContent($conf_screen->getHTML());
555 "install" => array(
"name" =>
"install",
"lng" =>
"install"),
556 "installLocal" => array(
"name" =>
"installLocal",
"lng" =>
"install_local"),
557 "uninstall" => array(
"name" =>
"uninstall",
"lng" =>
"uninstall"),
558 "refresh" => $ilSetting->get(
"lang_ext_maintenance") ==
"1" ?
559 array(
"name" =>
"confirmRefreshSelected",
"lng" =>
"refresh") :
560 array(
"name" =>
"RefreshSelected",
"lng" =>
"refresh"),
561 "setSystemLanguage" => array(
"name" =>
"setSystemLanguage",
"lng" =>
"setSystemLanguage"),
562 "setUserLanguage" => array(
"name" =>
"setUserLanguage",
"lng" =>
"setUserLanguage")
refreshSelectedObject()
update selected languages
installObject()
install languages
refreshObject()
update all installed languages
setSystemLanguageObject()
set the system language
setUserLanguageObject()
set user language
getTabs(&$tabs_gui)
get tabs public
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
static _lookupTitle($a_id)
lookup object title
confirmRefreshSelectedObject()
disableExtendedLanguageMaintenanceObject()
Disable extended language maintenance.
installLocalObject()
Install local language modifications.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
ilObjLanguageFolderGUI($a_data, $a_id, $a_call_by_reference)
Constructor.
Class ilObjectGUI Basic methods of all Output classes.
redirection script todo: (a better solution should control the processing via a xml file) ...
prepareOutput()
prepare output
viewObject()
show installed languages
enableExtendedLanguageMaintenanceObject()
Enable extended language maintenance.
uninstallObject()
uninstall language
static refreshAll()
Refresh all installed languages.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
checkLanguageObject()
check all languages
Class ilObjLanguageFolderGUI.
Confirmation screen class.