protected function handlePageCall($a_cmd) { $this->tabs_gui->clearTargets(); $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "view")); if (!$this->page_id) { $this->ctrl->redirect($this, "view"); } $page_gui = $this->getPageGUIInstance($this->page_id); // needed for editor $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), $this->getType())); $ret = $this->ctrl->forwardCommand($page_gui); if ($ret != "" && $ret !== true) { // preview (fullscreen) if ($this->page_mode == "preview") { // embedded call which did not generate any output (e.g. calendar month navigation) if ($ret != ilPortfolioPageGUI::EMBEDDED_NO_OUTPUT) { // suppress (portfolio) notes for blog postings $this->preview(false, $ret, $a_cmd != "previewEmbedded"); } else { $this->preview(false); } } else { $this->setContentStyleSheet(); $this->tpl->setContent($ret); } } }
public function executeCommand() { // $this->prepareOutput(); switch ($this->ctrl->getNextClass($this)) { case "ilcontainerstartobjectspagegui": $this->checkPermission("write"); $this->tabs_gui->clearTargets(); $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "listStructure")); include_once "Services/Container/classes/class.ilContainerStartObjectsPage.php"; if (!ilContainerStartObjectsPage::_exists("cstr", $this->object->getId())) { // doesn't exist -> create new one $new_page_object = new ilContainerStartObjectsPage(); $new_page_object->setParentId($this->object->getId()); $new_page_object->setId($this->object->getId()); $new_page_object->createFromXML(); unset($new_page_object); } $this->ctrl->setReturnByClass("ilcontainerstartobjectspagegui", "edit"); include_once "Services/Container/classes/class.ilContainerStartObjectsPageGUI.php"; $pgui = new ilContainerStartObjectsPageGUI($this->object->getId()); // needed for editor? include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $pgui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0)); $ret = $this->ctrl->forwardCommand($pgui); if ($ret) { $this->tpl->setContent($ret); } break; default: $cmd = $this->ctrl->getCmd("listStructure"); $cmd .= "Object"; $this->{$cmd}(); break; } }
/** * Render COPage * * @see ilContainerGUI * @return string */ protected function getPageHTML() { global $tpl, $ilSetting, $ilUser; if (!$ilSetting->get("enable_cat_page_edit")) { return; } $page_id = $this->start_object->getObjId(); // if page does not exist, return nothing include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id)) { return; } include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); include_once "./Services/Container/classes/class.ilContainerStartObjectsPageGUI.php"; $page_gui = new ilContainerStartObjectsPageGUI($page_id); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0)); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); return $page_gui->showPage(); }
function &executeCommand() { global $ilTabs; $next_class = $this->ctrl->getNextClass($this); $this->prepareOutput(); switch ($next_class) { case 'ilpermissiongui': include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case 'ilimprintgui': // page editor will set its own tabs $ilTabs->clearTargets(); $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "")); include_once "./Services/Imprint/classes/class.ilImprintGUI.php"; $igui = new ilImprintGUI(); // needed for editor $igui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "impr")); if (!$this->checkPermissionBool("write")) { $igui->setEnableEditing(false); } $ret = $this->ctrl->forwardCommand($igui); if ($ret != "") { $this->tpl->setContent($ret); } break; case "ilobjectownershipmanagementgui": $this->setSystemCheckSubTabs("no_owner"); include_once "Services/Object/classes/class.ilObjectOwnershipManagementGUI.php"; $gui = new ilObjectOwnershipManagementGUI(0); $this->ctrl->forwardCommand($gui); break; case "ilcronmanagergui": $ilTabs->activateTab("cron_jobs"); include_once "Services/Cron/classes/class.ilCronManagerGUI.php"; $gui = new ilCronManagerGUI(); $this->ctrl->forwardCommand($gui); break; default: //var_dump($_POST); $cmd = $this->ctrl->getCmd("view"); $cmd .= "Object"; $this->{$cmd}(); break; } return true; }
/** * showRecord * a_val = */ public function renderRecord() { global $ilTabs, $tpl, $ilCtrl, $lng; $rctpl = new ilTemplate("tpl.record_view.html", true, true, "Modules/DataCollection"); $ilTabs->setTabActive("id_content"); $view_id = self::_getViewDefinitionId($this->record_obj); if (!$view_id) { $ilCtrl->redirectByClass("ildatacollectionrecordlistgui", "listRecords"); } // please do not use ilPageObjectGUI directly here, use derived class // ilDataCollectionRecordViewViewdefinitionGUI //$pageObj = new ilPageObjectGUI("dclf", $view_id); // see ilObjDataCollectionGUI->executeCommand about instantiation include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php"; $pageObj = new ilDataCollectionRecordViewViewdefinitionGUI($this->record_obj->getTableId(), $view_id); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $pageObj->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl")); $html = $pageObj->getHTML(); $rctpl->addCss("./Services/COPage/css/content.css"); $rctpl->fillCssFiles(); $table = ilDataCollectionCache::getTableCache($this->record_obj->getTableId()); foreach ($table->getFields() as $field) { //ILIAS_Ref_Links $pattern = '/\\[dcliln field="' . preg_quote($field->getTitle(), "/") . '"\\](.*?)\\[\\/dcliln\\]/'; if (preg_match($pattern, $html)) { $html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(), $this->setOptions("\$1")), $html); } //DataCollection Ref Links $pattern = '/\\[dclrefln field="' . preg_quote($field->getTitle(), "/") . '"\\](.*?)\\[\\/dclrefln\\]/'; if (preg_match($pattern, $html)) { $this->currentField = $field; $html = preg_replace_callback($pattern, array($this, "doReplace"), $html); } $pattern = '/\\[ext tableOf="' . preg_quote($field->getTitle(), "/") . '" field="(.*?)"\\]/'; if (preg_match($pattern, $html)) { $this->currentField = $field; $html = preg_replace_callback($pattern, array($this, "doExtReplace"), $html); } $html = str_ireplace("[" . $field->getTitle() . "]", $this->record_obj->getRecordFieldHTML($field->getId()), $html); } $rctpl->setVariable("CONTENT", $html); //Permanent Link include_once "./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php"; $perma_link = new ilPermanentLinkGUI("dcl", $_GET["ref_id"], "_" . $_GET['record_id']); $rctpl->setVariable("PERMA_LINK", $perma_link->getHTML()); $tpl->setContent($rctpl->get()); }
/** * execute command */ function &executeCommand() { global $ilCtrl, $tpl; $next_class = $ilCtrl->getNextClass($this); $cmd = $ilCtrl->getCmd(); switch ($next_class) { case "ilscorm2004pagegui": $tpl->getStandardTemplate(); $this->setContentStyle(); $this->setLocator(); // Determine whether the view of a learning resource should // be shown in the frameset of ilias, or in a separate window. //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame"; $showViewInFrameset = true; $ilCtrl->setReturn($this, "edit"); include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php"; $page_gui =& new ilSCORM2004PageGUI($this->slm_object->getType(), $this->node_object->getId(), 0, $this->getParentGUI()->object->getId(), $this->slm_object->getAssignedGlossary()); $page_gui->setEditPreview(true); $page_gui->setPresentationTitle($this->node_object->getTitle()); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->slm_object->getStyleSheetId(), "sahs")); if ($this->node_object->tree->getParentId($this->node_object->getId()) > 0) { $sco = new ilSCORM2004Sco($this->node_object->getSLMObject(), $this->node_object->tree->getParentId($this->node_object->getId())); if (count($sco->getGlossaryTermIds()) > 1) { include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ScoGUI.php"; $page_gui->setGlossaryOverviewInfo(ilSCORM2004ScoGUI::getGlossaryOverviewId(), $sco); } } $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "active_node", $_GET["obj_id"]); $page_gui->setExplorerUpdater("tree", "tree_div", $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui", "showTree", "", true)); $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "active_node", ""); // set page view link $view_frame = ilFrameTargetInfo::_getFrame("MainContent"); $page_gui->setLinkParams("ref_id=" . $this->slm_object->getRefId()); $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.png")); $page_gui->activateMetaDataEditor($this->slm_object->getID(), $this->node_object->getId(), $this->node_object->getType(), $this->node_object, 'MDUpdateListener'); $ret = $ilCtrl->forwardCommand($page_gui); $this->setTabs(); $tpl->setContent($ret); break; default: $ret =& $this->{$cmd}(); break; } return $ret; }
/** * @param bool $editComments */ public function renderRecord($editComments = false) { global $ilTabs, $tpl, $ilCtrl, $lng; $rctpl = new ilTemplate("tpl.record_view.html", false, true, "Modules/DataCollection"); $ilTabs->setTabActive("id_content"); $view_id = self::_getViewDefinitionId($this->record_obj); if (!$view_id) { $ilCtrl->redirectByClass("ildatacollectionrecordlistgui", "listRecords"); } // see ilObjDataCollectionGUI->executeCommand about instantiation include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php"; $pageObj = new ilDataCollectionRecordViewViewdefinitionGUI($this->record_obj->getTableId(), $view_id); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $pageObj->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl")); $html = $pageObj->getHTML(); $rctpl->addCss("./Services/COPage/css/content.css"); $rctpl->fillCssFiles(); $table = ilDataCollectionCache::getTableCache($this->record_obj->getTableId()); foreach ($table->getRecordFields() as $field) { //ILIAS_Ref_Links $pattern = '/\\[dcliln field="' . preg_quote($field->getTitle(), "/") . '"\\](.*?)\\[\\/dcliln\\]/'; if (preg_match($pattern, $html)) { $html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(), $this->setOptions("\$1")), $html); } //DataCollection Ref Links $pattern = '/\\[dclrefln field="' . preg_quote($field->getTitle(), "/") . '"\\](.*?)\\[\\/dclrefln\\]/'; if (preg_match($pattern, $html)) { $this->currentField = $field; $html = preg_replace_callback($pattern, array($this, "doReplace"), $html); } $pattern = '/\\[ext tableOf="' . preg_quote($field->getTitle(), "/") . '" field="(.*?)"\\]/'; if (preg_match($pattern, $html)) { $this->currentField = $field; $html = preg_replace_callback($pattern, array($this, "doExtReplace"), $html); } $html = str_ireplace("[" . $field->getTitle() . "]", $this->record_obj->getRecordFieldSingleHTML($field->getId()), $html); } foreach ($table->getStandardFields() as $field) { $html = str_ireplace("[" . $field->getId() . "]", $this->record_obj->getRecordFieldSingleHTML($field->getId()), $html); } $rctpl->setVariable("CONTENT", $html); //Permanent Link $perma_link = new ilPermanentLinkGUI("dcl", $_GET["ref_id"], "_" . $_GET['record_id']); $tpl->setVariable('PRMLINK', $perma_link->getHTML()); // Buttons for previous/next records if ($this->is_enabled_paging) { $prevNextLinks = $this->renderPrevNextLinks(); $rctpl->setVariable('PREV_NEXT_RECORD_LINKS', $prevNextLinks); $ilCtrl->clearParameters($this); // #14083 $rctpl->setVariable('FORM_ACTION', $ilCtrl->getFormAction($this)); $rctpl->setVariable('RECORD', $lng->txt('dcl_record')); $rctpl->setVariable('RECORD_FROM_TOTAL', sprintf($lng->txt('dcl_record_from_total'), $this->current_record_position, count($this->record_ids))); $rctpl->setVariable('SELECT_OPTIONS', $this->renderSelectOptions()); } // Edit Button if ($this->record_obj->hasPermissionToEdit((int) $_GET['ref_id'])) { $button = ilLinkButton::getInstance(); $ilCtrl->setParameterByClass('ildatacollectionrecordeditgui', 'table_id', $this->table->getId()); $ilCtrl->setParameterByClass('ildatacollectionrecordeditgui', 'redirect', ilDataCollectionRecordEditGUI::REDIRECT_DETAIL); $ilCtrl->saveParameterByClass('ildatacollectionrecordeditgui', 'record_id'); $button->setUrl($ilCtrl->getLinkTargetByClass('ildatacollectionrecordeditgui', 'edit')); $button->setCaption($lng->txt('dcl_edit_record'), false); $rctpl->setVariable('EDIT_RECORD_BUTTON', $button->render()); } // Comments if ($this->table->getPublicCommentsEnabled()) { $rctpl->setVariable('COMMENTS', $this->renderComments($editComments)); } $tpl->setContent($rctpl->get()); }
function executeCommand() { global $ilCtrl, $tpl, $ilTabs, $lng, $ilNavigationHistory; // goto link to blog posting if ($_GET["gtp"]) { $ilCtrl->setCmdClass("ilblogpostinggui"); $_GET["blpg"] = $_GET["gtp"]; $ilCtrl->setCmd("previewFullscreen"); } $next_class = $ilCtrl->getNextClass($this); $cmd = $ilCtrl->getCmd(); if ($this->id_type == self::REPOSITORY_NODE_ID) { $tpl->getStandardTemplate(); // add entry to navigation history if (!$this->getCreationMode() && $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) { $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"); $ilNavigationHistory->addItem($this->node_id, $link, "blog"); } } switch ($next_class) { case 'ilblogpostinggui': // #9680 if ($this->id_type == self::REPOSITORY_NODE_ID) { $this->setLocator(); } else { include_once "Services/Form/classes/class.ilFileInputGUI.php"; ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true); } $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "")); include_once "./Modules/Blog/classes/class.ilBlogPostingGUI.php"; $bpost_gui = new ilBlogPostingGUI($this->node_id, $this->getAccessHandler(), $_GET["blpg"], $_GET["old_nr"], $this->object->getNotesStatus() && !$this->disable_notes, $this->mayContribute($_GET["blpg"])); // needed for editor $bpost_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), "blog")); // keep preview mode through notes gui (has its own commands) switch ($cmd) { // blog preview case "previewFullscreen": $ilCtrl->setParameter($this, "prvm", "fsc"); break; // blog in portfolio // blog in portfolio case "previewEmbedded": $ilCtrl->setParameter($this, "prvm", "emb"); break; // edit // edit default: $this->setContentStyleSheet(); $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]); $this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"), $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen")); $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", ""); break; } $ret = $ilCtrl->forwardCommand($bpost_gui); if ($ret != "") { // keep preview mode through notes gui if ($_REQUEST["prvm"]) { $cmd = "preview" . ($_REQUEST["prvm"] == "fsc" ? "Fullscreen" : "Embedded"); } // $is_owner = $this->object->getOwner() == $ilUser->getId(); $is_owner = $this->mayContribute(); $is_active = $bpost_gui->getBlogPosting()->getActive(); // do not show inactive postings if (($cmd == "previewFullscreen" || $cmd == "previewEmbedded") && !$is_owner && !$is_active) { $this->ctrl->redirect($this, "preview"); } switch ($cmd) { // blog preview case "previewFullscreen": $this->addHeaderAction($cmd); $this->filterInactivePostings(); $nav = $this->renderNavigation($this->items, "preview", $cmd); $this->renderFullScreen($ret, $nav); break; // blog in portfolio // blog in portfolio case "previewEmbedded": $this->filterInactivePostings(); $nav = $this->renderNavigation($this->items, "gethtml", $cmd); return $this->buildEmbedded($ret, $nav); // ilias/editor // ilias/editor default: // infos about draft status / snippet $info = array(); if (!$is_active) { // single author blog (owner) in personal workspace if ($this->id_type == self::WORKSPACE_NODE_ID) { $info[] = $lng->txt("blog_draft_info"); } else { $info[] = $lng->txt("blog_draft_info_contributors"); } } if ($cmd != "history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText()) { $info[] = $lng->txt("blog_new_posting_info"); } if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) { // #9737 $info[] = $lng->txt("blog_posting_edit_approval_info"); } if (sizeof($info)) { ilUtil::sendInfo(implode("<br />", $info)); } // revert to edit cmd to avoid confusion $this->addHeaderAction("render"); $tpl->setContent($ret); $nav = $this->renderNavigation($this->items, "render", $cmd, null, $is_owner); $tpl->setRightContent($nav); break; } } break; case "ilinfoscreengui": $this->prepareOutput(); $this->infoScreenForward(); break; case "ilnotegui": $this->preview(); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case "ilpermissiongui": $this->prepareOutput(); $ilTabs->activateTab("id_permissions"); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui = new ilPermissionGUI($this); $this->ctrl->forwardCommand($perm_gui); break; case "ilobjectcopygui": include_once "./Services/Object/classes/class.ilObjectCopyGUI.php"; $cp = new ilObjectCopyGUI($this); $cp->setType("blog"); $this->ctrl->forwardCommand($cp); break; case 'ilrepositorysearchgui': $this->prepareOutput(); $ilTabs->activateTab("contributors"); include_once './Services/Search/classes/class.ilRepositorySearchGUI.php'; $rep_search = new ilRepositorySearchGUI(); $rep_search->setTitle($this->lng->txt("blog_add_contributor")); $rep_search->setCallback($this, 'addContributor'); $this->ctrl->setReturn($this, 'contributors'); $ret =& $this->ctrl->forwardCommand($rep_search); break; case 'ilexportgui': $this->prepareOutput(); $ilTabs->activateTab("export"); include_once "./Services/Export/classes/class.ilExportGUI.php"; $exp_gui = new ilExportGUI($this); $exp_gui->addFormat("xml"); $ret = $ilCtrl->forwardCommand($exp_gui); break; case "ilobjstylesheetgui": include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php"; $this->ctrl->setReturn($this, "editStyleProperties"); $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false); $style_gui->omitLocator(); if ($cmd == "create" || $_GET["new_type"] == "sty") { $style_gui->setCreationMode(true); } if ($cmd == "confirmedDelete") { $this->object->setStyleSheetId(0); $this->object->update(); } $ret = $this->ctrl->forwardCommand($style_gui); if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") { $style_id = $ret; $this->object->setStyleSheetId($style_id); $this->object->update(); $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit"); } break; default: if ($cmd != "gethtml") { // desktop item handling, must be toggled before header action if ($cmd == "addToDesk" || $cmd == "removeFromDesk") { $this->{$cmd . "Object"}(); if ($_GET["prvm"]) { $cmd = "preview"; } else { $cmd = "render"; } $ilCtrl->setCmd($cmd); } $this->addHeaderAction($cmd); } return parent::executeCommand(); } return true; }
public function executeCommand() { global $ilCtrl, $ilTabs, $ilNavigationHistory, $ilUser, $tpl; // Navigation History $link = $ilCtrl->getLinkTarget($this, "render"); if ($this->object != NULL) { $ilNavigationHistory->addItem($this->object->getRefId(), $link, "dcl"); } //Direct-Link Resource if ($_GET["dcl_gtr"]) { $ilCtrl->setCmdClass("ildatacollectionrecordviewgui"); $_GET['record_id'] = $_GET["dcl_gtr"]; $ilCtrl->setCmd("renderRecord"); } $next_class = $ilCtrl->getNextClass($this); $cmd = $ilCtrl->getCmd(); if (!$this->getCreationMode() && $next_class != "ilinfoscreengui" && !$this->checkPermissionBool("read")) { $tpl->getStandardTemplate(); $tpl->setContent("Permission Denied."); return; } switch ($next_class) { case "ilinfoscreengui": $this->prepareOutput(); $ilTabs->activateTab("id_info"); $this->infoScreenForward(); break; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case "ilpermissiongui": $this->prepareOutput(); $ilTabs->activateTab("id_permissions"); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui = new ilPermissionGUI($this); $this->ctrl->forwardCommand($perm_gui); break; case "ilobjectcopygui": include_once "./Services/Object/classes/class.ilObjectCopyGUI.php"; $cp = new ilObjectCopyGUI($this); $cp->setType("dcl"); $tpl->getStandardTemplate(); $this->ctrl->forwardCommand($cp); break; case "ildatacollectionfieldlistgui": $this->prepareOutput(); $this->addListFieldsTabs("list_fields"); $ilTabs->setTabActive("id_fields"); include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldListGUI.php"; $fieldlist_gui = new ilDataCollectionFieldListGUI($this, $this->table_id); $this->ctrl->forwardCommand($fieldlist_gui); break; case "ildatacollectiontableeditgui": $this->prepareOutput(); $ilTabs->setTabActive("id_fields"); include_once "./Modules/DataCollection/classes/class.ilDataCollectionTableEditGUI.php"; $tableedit_gui = new ilDataCollectionTableEditGUI($this); $this->ctrl->forwardCommand($tableedit_gui); break; case "ildatacollectionfieldeditgui": $this->prepareOutput(); $ilTabs->activateTab("id_fields"); include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldEditGUI.php"; $fieldedit_gui = new ilDataCollectionFieldEditGUI($this, $this->table_id, $_REQUEST["field_id"]); $this->ctrl->forwardCommand($fieldedit_gui); break; case "ildatacollectionrecordlistgui": $this->addHeaderAction(false); $this->prepareOutput(); $ilTabs->activateTab("id_records"); include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListGUI.php"; $recordlist_gui = new ilDataCollectionRecordListGUI($this, $this->table_id); $this->ctrl->forwardCommand($recordlist_gui); break; case "ildatacollectionrecordeditgui": $this->prepareOutput(); $ilTabs->activateTab("id_records"); include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordEditGUI.php"; $recordedit_gui = new ilDataCollectionRecordEditGUI($this); $this->ctrl->forwardCommand($recordedit_gui); break; case "ildatacollectionrecordviewviewdefinitiongui": $this->prepareOutput(); // page editor will set its own tabs $ilTabs->clearTargets(); $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ildatacollectionfieldlistgui", "listFields")); include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php"; $recordedit_gui = new ilDataCollectionRecordViewViewdefinitionGUI($this->table_id); // needed for editor $recordedit_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl")); if (!$this->checkPermissionBool("write")) { $recordedit_gui->setEnableEditing(false); } $ret = $this->ctrl->forwardCommand($recordedit_gui); if ($ret != "") { $this->tpl->setContent($ret); } $ilTabs->removeTab('history'); $ilTabs->removeTab('clipboard'); // Fixme $ilTabs->removeTab('pg'); break; case "ildatacollectionrecordlistviewdefinitiongui": $this->prepareOutput(); $this->addListFieldsTabs("list_viewdefinition"); $ilTabs->setTabActive("id_fields"); include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListViewdefinitionGUI.php"; $recordlist_gui = new ilDataCollectionRecordListViewdefinitionGUI($this, $this->table_id); $this->ctrl->forwardCommand($recordlist_gui); break; case "ilobjfilegui": $this->prepareOutput(); $ilTabs->setTabActive("id_records"); include_once "./Modules/File/classes/class.ilObjFile.php"; $file_gui = new ilObjFile($this); $this->ctrl->forwardCommand($file_gui); break; case "ildatacollectionrecordviewgui": $this->prepareOutput(); include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php"; $recordview_gui = new ilDataCollectionRecordViewGUI($this); $this->ctrl->forwardCommand($recordview_gui); $ilTabs->clearTargets(); $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ilObjDataCollectionGUI", "")); break; case "ilratinggui": $rgui = new ilRatingGUI(); $rgui->setObject($_GET['record_id'], "dcl_record", $_GET["field_id"], "dcl_field"); $rgui->executeCommand(); $ilCtrl->redirectByClass("ilDataCollectionRecordListGUI", "listRecords"); break; default: return parent::executeCommand(); } return true; }
/** * 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'] . " › " . 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 } }
/** * show print view */ function showPrintView() { global $ilUser, $lng, $ilCtrl; include_once "./Modules/LearningModule/classes/class.ilLMPage.php"; if (!$this->lm->isActivePrintView()) { return; } $this->renderPageTitle(); $c_obj_id = $this->getCurrentPageId(); // set values according to selection if ($_POST["sel_type"] == "page") { if (!is_array($_POST["obj_id"]) || !in_array($c_obj_id, $_POST["obj_id"])) { $_POST["obj_id"][] = $c_obj_id; } } if ($_POST["sel_type"] == "chapter" && $c_obj_id > 0) { $path = $this->lm_tree->getPathFull($c_obj_id); $chap_id = $path[1]["child"]; if ($chap_id > 0) { $_POST["obj_id"][] = $chap_id; } } //var_dump($_GET); //var_dump($_POST); // set style sheets if (!$this->offlineMode()) { $this->tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle()); } else { $style_name = $ilUser->getPref("style") . ".css"; $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name); } // content style $this->tpl->setCurrentBlock("ContentStyle"); if (!$this->offlineMode()) { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId())); } else { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content_style/content.css"); } $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); //$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->addBlockFile("CONTENT", "content", "tpl.lm_print_view.html", true); // set title header $this->tpl->setVariable("HEADER", $this->lm->getTitle()); $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId())); include_once "./Modules/LearningModule/classes/class.ilLMPageGUI.php"; include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php"; include_once "./Modules/LearningModule/classes/class.ilStructureObject.php"; $act_level = 99999; $activated = false; $glossary_links = array(); $output_header = false; $media_links = array(); // get header and footer if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) { if (ilLMObject::_exists($this->lm->getFooterPage())) { $page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage()); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm")); // determine target frames for internal links $page_object_gui->setLinkFrame($_GET["frame"]); $page_object_gui->setOutputMode("print"); $page_object_gui->setPresentationTitle(""); $page_object_gui->setFileDownloadLink("#"); $page_object_gui->setFullscreenLink("#"); $page_object_gui->setSourceCodeDownloadScript("#"); $footer_page_content = $page_object_gui->showPage(); } } if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) { if (ilLMObject::_exists($this->lm->getHeaderPage())) { $page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage()); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm")); // determine target frames for internal links $page_object_gui->setLinkFrame($_GET["frame"]); $page_object_gui->setOutputMode("print"); $page_object_gui->setPresentationTitle(""); $page_object_gui->setFileDownloadLink("#"); $page_object_gui->setFullscreenLink("#"); $page_object_gui->setSourceCodeDownloadScript("#"); $header_page_content = $page_object_gui->showPage(); } } // add free selected pages if (is_array($_POST["obj_id"])) { foreach ($_POST["obj_id"] as $k) { if ($k > 0 && !$this->lm_tree->isInTree($k)) { if (ilLMObject::_lookupType($k) == "pg") { $nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true); } } } } else { ilUtil::sendFailure($lng->txt("cont_print_no_page_selected"), true); $ilCtrl->redirect($this, "showPrintViewSelection"); } foreach ($nodes as $node_key => $node) { // check page activation $active = ilLMPage::_lookupActive($node["obj_id"], $this->lm->getType(), $this->lm_set->get("time_scheduled_page_activation")); if ($node["type"] == "pg" && !$active) { continue; } // print all subchapters/subpages if higher chapter // has been selected if ($node["depth"] <= $act_level) { if (is_array($_POST["obj_id"]) && in_array($node["obj_id"], $_POST["obj_id"])) { $act_level = $node["depth"]; $activated = true; } else { $act_level = 99999; $activated = false; } } if ($activated && ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node["obj_id"])) { // output learning module header if ($node["type"] == "du") { $output_header = true; } // output chapter title if ($node["type"] == "st") { if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && $this->lm_gui->object->getPublicAccessMode() == "selected") { if (!ilLMObject::_isPagePublic($node["obj_id"])) { continue; } } $chap = new ilStructureObject($this->lm, $node["obj_id"]); $this->tpl->setCurrentBlock("print_chapter"); $chapter_title = $chap->_getPresentationTitle($node["obj_id"], $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), 0, $this->lang); $this->tpl->setVariable("CHAP_TITLE", $chapter_title); if ($this->lm->getPageHeader() == IL_CHAPTER_TITLE) { if ($nodes[$node_key + 1]["type"] == "pg") { $this->tpl->setVariable("CHAP_HEADER", $header_page_content); $did_chap_page_header = true; } } $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("print_block"); $this->tpl->parseCurrentBlock(); } // output page if ($node["type"] == "pg") { if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && $this->lm_gui->object->getPublicAccessMode() == "selected") { if (!ilLMObject::_isPagePublic($node["obj_id"])) { continue; } } $this->tpl->setCurrentBlock("print_item"); // get page $page_id = $node["obj_id"]; $page_object_gui = $this->getLMPageGUI($page_id); $page_object = $page_object_gui->getPageObject(); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm")); // get lm page $lm_pg_obj = new ilLMPageObject($this->lm, $page_id); $lm_pg_obj->setLMId($this->lm->getId()); // determine target frames for internal links $page_object_gui->setLinkFrame($_GET["frame"]); $page_object_gui->setOutputMode("print"); $page_object_gui->setPresentationTitle(""); if ($this->lm->getPageHeader() == IL_PAGE_TITLE || $node["free"] === true) { $page_title = ilLMPageObject::_getPresentationTitle($lm_pg_obj->getId(), $this->lm->getPageHeader(), $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), false, 0, $this->lang); // prevent page title after chapter title // that have the same content if ($this->lm->isActiveNumbering()) { $chapter_title = trim(substr($chapter_title, strpos($chapter_title, " "))); } if ($page_title != $chapter_title) { $page_object_gui->setPresentationTitle($page_title); } } // handle header / footer $hcont = $header_page_content; $fcont = $footer_page_content; if ($this->lm->getPageHeader() == IL_CHAPTER_TITLE) { if ($did_chap_page_header) { $hcont = ""; } if ($nodes[$node_key + 1]["type"] == "pg" && !($nodes[$node_key + 1]["depth"] <= $act_level && !in_array($nodes[$node_key + 1]["obj_id"], $_POST["obj_id"]))) { $fcont = ""; } } $page_object_gui->setFileDownloadLink("#"); $page_object_gui->setFullscreenLink("#"); $page_object_gui->setSourceCodeDownloadScript("#"); $page_content = $page_object_gui->showPage(); if ($this->lm->getPageHeader() != IL_PAGE_TITLE) { $this->tpl->setVariable("CONTENT", $hcont . $page_content . $fcont); } else { $this->tpl->setVariable("CONTENT", $hcont . $page_content . $fcont . "<br />"); } $chapter_title = ""; $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("print_block"); $this->tpl->parseCurrentBlock(); // get internal links $int_links = ilInternalLink::_getTargetsOfSource($this->lm->getType() . ":pg", $node["obj_id"]); $got_mobs = false; foreach ($int_links as $key => $link) { if ($link["type"] == "git" && ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) { $glossary_links[$key] = $link; } if ($link["type"] == "mob" && ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) { $got_mobs = true; $mob_links[$key] = $link; } } // this is not cool because of performance reasons // unfortunately the int link table does not // store the target frame (we want to append all linked // images but not inline images (i.e. mobs with no target // frame)) if ($got_mobs) { $page_object->buildDom(); $links = $page_object->getInternalLinks(); foreach ($links as $link) { if ($link["Type"] == "MediaObject" && $link["TargetFrame"] != "" && $link["TargetFrame"] != "None") { $media_links[] = $link; } } } } } } $annex_cnt = 0; $annexes = array(); // glossary if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix()) { include_once "./Modules/Glossary/classes/class.ilGlossaryTerm.php"; include_once "./Modules/Glossary/classes/class.ilGlossaryDefinition.php"; // sort terms $terms = array(); foreach ($glossary_links as $key => $link) { $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"]); $terms[$term . ":" . $key] = array("key" => $key, "link" => $link, "term" => $term); } $terms = ilUtil::sortArray($terms, "term", "asc"); //ksort($terms); foreach ($terms as $t) { $link = $t["link"]; $key = $t["key"]; $defs = ilGlossaryDefinition::getDefinitionList($link["id"]); $def_cnt = 1; // output all definitions of term foreach ($defs as $def) { // definition + number, if more than 1 definition if (count($defs) > 1) { $this->tpl->setCurrentBlock("def_title"); $this->tpl->setVariable("TXT_DEFINITION", $this->lng->txt("cont_definition") . " " . $def_cnt++); $this->tpl->parseCurrentBlock(); } include_once "./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php"; $page_gui = new ilGlossaryDefPageGUI($def["id"]); $page_gui->setTemplateOutput(false); $page_gui->setOutputMode("print"); $this->tpl->setCurrentBlock("definition"); $page_gui->setFileDownloadLink("#"); $page_gui->setFullscreenLink("#"); $page_gui->setSourceCodeDownloadScript("#"); $output = $page_gui->showPage(); $this->tpl->setVariable("VAL_DEFINITION", $output); $this->tpl->parseCurrentBlock(); } // output term $this->tpl->setCurrentBlock("term"); $this->tpl->setVariable("VAL_TERM", $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"])); $this->tpl->parseCurrentBlock(); } // output glossary header $annex_cnt++; $this->tpl->setCurrentBlock("glossary"); $annex_title = $this->lng->txt("cont_annex") . " " . chr(64 + $annex_cnt) . ": " . $this->lng->txt("glo"); $this->tpl->setVariable("TXT_GLOSSARY", $annex_title); $this->tpl->parseCurrentBlock(); $annexes[] = $annex_title; } // referenced images if (count($media_links) > 0) { include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php"; include_once "./Services/MediaObjects/classes/class.ilMediaItem.php"; foreach ($media_links as $media) { if (substr($media["Target"], 0, 4) == "il__") { $arr = explode("_", $media["Target"]); $id = $arr[count($arr) - 1]; $med_obj = new ilObjMediaObject($id); $med_item = $med_obj->getMediaItem("Standard"); if (is_object($med_item)) { if (is_int(strpos($med_item->getFormat(), "image"))) { $this->tpl->setCurrentBlock("ref_image"); // image source if ($med_item->getLocationType() == "LocalFile") { $this->tpl->setVariable("IMG_SOURCE", ilUtil::getWebspaceDir("output") . "/mobs/mm_" . $id . "/" . $med_item->getLocation()); } else { $this->tpl->setVariable("IMG_SOURCE", $med_item->getLocation()); } if ($med_item->getCaption() != "") { $this->tpl->setVariable("IMG_TITLE", $med_item->getCaption()); } else { $this->tpl->setVariable("IMG_TITLE", $med_obj->getTitle()); } $this->tpl->parseCurrentBlock(); } } } } // output glossary header $annex_cnt++; $this->tpl->setCurrentBlock("ref_images"); $annex_title = $this->lng->txt("cont_annex") . " " . chr(64 + $annex_cnt) . ": " . $this->lng->txt("cont_ref_images"); $this->tpl->setVariable("TXT_REF_IMAGES", $annex_title); $this->tpl->parseCurrentBlock(); $annexes[] = $annex_title; } // output learning module title and toc if ($output_header) { $this->tpl->setCurrentBlock("print_header"); $this->tpl->setVariable("LM_TITLE", $this->lm->getTitle()); if ($this->lm->getDescription() != "none") { include_once "Services/MetaData/classes/class.ilMD.php"; $md = new ilMD($this->lm->getId(), 0, $this->lm->getType()); $md_gen = $md->getGeneral(); foreach ($md_gen->getDescriptionIds() as $id) { $md_des = $md_gen->getDescription($id); $description = $md_des->getDescription(); } $this->tpl->setVariable("LM_DESCRIPTION", $description); } $this->tpl->parseCurrentBlock(); // output toc $nodes2 = $nodes; foreach ($nodes2 as $node2) { if ($node2["type"] == "st" && ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node2["obj_id"])) { for ($j = 1; $j < $node2["depth"]; $j++) { $this->tpl->setCurrentBlock("indent"); $this->tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png")); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("toc_entry"); $this->tpl->setVariable("TXT_TOC_TITLE", ilStructureObject::_getPresentationTitle($node2["obj_id"], $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), 0, $this->lang)); $this->tpl->parseCurrentBlock(); } } // annexes foreach ($annexes as $annex) { $this->tpl->setCurrentBlock("indent"); $this->tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png")); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("toc_entry"); $this->tpl->setVariable("TXT_TOC_TITLE", $annex); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("toc"); $this->tpl->setVariable("TXT_TOC", $this->lng->txt("cont_toc")); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("print_start_block"); $this->tpl->parseCurrentBlock(); } // output author information include_once 'Services/MetaData/classes/class.ilMD.php'; $md = new ilMD($this->lm->getId(), 0, $this->lm->getType()); if (is_object($lifecycle = $md->getLifecycle())) { $sep = $author = ""; foreach ($ids = $lifecycle->getContributeIds() as $con_id) { $md_con = $lifecycle->getContribute($con_id); if ($md_con->getRole() == "Author") { foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) { $md_ent = $md_con->getEntity($ent_id); $author = $author . $sep . $md_ent->getEntity(); $sep = ", "; } } } if ($author != "") { $this->lng->loadLanguageModule("meta"); $this->tpl->setCurrentBlock("author"); $this->tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author")); $this->tpl->setVariable("LM_AUTHOR", $author); $this->tpl->parseCurrentBlock(); } } // output copyright information if (is_object($md_rights = $md->getRights())) { $copyright = $md_rights->getDescription(); include_once 'Services/MetaData/classes/class.ilMDUtils.php'; $copyright = ilMDUtils::_parseCopyright($copyright); if ($copyright != "") { $this->lng->loadLanguageModule("meta"); $this->tpl->setCurrentBlock("copyright"); $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright")); $this->tpl->setVariable("LM_COPYRIGHT", $copyright); $this->tpl->parseCurrentBlock(); } } $this->tpl->show(false); }
/** * execute command */ function &executeCommand() { global $tpl, $ilCtrl, $ilTabs, $ilSetting; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); //echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":". // ":nextClass:".$next_class.":"; flush(); switch ($next_class) { case "illmpagegui": // Determine whether the view of a learning resource should // be shown in the frameset of ilias, or in a separate window. //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame"; $showViewInFrameset = true; $lm_set = new ilSetting("lm"); $this->ctrl->setReturn($this, "edit"); if (!ilPageObject::_exists("lm", $this->obj->getId(), $_GET["transl"]) && ilPageObject::_exists("lm", $this->obj->getId(), "-")) { if ($_GET["totransl"] == "") { $_GET["totransl"] = $_GET["transl"]; $ilCtrl->setCmd("switchToLanguage"); } $ilCtrl->setCmdClass("illmpagegui"); $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-"); } else { $page_gui = new ilLMPageGUI($this->obj->getId()); } $page_gui->setEditPreview(true); $page_gui->activateMetaDataEditor($this->content_object->getID(), $this->obj->getId(), $this->obj->getType(), $this->obj, "MDUpdateListener"); if ($ilSetting->get("block_activated_news")) { $page_gui->setEnabledNews(true, $this->obj->content_object->getId(), $this->obj->content_object->getType()); } // set page view link if ($showViewInFrameset) { $view_frame = ilFrameTargetInfo::_getFrame("MainContent"); } else { $view_frame = "ilContObj" . $this->content_object->getID(); } $page_gui->setViewPageLink(ILIAS_HTTP_PATH . "/goto.php?target=pg_" . $this->obj->getId() . "_" . $_GET["ref_id"], $view_frame); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->content_object->getStyleSheetId(), "lm")); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->getPageObject()->buildDom(); $int_links = $page_gui->getPageObject()->getInternalLinks(); $link_xml = $this->getLinkXML($int_links); $page_gui->setLinkXML($link_xml); $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments()); $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI"); $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI"); $page_gui->setLinkParams("ref_id=" . $this->content_object->getRefId()); $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI"); $page_gui->setPresentationTitle(ilLMPageObject::_getPresentationTitle($this->obj->getId(), $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering())); $page_gui->setLocator($contObjLocator); $page_gui->setHeader($this->lng->txt("page") . ": " . $this->obj->getTitle()); $page_gui->setActivationListener($this, "activatePage"); $up_gui = $this->content_object->getType() == "dbk" ? "ilobjdlbookgui" : "ilobjlearningmodulegui"; $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId()); $page_gui->setExplorerUpdater("tree", "tree_div", $ilCtrl->getLinkTargetByClass($up_gui, "explorer", "", true)); $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.png")); $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle()); if ($this->content_object->getLayoutPerPage()) { $page_gui->setTabHook($this, "addPageTabs"); } $ret = $this->ctrl->forwardCommand($page_gui); $tpl->setContent($ret); break; default: $ret =& $this->{$cmd}(); break; } }
/** * Get container page HTML */ function getContainerPageHTML() { global $ilSetting, $ilUser; if (!$ilSetting->get("enable_cat_page_edit")) { return; } // old page editor content $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page"); if ($xpage_id > 0) { include_once "Services/XHTMLPage/classes/class.ilXHTMLPage.php"; $xpage = new ilXHTMLPage($xpage_id); return $xpage->getContent(); } // page object // if page does not exist, return nothing include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("cont", $this->object->getId())) { return ""; } include_once "./Services/Container/classes/class.ilContainerPage.php"; include_once "./Services/Container/classes/class.ilContainerPageGUI.php"; include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())); $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); // get page object include_once "./Services/Object/classes/class.ilObjectTranslation.php"; $ot = ilObjectTranslation::getInstance($this->object->getId()); $lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(), "cont"); $page_gui = new ilContainerPageGUI($this->object->getId(), 0, $lang); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), $this->object->getType())); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $ret = $page_gui->showPage(); //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>"; //$ret =& $page_gui->executeCommand(); return $ret; }
/** * Prepare HTML exporter * * @param * @return */ function prepareHTMLExporter($a_target_dir) { // system style html exporter include_once "./Services/Style/classes/class.ilSystemStyleHTMLExport.php"; $this->sys_style_html_export = new ilSystemStyleHTMLExport($a_target_dir); $this->sys_style_html_export->export(); // init co page html exporter include_once "./Services/COPage/classes/class.ilCOPageHTMLExport.php"; $this->co_page_html_export = new ilCOPageHTMLExport($a_target_dir); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->co_page_html_export->setContentStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->getStyleSheetId())); $this->co_page_html_export->createDirectories(); $this->co_page_html_export->exportStyles(); $this->co_page_html_export->exportSupportScripts(); include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php"; $this->flv_dir = $a_target_dir . "/" . ilPlayerUtil::getFlashVideoPlayerDirectory(); ilUtil::makeDir($a_target_dir . '/css/yahoo'); ilUtil::makeDir($a_target_dir . '/objects'); ilUtil::makeDir($a_target_dir . '/players'); ilUtil::makeDir($this->flv_dir); include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php"; // copy(ilPlayerUtil::getFlashVideoPlayerFilename(true), // $a_target_dir.'/js/'.ilPlayerUtil::getFlashVideoPlayerFilename()); ilPlayerUtil::copyPlayerFilesToTargetDirectory($this->flv_dir); copy('./Modules/Scorm2004/scripts/scorm_2004.js', $a_target_dir . '/js/scorm.js'); copy('./Modules/Scorm2004/scripts/pager.js', $a_target_dir . '/js/pager.js'); copy('./Modules/Scorm2004/scripts/questions/pure.js', $a_target_dir . '/js/pure.js'); copy('./Modules/Scorm2004/scripts/questions/question_handling.js', $a_target_dir . '/js/question_handling.js'); }
/** * Execute command * @return <type> */ public function executeCommand() { global $ilCtrl; $next_class = $ilCtrl->getNextClass($this); $cmd = $ilCtrl->getCmd(); $this->setTabs(); switch ($next_class) { case 'ilcourseobjectivesgui': $this->ctrl->setReturn($this, 'listObjectives'); $GLOBALS['ilTabs']->clearTargets(); $GLOBALS['ilTabs']->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'listObjectives')); include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php'; $reg_gui =& new ilCourseObjectivesGUI($this->getParentObject()->getRefId()); $this->ctrl->forwardCommand($reg_gui); break; case 'ilcontainerstartobjectsgui': include_once './Services/Container/classes/class.ilContainerStartObjectsGUI.php'; $stgui = new ilContainerStartObjectsGUI($this->getParentObject()); $ret = $this->ctrl->forwardCommand($stgui); $GLOBALS['ilTabs']->activateSubTab('start'); $GLOBALS['ilTabs']->removeSubTab('manage'); #$GLOBALS['tpl']->setContent($this->ctrl->getHTML($stgui)); break; case 'ilconditionhandlergui': $this->ctrl->saveParameterByClass('ilconditionhandlergui', 'objective_id'); $GLOBALS['ilTabs']->clearTargets(); $GLOBALS['ilTabs']->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'listObjectives')); include_once './Services/AccessControl/classes/class.ilConditionHandlerInterface.php'; $cond = new ilConditionHandlerGUI($this); $cond->setBackButtons(array()); $cond->setAutomaticValidation(false); $cond->setTargetType("lobj"); $cond->setTargetRefId($this->getParentObject()->getRefId()); $cond->setTargetId((int) $_REQUEST['objective_id']); // objecitve include_once './Modules/Course/classes/class.ilCourseObjective.php'; $obj = new ilCourseObjective($this->getParentObject(), (int) $_REQUEST['objective_id']); $cond->setTargetTitle($obj->getTitle()); $this->ctrl->forwardCommand($cond); break; case 'illopagegui': $this->ctrl->saveParameterByClass('illopagegui', 'objective_id'); $GLOBALS['ilTabs']->clearTargets(); $GLOBALS['ilTabs']->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'listObjectives')); $objtv_id = (int) $_REQUEST['objective_id']; include_once 'Modules/Course/classes/Objectives/class.ilLOPage.php'; if (!ilLOPage::_exists('lobj', $objtv_id)) { // doesn't exist -> create new one $new_page_object = new ilLOPage(); $new_page_object->setParentId($objtv_id); $new_page_object->setId($objtv_id); $new_page_object->createFromXML(); unset($new_page_object); } $this->ctrl->setReturn($this, 'listObjectives'); include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php'; $pgui = new ilLOPageGUI($objtv_id); $pgui->setPresentationTitle(ilCourseObjective::lookupObjectiveTitle($objtv_id)); // needed for editor? include_once './Services/Style/classes/class.ilObjStyleSheet.php'; $pgui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0)); // #14895 $GLOBALS['tpl']->setCurrentBlock("ContentStyle"); $GLOBALS['tpl']->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $GLOBALS['tpl']->parseCurrentBlock(); $ret = $this->ctrl->forwardCommand($pgui); if ($ret) { $GLOBALS['tpl']->setContent($ret); } break; default: if (!$cmd) { // get first unaccomplished step include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php'; $cmd = ilLOEditorStatus::getInstance($this->getParentObject())->getFirstFailedStep(); } $this->{$cmd}(); break; } return true; }
/** * view wiki page */ function viewPageObject() { global $lng, $ilCtrl, $tpl, $ilTabs, $ilAccess; $this->checkPermission("read"); $ilTabs->clearTargets(); $tpl->setHeaderActionMenu(null); $page = $_GET["page"] != "" ? $_GET["page"] : $this->object->getStartPage(); $_GET["page"] = $page; include_once "./Modules/Wiki/classes/class.ilWikiPage.php"; if (!ilWikiPage::exists($this->object->getId(), $page)) { $page = $this->object->getStartPage(); } if (!ilWikiPage::exists($this->object->getId(), $page)) { ilUtil::sendInfo($lng->txt("wiki_no_start_page"), true); $ilCtrl->redirect($this, "infoScreen"); return; } // page exists, show it ! $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($page)); include_once "./Modules/Wiki/classes/class.ilWikiPageGUI.php"; $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($page), 0, $this->object->getRefId()); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), "wiki")); $this->setContentStyleSheet(); //$wpage_gui->setOutputMode(IL_PAGE_PREVIEW); //$wpage_gui->setSideBlock(); $ilCtrl->setCmdClass("ilwikipagegui"); $ilCtrl->setCmd("preview"); if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) && (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) || $wpage_gui->getPageObject()->getBlocked())) { $wpage_gui->setEnableEditing(false); } // alter title and description //$tpl->setTitle($wpage_gui->getPageObject()->getTitle()); //$tpl->setDescription($this->object->getTitle()); $html = $ilCtrl->forwardCommand($wpage_gui); //$this->addPageTabs(); $tpl->setContent($html); }