ILIAS  release_8 Revision v8.24
ilHelp Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilHelp:

Static Public Member Functions

static getTooltipPresentationText (string $a_tt_id)
 
static getObjCreationTooltipText (string $a_type)
 Get object_creation tooltip tab text. More...
 
static getMainMenuTooltip (string $a_item_id)
 
static getAllTooltips (string $a_comp="", int $a_module_id=0)
 
static addTooltip (string $a_tt_id, string $a_text, int $a_module_id=0)
 
static updateTooltip (int $a_id, string $a_text, string $a_tt_id)
 
static getTooltipComponents (int $a_module_id=0)
 Get all tooltip components. More...
 
static deleteTooltip (int $a_id)
 
static deleteTooltipsOfModule (int $a_id)
 
static getHelpLMId ()
 Get help lm id. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Online help application class

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ addTooltip()

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

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

136 : void {
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: feed.php:28

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

+ Here is the caller graph for this function:

◆ deleteTooltip()

static ilHelp::deleteTooltip ( int  $a_id)
static

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

200 : void {
201 global $DIC;
202
203 $ilDB = $DIC->database();
204
205 $ilDB->manipulate(
206 "DELETE FROM help_tooltip WHERE " .
207 " id = " . $ilDB->quote($a_id, "integer")
208 );
209 }

Referenced by ilObjContentObjectGUI\deleteTooltips().

+ Here is the caller graph for this function:

◆ deleteTooltipsOfModule()

static ilHelp::deleteTooltipsOfModule ( int  $a_id)
static

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

213 : void {
214 global $DIC;
215
216 $ilDB = $DIC->database();
217
218 $ilDB->manipulate(
219 "DELETE FROM help_tooltip WHERE " .
220 " module_id = " . $ilDB->quote($a_id, "integer")
221 );
222 }

◆ getAllTooltips()

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

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

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

References $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 228 of file class.ilHelp.php.

228 : int
229 {
230 global $DIC;
231
232 $ilSetting = $DIC->settings();
233
234 $lm_id = 0;
235
236 if ((int) OH_REF_ID > 0) {
237 $lm_id = ilObject::_lookupObjId((int) OH_REF_ID);
238 } else {
239 $hm = (int) $ilSetting->get("help_module");
240 if ($hm > 0) {
242 }
243 }
244
245 return $lm_id;
246 }
static lookupModuleLmId(int $a_id)
static _lookupObjId(int $ref_id)
global $ilSetting
Definition: privfeed.php:17

References $DIC, $ilSetting, ilObject\_lookupObjId(), ILIAS\Repository\int(), 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 ( string  $a_item_id)
static
Returns
string tooltip text

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

106 : string {
107 return self::getTooltipPresentationText($a_item_id);
108 }
static getTooltipPresentationText(string $a_tt_id)

◆ getObjCreationTooltipText()

static ilHelp::getObjCreationTooltipText ( string  $a_type)
static

Get object_creation tooltip tab text.

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

97 : string {
98 return self::getTooltipPresentationText($a_type . "_create");
99 }

Referenced by ilObjectAddNewItemGUI\getHTML(), ilEmployeeTalkMyStaffListGUI\loadActionBar(), and ilEmployeeTalkMyStaffUserGUI\loadActionBar().

+ Here is the caller graph for this function:

◆ getTooltipComponents()

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

Get all tooltip components.

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

182 : array {
183 global $DIC;
184
185 $ilDB = $DIC->database();
186 $lng = $DIC->language();
187
188 $set = $ilDB->query("SELECT DISTINCT comp FROM help_tooltip " .
189 " WHERE module_id = " . $ilDB->quote($a_module_id, "integer") .
190 " ORDER BY comp ");
191 $comps[""] = "- " . $lng->txt("help_all") . " -";
192 while ($rec = $ilDB->fetchAssoc($set)) {
193 $comps[$rec["comp"]] = $rec["comp"];
194 }
195 return $comps;
196 }
$lng

Referenced by ilObjContentObjectGUI\showTooltipList().

+ Here is the caller graph for this function:

◆ getTooltipPresentationText()

static ilHelp::getTooltipPresentationText ( string  $a_tt_id)
static

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

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

Referenced by ilHelpGUI\getTabTooltipText().

+ Here is the caller graph for this function:

◆ updateTooltip()

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

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

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

Referenced by ilObjContentObjectGUI\saveTooltips().

+ Here is the caller graph for this function:

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