/**
  * Constructor
  */
 function __construct($a_temp_type, $a_parent_obj, $a_parent_cmd, $a_style_obj)
 {
     global $ilCtrl, $lng, $ilAccess, $lng, $rbacsystem;
     parent::__construct($a_parent_obj, $a_parent_cmd);
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     ilAccordionGUI::addCss();
     $this->setTitle($lng->txt("sty_templates"));
     $this->style_obj = $a_style_obj;
     $this->temp_type = $a_temp_type;
     $this->addColumn("", "", "1");
     // checkbox
     $this->addColumn($this->lng->txt("sty_template_name"), "");
     $this->addColumn($this->lng->txt("sty_preview"), "");
     $this->addColumn($this->lng->txt("sty_commands"), "", "1");
     $this->setEnableHeader(true);
     $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
     $this->setRowTemplate("tpl.style_template_row.html", "Services/Style");
     //$this->setSelectAllCheckbox("file");
     $this->getItems();
     // action commands
     if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"])) {
         $this->addMultiCommand("deleteTemplateConfirmation", $lng->txt("delete"));
         if ($a_temp_type == "table") {
             $this->addCommandButton("generateTemplate", $this->lng->txt("sty_generate_template"));
         }
         $this->addCommandButton("addTemplate", $this->lng->txt("sty_add_template"));
     }
     $this->setEnableTitle(true);
 }
 /**
  * get the HTML code for showing the card in a training
  */
 function getCardForTrainingHTML()
 {
     require_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(0));
     // get the card pages to be displayed
     if ($this->card->getTermId()) {
         $pages = $this->getGlossaryTermPages();
     } else {
         // TODO: corrently only glossary cards are supported
         $pages = array();
     }
     require_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     $question = new ilAccordionGUI();
     $question->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN);
     $question->setContentClass("xflcFlashcardPage");
     $question->addItem($pages[0]["title"], $pages[0]["html"]);
     $answers = new ilAccordionGUI();
     //$answers->setBehaviour(ilAccordionGUI::FIRST_OPEN);
     $answers->setContentClass("xflcFlashcardPage");
     for ($i = 1; $i < count($pages); $i++) {
         $answers->addItem($pages[$i]["title"], $pages[$i]["html"]);
     }
     return $question->getHTML() . $answers->getHTML();
 }
 /**
  * Get trigger table
  */
 function getImageMapTableHTML()
 {
     global $tpl, $ilToolbar, $lng, $ilCtrl;
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQueryUI();
     $tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
     $tpl->addJavascript("./Services/COPage/js/ilCOPagePCInteractiveImage.js");
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     ilAccordionGUI::addJavaScript();
     ilAccordionGUI::addCss();
     $ilToolbar->addText($lng->txt("cont_drag_element_click_save"));
     $ilToolbar->setId("drag_toolbar");
     $ilToolbar->setHidden(true);
     $ilToolbar->addButton($lng->txt("save"), "#", "", "", "", "save_pos_button");
     $ilToolbar->addButton($lng->txt("cancel"), $ilCtrl->getLinkTarget($this, "editMapAreas"));
     include_once "./Services/COPage/classes/class.ilPCIIMTriggerTableGUI.php";
     $image_map_table = new ilPCIIMTriggerTableGUI($this, "editMapAreas", $this->content_obj, $this->getParentNodeName());
     return $image_map_table->getHTML();
 }
示例#4
0
 /**
  * Show overview of assignments
  */
 function showOverviewObject()
 {
     global $tpl, $ilTabs, $ilUser, $ilToolbar;
     $this->checkPermission("read");
     include_once "./Services/Tracking/classes/class.ilLearningProgress.php";
     ilLearningProgress::_tracProgress($ilUser->getId(), $this->object->getId(), $this->object->getRefId(), 'exc');
     $ilTabs->activateTab("content");
     $this->addContentSubTabs("content");
     // show certificate?
     if ($this->object->hasUserCertificate($ilUser->getId())) {
         include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
         include_once "./Services/Certificate/classes/class.ilCertificate.php";
         $adapter = new ilExerciseCertificateAdapter($this->object);
         if (ilCertificate::_isComplete($adapter)) {
             $ilToolbar->addButton($this->lng->txt("certificate"), $this->ctrl->getLinkTarget($this, "outCertificate"));
         }
     }
     include_once "./Modules/Exercise/classes/class.ilExAssignment.php";
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     $acc = new ilAccordionGUI();
     $acc->setId("exc_ow_" . $this->object->getId());
     $ass_data = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
     include_once "./Modules/Exercise/classes/class.ilExAssignmentGUI.php";
     $ass_gui = new ilExAssignmentGUI($this->object);
     foreach ($ass_data as $ass) {
         // incoming assignment deeplink
         $force_open = false;
         if (isset($_GET["ass_id_goto"]) && (int) $_GET["ass_id_goto"] == $ass["id"]) {
             $force_open = true;
         }
         $acc->addItem($ass_gui->getOverviewHeader($ass), $ass_gui->getOverviewBody($ass), $force_open);
     }
     if (count($ass_data) < 2) {
         $acc->setBehaviour("FirstOpen");
     } else {
         $acc->setUseSessionStorage(true);
     }
     $tpl->setContent($acc->getHTML());
 }
示例#5
0
 /**
  * Get HTML for creation forms (accordion)
  *
  * @param array $a_forms
  */
 protected final function getCreationFormsHTML(array $a_forms)
 {
     global $tpl;
     // #13168- sanity check
     foreach ($a_forms as $id => $form) {
         if (!$form instanceof ilPropertyFormGUI) {
             unset($a_forms[$id]);
         }
     }
     // no accordion if there is just one form
     if (sizeof($a_forms) == 1) {
         $form_type = key($a_forms);
         $a_forms = array_shift($a_forms);
         // see bug #0016217
         if (method_exists($this, "getCreationFormTitle")) {
             $form_title = $this->getCreationFormTitle($form_type);
             if ($form_title != "") {
                 $a_forms->setTitle($form_title);
             }
         }
         return $a_forms->getHTML();
     } else {
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         $acc = new ilAccordionGUI();
         $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
         $cnt = 1;
         foreach ($a_forms as $form_type => $cf) {
             $htpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "Services/Object");
             // using custom form titles (used for repository plugins)
             $form_title = "";
             if (method_exists($this, "getCreationFormTitle")) {
                 $form_title = $this->getCreationFormTitle($form_type);
             }
             if (!$form_title) {
                 $form_title = $cf->getTitle();
             }
             // move title from form to accordion
             $htpl->setVariable("TITLE", $this->lng->txt("option") . " " . $cnt . ": " . $form_title);
             $cf->setTitle(null);
             $cf->setTitleIcon(null);
             $cf->setTableWidth("100%");
             $acc->addItem($htpl->get(), $cf->getHTML());
             $cnt++;
         }
         return "<div class='ilCreationFormSection'>" . $acc->getHTML() . "</div>";
     }
 }
 /**
  * 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>&nbsp;</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);
     }
 }
 /**
  * Show overview
  */
 function showOverview()
 {
     global $tpl, $ilTabs;
     $ilTabs->activateTab("overview");
     $this->addOverviewSubTabs("overview");
     include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php";
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     $acc = new ilAccordionGUI();
     $acc->setBehaviour("OneOpenSession");
     $acc->setId("eph_ow_" . $this->object->getId());
     $ass_data = ilEphAssignment::getAssignmentDataOfEphorus($this->object->getId());
     include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignmentGUI.php";
     $ass_gui = new ilEphAssignmentGUI($this->object);
     foreach ($ass_data as $ass) {
         $acc->addItem($ass_gui->getOverviewHeader($ass), $ass_gui->getOverviewBody($ass));
     }
     $tpl->setContent($acc->getHTML());
 }
 /**
  * render objective
  *
  * @access protected
  * @param int objective id
  * @param bool co page status
  * @param ilAccordionGUI $a_accordion 
  * @param array $a_lo_result 
  * @return string html
  */
 protected function renderObjective($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion = null, array $a_lo_result = null)
 {
     global $ilUser, $lng;
     include_once './Modules/Course/classes/class.ilCourseObjective.php';
     $objective = new ilCourseObjective($this->getContainerObject(), $a_objective_id);
     include_once './Services/Container/classes/class.ilContainerSorting.php';
     include_once './Services/Object/classes/class.ilObjectActivation.php';
     $items = ilObjectActivation::getItemsByObjective($a_objective_id);
     // sorting is handled by ilCourseObjectiveMaterials
     // $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items);
     include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
     $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
     // #13381 - map material assignment to position
     $sort_map = array();
     foreach ($objectives_lm_obj->getMaterials() as $item) {
         $sort_map[$item["lm_ass_id"]] = $item["position"];
     }
     $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
     $is_order = $this->getContainerGUI()->isActiveOrdering();
     $sort_content = array();
     foreach ($items as $item) {
         if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) {
             continue;
         }
         $item_list_gui2 = $this->getItemGUI($item);
         $item_list_gui2->enableIcon(true);
         if ($is_order || $a_accordion) {
             $item_list_gui2->enableCommands(true, true);
             $item_list_gui2->enableProperties(false);
         }
         $chapters = $objectives_lm_obj->getChapters();
         if (count($chapters)) {
             $has_sections = false;
             foreach ($chapters as $chapter) {
                 if ($chapter['ref_id'] != $item['child']) {
                     continue;
                 }
                 $has_sections = true;
                 include_once './Modules/LearningModule/classes/class.ilLMObject.php';
                 $title = $item['title'] . " &rsaquo; " . ilLMObject::_lookupTitle($chapter['obj_id']) . " (" . $lng->txt('obj_' . $chapter['type']) . ")";
                 $item_list_gui2->setDefaultCommandParameters(array("obj_id" => $chapter['obj_id'], "focus_id" => $chapter['obj_id'], "focus_return" => $this->container_obj->getRefId()));
                 if ($is_order) {
                     $item_list_gui2->setPositionInputField("[lobj][" . $a_objective_id . "][" . $chapter['lm_ass_id'] . "]", sprintf('%d', $chapter['position'] * 10));
                 }
                 $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $title, $item['description']);
                 // #13381 - use materials order
                 $sort_key = str_pad($chapter['position'], 5, 0, STR_PAD_LEFT) . "_" . strtolower($title) . "_" . $chapter['lm_ass_id'];
                 $sort_content[$sort_key] = $sub_item_html;
             }
         }
         $this->rendered_items[$item['child']] = true;
         if ($lm_ass_id = $objectives_lm_obj->isAssigned($item['ref_id'], true)) {
             if ($is_order) {
                 $item_list_gui2->setPositionInputField("[lobj][" . $a_objective_id . "][" . $lm_ass_id . "]", sprintf('%d', $sort_map[$lm_ass_id] * 10));
             }
             $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description']);
             // #13381 - use materials order
             $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT) . "_" . strtolower($item['title']) . "_" . $lm_ass_id;
             $sort_content[$sort_key] = $sub_item_html;
         }
     }
     if ($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL) {
         $this->objective_list_gui->enableCommands(false);
     } else {
         $this->objective_list_gui->enableCommands(true);
     }
     if ($is_order) {
         $this->objective_list_gui->setPositionInputField("[lobj][" . $a_objective_id . "][0]", $objective->__getPosition() * 10);
     }
     ksort($sort_content);
     if (!$a_accordion) {
         foreach ($sort_content as $sub_item_html) {
             $this->objective_list_gui->addSubItemHTML($sub_item_html);
         }
         return $this->objective_list_gui->getListItemHTML(0, $a_objective_id, $objective->getTitle(), $objective->getDescription(), $is_manage || $is_order);
     } else {
         $acc_content = $sort_content;
         $initial_shown = false;
         if ($this->getSettings()->hasSeparateInitialTests() and !$a_lo_result['initial_status']) {
             $acc_content[] = $this->renderTest($this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL), $a_objective_id, true, false, $a_lo_result);
             $initial_shown = TRUE;
         } elseif ($this->getSettings()->hasSeparateQualifiedTests()) {
             $acc_content[] = $this->renderTest($this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_QUALIFIED), $a_objective_id, false, false, $a_lo_result);
         }
         /*
         if($this->loc_settings->getInitialTest() &&
         	$this->loc_settings->getType() == ilLOSettings::LOC_INITIAL_SEL &&
         	!$a_lo_result["initial_status"])
         {
         	$acc_content[] = $this->renderTest($this->loc_settings->getInitialTest(), $a_objective_id, true, false, $a_lo_result);
         	$initial_shown = true;
         }	
         if(!$initial_shown &&
         	$this->loc_settings->getQualifiedTest() && 
         	$this->loc_settings->isQualifiedTestPerObjectiveVisible())
         {
         	$acc_content[] = $this->renderTest($this->loc_settings->getQualifiedTest(), $a_objective_id, false, false, $a_lo_result);
         }
         */
         $co_page = null;
         include_once "./Services/COPage/classes/class.ilPageUtil.php";
         if (ilPageUtil::_existsAndNotEmpty("lobj", $objective->getObjectiveId())) {
             $a_has_lo_page = true;
             include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
             $page_gui = new ilLOPageGUI($objective->getObjectiveId());
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
             $page_gui->setPresentationTitle("");
             $page_gui->setTemplateOutput(false);
             $page_gui->setHeader("");
             $co_page = "<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . "</div>";
         }
         // patch optes start
         $a_accordion->addItem($this->buildAccordionTitle($objective, $a_lo_result), $co_page . $this->buildAccordionContent($acc_content), isset($_GET["oobj"]) && (int) $_GET["oobj"] == $objective->getObjectiveId());
         // patch optes end
     }
 }
 function accordiontestObject()
 {
     global $tpl;
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     $acc = new ilAccordionGUI();
     $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
     $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
     $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
     $ac2 = new ilAccordionGUI();
     $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
     $ac2->addItem("Header 2", $acc->getHTML());
     $ac2->setOrientation(ilAccordionGUI::VERTICAL);
     $tpl->setContent($ac2->getHTML());
 }
 /**
  * generates frame layout
  */
 function layout($a_xml = "main.xml", $doShow = true)
 {
     global $tpl, $ilSetting, $ilCtrl, $ilUser;
     $layout = $this->determineLayout();
     // xmldocfile is deprecated! Use domxml_open_file instead.
     // But since using relative pathes with domxml under windows don't work,
     // we need another solution:
     $xmlfile = file_get_contents("./Modules/LearningModule/layouts/lm/" . $layout . "/" . $a_xml);
     if (!($doc = domxml_open_mem($xmlfile))) {
         include_once "./Modules/LearningModule/exceptions/class.ilLMPresentationException.php";
         throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Error reading " . $layout . "/" . $a_xml . ".");
     }
     $this->layout_doc = $doc;
     //echo ":".htmlentities($xmlfile).":$layout:$a_xml:";
     // get current frame node
     $xpc = xpath_new_context($doc);
     $path = empty($_GET["frame"]) || $_GET["frame"] == "_blank" ? "/ilLayout/ilFrame[1]" : "//ilFrame[@name='" . $_GET["frame"] . "']";
     $result = xpath_eval($xpc, $path);
     $found = $result->nodeset;
     if (count($found) != 1) {
         include_once "./Modules/LearningModule/exceptions/class.ilLMPresentationException.php";
         throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Found " . count($found) . " nodes for " . " path " . $path . " in " . $layout . "/" . $a_xml . ". LM Layout is " . $this->lm->getLayout());
     }
     $node = $found[0];
     // ProcessFrameset
     // node is frameset, if it has cols or rows attribute
     $attributes = $this->attrib2arr($node->attributes());
     $this->frames = array();
     if (!empty($attributes["rows"]) || !empty($attributes["cols"])) {
         $content .= $this->buildTag("start", "frameset", $attributes);
         //$this->frames = array();
         $this->processNodes($content, $node);
         $content .= $this->buildTag("end", "frameset");
         $this->tpl = new ilTemplate("tpl.frameset.html", true, true, "Modules/LearningModule");
         $this->renderPageTitle();
         $this->tpl->setVariable("FS_CONTENT", $content);
         if (!$doshow) {
             $content = $this->tpl->get();
         }
     } else {
         // ProcessContentTag
         //if ((empty($attributes["template"]) || !empty($_GET["obj_type"])))
         if ((empty($attributes["template"]) || !empty($_GET["obj_type"])) && ($_GET["frame"] != "_blank" || $_GET["obj_type"] != "MediaObject")) {
             // we got a variable content frame (can display different
             // object types (PageObject, MediaObject, GlossarItem)
             // and contains elements for them)
             // determine object type
             if (empty($_GET["obj_type"])) {
                 $obj_type = "PageObject";
             } else {
                 $obj_type = $_GET["obj_type"];
             }
             // get object specific node
             $childs = $node->child_nodes();
             $found = false;
             foreach ($childs as $child) {
                 if ($child->node_name() == $obj_type) {
                     $found = true;
                     $attributes = $this->attrib2arr($child->attributes());
                     $node = $child;
                     //echo "<br>2node:".$node->node_name();
                     break;
                 }
             }
             if (!$found) {
                 echo "ilLMPresentation: No template specified for frame '" . $_GET["frame"] . "' and object type '" . $obj_type . "'.";
                 exit;
             }
         }
         // get template
         $in_module = $attributes["template_location"] == "module" ? true : false;
         if ($in_module) {
             $this->tpl = new ilTemplate($attributes["template"], true, true, $in_module);
             $this->tpl->setBodyClass("");
         } else {
             $this->tpl = $tpl;
         }
         // set style sheets
         if (!$this->offlineMode()) {
             $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
         } else {
             $style_name = $ilUser->getPref("style") . ".css";
             $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
         }
         include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
         iljQueryUtil::initjQuery($this->tpl);
         iljQueryUtil::initjQueryUI($this->tpl);
         include_once "./Services/UICore/classes/class.ilUIFramework.php";
         ilUIFramework::init($this->tpl);
         // to make e.g. advanced seletions lists work:
         $GLOBALS["tpl"] = $this->tpl;
         $childs = $node->child_nodes();
         foreach ($childs as $child) {
             $child_attr = $this->attrib2arr($child->attributes());
             switch ($child->node_name()) {
                 case "ilMainMenu":
                     $this->ilMainMenu();
                     $this->renderPageTitle();
                     break;
                 case "ilTOC":
                     $this->ilTOC($child_attr["target_frame"]);
                     break;
                 case "ilPage":
                     switch ($this->lm->getType()) {
                         case "lm":
                             unset($_SESSION["tr_id"]);
                             unset($_SESSION["bib_id"]);
                             unset($_SESSION["citation"]);
                             $content = $this->ilPage($child);
                             break;
                     }
                     break;
                 case "ilGlossary":
                     $content = $this->ilGlossary($child);
                     break;
                 case "ilLMNavigation":
                     $this->ilLMNavigation();
                     break;
                 case "ilMedia":
                     $this->ilMedia();
                     break;
                 case "ilLocator":
                     $this->ilLocator();
                     break;
                 case "ilJavaScript":
                     $this->ilJavaScript($child_attr["inline"], $child_attr["file"], $child_attr["location"]);
                     break;
                 case "ilLMMenu":
                     $this->ilLMMenu();
                     break;
                 case "ilLMHead":
                     $this->ilLMHead();
                     break;
                 case "ilLMSubMenu":
                     $this->ilLMSubMenu();
                     break;
                 case "ilLMNotes":
                     $this->ilLMNotes();
                     break;
             }
         }
         // TODO: Very dirty hack to force the import of JavaScripts in learning content in the FAQ frame (e.g. if jsMath is in the content)
         // Unfortunately there is no standardized way to do this somewhere else. Calling fillJavaScripts always in ilTemplate causes multiple additions of the the js files.
         // 19.7.2014: outcommented, since fillJavaScriptFiles is called in the next blocks, and the
         // following lines would add the js files two times
         //			if (strcmp($_GET["frame"], "topright") == 0) $this->tpl->fillJavaScriptFiles();
         //			if (strcmp($_GET["frame"], "right") == 0) $this->tpl->fillJavaScriptFiles();
         //			if (strcmp($_GET["frame"], "botright") == 0) $this->tpl->fillJavaScriptFiles();
         if (!$this->offlineMode()) {
             include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
             ilAccordionGUI::addJavaScript();
             ilAccordionGUI::addCss();
             $this->tpl->addJavascript("./Modules/LearningModule/js/LearningModule.js");
             include_once "./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
             $close_call = "il.LearningModule.setCloseHTML('" . ilGlyphGUI::get(ilGlyphGUI::CLOSE) . "');";
             $this->tpl->addOnLoadCode($close_call);
             //$store->set("cf_".$this->lm->getId());
             // handle initial content
             if ($_GET["frame"] == "") {
                 include_once "./Services/Authentication/classes/class.ilSessionIStorage.php";
                 $store = new ilSessionIStorage("lm");
                 $last_frame_url = $store->get("cf_" . $this->lm->getId());
                 if ($last_frame_url != "") {
                     $this->tpl->addOnLoadCode("il.LearningModule.setLastFrameUrl('" . $last_frame_url . "', 'center_bottom');");
                 }
                 if (in_array($layout, array("toc2windyn"))) {
                     $this->tpl->addOnLoadCode("il.LearningModule.setSaveUrl('" . $ilCtrl->getLinkTarget($this, "saveFrameUrl", "", false, false) . "');\n\t\t\t\t\t\t\til.LearningModule.openInitFrames();\n\t\t\t\t\t\t\t");
                 }
                 $this->tpl->addOnLoadCode("il.LearningModule.setTocRefreshUrl('" . $ilCtrl->getLinkTarget($this, "refreshToc", "", false, false) . "');\n\t\t\t\t\t\t\t");
             }
             // from main menu
             //				$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
             $this->tpl->addJavascript("./Services/Navigation/js/ServiceNavigation.js");
             $this->tpl->fillJavaScriptFiles();
             $this->tpl->fillScreenReaderFocus();
             $this->tpl->fillCssFiles();
         } else {
             // reset standard css files
             $this->tpl->resetJavascript();
             $this->tpl->resetCss();
             include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php";
             foreach (ilObjContentObject::getSupplyingExportFiles() as $f) {
                 if ($f["type"] == "js") {
                     $this->tpl->addJavascript($f["target"]);
                 }
                 if ($f["type"] == "css") {
                     $this->tpl->addCSS($f["target"]);
                 }
             }
             $this->tpl->fillJavaScriptFiles(true);
             $this->tpl->fillCssFiles(true);
         }
         $this->tpl->fillBodyClass();
     }
     if ($doShow) {
         // (horrible) workaround for preventing template engine
         // from hiding paragraph text that is enclosed
         // in curly brackets (e.g. "{a}", see ilPageObjectGUI::showPage())
         $this->tpl->fillTabs();
         if ($this->fill_on_load_code) {
             $this->tpl->fillOnLoadCode();
         }
         $content = $this->tpl->get();
         $content = str_replace("&#123;", "{", $content);
         $content = str_replace("&#125;", "}", $content);
         header('Content-type: text/html; charset=UTF-8');
         echo $content;
     } else {
         $this->tpl->fillLeftNav();
         $this->tpl->fillOnLoadCode();
         $content = $this->tpl->get();
     }
     return $content;
 }
示例#12
0
 /**
  * display content of page
  */
 function showPage()
 {
     global $tree, $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs;
     // jquery and jquery ui are always provided for components
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     iljQueryUtil::initjQueryUI();
     //		$this->initSelfAssessmentRendering();
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
     ilObjMediaObjectGUI::includePresentationJS($GLOBALS["tpl"]);
     $GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilCOPagePres.js");
     // needed for overlays in iim
     include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
     ilOverlayGUI::initJavascript();
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     ilPlayerUtil::initMediaElementJs($GLOBALS["tpl"]);
     // init template
     //if($this->outputToTemplate())
     //{
     if ($this->getOutputMode() == "edit") {
         //echo ":".$this->getTemplateTargetVar().":";
         $tpl = new ilTemplate("tpl.page_edit_wysiwyg.html", true, true, "Services/COPage");
         //$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_edit_wysiwyg.html", "Services/COPage");
         // to do: status dependent class
         $tpl->setVariable("CLASS_PAGE_TD", "ilc_Page");
         // user comment
         if ($this->isEnabledChangeComments()) {
             $tpl->setCurrentBlock("change_comment");
             $tpl->setVariable("TXT_ADD_COMMENT", $this->lng->txt("cont_add_change_comment"));
             $tpl->parseCurrentBlock();
         }
         $tpl->setVariable("WYSIWYG_ACTION", $ilCtrl->getFormActionByClass("ilpageeditorgui", "", "", true));
         // determine media, html and javascript mode
         $sel_media_mode = $ilUser->getPref("ilPageEditor_MediaMode") == "disable" ? "disable" : "enable";
         $sel_html_mode = $ilUser->getPref("ilPageEditor_HTMLMode") == "disable" ? "disable" : "enable";
         $sel_js_mode = "disable";
         //if($ilSetting->get("enable_js_edit", 1))
         //{
         $sel_js_mode = ilPageEditorGUI::_doJSEditing() ? "enable" : "disable";
         //}
         // show prepending html
         $tpl->setVariable("PREPENDING_HTML", $this->getPrependingHtml());
         $tpl->setVariable("TXT_CONFIRM_DELETE", $lng->txt("cont_confirm_delete"));
         // presentation view
         if ($this->getViewPageLink() != "") {
             $ilTabs->addNonTabbedLink("pres_view", $this->lng->txt("cont_presentation_view"), $this->getViewPageLink(), $this->getViewPageTarget());
         }
         // show actions drop down
         $this->addActionsMenu($tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode);
         // get js files for JS enabled editing
         if ($sel_js_mode == "enable") {
             $this->insertHelp($tpl);
             include_once "./Services/YUI/classes/class.ilYuiUtil.php";
             ilYuiUtil::initDragDrop();
             ilYuiUtil::initConnection();
             ilYuiUtil::initPanel(false);
             $GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilcopagecallback.js");
             $GLOBALS["tpl"]->addJavascript("Services/COPage/js/page_editing.js");
             include_once './Services/Style/classes/class.ilObjStyleSheet.php';
             $GLOBALS["tpl"]->addOnloadCode("var preloader = new Image();\n\t\t\t\t\t\tpreloader.src = './templates/default/images/loader.svg';\n\t\t\t\t\t\tilCOPage.setContentCss('" . ilObjStyleSheet::getContentStylePath((int) $this->getStyleId()) . ", " . ilUtil::getStyleSheetLocation() . ", ./Services/COPage/css/tiny_extra.css" . "')");
             //$GLOBALS["tpl"]->addJavascript("Services/RTE/tiny_mce_3_3_9_2/il_tiny_mce_src.js");
             $GLOBALS["tpl"]->addJavascript("Services/COPage/tiny/4_1_5/tinymce.js");
             $tpl->touchBlock("init_dragging");
             $cfg = $this->getPageConfig();
             $tpl->setVariable("IL_TINY_MENU", self::getTinyMenu($this->getPageObject()->getParentType(), $cfg->getEnableInternalLinks(), $cfg->getEnableWikiLinks(), $cfg->getEnableKeywords(), $this->getStyleId(), true, true, $cfg->getEnableAnchors()));
             // add int link parts
             include_once "./Services/Link/classes/class.ilInternalLinkGUI.php";
             $tpl->setCurrentBlock("int_link_prep");
             $tpl->setVariable("INT_LINK_PREP", ilInternalLinkGUI::getInitHTML($ilCtrl->getLinkTargetByClass(array("ilpageeditorgui", "ilinternallinkgui"), "", false, true, false)));
             $tpl->parseCurrentBlock();
             include_once "./Services/YUI/classes/class.ilYuiUtil.php";
             ilYuiUtil::initConnection();
             $GLOBALS["tpl"]->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
         }
         // multiple actions
         $cnt_pcs = $this->getPageObject()->countPageContents();
         if ($cnt_pcs > 1 || $this->getPageObject()->getParentType() != "qpl" && $cnt_pcs > 0) {
             $tpl->setCurrentBlock("multi_actions");
             if ($sel_js_mode == "enable") {
                 $tpl->setVariable("ONCLICK_DE_ACTIVATE_SELECTED", 'onclick="return ilEditMultiAction(\'activateSelected\');"');
                 $tpl->setVariable("ONCLICK_DELETE_SELECTED", 'onclick="return ilEditMultiAction(\'deleteSelected\');"');
                 $tpl->setVariable("ONCLICK_ASSIGN_CHARACTERISTIC", 'onclick="return ilEditMultiAction(\'assignCharacteristicForm\');"');
                 $tpl->setVariable("ONCLICK_COPY_SELECTED", 'onclick="return ilEditMultiAction(\'copySelected\');"');
                 $tpl->setVariable("ONCLICK_CUT_SELECTED", 'onclick="return ilEditMultiAction(\'cutSelected\');"');
                 $tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
                 $tpl->setVariable("ONCLICK_SELECT_ALL", 'onclick="return ilEditMultiAction(\'selectAll\');"');
             }
             $tpl->setVariable("TXT_DE_ACTIVATE_SELECTED", $this->lng->txt("cont_ed_enable"));
             $tpl->setVariable("TXT_ASSIGN_CHARACTERISTIC", $this->lng->txt("cont_assign_characteristic"));
             $tpl->setVariable("TXT_DELETE_SELECTED", $this->lng->txt("cont_delete_selected"));
             $tpl->setVariable("TXT_COPY_SELECTED", $this->lng->txt("copy"));
             $tpl->setVariable("TXT_CUT_SELECTED", $this->lng->txt("cut"));
             $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
             $tpl->parseCurrentBlock();
         }
     } else {
         // presentation or preview here
         $tpl = new ilTemplate("tpl.page.html", true, true, "Services/COPage");
         if ($this->getEnabledPageFocus()) {
             $tpl->touchBlock("page_focus");
         }
         include_once "./Services/User/classes/class.ilUserUtil.php";
         // presentation
         if ($this->isPageContainerToBeRendered()) {
             $tpl->touchBlock("page_container_1");
             $tpl->touchBlock("page_container_2");
             $tpl->touchBlock("page_container_3");
         }
         // history
         $c_old_nr = $this->getPageObject()->old_nr;
         if ($c_old_nr > 0 || $this->getCompareMode() || $_GET["history_mode"] == 1) {
             $hist_info = $this->getPageObject()->getHistoryInfo($c_old_nr);
             if (!$this->getCompareMode()) {
                 $ilCtrl->setParameter($this, "history_mode", "1");
                 // previous revision
                 if (is_array($hist_info["previous"])) {
                     $tpl->setCurrentBlock("previous_rev");
                     $tpl->setVariable("TXT_PREV_REV", $lng->txt("cont_previous_rev"));
                     $ilCtrl->setParameter($this, "old_nr", $hist_info["previous"]["nr"]);
                     $tpl->setVariable("HREF_PREV", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                 } else {
                     $tpl->setCurrentBlock("previous_rev_disabled");
                     $tpl->setVariable("TXT_PREV_REV", $lng->txt("cont_previous_rev"));
                     $tpl->parseCurrentBlock();
                 }
                 // next revision
                 if ($c_old_nr > 0) {
                     $tpl->setCurrentBlock("next_rev");
                     $tpl->setVariable("TXT_NEXT_REV", $lng->txt("cont_next_rev"));
                     $ilCtrl->setParameter($this, "old_nr", $hist_info["next"]["nr"]);
                     $tpl->setVariable("HREF_NEXT", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                     // latest revision
                     $tpl->setCurrentBlock("latest_rev");
                     $tpl->setVariable("TXT_LATEST_REV", $lng->txt("cont_latest_rev"));
                     $ilCtrl->setParameter($this, "old_nr", "");
                     $tpl->setVariable("HREF_LATEST", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                 }
                 $ilCtrl->setParameter($this, "history_mode", "");
                 // rollback
                 if ($c_old_nr > 0 && $ilUser->getId() != ANONYMOUS_USER_ID) {
                     $tpl->setCurrentBlock("rollback");
                     $ilCtrl->setParameter($this, "old_nr", $c_old_nr);
                     $tpl->setVariable("HREF_ROLLBACK", $ilCtrl->getLinkTarget($this, "rollbackConfirmation"));
                     $ilCtrl->setParameter($this, "old_nr", "");
                     $tpl->setVariable("TXT_ROLLBACK", $lng->txt("cont_rollback"));
                     $tpl->parseCurrentBlock();
                 }
             }
             $tpl->setCurrentBlock("hist_nav");
             $tpl->setVariable("TXT_REVISION", $lng->txt("cont_revision"));
             $tpl->setVariable("VAL_REVISION_DATE", ilDatePresentation::formatDate(new ilDateTime($hist_info["current"]["hdate"], IL_CAL_DATETIME)));
             $tpl->setVariable("VAL_REV_USER", ilUserUtil::getNamePresentation($hist_info["current"]["user_id"]));
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->getOutputMode() != IL_PAGE_PRESENTATION && $this->getOutputMode() != IL_PAGE_OFFLINE && $this->getOutputMode() != IL_PAGE_PREVIEW && $this->getOutputMode() != IL_PAGE_PRINT) {
         $tpl->setVariable("FORMACTION", $this->ctrl->getFormActionByClass("ilpageeditorgui"));
     }
     // output media object edit list (of media links)
     if ($this->getOutputMode() == "edit") {
         $links = ilInternalLink::_getTargetsOfSource($this->obj->getParentType() . ":pg", $this->obj->getId(), $this->obj->getLanguage());
         $mob_links = array();
         foreach ($links as $link) {
             if ($link["type"] == "mob") {
                 if (ilObject::_exists($link["id"]) && ilObject::_lookupType($link["id"]) == "mob") {
                     $mob_links[$link["id"]] = ilObject::_lookupTitle($link["id"]) . " [" . $link["id"] . "]";
                 }
             }
         }
         // linked media objects
         if (count($mob_links) > 0) {
             $tpl->setCurrentBlock("med_link");
             $tpl->setVariable("TXT_LINKED_MOBS", $this->lng->txt("cont_linked_mobs"));
             $tpl->setVariable("SEL_MED_LINKS", ilUtil::formSelect(0, "mob_id", $mob_links, false, true));
             $tpl->setVariable("TXT_EDIT_MEDIA", $this->lng->txt("cont_edit_mob"));
             $tpl->setVariable("TXT_COPY_TO_CLIPBOARD", $this->lng->txt("cont_copy_to_clipboard"));
             //$this->tpl->setVariable("TXT_COPY_TO_POOL", $this->lng->txt("cont_copy_to_mediapool"));
             $tpl->parseCurrentBlock();
         }
         // content snippets used
         include_once "./Services/COPage/classes/class.ilPCContentInclude.php";
         $snippets = ilPCContentInclude::collectContentIncludes($this->getPageObject(), $this->getPageObject()->getDomDoc());
         if (count($snippets) > 0) {
             foreach ($snippets as $s) {
                 include_once "./Modules/MediaPool/classes/class.ilMediaPoolPage.php";
                 $sn_arr[$s["id"]] = ilMediaPoolPage::lookupTitle($s["id"]);
             }
             $tpl->setCurrentBlock("med_link");
             $tpl->setVariable("TXT_CONTENT_SNIPPETS_USED", $this->lng->txt("cont_snippets_used"));
             $tpl->setVariable("SEL_SNIPPETS", ilUtil::formSelect(0, "ci_id", $sn_arr, false, true));
             $tpl->setVariable("TXT_SHOW_INFO", $this->lng->txt("cont_show_info"));
             $tpl->parseCurrentBlock();
         }
         // scheduled activation?
         if (!$this->getPageObject()->getActive() && $this->getPageObject()->getActivationStart() != "" && $this->getPageConfig()->getEnableScheduledActivation()) {
             $tpl->setCurrentBlock("activation_txt");
             $tpl->setVariable("TXT_SCHEDULED_ACTIVATION", $lng->txt("cont_scheduled_activation"));
             $tpl->setVariable("SA_FROM", ilDatePresentation::formatDate(new ilDateTime($this->getPageObject()->getActivationStart(), IL_CAL_DATETIME)));
             $tpl->setVariable("SA_TO", ilDatePresentation::formatDate(new ilDateTime($this->getPageObject()->getActivationEnd(), IL_CAL_DATETIME)));
             $tpl->parseCurrentBlock();
         }
     }
     if ($_GET["reloadTree"] == "y") {
         $tpl->setCurrentBlock("reload_tree");
         if ($this->obj->getParentType() == "dbk") {
             $tpl->setVariable("LINK_TREE", $this->ctrl->getLinkTargetByClass("ilobjdlbookgui", "explorer", "", false, false));
         } else {
             $tpl->setVariable("LINK_TREE", $this->ctrl->getLinkTargetByClass("ilobjlearningmodulegui", "explorer", "", false, false));
         }
         $tpl->parseCurrentBlock();
     }
     //		}
     // get content
     $builded = $this->obj->buildDom();
     // manage hierarchical ids
     if ($this->getOutputMode() == "edit") {
         // add pc ids, if necessary
         if (!$this->obj->checkPCIds()) {
             $this->obj->insertPCIds();
             $this->obj->update(true, true);
         }
         $this->obj->addFileSizes();
         $this->obj->addHierIDs();
         $hids = $this->obj->getHierIds();
         $row1_ids = $this->obj->getFirstRowIds();
         $col1_ids = $this->obj->getFirstColumnIds();
         $litem_ids = $this->obj->getListItemIds();
         $fitem_ids = $this->obj->getFileItemIds();
         // standard menues
         $hids = $this->obj->getHierIds();
         foreach ($hids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_" . $hid);
             $tpl->parseCurrentBlock();
         }
         // column menues for tables
         foreach ($col1_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_r" . $hid);
             $tpl->parseCurrentBlock();
         }
         // row menues for tables
         foreach ($row1_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_c" . $hid);
             $tpl->parseCurrentBlock();
         }
         // list item menues
         foreach ($litem_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_i" . $hid);
             $tpl->parseCurrentBlock();
         }
         // file item menues
         foreach ($fitem_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_i" . $hid);
             $tpl->parseCurrentBlock();
         }
     } else {
         $this->obj->addFileSizes();
     }
     //echo "<br>-".htmlentities($this->obj->getXMLContent())."-<br><br>";
     //echo "<br>-".htmlentities($this->getLinkXML())."-";
     // set default link xml, if nothing was set yet
     if (!$this->link_xml_set) {
         $this->setDefaultLinkXml();
     }
     //$content = $this->obj->getXMLFromDom(false, true, true,
     //	$this->getLinkXML().$this->getQuestionXML().$this->getComponentPluginsXML());
     $link_xml = $this->getLinkXML();
     // disable/enable auto margins
     if ($this->getStyleId() > 0) {
         if (ilObject::_lookupType($this->getStyleId()) == "sty") {
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $style = new ilObjStyleSheet($this->getStyleId());
             $template_xml = $style->getTemplateXML();
             $disable_auto_margins = "n";
             if ($style->lookupStyleSetting("disable_auto_margins")) {
                 $disable_auto_margins = "y";
             }
         }
     }
     if ($this->getAbstractOnly()) {
         $content = "<dummy><PageObject><PageContent><Paragraph>" . $this->obj->getFirstParagraphText() . $link_xml . "</Paragraph></PageContent></PageObject></dummy>";
     } else {
         $content = $this->obj->getXMLFromDom(false, true, true, $link_xml . $this->getQuestionXML() . $template_xml . $this->getComponentPluginsXML());
     }
     // check validation errors
     if ($builded !== true) {
         $this->displayValidationError($builded);
     } else {
         $this->displayValidationError($_SESSION["il_pg_error"]);
     }
     unset($_SESSION["il_pg_error"]);
     if (isset($_SESSION["citation_error"])) {
         ilUtil::sendFailure($this->lng->txt("cont_citation_selection_not_valid"));
         ilSession::clear("citation_error");
     }
     // get title
     $pg_title = $this->getPresentationTitle();
     $col_path = ilUtil::getImagePath("col.svg");
     $row_path = ilUtil::getImagePath("row.svg");
     $item_path = ilUtil::getImagePath("item.svg");
     if ($this->getOutputMode() != "offline") {
         $enlarge_path = ilUtil::getImagePath("enlarge.svg");
         $wb_path = ilUtil::getWebspaceDir("output") . "/";
     } else {
         $enlarge_path = "images/enlarge.svg";
         $wb_path = "";
     }
     $pg_title_class = $this->getOutputMode() == "print" ? "ilc_PrintPageTitle" : "";
     // page splitting only for learning modules and
     // digital books
     $enable_split_new = $this->obj->getParentType() == "lm" || $this->obj->getParentType() == "dbk" ? "y" : "n";
     // page splitting to next page only for learning modules and
     // digital books if next page exists in tree
     if (($this->obj->getParentType() == "lm" || $this->obj->getParentType() == "dbk") && ilObjContentObject::hasSuccessorPage($this->obj->getParentId(), $this->obj->getId())) {
         $enable_split_next = "y";
     } else {
         $enable_split_next = "n";
     }
     $img_path = ilUtil::getImagePath("", false, $this->getOutputMode(), $this->getOutputMode() == "offline");
     if ($this->getPageConfig()->getEnablePCType("Tabs")) {
         //include_once("./Services/YUI/classes/class.ilYuiUtil.php");
         //ilYuiUtil::initTabView();
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         ilAccordionGUI::addJavaScript();
         ilAccordionGUI::addCss();
     }
     $file_download_link = $this->determineFileDownloadLink();
     $fullscreen_link = $this->determineFullscreenLink();
     $this->sourcecode_download_script = $this->determineSourcecodeDownloadScript();
     // default values for various parameters (should be used by
     // all instances in the future)
     $media_mode = $this->getOutputMode() == "edit" ? $ilUser->getPref("ilPageEditor_MediaMode") : "enable";
     include_once "./Modules/LearningModule/classes/class.ilEditClipboard.php";
     $paste = ilEditClipboard::getAction() == "copy" && $this->getOutputMode() == "edit";
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     $flv_video_player = $this->getOutputMode() != "offline" ? ilPlayerUtil::getFlashVideoPlayerFilename(true) : ilPlayerUtil::getFlashVideoPlayerFilename(true);
     $cfg = $this->getPageConfig();
     // added UTF-8 encoding otherwise umlaute are converted too
     include_once "./Services/Maps/classes/class.ilMapUtil.php";
     $params = array('mode' => $this->getOutputMode(), 'pg_title' => htmlentities($pg_title, ENT_QUOTES, "UTF-8"), 'enable_placeholder' => $cfg->getEnablePCType("PlaceHolder") ? "y" : "n", 'pg_id' => $this->obj->getId(), 'pg_title_class' => $pg_title_class, 'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path, 'img_col' => $col_path, 'img_row' => $row_path, 'img_item' => $item_path, 'enable_split_new' => $enable_split_new, 'enable_split_next' => $enable_split_next, 'link_params' => $this->link_params, 'file_download_link' => $file_download_link, 'fullscreen_link' => $fullscreen_link, 'img_path' => $img_path, 'parent_id' => $this->obj->getParentId(), 'download_script' => $this->sourcecode_download_script, 'encoded_download_script' => urlencode($this->sourcecode_download_script), 'bib_id' => $this->getBibId(), 'citation' => (int) $this->isEnabledCitation(), 'pagebreak' => $this->lng->txt('dgl_pagebreak'), 'page' => $this->lng->txt('page'), 'citate_page' => $this->lng->txt('citate_page'), 'citate_from' => $this->lng->txt('citate_from'), 'citate_to' => $this->lng->txt('citate_to'), 'citate' => $this->lng->txt('citate'), 'enable_rep_objects' => $cfg->getEnablePCType("Resources") ? "y" : "n", 'enable_login_page' => $cfg->getEnablePCType("LoginPageElement") ? "y" : "n", 'enable_map' => $cfg->getEnablePCType("Map") && ilMapUtil::isActivated() ? "y" : "n", 'enable_tabs' => $cfg->getEnablePCType("Tabs") ? "y" : "n", 'enable_sa_qst' => $cfg->getEnableSelfAssessment() ? "y" : "n", 'enable_file_list' => $cfg->getEnablePCType("FileList") ? "y" : "n", 'enable_content_includes' => $cfg->getEnablePCType("ContentInclude") ? "y" : "n", 'enable_content_templates' => count($this->getPageObject()->getContentTemplates()) > 0 ? "y" : "n", 'paste' => $paste ? "y" : "n", 'media_mode' => $media_mode, 'javascript' => $sel_js_mode, 'paragraph_plugins' => $paragraph_plugin_string, 'disable_auto_margins' => $disable_auto_margins, 'page_toc' => $cfg->getEnablePageToc() ? "y" : "n", 'enable_profile' => $cfg->getEnablePCType("Profile") ? "y" : "n", 'enable_verification' => $cfg->getEnablePCType("Verification") ? "y" : "n", 'enable_blog' => $cfg->getEnablePCType("Blog") ? "y" : "n", 'enable_skills' => $cfg->getEnablePCType("Skills") ? "y" : "n", 'enable_qover' => $cfg->getEnablePCType("QuestionOverview") ? "y" : "n", 'enable_consultation_hours' => $cfg->getEnablePCType("ConsultationHours") ? "y" : "n", 'enable_my_courses' => $cfg->getEnablePCType("MyCourses") ? "y" : "n", 'enable_amd_page_list' => $cfg->getEnablePCType("AMDPageList") ? "y" : "n", 'flv_video_player' => $flv_video_player);
     if ($this->link_frame != "") {
         // todo other link types
         $params["pg_frame"] = $this->link_frame;
     }
     //$content = str_replace("&nbsp;", "", $content);
     // this ensures that cache is emptied with every update
     $params["version"] = ILIAS_VERSION;
     // ensure no cache hit, if included files/media objects have been changed
     $params["incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
     // run xslt
     $md5 = md5(serialize($params) . $link_xml . $template_xml);
     //$a = microtime();
     // check cache (same parameters, non-edit mode and rendered time
     // > last change
     if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "presentation") && !$this->getCompareMode() && !$this->getAbstractOnly() && $md5 == $this->obj->getRenderMd5() && $this->obj->getLastChange() < $this->obj->getRenderedTime() && $this->obj->getRenderedTime() != "" && $this->obj->old_nr == 0) {
         // cache hit
         $output = $this->obj->getRenderedContent();
     } else {
         $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
         $args = array('/_xml' => $content, '/_xsl' => $xsl);
         $xh = xslt_create();
         //		echo "<b>XSLT</b>:".htmlentities($xsl).":<br>";
         //		echo "mode:".$this->getOutputMode().":<br>";
         $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
         if (($this->getOutputMode() == "presentation" || $this->getOutputMode() == "preview") && !$this->getAbstractOnly() && $this->obj->old_nr == 0) {
             //echo "writerenderedcontent";
             $this->obj->writeRenderedContent($output, $md5);
         }
         //echo xslt_error($xh);
         xslt_free($xh);
     }
     //$b = microtime();
     //echo "$a - $b";
     //echo "<pre>".htmlentities($output)."</pre>";
     // unmask user html
     if (($this->getOutputMode() != "edit" || $ilUser->getPref("ilPageEditor_HTMLMode") != "disable") && !$this->getPageConfig()->getPreventHTMLUnmasking()) {
         $output = str_replace("&lt;", "<", $output);
         $output = str_replace("&gt;", ">", $output);
     }
     $output = str_replace("&amp;", "&", $output);
     $output = ilUtil::insertLatexImages($output);
     // insert page snippets
     $output = $this->insertContentIncludes($output);
     // insert resource blocks
     $output = $this->insertResources($output);
     // insert page toc
     if ($this->getPageConfig()->getEnablePageToc()) {
         $output = $this->insertPageToc($output);
     }
     // insert advanced output trigger
     $output = $this->insertAdvTrigger($output);
     // workaround for preventing template engine
     // from hiding paragraph text that is enclosed
     // in curly brackets (e.g. "{a}", see ilLMEditorGUI::executeCommand())
     $output = $this->replaceCurlyBrackets($output);
     // remove all newlines (important for code / pre output)
     $output = str_replace("\n", "", $output);
     //echo htmlentities($output);
     $output = $this->postOutputProcessing($output);
     //echo htmlentities($output);
     if ($this->getOutputMode() == "edit" && !$this->getPageObject()->getActive($this->getPageConfig()->getEnableScheduledActivation())) {
         $output = '<div class="il_editarea_disabled">' . $output . '</div>';
     }
     // for all page components...
     include_once "./Services/COPage/classes/class.ilCOPagePCDef.php";
     $defs = ilCOPagePCDef::getPCDefinitions();
     foreach ($defs as $def) {
         ilCOPagePCDef::requirePCClassByName($def["name"]);
         $pc_class = $def["pc_class"];
         $pc_obj = new $pc_class($this->getPageObject());
         // post xsl page content modification by pc elements
         $output = $pc_obj->modifyPageContentPostXsl($output, $this->getOutputMode());
         // javascript files
         $js_files = $pc_obj->getJavascriptFiles($this->getOutputMode());
         foreach ($js_files as $js) {
             $GLOBALS["tpl"]->addJavascript($js);
         }
         // css files
         $css_files = $pc_obj->getCssFiles($this->getOutputMode());
         foreach ($css_files as $css) {
             $GLOBALS["tpl"]->addCss($css);
         }
         // onload code
         $onload_code = $pc_obj->getOnloadCode($this->getOutputMode());
         foreach ($onload_code as $code) {
             $GLOBALS["tpl"]->addOnloadCode($code);
         }
     }
     //		$output = $this->selfAssessmentRendering($output);
     // output
     if ($ilCtrl->isAsynch() && !$this->getRawPageContent() && $this->getOutputMode() == "edit") {
         // e.g. ###3:110dad8bad6df8620071a0a693a2d328###
         if ($_GET["updated_pc_id_str"] != "") {
             echo $_GET["updated_pc_id_str"];
         }
         $tpl->setVariable($this->getTemplateOutputVar(), $output);
         $tpl->setCurrentBlock("edit_page");
         $tpl->parseCurrentBlock();
         echo $tpl->get("edit_page");
         exit;
     }
     if ($this->outputToTemplate()) {
         $tpl->setVariable($this->getTemplateOutputVar(), $output);
         $this->tpl->setVariable($this->getTemplateTargetVar(), $tpl->get());
         return $output;
     } else {
         if ($this->getRawPageContent()) {
             return $output;
         } else {
             $tpl->setVariable($this->getTemplateOutputVar(), $output);
             return $tpl->get();
         }
     }
 }
示例#13
0
 /**
  * Insert tabs form.
  */
 function initForm($a_mode = "edit")
 {
     global $ilCtrl, $tpl, $lng;
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     ilAccordionGUI::addCss();
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     if ($a_mode != "edit") {
         $this->form->setTitle($lng->txt("cont_ed_insert_tabs"));
     } else {
         $this->form->setTitle($lng->txt("cont_edit_tabs"));
     }
     // tabs type
     /*$type_prop = new ilSelectInputGUI($lng->txt("cont_type"),
     			"type");
     		$types = array(ilPCTabs::ACCORDION_VER => $lng->txt("cont_tabs_acc_ver"),
     			ilPCTabs::ACCORDION_HOR => $lng->txt("cont_tabs_acc_hor"));
     		$type_prop->setOptions($types);
     		$this->form->addItem($type_prop);*/
     $templ = $this->getTemplateOptions("vaccordion");
     require_once "./Services/Form/classes/class.ilAdvSelectInputGUI.php";
     $vchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"), "vaccord_templ");
     $vchars = array();
     foreach ($templ as $k => $te) {
         $t = explode(":", $k);
         $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
         $vchar_prop->addOption($k, $te, $html);
         if ($t[2] == "VerticalAccordion") {
             $vchar_prop->setValue($k);
         }
     }
     $templ = $this->getTemplateOptions("haccordion");
     $hchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"), "haccord_templ");
     $hchars = array();
     foreach ($templ as $k => $te) {
         $t = explode(":", $k);
         $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
         $hchar_prop->addOption($k, $te, $html);
         if ($t[2] == "HorizontalAccordion") {
             $hchar_prop->setValue($k);
         }
     }
     $radg = new ilRadioGroupInputGUI($lng->txt("cont_type"), "type");
     $radg->setValue(ilPCTabs::ACCORDION_VER);
     $op1 = new ilRadioOption($lng->txt("cont_tabs_acc_ver"), ilPCTabs::ACCORDION_VER);
     $op1->addSubItem($vchar_prop);
     $radg->addOption($op1);
     $op2 = new ilRadioOption($lng->txt("cont_tabs_acc_hor"), ilPCTabs::ACCORDION_HOR);
     $op2->addSubItem($hchar_prop);
     $radg->addOption($op2);
     $this->form->addItem($radg);
     // number of initial tabs
     if ($a_mode == "create") {
         $nr_prop = new ilSelectInputGUI($lng->txt("cont_number_of_tabs"), "nr");
         $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10);
         $nr_prop->setOptions($nrs);
         $this->form->addItem($nr_prop);
     }
     $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_width"), "content_width");
     $ni->setMaxLength(4);
     $ni->setSize(4);
     $this->form->addItem($ni);
     $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_height"), "content_height");
     $ni->setMaxLength(4);
     $ni->setSize(4);
     $this->form->addItem($ni);
     // behaviour
     $options = array("AllClosed" => $lng->txt("cont_all_closed"), "FirstOpen" => $lng->txt("cont_first_open"), "ForceAllOpen" => $lng->txt("cont_force_all_open"));
     $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "behavior");
     $si->setOptions($options);
     $this->form->addItem($si);
     // alignment
     $align_opts = array("Left" => $lng->txt("cont_left"), "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"), "LeftFloat" => $lng->txt("cont_left_float"), "RightFloat" => $lng->txt("cont_right_float"));
     $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align");
     $align->setOptions($align_opts);
     $align->setValue("Center");
     $align->setInfo($lng->txt("cont_tabs_hor_align_info"));
     $this->form->addItem($align);
     // save/cancel buttons
     if ($a_mode == "create") {
         $this->form->addCommandButton("create_section", $lng->txt("save"));
         $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     } else {
         $this->form->addCommandButton("update", $lng->txt("save"));
         $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     }
 }
示例#14
0
 /**
  * Show template permissions
  * @return void
  */
 protected function permObject($a_show_admin_permissions = false)
 {
     global $ilTabs, $ilErr, $ilToolbar, $objDefinition, $rbacreview;
     $ilTabs->setTabActive('default_perm_settings');
     $this->setSubTabs('default_perm_settings');
     if ($a_show_admin_permissions) {
         $ilTabs->setSubTabActive('rbac_admin_permissions');
     } else {
         $ilTabs->setSubTabActive('rbac_repository_permissions');
     }
     if (!$this->checkAccess('write', 'edit_permission')) {
         $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'), $ilErr->MESSAGE);
         return true;
     }
     // Show copy role button
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
     $ilToolbar->addButton($this->lng->txt("adopt_perm_from_template"), $this->ctrl->getLinkTarget($this, 'adoptPerm'));
     if ($rbacreview->isDeleteable($this->object->getId(), $this->rolf_ref_id)) {
         $ilToolbar->addButton($this->lng->txt('rbac_delete_role'), $this->ctrl->getLinkTarget($this, 'confirmDeleteRole'));
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rbac_template_permissions.html', 'Services/AccessControl');
     $this->tpl->setVariable('PERM_ACTION', $this->ctrl->getFormAction($this));
     include_once './Services/Accordion/classes/class.ilAccordionGUI.php';
     $acc = new ilAccordionGUI();
     $acc->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN);
     $acc->setId('template_perm_' . $this->getParentRefId());
     if ($this->rolf_ref_id == ROLE_FOLDER_ID) {
         if ($a_show_admin_permissions) {
             $subs = $objDefinition->getSubObjectsRecursively('adm', true, true);
         } else {
             $subs = $objDefinition->getSubObjectsRecursively('root', true, $a_show_admin_permissions);
         }
     } else {
         $subs = $objDefinition->getSubObjectsRecursively($this->getParentType(), true, $a_show_admin_permissions);
     }
     $sorted = array();
     foreach ($subs as $subtype => $def) {
         if ($objDefinition->isPlugin($subtype)) {
             $translation = ilPlugin::lookupTxt("rep_robj", $subtype, "obj_" . $subtype);
         } elseif ($objDefinition->isSystemObject($subtype)) {
             $translation = $this->lng->txt("obj_" . $subtype);
         } else {
             $translation = $this->lng->txt('objs_' . $subtype);
         }
         $sorted[$subtype] = $def;
         $sorted[$subtype]['translation'] = $translation;
     }
     $sorted = ilUtil::sortArray($sorted, 'translation', 'asc', true, true);
     foreach ($sorted as $subtype => $def) {
         if ($objDefinition->isPlugin($subtype)) {
             $translation = ilPlugin::lookupTxt("rep_robj", $subtype, "obj_" . $subtype);
         } elseif ($objDefinition->isSystemObject($subtype)) {
             $translation = $this->lng->txt("obj_" . $subtype);
         } else {
             $translation = $this->lng->txt('objs_' . $subtype);
         }
         include_once 'Services/AccessControl/classes/class.ilObjectRoleTemplatePermissionTableGUI.php';
         $tbl = new ilObjectRoleTemplatePermissionTableGUI($this, 'perm', $this->getParentRefId(), $this->object->getId(), $subtype, $a_show_admin_permissions);
         $tbl->parse();
         $acc->addItem($translation, $tbl->getHTML());
     }
     $this->tpl->setVariable('ACCORDION', $acc->getHTML());
     // Add options table
     include_once './Services/AccessControl/classes/class.ilObjectRoleTemplateOptionsTableGUI.php';
     $options = new ilObjectRoleTemplateOptionsTableGUI($this, 'perm', $this->rolf_ref_id, $this->object->getId(), $a_show_admin_permissions);
     $options->addMultiCommand($a_show_admin_permissions ? 'adminPermSave' : 'permSave', $this->lng->txt('save'));
     $options->parse();
     $this->tpl->setVariable('OPTIONS_TABLE', $options->getHTML());
 }
 protected function fillRow($a_set)
 {
     global $ilCtrl;
     if ($this->show_peer_review && isset($a_set["peer"])) {
         $acc_data = array();
         foreach ($a_set["peer"] as $peer_id => $peer_review) {
             $peer_name = ilUserUtil::getNamePresentation($peer_id);
             $acc_item = $peer_name;
             if ($peer_review[1]) {
                 $rating = new ilRatingGUI();
                 $rating->setObject($this->ass->getId(), "ass", $a_set["uid"], "peer");
                 $rating->setUserId($peer_id);
                 $acc_item .= " " . $rating->getHTML(false, false);
             }
             if ($peer_review[0]) {
                 $acc_item .= '<div class="small">' . nl2br($peer_review[0]) . "</div>";
             }
             $uploads = $this->ass->getPeerUploadFiles($a_set["uid"], $peer_id);
             if ($uploads) {
                 $acc_item .= '<div class="small">';
                 $ilCtrl->setParameter($this->parent_obj, "fu", $peer_id . "__" . $a_set["uid"]);
                 foreach ($uploads as $file) {
                     $ilCtrl->setParameter($this->parent_obj, "fuf", md5($file));
                     $dl = $ilCtrl->getLinkTarget($this->parent_obj, "downloadPeerReview");
                     $ilCtrl->setParameter($this->parent_obj, "fuf", "");
                     $acc_item .= '<a href="' . $dl . '">' . basename($file) . '</a><br />';
                 }
                 $ilCtrl->setParameter($this->parent_obj, "fu", "");
                 $acc_item .= '</div>';
             }
             $acc_data[$peer_id] = array("name" => $peer_name, "review" => $acc_item);
         }
         if ($acc_data) {
             $acc_data = ilUtil::sortArray($acc_data, "name", "asc");
             $acc = new ilAccordionGUI();
             $acc->setId($this->ass->getId() . "_" . $a_set["uid"]);
             $acc_html = "<ul>";
             foreach ($acc_data as $acc_item) {
                 $acc_html .= "<li>" . $acc_item["review"] . "</li>";
             }
             $acc_html .= "</ul>";
             $acc->addItem($this->lng->txt("show") . " (" . sizeof($acc_data) . ")", $acc_html);
             $this->tpl->setCurrentBlock("peer_bl");
             $this->tpl->setVariable("PEER_REVIEW", $acc->getHTML());
             $this->tpl->parseCurrentBlock();
         }
     }
     $this->tpl->setVariable("USER_NAME", $a_set["uname"]);
     $this->tpl->setVariable("USER_DATE", ilDatePresentation::formatDate(new ilDate($a_set["udate"], IL_CAL_DATETIME)));
     $this->tpl->setVariable("USER_TEXT", $a_set["utext"]);
 }
 /**
  * Show online help
  */
 function showHelp()
 {
     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";
             $oh_lm_id = ilObjHelpSettings::lookupModuleLmId($hm);
         }
         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();
     }
     exit;
 }