ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSystemStyleMainGUI Class Reference

Settings UI class for system styles. More...

+ Collaboration diagram for ilSystemStyleMainGUI:

Public Member Functions

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

Protected Member Functions

 setUnderworldTabs ($active="")
 Sets the tab correctly if one system style is open (navigational underworld opened) More...
 
 setUnderworldTitle ()
 Sets title correctly if one system style is opened. More...
 

Protected Attributes

 $ctrl
 
 $lng
 
 $DIC
 
 $tabs
 
 $rbacsystem
 
 $ref_id
 
 $tpl
 

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.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

@ilCtrl_Calls ilSystemStyleMainGUI: ilSystemStyleOverviewGUI,ilSystemStyleSettingsGUI @ilCtrl_Calls ilSystemStyleMainGUI: ilSystemStyleLessGUI,ilSystemStyleIconsGUI,ilSystemStyleDocumentationGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleMainGUI::__construct ( )

Constructor.

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

63 {
64 global $DIC;
65
66 $this->ctrl = $DIC->ctrl();
67 $this->lng = $DIC->language();
68 $this->tabs = $DIC->tabs();
69 $this->rbacsystem = $DIC->rbac()->system();
70 $this->tpl = $DIC["tpl"];
71
72 $this->ref_id = (int) $_GET["ref_id"];
73 }
$_GET["client_id"]

References $_GET, and $DIC.

Member Function Documentation

◆ checkPermission()

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

Checks permission for system styles.

Permissions work on two levels, ordinary rbac and the 'enable_system_styles_management' setting in the tools section of the ilias.ini.php

Parameters
$a_perm
bool | true$a_throw_exc
Returns
bool
Exceptions
ilObjectException

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

160 {
161 global $ilIliasIniFile;
162
163 $has_perm = true;
164
166 if($a_perm == "sty_management"){
167 $has_perm = $ilIliasIniFile->readVariable("tools","enable_system_styles_management")== "1" ? true:false;
168 $a_perm = "sty_write_system";
169 if($has_perm && ! is_writable($config->getCustomizingSkinPath())){
170 ilUtil::sendFailure($this->lng->txt("enable_system_styles_management_no_write_perm"));
171 $has_perm = false;
172 }
173 }
174
175 if($has_perm){
176 $has_perm = $this->rbacsystem->checkAccess($a_perm, $this->ref_id);
177 }
178
179 if (!$has_perm)
180 {
181 if ($a_throw_exc)
182 {
183 include_once "Services/Object/exceptions/class.ilObjectException.php";
184 throw new ilObjectException($this->lng->txt("sty_permission_denied"));
185 }
186 return false;
187 }
188 return $has_perm;
189 }
Base exception class for object service.
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ilIliasIniFile

References $config, $ilIliasIniFile, and ilUtil\sendFailure().

Referenced by executeCommand().

+ 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
ilObjectException

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

83 {
84 $next_class = $this->ctrl->getNextClass($this);
85
86 $this->ctrl->setParameterByClass('ilsystemstylesettingsgui','skin_id',$_GET["skin_id"]);
87 $this->ctrl->setParameterByClass('ilsystemstylesettingsgui','style_id',$_GET["style_id"]);
88 $this->ctrl->setParameterByClass('ilsystemstylelessgui','skin_id',$_GET["skin_id"]);
89 $this->ctrl->setParameterByClass('ilsystemstylelessgui','style_id',$_GET["style_id"]);
90 $this->ctrl->setParameterByClass('ilsystemstyleiconsgui','skin_id',$_GET["skin_id"]);
91 $this->ctrl->setParameterByClass('ilsystemstyleiconsgui','style_id',$_GET["style_id"]);
92 $this->ctrl->setParameterByClass('ilsystemstyledocumentationgui','skin_id',$_GET["skin_id"]);
93 $this->ctrl->setParameterByClass('ilsystemstyledocumentationgui','style_id',$_GET["style_id"]);
94
95 try{
96 switch ($next_class)
97 {
98
99 case "ilsystemstylesettingsgui":
100 $this->checkPermission("sty_management");
101 $this->setUnderworldTabs('settings');
102 $this->setUnderworldTitle();
103 include_once("Settings/class.ilSystemStyleSettingsGUI.php");
104 $system_styles_settings = new ilSystemStyleSettingsGUI();
105 $this->ctrl->forwardCommand($system_styles_settings);
106 break;
107 case "ilsystemstylelessgui":
108 $this->checkPermission("sty_management");
109 $this->setUnderworldTabs('less');
110 $this->setUnderworldTitle();
111 include_once("Less/class.ilSystemStyleLessGUI.php");
112 $system_styles_less = new ilSystemStyleLessGUI();
113 $this->ctrl->forwardCommand($system_styles_less);
114 break;
115 case "ilsystemstyleiconsgui":
116 $this->checkPermission("sty_management");
117 $this->setUnderworldTabs('icons');
118 $this->setUnderworldTitle();
119 include_once("Icons/class.ilSystemStyleIconsGUI.php");
120 $system_styles_icons = new ilSystemStyleIconsGUI();
121 $this->ctrl->forwardCommand($system_styles_icons);
122 break;
123 case "ilsystemstyledocumentationgui":
124 $this->checkPermission("sty_management");
125 $this->setUnderworldTabs('documentation');
126 $this->setUnderworldTitle();
127 include_once("Documentation/class.ilSystemStyleDocumentationGUI.php");
128 $system_styles_documentation = new ilSystemStyleDocumentationGUI();
129 $this->ctrl->forwardCommand($system_styles_documentation);
130 break;
131 case "ilsystemstyleoverviewgui":
132 default:
133 $this->checkPermission("visible,read");
134 include_once("Overview/class.ilSystemStyleOverviewGUI.php");
135 $system_styles_overview = new ilSystemStyleOverviewGUI(!$this->checkPermission("sty_write_system",false)
136 ,$this->checkPermission("sty_management",false));
137 $this->ctrl->forwardCommand($system_styles_overview);
138 break;
139 }
140 }catch(ilObjectException $e){
141 ilUtil::sendFailure($e->getMessage());
142 $this->checkPermission("visible,read");
143 include_once("Overview/class.ilSystemStyleOverviewGUI.php");
144 $this->ctrl->setCmd("");
145 $system_styles_overview = new ilSystemStyleOverviewGUI(!$this->checkPermission("sty_write_system",false),$this->checkPermission("sty_management",false));
146 $this->ctrl->forwardCommand($system_styles_overview);
147 }
148 }
checkPermission($a_perm, $a_throw_exc=true)
Checks permission for system styles.
setUnderworldTitle()
Sets title correctly if one system style is opened.
setUnderworldTabs($active="")
Sets the tab correctly if one system style is open (navigational underworld opened)

References $_GET, checkPermission(), ilUtil\sendFailure(), setUnderworldTabs(), and setUnderworldTitle().

+ Here is the call graph for this function:

◆ setUnderworldTabs()

ilSystemStyleMainGUI::setUnderworldTabs (   $active = "")
protected

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

Parameters
string$active

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

196 {
197 $this->tabs->clearTargets();
198
199 $this->tabs->setBackTarget($this->lng->txt("back"),$this->ctrl->getLinkTarget($this));
200 $this->tabs->addTab('settings', $this->lng->txt('settings'), $this->ctrl->getLinkTargetByClass('ilsystemstylesettingsgui'));
201 $this->tabs->addTab('less', $this->lng->txt('less'), $this->ctrl->getLinkTargetByClass('ilsystemstylelessgui'));
202 $this->tabs->addTab('icons', $this->lng->txt('icons'), $this->ctrl->getLinkTargetByClass('ilsystemstyleiconsgui'));
203 $this->tabs->addTab('documentation', $this->lng->txt('documentation'), $this->ctrl->getLinkTargetByClass('ilsystemstyledocumentationgui'));
204
205 $this->tabs->activateTab($active);
206 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ setUnderworldTitle()

ilSystemStyleMainGUI::setUnderworldTitle ( )
protected

Sets title correctly if one system style is opened.

Exceptions
ilSystemStyleException

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

214 {
215 $skin_id = $_GET["skin_id"];
216 $style_id = $_GET["style_id"];
217
218 $skin = ilSystemStyleSkinContainer::generateFromId($skin_id)->getSkin();
219 $style = $skin->getStyle($style_id);
220
221 $this->tpl->setTitle($style->getName());
222 if($style->isSubstyle()){
223 $this->tpl->setDescription($this->lng->txt("settings_of_substyle")." '".$style->getName()."' ".
224 $this->lng->txt("of_parent")." '".$skin->getStyle($style->getSubstyleOf())->getName()."' ".
225 $this->lng->txt("from_skin")." ".$skin->getName()
226 );
227 }else{
228 $this->tpl->setDescription($this->lng->txt("settings_of_style")." '".$style->getName()."' ".
229 $this->lng->txt("from_skin")." '".$skin->getName()."'"
230 );
231 }
232 }
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
$style
Definition: example_012.php:70

References $_GET, $style, and ilSystemStyleSkinContainer\generateFromId().

Referenced by executeCommand().

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

Field Documentation

◆ $ctrl

ilSystemStyleMainGUI::$ctrl
protected

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

◆ $DIC

ilSystemStyleMainGUI::$DIC
protected

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

Referenced by __construct().

◆ $lng

ilSystemStyleMainGUI::$lng
protected

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

◆ $rbacsystem

ilSystemStyleMainGUI::$rbacsystem
protected

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

◆ $ref_id

ilSystemStyleMainGUI::$ref_id
protected

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

◆ $tabs

ilSystemStyleMainGUI::$tabs
protected

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

◆ $tpl

ilSystemStyleMainGUI::$tpl
protected

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


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