2include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
    3include_once(
"Services/Style/System/classes/class.ilSystemStyleSettings.php");
 
    4include_once(
"Services/Style/System/classes/Overview/class.ilSystemStyleDeleteGUI.php");
 
    5include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleMessageStack.php");
 
    6include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleSkinContainer.php");
 
    7include_once(
"Services/FileDelivery/classes/class.ilFileDelivery.php");
 
    8include_once(
"Services/Style/System/classes/Overview/class.ilSystemStylesTableGUI.php");
 
    9include_once(
"Services/Form/classes/class.ilSelectInputGUI.php");
 
   10include_once(
"Services/Style/System/classes/class.ilStyleDefinition.php");
 
   11include_once(
"Services/Style/System/classes/Utilities/class.ilSkinXML.php");
 
   12include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleSkinContainer.php");
 
   13include_once(
"Services/Object/exceptions/class.ilObjectException.php");
 
   70        $this->
ilias = $DIC[
"ilias"];
 
   72        $this->ctrl = 
$DIC->ctrl();
 
   73        $this->toolbar = 
$DIC->toolbar();
 
   74        $this->lng = 
$DIC->language();
 
   75        $this->tpl = 
$DIC[
"tpl"];
 
   77        $this->ref_id = (int) 
$_GET[
"ref_id"];
 
   88        $cmd = $this->ctrl->getCmd();
 
   96            case "addSystemStyle":
 
   98            case "saveNewSystemStyle":
 
   99            case "saveNewSubStyle":
 
  104            case "confirmDelete":
 
  113            case "moveUserStyles":
 
  114            case "saveStyleSettings":
 
  130        $this->tpl->setContent(
$table->getHTML());
 
  145            $add_skin_btn->setCaption($this->lng->txt(
"add_system_style"), 
false);
 
  146            $add_skin_btn->setUrl($this->ctrl->getLinkTarget($this, 
'addSystemStyle'));
 
  147            $this->toolbar->addButtonInstance($add_skin_btn);
 
  151            $add_substyle_btn->setCaption($this->lng->txt(
"add_substyle"), 
false);
 
  152            $add_substyle_btn->setUrl($this->ctrl->getLinkTarget($this, 
'addSubStyle'));
 
  153            if (count(ilStyleDefinition::getAllSkins()) == 1) {
 
  154                $add_substyle_btn->setDisabled(
true);
 
  156            $this->toolbar->addButtonInstance($add_substyle_btn);
 
  158            $this->toolbar->addSeparator();
 
  162        $si = 
new ilSelectInputGUI($this->lng->txt(
"sty_move_user_styles") . 
": " . $this->lng->txt(
"sty_from"), 
"from_style");
 
  166            if (!$skin_style[
'substyle_of']) {
 
  170        $si->setOptions(
$options + array(
"other" => $this->lng->txt(
"other")));
 
  172        $this->toolbar->addInputItem(
$si, 
true);
 
  177        $this->toolbar->addInputItem(
$si, 
true);
 
  180        $move_skin_btn->setCaption($this->lng->txt(
"sty_move_style"), 
false);
 
  181        $this->toolbar->addButtonInstance($move_skin_btn);
 
  182        $this->toolbar->setFormAction($this->ctrl->getLinkTarget($this, 
'moveUserStyles'));
 
  186        $this->tpl->setContent(
$table->getHTML());
 
  194        $to = explode(
":", 
$_POST[
"to_style"]);
 
  196        if (
$_POST[
"from_style"] == 
"other") {
 
  202            foreach ($all_user_styles as 
$style) {
 
  204                    $style_arr = explode(
":", 
$style);
 
  213        ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
  214        $this->ctrl->redirect($this, 
"edit");
 
  227            foreach ($all_styles as $st) {
 
  228                if (!isset(
$_POST[
"st_act"][$st[
"id"]])) {
 
  236            if (
$_POST[
"default_skin_style"] != 
"") {
 
  237                $sknst = explode(
":", 
$_POST[
"default_skin_style"]);
 
  242        $message_stack->sendMessages(
true);
 
  243        $this->ctrl->redirect($this, 
"edit");
 
  254        if (count(
$_POST[
"st_act"]) < 1) {
 
  259        if (!isset(
$_POST[
"st_act"][
$_POST[
"default_skin_style"]])) {
 
  268        foreach ($all_styles as $st) {
 
  269            if (!isset(
$_POST[
"st_act"][$st[
"id"]])) {
 
  293        if (
$form->checkInput()) {
 
  304                    $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'skin_id', $skin->getId());
 
  305                    $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'style_id', 
$style->getId());
 
  306                    if ($message_stack->hasMessages()) {
 
  307                        $message_stack->sendMessages(
true);
 
  309                        ilUtil::sendSuccess($this->lng->txt(
"msg_sys_style_created"), 
true);
 
  311                    $this->ctrl->redirectByClass(
"ilSystemStyleSettingsGUI");
 
  316            $message_stack->sendMessages();
 
  320        $form->setValuesByPost();
 
  321        $this->tpl->setContent(
$form->getHTML());
 
  331        $DIC->tabs()->clearTargets();
 
  335        $DIC->help()->setScreenIdComponent(
"sty");
 
  336        $DIC->help()->setScreenId(
"system_styles");
 
  337        $DIC->help()->setSubScreenId(
"create");
 
  345        $this->tpl->setContent($this->getCreationFormsHTML($forms));
 
  354        $form->setFormAction($this->ctrl->getFormAction($this));
 
  355        $form->setTitle($this->lng->txt(
"sty_create_new_system_style"));
 
  358        $ti->setInfo($this->lng->txt(
"skin_id_description"));
 
  359        $ti->setMaxLength(128);
 
  361        $ti->setRequired(
true);
 
  364        $ti = 
new ilTextInputGUI($this->lng->txt(
"skin_name"), 
"skin_name");
 
  365        $ti->setInfo($this->lng->txt(
"skin_name_description"));
 
  366        $ti->setMaxLength(128);
 
  368        $ti->setRequired(
true);
 
  371        $ti = 
new ilTextInputGUI($this->lng->txt(
"style_id"), 
"style_id");
 
  372        $ti->setInfo($this->lng->txt(
"style_id_description"));
 
  373        $ti->setMaxLength(128);
 
  375        $ti->setRequired(
true);
 
  378        $ti = 
new ilTextInputGUI($this->lng->txt(
"style_name"), 
"style_name");
 
  379        $ti->setInfo($this->lng->txt(
"style_name_description"));
 
  380        $ti->setMaxLength(128);
 
  382        $ti->setRequired(
true);
 
  385        $form->addCommandButton(
"saveNewSystemStyle", $this->lng->txt(
"save"));
 
  386        $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  397        $form->setFormAction($this->ctrl->getFormAction($this));
 
  398        $form->setTitle($this->lng->txt(
"sty_import_system_style"));
 
  401        $file_input = 
new ilFileInputGUI($this->lng->txt(
"import_file"), 
"importfile");
 
  402        $file_input->setRequired(
true);
 
  403        $file_input->setSuffixes(array(
"zip"));
 
  404        $form->addItem($file_input);
 
  406        $form->addCommandButton(
"importStyle", $this->lng->txt(
"import"));
 
  407        $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  418        $form->setFormAction($this->ctrl->getFormAction($this));
 
  419        $form->setTitle($this->lng->txt(
"sty_copy_other_system_style"));
 
  423        $ti->setRequired(
true);
 
  428            if (
$style[
"skin_id"] != $system_style_conf->getDefaultSkinId()) {
 
  436        $form->addCommandButton(
"copyStyle", $this->lng->txt(
"copy"));
 
  437        $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  446    protected function getCreationFormsHTML(array $a_forms)
 
  448        include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
 
  453        foreach ($a_forms as $form_type => $cf) {
 
  457            $htpl = 
new ilTemplate(
"tpl.creation_acc_head.html", 
true, 
true, 
"Services/Object");
 
  461            if (method_exists($this, 
"getCreationFormTitle")) {
 
  462                $form_title = $this->getCreationFormTitle($form_type);
 
  465                $form_title = $cf->getTitle();
 
  469            $htpl->setVariable(
"TITLE", $this->lng->txt(
"option") . 
" " . $cnt . 
": " .
 
  472            $cf->setTitleIcon(
null);
 
  473            $cf->setTableWidth(
"100%");
 
  475            $acc->addItem($htpl->get(), $cf->getHTML());
 
  480        return "<div class='ilCreationFormSection'>" . $acc->getHTML() . 
"</div>";
 
  487        $imploded_skin_style_id = explode(
":", 
$_POST[
'source_style']);
 
  488        $skin_id = $imploded_skin_style_id[0];
 
  489        $style_id = $imploded_skin_style_id[1];
 
  495            $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'skin_id', $new_container->getSkin()->getId());
 
  496            $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'style_id', $new_container->getSkin()->getStyle($style_id)->getId());
 
  497        } 
catch (Exception $e) {
 
  502        $message_stack->sendMessages(
true);
 
  503        $this->ctrl->redirectByClass(
"ilSystemStyleSettingsGUI");
 
  508        $skin_id = 
$_GET[
"skin_id"];
 
  509        $style_id = 
$_GET[
"style_id"];
 
  515            $delete_form_table->addStyle(
$container->getSkin(), 
$container->getSkin()->getStyle($style_id));
 
  516            $this->tpl->setContent($delete_form_table->getDeleteStyleFormHTML());
 
  519            $message_stack->sendMessages(
true);
 
  528        $all_deletable = 
true;
 
  529        foreach (
$_POST[
'id'] as $skin_style_id) {
 
  530            $imploded_skin_style_id = explode(
":", $skin_style_id);
 
  531            $skin_id = $imploded_skin_style_id[0];
 
  532            $style_id = $imploded_skin_style_id[1];
 
  533            if (!$this->
checkDeletable($skin_id, $style_id, $message_stack)) {
 
  534                $all_deletable = 
false;
 
  537        if ($all_deletable) {
 
  538            foreach (
$_POST[
'id'] as $skin_style_id) {
 
  539                $imploded_skin_style_id = explode(
":", $skin_style_id);
 
  540                $skin_id = $imploded_skin_style_id[0];
 
  541                $style_id = $imploded_skin_style_id[1];
 
  543                $delete_form_table->addStyle(
$container->getSkin(), 
$container->getSkin()->getStyle($style_id));
 
  545            $this->tpl->setContent($delete_form_table->getDeleteStyleFormHTML());
 
  548            $message_stack->sendMessages(
true);
 
  588            if (is_string($skin_style_id) && strpos(
$key, 
'style') !== 
false) {
 
  590                    $imploded_skin_style_id = explode(
":", $skin_style_id);
 
  592                    $syle = 
$container->getSkin()->getStyle($imploded_skin_style_id[1]);
 
  597                } 
catch (Exception $e) {
 
  602        $message_stack->sendMessages(
true);
 
  603        $this->ctrl->redirect($this);
 
  613        if (
$form->checkInput()) {
 
  616            $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'skin_id', $imported_container->getSkin()->getId());
 
  617            $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'style_id', $imported_container->getSkin()->getDefaultStyle()->getId());
 
  620            $message_stack->sendMessages(
true);
 
  621            $this->ctrl->redirectByClass(
"ilSystemStyleSettingsGUI");
 
  625        $form->setValuesByPost();
 
  626        $this->tpl->setContent(
$form->getHTML());
 
  630        $skin_id = 
$_GET[
"skin_id"];
 
  634        } 
catch (Exception $e) {
 
  647        $DIC->tabs()->clearTargets();
 
  651        $DIC->help()->setScreenIdComponent(
"sty");
 
  652        $DIC->help()->setScreenId(
"system_styles");
 
  653        $DIC->help()->setSubScreenId(
"create_sub");
 
  657        $this->tpl->setContent(
$form->getHTML());
 
  666        $form->setFormAction($this->ctrl->getFormAction($this));
 
  667        $form->setTitle($this->lng->txt(
"sty_create_new_system_sub_style"));
 
  670        $ti = 
new ilTextInputGUI($this->lng->txt(
"sub_style_id"), 
"sub_style_id");
 
  671        $ti->setInfo($this->lng->txt(
"sub_style_id_description"));
 
  672        $ti->setMaxLength(128);
 
  674        $ti->setRequired(
true);
 
  677        $ti = 
new ilTextInputGUI($this->lng->txt(
"sub_style_name"), 
"sub_style_name");
 
  678        $ti->setInfo($this->lng->txt(
"sub_style_name_description"));
 
  679        $ti->setMaxLength(128);
 
  681        $ti->setRequired(
true);
 
  686        $ti->setRequired(
true);
 
  687        $ti->setInfo($this->lng->txt(
"sub_style_parent_style_description"));
 
  692            if (
$style[
"skin_id"] != $system_style_conf->getDefaultSkinId() && !
$style[
"substyle_of"]) {
 
  699        $form->addCommandButton(
"saveNewSubStyle", $this->lng->txt(
"save"));
 
  700        $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  709        if (
$form->checkInput()) {
 
  711                $imploded_parent_skin_style_id = explode(
":", 
$_POST[
'parent_style']);
 
  712                $parent_skin_id = $imploded_parent_skin_style_id[0];
 
  713                $parent_style_id = $imploded_parent_skin_style_id[1];
 
  717                if (array_key_exists(
$_POST[
'sub_style_id'], 
$container->getSkin()->getSubstylesOfStyle($parent_style_id))) {
 
  721                $sub_style_id = 
$_POST[
'sub_style_id'];
 
  724                $style->setSubstyleOf($parent_style_id);
 
  727                $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'skin_id', $parent_skin_id);
 
  728                $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI', 
'style_id', $sub_style_id);
 
  729                ilUtil::sendSuccess($this->lng->txt(
"msg_sub_style_created"), 
true);
 
  730                $this->ctrl->redirectByClass(
"ilSystemStyleSettingsGUI");
 
  737        $form->setValuesByPost();
 
  738        $this->tpl->setContent(
$form->getHTML());
 
An exception for terminatinating execution or to throw for unit testing.
Accordion user interface class.
static _getAllUserAssignedStyles()
skins and styles
static _moveUsersToStyle($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
skins and styles
static _getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles
Base exception class for object service.
ilSkinXml holds an manages the basic data of a skin as provide by the template of the skin.
static skinExists($skin_id, ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
static styleExists($style_id)
static getAllSkinStyles()
Get all skins/styles as array (convenient for tables) Attention: tempalte_name/template_id in this ar...
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Class for advanced editing exception handling in ILIAS.
const SUBSTYLE_ASSIGNMENT_EXISTS
Used to stack messages to be shown to the user.
addMessage(ilSystemStyleMessage $message)
Add a message to be displayed by the stack.
setManagementEnabled($management_enabled)
executeCommand()
Execute command.
addSystemStyleForms()
create
moveUserStyles()
Move user styles.
checkDeletable($skin_id, $style_id, ilSystemStyleMessageStack $message_stack)
saveStyleSettings()
Save skin and style settings.
__construct($read_only, $management_enabled)
Constructor.
checkStyleSettings(ilSystemStyleMessageStack $message_stack)
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.
This class is responsible for all file system related actions related actions of a skin such as copyi...
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
static import($import_zip_path, $name, ilSystemStyleMessageStack $message_stack=null, $system_styles_conf=null, $uploaded=true)
Imports a skin from zip.
TableGUI class for system styles.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(!array_key_exists('StateId', $_REQUEST)) $id
redirection script todo: (a better solution should control the processing via a xml file)
if(empty($password)) $table
if(isset($_POST['submit'])) $form