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");
75 case "deleteAssignments":
77 $assign_gui->deleteAssignments($skin,
$style);
79 case "saveAssignment":
81 $assign_gui->saveAssignment($skin,
$style);
85 $assign_gui->addAssignment($skin,
$style);
89 $assign_gui->assignStyle($skin,
$style);
106 $this->tabs->addSubTab(
'edit', $this->lng->txt(
'settings'), $this->ctrl->getLinkTargetByClass(
'ilsystemstylesettingsgui'));
107 $this->tabs->addSubTab(
'assignStyle', $this->lng->txt(
'assignment'), $this->ctrl->getLinkTargetByClass(
'ilsystemstylesettingsgui',
"assignStyle"));
109 $this->tabs->activateSubTab($active);
115 $this->tpl->setContent($form->getHTML());
126 if(!
$_GET[
"skin_id"]){
129 if(!
$_GET[
"style_id"]){
133 $skin = ilSkinXML::parseFromXML($system_style_config->getCustomizingSkinPath().$_GET[
"skin_id"].
"/template.xml");
135 $values[
"skin_id"] = $skin->getId();
136 $values[
"skin_name"] = $skin->getName();
137 $values[
"style_id"] =
$style->getId();
138 $values[
"style_name"] =
$style->getName();
139 $values[
"image_dir"] =
$style->getImageDirectory();
140 $values[
"font_dir"] =
$style->getFontDirectory();
141 $values[
"sound_dir"] =
$style->getSoundDirectory();
145 $values[
"parent_style"] =
$style->getSubstyleOf();
148 $is_personal_style =
$DIC->user()->getPref(
"skin")==$skin->getId() &&
$DIC->user()->getPref(
"style") ==
$style->getId();
149 $values[
"personal"] = $is_personal_style;
151 $values[
"default"] = $is_default_style;
154 $form->setValuesByArray($values);
162 if ($form->checkInput())
167 $skin = ilSkinXML::parseFromXML($system_style_conf->getCustomizingSkinPath().$_GET[
"skin_id"].
"/template.xml");
177 $message_stack->sendMessages(
true);
178 $this->ctrl->redirectByClass(
"ilSystemStyleSettingsGUI");
184 $message_stack->sendMessages();
186 $form->setValuesByPost();
187 $this->tpl->setContent($form->getHTML());
199 $old_skin = clone $container->getSkin();
200 $old_style = clone $old_skin->getStyle(
$_GET[
"style_id"]);
202 $new_skin = $container->getSkin();
203 $new_skin->setId(
$_POST[
"skin_id"]);
204 $new_skin->setName(
$_POST[
"skin_name"]);
205 $new_skin->getVersionStep(
$_POST[
'skin_version']);
207 $new_style = $new_skin->getStyle(
$_GET[
"style_id"]);
208 $new_style->setId(
$_POST[
"style_id"]);
209 $new_style->setName(
$_POST[
"style_name"]);
210 $new_style->setCssFile(
$_POST[
"style_id"]);
211 $new_style->setImageDirectory(
$_POST[
"image_dir"]);
212 $new_style->setSoundDirectory(
$_POST[
"sound_dir"]);
213 $new_style->setFontDirectory(
$_POST[
"font_dir"]);
215 $container->updateSkin($old_skin);
216 $container->updateStyle($new_style->getId(),$old_style);
219 if(
$_POST[
"active"] == 1){
221 if(
$_POST[
"personal"]==1){
236 if(!
$_POST[
"personal"] &&
$DIC->user()->getPref(
"skin") == $new_skin->getId()){
244 $system_style_conf->getDefaultSkinId(),$system_style_conf->getDefaultStyleId()
254 $system_style_conf->getDefaultSkinId(),$system_style_conf->getDefaultStyleId()
257 $this->lng->txt(
"default_style_set_to").
" ".$system_style_conf->getDefaultSkinId().
": ".$system_style_conf->getDefaultStyleId(),
261 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'skin_id',$new_skin->getId());
262 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'style_id',$new_style->getId());
271 $skin = $container->getSkin();
272 $old_substyle = clone $skin->getStyle(
$_GET[
"style_id"]);
274 $new_substyle = $skin->getStyle(
$_GET[
"style_id"]);
275 $new_substyle->setId(
$_POST[
"style_id"]);
276 $new_substyle->setName(
$_POST[
"style_name"]);
277 $new_substyle->setCssFile(
$_POST[
"style_id"]);
278 $new_substyle->setImageDirectory(
$_POST[
"image_dir"]);
279 $new_substyle->setSoundDirectory(
$_POST[
"sound_dir"]);
280 $new_substyle->setFontDirectory(
$_POST[
"font_dir"]);
281 $new_substyle->setSubstyleOf($old_substyle->getSubstyleOf());
283 $container->updateSkin($skin);
284 $container->updateStyle($new_substyle->getId(),$old_substyle);
286 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'skin_id',$skin->getId());
287 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'style_id',$new_substyle->getId());
298 $skin = ilSkinXML::parseFromXML($system_style_conf->getCustomizingSkinPath().$_GET[
"skin_id"].
"/template.xml");
301 $form->setFormAction($this->ctrl->getFormActionByClass(
"ilsystemstylesettingsgui"));
304 if(!
$style->isSubstyle()){
305 $form->setTitle($this->lng->txt(
"skin"));
308 $ti->setMaxLength(128);
310 $ti->setRequired(
true);
311 $ti->setInfo($this->lng->txt(
"skin_id_description"));
314 $ti =
new ilTextInputGUI($this->lng->txt(
"skin_name"),
"skin_name");
315 $ti->setInfo($this->lng->txt(
"skin_name_description"));
316 $ti->setMaxLength(128);
318 $ti->setRequired(
true);
321 if($skin->isVersionChangeable()) {
323 $ti->setInfo($this->lng->txt(
"skin_version_description"));
324 $ti->setValue($skin->getVersion());
329 $section->setTitle($this->lng->txt(
"style"));
332 $form->setTitle($this->lng->txt(
"sub_style"));
335 $ti =
new ilTextInputGUI($this->lng->txt(
"style_id"),
"style_id");
336 $ti->setMaxLength(128);
338 $ti->setRequired(
true);
339 $ti->setInfo($this->lng->txt(
"style_id_description"));
342 $ti =
new ilTextInputGUI($this->lng->txt(
"style_name"),
"style_name");
343 $ti->setMaxLength(128);
345 $ti->setRequired(
true);
346 $ti->setInfo($this->lng->txt(
"style_name_description"));
349 $ti =
new ilTextInputGUI($this->lng->txt(
"image_dir"),
"image_dir");
350 $ti->setMaxLength(128);
352 $ti->setInfo($this->lng->txt(
"image_dir_description"));
355 $ti =
new ilTextInputGUI($this->lng->txt(
"font_dir"),
"font_dir");
356 $ti->setMaxLength(128);
358 $ti->setInfo($this->lng->txt(
"font_dir_description"));
361 $ti =
new ilTextInputGUI($this->lng->txt(
"sound_dir"),
"sound_dir");
362 $ti->setMaxLength(128);
364 $ti->setInfo($this->lng->txt(
"sound_dir_description"));
367 if(!
$style->isSubstyle()){
369 $section->setTitle($this->lng->txt(
"system_style_activation"));
372 $active =
new ilCheckboxInputGUI($this->lng->txt(
"system_style_activation"),
"active");
373 $active->setInfo($this->lng->txt(
"system_style_activation_description"));
376 $set_default->setInfo($this->lng->txt(
"system_style_default_description"));
377 $active->addSubItem($set_default);
380 $set_personal->setInfo($this->lng->txt(
"system_style_personal_description"));
381 $active->addSubItem($set_personal);
384 $form->addItem($active);
387 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
388 $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.