2include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
3include_once(
"Services/Style/System/classes/Utilities/class.ilSkinXML.php");
4include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleSkinContainer.php");
5include_once(
"Services/Style/System/classes/class.ilSystemStyleSettings.php");
6include_once(
"Services/Style/System/classes/Exceptions/class.ilSystemStyleException.php");
7include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleMessageStack.php");
8include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleMessage.php");
9include_once(
"Services/Style/System/classes/Settings/class.ilSubStyleAssignmentGUI.php");
46 $this->ctrl =
$DIC->ctrl();
47 $this->lng =
$DIC->language();
48 $this->tabs =
$DIC->tabs();
50 $this->tpl =
$DIC[
"tpl"];
59 $cmd = $this->ctrl->getCmd() ? $this->ctrl->getCmd():
"edit";
61 $skin = ilSkinXML::parseFromXML($system_style_conf->getCustomizingSkinPath() .
$_GET[
"skin_id"] .
"/template.xml");
62 $style = $skin->getStyle(
$_GET[
"style_id"]);
64 if ($style->isSubstyle()) {
65 if ($cmd ==
"edit" || $cmd ==
"view") {
73 case "deleteAssignments":
75 $assign_gui->deleteAssignments($skin, $style);
77 case "saveAssignment":
79 $assign_gui->saveAssignment($skin, $style);
83 $assign_gui->addAssignment($skin, $style);
87 $assign_gui->assignStyle($skin, $style);
104 $this->tabs->addSubTab(
'edit', $this->lng->txt(
'settings'), $this->ctrl->getLinkTargetByClass(
'ilsystemstylesettingsgui'));
105 $this->tabs->addSubTab(
'assignStyle', $this->lng->txt(
'assignment'), $this->ctrl->getLinkTargetByClass(
'ilsystemstylesettingsgui',
"assignStyle"));
107 $this->tabs->activateSubTab($active);
114 $this->tpl->setContent($form->getHTML());
124 if (!
$_GET[
"skin_id"]) {
127 if (!
$_GET[
"style_id"]) {
131 $skin = ilSkinXML::parseFromXML($system_style_config->getCustomizingSkinPath() .
$_GET[
"skin_id"] .
"/template.xml");
132 $style = $skin->getStyle(
$_GET[
"style_id"]);
133 $values[
"skin_id"] = $skin->getId();
134 $values[
"skin_name"] = $skin->getName();
135 $values[
"style_id"] = $style->getId();
136 $values[
"style_name"] = $style->getName();
137 $values[
"image_dir"] = $style->getImageDirectory();
138 $values[
"font_dir"] = $style->getFontDirectory();
139 $values[
"sound_dir"] = $style->getSoundDirectory();
142 if ($style->isSubstyle()) {
143 $values[
"parent_style"] = $style->getSubstyleOf();
146 $is_personal_style =
$DIC->user()->getPref(
"skin") == $skin->getId() &&
$DIC->user()->getPref(
"style") == $style->getId();
147 $values[
"personal"] = $is_personal_style;
149 $values[
"default"] = $is_default_style;
152 $form->setValuesByArray($values);
161 if ($form->checkInput()) {
164 $skin = ilSkinXML::parseFromXML($system_style_conf->getCustomizingSkinPath() .
$_GET[
"skin_id"] .
"/template.xml");
165 $style = $skin->getStyle(
$_GET[
"style_id"]);
167 if ($style->isSubstyle()) {
174 $message_stack->sendMessages(
true);
175 $this->ctrl->redirectByClass(
"ilSystemStyleSettingsGUI");
180 $message_stack->sendMessages();
183 $form->setValuesByPost();
184 $this->tpl->setContent($form->getHTML());
198 $old_style = clone $old_skin->getStyle(
$_GET[
"style_id"]);
201 $new_skin->setId(
$_POST[
"skin_id"]);
202 $new_skin->setName(
$_POST[
"skin_name"]);
203 $new_skin->getVersionStep(
$_POST[
'skin_version']);
205 $new_style = $new_skin->getStyle(
$_GET[
"style_id"]);
206 $new_style->setId(
$_POST[
"style_id"]);
207 $new_style->setName(
$_POST[
"style_name"]);
208 $new_style->setCssFile(
$_POST[
"style_id"]);
209 $new_style->setImageDirectory(
$_POST[
"image_dir"]);
210 $new_style->setSoundDirectory(
$_POST[
"sound_dir"]);
211 $new_style->setFontDirectory(
$_POST[
"font_dir"]);
214 $container->updateStyle($new_style->getId(), $old_style);
217 if (
$_POST[
"active"] == 1) {
219 if (
$_POST[
"personal"] == 1) {
222 if (
$_POST[
"default"] == 1) {
234 if (!
$_POST[
"personal"] &&
$DIC->user()->getPref(
"skin") == $new_skin->getId()) {
243 $system_style_conf->getDefaultSkinId(),
244 $system_style_conf->getDefaultStyleId()
256 $system_style_conf->getDefaultSkinId(),
257 $system_style_conf->getDefaultStyleId()
261 $this->lng->txt(
"default_style_set_to") .
" " . $system_style_conf->getDefaultSkinId() .
": " . $system_style_conf->getDefaultStyleId(),
266 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'skin_id', $new_skin->getId());
267 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'style_id', $new_style->getId());
278 $old_substyle = clone $skin->getStyle(
$_GET[
"style_id"]);
280 $new_substyle = $skin->getStyle(
$_GET[
"style_id"]);
281 $new_substyle->setId(
$_POST[
"style_id"]);
282 $new_substyle->setName(
$_POST[
"style_name"]);
283 $new_substyle->setCssFile(
$_POST[
"style_id"]);
284 $new_substyle->setImageDirectory(
$_POST[
"image_dir"]);
285 $new_substyle->setSoundDirectory(
$_POST[
"sound_dir"]);
286 $new_substyle->setFontDirectory(
$_POST[
"font_dir"]);
287 $new_substyle->setSubstyleOf($old_substyle->getSubstyleOf());
290 $container->updateStyle($new_substyle->getId(), $old_substyle);
292 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'skin_id', $skin->getId());
293 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'style_id', $new_substyle->getId());
305 $skin = ilSkinXML::parseFromXML($system_style_conf->getCustomizingSkinPath() .
$_GET[
"skin_id"] .
"/template.xml");
306 $style = $skin->getStyle(
$_GET[
"style_id"]);
308 $form->setFormAction($this->ctrl->getFormActionByClass(
"ilsystemstylesettingsgui"));
311 if (!$style->isSubstyle()) {
312 $form->setTitle($this->lng->txt(
"skin"));
315 $ti->setMaxLength(128);
317 $ti->setRequired(
true);
318 $ti->setInfo($this->lng->txt(
"skin_id_description"));
321 $ti =
new ilTextInputGUI($this->lng->txt(
"skin_name"),
"skin_name");
322 $ti->setInfo($this->lng->txt(
"skin_name_description"));
323 $ti->setMaxLength(128);
325 $ti->setRequired(
true);
328 if ($skin->isVersionChangeable()) {
330 $ti->setInfo($this->lng->txt(
"skin_version_description"));
331 $ti->setValue($skin->getVersion());
336 $section->setTitle($this->lng->txt(
"style"));
339 $form->setTitle($this->lng->txt(
"sub_style"));
342 $ti =
new ilTextInputGUI($this->lng->txt(
"style_id"),
"style_id");
343 $ti->setMaxLength(128);
345 $ti->setRequired(
true);
346 $ti->setInfo($this->lng->txt(
"style_id_description"));
349 $ti =
new ilTextInputGUI($this->lng->txt(
"style_name"),
"style_name");
350 $ti->setMaxLength(128);
352 $ti->setRequired(
true);
353 $ti->setInfo($this->lng->txt(
"style_name_description"));
356 $ti =
new ilTextInputGUI($this->lng->txt(
"image_dir"),
"image_dir");
357 $ti->setMaxLength(128);
359 $ti->setInfo($this->lng->txt(
"image_dir_description"));
362 $ti =
new ilTextInputGUI($this->lng->txt(
"font_dir"),
"font_dir");
363 $ti->setMaxLength(128);
365 $ti->setInfo($this->lng->txt(
"font_dir_description"));
368 $ti =
new ilTextInputGUI($this->lng->txt(
"sound_dir"),
"sound_dir");
369 $ti->setMaxLength(128);
371 $ti->setInfo($this->lng->txt(
"sound_dir_description"));
374 if (!$style->isSubstyle()) {
376 $section->setTitle($this->lng->txt(
"system_style_activation"));
379 $active =
new ilCheckboxInputGUI($this->lng->txt(
"system_style_activation"),
"active");
380 $active->setInfo($this->lng->txt(
"system_style_activation_description"));
383 $set_default->setInfo($this->lng->txt(
"system_style_default_description"));
384 $active->addSubItem($set_default);
387 $set_personal->setInfo($this->lng->txt(
"system_style_personal_description"));
388 $active->addSubItem($set_personal);
391 $form->addItem($active);
394 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
395 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
An exception for terminatinating execution or to throw for unit testing.
This class represents a non editable value in a property form.
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Class for advanced editing exception handling in ILIAS.
Used to stack messages to be shown to the user.
addMessage(ilSystemStyleMessage $message)
Add a message to be displayed by the stack.
setSubStyleSubTabs($active="")
saveSubStyle(ilSystemStyleMessageStack $message_stack)
executeCommand()
Execute command.
getPropertiesValues($form)
Get values for edit properties form.
saveStyle(ilSystemStyleMessageStack $message_stack)
__construct()
Constructor.
static getCurrentDefaultStyle()
Gets default style of the system.
static getCurrentUserPrefSkin()
Gets a users preferred skin by using the user object.
static setCurrentDefaultStyle($skin_id, $style_id)
Sets the default style of the system.
static _activateStyle($a_skin, $a_style)
activate system style
static _deactivateStyle($a_skin, $a_style)
deactivate system style
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
static getCurrentDefaultSkin()
Gets default Skin of the System.
static setCurrentUserPrefStyle($skin_id, $style_id)
Sets a users preferred system skin/style by using the user object.
static getCurrentUserPrefStyle()
Gets a users preferred style by using the user object.
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.