ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSystemStyleMainGUI Class Reference

Settings UI class for system styles. More...

+ Collaboration diagram for ilSystemStyleMainGUI:

Public Member Functions

 executeCommand ()
 Main routing of the system styles. More...
 
 checkPermission (string $a_perm, bool $a_throw_exc=true)
 Checks permission for system styles. More...
 

Protected Member Functions

 executeDefaultCommand (ilSkinFactory $skin_factory, string $skin_id, string $style_id)
 
 setTabs (string $skin_id, string $style_id, string $active='')
 
 setUnderworldTabs (string $sking_id, string $active='', bool $read_only=false)
 Sets the tab correctly if one system style is open (navigational underworld opened) More...
 
 setUnderworldTitle (string $skin_id, string $style_id, string $active)
 Sets title correctly if one system style is opened. More...
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs
 
ilRbacSystem $rbacsystem
 
string $ref_id
 
ilGlobalTemplateInterface $tpl
 
ilHelpGUI $help
 
Factory $ui_factory
 
Renderer $renderer
 
ilIniFile $ilIniFile
 
ilLocatorGUI $locator
 
Services $global_screen
 
WrapperFactory $request_wrapper
 
RefineryFactory $refinery
 
ServerRequestInterface $request
 
ilToolbarGUI $toolbar
 
ilSkinFactory $skin_factory
 
FileUpload $upload
 
ilTree $tree
 
ilObjUser $user
 
ilSystemStyleMessageStack $message_stack
 

Detailed Description

Settings UI class for system styles.

Acts as main router for the systems styles and handles permissions checks, sets tabs and title as well as description of the content section. @ilCtrl_Calls ilSystemStyleMainGUI: ilSystemStyleOverviewGUI,ilSystemStyleConfigGUI,ilSystemStyleDocumentationGUI

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

Member Function Documentation

◆ checkPermission()

ilSystemStyleMainGUI::checkPermission ( string  $a_perm,
bool  $a_throw_exc = true 
)

Checks permission for system styles.

Definition at line 221 of file class.ilSystemStyleMainGUI.php.

221 : bool
222 {
223 $has_perm = $this->rbacsystem->checkAccess($a_perm, (int) $this->ref_id);
224
225 if (!$has_perm) {
226 if ($a_throw_exc) {
227 throw new ilObjectException($this->lng->txt('sty_permission_denied'));
228 }
229 return false;
230 }
231 return true;
232 }
Base exception class for object service.

References ILIAS\Repository\lng().

Referenced by executeCommand(), and executeDefaultCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilSystemStyleMainGUI::executeCommand ( )

Main routing of the system styles.

Resets ilCtrl Parameter for all subsequent generation of links.

Exceptions
ilCtrlException

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

94 : void
95 {
96 $next_class = $this->ctrl->getNextClass($this);
97
98 $this->help->setScreenIdComponent('sty');
99 $this->help->setScreenId('system_styles');
100
101 $config = new ilSystemStyleConfig();
102 $skin_factory = new ilSkinFactory($this->lng);
103
104 if ($this->request_wrapper->query()->has('skin_id') && $this->request_wrapper->query()->has('style_id')) {
105 $skin_id = $this->request_wrapper->query()->retrieve('skin_id', $this->refinery->kindlyTo()->string());
106 $style_id = $this->request_wrapper->query()->retrieve('style_id', $this->refinery->kindlyTo()->string());
107 } else {
108 $skin_id = $config->getDefaultSkinId();
109 $style_id = $config->getDefaultStyleId();
110 }
111
112 $this->ctrl->setParameterByClass(ilSystemStyleConfigGUI::class, 'skin_id', $skin_id);
113 $this->ctrl->setParameterByClass(ilSystemStyleConfigGUI::class, 'style_id', $style_id);
114 $this->ctrl->setParameterByClass(ilSystemStyleDocumentationGUI::class, 'skin_id', $skin_id);
115 $this->ctrl->setParameterByClass(ilSystemStyleDocumentationGUI::class, 'style_id', $style_id);
116
117 try {
118 switch ($next_class) {
119 case strtolower(ilSystemStyleConfigGUI::class):
120 $this->help->setSubScreenId('settings');
121 $this->checkPermission('sty_management');
122 $this->setUnderworldTabs($skin_id, 'settings');
123 $this->setUnderworldTitle($skin_id, $style_id, 'settings');
124 $system_styles_settings = new ilSystemStyleConfigGUI(
125 $this->ctrl,
126 $this->lng,
127 $this->tpl,
128 $this->tabs,
129 $this->ui_factory,
130 $this->renderer,
132 $this->request_wrapper,
133 $this->refinery,
134 $this->toolbar,
135 $this->user,
136 $this->request,
137 $this->tree,
138 $skin_id,
139 $style_id
140 );
141 $this->ctrl->forwardCommand($system_styles_settings);
142 break;
143 case strtolower(ilSystemStyleDocumentationGUI::class):
144 $this->setTabs($skin_id, $style_id);
145 $this->tabs->activateSubTab('documentation');
146 $this->help->setSubScreenId('documentation');
147 $read_only = !$this->checkPermission('sty_management', false);
148 $node_id = '';
149 if ($this->request_wrapper->query()->has('node_id')) {
150 $node_id = $this->request_wrapper->query()->retrieve(
151 'node_id',
152 $this->refinery->kindlyTo()->string()
153 );
154 }
155 $goto_link = (new ilKSDocumentationGotoLink())->generateGotoLink($node_id, $skin_id, $style_id);
156 $this->global_screen->tool()->context()->current()->addAdditionalData(
158 true
159 );
160 $this->tpl->setPermanentLink('stys', (int) $this->ref_id, $goto_link);
161 $entries = new Entries();
162 $entries->addEntriesFromArray(require ilKitchenSinkDataCollectedObjective::PATH());
163 $documentation_gui = new ilSystemStyleDocumentationGUI(
164 $this->tpl,
165 $this->ctrl,
166 $this->ui_factory,
167 $this->renderer
168 );
169 $documentation_gui->show($entries, $node_id);
170 break;
171 case strtolower(ilSystemStyleOverviewGUI::class):
172 default:
173 $this->executeDefaultCommand($skin_factory, $skin_id, $style_id);
174 break;
175 }
176 } catch (ilObjectException $e) {
177 $this->message_stack->addMessage(new ilSystemStyleMessage(
178 $e->getMessage(),
180 ));
181 $this->message_stack->sendMessages();
182 $this->executeDefaultCommand($skin_factory, $skin_id, $style_id);
183 }
184 }
renderer()
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Renders the Overview of the Examples in the Administration.
executeDefaultCommand(ilSkinFactory $skin_factory, string $skin_id, string $style_id)
setUnderworldTabs(string $sking_id, string $active='', bool $read_only=false)
Sets the tab correctly if one system style is open (navigational underworld opened)
setUnderworldTitle(string $skin_id, string $style_id, string $active)
Sets title correctly if one system style is opened.
checkPermission(string $a_perm, bool $a_throw_exc=true)
Checks permission for system styles.
setTabs(string $skin_id, string $style_id, string $active='')

References Vendor\Package\$e, $ref_id, $skin_factory, checkPermission(), ILIAS\Repository\ctrl(), executeDefaultCommand(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), renderer(), setTabs(), setUnderworldTabs(), setUnderworldTitle(), ilSystemStyleDocumentationGUI\SHOW_TREE, ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ilSystemStyleMessage\TYPE_ERROR, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ executeDefaultCommand()

ilSystemStyleMainGUI::executeDefaultCommand ( ilSkinFactory  $skin_factory,
string  $skin_id,
string  $style_id 
)
protected

Definition at line 186 of file class.ilSystemStyleMainGUI.php.

186 : void
187 {
188 $this->help->setSubScreenId('overview');
189 $this->setTabs($skin_id, $style_id);
190 $this->tabs->activateSubTab('overview');
191 $this->checkPermission('visible,read');
192 $read_only = !$this->checkPermission('sty_write_system', false);
193 $management_enabled = true;//$this->checkPermission('sty_management', false);
194 $system_styles_overview = new ilSystemStyleOverviewGUI(
195 $this->ctrl,
196 $this->lng,
197 $this->tpl,
198 $this->ui_factory,
199 $this->renderer,
200 $this->request_wrapper,
201 $this->toolbar,
202 $this->refinery,
203 $skin_factory,
204 $this->upload,
205 $this->tabs,
206 $this->help,
207 $skin_id,
208 $style_id,
209 $this->ref_id,
210 $read_only,
211 $management_enabled
212 );
213
214 $this->ctrl->forwardCommand($system_styles_overview);
215 }

References checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), renderer(), setTabs(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\upload().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilSystemStyleMainGUI::setTabs ( string  $skin_id,
string  $style_id,
string  $active = '' 
)
protected

Definition at line 234 of file class.ilSystemStyleMainGUI.php.

234 {
235 $this->ctrl->setParameterByClass(ilSystemStyleDocumentationGUI::class, 'skin_id', $skin_id);
236 $this->ctrl->setParameterByClass(ilSystemStyleDocumentationGUI::class, 'style_id', $style_id);
237
238 $this->tabs->addSubTab(
239 'overview',
240 $this->lng->txt('overview'),
241 $this->ctrl->getLinkTargetByClass(self::class), 'documentation');
242 $this->tabs->addSubTab('documentation',
243 $this->lng->txt('documentation'),
244 $this->ctrl->getLinkTargetByClass(ilSystemStyleDocumentationGUI::class, 'entries')
245 );
246
247 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by executeCommand(), and executeDefaultCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUnderworldTabs()

ilSystemStyleMainGUI::setUnderworldTabs ( string  $sking_id,
string  $active = '',
bool  $read_only = false 
)
protected

Sets the tab correctly if one system style is open (navigational underworld opened)

Exceptions
ilCtrlException

Definition at line 252 of file class.ilSystemStyleMainGUI.php.

252 : void
253 {
254 $this->tabs->clearTargets();
255
256 if ($read_only) {
257 $this->locator->clearItems();
258 $this->tpl->setLocator();
259 return;
260 }
261
262 $this->help->setScreenIdComponent('sty');
263 $this->help->setScreenId('system_styles');
264 $this->tabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this));
265
266 $this->tabs->addTab(
267 'settings',
268 $this->lng->txt('settings'),
269 $this->ctrl->getLinkTargetByClass('ilsystemstyleconfiggui')
270 );
271
272 $this->tabs->activateTab($active);
273 }

References ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\locator(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUnderworldTitle()

ilSystemStyleMainGUI::setUnderworldTitle ( string  $skin_id,
string  $style_id,
string  $active 
)
protected

Sets title correctly if one system style is opened.

Exceptions
ilSystemStyleException

Definition at line 279 of file class.ilSystemStyleMainGUI.php.

279 : void
280 {
281 $skin = $this->skin_factory->skinStyleContainerFromId($skin_id, $this->message_stack)->getSkin();
282 $style = $skin->getStyle($style_id);
283
284 $this->tpl->setTitle($style->getName());
285 if ($style->isSubstyle()) {
286 $this->tpl->setDescription(
287 $this->lng->txt('settings_of_substyle') . " '" . $style->getName() . "' " .
288 $this->lng->txt('of_parent') . " '" . $skin->getStyle($style->getSubstyleOf())->getName() . "' " .
289 $this->lng->txt('from_skin') . ' ' . $skin->getName()
290 );
291 } else {
292 $this->tpl->setDescription(
293 $this->lng->txt('settings_of_style') . " '" . $style->getName() . "' " .
294 $this->lng->txt('from_skin') . " '" . $skin->getName() . "'"
295 );
296 }
297 }

References ILIAS\Repository\lng().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilSystemStyleMainGUI::$ctrl
protected

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

◆ $global_screen

Services ilSystemStyleMainGUI::$global_screen
protected

Definition at line 48 of file class.ilSystemStyleMainGUI.php.

◆ $help

ilHelpGUI ilSystemStyleMainGUI::$help
protected

Definition at line 43 of file class.ilSystemStyleMainGUI.php.

◆ $ilIniFile

ilIniFile ilSystemStyleMainGUI::$ilIniFile
protected

Definition at line 46 of file class.ilSystemStyleMainGUI.php.

◆ $lng

ilLanguage ilSystemStyleMainGUI::$lng
protected

Definition at line 38 of file class.ilSystemStyleMainGUI.php.

◆ $locator

ilLocatorGUI ilSystemStyleMainGUI::$locator
protected

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

◆ $message_stack

ilSystemStyleMessageStack ilSystemStyleMainGUI::$message_stack
protected

Definition at line 57 of file class.ilSystemStyleMainGUI.php.

◆ $rbacsystem

ilRbacSystem ilSystemStyleMainGUI::$rbacsystem
protected

Definition at line 40 of file class.ilSystemStyleMainGUI.php.

◆ $ref_id

string ilSystemStyleMainGUI::$ref_id
protected

Definition at line 41 of file class.ilSystemStyleMainGUI.php.

Referenced by executeCommand().

◆ $refinery

RefineryFactory ilSystemStyleMainGUI::$refinery
protected

Definition at line 50 of file class.ilSystemStyleMainGUI.php.

◆ $renderer

Renderer ilSystemStyleMainGUI::$renderer
protected

Definition at line 45 of file class.ilSystemStyleMainGUI.php.

◆ $request

ServerRequestInterface ilSystemStyleMainGUI::$request
protected

Definition at line 51 of file class.ilSystemStyleMainGUI.php.

◆ $request_wrapper

WrapperFactory ilSystemStyleMainGUI::$request_wrapper
protected

Definition at line 49 of file class.ilSystemStyleMainGUI.php.

◆ $skin_factory

ilSkinFactory ilSystemStyleMainGUI::$skin_factory
protected

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

Referenced by executeCommand().

◆ $tabs

ilTabsGUI ilSystemStyleMainGUI::$tabs
protected

Definition at line 39 of file class.ilSystemStyleMainGUI.php.

◆ $toolbar

ilToolbarGUI ilSystemStyleMainGUI::$toolbar
protected

Definition at line 52 of file class.ilSystemStyleMainGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilSystemStyleMainGUI::$tpl
protected

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

◆ $tree

ilTree ilSystemStyleMainGUI::$tree
protected

Definition at line 55 of file class.ilSystemStyleMainGUI.php.

◆ $ui_factory

Factory ilSystemStyleMainGUI::$ui_factory
protected

Definition at line 44 of file class.ilSystemStyleMainGUI.php.

◆ $upload

FileUpload ilSystemStyleMainGUI::$upload
protected

Definition at line 54 of file class.ilSystemStyleMainGUI.php.

◆ $user

ilObjUser ilSystemStyleMainGUI::$user
protected

Definition at line 56 of file class.ilSystemStyleMainGUI.php.


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