/** * Render help button * * @param * @return */ function renderHelpButtons() { global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser; // screen id if (defined("OH_REF_ID") && OH_REF_ID > 0) { if ($ilHelp->getScreenId() != "") { if ($this->getMode() == self::MODE_FULL) { $this->tpl->setCurrentBlock("screen_id"); $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId()); $this->tpl->parseCurrentBlock(); } } } $help_active = false; include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php"; $helpl = new ilGroupedListGUI(); $helpl->setAsDropDown(true, true); if ($ilHelp->hasSections()) { $help_active = true; $lng->loadLanguageModule("help"); //$this->tpl->setCurrentBlock("help_icon"); // add javascript needed by help (to do: move to help class) $tpl->addJavascript("./Services/Help/js/ilHelp.js"); include_once "./Services/Accordion/classes/class.ilAccordionGUI.php"; $acc = new ilAccordionGUI(); $acc->addJavascript(); $acc->addCss(); include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php"; ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "", "bottom center", "top center", false); $helpl->addEntry("<span> </span> " . $lng->txt("help_topcis"), "#", "", "il.Help.listHelp(event, false);"); } $module_id = (int) $ilSetting->get("help_module"); if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" && $ilSetting->get("help_mode") != "1") { $help_active = true; $lng->loadLanguageModule("help"); $tpl->addJavascript("./Services/Help/js/ilHelp.js"); include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php"; ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "", "bottom center", "top center", false); $helpl->addEntry('<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> ' . $lng->txt("help_tooltips"), "#", "", "return il.Help.switchTooltips(event);"); } if ($help_active) { $this->tpl->setCurrentBlock("help"); $this->tpl->setVariable("TXT_HELP", $lng->txt("help")); $this->tpl->setVariable("HELP_SELECT", $helpl->getHTML()); $this->tpl->parseCurrentBlock(); // always set ajax url $ts = $ilCtrl->getTargetScript(); $ilCtrl->setTargetScript("ilias.php"); $ilHelp->setCtrlPar(); $tpl->addOnLoadCode("il.Help.setAjaxUrl('" . $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true) . "');"); $ilCtrl->setTargetScript($ts); } }
/** * Render help button * * @param * @return */ function renderHelpButtons() { global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser; // screen id if (defined("OH_REF_ID") && OH_REF_ID > 0) { if ($ilHelp->getScreenId() != "") { $this->tpl->setCurrentBlock("screen_id"); $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId()); $this->tpl->parseCurrentBlock(); } } $help_active = false; if ($ilHelp->hasSections()) { $help_active = true; $lng->loadLanguageModule("help"); $this->tpl->setCurrentBlock("help_icon"); // add javascript needed by help (to do: move to help class) $tpl->addJavascript("./Services/Help/js/ilHelp.js"); include_once "./Services/Accordion/classes/class.ilAccordionGUI.php"; $acc = new ilAccordionGUI(); $acc->addJavascript(); $acc->addCss(); $this->tpl->setVariable("IMG_HELP", ilUtil::getImagePath("icon_help.png")); $this->tpl->parseCurrentBlock(); include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php"; ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "", "bottom center", "top center", false); } $module_id = (int) $ilSetting->get("help_module"); if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" && $ilSetting->get("help_mode") != "1") { $help_active = true; $lng->loadLanguageModule("help"); $tpl->addJavascript("./Services/Help/js/ilHelp.js"); $this->tpl->setCurrentBlock("help_tt_icon"); $this->tpl->setVariable("IMG_TT_ON", ilUtil::getImagePath("icon_tt.png")); $this->tpl->setVariable("IMG_TT_OFF", ilUtil::getImagePath("icon_tt_off.png")); $this->tpl->parseCurrentBlock(); include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php"; ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "", "bottom center", "top center", false); } if ($help_active) { // always set ajax url $ts = $ilCtrl->getTargetScript(); $ilCtrl->setTargetScript("ilias.php"); $ilHelp->setCtrlPar(); $tpl->addOnLoadCode("il.Help.setAjaxUrl('" . $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true) . "');"); $ilCtrl->setTargetScript($ts); } }