19 declare(strict_types=1);
    59         ServerRequestInterface $request,
    80         $this->style_container = $this->skin_factory->skinStyleContainerFromId($skin_id, $this->message_stack);
    85         $cmd = $this->
ctrl->getCmd() ? $this->
ctrl->getCmd() : 
'edit';
    86         $style = $this->style_container->getSkin()->getStyle($this->style_id);
    88         if ($style->isSubstyle()) {
    89             if ($cmd == 
'edit' || $cmd == 
'view') {
   103             $this->request_wrapper,
   109             case 'deleteAssignments':
   110                 $assign_gui->deleteAssignments($this->style_container->getSkin(), $style);
   112             case 'saveAssignment':
   113                 $assign_gui->saveAssignment($this->style_container->getSkin(), $style);
   115             case 'addAssignment':
   116                 $assign_gui->addAssignment();
   119                 $assign_gui->assignStyle($this->style_container->getSkin(), $style);
   133         $this->
tabs->addSubTab(
   135             $this->
lng->txt(
'settings'),
   136             $this->
ctrl->getLinkTargetByClass(
'ilsystemstyleconfiggui')
   138         $this->
tabs->addSubTab(
   140             $this->
lng->txt(
'assignment'),
   141             $this->
ctrl->getLinkTargetByClass(
'ilsystemstyleconfiggui', 
'assignStyle')
   144         $this->
tabs->activateSubTab($active);
   147     protected function edit(): void
   150         $this->tpl->setContent($this->renderer->render($form));
   153     protected function save(): void
   155         $new_skin = $this->style_container->getSkin();
   156         $new_style = $new_skin->getStyle($this->style_id);
   157         $old_skin = clone $new_skin;
   158         $old_style = clone $new_style;
   161         $form = $form->withRequest($this->request);
   162         $result = $form->getData();
   166                 $new_skin->updateParentStyleOfSubstyles($old_style->getId(), $new_style->getId());
   167                 $this->style_container->updateSkin($old_skin);
   168                 $this->style_container->updateStyle($new_style->getId(), $old_style);
   170                 if ($old_style->isSubstyle()) {
   171                     $new_style->setSubstyleOf($old_style->getSubstyleOf());
   185                         $result[
'activation_section'],
   192                 $this->
ctrl->setParameterByClass(
'ilsystemstyleconfiggui', 
'skin_id', $new_skin->getId());
   193                 $this->
ctrl->setParameterByClass(
'ilsystemstyleconfiggui', 
'style_id', $new_style->getId());
   195                 $this->message_stack->sendMessages();
   196                 $this->
ctrl->redirectByClass(
'ilsystemstyleconfiggui');
   205         $this->tpl->setContent($this->renderer->render(
   206             array_merge($this->message_stack->getUIComponentsMessages($this->ui_factory), [$form])
   211         ?array $activation_values,
   220         if (is_array($activation_values)) {
   222             $personal = (bool) $activation_values[
'personal'];
   223             $default = (bool) $activation_values[
'default'];
   240         if (!$personal && $this->
user->getPref(
'skin') == $skin_id) {
   249                     $system_style_conf->getDefaultSkinId(),
   250                     $system_style_conf->getDefaultStyleId()
   255                     $this->
lng->txt(
'personal_style_set_to') . 
' ' .
   263                 $system_style_conf->getDefaultSkinId(),
   264                 $system_style_conf->getDefaultStyleId()
   268                     $this->
lng->txt(
'default_style_set_to') . 
' ' . $system_style_conf->getDefaultSkinId() . 
': ' . $system_style_conf->getDefaultStyleId(),
   280         $f = $this->ui_factory->input();
   281         $skin = $this->style_container->getSkin();
   282         $style = $skin->getStyle($this->style_id);
   284         if (!$style->isSubstyle()) {
   286             $skin_fields[] = 
$f->field()->text($this->
lng->txt(
'skin_id'), $this->
lng->txt(
'skin_id_description'))
   288                                ->withValue($skin->getId())
   290                                    function ($v) use ($skin) {
   295             $skin_fields[] = 
$f->field()->text($this->
lng->txt(
'skin_name'), $this->
lng->txt(
'skin_name_description'))
   297                                ->withValue($skin->getName())
   299                                    function ($v) use ($skin) {
   304             if ($skin->isVersionChangeable()) {
   305                 $skin_fields[] = 
$f->field()->text(
   306                     $this->
lng->txt(
'skin_version'),
   307                     $this->
lng->txt(
'skin_version_description')
   310                                    ->withValue($skin->getVersion())
   312                                        function ($v) use ($skin) {
   313                                            $skin->getVersionStep($v);
   317             $sections[] = 
$f->field()->section($skin_fields, $this->
lng->txt(
'skin'));
   320         $style_id = 
$f->field()->text($this->
lng->txt(
'style_id'), $this->
lng->txt(
'style_id_description'))
   322                       ->withValue($style->getId())
   324                           function ($v) use ($style) {
   326                               $style->setCssFile($v);
   329         $style_name = 
$f->field()->text($this->
lng->txt(
'style_name'), $this->
lng->txt(
'style_name_description'))
   331                         ->withValue($style->getName())
   333                             function ($v) use ($style) {
   337         $image_dir = 
$f->field()->text($this->
lng->txt(
'image_dir'), $this->
lng->txt(
'image_dir_description'))
   340                            function ($v) use ($style) {
   341                                $style->setImageDirectory($v);
   344         $font_dir = 
$f->field()->text($this->
lng->txt(
'font_dir'), $this->
lng->txt(
'font_dir_description'))
   347                           function ($v) use ($style) {
   348                               $style->setFontDirectory($v);
   351         $sound_dir = 
$f->field()->text($this->
lng->txt(
'sound_dir'), $this->
lng->txt(
'sound_dir_description'))
   354                            function ($v) use ($style) {
   355                                $style->setSoundDirectory($v);
   358         $section_name = $this->
lng->txt(
'style');
   359         if ($style->isSubstyle()) {
   360             $this->
lng->txt(
'sub_style');
   362         $sections[] = 
$f->field()->section([$style_id, $style_name, $image_dir, $font_dir, $sound_dir], $section_name);
   364         if (!$style->isSubstyle()) {
   366             $activation_values = null;
   368                 $is_personal_style = $this->
user->getPref(
'skin') == $skin->getId()
   369                     && $this->
user->getPref(
'style') == $style->getId();
   372                 $activation_values = [
'default' => $is_default_style, 
'personal' => $is_personal_style];
   375             $default = 
$f->field()->checkbox(
   376                 $this->
lng->txt(
'default'),
   377                 $this->
lng->txt(
'system_style_default_description')
   380             $personal = 
$f->field()->checkbox(
   381                 $this->
lng->txt(
'personal'),
   382                 $this->
lng->txt(
'system_style_personal_description')
   385             $activation = 
$f->field()->optionalGroup(
   386                 [
'default' => $default, 
'personal' => $personal],
   387                 $this->
lng->txt(
'system_style_activation'),
   388                 $this->
lng->txt(
'system_style_activation_description')
   390             $sections[
'activation_section'] = 
$f->field()->section(
   391                 [
'activation' => $activation],
   392                 $this->
lng->txt(
'system_style_activation')
   396                                                         return $v[
'activation'];
   401         return $f->container()->form()->standard($this->
ctrl->getFormActionByClass(
   402             'ilsystemstyleconfiggui',
 ServerRequestInterface $request
 
ilSkinFactory $skin_factory
 
An entity that renders components to a string output. 
 
setSubStyleSubTabs(string $active='')
 
static _lookupActivatedStyle(string $a_skin, string $a_style)
lookup if a style is activated 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static getCurrentUserPrefSkin()
Gets a users preferred skin by using the user object. 
 
static getCurrentDefaultSkin()
Gets default Skin of the System. 
 
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
 
static getCurrentUserPrefStyle()
Gets a users preferred style by using the user object. 
 
addMessage(ilSystemStyleMessage $message)
Add a message to be displayed by the stack. 
 
static _deactivateStyle(string $a_skin, string $a_style)
deactivate system style 
 
static _activateStyle(string $a_skin, string $a_style)
activate system style 
 
This class is responsible for all file system related actions related actions of a skin such as copyi...
 
ilSkinStyleContainer $style_container
 
ilGlobalTemplateInterface $tpl
 
static updateSkinIdAndStyleIDOfSubStyleCategoryAssignments(string $old_skin_id, string $old_style_id, string $new_skin_id, string $new_style_id)
Updates an assignment, e.g. 
 
static setCurrentDefaultStyle(string $skin_id, string $style_id)
Sets the default style of the system. 
 
ilSystemStyleMessageStack $message_stack
 
handleStyleActivation(?array $activation_values, string $skin_id, string $style_id, ilSystemStyleMessageStack $message_stack)
 
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
 
__construct(ilCtrl $ctrl, ilLanguage $lng, ilGlobalTemplateInterface $tpl, ilTabsGUI $tabs, Factory $ui_factory, Renderer $renderer, ilSkinFactory $skin_factory, WrapperFactory $request_wrapper, Refinery $refinery, ilToolbarGUI $toolbar, ilObjUser $user, ServerRequestInterface $request, ilTree $tree, string $skin_id, string $style_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
WrapperFactory $request_wrapper
 
Used to stack messages to be shown to the user. 
 
static getCurrentDefaultStyle()
Gets default style of the system. 
 
static updateSubStyleIdfSubStyleCategoryAssignments(string $old_substyle_id, string $new_substyle_id)
Updates an assignment, e.g. 
 
static setCurrentUserPrefStyle(string $skin_id, string $style_id)
Sets a users preferred system skin/style by using the user object.