ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilHelpGUI Class Reference

Help GUI class. More...

+ Collaboration diagram for ilHelpGUI:

Public Member Functions

 __construct ()
 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, $ajax_url)
 Render current help page. More...
 
 isHelpPageActive ()
 Is help page active? 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()
 

Protected Member Functions

 replaceMenuItemTags (string $content)
 Help page post processing. More...
 
 replaceItemTag ($mmc, string $content, \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem $item)
 Replace item tag. More...
 
 getTitleForItem (\ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem $item)
 Get title for item. More...
 

Protected Attributes

 $ctrl
 
 $settings
 
 $lng
 
 $user
 
 $ui
 
 $raw_menu_items = null
 

Detailed Description

Help GUI class.

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

@ilCtrl_Calls ilHelpGUI: ilLMPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilHelpGUI::__construct ( )

constructor

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

58 {
59 global $DIC;
60
61 $this->settings = $DIC->settings();
62 $this->lng = $DIC->language();
63 $this->user = $DIC->user();
64 $ilCtrl = $DIC->ctrl();
65
66 $this->ctrl = $ilCtrl;
67 $this->ui = $DIC->ui();
68 }
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5
$DIC
Definition: xapitoken.php:46

References $DIC, $ilCtrl, settings(), ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ activateTooltips()

ilHelpGUI::activateTooltips ( )

Activate tooltips.

Parameters

return

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

480 {
482
483 $ilUser->writePref("hide_help_tt", "0");
484 }
$ilUser
Definition: imgupload.php:18

References $ilUser, and $user.

◆ addHelpSection()

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

Add help section.

Parameters

return

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

152 {
153 $this->help_sections[] = array("help_id" => $a_help_id, $a_level);
154 }

◆ deactivateTooltips()

ilHelpGUI::deactivateTooltips ( )

Deactivate tooltips.

Parameters

return

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

467 {
469
470 $ilUser->writePref("hide_help_tt", "1");
471 }

References $ilUser, and $user.

◆ executeCommand()

ilHelpGUI::executeCommand ( )

execute command

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

206 {
207 $cmd = $this->ctrl->getCmd("showHelp");
208 $next_class = $this->ctrl->getNextClass($this);
209
210 switch ($next_class) {
211 default:
212 return $this->$cmd();
213 break;
214 }
215 }

◆ getHelpSections()

ilHelpGUI::getHelpSections ( )

Get help sections.

Parameters

return

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

177 {
178 include_once("./Services/Help/classes/class.ilHelpMapping.php");
179 return ilHelpMapping::getHelpSectionsForId($this->getScreenId(), (int) $_GET["ref_id"]);
180 }
$_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 533 of file class.ilHelpGUI.php.

534 {
535 $link_info = "<LinkTargets>";
536 $link_info .= "<LinkTarget TargetFrame=\"None\" LinkTarget=\"\" OnClick=\"return il.Help.openLink(event);\" />";
537 $link_info .= "</LinkTargets>";
538 return $link_info;
539 }

Referenced by showPage().

+ Here is the caller graph for this function:

◆ getLinkXML()

ilHelpGUI::getLinkXML (   $a_int_links)

get xml for links

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

490 {
492
493 $link_info = "<IntLinkInfos>";
494 foreach ($a_int_links as $int_link) {
495 $target = $int_link["Target"];
496 if (substr($target, 0, 4) == "il__") {
497 $target_arr = explode("_", $target);
498 $target_id = $target_arr[count($target_arr) - 1];
499 $type = $int_link["Type"];
500 $targetframe = "None";
501
502 // anchor
503 $anc = $anc_add = "";
504 if ($int_link["Anchor"] != "") {
505 $anc = $int_link["Anchor"];
506 $anc_add = "_" . rawurlencode($int_link["Anchor"]);
507 }
508
509 switch ($type) {
510 case "PageObject":
511 case "StructureObject":
512 if ($type == "PageObject") {
513 $href = "#pg_" . $target_id;
514 } else {
515 $href = "#";
516 }
517 break;
518
519 }
520
521 $link_info .= "<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
522 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"\" Anchor=\"\"/>";
523 }
524 }
525 $link_info .= "</IntLinkInfos>";
526
527 return $link_info;
528 }
$target_id
Definition: goto.php:49
$target_arr
Definition: goto.php:47
$type

References $ctrl, $ilCtrl, $target_arr, $target_id, and $type.

Referenced by showPage().

+ Here is the caller graph for this function:

◆ getScreenId()

ilHelpGUI::getScreenId ( )

Get screen id.

Parameters

return

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

120 {
121 $comp = ($this->screen_id_component != "")
122 ? $this->screen_id_component
123 : $this->def_screen_id[self::ID_PART_COMPONENT];
124
125 if ($comp == "") {
126 return "";
127 }
128
129 $scr_id = ($this->screen_id[self::ID_PART_SCREEN] != "")
130 ? $this->screen_id[self::ID_PART_SCREEN]
131 : $this->def_screen_id[self::ID_PART_SCREEN];
132
133 $sub_scr_id = ($this->screen_id[self::ID_PART_SUB_SCREEN] != "")
134 ? $this->screen_id[self::ID_PART_SUB_SCREEN]
135 : $this->def_screen_id[self::ID_PART_SUB_SCREEN];
136
137 $screen_id = $comp . "/" .
138 $scr_id . "/" .
139 $sub_scr_id;
140
141 return $screen_id;
142 }
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 394 of file class.ilHelpGUI.php.

395 {
397
398 include_once("./Services/Help/classes/class.ilHelp.php");
399 if ($this->screen_id_component != "") {
400 return ilHelp::getTooltipPresentationText($this->screen_id_component . "_" . $a_tab_id);
401 //return $lng->txt("help_tt_".$this->screen_id_component."_".$a_tab_id);
402 }
403 return "";
404 }
static getTooltipPresentationText($a_tt_id)
Get tooltip for id.

References $lng, and ilHelp\getTooltipPresentationText().

+ Here is the call graph for this function:

◆ getTitleForItem()

ilHelpGUI::getTitleForItem ( \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem  $item)
protected

Get title for item.

Parameters
\ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem$item
Returns
string
Exceptions
Throwable

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

687 : string
688 {
689 global $DIC;
690 $mmc = $DIC->globalScreen()->collector()->mainmenu();
691 return $mmc->getItemInformation()->customTranslationForUser($item)->getTitle();
692 }

References $DIC.

Referenced by replaceItemTag().

+ Here is the caller graph for this function:

◆ hasSections()

ilHelpGUI::hasSections ( )

Has sections?

Parameters

return

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

163 {
165
166 include_once("./Services/Help/classes/class.ilHelpMapping.php");
168 }
static hasScreenIdSections($a_screen_id)
Has given screen Id any sections?
global $ilSetting
Definition: privfeed.php:17

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

+ Here is the call graph for this function:

◆ initHelp()

ilHelpGUI::initHelp (   $a_tpl,
  $ajax_url 
)

Render current help page.

Parameters

return

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

413 {
414 global $DIC;
415
416 $ilUser = $DIC->user();
417 $ilSetting = $DIC->settings();
418 $ctrl = $DIC->ctrl();
419
421 $a_tpl->addJavascript("./Services/Help/js/ilHelp.js");
422 $a_tpl->addJavascript("./Services/Accordion/js/accordion.js");
424 $a_tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
425
426 $this->setCtrlPar();
427 $a_tpl->addOnLoadCode(
428 "il.Help.setAjaxUrl('" .
429 $ctrl->getLinkTargetByClass("ilhelpgui", "", "", true)
430 . "');"
431 );
432
433
434 $module_id = (int) $ilSetting->get("help_module");
435
436 if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de") {
437 if (ilSession::get("help_pg") > 0) {
438 $a_tpl->addOnLoadCode("il.Help.showCurrentPage(" . ilSession::get("help_pg") . ");", 3);
439 } else {
440 $a_tpl->addOnLoadCode("il.Help.listHelp(null);", 3);
441 }
442
443
444 if ($ilUser->getPref("hide_help_tt")) {
445 $a_tpl->addOnLoadCode("if (il && il.Help) {il.Help.switchTooltips();}", 3);
446 }
447 }
448 }
setCtrlPar()
Get help section url parameter.
static get($a_var)
Get a value.
static initConnection(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
static initMaphilight()
Inits and add maphilight to the general template.

References $ctrl, $DIC, $ilSetting, $ilUser, ilSession\get(), ilYuiUtil\initConnection(), iljQueryUtil\initMaphilight(), and setCtrlPar().

+ Here is the call graph for this function:

◆ isHelpPageActive()

ilHelpGUI::isHelpPageActive ( )

Is help page active?

Parameters

return

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

456 {
457 return (ilSession::get("help_pg") > 0);
458 }

References ilSession\get().

+ Here is the call graph for this function:

◆ replaceItemTag()

ilHelpGUI::replaceItemTag (   $mmc,
string  $content,
\ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem  $item 
)
protected

Replace item tag.

Parameters

return

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

646 {
647 global $DIC;
648 $mmc = $DIC->globalScreen()->collector()->mainmenu();
649
650 $id = $item->getProviderIdentification()->getInternalIdentifier();
651 $ws = "[ \t\r\f\v\n]*";
652
653 // menu item path
654 while (preg_match("~\[(menu" . $ws . "path$ws=$ws(\"$id\")$ws)/\]~i", $content, $found)) {
655 $path = "";
656 if ($item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild) {
657 $parent = $mmc->getItemInformation()->getParent($item);
658 if ($parent !== null) {
659 $parent = $mmc->getSingleItemFromRaw($parent);
660 $path = $this->getTitleForItem($parent) . " > ";
661 }
662 }
663 $path .= $this->getTitleForItem($item);
664 $content = preg_replace(
665 '~\[' . $found[1] . '/\]~i',
666 "<strong>" . $path . "</strong>",
667 $content
668 );
669 }
670 // menu item
671 while (preg_match("~\[(menu" . $ws . "item$ws=$ws(\"$id\")$ws)/\]~i", $content, $found)) {
672 $content = preg_replace(
673 '~\[' . $found[1] . '/\]~i',
674 "<strong>" . $this->getTitleForItem($item) . "</strong>",
675 $content
676 );
677 }
678 return $content;
679 }
getTitleForItem(\ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem $item)
Get title for item.
Class ChatMainBarProvider \MainMenu\Provider.

References $DIC, and getTitleForItem().

Referenced by replaceMenuItemTags().

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

◆ replaceMenuItemTags()

ilHelpGUI::replaceMenuItemTags ( string  $content)
protected

Help page post processing.

Parameters
string$content
Returns
string
Exceptions
Throwable

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

618 : string
619 {
620 global $DIC;
621
622 $mmc = $DIC->globalScreen()->collector()->mainmenu();
623 if ($this->raw_menu_items == null) {
624 $mmc->collectOnce();
625 $this->raw_menu_items = iterator_to_array($mmc->getRawItems());
626 }
627
628 foreach ($this->raw_menu_items as $item) {
629 if ($item instanceof Item\LinkList) {
630 foreach ($item->getLinks() as $link) {
631 $content = $this->replaceItemTag($mmc, $content, $link);
632 }
633 }
634 $content = $this->replaceItemTag($mmc, $content, $item);
635 }
636 return $content;
637 }
replaceItemTag($mmc, string $content, \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem $item)
Replace item tag.

References $DIC, and replaceItemTag().

Referenced by showHelp(), and showPage().

+ 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 382 of file class.ilHelpGUI.php.

383 {
384 ilSession::clear("help_pg");
385 }
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 547 of file class.ilHelpGUI.php.

548 {
550 $ui = $this->ui;
551
552 $term = $_GET["term"];
553
554 if ($term == "") {
555 $term = ilSession::get("help_search_term");
556 }
557
558 $this->resetCurrentPage();
559
560 $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
561 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
562
563
564 $back_button = $ui->factory()->button()->bulky($ui->factory()->symbol()->glyph()->back(), $lng->txt("back"), "#")->withOnLoadCode(function ($id) {
565 return
566 "$(\"#$id\").click(function() { return il.Help.listHelp(event, true); return false;});";
567 });
568 $h_tpl->setVariable("BACKBUTTON", $ui->renderer()->renderAsync($back_button));
569
570 $h_tpl->setVariable("HEAD", $lng->txt("help") . " - " .
571 $lng->txt("search_result"));
572
573 $h_tpl->setCurrentBlock("search");
574 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
575 $h_tpl->setVariable("GL_SEARCH", ilGlyphGUI::get(ilGlyphGUI::SEARCH));
576 $h_tpl->setVariable("HELP_SEARCH_LABEL", $this->lng->txt("help_search_label"));
577 $h_tpl->setVariable("VAL_SEARCH", ilUtil::prepareFormOutput($term));
578 $h_tpl->parseCurrentBlock();
579
580 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
581 $h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
582
583 $lm_id = ilHelp::getHelpLMId();
584 include_once("./Services/Search/classes/class.ilRepositoryObjectDetailSearch.php");
585 $s = new ilRepositoryObjectDetailSearch($lm_id);
586 $s->setQueryString($term);
587 $result = $s->performSearch();
588
589 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
590 $grp_list = new ilGroupedListGUI();
591 foreach ($result->getResults() as $r) {
592 $grp_list->addEntry(
593 ilLMObject::_lookupTitle($r["item_id"]),
594 "#",
595 "",
596 "return il.Help.showPage(" . $r["item_id"] . ");"
597 );
598 }
599 $h_tpl->setVariable("CONTENT", $grp_list->getHTML());
600
601 ilSession::set("help_search_term", $term);
602
603 echo $h_tpl->get();
604 ;
605 exit;
606 }
$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
exit
Definition: login.php:29

References $_GET, $lng, $result, $ui, 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 188 of file class.ilHelpGUI.php.

189 {
191
192 /*$h_ids = $sep = "";
193 foreach ($this->getHelpSections() as $hs)
194 {
195 $h_ids.= $sep.$hs;
196 $sep = ",";
197 }*/
198 $ilCtrl->setParameterByClass("ilhelpgui", "help_screen_id", $this->getScreenId() . "." . $_GET["ref_id"]);
199 }

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

Referenced by initHelp().

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

◆ setDefaultScreenId()

ilHelpGUI::setDefaultScreenId (   $a_part,
  $a_id 
)

Set default screen id.

Parameters

return

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

77 {
78 $this->def_screen_id[$a_part] = $a_id;
79 }

◆ setScreenId()

ilHelpGUI::setScreenId (   $a_id)

Set screen id.

Parameters

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

87 {
88 $this->screen_id[self::ID_PART_SCREEN] = $a_id;
89 }

References ID_PART_SCREEN.

◆ setScreenIdComponent()

ilHelpGUI::setScreenIdComponent (   $a_comp)

Set screen id component.

Parameters

return

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

108 {
109 $this->screen_id_component = $a_comp;
110 }

◆ setSubScreenId()

ilHelpGUI::setSubScreenId (   $a_id)

Set sub screen id.

Parameters

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

97 {
98 $this->screen_id[self::ID_PART_SUB_SCREEN] = $a_id;
99 }

References ID_PART_SUB_SCREEN.

◆ showHelp()

ilHelpGUI::showHelp ( )

Show online help.

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

221 {
223 $lng->loadLanguageModule("help");
224 $ui = $this->ui;
225
226 if ($_GET["help_screen_id"] != "") {
227 ilSession::set("help_screen_id", $_GET["help_screen_id"]);
228 $help_screen_id = $_GET["help_screen_id"];
229 } else {
230 $help_screen_id = ilSession::get("help_screen_id");
231 }
232
233 ilSession::set("help_search_term", "");
234
235 $this->resetCurrentPage();
236
237 $id_arr = explode(".", $help_screen_id);
238 include_once("./Services/Help/classes/class.ilHelpMapping.php");
239 include_once("./Services/Help/classes/class.ilHelp.php");
240
241 $help_arr = ilHelpMapping::getHelpSectionsForId($id_arr[0], $id_arr[1]);
242 $oh_lm_id = ilHelp::getHelpLMId();
243
244 if ($oh_lm_id > 0) {
245 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
246 $acc = new ilAccordionGUI();
247 $acc->setId("oh_acc_" . $h_id);
248 $acc->setUseSessionStorage(true);
249 $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
250
251 foreach ($help_arr as $h_id) {
252 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
253 $st_id = $h_id;
254 if (!ilLMObject::_exists($st_id)) {
255 continue;
256 }
257
258 $pages = ilLMObject::getPagesOfChapter($oh_lm_id, $st_id);
259 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
260 $grp_list = new ilGroupedListGUI();
261 foreach ($pages as $pg) {
262 $grp_list->addEntry(
263 $this->replaceMenuItemTags((string) ilLMObject::_lookupTitle($pg["child"])),
264 "#",
265 "",
266 "return il.Help.showPage(" . $pg["child"] . ");"
267 );
268 }
269
270 $acc->addItem(ilLMObject::_lookupTitle($st_id), $grp_list->getHTML());
271 }
272
273 $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
274 $h_tpl->setVariable("HEAD", $lng->txt("help"));
275
276 $h_tpl->setCurrentBlock("search");
277 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
278 $h_tpl->setVariable("GL_SEARCH", ilGlyphGUI::get(ilGlyphGUI::SEARCH));
279 $h_tpl->setVariable("HELP_SEARCH_LABEL", $this->lng->txt("help_search_label"));
280 $h_tpl->parseCurrentBlock();
281
282 if (count($help_arr) > 0) {
283 $h_tpl->setVariable("CONTENT", $acc->getHTML());
284 } else {
285 $mess = $ui->factory()->messageBox()->info($lng->txt("help_no_content"));
286 $h_tpl->setVariable("CONTENT", $ui->renderer()->render([$mess]));
287 }
288
289 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
290 $h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
291 echo $h_tpl->get();
292 }
293 exit;
294 }
Accordion user interface class.
replaceMenuItemTags(string $content)
Help page post processing.
static getPagesOfChapter($a_lm_id, $a_chap_id)
Get pages of chapter.
static _exists($a_id)
checks wether a lm content object with specified id exists or not

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

+ Here is the call graph for this function:

◆ showPage()

ilHelpGUI::showPage ( )

Show page.

Parameters

return

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

303 {
305 $ui = $this->ui;
306
307 $page_id = (int) $_GET["help_page"];
308
309 $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
310 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
311
312
313 if (($t = ilSession::get("help_search_term")) != "") {
314 $back_button = $ui->factory()->button()->bulky($ui->factory()->symbol()->glyph()->back(), $lng->txt("back"), "#")->withOnLoadCode(function ($id) use ($t) {
315 return
316 "$(\"#$id\").click(function() { return il.Help.search('" . ilUtil::prepareFormOutput($t) . "'); return false;});";
317 });
318 $h_tpl->setVariable("BACKBUTTON", $ui->renderer()->renderAsync($back_button));
319 } else {
320 $back_button = $ui->factory()->button()->bulky($ui->factory()->symbol()->glyph()->back(), $lng->txt("back"), "#")->withOnLoadCode(function ($id) {
321 return
322 "$(\"#$id\").click(function() { return il.Help.listHelp(event, true); return false;});";
323 });
324 $h_tpl->setVariable("BACKBUTTON", $ui->renderer()->renderAsync($back_button));
325 }
326
327 $h_tpl->setVariable(
328 "HEAD",
329 $this->replaceMenuItemTags((string) ilLMObject::_lookupTitle($page_id))
330 );
331
332 include_once("./Services/COPage/classes/class.ilPageUtil.php");
333 if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id)) {
334 exit;
335 }
336 include_once("./Services/COPage/classes/class.ilPageObject.php");
337 include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
338
339 // get page object
340 include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
341 include_once("./Modules/LearningModule/classes/class.ilLMPageGUI.php");
342 $page_gui = new ilLMPageGUI($page_id);
343 $cfg = $page_gui->getPageConfig();
344 $page_gui->setPresentationTitle("");
345 $page_gui->setTemplateOutput(false);
346 $page_gui->setHeader("");
347 $page_gui->setRawPageContent(true);
348 $cfg->setEnablePCType("Map", false);
349 $cfg->setEnablePCType("Tabs", false);
350 $cfg->setEnablePCType("FileList", false);
351
352 $page_gui->getPageObject()->buildDom();
353 $int_links = $page_gui->getPageObject()->getInternalLinks();
354 $link_xml = $this->getLinkXML($int_links);
355 $link_xml .= $this->getLinkTargetsXML();
356 //echo htmlentities($link_xml);
357 $page_gui->setLinkXML($link_xml);
358
359 $ret = $this->replaceMenuItemTags((string) $page_gui->showPage());
360
361 $h_tpl->setVariable("CONTENT", $ret);
362 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
363 $h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
364
365 ilSession::set("help_pg", $page_id);
366
367 $page = $h_tpl->get();
368
369 // replace style classes
370 //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page);
371
372 echo $page;
373 exit;
374 }
getLinkXML($a_int_links)
get xml for links
getLinkTargetsXML()
Get XMl for Link Targets.
Extension of ilPageObjectGUI for learning modules.
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)
$ret
Definition: parser.php:6

References $_GET, $lng, $ret, $ui, ilPageUtil\_existsAndNotEmpty(), ilLMObject\_lookupTitle(), ilGlyphGUI\CLOSE, exit, ilGlyphGUI\get(), ilSession\get(), getLinkTargetsXML(), getLinkXML(), ilUtil\prepareFormOutput(), replaceMenuItemTags(), ilSession\set(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilHelpGUI::$ctrl
protected

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

Referenced by getLinkXML(), initHelp(), and setCtrlPar().

◆ $def_screen_id

ilHelpGUI::$def_screen_id = array()

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

◆ $help_sections

ilHelpGUI::$help_sections = array()

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

◆ $lng

ilHelpGUI::$lng
protected

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

Referenced by getTabTooltipText(), search(), showHelp(), and showPage().

◆ $raw_menu_items

ilHelpGUI::$raw_menu_items = null
protected

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

◆ $screen_id

ilHelpGUI::$screen_id = array()

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

Referenced by getScreenId().

◆ $settings

ilHelpGUI::$settings
protected

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

Referenced by hasSections().

◆ $ui

ilHelpGUI::$ui
protected

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

Referenced by search(), showHelp(), and showPage().

◆ $user

ilHelpGUI::$user
protected

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

Referenced by activateTooltips(), and deactivateTooltips().

◆ ID_PART_COMPONENT

const ilHelpGUI::ID_PART_COMPONENT = "component"

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

◆ ID_PART_SCREEN

◆ ID_PART_SUB_SCREEN

const ilHelpGUI::ID_PART_SUB_SCREEN = "sub_screen"

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

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


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