ILIAS  release_4-3 Revision
 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.

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$

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

Member Function Documentation

ilHelpGUI::activateTooltips ( )

Activate tooltips.

Parameters
@return

Definition at line 385 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 114 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 372 of file class.ilHelpGUI.php.

References $ilUser.

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

execute command

Definition at line 168 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 139 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::getScreenId ( )

Get screen id.

Parameters
@return

Definition at line 81 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 333 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 125 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 25 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 352 of file class.ilHelpGUI.php.

References $ilUser, and ilSession\get().

{
global $ilUser;
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("il.Help.switchTooltips();", 3);
}
}

+ Here is the call graph for this function:

ilHelpGUI::resetCurrentPage ( )

Hide help.

Parameters
@return

Definition at line 321 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 151 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 38 of file class.ilHelpGUI.php.

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

Set screen id.

Parameters

Definition at line 48 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 69 of file class.ilHelpGUI.php.

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

Set sub screen id.

Parameters

Definition at line 58 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 184 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().

{
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");
$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());
$h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png")));
echo $h_tpl->get();
}
}

+ Here is the call graph for this function:

ilHelpGUI::showPage ( )

Show page.

Parameters
@return

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

References $_GET, $lng, $ret, ilPageUtil\_existsAndNotEmpty(), ilLMObject\_lookupTitle(), exit, ilUtil\getImagePath(), ilUtil\img(), 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");
$page_gui =& new ilPageObjectGUI("lm", $page_id);
$page_gui->setPresentationTitle("");
$page_gui->setTemplateOutput(false);
$page_gui->setHeader("");
$page_gui->setEnabledFileLists(false);
$page_gui->setEnabledPCTabs(false);
$page_gui->setFileDownloadLink(".");
$page_gui->setFullscreenLink(".");
$page_gui->setSourcecodeDownloadScript(".");
$page_gui->setRawPageContent(true);
$page_gui->setEnabledMaps(false);
$ret = $page_gui->showPage();
$h_tpl->setVariable("CONTENT", $ret);
$h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png")));
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 19 of file class.ilHelpGUI.php.

ilHelpGUI::$help_sections = array()

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

ilHelpGUI::$screen_id = array()

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

Referenced by getScreenId().

const ilHelpGUI::ID_PART_COMPONENT = "component"

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

const ilHelpGUI::ID_PART_SUB_SCREEN = "sub_screen"

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

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


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