コード例 #1
0
 /**
  * show objectives
  *
  * @access public
  * @param object $tpl template object
  * @return
  */
 public function showObjectives($a_tpl, $a_is_order = false)
 {
     global $lng, $ilSetting;
     $this->clearAdminCommandsDetermination();
     // get embedded blocks
     $has_container_page = false;
     if (!$a_is_order) {
         $output_html = $this->getContainerGUI()->getContainerPageHTML();
         if ($output_html != "") {
             $has_container_page = true;
             $this->output_html .= $this->insertPageEmbeddedBlocks($output_html);
         }
         unset($output_html);
     }
     // All objectives
     include_once './Modules/Course/classes/class.ilCourseObjective.php';
     if (!count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
         return false;
     }
     include_once './Modules/Course/classes/class.ilCourseObjectiveListGUI.php';
     $this->objective_list_gui = new ilCourseObjectiveListGUI();
     $this->objective_list_gui->setContainerObject($this->getContainerGUI());
     if ($ilSetting->get("icon_position_in_lists") == "item_rows") {
         $this->objective_list_gui->enableIcon(true);
     }
     $acc = null;
     if (!$a_is_order) {
         include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
         $acc = new ilAccordionGUI();
         $acc->setUseSessionStorage(true);
         $acc->setAllowMultiOpened(true);
         $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
         $acc->setId("crsobjtv_" . $this->container_obj->getId());
     } else {
         $this->renderer->addCustomBlock('lobj', $lng->txt('crs_objectives'));
     }
     $lur_data = $this->parseLOUserResults();
     $has_initial = ilLOSettings::getInstanceByObjId($this->container_obj->getId())->worksWithInitialTest();
     $has_lo_page = false;
     $obj_cnt = 0;
     foreach ($objective_ids as $objective_id) {
         include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
         if ($has_initial && (!isset($lur_data[$objective_id]) or ilLOUtils::hasActiveRun($this->container_obj->getId(), ilLOSettings::getInstanceByObjId($this->container_obj->getId())->getInitialTest(), $objective_id))) {
             $lur_data[$objective_id] = array("type" => ilLOSettings::TYPE_TEST_INITIAL);
         }
         if ($html = $this->renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id])) {
             $this->renderer->addItemToBlock('lobj', 'lobj', $objective_id, $html);
         }
         $obj_cnt++;
     }
     // buttons for showing/hiding all objectives
     if (!$a_is_order && $obj_cnt > 1) {
         $this->showButton("", $lng->txt("crs_show_all_obj"), "", "crs_show_all_obj_btn");
         $this->showButton("", $lng->txt("crs_hide_all_obj"), "", "crs_hide_all_obj_btn");
         $acc->setShowAllElement("crs_show_all_obj_btn");
         $acc->setHideAllElement("crs_hide_all_obj_btn");
     }
     if (!$has_container_page && $has_lo_page) {
         // add core co page css
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         $GLOBALS["tpl"]->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
         $GLOBALS["tpl"]->setCurrentBlock("SyntaxStyle");
         $GLOBALS["tpl"]->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
         $GLOBALS["tpl"]->parseCurrentBlock();
     }
     // order/block
     if ($a_is_order) {
         $this->addFooterRow();
         $this->output_html .= $output_html . $this->renderer->getHTML();
         $this->renderer->resetDetails();
     } else {
         $this->output_html .= "<div class='ilCrsObjAcc'>" . $acc->getHTML() . "</div>";
     }
 }
コード例 #2
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());
 }
コード例 #3
0
ファイル: class.ilHelpGUI.php プロジェクト: arlendotcn/ilias
 /**
  * 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_" . $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();
     }
     exit;
 }