ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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

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

References $DIC, and $ilDB.

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

140  {
141  global $DIC;
142 
143  $ilDB = $DIC->database();
144 
145  $fu = strpos($a_tt_id, "_");
146  $comp = substr($a_tt_id, 0, $fu);
147 
148  $nid = $ilDB->nextId("help_tooltip");
149  $ilDB->manipulate("INSERT INTO help_tooltip " .
150  "(id, tt_text, tt_id, comp,module_id) VALUES (" .
151  $ilDB->quote($nid, "integer") . "," .
152  $ilDB->quote($a_text, "text") . "," .
153  $ilDB->quote($a_tt_id, "text") . "," .
154  $ilDB->quote($comp, "text") . "," .
155  $ilDB->quote($a_module_id, "integer") .
156  ")");
157  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ deleteTooltip()

static ilHelp::deleteTooltip (   $a_id)
static

Delete tooltip.

Parameters

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

References $DIC, and $ilDB.

Referenced by ilObjContentObjectGUI\deleteTooltips().

214  {
215  global $DIC;
216 
217  $ilDB = $DIC->database();
218 
219  $ilDB->manipulate(
220  "DELETE FROM help_tooltip WHERE " .
221  " id = " . $ilDB->quote($a_id, "integer")
222  );
223  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ deleteTooltipsOfModule()

static ilHelp::deleteTooltipsOfModule (   $a_id)
static

Delete tooltips of module.

Parameters

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

References $DIC, and $ilDB.

Referenced by ilObjHelpSettings\deleteModule().

232  {
233  global $DIC;
234 
235  $ilDB = $DIC->database();
236 
237  $ilDB->manipulate(
238  "DELETE FROM help_tooltip WHERE " .
239  " module_id = " . $ilDB->quote($a_id, "integer")
240  );
241  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ getAllTooltips()

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

Get all tooltips.

Parameters

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

References $DIC, and $ilDB.

Referenced by ilHelpTooltipTableGUI\__construct().

114  {
115  global $DIC;
116 
117  $ilDB = $DIC->database();
118 
119  $q = "SELECT * FROM help_tooltip";
120  $q .= " WHERE module_id = " . $ilDB->quote($a_module_id, "integer");
121  if ($a_comp != "") {
122  $q .= " AND comp = " . $ilDB->quote($a_comp, "text");
123  }
124  $set = $ilDB->query($q);
125  $tts = array();
126  while ($rec = $ilDB->fetchAssoc($set)) {
127  $tts[$rec["id"]] = array("id" => $rec["id"], "text" => $rec["tt_text"],
128  "tt_id" => $rec["tt_id"]);
129  }
130  return $tts;
131  }
global $DIC
Definition: saml.php:7
global $ilDB
+ 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 248 of file class.ilHelp.php.

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

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

249  {
250  global $DIC;
251 
252  $ilSetting = $DIC->settings();
253 
254  $lm_id = 0;
255 
256  if (OH_REF_ID > 0) {
257  $lm_id = ilObject::_lookupObjId(OH_REF_ID);
258  } else {
259  $hm = (int) $ilSetting->get("help_module");
260  if ($hm > 0) {
261  include_once("./Services/Help/classes/class.ilObjHelpSettings.php");
263  }
264  }
265 
266  return $lm_id;
267  }
global $DIC
Definition: saml.php:7
static _lookupObjId($a_id)
static lookupModuleLmId($a_id)
lookup module lm id
global $ilSetting
Definition: privfeed.php:17
+ 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 101 of file class.ilHelp.php.

Referenced by ilMMTopParentItemRenderer\addEntry(), ilMainMenuGUI\addToolbarTooltip(), ilAdministrationGUI\getDropDown(), ilMMTopParentItemRenderer\handleAsyncContent(), and ilMMTopParentItemRenderer\handleContent().

102  {
103  return self::getTooltipPresentationText($a_item_id);
104  }
+ 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 90 of file class.ilHelp.php.

References $a_type.

Referenced by ilObjectAddNewItemGUI\getHTML().

91  {
92  return self::getTooltipPresentationText($a_type . "_create");
93  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ getTooltipComponents()

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

Get all tooltip components.

Parameters

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

References $DIC, $ilDB, and $lng.

Referenced by ilObjContentObjectGUI\showTooltipList().

191  {
192  global $DIC;
193 
194  $ilDB = $DIC->database();
195  $lng = $DIC->language();
196 
197  $set = $ilDB->query("SELECT DISTINCT comp FROM help_tooltip " .
198  " WHERE module_id = " . $ilDB->quote($a_module_id, "integer") .
199  " ORDER BY comp ");
200  $comps[""] = "- " . $lng->txt("help_all") . " -";
201  while ($rec = $ilDB->fetchAssoc($set)) {
202  $comps[$rec["comp"]] = $rec["comp"];
203  }
204  return $comps;
205  }
global $DIC
Definition: saml.php:7
$lng
global $ilDB
+ Here is the caller graph for this function:

◆ getTooltipPresentationText()

static ilHelp::getTooltipPresentationText (   $a_tt_id)
static

Get tooltip for id.

Parameters

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

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

Referenced by ilHelpGUI\getTabTooltipText().

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 ($ilUser->getPref("hide_help_tt")) {
37  return "";
38  }
39 
40  if (OH_REF_ID > 0) {
41  $module_id = 0;
42  } else {
43  $module_id = (int) $ilSetting->get("help_module");
44  if ($module_id == 0) {
45  return "";
46  }
47  }
48 
49  $set = $ilDB->query(
50  "SELECT tt_text FROM help_tooltip " .
51  " WHERE tt_id = " . $ilDB->quote($a_tt_id, "text") .
52  " AND module_id = " . $ilDB->quote($module_id, "integer")
53  );
54  $rec = $ilDB->fetchAssoc($set);
55  if ($rec["tt_text"] != "") {
56  $t = $rec["tt_text"];
57  if ($module_id == 0) {
58  $t .= "<br/><i class='small'>" . $a_tt_id . "</i>";
59  }
60  return $t;
61  } else { // try to get general version
62  $fu = strpos($a_tt_id, "_");
63  $gen_tt_id = "*" . substr($a_tt_id, $fu);
64  $set = $ilDB->query(
65  "SELECT tt_text FROM help_tooltip " .
66  " WHERE tt_id = " . $ilDB->quote($gen_tt_id, "text") .
67  " AND module_id = " . $ilDB->quote($module_id, "integer")
68  );
69  $rec = $ilDB->fetchAssoc($set);
70  if ($rec["tt_text"] != "") {
71  $t = $rec["tt_text"];
72  if ($module_id == 0) {
73  $t .= "<br/><i class='small'>" . $a_tt_id . "</i>";
74  }
75  return $t;
76  }
77  }
78  if ($module_id == 0) {
79  return "<i>" . $a_tt_id . "</i>";
80  }
81  return "";
82  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
global $ilDB
+ Here is the caller graph for this function:

◆ updateTooltip()

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

Update tooltip.

Parameters

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

References $DIC, and $ilDB.

Referenced by ilObjContentObjectGUI\saveTooltips().

166  {
167  global $DIC;
168 
169  $ilDB = $DIC->database();
170 
171  $fu = strpos($a_tt_id, "_");
172  $comp = substr($a_tt_id, 0, $fu);
173 
174  $ilDB->manipulate(
175  "UPDATE help_tooltip SET " .
176  " tt_text = " . $ilDB->quote($a_text, "text") . ", " .
177  " tt_id = " . $ilDB->quote($a_tt_id, "text") . ", " .
178  " comp = " . $ilDB->quote($comp, "text") .
179  " WHERE id = " . $ilDB->quote($a_id, "integer")
180  );
181  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

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