19declare(strict_types=1);
39 private \ILIAS\HTTP\Services
$http;
56 $this->
ctrl = $DIC->ctrl();
57 $this->tpl =
$DIC->ui()->mainTemplate();
58 $this->
tabs = $DIC->tabs();
60 $this->
http = $DIC->http();
61 $this->ilErr =
$DIC->ilErr();
63 $this->ui_factory =
$DIC->ui()->factory();
64 $this->ui_renderer =
$DIC->ui()->renderer();
65 $this->rbac_system =
$DIC->rbac()->system();
67 $this->
lng = $DIC[
'lng'];
69 $this->
lng->loadLanguageModule(
'auth');
71 $this->ref_id = $a_ref_id;
73 $content_style =
$DIC->contentStyle();
74 $this->content_style_domain = $content_style
76 ->styleForRefId($a_ref_id);
77 $this->content_style_gui = $content_style->gui();
79 $query_wrapper =
$DIC->http()->wrapper()->query();
80 $post_wrapper =
$DIC->http()->wrapper()->post();
83 if ($query_wrapper->has(
'redirectSource')) {
84 $this->redirect_source = $query_wrapper->retrieve(
'redirectSource',
$refinery->kindlyTo()->string());
87 if ($post_wrapper->has(
'key')) {
88 $this->requested_language_id = $post_wrapper->retrieve(
'key',
$refinery->kindlyTo()->int());
89 } elseif ($query_wrapper->has(
'key')) {
90 $this->requested_language_id = $query_wrapper->retrieve(
'key',
$refinery->kindlyTo()->int());
93 $this->request_ipe_context = $query_wrapper->retrieve(
94 self::CONTEXT_HTTP_PARAM,
100 $this->
ctrl->setParameter($this, self::CONTEXT_HTTP_PARAM, $this->request_ipe_context);
117 switch (strtolower($this->
ctrl->getNextClass($this) ??
'')) {
118 case strtolower(ilLoginPageGUI::class):
119 case strtolower(ilLogoutPageGUI::class):
120 $this->
tabs->clearTargets();
121 $this->
tabs->setBackTarget(
122 $this->
lng->txt(
'back'),
123 $this->ctrl->getLinkTarget($this, self::DEFAULT_COMMAND)
126 if (strtolower($this->redirect_source ??
'') !== strtolower(ilInternalLinkGUI::class)) {
127 $this->forwardToPageObject();
132 $cmd = $this->
ctrl->getCmd();
133 if ($cmd ===
null || $cmd ===
'' || !method_exists($this, $cmd .
'Command')) {
136 $verified_command = $cmd .
'Command';
138 $this->$verified_command();
148 private function forwardToPageObject(): void
150 if (!$this->requested_language_id) {
151 $this->tpl->setOnScreenMessage(
152 $this->tpl::MESSAGE_TYPE_FAILURE,
153 $this->
lng->txt(
'language_does_not_exist'),
156 $this->
ctrl->returnToParent($this);
159 $this->
lng->loadLanguageModule(
'content');
167 $this->
ctrl->setParameter($this,
'key', $this->requested_language_id);
169 if (!$ipe_class::_exists($ipe_page_type, $this->requested_language_id)) {
170 $new_page_object =
new $ipe_class();
171 $new_page_object->setParentId($this->requested_language_id);
172 $new_page_object->setId($this->requested_language_id);
173 $new_page_object->createFromXML();
176 $this->
ctrl->setReturnByClass($ipe_gui_class,
'edit');
178 $page_gui =
new ($ipe_gui_class)($this->requested_language_id);
182 $this->content_style_gui->addCss($this->tpl, $this->ref_id);
184 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
185 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
186 $page_gui->setTemplateOutput(
false);
188 if (!$this->rbac_system->checkAccess(
'write', $this->ref_id)) {
190 $page_gui->setEnableEditing(
false);
193 $html = $this->
ctrl->forwardCommand($page_gui);
196 $this->tpl->setContent($html);
202 $action = $this->
http->wrapper()->query()->retrieve(
203 'authpage_languages_action',
205 $this->refinery->kindlyTo()->string(),
206 $this->refinery->always(
'')
210 $keys = $this->
http->wrapper()->query()->retrieve(
211 'authpage_languages_key',
213 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()),
214 $this->refinery->always([])
219 case AuthPageLanguagesOverviewTable::DEACTIVATE:
220 case AuthPageLanguagesOverviewTable::ACTIVATE:
221 if (!$this->rbac_system->checkAccess(
'write', $this->ref_id)) {
222 $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
228 case AuthPageLanguagesOverviewTable::EDIT:
229 case AuthPageLanguagesOverviewTable::PREVIEW:
232 $this->
ctrl->setParameter($this,
'key', $language_id);
233 $this->
ctrl->redirectByClass(
240 $this->
ctrl->redirect($this, self::DEFAULT_COMMAND);
248 $keys = $this->
http->wrapper()->query()->retrieve(
249 'authpage_languages_key',
251 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()),
252 $this->refinery->always([])
256 $lang_keys = $this->
lng->getInstalledLanguages();
258 if ((
string) current($keys) !==
'ALL_OBJECTS') {
259 $lang_keys = array_intersect($keys, $lang_keys);
272 foreach ($lang_keys as $lang_key) {
273 $settings->enableIliasEditor($lang_key,
true);
278 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->
lng->txt(
'settings_saved'),
true);
279 $this->
ctrl->redirect($this, self::DEFAULT_COMMAND);
289 foreach ($lang_keys as $lang_key) {
290 $settings->enableIliasEditor($lang_key,
false);
295 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->
lng->txt(
'settings_saved'),
true);
296 $this->
ctrl->redirect($this, self::DEFAULT_COMMAND);
309 $this->rbac_system->checkAccess(
'write', $this->ref_id)
312 $this->tpl->setContent($this->ui_renderer->render($tbl->getComponent()));
Facade for consumer gui interface.
@ilCtrl_isCalledBy ilAuthPageEditorGUI: ilObjAuthSettingsGUI @ilCtrl_Calls ilAuthPageEditorGUI: ilLog...
ilRbacSystem $rbac_system
getRequestedAuthPageEditorContext()
ILIAS UI Renderer $ui_renderer
ILIAS Refinery Factory $refinery
ILIAS HTTP Services $http
showPageEditorLanguagesCommand()
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
final const string CONTEXT_HTTP_PARAM
GUIService $content_style_gui
ILIAS UI Factory $ui_factory
string $request_ipe_context
getSafePostCommands()
This method must return a list of safe POST commands.
int $requested_language_id
handlePageActionsCommand()
ILIAS Style Content Object ObjectFacade $content_style_domain
__construct(int $a_ref_id)
ilGlobalTemplateInterface $tpl
final const string DEFAULT_COMMAND
final const string LANGUAGE_TABLE_ACTIONS_COMMAND
static getInstance(AuthPageEditorContext $context)
Error Handling & global info handling.
static lookupId(string $a_lang_key)
Lookup obj_id of language.
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()
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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.