ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
64  }
global $DIC

Member Function Documentation

◆ addAssignment()

ilSubStyleAssignmentGUI::addAssignment ( )

Add style category assignment.

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

References $_GET, and getParentGui().

89  {
90 
91  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
92  $exp = new ilSearchRootSelector(
93  $this->ctrl->getLinkTarget($this->getParentGui(),'addStyleCatAssignment'));
94  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $this->tree->readRootId());
95  $exp->setExpandTarget($this->ctrl->getLinkTarget($this->getParentGui(),'addAssignment'));
96  $exp->setTargetClass(get_class($this->getParentGui()));
97  $exp->setCmd('saveAssignment');
98  $exp->setClickableTypes(["cat"]);
99 
100  $exp->setOutput(0);
101  $this->tpl->setContent($exp->getOutput());
102  }
$_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

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

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

72  {
73  $style = $skin->getStyle($substyle->getSubstyleOf());
74 
75  $this->toolbar->addFormButton($this->lng->txt("sty_add_assignment"), "addAssignment");
76  $this->toolbar->setFormAction($this->ctrl->getFormAction($this->getParentGui()));
77 
78  $tab = new ilSysStyleCatAssignmentTableGUI($this->getParentGui(), "assignStyleToCat",$skin->getId(), $style->getId(),
79  $substyle->getId());
80 
81  $this->tpl->setContent($tab->getHTML());
82  }
$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 133 of file class.ilSubStyleAssignmentGUI.php.

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

134  {
135  $style = $skin->getStyle($substyle->getSubstyleOf());
136 
137 
138  if (is_array($_POST["id"]))
139  {
140  foreach ($_POST["id"] as $id)
141  {
142  $id_arr = explode(":", $id);
144  $substyle->getId(), $id_arr[1]);
145  }
146  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
147  }else{
148  ilUtil::sendFailure($this->lng->txt("no_style_selected"), true);
149  }
150 
151  $this->ctrl->redirect($this->getParentGui(), "assignStyle");
152  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$style
Definition: example_012.php:70
getSubstyleOf()
Returns the parent style of this style if set.
static deleteSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Deletes all sub style category assignment of a system style.
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 157 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 111 of file class.ilSubStyleAssignmentGUI.php.

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

112  {
113  $style = $skin->getStyle($substyle->getSubstyleOf());
114  try{
116  $substyle->getId(), $_GET["root_id"]);
117  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
118  }catch(ilSystemStyleException $e){
119  ilUtil::sendFailure($this->lng->txt("msg_assignment_failed").$e->getMessage(), true);
120 
121  }
122 
123 
124  $this->ctrl->redirect($this->getParentGui(), "assignStyle");
125  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$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.
static writeSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Sets a substyle category assignment.
+ Here is the call graph for this function:

◆ setParentGui()

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

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

References $parent_gui.

166  {
167  $this->parent_gui = $parent_gui;
168  }

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: