ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilHelpGUI Class Reference

Help GUI class. More...

+ Collaboration diagram for ilHelpGUI:

Public Member Functions

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

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:
class.ilHelpGUI.php 56474 2014-12-16 16:25:26Z akill

ilHelpGUI: ilLMPageGUI

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

Member Function Documentation

ilHelpGUI::activateTooltips ( )

Activate tooltips.

Parameters
@return

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

References $ilUser.

{
global $ilUser;
$ilUser->writePref("hide_help_tt", "0");
}
ilHelpGUI::addHelpSection (   $a_help_id,
  $a_level = 1 
)

Add help section.

Parameters
@return

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

{
$this->help_sections[] = array("help_id" => $a_help_id, $a_level);
}
ilHelpGUI::deactivateTooltips ( )

Deactivate tooltips.

Parameters
@return

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

References $ilUser.

{
global $ilUser;
$ilUser->writePref("hide_help_tt", "1");
}
ilHelpGUI::executeCommand ( )

execute command

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

References $cmd.

{
$cmd = $this->ctrl->getCmd("showHelp");
$next_class = $this->ctrl->getNextClass($this);
switch($next_class)
{
default:
return $this->$cmd();
break;
}
}
ilHelpGUI::getHelpSections ( )

Get help sections.

Parameters
@return

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

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

{
include_once("./Services/Help/classes/class.ilHelpMapping.php");
return ilHelpMapping::getHelpSectionsForId($this->getScreenId(), (int) $_GET["ref_id"]);
}

+ Here is the call graph for this function:

ilHelpGUI::getLinkTargetsXML ( )

Get XMl for Link Targets.

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

Referenced by showPage().

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

+ Here is the caller graph for this function:

ilHelpGUI::getLinkXML (   $a_int_links)

get xml for links

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

References $ilCtrl, $target_arr, and $target_id.

Referenced by showPage().

{
global $ilCtrl;
$link_info = "<IntLinkInfos>";
foreach ($a_int_links as $int_link)
{
$target = $int_link["Target"];
if (substr($target, 0, 4) == "il__")
{
$target_arr = explode("_", $target);
$type = $int_link["Type"];
$targetframe = "None";
// anchor
$anc = $anc_add = "";
if ($int_link["Anchor"] != "")
{
$anc = $int_link["Anchor"];
$anc_add = "_".rawurlencode($int_link["Anchor"]);
}
switch($type)
{
case "PageObject":
case "StructureObject":
if ($type == "PageObject")
{
$href = "#pg_".$target_id;
}
else
{
$href = "#";
}
break;
}
$link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
"TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"\" Anchor=\"\"/>";
}
}
$link_info.= "</IntLinkInfos>";
return $link_info;
}

+ Here is the caller graph for this function:

ilHelpGUI::getScreenId ( )

Get screen id.

Parameters
@return

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

References $screen_id, ID_PART_SCREEN, and ID_PART_SUB_SCREEN.

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

{
$comp = ($this->screen_id_component != "")
? $this->screen_id_component
: $this->def_screen_id[self::ID_PART_COMPONENT];
if ($comp == "")
{
return "";
}
$scr_id = ($this->screen_id[self::ID_PART_SCREEN] != "")
? $this->screen_id[self::ID_PART_SCREEN]
: $this->def_screen_id[self::ID_PART_SCREEN];
$sub_scr_id = ($this->screen_id[self::ID_PART_SUB_SCREEN] != "")
? $this->screen_id[self::ID_PART_SUB_SCREEN]
: $this->def_screen_id[self::ID_PART_SUB_SCREEN];
$screen_id = $comp."/".
$scr_id."/".
$sub_scr_id;
return $screen_id;
}

+ Here is the caller graph for this function:

ilHelpGUI::getTabTooltipText (   $a_tab_id)

Get tab tooltip text.

Parameters
string$a_tab_idtab id
Returns
string tooltip text

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

References $lng, and ilHelp\getTooltipPresentationText().

{
global $lng;
include_once("./Services/Help/classes/class.ilHelp.php");
if ($this->screen_id_component != "")
{
return ilHelp::getTooltipPresentationText($this->screen_id_component."_".$a_tab_id);
//return $lng->txt("help_tt_".$this->screen_id_component."_".$a_tab_id);
}
return "";
}

+ Here is the call graph for this function:

ilHelpGUI::hasSections ( )

Has sections?

Parameters
@return

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

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

{
global $ilSetting;
include_once("./Services/Help/classes/class.ilHelpMapping.php");
}

+ Here is the call graph for this function:

ilHelpGUI::ilHelpGUI ( )

constructor

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

References $ilCtrl.

{
global $ilCtrl;
$this->ctrl =& $ilCtrl;
}
ilHelpGUI::initHelp (   $a_tpl)

Render current help page.

Parameters
@return

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

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

{
$module_id = (int) $ilSetting->get("help_module");
if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de")
{
if (ilSession::get("help_pg") > 0)
{
$a_tpl->addOnLoadCode("il.Help.showCurrentPage(".ilSession::get("help_pg").");", 3);
}
if ($ilUser->getPref("hide_help_tt"))
{
$a_tpl->addOnLoadCode("if (il && il.Help) il.Help.switchTooltips();", 3);
}
}
}

+ Here is the call graph for this function:

ilHelpGUI::resetCurrentPage ( )

Hide help.

Parameters
@return

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

References ilSession\clear().

Referenced by showHelp().

{
ilSession::clear("help_pg");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilHelpGUI::setCtrlPar ( )

Get help section url parameter.

Parameters
@return

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

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

{
global $ilCtrl;
/*$h_ids = $sep = "";
foreach ($this->getHelpSections() as $hs)
{
$h_ids.= $sep.$hs;
$sep = ",";
}*/
$ilCtrl->setParameterByClass("ilhelpgui", "help_screen_id", $this->getScreenId().".".$_GET["ref_id"]);
}

+ Here is the call graph for this function:

ilHelpGUI::setDefaultScreenId (   $a_part,
  $a_id 
)

Set default screen id.

Parameters
@return

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

{
$this->def_screen_id[$a_part] = $a_id;
}
ilHelpGUI::setScreenId (   $a_id)

Set screen id.

Parameters

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

References ID_PART_SCREEN.

{
$this->screen_id[self::ID_PART_SCREEN] = $a_id;
}
ilHelpGUI::setScreenIdComponent (   $a_comp)

Set screen id component.

Parameters
@return

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

{
$this->screen_id_component = $a_comp;
}
ilHelpGUI::setSubScreenId (   $a_id)

Set sub screen id.

Parameters

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

References ID_PART_SUB_SCREEN.

{
$this->screen_id[self::ID_PART_SUB_SCREEN] = $a_id;
}
ilHelpGUI::showHelp ( )

Show online help.

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

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

{
global $ilHelp, $lng, $ilSetting;
if ($_GET["help_screen_id"] != "")
{
ilSession::set("help_screen_id", $_GET["help_screen_id"]);
$help_screen_id = $_GET["help_screen_id"];
}
else
{
$help_screen_id = ilSession::get("help_screen_id");
}
$this->resetCurrentPage();
$id_arr = explode(".", $help_screen_id);
include_once("./Services/Help/classes/class.ilHelpMapping.php");
$help_arr = ilHelpMapping::getHelpSectionsForId($id_arr[0], $id_arr[1]);
$hm = (int) $ilSetting->get("help_module");
if ((OH_REF_ID > 0 || $hm > 0) && count($help_arr) > 0)
{
if (OH_REF_ID > 0)
{
$oh_lm_id = ilObject::_lookupObjId(OH_REF_ID);
}
else
{
include_once("./Services/Help/classes/class.ilObjHelpSettings.php");
}
include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
$acc = new ilAccordionGUI();
$acc->setId("oh_acc_".$h_id);
$acc->setUseSessionStorage(true);
$acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
foreach ($help_arr as $h_id)
{
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
$st_id = $h_id;
if (!ilLMObject::_exists($st_id))
{
continue;
}
$pages = ilLMObject::getPagesOfChapter($oh_lm_id, $st_id);
include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
$grp_list = new ilGroupedListGUI();
foreach ($pages as $pg)
{
$grp_list->addEntry(ilLMObject::_lookupTitle($pg["child"]), "#", "",
"return il.Help.showPage(".$pg["child"].");");
}
$acc->addItem(ilLMObject::_lookupTitle($st_id), $grp_list->getHTML());
}
$h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
$h_tpl->setVariable("HEAD", $lng->txt("help"));
$h_tpl->setVariable("CONTENT", $acc->getHTML());
include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
$h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
echo $h_tpl->get();
}
}

+ Here is the call graph for this function:

ilHelpGUI::showPage ( )

Show page.

Parameters
@return

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

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

{
global $lng;
$page_id = (int) $_GET["help_page"];
$h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
$h_tpl->setCurrentBlock("backlink");
$h_tpl->setVariable("TXT_BACK", $lng->txt("back"));
$h_tpl->setVariable("ONCLICK_BACK",
"return il.Help.listHelp(event, true);");
$h_tpl->parseCurrentBlock();
$h_tpl->setVariable("HEAD", $lng->txt("help")." - ".
include_once("./Services/COPage/classes/class.ilPageUtil.php");
if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id))
{
}
include_once("./Services/COPage/classes/class.ilPageObject.php");
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
// get page object
include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
include_once("./Modules/LearningModule/classes/class.ilLMPageGUI.php");
$page_gui = new ilLMPageGUI($page_id);
$cfg = $page_gui->getPageConfig();
$page_gui->setPresentationTitle("");
$page_gui->setTemplateOutput(false);
$page_gui->setHeader("");
$page_gui->setRawPageContent(true);
$cfg->setEnablePCType("Map", false);
$cfg->setEnablePCType("Tabs", false);
$cfg->setEnablePCType("FileList", false);
$page_gui->getPageObject()->buildDom();
$int_links = $page_gui->getPageObject()->getInternalLinks();
$link_xml = $this->getLinkXML($int_links);
$link_xml.= $this->getLinkTargetsXML();
//echo htmlentities($link_xml);
$page_gui->setLinkXML($link_xml);
$ret = $page_gui->showPage();
$h_tpl->setVariable("CONTENT", $ret);
include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
$h_tpl->setVariable("CLOSE_IMG", ilGlyphGUI::get(ilGlyphGUI::CLOSE));
ilSession::set("help_pg", $page_id);
$page = $h_tpl->get();
// replace style classes
//$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page);
echo $page;
}

+ Here is the call graph for this function:

Field Documentation

ilHelpGUI::$def_screen_id = array()

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

ilHelpGUI::$help_sections = array()

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

ilHelpGUI::$screen_id = array()

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

Referenced by getScreenId().

const ilHelpGUI::ID_PART_COMPONENT = "component"

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

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: