ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSubStyleAssignmentGUI Class Reference
+ Collaboration diagram for ilSubStyleAssignmentGUI:

Public Member Functions

 __construct (ilSystemStyleSettingsGUI $parent_gui)
 Constructor. More...
 
 assignStyle (ilSkinXML $skin, ilSkinStyleXML $substyle)
 Assign styles to categories. More...
 
 addAssignment ()
 Add style category assignment. More...
 
 saveAssignment (ilSkinXML $skin, ilSkinStyleXML $substyle)
 Save style category assignment. More...
 
 deleteAssignments (ilSkinXML $skin, ilSkinStyleXML $substyle)
 Delete system style to category assignments. More...
 
 getParentGui ()
 
 setParentGui ($parent_gui)
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tpl
 
 $toolbar
 
 $parent_gui
 
 $tree
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSubStyleAssignmentGUI::__construct ( ilSystemStyleSettingsGUI  $parent_gui)

Constructor.

Definition at line 53 of file class.ilSubStyleAssignmentGUI.php.

References $DIC, and $parent_gui.

54  {
55  global $DIC;
56 
57  $this->ctrl = $DIC->ctrl();
58  $this->lng = $DIC->language();
59  $this->toolbar = $DIC->toolbar();
60  $this->tpl = $DIC["tpl"];
61  $this->parent_gui = $parent_gui;
62  $this->tree = $DIC["tree"];
63  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addAssignment()

ilSubStyleAssignmentGUI::addAssignment ( )

Add style category assignment.

Definition at line 94 of file class.ilSubStyleAssignmentGUI.php.

References $_GET, and getParentGui().

95  {
96  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
97  $exp = new ilSearchRootSelector(
98  $this->ctrl->getLinkTarget($this->getParentGui(), 'addStyleCatAssignment')
99  );
100  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $this->tree->readRootId());
101  $exp->setExpandTarget($this->ctrl->getLinkTarget($this->getParentGui(), 'addAssignment'));
102  $exp->setTargetClass(get_class($this->getParentGui()));
103  $exp->setCmd('saveAssignment');
104  $exp->setClickableTypes(["cat"]);
105 
106  $exp->setOutput(0);
107  $this->tpl->setContent($exp->getOutput());
108  }
$_GET["client_id"]
+ Here is the call graph for this function:

◆ assignStyle()

ilSubStyleAssignmentGUI::assignStyle ( ilSkinXML  $skin,
ilSkinStyleXML  $substyle 
)

Assign styles to categories.

Parameters
ilSkinXML$skin
ilSkinStyleXML$substyle
Exceptions
ilSystemStyleException

Definition at line 72 of file class.ilSubStyleAssignmentGUI.php.

References $style, $tab, ilSkinStyleXML\getId(), ilSkinXML\getId(), getParentGui(), ilSkinXML\getStyle(), and ilSkinStyleXML\getSubstyleOf().

73  {
74  $style = $skin->getStyle($substyle->getSubstyleOf());
75 
76  $this->toolbar->addFormButton($this->lng->txt("sty_add_assignment"), "addAssignment");
77  $this->toolbar->setFormAction($this->ctrl->getFormAction($this->getParentGui()));
78 
80  $this->getParentGui(),
81  "assignStyleToCat",
82  $skin->getId(),
83  $style->getId(),
84  $substyle->getId()
85  );
86 
87  $this->tpl->setContent($tab->getHTML());
88  }
$style
Definition: example_012.php:70
getSubstyleOf()
Returns the parent style of this style if set.
TableGUI class for system style to category assignments.
+ Here is the call graph for this function:

◆ deleteAssignments()

ilSubStyleAssignmentGUI::deleteAssignments ( ilSkinXML  $skin,
ilSkinStyleXML  $substyle 
)

Delete system style to category assignments.

Parameters
ilSkinXML$skin
ilSkinStyleXML$substyle

Definition at line 142 of file class.ilSubStyleAssignmentGUI.php.

References $_POST, $id, $style, ilSystemStyleSettings\deleteSystemStyleCategoryAssignment(), ilSkinStyleXML\getId(), ilSkinXML\getId(), getParentGui(), ilSkinXML\getStyle(), ilSkinStyleXML\getSubstyleOf(), and ilUtil\sendFailure().

143  {
144  $style = $skin->getStyle($substyle->getSubstyleOf());
145 
146 
147  if (is_array($_POST["id"])) {
148  foreach ($_POST["id"] as $id) {
149  $id_arr = explode(":", $id);
151  $skin->getId(),
152  $style->getId(),
153  $substyle->getId(),
154  $id_arr[1]
155  );
156  }
157  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
158  } else {
159  ilUtil::sendFailure($this->lng->txt("no_style_selected"), true);
160  }
161 
162  $this->ctrl->redirect($this->getParentGui(), "assignStyle");
163  }
$style
Definition: example_012.php:70
static deleteSystemStyleCategoryAssignment( $a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Deletes all sub style category assignment of a system style.
getSubstyleOf()
Returns the parent style of this style if set.
if(!array_key_exists('StateId', $_REQUEST)) $id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ getParentGui()

ilSubStyleAssignmentGUI::getParentGui ( )
Returns
ilSystemStyleSettingsGUI

Definition at line 168 of file class.ilSubStyleAssignmentGUI.php.

References $parent_gui.

Referenced by addAssignment(), assignStyle(), deleteAssignments(), and saveAssignment().

+ Here is the caller graph for this function:

◆ saveAssignment()

ilSubStyleAssignmentGUI::saveAssignment ( ilSkinXML  $skin,
ilSkinStyleXML  $substyle 
)

Save style category assignment.

Parameters
ilSkinXML$skin
ilSkinStyleXML$substyle

Definition at line 117 of file class.ilSubStyleAssignmentGUI.php.

References $_GET, $style, ilSkinStyleXML\getId(), ilSkinXML\getId(), getParentGui(), ilSkinXML\getStyle(), ilSkinStyleXML\getSubstyleOf(), ilUtil\sendFailure(), and ilSystemStyleSettings\writeSystemStyleCategoryAssignment().

118  {
119  $style = $skin->getStyle($substyle->getSubstyleOf());
120  try {
122  $skin->getId(),
123  $style->getId(),
124  $substyle->getId(),
125  $_GET["root_id"]
126  );
127  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
128  } catch (ilSystemStyleException $e) {
129  ilUtil::sendFailure($this->lng->txt("msg_assignment_failed") . $e->getMessage(), true);
130  }
131 
132 
133  $this->ctrl->redirect($this->getParentGui(), "assignStyle");
134  }
static writeSystemStyleCategoryAssignment( $a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Sets a substyle category assignment.
$style
Definition: example_012.php:70
$_GET["client_id"]
getSubstyleOf()
Returns the parent style of this style if set.
Class for advanced editing exception handling in ILIAS.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ setParentGui()

ilSubStyleAssignmentGUI::setParentGui (   $parent_gui)
Parameters
ilSystemStyleSettingsGUI$parent_gui

Definition at line 176 of file class.ilSubStyleAssignmentGUI.php.

References $parent_gui.

177  {
178  $this->parent_gui = $parent_gui;
179  }

Field Documentation

◆ $ctrl

ilSubStyleAssignmentGUI::$ctrl
protected

Definition at line 22 of file class.ilSubStyleAssignmentGUI.php.

◆ $lng

ilSubStyleAssignmentGUI::$lng
protected

Definition at line 27 of file class.ilSubStyleAssignmentGUI.php.

◆ $parent_gui

ilSubStyleAssignmentGUI::$parent_gui
protected

Definition at line 42 of file class.ilSubStyleAssignmentGUI.php.

Referenced by __construct(), getParentGui(), and setParentGui().

◆ $toolbar

ilSubStyleAssignmentGUI::$toolbar
protected

Definition at line 37 of file class.ilSubStyleAssignmentGUI.php.

◆ $tpl

ilSubStyleAssignmentGUI::$tpl
protected

Definition at line 32 of file class.ilSubStyleAssignmentGUI.php.

◆ $tree

ilSubStyleAssignmentGUI::$tree
protected

Definition at line 47 of file class.ilSubStyleAssignmentGUI.php.


The documentation for this class was generated from the following file: