ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSubStyleAssignmentGUI Class Reference
+ Collaboration diagram for ilSubStyleAssignmentGUI:

Public Member Functions

 __construct (ilSystemStyleConfigGUI $parent_gui, ilCtrl $ctrl, ilLanguage $lng, ilGlobalTemplateInterface $tpl, ilToolbarGUI $toolbar, ilTree $tree, WrapperFactory $request_wrapper, Refinery $refinery, \ILIAS\UI\Factory $ui_factory)
 
 assignStyle (ilSkin $skin, ilSkinStyle $substyle)
 Assign styles to categories. More...
 
 addAssignment ()
 Add style category assignment. More...
 
 saveAssignment (ilSkin $skin, ilSkinStyle $substyle)
 Save style category assignment. More...
 
 deleteAssignments (ilSkin $skin, ilSkinStyle $substyle)
 Delete system style to category assignments. More...
 
 getParentGui ()
 
 setParentGui (ilSystemStyleConfigGUI $parent_gui)
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilToolbarGUI $toolbar
 
ilSystemStyleConfigGUI $parent_gui
 
ilTree $tree
 
WrapperFactory $request_wrapper
 
Refinery $refinery
 
ILIAS UI Factory $ui_factory
 

Private Attributes

ilSystemStyleMessageStack $message_stack
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSubStyleAssignmentGUI::__construct ( ilSystemStyleConfigGUI  $parent_gui,
ilCtrl  $ctrl,
ilLanguage  $lng,
ilGlobalTemplateInterface  $tpl,
ilToolbarGUI  $toolbar,
ilTree  $tree,
WrapperFactory  $request_wrapper,
Refinery  $refinery,
\ILIAS\UI\Factory  $ui_factory 
)

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

References $ctrl, $lng, $parent_gui, $refinery, $request_wrapper, $toolbar, $tpl, $tree, $ui_factory, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\toolbar().

47  {
48  $this->ctrl = $ctrl;
49  $this->lng = $lng;
50  $this->toolbar = $toolbar;
51  $this->tpl = $tpl;
52  $this->parent_gui = $parent_gui;
53  $this->tree = $tree;
54  $this->request_wrapper = $request_wrapper;
55  $this->refinery = $refinery;
56  $this->ui_factory = $ui_factory;
57  $this->message_stack = new ilSystemStyleMessageStack($this->tpl);
58  }
Used to stack messages to be shown to the user.
+ Here is the call graph for this function:

Member Function Documentation

◆ addAssignment()

ilSubStyleAssignmentGUI::addAssignment ( )

Add style category assignment.

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

References ILIAS\Repository\ctrl(), getParentGui(), and ILIAS\Repository\refinery().

87  : void
88  {
89  $exp = new ilSearchRootSelector(
90  $this->ctrl->getLinkTarget($this->getParentGui(), 'addStyleCatAssignment')
91  );
92  $expand_id = $this->tree->readRootId();
93  if ($this->request_wrapper->query()->has('search_root_expand')) {
94  $expand_id = $this->request_wrapper->query()->retrieve(
95  'search_root_expand',
96  $this->refinery->kindlyTo()->string()
97  );
98  }
99  $exp->setExpand($expand_id);
100  $exp->setExpandTarget($this->ctrl->getLinkTarget($this->getParentGui(), 'addAssignment'));
101  $exp->setTargetClass(get_class($this->getParentGui()));
102  $exp->setCmd('saveAssignment');
103  $exp->setClickableTypes(['cat']);
104 
105  $exp->setOutput(0);
106  $this->tpl->setContent($exp->getOutput());
107  }
+ Here is the call graph for this function:

◆ assignStyle()

ilSubStyleAssignmentGUI::assignStyle ( ilSkin  $skin,
ilSkinStyle  $substyle 
)

Assign styles to categories.

Exceptions
ilSystemStyleException

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

References ILIAS\Repository\ctrl(), ilSkinStyle\getId(), ilSkin\getId(), getParentGui(), ilSkin\getStyle(), ilSkinStyle\getSubstyleOf(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

64  : void
65  {
66  $style = $skin->getStyle($substyle->getSubstyleOf());
67 
68  $this->toolbar->addComponent($this->ui_factory->button()->standard(
69  $this->lng->txt('sty_add_assignment'),
70  $this->ctrl->getLinkTarget($this->parent_gui, 'addAssignment')
71  ));
72 
74  $this->getParentGui(),
75  'assignStyleToCat',
76  $skin->getId(),
77  $style->getId(),
78  $substyle->getId()
79  );
80 
81  $this->tpl->setContent($tab->getHTML());
82  }
getStyle(string $id)
TableGUI class for system style to category assignments.
getSubstyleOf()
Returns the parent style of this style if set.
+ Here is the call graph for this function:

◆ deleteAssignments()

ilSubStyleAssignmentGUI::deleteAssignments ( ilSkin  $skin,
ilSkinStyle  $substyle 
)

Delete system style to category assignments.

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

References $id, ILIAS\Repository\ctrl(), ilSystemStyleSettings\deleteSystemStyleCategoryAssignment(), ilSkinStyle\getId(), ilSkin\getId(), getParentGui(), ilSkin\getStyle(), ilSkinStyle\getSubstyleOf(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilSystemStyleMessage\TYPE_ERROR.

138  : void
139  {
140  $style = $skin->getStyle($substyle->getSubstyleOf());
141 
142  if ($this->request_wrapper->post()->has('id')) {
143  $ids = $this->request_wrapper->post()->retrieve('id', $this->refinery->identity());
144  foreach ($ids as $id) {
145  $id_arr = explode(':', $id);
147  $skin->getId(),
148  $style->getId(),
149  $substyle->getId(),
150  $id_arr[1]
151  );
152  }
153  $this->message_stack->addMessage(new ilSystemStyleMessage($this->lng->txt('msg_obj_modified')));
154  } else {
155  $this->message_stack->addMessage(new ilSystemStyleMessage(
156  $this->lng->txt('no_style_selected'),
158  ));
159  }
160  $this->message_stack->sendMessages();
161  $this->ctrl->redirect($this->getParentGui(), 'assignStyle');
162  }
getStyle(string $id)
static deleteSystemStyleCategoryAssignment(string $a_skin_id, string $a_style_id, string $a_substyle, string $a_ref_id)
Deletes all sub style category assignment of a system style.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getSubstyleOf()
Returns the parent style of this style if set.
+ Here is the call graph for this function:

◆ getParentGui()

ilSubStyleAssignmentGUI::getParentGui ( )

Definition at line 164 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 ( ilSkin  $skin,
ilSkinStyle  $substyle 
)

Save style category assignment.

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

References Vendor\Package\$e, $message, ILIAS\Repository\ctrl(), ilSkinStyle\getId(), ilSkin\getId(), getParentGui(), ilSkin\getStyle(), ilSkinStyle\getSubstyleOf(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilSystemStyleMessage\TYPE_ERROR, and ilSystemStyleSettings\writeSystemStyleCategoryAssignment().

112  : void
113  {
114  $style = $skin->getStyle($substyle->getSubstyleOf());
115  try {
116  $root_id = $this->request_wrapper->query()->retrieve(
117  'root_id',
118  $this->refinery->kindlyTo()->string()
119  );
121  $skin->getId(),
122  $style->getId(),
123  $substyle->getId(),
124  $root_id
125  );
126  $this->message_stack->addMessage(new ilSystemStyleMessage($this->lng->txt('msg_obj_modified')));
127  } catch (ilSystemStyleException $e) {
128  $message = $this->lng->txt('msg_assignment_failed') . $e->getMessage();
129  $this->message_stack->addMessage(new ilSystemStyleMessage($message, ilSystemStyleMessage::TYPE_ERROR));
130  }
131  $this->message_stack->sendMessages();
132  $this->ctrl->redirect($this->getParentGui(), 'assignStyle');
133  }
static writeSystemStyleCategoryAssignment(string $a_skin_id, string $a_style_id, string $a_substyle, string $a_ref_id)
Sets a substyle category assignment.
getStyle(string $id)
$message
Definition: xapiexit.php:31
getSubstyleOf()
Returns the parent style of this style if set.
+ Here is the call graph for this function:

◆ setParentGui()

ilSubStyleAssignmentGUI::setParentGui ( ilSystemStyleConfigGUI  $parent_gui)

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

References $parent_gui.

169  : void
170  {
171  $this->parent_gui = $parent_gui;
172  }

Field Documentation

◆ $ctrl

ilCtrl ilSubStyleAssignmentGUI::$ctrl
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilSubStyleAssignmentGUI::$lng
protected

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

Referenced by __construct().

◆ $message_stack

ilSystemStyleMessageStack ilSubStyleAssignmentGUI::$message_stack
private

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

◆ $parent_gui

ilSystemStyleConfigGUI ilSubStyleAssignmentGUI::$parent_gui
protected

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

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

◆ $refinery

Refinery ilSubStyleAssignmentGUI::$refinery
protected

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

Referenced by __construct().

◆ $request_wrapper

WrapperFactory ilSubStyleAssignmentGUI::$request_wrapper
protected

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

Referenced by __construct().

◆ $toolbar

ilToolbarGUI ilSubStyleAssignmentGUI::$toolbar
protected

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

Referenced by __construct().

◆ $tpl

ilGlobalTemplateInterface ilSubStyleAssignmentGUI::$tpl
protected

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

Referenced by __construct().

◆ $tree

ilTree ilSubStyleAssignmentGUI::$tree
protected

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

Referenced by __construct().

◆ $ui_factory

ILIAS UI Factory ilSubStyleAssignmentGUI::$ui_factory
protected

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

Referenced by __construct().


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