ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

64 {
65 $empty_keys = array();
66 foreach (self::$func_def as $f => $c)
67 {
68 $empty_keys[$f] = "";
69 }
70
71 return $empty_keys;
72 }

Referenced by getKeys().

+ Here is the caller graph for this function:

◆ getComponentNames()

static ilAccessKey::getComponentNames (   $a_func_id)
static

Get Component Names.

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

88 {
89 global $lng;
90
91 $c_str = $lim = "";
92 foreach (self::$func_def[$a_func_id]["component"] as $c)
93 {
94 $c_str.= $lim.$lng->txt("acc_comp_".$c);
95 $lim = ", ";
96 }
97 return $c_str;
98 }
global $lng
Definition: privfeed.php:40

References $lng.

Referenced by ilAccessKeyTableGUI\fillRow().

+ Here is the caller graph for this function:

◆ getFunctionName()

static ilAccessKey::getFunctionName (   $a_func_id)
static

Get Function Name.

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

78 {
79 global $lng;
80
81 return $lng->txt(self::$func_def[$a_func_id]["lang"]);
82 }

References $lng.

Referenced by ilAccessKeyTableGUI\fillRow().

+ 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 135 of file class.ilAccessKey.php.

136 {
137 global $ilDB;
138
139 $key = "";
140
141 // get defaults
142 if ($lang_key != "0" && !$a_ignore_default)
143 {
144 $key = ilAccessKey::getKey($a_func_id);
145 }
146
147 // get keys of selected language
148 $set = $ilDB->query("SELECT * FROM acc_access_key ".
149 " WHERE lang_key = ".$ilDB->quote($lang_key, "text").
150 " AND function_id = ".$ilDB->quote($a_func_id, "integer")
151 );
152 if ($rec = $ilDB->fetchAssoc($set))
153 {
154 $key = $rec["access_key"];
155 }
156
157 return $key;
158 }
static getKey($a_func_id, $lang_key="0", $a_ignore_default=false)
Get single access key.
global $ilDB

References $ilDB, and getKey().

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

+ Here is the call graph for this function:
+ 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 106 of file class.ilAccessKey.php.

107 {
108 global $ilDB;
109
111
112 // get defaults
113 if ($lang_key != "0" && !$a_ignore_default)
114 {
115 $keys = ilAccessKey::getKeys();
116 }
117
118 // get keys of selected language
119 $set = $ilDB->query("SELECT * FROM acc_access_key ".
120 " WHERE lang_key = ".$ilDB->quote($lang_key, "text")
121 );
122 while ($rec = $ilDB->fetchAssoc($set))
123 {
124 $keys[$rec["function_id"]] = $rec["access_key"];
125 }
126
127 return $keys;
128 }
static getAllKeysEmpty()
Get all function ids with empty keys.
static getKeys($lang_key="0", $a_ignore_default=false)
Get access keys for language.

References $ilDB, getAllKeysEmpty(), and getKeys().

Referenced by ilAccessKeyTableGUI\__construct(), and getKeys().

+ 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 165 of file class.ilAccessKey.php.

166 {
167 global $ilDB;
168
169 $ilDB->manipulate("DELETE FROM acc_access_key WHERE ".
170 "lang_key = ".$ilDB->quote($a_lang_key, "text")
171 );
172
173 foreach ($a_keys as $func_id => $acc_key)
174 {
175 $ilDB->manipulate("INSERT INTO acc_access_key ".
176 "(lang_key, function_id, access_key) VALUES (".
177 $ilDB->quote($a_lang_key, "text").",".
178 $ilDB->quote($func_id, "integer").",".
179 $ilDB->quote(strtolower(trim($acc_key)), "text").
180 ")");
181 }
182 }

References $ilDB.

Referenced by ilObjAccessibilitySettingsGUI\saveAccessKeys().

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

◆ FORWARD_MAIL

const ilAccessKey::FORWARD_MAIL = 8

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

◆ LAST_VISITED

const ilAccessKey::LAST_VISITED = 4

◆ MARK_ALL_READ

const ilAccessKey::MARK_ALL_READ = 9

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

◆ 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.

Referenced by ilMainMenuGUI\renderEntry().

◆ 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.

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