ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilHelpGUI Class Reference

Help GUI class. More...

+ Collaboration diagram for ilHelpGUI:

Public Member Functions

 ilHelpGUI ()
 constructor More...
 
 setDefaultScreenId ($a_part, $a_id)
 Set default screen id. More...
 
 setScreenId ($a_id)
 Set screen id. More...
 
 setSubScreenId ($a_id)
 Set sub screen id. More...
 
 setScreenIdComponent ($a_comp)
 Set screen id component. More...
 
 getScreenId ()
 Get screen id. More...
 
 addHelpSection ($a_help_id, $a_level=1)
 Add help section. More...
 
 hasSections ()
 Has sections? More...
 
 getHelpSections ()
 Get help sections. More...
 
 setCtrlPar ()
 Get help section url parameter. More...
 
 executeCommand ()
 execute command More...
 
 showHelp ()
 Show online help. More...
 
 showPage ()
 Show page. More...
 
 resetCurrentPage ()
 Hide help. More...
 
 getTabTooltipText ($a_tab_id)
 Get tab tooltip text. More...
 
 initHelp ($a_tpl)
 Render current help page. More...
 
 deactivateTooltips ()
 Deactivate tooltips. More...
 
 activateTooltips ()
 Activate tooltips. More...
 
 getLinkXML ($a_int_links)
 get xml for links More...
 
 getLinkTargetsXML ()
 Get XMl for Link Targets. More...
 
 search ()
 Search. More...
 

Data Fields

 $help_sections = array()
 
const ID_PART_SCREEN = "screen"
 
const ID_PART_SUB_SCREEN = "sub_screen"
 
const ID_PART_COMPONENT = "component"
 
 $def_screen_id = array()
 
 $screen_id = array()
 

Detailed Description

Help GUI class.

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

@ilCtrl_Calls ilHelpGUI: ilLMPageGUI

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

Member Function Documentation

◆ activateTooltips()

ilHelpGUI::activateTooltips ( )

Activate tooltips.

Parameters

return

Definition at line 412 of file class.ilHelpGUI.php.

413 {
414 global $ilUser;
415
416 $ilUser->writePref("hide_help_tt", "0");
417 }
global $ilUser
Definition: imgupload.php:15

References $ilUser.

◆ addHelpSection()

ilHelpGUI::addHelpSection (   $a_help_id,
  $a_level = 1 
)

Add help section.

Parameters

return

Definition at line 117 of file class.ilHelpGUI.php.

118 {
119 $this->help_sections[] = array("help_id" => $a_help_id, $a_level);
120 }

◆ deactivateTooltips()

ilHelpGUI::deactivateTooltips ( )

Deactivate tooltips.

Parameters

return

Definition at line 399 of file class.ilHelpGUI.php.

400 {
401 global $ilUser;
402
403 $ilUser->writePref("hide_help_tt", "1");
404 }

References $ilUser.

◆ executeCommand()

ilHelpGUI::executeCommand ( )

execute command

Definition at line 171 of file class.ilHelpGUI.php.

172 {
173 $cmd = $this->ctrl->getCmd("showHelp");
174 $next_class = $this->ctrl->getNextClass($this);
175
176 switch($next_class)
177 {
178 default:
179 return $this->$cmd();
180 break;
181 }
182 }
$cmd
Definition: sahs_server.php:35

References $cmd.

◆ getHelpSections()

ilHelpGUI::getHelpSections ( )

Get help sections.

Parameters

return

Definition at line 142 of file class.ilHelpGUI.php.

143 {
144 include_once("./Services/Help/classes/class.ilHelpMapping.php");
145 return ilHelpMapping::getHelpSectionsForId($this->getScreenId(), (int) $_GET["ref_id"]);
146 }
$_GET["client_id"]
getScreenId()
Get screen id.
static getHelpSectionsForId($a_screen_id, $a_ref_id)
Get help sections for screen id.

References $_GET, ilHelpMapping\getHelpSectionsForId(), and getScreenId().

+ Here is the call graph for this function:

◆ getLinkTargetsXML()

ilHelpGUI::getLinkTargetsXML ( )

Get XMl for Link Targets.

Definition at line 473 of file class.ilHelpGUI.php.

474 {
475 $link_info = "<LinkTargets>";
476 $link_info.="<LinkTarget TargetFrame=\"None\" LinkTarget=\"\" OnClick=\"return il.Help.openLink(event);\" />";
477 $link_info.= "</LinkTargets>";
478 return $link_info;
479 }

Referenced by showPage().

+ Here is the caller graph for this function:

◆ getLinkXML()

ilHelpGUI::getLinkXML (   $a_int_links)

get xml for links

Definition at line 422 of file class.ilHelpGUI.php.

423 {
424 global $ilCtrl;
425
426 $link_info = "<IntLinkInfos>";
427 foreach ($a_int_links as $int_link)
428 {
429 $target = $int_link["Target"];
430 if (substr($target, 0, 4) == "il__")
431 {
432 $target_arr = explode("_", $target);
433 $target_id = $target_arr[count($target_arr) - 1];
434 $type = $int_link["Type"];
435 $targetframe = "None";
436
437 // anchor
438 $anc = $anc_add = "";
439 if ($int_link["Anchor"] != "")
440 {
441 $anc = $int_link["Anchor"];
442 $anc_add = "_".rawurlencode($int_link["Anchor"]);
443 }
444
445 switch($type)
446 {
447 case "PageObject":
448 case "StructureObject":
449 if ($type == "PageObject")
450 {
451 $href = "#pg_".$target_id;
452 }
453 else
454 {
455 $href = "#";
456 }
457 break;
458
459 }
460
461 $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
462 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"\" Anchor=\"\"/>";
463 }
464 }
465 $link_info.= "</IntLinkInfos>";
466
467 return $link_info;
468 }
$target_id
Definition: goto.php:88
$target_arr
Definition: goto.php:86
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $target_arr, and $target_id.

Referenced by showPage().

+ Here is the caller graph for this function:

◆ getScreenId()

ilHelpGUI::getScreenId ( )

Get screen id.

Parameters

return

Definition at line 84 of file class.ilHelpGUI.php.

85 {
86 $comp = ($this->screen_id_component != "")
87 ? $this->screen_id_component
88 : $this->def_screen_id[self::ID_PART_COMPONENT];
89
90 if ($comp == "")
91 {
92 return "";
93 }
94
95 $scr_id = ($this->screen_id[self::ID_PART_SCREEN] != "")
96 ? $this->screen_id[self::ID_PART_SCREEN]
97 : $this->def_screen_id[self::ID_PART_SCREEN];
98
99 $sub_scr_id = ($this->screen_id[self::ID_PART_SUB_SCREEN] != "")
100 ? $this->screen_id[self::ID_PART_SUB_SCREEN]
101 : $this->def_screen_id[self::ID_PART_SUB_SCREEN];
102
103 $screen_id = $comp."/".
104 $scr_id."/".
105 $sub_scr_id;
106
107 return $screen_id;
108 }
const ID_PART_SCREEN
const ID_PART_SUB_SCREEN

References $screen_id, ID_PART_SCREEN, and ID_PART_SUB_SCREEN.

Referenced by getHelpSections(), hasSections(), and setCtrlPar().

+ Here is the caller graph for this function:

◆ getTabTooltipText()

ilHelpGUI::getTabTooltipText (   $a_tab_id)

Get tab tooltip text.

Parameters
string$a_tab_idtab id
Returns
string tooltip text

Definition at line 354 of file class.ilHelpGUI.php.

355 {
356 global $lng;
357
358 include_once("./Services/Help/classes/class.ilHelp.php");
359 if ($this->screen_id_component != "")
360 {
361 return ilHelp::getTooltipPresentationText($this->screen_id_component."_".$a_tab_id);
362 //return $lng->txt("help_tt_".$this->screen_id_component."_".$a_tab_id);
363 }
364 return "";
365 }
static getTooltipPresentationText($a_tt_id)
Get tooltip for id.
global $lng
Definition: privfeed.php:40

References $lng, and ilHelp\getTooltipPresentationText().

+ Here is the call graph for this function:

◆ hasSections()

ilHelpGUI::hasSections ( )

Has sections?

Parameters

return

Definition at line 128 of file class.ilHelpGUI.php.

129 {
130 global $ilSetting;
131
132 include_once("./Services/Help/classes/class.ilHelpMapping.php");
134 }
hasScreenIdSections($a_screen_id)
Has given screen Id any sections?
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, getScreenId(), and ilHelpMapping\hasScreenIdSections().

+ Here is the call graph for this function:

◆ ilHelpGUI()

ilHelpGUI::ilHelpGUI ( )

constructor

Definition at line 28 of file class.ilHelpGUI.php.

29 {
30 global $ilCtrl;
31
32 $this->ctrl =& $ilCtrl;
33 }

References $ilCtrl.

◆ initHelp()

ilHelpGUI::initHelp (   $a_tpl)

Render current help page.

Parameters

return

Definition at line 373 of file class.ilHelpGUI.php.

374 {
375 global $ilUser, $ilSetting;
376
377 $module_id = (int) $ilSetting->get("help_module");
378
379 if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de")
380 {
381 if (ilSession::get("help_pg") > 0)
382 {
383 $a_tpl->addOnLoadCode("il.Help.showCurrentPage(".ilSession::get("help_pg").");", 3);
384 }
385 if ($ilUser->getPref("hide_help_tt"))
386 {
387 $a_tpl->addJavascript("./Services/Help/js/ilHelp.js");
388 $a_tpl->addOnLoadCode("if (il && il.Help) {il.Help.switchTooltips();}", 3);
389 }
390 }
391 }
static get($a_var)
Get a value.

References $ilSetting, $ilUser, and ilSession\get().

Referenced by ilTemplate\initHelp().

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

◆ resetCurrentPage()

ilHelpGUI::resetCurrentPage ( )

Hide help.

Parameters

return

Definition at line 342 of file class.ilHelpGUI.php.

343 {
344 ilSession::clear("help_pg");
345 }
static clear($a_var)
Unset a value.

References ilSession\clear().

Referenced by search(), and showHelp().

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

◆ search()

ilHelpGUI::search ( )

Search.

Parameters

return

Definition at line 487 of file class.ilHelpGUI.php.

488 {
489 global $lng;
490
491 $term = $_GET["term"];
492
493 if ($term == "")
494 {
495 $term = ilSession::get("help_search_term");
496 }
497
498 $this->resetCurrentPage();
499
500 $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
501 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
502
503 $h_tpl->setCurrentBlock("backlink");
504 $h_tpl->setVariable("TXT_BACK", $lng->txt("back"));
505 $h_tpl->setVariable("ONCLICK_BACK",
506 "return il.Help.listHelp(event, true);");
507 $h_tpl->parseCurrentBlock();
508
509
510 $h_tpl->setVariable("HEAD", $lng->txt("help")." - ".
511 $lng->txt("search_result"));
512
513 $h_tpl->setCurrentBlock("search");
514 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
515 $h_tpl->setVariable("GL_SEARCH", ilGlyphGUI::get(ilGlyphGUI::SEARCH));
516 $h_tpl->setVariable("VAL_SEARCH", ilUtil::prepareFormOutput($term));
517 $h_tpl->parseCurrentBlock();
518
519 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
520 $h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
521
522 $lm_id = ilHelp::getHelpLMId();
523 include_once("./Services/Search/classes/class.ilRepositoryObjectDetailSearch.php");
524 $s = new ilRepositoryObjectDetailSearch($lm_id);
525 $s->setQueryString($term);
526 $result = $s->performSearch();
527
528 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
529 $grp_list = new ilGroupedListGUI();
530 foreach ($result->getResults() as $r)
531 {
532 $grp_list->addEntry(ilLMObject::_lookupTitle($r["item_id"]), "#", "",
533 "return il.Help.showPage(".$r["item_id"].");");
534 }
535 $h_tpl->setVariable("CONTENT", $grp_list->getHTML());
536
537 ilSession::set("help_search_term", $term);
538
539 echo $h_tpl->get();;
540 exit;
541 }
$result
static get($a_glyph, $a_text="")
Get glyph html.
Grouped list GUI class.
resetCurrentPage()
Hide help.
static getHelpLMId()
Get help lm id.
static _lookupTitle($a_obj_id)
Lookup title.
static set($a_var, $a_val)
Set a value.
special template class to simplify handling of ITX/PEAR
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$r
Definition: example_031.php:79
exit
Definition: login.php:54

References $_GET, $lng, $r, $result, ilLMObject\_lookupTitle(), ilGlyphGUI\CLOSE, exit, ilGlyphGUI\get(), ilSession\get(), ilHelp\getHelpLMId(), ilUtil\prepareFormOutput(), resetCurrentPage(), ilGlyphGUI\SEARCH, and ilSession\set().

+ Here is the call graph for this function:

◆ setCtrlPar()

ilHelpGUI::setCtrlPar ( )

Get help section url parameter.

Parameters

return

Definition at line 154 of file class.ilHelpGUI.php.

155 {
156 global $ilCtrl;
157
158 /*$h_ids = $sep = "";
159 foreach ($this->getHelpSections() as $hs)
160 {
161 $h_ids.= $sep.$hs;
162 $sep = ",";
163 }*/
164 $ilCtrl->setParameterByClass("ilhelpgui", "help_screen_id", $this->getScreenId().".".$_GET["ref_id"]);
165 }

References $_GET, $ilCtrl, and getScreenId().

+ Here is the call graph for this function:

◆ setDefaultScreenId()

ilHelpGUI::setDefaultScreenId (   $a_part,
  $a_id 
)

Set default screen id.

Parameters

return

Definition at line 41 of file class.ilHelpGUI.php.

42 {
43 $this->def_screen_id[$a_part] = $a_id;
44 }

◆ setScreenId()

ilHelpGUI::setScreenId (   $a_id)

Set screen id.

Parameters

Definition at line 51 of file class.ilHelpGUI.php.

52 {
53 $this->screen_id[self::ID_PART_SCREEN] = $a_id;
54 }

References ID_PART_SCREEN.

◆ setScreenIdComponent()

ilHelpGUI::setScreenIdComponent (   $a_comp)

Set screen id component.

Parameters

return

Definition at line 72 of file class.ilHelpGUI.php.

73 {
74 $this->screen_id_component = $a_comp;
75 }

◆ setSubScreenId()

ilHelpGUI::setSubScreenId (   $a_id)

Set sub screen id.

Parameters

Definition at line 61 of file class.ilHelpGUI.php.

62 {
63 $this->screen_id[self::ID_PART_SUB_SCREEN] = $a_id;
64 }

References ID_PART_SUB_SCREEN.

◆ showHelp()

ilHelpGUI::showHelp ( )

Show online help.

Definition at line 187 of file class.ilHelpGUI.php.

188 {
189 global $ilHelp, $lng, $ilSetting;
190
191 if ($_GET["help_screen_id"] != "")
192 {
193 ilSession::set("help_screen_id", $_GET["help_screen_id"]);
194 $help_screen_id = $_GET["help_screen_id"];
195 }
196 else
197 {
198 $help_screen_id = ilSession::get("help_screen_id");
199 }
200
201 ilSession::set("help_search_term", "");
202
203 $this->resetCurrentPage();
204
205 $id_arr = explode(".", $help_screen_id);
206 include_once("./Services/Help/classes/class.ilHelpMapping.php");
207 include_once("./Services/Help/classes/class.ilHelp.php");
208
209 $help_arr = ilHelpMapping::getHelpSectionsForId($id_arr[0], $id_arr[1]);
210 $oh_lm_id = ilHelp::getHelpLMId();
211
212 if ($oh_lm_id > 0 && count($help_arr) > 0)
213 {
214 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
215 $acc = new ilAccordionGUI();
216 $acc->setId("oh_acc_".$h_id);
217 $acc->setUseSessionStorage(true);
218 $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
219
220 foreach ($help_arr as $h_id)
221 {
222 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
223 $st_id = $h_id;
224
225 if (!ilLMObject::_exists($st_id))
226 {
227 continue;
228 }
229
230 $pages = ilLMObject::getPagesOfChapter($oh_lm_id, $st_id);
231 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
232 $grp_list = new ilGroupedListGUI();
233 foreach ($pages as $pg)
234 {
235 $grp_list->addEntry(ilLMObject::_lookupTitle($pg["child"]), "#", "",
236 "return il.Help.showPage(".$pg["child"].");");
237 }
238
239 $acc->addItem(ilLMObject::_lookupTitle($st_id), $grp_list->getHTML());
240 }
241 $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
242 $h_tpl->setVariable("HEAD", $lng->txt("help"));
243
244 $h_tpl->setCurrentBlock("search");
245 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
246 $h_tpl->setVariable("GL_SEARCH", ilGlyphGUI::get(ilGlyphGUI::SEARCH));
247 $h_tpl->parseCurrentBlock();
248
249 $h_tpl->setVariable("CONTENT", $acc->getHTML());
250 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
251 $h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
252 echo $h_tpl->get();
253 }
254 exit;
255 }
Accordion user interface class.
_exists($a_id)
checks wether a lm content object with specified id exists or not
static getPagesOfChapter($a_lm_id, $a_chap_id)
Get pages of chapter.

References $_GET, $ilSetting, $lng, ilLMObject\_exists(), ilLMObject\_lookupTitle(), ilGlyphGUI\CLOSE, exit, ilAccordionGUI\FIRST_OPEN, ilGlyphGUI\get(), ilSession\get(), ilHelp\getHelpLMId(), ilHelpMapping\getHelpSectionsForId(), ilLMObject\getPagesOfChapter(), resetCurrentPage(), ilGlyphGUI\SEARCH, and ilSession\set().

+ Here is the call graph for this function:

◆ showPage()

ilHelpGUI::showPage ( )

Show page.

Parameters

return

Definition at line 263 of file class.ilHelpGUI.php.

264 {
265 global $lng;
266
267 $page_id = (int) $_GET["help_page"];
268
269 $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
270 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
271
272
273 $h_tpl->setCurrentBlock("backlink");
274 $h_tpl->setVariable("TXT_BACK", $lng->txt("back"));
275 if (($t =ilSession::get("help_search_term")) != "")
276 {
277 $h_tpl->setVariable("ONCLICK_BACK",
278 "return il.Help.search('".ilUtil::prepareFormOutput($t)."');");
279 }
280 else
281 {
282 $h_tpl->setVariable("ONCLICK_BACK",
283 "return il.Help.listHelp(event, true);");
284 }
285 $h_tpl->parseCurrentBlock();
286
287
288 $h_tpl->setVariable("HEAD", $lng->txt("help")." - ".
289 ilLMObject::_lookupTitle($page_id));
290
291 include_once("./Services/COPage/classes/class.ilPageUtil.php");
292 if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id))
293 {
294 exit;
295 }
296 include_once("./Services/COPage/classes/class.ilPageObject.php");
297 include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
298
299 // get page object
300 include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
301 include_once("./Modules/LearningModule/classes/class.ilLMPageGUI.php");
302 $page_gui = new ilLMPageGUI($page_id);
303 $cfg = $page_gui->getPageConfig();
304 $page_gui->setPresentationTitle("");
305 $page_gui->setTemplateOutput(false);
306 $page_gui->setHeader("");
307 $page_gui->setRawPageContent(true);
308 $cfg->setEnablePCType("Map", false);
309 $cfg->setEnablePCType("Tabs", false);
310 $cfg->setEnablePCType("FileList", false);
311
312 $page_gui->getPageObject()->buildDom();
313 $int_links = $page_gui->getPageObject()->getInternalLinks();
314 $link_xml = $this->getLinkXML($int_links);
315 $link_xml.= $this->getLinkTargetsXML();
316//echo htmlentities($link_xml);
317 $page_gui->setLinkXML($link_xml);
318
319 $ret = $page_gui->showPage();
320
321 $h_tpl->setVariable("CONTENT", $ret);
322 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
323 $h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
324
325 ilSession::set("help_pg", $page_id);
326
327 $page = $h_tpl->get();
328
329 // replace style classes
330 //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page);
331
332 echo $page;
333 exit;
334 }
getLinkXML($a_int_links)
get xml for links
getLinkTargetsXML()
Get XMl for Link Targets.
Extension of ilPageObjectGUI for learning modules.
_existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)

References $_GET, $lng, $ret, $t, ilPageUtil\_existsAndNotEmpty(), ilLMObject\_lookupTitle(), ilGlyphGUI\CLOSE, exit, ilGlyphGUI\get(), ilSession\get(), getLinkTargetsXML(), getLinkXML(), ilUtil\prepareFormOutput(), and ilSession\set().

+ Here is the call graph for this function:

Field Documentation

◆ $def_screen_id

ilHelpGUI::$def_screen_id = array()

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

◆ $help_sections

ilHelpGUI::$help_sections = array()

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

◆ $screen_id

ilHelpGUI::$screen_id = array()

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

Referenced by getScreenId().

◆ ID_PART_COMPONENT

const ilHelpGUI::ID_PART_COMPONENT = "component"

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

◆ ID_PART_SCREEN

◆ ID_PART_SUB_SCREEN

const ilHelpGUI::ID_PART_SUB_SCREEN = "sub_screen"

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

Referenced by ilTabsGUI\__getHTML(), getScreenId(), and setSubScreenId().


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