19declare(strict_types=1);
93 $cmd = $this->
ctrl->getCmd();
100 case 'addSystemStyle':
102 case 'saveNewSystemStyle':
103 case 'saveNewSubStyle':
108 case 'confirmDelete':
117 case 'moveUserStyles':
118 case 'saveStyleSettings':
128 $this->message_stack->sendMessages();
131 protected function view(): void
134 $this->tpl->setContent($table->getHTML().$table->getModalsHtml());
141 if (!$skin_style[
'substyle_of'] && $style_name != $skin_style[
'style_name']) {
142 $options[
$id] = $skin_style[
'title'];
146 $default =
"default:delos";
147 if ($style_name ==
"Delos") {
148 $default = key($options);
151 if (count($options) == 0) {
155 $txt = $this->
lng->txt(
'sty_move_user_styles').
' '.$this->
lng->txt(
'sty_to');
157 $byline = $this->
lng->txt(
'sty_move_user_styles') .
' ' .
158 $this->
lng->txt(
'sty_from') .
' ' . $style_name;
160 $select = $this->ui_factory->input()->field()
161 ->select(
$txt, $options, $byline)
162 ->withValue($default)
163 ->withAdditionalTransformation($this->
refinery->string()->splitString(
':'))
164 ->withRequired(
true);
166 return $this->ui_factory->modal()->roundtrip(
167 $this->
lng->txt(
'change_assignment'),
169 [
"new_style" => $select],
170 $this->ctrl->getLinkTargetByClass(ilSystemStyleOverviewGUI::class,
'moveUserStyles')
183 $this->tpl->setContent($table->getHTML().$table->getModalsHtml());
188 $active_styles = $this->request_wrapper->post()->retrieve(
'st_act', $this->
refinery->identity());
192 foreach ($all_styles as $style) {
193 if (!isset($active_styles[$style[
'id']])) {
201 if ($this->request_wrapper->post()->has(
'default_skin_style')) {
202 $sknst = $this->request_wrapper->post()->retrieve(
203 'default_skin_style',
204 $this->
refinery->string()->splitString(
':')
209 $this->
lng->txt(
'msg_obj_modified'),
213 $this->message_stack->sendMessages();
214 $this->
ctrl->redirect($this,
'edit');
221 $request =
$DIC->http()->request();
224 [$new_skin, $new_style] = $modal->getData()[
"new_style"];
226 $old_skin = $this->request_wrapper->query()->retrieve(
'old_skin_id', $this->
refinery->kindlyTo()->string());
227 $old_style = $this->request_wrapper->query()->retrieve(
'old_style_id', $this->
refinery->kindlyTo()->string());
231 if ($old_style ==
'other') {
237 foreach ($all_user_styles as $style) {
239 [$old_skin, $old_style] = explode(
':', $style);
246 $message = sprintf($this->
lng->txt(
'sty_move_user_styles_saved'), $old_skin, $new_skin);
249 $this->message_stack->sendMessages();
250 $this->
ctrl->redirect($this,
'edit');
257 if (!$active_styles || count($active_styles) < 1) {
260 $this->
lng->txt(
'at_least_one_style'),
265 if ($this->request_wrapper->post()->has(
'default_skin_style')) {
266 $default_style = $this->request_wrapper->post()->retrieve(
267 'default_skin_style',
268 $this->
refinery->kindlyTo()->string()
271 $default_style = $this->config->getDefaultStyleId();
276 if (!isset($active_styles[$default_style])) {
279 $this->
lng->txt(
'cant_deactivate_default_style'),
288 foreach ($all_styles as $style) {
289 if (!isset($active_styles[$style[
'id']])) {
293 $style[
'style_name'] .
': ' . $this->
lng->txt(
'cant_deactivate_if_users_assigned'),
306 $this->style_container->export();
307 }
catch (Exception
$e) {
309 $this->
lng->txt(
'zip_export_failed') .
' ' . $e->getMessage(),
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Builds a Color from either hex- or rgb values.
Class ilCtrl provides processing control methods.
static _getNumberOfUsersForStyle(string $a_skin, string $a_style)
static _getAllUserAssignedStyles()
static _moveUsersToStyle(string $a_from_skin, string $a_from_style, string $a_to_skin, string $a_to_style)
Base exception class for object service.
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
skinStyleContainerFromId(string $skin_id, ilSystemStyleMessageStack $message_stack)
Get container class is responsible for all file system related actions related actions of a skin such...
This class is responsible for all file system related actions related actions of a skin such as copyi...
static getAllSkinStyles()
Get all skins/styles as array (convenient for tables) Attention: tempalte_name/template_id in this ar...
static styleExists(string $style_id)
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Used to stack messages to be shown to the user.
addMessage(ilSystemStyleMessage $message)
Add a message to be displayed by the stack.
WrapperFactory $request_wrapper
checkStyleSettings(ilSystemStyleMessageStack $message_stack, ?array $active_styles)
setManagementEnabled(bool $management_enabled)
ilSkinStyleContainer $style_container
__construct(ilCtrl $ctrl, Language $lng, ilGlobalTemplateInterface $tpl, Factory $ui_factory, Renderer $renderer, WrapperFactory $request_wrapper, ilToolbarGUI $toolbar, Refinery $refinery, ilSkinFactory $skin_factory, FileUpload $upload, ilTabsGUI $tabs, ilHelpGUI $help, string $skin_id, string $style_id, string $ref_id, bool $read_only, bool $management_enabled)
setReadOnly(bool $read_only)
ilSystemStyleConfig $config
ilSkinFactory $skin_factory
ilGlobalTemplateInterface $tpl
ilSystemStyleMessageStack $message_stack
getAssignmentCreationModal(string $style_name="")
static _activateStyle(string $a_skin, string $a_style)
activate system style
static _deactivateStyle(string $a_skin, string $a_style)
deactivate system style
static setCurrentDefaultStyle(string $skin_id, string $style_id)
Sets the default style of the system.
TableGUI class for system styles.
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.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.