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

Online help application class. More...

+ Collaboration diagram for ilHelp:

Static Public Member Functions

static getTooltipPresentationText ($a_tt_id)
 Get tooltip for id. More...
 
static getObjCreationTooltipText ($a_type)
 Get object_creation tooltip tab text. More...
 
static getMainMenuTooltip ($a_item_id)
 Get main menu tooltip. More...
 
static getAllTooltips ($a_comp="", $a_module_id=0)
 Get all tooltips. More...
 
static addTooltip ($a_tt_id, $a_text, $a_module_id=0)
 Add tooltip. More...
 
static updateTooltip ($a_id, $a_text, $a_tt_id)
 Update tooltip. More...
 
static getTooltipComponents ($a_module_id=0)
 Get all tooltip components. More...
 
static deleteTooltip ($a_id)
 Delete tooltip. More...
 
static deleteTooltipsOfModule ($a_id)
 Delete tooltips of module. More...
 
static getHelpLMId ()
 Get help lm id. More...
 

Detailed Description

Online help application class.

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.ilHelp.php.

Member Function Documentation

◆ addTooltip()

static ilHelp::addTooltip (   $a_tt_id,
  $a_text,
  $a_module_id = 0 
)
static

Add tooltip.

Parameters

return

Definition at line 135 of file class.ilHelp.php.

136 {
137 global $DIC;
138
139 $ilDB = $DIC->database();
140
141 $fu = strpos($a_tt_id, "_");
142 $comp = substr($a_tt_id, 0, $fu);
143
144 $nid = $ilDB->nextId("help_tooltip");
145 $ilDB->manipulate("INSERT INTO help_tooltip " .
146 "(id, tt_text, tt_id, comp,module_id) VALUES (" .
147 $ilDB->quote($nid, "integer") . "," .
148 $ilDB->quote($a_text, "text") . "," .
149 $ilDB->quote($a_tt_id, "text") . "," .
150 $ilDB->quote($comp, "text") . "," .
151 $ilDB->quote($a_module_id, "integer") .
152 ")");
153 }
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, and $ilDB.

Referenced by ilObjContentObjectGUI\addTooltip(), and ilHelpDataSet\importRecord().

+ Here is the caller graph for this function:

◆ deleteTooltip()

static ilHelp::deleteTooltip (   $a_id)
static

Delete tooltip.

Parameters

return

Definition at line 209 of file class.ilHelp.php.

210 {
211 global $DIC;
212
213 $ilDB = $DIC->database();
214
215 $ilDB->manipulate(
216 "DELETE FROM help_tooltip WHERE " .
217 " id = " . $ilDB->quote($a_id, "integer")
218 );
219 }

References $DIC, and $ilDB.

Referenced by ilObjContentObjectGUI\deleteTooltips().

+ Here is the caller graph for this function:

◆ deleteTooltipsOfModule()

static ilHelp::deleteTooltipsOfModule (   $a_id)
static

Delete tooltips of module.

Parameters

return

Definition at line 227 of file class.ilHelp.php.

228 {
229 global $DIC;
230
231 $ilDB = $DIC->database();
232
233 $ilDB->manipulate(
234 "DELETE FROM help_tooltip WHERE " .
235 " module_id = " . $ilDB->quote($a_id, "integer")
236 );
237 }

References $DIC, and $ilDB.

Referenced by ilObjHelpSettings\deleteModule().

+ Here is the caller graph for this function:

◆ getAllTooltips()

static ilHelp::getAllTooltips (   $a_comp = "",
  $a_module_id = 0 
)
static

Get all tooltips.

Parameters

return

Definition at line 109 of file class.ilHelp.php.

110 {
111 global $DIC;
112
113 $ilDB = $DIC->database();
114
115 $q = "SELECT * FROM help_tooltip";
116 $q.= " WHERE module_id = " . $ilDB->quote($a_module_id, "integer");
117 if ($a_comp != "") {
118 $q.= " AND comp = " . $ilDB->quote($a_comp, "text");
119 }
120 $set = $ilDB->query($q);
121 $tts = array();
122 while ($rec = $ilDB->fetchAssoc($set)) {
123 $tts[$rec["id"]] = array("id" => $rec["id"], "text" => $rec["tt_text"],
124 "tt_id" => $rec["tt_id"]);
125 }
126 return $tts;
127 }

References $DIC, and $ilDB.

Referenced by ilHelpTooltipTableGUI\__construct().

+ Here is the caller graph for this function:

◆ getHelpLMId()

static ilHelp::getHelpLMId ( )
static

Get help lm id.

Returns
int help learning module id

Definition at line 244 of file class.ilHelp.php.

245 {
246 global $DIC;
247
248 $ilSetting = $DIC->settings();
249
250 $lm_id = 0;
251
252 if (OH_REF_ID > 0) {
253 $lm_id = ilObject::_lookupObjId(OH_REF_ID);
254 } else {
255 $hm = (int) $ilSetting->get("help_module");
256 if ($hm > 0) {
257 include_once("./Services/Help/classes/class.ilObjHelpSettings.php");
259 }
260 }
261
262 return $lm_id;
263 }
static lookupModuleLmId($a_id)
lookup module lm id
static _lookupObjId($a_id)
global $ilSetting
Definition: privfeed.php:17

References $DIC, $ilSetting, ilObject\_lookupObjId(), and ilObjHelpSettings\lookupModuleLmId().

Referenced by ilHelpGUI\search(), and ilHelpGUI\showHelp().

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

◆ getMainMenuTooltip()

static ilHelp::getMainMenuTooltip (   $a_item_id)
static

Get main menu tooltip.

Parameters
string$a_mm_id
Returns
string tooltip text

Definition at line 97 of file class.ilHelp.php.

98 {
99 return self::getTooltipPresentationText($a_item_id);
100 }
static getTooltipPresentationText($a_tt_id)
Get tooltip for id.

References getTooltipPresentationText().

Referenced by ilAdministrationGUI\getDropDown(), and ilMainMenuGUI\renderEntry().

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

◆ getObjCreationTooltipText()

static ilHelp::getObjCreationTooltipText (   $a_type)
static

Get object_creation tooltip tab text.

Parameters
string$a_tab_idtab id
Returns
string tooltip text

Definition at line 86 of file class.ilHelp.php.

87 {
88 return self::getTooltipPresentationText($a_type . "_create");
89 }
$a_type
Definition: workflow.php:92

References $a_type, and getTooltipPresentationText().

Referenced by ilObjectAddNewItemGUI\getHTML().

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

◆ getTooltipComponents()

static ilHelp::getTooltipComponents (   $a_module_id = 0)
static

Get all tooltip components.

Parameters

return

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

187 {
188 global $DIC;
189
190 $ilDB = $DIC->database();
191 $lng = $DIC->language();
192
193 $set = $ilDB->query("SELECT DISTINCT comp FROM help_tooltip " .
194 " WHERE module_id = " . $ilDB->quote($a_module_id, "integer") .
195 " ORDER BY comp ");
196 $comps[""] = "- " . $lng->txt("help_all") . " -";
197 while ($rec = $ilDB->fetchAssoc($set)) {
198 $comps[$rec["comp"]] = $rec["comp"];
199 }
200 return $comps;
201 }
global $lng
Definition: privfeed.php:17

References $DIC, $ilDB, and $lng.

Referenced by ilObjContentObjectGUI\showTooltipList().

+ Here is the caller graph for this function:

◆ getTooltipPresentationText()

static ilHelp::getTooltipPresentationText (   $a_tt_id)
static

Get tooltip for id.

Parameters

return

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

20 {
21 global $DIC;
22
23 $ilDB = $DIC->database();
24 $ilSetting = $DIC->settings();
25 $ilUser = $DIC->user();
26
27
28 if ($ilUser->getLanguage() != "de") {
29 return "";
30 }
31
32 if ($ilSetting->get("help_mode") == "1") {
33 return "";
34 }
35
36 if (OH_REF_ID > 0) {
37 $module_id = 0;
38 } else {
39 $module_id = (int) $ilSetting->get("help_module");
40 if ($module_id == 0) {
41 return "";
42 }
43 }
44
45 $set = $ilDB->query(
46 "SELECT tt_text FROM help_tooltip " .
47 " WHERE tt_id = " . $ilDB->quote($a_tt_id, "text") .
48 " AND module_id = " . $ilDB->quote($module_id, "integer")
49 );
50 $rec = $ilDB->fetchAssoc($set);
51 if ($rec["tt_text"] != "") {
52 $t = $rec["tt_text"];
53 if ($module_id == 0) {
54 $t.="<br/><i class='small'>" . $a_tt_id . "</i>";
55 }
56 return $t;
57 } else { // try to get general version
58 $fu = strpos($a_tt_id, "_");
59 $gen_tt_id = "*" . substr($a_tt_id, $fu);
60 $set = $ilDB->query(
61 "SELECT tt_text FROM help_tooltip " .
62 " WHERE tt_id = " . $ilDB->quote($gen_tt_id, "text") .
63 " AND module_id = " . $ilDB->quote($module_id, "integer")
64 );
65 $rec = $ilDB->fetchAssoc($set);
66 if ($rec["tt_text"] != "") {
67 $t = $rec["tt_text"];
68 if ($module_id == 0) {
69 $t.="<br/><i class='small'>" . $a_tt_id . "</i>";
70 }
71 return $t;
72 }
73 }
74 if ($module_id == 0) {
75 return "<i>" . $a_tt_id . "</i>";
76 }
77 return "";
78 }
$ilUser
Definition: imgupload.php:18

References $DIC, $ilDB, $ilSetting, $ilUser, and $t.

Referenced by getMainMenuTooltip(), getObjCreationTooltipText(), and ilHelpGUI\getTabTooltipText().

+ Here is the caller graph for this function:

◆ updateTooltip()

static ilHelp::updateTooltip (   $a_id,
  $a_text,
  $a_tt_id 
)
static

Update tooltip.

Parameters

return

Definition at line 161 of file class.ilHelp.php.

162 {
163 global $DIC;
164
165 $ilDB = $DIC->database();
166
167 $fu = strpos($a_tt_id, "_");
168 $comp = substr($a_tt_id, 0, $fu);
169
170 $ilDB->manipulate(
171 "UPDATE help_tooltip SET " .
172 " tt_text = " . $ilDB->quote($a_text, "text") . ", " .
173 " tt_id = " . $ilDB->quote($a_tt_id, "text") . ", " .
174 " comp = " . $ilDB->quote($comp, "text") .
175 " WHERE id = " . $ilDB->quote($a_id, "integer")
176 );
177 }

References $DIC, and $ilDB.

Referenced by ilObjContentObjectGUI\saveTooltips().

+ Here is the caller graph for this function:

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