ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilHelpGUI Class Reference

Help GUI class. More...

+ Inheritance diagram for ilHelpGUI:
+ Collaboration diagram for ilHelpGUI:

Public Member Functions

 __construct ()
 
 setDefaultScreenId (string $a_part, string $a_id)
 
 setScreenId (string $a_id)
 
 setSubScreenId (string $a_id)
 
 setScreenIdComponent (string $a_comp)
 
 getScreenId ()
 
 addHelpSection (string $a_help_id, int $a_level=1)
 
 hasSections ()
 
 getHelpSections ()
 
 setCtrlPar ()
 
 executeCommand ()
 
 showHelp ()
 
 showPage ()
 
 resetCurrentPage ()
 
 getTabTooltipText (string $a_tab_id)
 
 initHelp (ilGlobalTemplateInterface $a_tpl, string $ajax_url)
 
 isHelpPageActive ()
 
 deactivateTooltips ()
 
 activateTooltips ()
 
 getLinkXML (array $a_int_links)
 
 getLinkTargetsXML ()
 Get XMl for Link Targets. More...
 
 search ()
 
 showTooltips ()
 
 isHelpActive ()
 
 areTooltipsActive ()
 
 savePersonalSettingFromLegacyForm (ilPropertyFormGUI $form)
 
 addPersonalSettingToLegacyForm (ilPropertyFormGUI $form)
 
 if (is_null(self::$internal_service))
 temporary move it here until DIC holds help service instead of ilHelpGUI More...
 

Data Fields

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

Protected Member Functions

 initUI ()
 
 symbol ()
 
 replaceMenuItemTags (string $content)
 
 replaceItemTag (string $content, \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem $item)
 

Protected Attributes

ILIAS Repository InternalGUIService $gui
 
ILIAS Help Presentation PresentationManager $presentation
 
ILIAS Help Map MapManager $help_map
 
StandardGUIRequest $help_request
 
ilCtrl $ctrl
 
ilSetting $settings
 
ilLanguage $lng
 
ilObjUser $user
 
string $screen_id_component = ''
 
ILIAS DI UIServices $ui
 
array $raw_menu_items = null
 

Static Protected Attributes

static ILIAS Help InternalService $internal_service = null
 

Detailed Description

Help GUI class.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilHelpGUI::__construct ( )

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

References ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

50  {
51  $domain = $this->internal()->domain();
52 
53  $this->settings = $domain->settings();
54  $this->lng = $domain->lng();
55  $this->user = $domain->user();
56 
57  $this->help_map = $domain->map();
58  $this->presentation = $domain->presentation();
59  }
+ Here is the call graph for this function:

Member Function Documentation

◆ activateTooltips()

ilHelpGUI::activateTooltips ( )

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

References $user, and ilObjUser\writePref().

348  : void
349  {
350  $ilUser = $this->user;
351 
352  $ilUser->writePref("hide_help_tt", "0");
353  }
writePref(string $a_keyword, string $a_value)
ilObjUser $user
+ Here is the call graph for this function:

◆ addHelpSection()

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

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

125  : void {
126  $this->help_sections[] = array("help_id" => $a_help_id, $a_level);
127  }

◆ addPersonalSettingToLegacyForm()

ilHelpGUI::addPersonalSettingToLegacyForm ( ilPropertyFormGUI  $form)

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

References $DIC, ilPropertyFormGUI\addItem(), areTooltipsActive(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

561  : void
562  {
563  if ($this->areTooltipsActive()) {
564  $this->lng->loadLanguageModule('help');
565  $cb = new ilCheckboxInputGUI($this->lng->txt('help_toggle_tooltips'), 'help_tooltips');
566  $cb->setChecked(!($this->user->prefs['hide_help_tt'] ?? false));
567  $cb->setInfo($this->lng->txt('help_toggle_tooltips_info'));
568  $form->addItem($cb);
569  }
570  }
+ Here is the call graph for this function:

◆ areTooltipsActive()

ilHelpGUI::areTooltipsActive ( )

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

Referenced by addPersonalSettingToLegacyForm(), and savePersonalSettingFromLegacyForm().

549  : bool
550  {
551  return $this->internal()->domain()->module()->areTooltipsActive();
552  }
+ Here is the caller graph for this function:

◆ deactivateTooltips()

ilHelpGUI::deactivateTooltips ( )

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

References $user, and ilObjUser\writePref().

341  : void
342  {
343  $ilUser = $this->user;
344 
345  $ilUser->writePref("hide_help_tt", "1");
346  }
writePref(string $a_keyword, string $a_value)
ilObjUser $user
+ Here is the call graph for this function:

◆ executeCommand()

ilHelpGUI::executeCommand ( )

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

References ILIAS\Repository\ctrl(), and initUI().

149  : string
150  {
151  $this->initUI();
152  $cmd = $this->ctrl->getCmd("showHelp") ?: "showHelp";
153  return (string) $this->$cmd();
154  }
+ Here is the call graph for this function:

◆ getHelpSections()

ilHelpGUI::getHelpSections ( )

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

References getScreenId().

134  : array
135  {
136  return $this->help_map->getHelpSectionsForId(
137  $this->getScreenId(),
138  $this->help_request->getRefId()
139  );
140  }
+ Here is the call graph for this function:

◆ getLinkTargetsXML()

ilHelpGUI::getLinkTargetsXML ( )

Get XMl for Link Targets.

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

Referenced by showPage().

398  : string
399  {
400  $link_info = "<LinkTargets>";
401  $link_info .= "<LinkTarget TargetFrame=\"None\" LinkTarget=\"\" OnClick=\"return il.Help.openLink(event);\" />";
402  $link_info .= "</LinkTargets>";
403  return $link_info;
404  }
+ Here is the caller graph for this function:

◆ getLinkXML()

ilHelpGUI::getLinkXML ( array  $a_int_links)

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

Referenced by showPage().

357  : string {
358  $href = "";
359  $link_info = "<IntLinkInfos>";
360  foreach ($a_int_links as $int_link) {
361  $target = $int_link["Target"];
362  if (strpos($target, "il__") === 0) {
363  $target_arr = explode("_", $target);
364  $target_id = $target_arr[count($target_arr) - 1];
365  $type = $int_link["Type"];
366  $targetframe = "None";
367 
368  // anchor
369  $anc = $anc_add = "";
370  if (($int_link["Anchor"] ?? "") != "") {
371  $anc = $int_link["Anchor"];
372  $anc_add = "_" . rawurlencode($int_link["Anchor"]);
373  }
374 
375  switch ($type) {
376  case "PageObject":
377  case "StructureObject":
378  if ($type === "PageObject") {
379  $href = "#pg_" . $target_id;
380  } else {
381  $href = "#";
382  }
383  break;
384  }
385 
386  $link_info .= "<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
387  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"\" Anchor=\"\"/>";
388  }
389  }
390  $link_info .= "</IntLinkInfos>";
391 
392  return $link_info;
393  }
+ Here is the caller graph for this function:

◆ getScreenId()

ilHelpGUI::getScreenId ( )

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

References $screen_id.

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

97  : string
98  {
99  $comp = ($this->screen_id_component != "")
100  ? $this->screen_id_component
101  : ($this->def_screen_id[self::ID_PART_COMPONENT] ?? '');
102 
103  if ($comp == "") {
104  return "";
105  }
106 
107  $scr_id = (isset($this->screen_id[self::ID_PART_SCREEN]) && $this->screen_id[self::ID_PART_SCREEN] != "")
108  ? $this->screen_id[self::ID_PART_SCREEN]
109  : ($this->def_screen_id[self::ID_PART_SCREEN] ?? '');
110 
111  $sub_scr_id = (isset($this->screen_id[self::ID_PART_SUB_SCREEN]) && $this->screen_id[self::ID_PART_SUB_SCREEN] != "")
112  ? $this->screen_id[self::ID_PART_SUB_SCREEN]
113  : ($this->def_screen_id[self::ID_PART_SUB_SCREEN] ?? '');
114 
115  $screen_id = $comp . "/" .
116  $scr_id . "/" .
117  $sub_scr_id;
118 
119  return $screen_id;
120  }
array $screen_id
+ Here is the caller graph for this function:

◆ getTabTooltipText()

ilHelpGUI::getTabTooltipText ( string  $a_tab_id)

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

295  : string
296  {
297  if ($this->screen_id_component != "") {
298  return $this->internal()->domain()->tooltips()->getTooltipPresentationText($this->screen_id_component . "_" . $a_tab_id);
299  }
300  return "";
301  }

◆ hasSections()

ilHelpGUI::hasSections ( )

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

References getScreenId().

129  : bool
130  {
131  return $this->help_map->hasScreenIdSections($this->getScreenId());
132  }
+ Here is the call graph for this function:

◆ if()

ilHelpGUI::if ( is_null(self::$internal_service)  )

temporary move it here until DIC holds help service instead of ilHelpGUI

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

579  {
580  self::$internal_service = new \ILIAS\Help\InternalService(
581  $DIC
582  );
583  }
global $DIC
Definition: feed.php:28

◆ initHelp()

ilHelpGUI::initHelp ( ilGlobalTemplateInterface  $a_tpl,
string  $ajax_url 
)

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

References $DIC, $ilSetting, ilGlobalTemplateInterface\addJavaScript(), ilGlobalTemplateInterface\addOnLoadCode(), ilSession\get(), ilCtrl\getLinkTargetByClass(), iljQueryUtil\initMaphilight(), initUI(), and setCtrlPar().

306  : void {
307  global $DIC;
308 
309  $this->initUI();
310  $ilUser = $DIC->user();
311  $ilSetting = $DIC->settings();
312  $ctrl = $DIC->ctrl();
313 
314  $a_tpl->addJavaScript("./Services/Help/js/ilHelp.js");
315  $a_tpl->addJavaScript("./Services/Accordion/js/accordion.js");
317  $a_tpl->addJavaScript("./Services/COPage/js/ilCOPagePres.js");
318 
319  $this->setCtrlPar();
320  $a_tpl->addOnLoadCode(
321  "il.Help.setAjaxUrl('" .
322  $ctrl->getLinkTargetByClass("ilhelpgui", "", "", true)
323  . "');"
324  );
325 
326 
327  if ($this->presentation->isHelpActive()) {
328  if (ilSession::get("help_pg") > 0) {
329  $a_tpl->addOnLoadCode("il.Help.showCurrentPage(" . ilSession::get("help_pg") . ");", 3);
330  } else {
331  $a_tpl->addOnLoadCode("il.Help.listHelp(null);", 3);
332  }
333  }
334  }
static get(string $a_var)
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
global $DIC
Definition: feed.php:28
static initMaphilight()
Inits and add maphilight to the general template.
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
global $ilSetting
Definition: privfeed.php:18
+ Here is the call graph for this function:

◆ initUI()

ilHelpGUI::initUI ( )
protected

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

References ILIAS\Repository\ctrl(), and ILIAS\Repository\ui().

Referenced by executeCommand(), and initHelp().

61  : void
62  {
63  $this->ui = $this->internal()->gui()->ui();
64  $gui = $this->internal()->gui();
65  $this->ctrl = $gui->ctrl();
66  $this->help_request = $gui->standardRequest();
67  }
ILIAS Repository InternalGUIService $gui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isHelpActive()

ilHelpGUI::isHelpActive ( )

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

544  : bool
545  {
546  return $this->internal()->domain()->module()->isHelpActive();
547  }

◆ isHelpPageActive()

ilHelpGUI::isHelpPageActive ( )

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

References ilSession\get().

336  : bool
337  {
338  return (ilSession::get("help_pg") > 0);
339  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ replaceItemTag()

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

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

References $DIC, $id, and $path.

Referenced by replaceMenuItemTags().

489  : string {
490  global $DIC;
491  $mmc = $DIC->globalScreen()->collector()->mainmenu();
492 
493  $id = $item->getProviderIdentification()->getInternalIdentifier();
494  $ws = "[ \t\r\f\v\n]*";
495 
496  // menu item path
497  while (preg_match("~\[(menu" . $ws . "path$ws=$ws(\"$id\")$ws)/\]~i", $content, $found)) {
498  $path = "";
499  if ($item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild) {
500  $parent = $mmc->getItemInformation()->getParent($item);
501  if ($parent !== null) {
502  $parent = $mmc->getSingleItemFromRaw($parent);
503  $path = $this->getTitleForItem($parent) . " > ";
504  }
505  }
506  $path .= $this->getTitleForItem($item);
507  $content = preg_replace(
508  '~\[' . $found[1] . '/\]~i',
509  "<strong>" . $path . "</strong>",
510  $content
511  );
512  }
513  // menu item
514  while (preg_match("~\[(menu" . $ws . "item$ws=$ws(\"$id\")$ws)/\]~i", $content, $found)) {
515  $content = preg_replace(
516  '~\[' . $found[1] . '/\]~i',
517  "<strong>" . $this->getTitleForItem($item) . "</strong>",
518  $content
519  );
520  }
521  return $content;
522  }
Class ChatMainBarProvider .
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ replaceMenuItemTags()

ilHelpGUI::replaceMenuItemTags ( string  $content)
protected

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

References $DIC, and replaceItemTag().

Referenced by showHelp(), and showPage().

466  : string {
467  global $DIC;
468 
469  $mmc = $DIC->globalScreen()->collector()->mainmenu();
470  if ($this->raw_menu_items == null) {
471  $mmc->collectOnce();
472  $this->raw_menu_items = iterator_to_array($mmc->getRawItems());
473  }
474 
475  foreach ($this->raw_menu_items as $item) {
476  if ($item instanceof Item\LinkList) {
477  foreach ($item->getLinks() as $link) {
478  $content = $this->replaceItemTag($content, $link);
479  }
480  }
481  $content = $this->replaceItemTag($content, $item);
482  }
483  return $content;
484  }
global $DIC
Definition: feed.php:28
replaceItemTag(string $content, \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem $item)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetCurrentPage()

ilHelpGUI::resetCurrentPage ( )

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

References ilSession\clear().

Referenced by search(), and showHelp().

290  : void
291  {
292  ilSession::clear("help_pg");
293  }
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ savePersonalSettingFromLegacyForm()

ilHelpGUI::savePersonalSettingFromLegacyForm ( ilPropertyFormGUI  $form)

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

References areTooltipsActive(), ilPropertyFormGUI\getInput(), and ILIAS\Repository\user().

554  : void
555  {
556  if ($this->areTooltipsActive()) {
557  $this->user->setPref('hide_help_tt', (string) (int) !$form->getInput('help_tooltips'));
558  }
559  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

◆ search()

ilHelpGUI::search ( )

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

References $id, $lng, $r, $ui, ilLMObject\_lookupTitle(), exit, ilSession\get(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\prepareFormOutput(), resetCurrentPage(), ilSession\set(), symbol(), ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

406  : void
407  {
408  $lng = $this->lng;
409  $ui = $this->ui;
410 
411  $term = $this->help_request->getTerm();
412 
413  if ($term === "") {
414  $term = ilSession::get("help_search_term");
415  }
416 
417  $this->resetCurrentPage();
418 
419  $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
420 
421  $back_button = $ui->factory()->button()->bulky($ui->factory()->symbol()->glyph()->back(), $lng->txt("back"), "#")->withOnLoadCode(function ($id) {
422  return
423  "$(\"#$id\").click(function() { return il.Help.listHelp(event, true); return false;});";
424  });
425  $h_tpl->setVariable("BACKBUTTON", $ui->renderer()->renderAsync($back_button));
426 
427  $h_tpl->setVariable("HEAD", $lng->txt("help") . " - " .
428  $lng->txt("search_result"));
429 
430  $h_tpl->setCurrentBlock("search");
431  $h_tpl->setVariable("GL_SEARCH", $this->symbol()->glyph("search")->render());
432  $h_tpl->setVariable("HELP_SEARCH_LABEL", $this->lng->txt("help_search_label"));
433  $h_tpl->setVariable("VAL_SEARCH", ilLegacyFormElementsUtil::prepareFormOutput($term));
434  $h_tpl->parseCurrentBlock();
435 
436  $h_tpl->setVariable("CLOSE_IMG", $this->symbol()->glyph("close")->render());
437 
438  $items = [];
439  $module = $this->internal()->domain()->module();
440  foreach ($module->getActiveModules() as $module_id) {
441  $lm_id = $module->lookupModuleLmId($module_id);
442  $s = new ilRepositoryObjectDetailSearch($lm_id);
443  $s->setQueryString($term);
444  $result = $s->performSearch();
445  foreach ($result->getResults() as $r) {
446  $items[] = $this->ui->factory()->button()->shy(
447  ilLMObject::_lookupTitle($r["item_id"]),
448  "#"
449  )->withOnLoadCode(function ($id) use ($r) {
450  return "document.getElementById('$id').addEventListener('click', () => {return il.Help.showPage(" . $r["item_id"] . ");})";
451  });
452  }
453  }
454 
455  $list = $this->ui->factory()->listing()->unordered($items);
456  $h_tpl->setVariable("CONTENT", $this->ui->renderer()->renderAsync($list));
457 
458  ilSession::set("help_search_term", $term);
459 
460  echo $h_tpl->get();
461  exit;
462  }
static get(string $a_var)
exit
Definition: login.php:29
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
ILIAS DI UIServices $ui
static prepareFormOutput($a_str, bool $a_strip=false)
static _lookupTitle(int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static set(string $a_var, $a_val)
Set a value.
$r
+ Here is the call graph for this function:

◆ setCtrlPar()

ilHelpGUI::setCtrlPar ( )

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

References $ctrl, $refId, and getScreenId().

Referenced by initHelp().

142  : void
143  {
144  $ilCtrl = $this->ctrl;
145  $refId = (string) $this->help_request->getRefId();
146  $ilCtrl->setParameterByClass("ilhelpgui", "help_screen_id", $this->getScreenId() . "." . $refId);
147  }
$refId
Definition: xapitoken.php:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDefaultScreenId()

ilHelpGUI::setDefaultScreenId ( string  $a_part,
string  $a_id 
)

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

78  : void {
79  $this->def_screen_id[$a_part] = $a_id;
80  }

◆ setScreenId()

ilHelpGUI::setScreenId ( string  $a_id)

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

Referenced by ilObjMediaObjectGUI\createObject(), and ilObjQuestionPoolGUI\createQuestionFormObject().

82  : void
83  {
84  $this->screen_id[self::ID_PART_SCREEN] = $a_id;
85  }
+ Here is the caller graph for this function:

◆ setScreenIdComponent()

ilHelpGUI::setScreenIdComponent ( string  $a_comp)

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

Referenced by ilObjPortfolioBaseGUI\addBlog(), ilObjPortfolioBaseGUI\addPage(), ilObjCategoryGUI\assignRolesObject(), ilBookingScheduleGUI\create(), ilBookingScheduleGUI\edit(), ilExSubmissionTextGUI\editAssignmentTextObject(), ilObjCategoryGUI\executeCommand(), ilSurveyEditorGUI\executeCommand(), ilObjQuestionPoolGUI\getQueryParamInt(), ilObjRootFolderGUI\getTabs(), ilGlossaryTermGUI\getTabs(), ilObjFileBasedLMGUI\getTabs(), ilObjStyleSheetGUI\getTabs(), ilObjWikiGUI\getTabs(), ilObjSurveyQuestionPoolGUI\getTabs(), ilGlossaryPresentationGUI\getTabs(), ilObjMediaObjectGUI\getTabs(), ilLMContentRendererGUI\initHelp(), ilSurveyExecutionGUI\outSurveyPage(), ilBookingHelpAdapter\setHelpId(), ilBasicSkillTemplateGUI\setLevelHead(), ilBasicSkillGUI\setLevelHead(), ilWikiPageGUI\setScreenIdComponent(), ilObjWorkspaceFolderGUI\setTabs(), ilSkillCategoryGUI\setTabs(), ilSkillTemplateReferenceGUI\setTabs(), ilSkillTemplateCategoryGUI\setTabs(), ilPortfolioRepositoryGUI\setTabs(), ilObjPortfolioTemplateGUI\setTabs(), ilBasicSkillTemplateGUI\setTabs(), ilObjPortfolioGUI\setTabs(), ilDashboardGUI\setTabs(), ilBasicSkillGUI\setTabs(), ilObjTaxonomyGUI\setTabs(), ilObjMediaCastGUI\setTabs(), ilObjMediaPoolGUI\setTabs(), ilObjContentObjectGUI\setTabs(), ilGlossaryPresentationGUI\showDefinitionTabs(), and ilExSubmissionFileGUI\uploadFormObject().

92  : void
93  {
94  $this->screen_id_component = $a_comp;
95  }
+ Here is the caller graph for this function:

◆ setSubScreenId()

ilHelpGUI::setSubScreenId ( string  $a_id)

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

Referenced by ilBookingScheduleGUI\confirmDelete().

87  : void
88  {
89  $this->screen_id[self::ID_PART_SUB_SCREEN] = $a_id;
90  }
+ Here is the caller graph for this function:

◆ showHelp()

ilHelpGUI::showHelp ( )

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

References $id, $lng, $ui, ilLMObject\_exists(), ilLMObject\_lookupContObjID(), ilLMObject\_lookupTitle(), exit, ilAccordionGUI\FIRST_OPEN, ilSession\get(), ilLMObject\getPagesOfChapter(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), replaceMenuItemTags(), resetCurrentPage(), ilSession\set(), symbol(), ilLanguage\txt(), and ILIAS\Repository\ui().

156  : void
157  {
158  $lng = $this->lng;
159  $lng->loadLanguageModule("help");
160  $ui = $this->ui;
161 
162  if ($this->help_request->getHelpScreenId() !== "") {
163  ilSession::set("help_screen_id", $this->help_request->getHelpScreenId());
164  $help_screen_id = $this->help_request->getHelpScreenId();
165  } else {
166  $help_screen_id = ilSession::get("help_screen_id");
167  }
168 
169  ilSession::set("help_search_term", "");
170 
171  $this->resetCurrentPage();
172 
173  $id_arr = explode(".", $help_screen_id);
174  $help_arr = $this->help_map->getHelpSectionsForId($id_arr[0], (int) $id_arr[1]);
175 
176  if (count($help_arr) > 0) {
177  $acc = new ilAccordionGUI();
178  $acc->setId("oh_acc");
179  $acc->setUseSessionStorage(true);
180  $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
181 
182  foreach ($help_arr as $h_id) {
183  $st_id = $h_id;
184  if (!ilLMObject::_exists($st_id)) {
185  continue;
186  }
187  $oh_lm_id = ilLMObject::_lookupContObjID($st_id);
188  $pages = ilLMObject::getPagesOfChapter($oh_lm_id, $st_id);
189  $items = [];
190  foreach ($pages as $pg) {
191  $items[] = $this->ui->factory()->button()->shy(
192  $this->replaceMenuItemTags(ilLMObject::_lookupTitle($pg["child"])),
193  "#"
194  )->withOnLoadCode(function ($id) use ($pg) {
195  return "document.getElementById('$id').addEventListener('click', () => {return il.Help.showPage(" . $pg["child"] . ");})";
196  });
197  }
198  $list = $this->ui->factory()->listing()->unordered($items);
199  $acc->addItem(ilLMObject::_lookupTitle($st_id), $this->ui->renderer()->renderAsync($list));
200  }
201 
202  $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
203  $h_tpl->setVariable("HEAD", $lng->txt("help"));
204 
205  $h_tpl->setCurrentBlock("search");
206  $h_tpl->setVariable("GL_SEARCH", $this->symbol()->glyph("search")->render());
207  $h_tpl->setVariable("HELP_SEARCH_LABEL", $this->lng->txt("help_search_label"));
208  $h_tpl->parseCurrentBlock();
209 
210  if (count($help_arr) > 0) {
211  $h_tpl->setVariable("CONTENT", $acc->getHTML(true));
212  } else {
213  $mess = $ui->factory()->messageBox()->info($lng->txt("help_no_content"));
214  $h_tpl->setVariable("CONTENT", $ui->renderer()->render([$mess]));
215  }
216 
217  $h_tpl->setVariable("CLOSE_IMG", $this->symbol()->glyph("close")->render());
218  echo $h_tpl->get();
219  }
220  exit;
221  }
static get(string $a_var)
exit
Definition: login.php:29
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
ILIAS DI UIServices $ui
loadLanguageModule(string $a_module)
Load language module.
static _lookupTitle(int $a_obj_id)
static getPagesOfChapter(int $a_lm_id, int $a_chap_id)
Get pages of chapter.
static _exists(int $a_id)
checks wether a lm content object with specified id exists or not
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _lookupContObjID(int $a_id)
get learning module id for lm object
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
replaceMenuItemTags(string $content)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ showPage()

ilHelpGUI::showPage ( )

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

References $id, $lng, $ui, ilPageUtil\_existsAndNotEmpty(), ilLMObject\_lookupTitle(), exit, ilSession\get(), getLinkTargetsXML(), getLinkXML(), ilLegacyFormElementsUtil\prepareFormOutput(), replaceMenuItemTags(), ilSession\set(), symbol(), ilLanguage\txt(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

223  : void
224  {
225  $lng = $this->lng;
226  $ui = $this->ui;
227 
228  $page_id = $this->help_request->getHelpPage();
229 
230  $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
231 
232  if (($t = ilSession::get("help_search_term")) != "") {
233  $back_button = $ui->factory()->button()->bulky($ui->factory()->symbol()->glyph()->back(), $lng->txt("back"), "#")->withOnLoadCode(function ($id) use ($t) {
234  return
235  "$(\"#$id\").click(function() { return il.Help.search('" . ilLegacyFormElementsUtil::prepareFormOutput(
236  $t
237  ) . "'); return false;});";
238  });
239  } else {
240  $back_button = $ui->factory()->button()->bulky($ui->factory()->symbol()->glyph()->back(), $lng->txt("back"), "#")->withOnLoadCode(function ($id) {
241  return
242  "$(\"#$id\").click(function() { return il.Help.listHelp(event, true); return false;});";
243  });
244  }
245  $h_tpl->setVariable("BACKBUTTON", $ui->renderer()->renderAsync($back_button));
246 
247  $h_tpl->setVariable(
248  "HEAD",
250  );
251 
252  if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id)) {
253  exit;
254  }
255 
256  // get page object
257  $page_gui = new ilLMPageGUI($page_id);
258  $cfg = $page_gui->getPageConfig();
259  $page_gui->setPresentationTitle("");
260  $page_gui->setTemplateOutput(false);
261  $page_gui->setHeader("");
262  $page_gui->setRawPageContent(true);
263  $cfg->setEnablePCType("Map", false);
264  $cfg->setEnablePCType("Tabs", false);
265  $cfg->setEnablePCType("FileList", false);
266 
267  $page_gui->getPageObject()->buildDom();
268  $int_links = $page_gui->getPageObject()->getInternalLinks();
269  $link_xml = $this->getLinkXML($int_links);
270  $link_xml .= $this->getLinkTargetsXML();
271  //echo htmlentities($link_xml);
272  $page_gui->setLinkXml($link_xml);
273 
274  $ret = $this->replaceMenuItemTags($page_gui->showPage());
275 
276  $h_tpl->setVariable("CONTENT", $ret);
277  $h_tpl->setVariable("CLOSE_IMG", $this->symbol()->glyph("close")->render());
278 
279  ilSession::set("help_pg", $page_id);
280 
281  $page = $h_tpl->get();
282 
283  // replace style classes
284  //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page);
285 
286  echo $page;
287  exit;
288  }
static get(string $a_var)
exit
Definition: login.php:29
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
ILIAS DI UIServices $ui
static prepareFormOutput($a_str, bool $a_strip=false)
static _lookupTitle(int $a_obj_id)
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
Extension of ilPageObjectGUI for learning modules.
getLinkXML(array $a_int_links)
getLinkTargetsXML()
Get XMl for Link Targets.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
replaceMenuItemTags(string $content)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ showTooltips()

ilHelpGUI::showTooltips ( )

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

539  : bool
540  {
541  return $this->presentation->showTooltips();
542  }

◆ symbol()

ilHelpGUI::symbol ( )
protected

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

References $DIC.

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

70  {
71  global $DIC;
72  return $DIC->repository()->internal()->gui()->symbol();
73  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilHelpGUI::$ctrl
protected

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

Referenced by setCtrlPar().

◆ $def_screen_id

array ilHelpGUI::$def_screen_id = array()

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

◆ $gui

ILIAS Repository InternalGUIService ilHelpGUI::$gui
protected

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

◆ $help_map

ILIAS Help Map MapManager ilHelpGUI::$help_map
protected

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

◆ $help_request

StandardGUIRequest ilHelpGUI::$help_request
protected

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

◆ $help_sections

array ilHelpGUI::$help_sections = array()

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

◆ $internal_service

ILIAS Help InternalService ilHelpGUI::$internal_service = null
staticprotected

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

◆ $lng

ilLanguage ilHelpGUI::$lng
protected

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

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

◆ $presentation

ILIAS Help Presentation PresentationManager ilHelpGUI::$presentation
protected

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

◆ $raw_menu_items

array ilHelpGUI::$raw_menu_items = null
protected

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

◆ $screen_id

array ilHelpGUI::$screen_id = array()

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

Referenced by getScreenId().

◆ $screen_id_component

string ilHelpGUI::$screen_id_component = ''
protected

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

◆ $settings

ilSetting ilHelpGUI::$settings
protected

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

◆ $ui

ILIAS DI UIServices ilHelpGUI::$ui
protected

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

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

◆ $user

ilObjUser ilHelpGUI::$user
protected

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

Referenced by activateTooltips(), and deactivateTooltips().

◆ ID_PART_COMPONENT

const ilHelpGUI::ID_PART_COMPONENT = "component"

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

◆ ID_PART_SCREEN

const ilHelpGUI::ID_PART_SCREEN = "screen"

◆ ID_PART_SUB_SCREEN

const ilHelpGUI::ID_PART_SUB_SCREEN = "sub_screen"

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

Referenced by ilTabsGUI\removeNonTabbedLinks().


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