ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAccessKey Class Reference

Access key handling. More...

+ Collaboration diagram for ilAccessKey:

Static Public Member Functions

static getFunctionName ($a_func_id)
 Get Function Name. More...
 
static getComponentNames ($a_func_id)
 Get Component Names. More...
 
static getKeys ($lang_key="0", $a_ignore_default=false)
 Get access keys for language. More...
 
static getKey ($a_func_id, $lang_key="0", $a_ignore_default=false)
 Get single access key. More...
 
static writeKeys ($a_keys, $a_lang_key="0")
 Write keys. More...
 

Data Fields

const NEXT = 1
 
const PREVIOUS = 2
 
const DELETE = 3
 
const LAST_VISITED = 4
 
const TREE_ON = 5
 
const TREE_OFF = 6
 
const REPLY = 7
 
const FORWARD_MAIL = 8
 
const MARK_ALL_READ = 9
 
const PERSONAL_DESKTOP = 10
 

Static Public Attributes

static $func_def
 

Static Private Member Functions

static getAllKeysEmpty ()
 Get all function ids with empty keys. More...
 

Detailed Description

Access key handling.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilAccessKey.php.

Member Function Documentation

◆ getAllKeysEmpty()

static ilAccessKey::getAllKeysEmpty ( )
staticprivate

Get all function ids with empty keys.

Returns
array function id => empty string

Definition at line 63 of file class.ilAccessKey.php.

References $c, and $f.

Referenced by getKeys().

64  {
65  $empty_keys = array();
66  foreach (self::$func_def as $f => $c) {
67  $empty_keys[$f] = "";
68  }
69 
70  return $empty_keys;
71  }
+ Here is the caller graph for this function:

◆ getComponentNames()

static ilAccessKey::getComponentNames (   $a_func_id)
static

Get Component Names.

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

References $c, $DIC, and $lng.

Referenced by ilAccessKeyTableGUI\fillRow().

89  {
90  global $DIC;
91 
92  $lng = $DIC->language();
93 
94  $c_str = $lim = "";
95  foreach (self::$func_def[$a_func_id]["component"] as $c) {
96  $c_str .= $lim . $lng->txt("acc_comp_" . $c);
97  $lim = ", ";
98  }
99  return $c_str;
100  }
global $DIC
Definition: saml.php:7
$lng
+ Here is the caller graph for this function:

◆ getFunctionName()

static ilAccessKey::getFunctionName (   $a_func_id)
static

Get Function Name.

Definition at line 76 of file class.ilAccessKey.php.

References $DIC, and $lng.

Referenced by ilAccessKeyTableGUI\fillRow().

77  {
78  global $DIC;
79 
80  $lng = $DIC->language();
81 
82  return $lng->txt(self::$func_def[$a_func_id]["lang"]);
83  }
global $DIC
Definition: saml.php:7
$lng
+ Here is the caller graph for this function:

◆ getKey()

static ilAccessKey::getKey (   $a_func_id,
  $lang_key = "0",
  $a_ignore_default = false 
)
static

Get single access key.

Parameters
stringlang key, "0" means default values

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

References $DIC, $ilDB, and $key.

Referenced by ilAccessKeyGUI\getAttribute(), and ilButtonBase\renderAttributes().

139  {
140  global $DIC;
141 
142  $ilDB = $DIC->database();
143 
144  $key = "";
145 
146  // get defaults
147  if ($lang_key != "0" && !$a_ignore_default) {
148  $key = ilAccessKey::getKey($a_func_id);
149  }
150 
151  // get keys of selected language
152  $set = $ilDB->query(
153  "SELECT * FROM acc_access_key " .
154  " WHERE lang_key = " . $ilDB->quote($lang_key, "text") .
155  " AND function_id = " . $ilDB->quote($a_func_id, "integer")
156  );
157  if ($rec = $ilDB->fetchAssoc($set)) {
158  $key = $rec["access_key"];
159  }
160 
161  return $key;
162  }
global $DIC
Definition: saml.php:7
static getKey($a_func_id, $lang_key="0", $a_ignore_default=false)
Get single access key.
global $ilDB
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ getKeys()

static ilAccessKey::getKeys (   $lang_key = "0",
  $a_ignore_default = false 
)
static

Get access keys for language.

Parameters
stringlang key, "0" means default values

Definition at line 108 of file class.ilAccessKey.php.

References $DIC, $ilDB, $keys, and getAllKeysEmpty().

Referenced by ilAccessKeyTableGUI\__construct().

109  {
110  global $DIC;
111 
112  $ilDB = $DIC->database();
113 
115 
116  // get defaults
117  if ($lang_key != "0" && !$a_ignore_default) {
119  }
120 
121  // get keys of selected language
122  $set = $ilDB->query(
123  "SELECT * FROM acc_access_key " .
124  " WHERE lang_key = " . $ilDB->quote($lang_key, "text")
125  );
126  while ($rec = $ilDB->fetchAssoc($set)) {
127  $keys[$rec["function_id"]] = $rec["access_key"];
128  }
129 
130  return $keys;
131  }
static getAllKeysEmpty()
Get all function ids with empty keys.
global $DIC
Definition: saml.php:7
static getKeys($lang_key="0", $a_ignore_default=false)
Get access keys for language.
$keys
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeKeys()

static ilAccessKey::writeKeys (   $a_keys,
  $a_lang_key = "0" 
)
static

Write keys.

Parameters
arrayfunction ids => keys

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

References $DIC, and $ilDB.

Referenced by ilObjAccessibilitySettingsGUI\saveAccessKeys().

170  {
171  global $DIC;
172 
173  $ilDB = $DIC->database();
174 
175  $ilDB->manipulate(
176  "DELETE FROM acc_access_key WHERE " .
177  "lang_key = " . $ilDB->quote($a_lang_key, "text")
178  );
179 
180  foreach ($a_keys as $func_id => $acc_key) {
181  $ilDB->manipulate("INSERT INTO acc_access_key " .
182  "(lang_key, function_id, access_key) VALUES (" .
183  $ilDB->quote($a_lang_key, "text") . "," .
184  $ilDB->quote($func_id, "integer") . "," .
185  $ilDB->quote(strtolower(trim($acc_key)), "text") .
186  ")");
187  }
188  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

Field Documentation

◆ $func_def

ilAccessKey::$func_def
static

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

◆ DELETE

const ilAccessKey::DELETE = 3

Definition at line 16 of file class.ilAccessKey.php.

Referenced by ilMailFolderGUI\confirmDeleteMails().

◆ FORWARD_MAIL

const ilAccessKey::FORWARD_MAIL = 8

Definition at line 21 of file class.ilAccessKey.php.

Referenced by ilMailFolderGUI\confirmDeleteMails().

◆ LAST_VISITED

const ilAccessKey::LAST_VISITED = 4

Definition at line 17 of file class.ilAccessKey.php.

Referenced by ilNavigationHistoryGUI\getHTML().

◆ MARK_ALL_READ

const ilAccessKey::MARK_ALL_READ = 9

◆ NEXT

const ilAccessKey::NEXT = 1

Definition at line 14 of file class.ilAccessKey.php.

Referenced by ilLMPresentationGUI\ilLMNavigation().

◆ PERSONAL_DESKTOP

const ilAccessKey::PERSONAL_DESKTOP = 10

Definition at line 23 of file class.ilAccessKey.php.

◆ PREVIOUS

const ilAccessKey::PREVIOUS = 2

Definition at line 15 of file class.ilAccessKey.php.

Referenced by ilLMPresentationGUI\ilLMNavigation().

◆ REPLY

const ilAccessKey::REPLY = 7

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

Referenced by ilMailFolderGUI\confirmDeleteMails().

◆ TREE_OFF

const ilAccessKey::TREE_OFF = 6

Definition at line 19 of file class.ilAccessKey.php.

Referenced by ilTemplate\fillSideIcons().

◆ TREE_ON

const ilAccessKey::TREE_ON = 5

Definition at line 18 of file class.ilAccessKey.php.

Referenced by ilTemplate\fillSideIcons().


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