ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 

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$

ilHelpGUI: ilLMPageGUI

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

Member Function Documentation

◆ activateTooltips()

ilHelpGUI::activateTooltips ( )

Activate tooltips.

Parameters

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

References $ilUser.

401  {
402  global $ilUser;
403 
404  $ilUser->writePref("hide_help_tt", "0");
405  }
global $ilUser
Definition: imgupload.php:15

◆ addHelpSection()

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

Add help section.

Parameters

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

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

References $ilUser.

388  {
389  global $ilUser;
390 
391  $ilUser->writePref("hide_help_tt", "1");
392  }
global $ilUser
Definition: imgupload.php:15

◆ executeCommand()

ilHelpGUI::executeCommand ( )

execute command

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

References $cmd.

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

◆ getHelpSections()

ilHelpGUI::getHelpSections ( )

Get help sections.

Parameters

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

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

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

◆ getLinkTargetsXML()

ilHelpGUI::getLinkTargetsXML ( )

Get XMl for Link Targets.

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

Referenced by showPage().

462  {
463  $link_info = "<LinkTargets>";
464  $link_info.="<LinkTarget TargetFrame=\"None\" LinkTarget=\"\" OnClick=\"return il.Help.openLink(event);\" />";
465  $link_info.= "</LinkTargets>";
466  return $link_info;
467  }
+ Here is the caller graph for this function:

◆ getLinkXML()

ilHelpGUI::getLinkXML (   $a_int_links)

get xml for links

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

References $ilCtrl, $target_arr, and $target_id.

Referenced by showPage().

411  {
412  global $ilCtrl;
413 
414  $link_info = "<IntLinkInfos>";
415  foreach ($a_int_links as $int_link)
416  {
417  $target = $int_link["Target"];
418  if (substr($target, 0, 4) == "il__")
419  {
420  $target_arr = explode("_", $target);
421  $target_id = $target_arr[count($target_arr) - 1];
422  $type = $int_link["Type"];
423  $targetframe = "None";
424 
425  // anchor
426  $anc = $anc_add = "";
427  if ($int_link["Anchor"] != "")
428  {
429  $anc = $int_link["Anchor"];
430  $anc_add = "_".rawurlencode($int_link["Anchor"]);
431  }
432 
433  switch($type)
434  {
435  case "PageObject":
436  case "StructureObject":
437  if ($type == "PageObject")
438  {
439  $href = "#pg_".$target_id;
440  }
441  else
442  {
443  $href = "#";
444  }
445  break;
446 
447  }
448 
449  $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
450  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"\" Anchor=\"\"/>";
451  }
452  }
453  $link_info.= "</IntLinkInfos>";
454 
455  return $link_info;
456  }
$target_arr
Definition: goto.php:86
$target_id
Definition: goto.php:88
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ getScreenId()

ilHelpGUI::getScreenId ( )

Get screen id.

Parameters

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

References $screen_id.

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

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

References $lng, and ilHelp\getTooltipPresentationText().

344  {
345  global $lng;
346 
347  include_once("./Services/Help/classes/class.ilHelp.php");
348  if ($this->screen_id_component != "")
349  {
350  return ilHelp::getTooltipPresentationText($this->screen_id_component."_".$a_tab_id);
351  //return $lng->txt("help_tt_".$this->screen_id_component."_".$a_tab_id);
352  }
353  return "";
354  }
static getTooltipPresentationText($a_tt_id)
Get tooltip for id.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ hasSections()

ilHelpGUI::hasSections ( )

Has sections?

Parameters

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

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

129  {
130  global $ilSetting;
131 
132  include_once("./Services/Help/classes/class.ilHelpMapping.php");
134  }
getScreenId()
Get screen id.
hasScreenIdSections($a_screen_id)
Has given screen Id any sections?
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ ilHelpGUI()

ilHelpGUI::ilHelpGUI ( )

constructor

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

References $ilCtrl.

29  {
30  global $ilCtrl;
31 
32  $this->ctrl =& $ilCtrl;
33  }
global $ilCtrl
Definition: ilias.php:18

◆ initHelp()

ilHelpGUI::initHelp (   $a_tpl)

Render current help page.

Parameters

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

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

Referenced by ilTemplate\initHelp().

363  {
364  global $ilUser, $ilSetting;
365 
366  $module_id = (int) $ilSetting->get("help_module");
367 
368  if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de")
369  {
370  if (ilSession::get("help_pg") > 0)
371  {
372  $a_tpl->addOnLoadCode("il.Help.showCurrentPage(".ilSession::get("help_pg").");", 3);
373  }
374  if ($ilUser->getPref("hide_help_tt"))
375  {
376  $a_tpl->addOnLoadCode("if (il && il.Help) il.Help.switchTooltips();", 3);
377  }
378  }
379  }
static get($a_var)
Get a value.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetCurrentPage()

ilHelpGUI::resetCurrentPage ( )

Hide help.

Parameters

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

References ilSession\clear().

Referenced by showHelp().

332  {
333  ilSession::clear("help_pg");
334  }
static clear($a_var)
Unset a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCtrlPar()

ilHelpGUI::setCtrlPar ( )

Get help section url parameter.

Parameters

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

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

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  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
getScreenId()
Get screen id.
+ Here is the call graph for this function:

◆ setDefaultScreenId()

ilHelpGUI::setDefaultScreenId (   $a_part,
  $a_id 
)

Set default screen id.

Parameters

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  }

◆ setScreenIdComponent()

ilHelpGUI::setScreenIdComponent (   $a_comp)

Set screen id component.

Parameters

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  }

◆ showHelp()

ilHelpGUI::showHelp ( )

Show online help.

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

References $_GET, $ilSetting, $lng, ilLMObject\_exists(), ilObject\_lookupObjId(), ilLMObject\_lookupTitle(), exit, ilAccordionGUI\FIRST_OPEN, ilSession\get(), ilHelpMapping\getHelpSectionsForId(), ilUtil\getImagePath(), ilLMObject\getPagesOfChapter(), ilUtil\img(), ilObjHelpSettings\lookupModuleLmId(), resetCurrentPage(), and ilSession\set().

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  $this->resetCurrentPage();
202 
203  $id_arr = explode(".", $help_screen_id);
204  include_once("./Services/Help/classes/class.ilHelpMapping.php");
205  $help_arr = ilHelpMapping::getHelpSectionsForId($id_arr[0], $id_arr[1]);
206 
207  $hm = (int) $ilSetting->get("help_module");
208 
209  if ((OH_REF_ID > 0 || $hm > 0) && count($help_arr) > 0)
210  {
211  if (OH_REF_ID > 0)
212  {
213  $oh_lm_id = ilObject::_lookupObjId(OH_REF_ID);
214  }
215  else
216  {
217  include_once("./Services/Help/classes/class.ilObjHelpSettings.php");
218  $oh_lm_id = ilObjHelpSettings::lookupModuleLmId($hm);
219  }
220 
221  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
222  $acc = new ilAccordionGUI();
223  $acc->setId("oh_acc");
224  $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
225 
226  foreach ($help_arr as $h_id)
227  {
228  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
229  $st_id = $h_id;
230 
231  if (!ilLMObject::_exists($st_id))
232  {
233  continue;
234  }
235 
236  $pages = ilLMObject::getPagesOfChapter($oh_lm_id, $st_id);
237  include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
238  $grp_list = new ilGroupedListGUI();
239  foreach ($pages as $pg)
240  {
241  $grp_list->addEntry(ilLMObject::_lookupTitle($pg["child"]), "#", "",
242  "return il.Help.showPage(".$pg["child"].");");
243  }
244 
245  $acc->addItem(ilLMObject::_lookupTitle($st_id), $grp_list->getHTML());
246  }
247  $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
248  $h_tpl->setVariable("HEAD", $lng->txt("help"));
249  $h_tpl->setVariable("CONTENT", $acc->getHTML());
250  $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png")));
251  echo $h_tpl->get();
252  }
253  exit;
254  }
exit
Definition: login.php:54
_exists($a_id)
checks wether a lm content object with specified id exists or not
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
$_GET["client_id"]
static getHelpSectionsForId($a_screen_id, $a_ref_id)
Get help sections for screen id.
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
static _lookupTitle($a_obj_id)
Lookup title.
resetCurrentPage()
Hide help.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Grouped list GUI class.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static getPagesOfChapter($a_lm_id, $a_chap_id)
Get pages of chapter.
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
lookupModuleLmId($a_id)
lookup module lm id
Accordion user interface class.
+ Here is the call graph for this function:

◆ showPage()

ilHelpGUI::showPage ( )

Show page.

Parameters

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

References $_GET, $lng, $ret, ilPageUtil\_existsAndNotEmpty(), ilLMObject\_lookupTitle(), exit, ilUtil\getImagePath(), getLinkTargetsXML(), getLinkXML(), ilUtil\img(), and ilSession\set().

263  {
264  global $lng;
265 
266  $page_id = (int) $_GET["help_page"];
267 
268  $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
269  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
270 
271  $h_tpl->setCurrentBlock("backlink");
272  $h_tpl->setVariable("TXT_BACK", $lng->txt("back"));
273  $h_tpl->setVariable("ONCLICK_BACK",
274  "return il.Help.listHelp(event, true);");
275  $h_tpl->parseCurrentBlock();
276 
277 
278  $h_tpl->setVariable("HEAD", $lng->txt("help")." - ".
279  ilLMObject::_lookupTitle($page_id));
280 
281  include_once("./Services/COPage/classes/class.ilPageUtil.php");
282  if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id))
283  {
284  exit;
285  }
286  include_once("./Services/COPage/classes/class.ilPageObject.php");
287  include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
288 
289  // get page object
290  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
291  include_once("./Modules/LearningModule/classes/class.ilLMPageGUI.php");
292  $page_gui = new ilLMPageGUI($page_id);
293  $cfg = $page_gui->getPageConfig();
294  $page_gui->setPresentationTitle("");
295  $page_gui->setTemplateOutput(false);
296  $page_gui->setHeader("");
297  $page_gui->setRawPageContent(true);
298  $cfg->setEnablePCType("Map", false);
299  $cfg->setEnablePCType("Tabs", false);
300  $cfg->setEnablePCType("FileList", false);
301 
302  $page_gui->getPageObject()->buildDom();
303  $int_links = $page_gui->getPageObject()->getInternalLinks();
304  $link_xml = $this->getLinkXML($int_links);
305  $link_xml.= $this->getLinkTargetsXML();
306 //echo htmlentities($link_xml);
307  $page_gui->setLinkXML($link_xml);
308 
309  $ret = $page_gui->showPage();
310 
311  $h_tpl->setVariable("CONTENT", $ret);
312  $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png")));
313 
314  ilSession::set("help_pg", $page_id);
315 
316  $page = $h_tpl->get();
317 
318  // replace style classes
319  //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page);
320 
321  echo $page;
322  exit;
323  }
exit
Definition: login.php:54
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
$_GET["client_id"]
static set($a_var, $a_val)
Set a value.
static _lookupTitle($a_obj_id)
Lookup title.
_existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Extension of ilPageObjectGUI for learning modules.
special template class to simplify handling of ITX/PEAR
getLinkTargetsXML()
Get XMl for Link Targets.
getLinkXML($a_int_links)
get xml for links
global $lng
Definition: privfeed.php:40
+ 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

const ilHelpGUI::ID_PART_SCREEN = "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().


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