19declare(strict_types=1);
26use Psr\Http\Message\ServerRequestInterface;
67 $this->
ctrl = $DIC->ctrl();
68 $this->
lng = $DIC->language();
69 $this->
tabs = $DIC->tabs();
70 $this->rbacsystem =
$DIC->rbac()->system();
71 $this->tpl =
$DIC->ui()->mainTemplate();
72 $this->
help = $DIC->help();
73 $this->ui_factory =
$DIC->ui()->factory();
74 $this->renderer =
$DIC->ui()->renderer();
75 $this->
locator = $DIC[
'ilLocator'];
77 $this->global_screen =
$DIC->globalScreen();
78 $this->request_wrapper =
$DIC->http()->wrapper();
80 $this->request =
$DIC->http()->request();
81 $this->
toolbar = $DIC->toolbar();
82 $this->
upload = $DIC->upload();
83 $this->tree =
$DIC->repositoryTree();
85 $this->
user = $DIC->user();
88 $this->ref_id = $this->request_wrapper->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->string());
97 $next_class = $this->
ctrl->getNextClass($this);
99 $this->
help->setScreenIdComponent(
'sty');
100 $this->
help->setScreenId(
'system_styles');
105 if ($this->request_wrapper->query()->has(
'skin_id') && $this->request_wrapper->query()->has(
'style_id')) {
106 $skin_id = $this->request_wrapper->query()->retrieve(
'skin_id', $this->
refinery->kindlyTo()->string());
107 $style_id = $this->request_wrapper->query()->retrieve(
'style_id', $this->
refinery->kindlyTo()->string());
109 $skin_id =
$config->getDefaultSkinId();
110 $style_id =
$config->getDefaultStyleId();
113 $this->
ctrl->setParameterByClass(
'ilsystemstylesettingsgui',
'skin_id', $skin_id);
114 $this->
ctrl->setParameterByClass(
'ilsystemstylesettingsgui',
'style_id', $style_id);
115 $this->
ctrl->setParameterByClass(
'ilsystemstylelessgui',
'skin_id', $skin_id);
116 $this->
ctrl->setParameterByClass(
'ilsystemstylelessgui',
'style_id', $style_id);
117 $this->
ctrl->setParameterByClass(
'ilsystemstyleiconsgui',
'skin_id', $skin_id);
118 $this->
ctrl->setParameterByClass(
'ilsystemstyleiconsgui',
'style_id', $style_id);
119 $this->
ctrl->setParameterByClass(
'ilsystemstyledocumentationgui',
'skin_id', $skin_id);
120 $this->
ctrl->setParameterByClass(
'ilsystemstyledocumentationgui',
'style_id', $style_id);
123 switch ($next_class) {
125 case 'ilsystemstylesettingsgui':
126 $this->
help->setSubScreenId(
'settings');
138 $this->request_wrapper,
147 $this->
ctrl->forwardCommand($system_styles_settings);
149 case 'ilsystemstylelessgui':
150 $this->
help->setSubScreenId(
'less');
167 $this->
ctrl->forwardCommand($system_styles_less);
169 case 'ilsystemstyleiconsgui':
170 $this->
help->setSubScreenId(
'icons');
180 $this->request_wrapper,
189 $this->
ctrl->forwardCommand($system_styles_icons);
191 case 'ilsystemstyledocumentationgui':
192 $this->
help->setSubScreenId(
'documentation');
197 if ($this->request_wrapper->query()->has(
'node_id')) {
198 $node_id = $this->request_wrapper->query()->retrieve(
200 $this->
refinery->kindlyTo()->string()
204 $this->global_screen->tool()->context()->current()->addAdditionalData(
208 $this->tpl->setPermanentLink(
'stys', (
int)
$this->ref_id, $goto_link);
209 $entries =
new Entries();
217 $documentation_gui->show($entries, $node_id);
219 case 'ilsystemstyleoverviewgui':
229 $this->message_stack->sendMessages();
236 $this->
help->setSubScreenId(
'overview');
246 $this->request_wrapper,
260 $this->
ctrl->forwardCommand($system_styles_overview);
273 if ($a_perm ==
'sty_management') {
274 $has_perm = $this->
ilIniFile->readVariable(
'tools',
'enable_system_styles_management') ==
'1';
275 $a_perm =
'sty_write_system';
276 if ($has_perm && !is_writable(
$config->getCustomizingSkinPath())) {
278 $this->
lng->txt(
'enable_system_styles_management_no_write_perm'),
281 $this->message_stack->sendMessages();
287 $has_perm = $this->rbacsystem->checkAccess($a_perm, (
int) $this->ref_id);
303 protected function setUnderworldTabs(
string $sking_id,
string $active =
'',
bool $read_only =
false): void
305 $this->
tabs->clearTargets();
309 $this->tpl->setLocator();
316 $this->
help->setScreenIdComponent(
'sty');
317 $this->
help->setScreenId(
'system_styles');
318 $this->
tabs->setBackTarget($this->
lng->txt(
'back'), $this->ctrl->getLinkTarget($this));
320 if ($sking_id !=
$config->getDefaultSkinId()) {
323 $this->
lng->txt(
'settings'),
324 $this->ctrl->getLinkTargetByClass(
'ilsystemstylesettingsgui')
328 $this->
lng->txt(
'less'),
329 $this->ctrl->getLinkTargetByClass(
'ilsystemstylelessgui')
333 $this->
lng->txt(
'icons'),
334 $this->ctrl->getLinkTargetByClass(
'ilsystemstyleiconsgui')
340 $this->
lng->txt(
'documentation'),
341 $this->ctrl->getLinkTargetByClass(
'ilsystemstyledocumentationgui')
344 $this->
tabs->activateTab($active);
351 protected function setUnderworldTitle(
string $skin_id,
string $style_id,
bool $read_only =
false): void
353 $skin = $this->skin_factory->skinStyleContainerFromId($skin_id, $this->message_stack)->getSkin();
354 $style = $skin->getStyle($style_id);
357 $this->tpl->setTitle($this->
lng->txt(
'documentation'));
359 if ($style->isSubstyle()) {
360 $this->tpl->setDescription(
361 $this->
lng->txt(
'ks_documentation_of_substyle')
363 . $style->getName() .
"' " .
364 $this->lng->txt(
'of_parent') .
" '" . $skin->getStyle($style->getSubstyleOf())->getName() .
"' " .
365 $this->lng->txt(
'from_skin') .
' ' . $skin->getName()
368 $this->tpl->setDescription(
369 $this->
lng->txt(
'ks_documentation_of_style') .
" '" . $style->getName() .
"' " .
370 $this->lng->txt(
'from_skin') .
" '" . $skin->getName() .
"'"
374 $this->tpl->setTitle($style->getName());
375 if ($style->isSubstyle()) {
376 $this->tpl->setDescription(
377 $this->
lng->txt(
'settings_of_substyle') .
" '" . $style->getName() .
"' " .
378 $this->lng->txt(
'of_parent') .
" '" . $skin->getStyle($style->getSubstyleOf())->getName() .
"' " .
379 $this->lng->txt(
'from_skin') .
' ' . $skin->getName()
382 $this->tpl->setDescription(
383 $this->
lng->txt(
'settings_of_style') .
" '" . $style->getName() .
"' " .
384 $this->lng->txt(
'from_skin') .
" '" . $skin->getName() .
"'"
Container storing a list of UI Component Entries, can act as Iterator, countable and is serializable.
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Generatates and reads Goto Links.
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...
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Renders the Overview of the Examples in the Administration.
@ilCtrl_Calls ilSystemStyleIconsGUI:
Settings UI class for system styles.
ilSkinFactory $skin_factory
executeDefaultCommand(ilSkinFactory $skin_factory, string $skin_id, string $style_id)
setUnderworldTabs(string $sking_id, string $active='', bool $read_only=false)
Sets the tab correctly if one system style is open (navigational underworld opened)
ilSystemStyleMessageStack $message_stack
checkPermission(string $a_perm, bool $a_throw_exc=true)
Checks permission for system styles.
ilGlobalTemplateInterface $tpl
executeCommand()
Main routing of the system styles.
WrapperFactory $request_wrapper
ServerRequestInterface $request
RefineryFactory $refinery
setUnderworldTitle(string $skin_id, string $style_id, bool $read_only=false)
Sets title correctly if one system style is opened.
Used to stack messages to be shown to the user.
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 is how the factory for UI elements looks.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc