ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSystemStyleMainGUI Class Reference

Settings UI class for system styles. More...

+ Collaboration diagram for ilSystemStyleMainGUI:

Public Member Functions

 checkPermission ($a_perm, $a_throw_exc=true)
 Checks permission for system styles. More...
 

Protected Member Functions

 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$

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

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

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 216 of file class.ilSystemStyleMainGUI.php.

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

217  {
218  global $ilIliasIniFile;
219 
220  $has_perm = true;
221 
223  if ($a_perm == "sty_management") {
224  $has_perm = $ilIliasIniFile->readVariable("tools", "enable_system_styles_management")== "1" ? true:false;
225  $a_perm = "sty_write_system";
226  if ($has_perm && !is_writable($config->getCustomizingSkinPath())) {
227  ilUtil::sendFailure($this->lng->txt("enable_system_styles_management_no_write_perm"));
228  $has_perm = false;
229  }
230  }
231 
232  if ($has_perm) {
233  $has_perm = $this->rbacsystem->checkAccess($a_perm, $this->ref_id);
234  }
235 
236  if (!$has_perm) {
237  if ($a_throw_exc) {
238  include_once "Services/Object/exceptions/class.ilObjectException.php";
239  throw new ilObjectException($this->lng->txt("sty_permission_denied"));
240  }
241  return false;
242  }
243  return $has_perm;
244  }
Base exception class for object service.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
$ilIliasIniFile
+ Here is the call graph for this function:

◆ setUnderworldTitle()

ilSystemStyleMainGUI::setUnderworldTitle ( )
protected

Sets title correctly if one system style is opened.

Exceptions
ilSystemStyleException

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

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

284  {
285  $skin_id = $_GET["skin_id"];
286  $style_id = $_GET["style_id"];
287 
288  $skin = ilSystemStyleSkinContainer::generateFromId($skin_id)->getSkin();
289  $style = $skin->getStyle($style_id);
290 
291  $this->tpl->setTitle($style->getName());
292  if ($style->isSubstyle()) {
293  $this->tpl->setDescription(
294  $this->lng->txt("settings_of_substyle") . " '" . $style->getName() . "' " .
295  $this->lng->txt("of_parent") . " '" . $skin->getStyle($style->getSubstyleOf())->getName() . "' " .
296  $this->lng->txt("from_skin") . " " . $skin->getName()
297  );
298  } else {
299  $this->tpl->setDescription(
300  $this->lng->txt("settings_of_style") . " '" . $style->getName() . "' " .
301  $this->lng->txt("from_skin") . " '" . $skin->getName() . "'"
302  );
303  }
304  }
$style
Definition: example_012.php:70
$_GET["client_id"]
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
+ Here is the call 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.

◆ $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: