19declare(strict_types=1);
57 $this->
ctrl = $DIC->ctrl();
58 $this->tpl =
$DIC->ui()->mainTemplate();
59 $this->
tabs = $DIC->tabs();
60 $this->
toolbar = $DIC->toolbar();
61 $this->rbacsystem =
$DIC->rbac()->system();
62 $this->setting =
$DIC->settings();
63 $this->ilErr =
$DIC[
'ilErr'];
65 $this->
lng = $DIC[
'lng'];
67 $this->
lng->loadLanguageModule(
'auth');
68 $this->ref_id = $a_ref_id;
71 $this->content_style_domain =
$DIC->contentStyle()
73 ->styleForRefId($a_ref_id);
75 $query_wrapper =
$DIC->http()->wrapper()->query();
76 $post_wrapper =
$DIC->http()->wrapper()->post();
77 $is_post_request =
$DIC->http()->request()->getMethod() ===
"POST";
80 if ($query_wrapper->has(
"redirectSource")) {
81 $this->redirect_source = $query_wrapper->retrieve(
"redirectSource",
$refinery->kindlyTo()->string());
83 if ($post_wrapper->has(
"key")) {
84 $this->key = $post_wrapper->retrieve(
"key",
$refinery->kindlyTo()->int());
85 } elseif ($query_wrapper->has(
"key")) {
86 $this->key = $query_wrapper->retrieve(
"key",
$refinery->kindlyTo()->int());
88 if ($is_post_request) {
89 if ($post_wrapper->has(
"visible_languages")) {
90 $this->visible_languages = $post_wrapper->retrieve(
"visible_languages",
$refinery->kindlyTo()->listOf(
$refinery->kindlyTo()->string()));
92 if ($post_wrapper->has(
"languages")) {
93 $this->languages = $post_wrapper->retrieve(
"languages",
$refinery->kindlyTo()->listOf(
$refinery->kindlyTo()->string()));
113 switch ($this->
ctrl->getNextClass($this)) {
114 case 'illoginpagegui':
115 $this->
tabs->clearTargets();
116 $this->
tabs->setBackTarget(
117 $this->
lng->txt(
'back'),
118 $this->ctrl->getLinkTarget($this,
'show'),
122 if ($this->redirect_source !==
"ilinternallinkgui") {
128 if (!$cmd = $this->
ctrl->getCmd()) {
142 $this->
ctrl->saveParameter($this,
'key');
144 $this->
lng->loadLanguageModule(
"content");
149 $new_page_object->setParentId($this->key);
150 $new_page_object->setId($this->key);
151 $new_page_object->createFromXML();
158 $this->
ctrl->setReturnByClass(
'illoginpagegui',
"edit");
161 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
169 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
170 $page_gui->setTemplateOutput(
false);
176 if ($this->
ctrl->getCmd() ===
'editPage') {
177 $this->
ctrl->setCmd(
'edit');
179 $html = $this->
ctrl->forwardCommand($page_gui);
182 $this->tpl->setContent($html);
189 protected function show(): void
208 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this));
213 $this->
lng->txt(
'login_page_switch_ipe'),
214 $this->ctrl->getLinkTarget($this,
'switchIPE')
221 $this->
lng->txt(
'login_page_switch_rte'),
222 $this->ctrl->getLinkTarget($this,
'switchRTE')
236 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'login_page_editor_switched'),
true);
237 $this->
ctrl->redirect($this,
'show');
248 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'login_page_editor_switched'),
true);
249 $this->
ctrl->redirect($this,
'show');
258 foreach ($this->visible_languages as $lang_key) {
263 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
264 $this->
ctrl->redirect($this,
'show');
275 $this->tpl->setContent($tbl->getHTML());
287 if (!$this->rbacsystem->checkAccess(
"visible,read", $this->getRefId())) {
288 $this->ilErr->raiseError($this->
lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
290 $this->
lng->loadLanguageModule(
"meta");
292 $this->tpl->addBlockFile(
295 "tpl.auth_login_messages.html",
296 "Services/Authentication"
298 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
299 $this->tpl->setVariable(
"TXT_HEADLINE", $this->
lng->txt(
"login_information"));
300 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->
lng->txt(
"login_information_desc"));
301 $this->tpl->setVariable(
"TXT_SUBMIT", $this->
lng->txt(
"save"));
303 $this->tpl->setVariable(
'LOGIN_INFO', $this->
form->getHTML());
313 if (!$this->rbacsystem->checkAccess(
"write", $this->getRefId())) {
314 $this->ilErr->raiseError($this->
lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
318 if ($this->
form->checkInput()) {
320 $this->loginSettings =
new ilSetting(
"login_settings");
321 foreach ($this->
lng->getInstalledLanguages() as $lang_key) {
322 $settingKey =
"login_message_" . $lang_key;
323 if ($this->
form->getInput($settingKey)) {
324 $this->loginSettings->set($settingKey, $this->
form->getInput($settingKey));
327 if ($this->
form->getInput(
'default_auth_mode')) {
328 $this->setting->set(
'default_auth_mode', $this->
form->getInput(
'default_auth_mode'));
331 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"login_information_settings_saved"),
true);
334 $this->
ctrl->redirect($this,
'show');
343 $this->
form->setFormAction($this->
ctrl->getFormAction($this,
'saveLoginInfo'));
344 $this->
form->setTableWidth(
'80%');
345 $this->
form->setTitle($this->
lng->txt(
'login_information'));
347 $this->
form->addCommandButton(
'saveLoginInfo', $this->
lng->txt(
'save'));
352 $select->setInfo($this->
lng->txt(
'default_auth_mode_info'));
357 $select->setOptions($options);
358 $this->
form->addItem($select);
361 if (!is_object($this->loginSettings)) {
362 $this->loginSettings =
new ilSetting(
"login_settings");
365 $login_settings = $this->loginSettings->getAll();
367 $def_language = $this->
lng->getDefaultLanguage();
371 if ($lang_key === $def_language) {
372 $add =
" (" . $this->
lng->txt(
"default") .
")";
376 $this->
lng->txt(
"meta_l_" . $lang_key) . $add,
377 'login_message_' . $lang_key
379 $textarea->setRows(10);
380 $msg_login_lang =
"login_message_" . $lang_key;
381 if (isset($login_settings[$msg_login_lang])) {
382 $textarea->setValue($login_settings[$msg_login_lang]);
384 $textarea->setUseRte(
true);
385 $textarea->setRteTagSet(
"extended");
386 $this->
form->addItem($textarea);
388 unset($login_settings[
"login_message_" . $lang_key]);
392 $lang_key = substr(
$key, strrpos(
$key,
"_") + 1, strlen(
$key) - strrpos(
$key,
"_"));
395 $this->
lng->txt(
"meta_l_" . $lang_key),
396 'login_message_' . $lang_key
398 $textarea->setRows(10);
400 $textarea->setUseRte(
true);
401 $textarea->setRteTagSet(
"extended");
403 $textarea->setAlert($this->
lng->txt(
"not_installed"));
405 $this->
form->addItem($textarea);
420 if ($a_def_language !==
"") {
423 foreach ($a_languages as $val) {
Login page editor settings GUI ILIAS page editor or richtext editor.
setDefLangFirst(string $a_def_language, array $a_languages)
returns an array of all installed languages, default language at the first position
showIliasEditor()
Show ILIAS page editor summary.
addEditorSwitch()
Show editor switch.
switchIPE()
Switch editor mode to ILIAS Page editor.
showRichtextEditor()
Show richtext editor @global ilRbacSystem $rbacsystem @global ilLanguage $lng @global ilSetting $ilSe...
ilAuthLoginPageEditorSettings $settings
show()
Show current activated editor.
switchRTE()
Switch editor mode to richtext editor.
executeCommand()
ilCtrl execute command
initLoginForm()
Init login form.
ilGlobalTemplateInterface $tpl
__construct(int $a_ref_id)
activate()
Activate languages.
ILIAS Style Content Object ObjectFacade $content_style_domain
saveLoginInfo()
saves the login information data
forwardToPageObject()
Forward to page editor.
Storage of editor settings.
static getInstance()
Get singelton instance.
enableIliasEditor(string $a_langkey, bool $a_status)
Enable editor for language.
Class ilCtrl provides processing control methods.
Error Handling & global info handling uses PEAR error class.
static _getFirstActiveServer()
Get first active server.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getSyntaxStylePath()
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Refinery Factory $refinery
form( $class_path, string $cmd)