/** * Constructor * * @param object $a_parent_obj * @param int $table_id * @param int $a_definition_id */ public function __construct($table_id, $a_definition_id = 0) { global $tpl; //TODO Permission-Check $this->table_id = $table_id; if (!$a_definition_id) { $a_definition_id = ilDataCollectionRecordViewViewdefinition::getIdByTableId($this->table_id); } // we always need a page object - create on demand if (!$a_definition_id) { $viewdef = new ilDataCollectionRecordViewViewdefinition(0, $this->table_id); $viewdef->create(); $a_definition_id = $viewdef->getId(); } parent::__construct("dclf", $a_definition_id); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // config $this->setPreventHTMLUnmasking(true); $this->setEnabledPCTabs(true); $this->setEnabledMaps(false); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); $this->setEnabledActivation(false); }
/** * 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(); }
/** * Constructor */ function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true) { global $tpl, $ilSetting; $this->portfolio_id = (int) $a_portfolio_id; $this->enable_comments = (bool) $a_enable_comments; parent::__construct("prtf", $a_id, $a_old_nr); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // #11190 $prfa_set = new ilSetting("prfa"); $this->setPreventHTMLUnmasking((bool) $prfa_set->get("mask", false)); // $this->setEnabledMaps(true); $this->setEnabledInternalLinks(false); $this->setEnabledPCTabs(true); $this->setEnabledProfile(true); if (!$ilSetting->get('disable_wsp_certificates')) { $this->setEnabledVerification(true); } /* embedding blog postings currently disabled if(!$ilSetting->get('disable_wsp_blogs')) { $this->setEnabledBlog(true); } */ $skmg_set = new ilSetting("skmg"); if ($skmg_set->get("enable_skmg")) { $this->setEnabledSkills(true); } }
/** * Constructor */ public function __construct() { global $tpl; if (!ilImprint::_exists("impr", 1)) { $page = new ilImprint("impr"); $page->setId(1); $page->create(); } // there is only 1 imprint page parent::__construct("impr", 1); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // config $this->setPreventHTMLUnmasking(true); $this->setEnabledPCTabs(true); $this->setEnabledMaps(false); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); $this->setEnabledActivation(true); }
/** * @param $table_id * @param int $a_definition_id */ public function __construct($table_id, $a_definition_id = 0) { global $tpl, $ilCtrl; /** * @var $ilCtrl ilCtrl */ $this->ctrl = $ilCtrl; //TODO Permission-Check $this->table_id = $table_id; if (!$a_definition_id) { $a_definition_id = ilDataCollectionRecordViewViewdefinition::getIdByTableId($this->table_id); } // we always need a page object - create on demand if (!$a_definition_id) { $viewdef = new ilDataCollectionRecordViewViewdefinition(); $viewdef->setTableId($this->table_id); $viewdef->setActive(false); $viewdef->create(); $a_definition_id = $viewdef->getId(); } parent::__construct("dclf", $a_definition_id); $this->getPageObject()->setTableId($this->table_id); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
function __construct($a_parent_type, $a_id = 0, $a_old_nr = 0, $a_slm_id = 0) { global $tpl, $ilCtrl; parent::__construct($a_parent_type, $a_id, $a_old_nr); //associated object include_once "./Services/Style/classes/class.ilPageLayout.php"; $this->layout_object = new ilPageLayout($a_id); $this->layout_object->readObject(); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->layout_object->getStyleId())); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilObjStyleSheet::getPlaceHolderStylePath()); $tpl->parseCurrentBlock(); $this->setEnabledMaps(false); $this->setPreventHTMLUnmasking(false); $this->setEnabledInternalLinks(false); $this->setEnabledSelfAssessment(false); $this->setStyleId($this->layout_object->getStyleId()); //set For GUI and associated object $this->setLayoutMode(true); $this->obj->setLayoutMode(true); $this->slm_id = $a_slm_id; }
/** * Constructor * * @param int $a_node * @param object $a_access_handler * @param int $a_id * @param int $a_old_nr * @param bool $a_enable_notes * @param bool $a_may_contribute * @return ilBlogPostingGUI */ function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes = true, $a_may_contribute = true) { global $tpl, $lng; $lng->loadLanguageModule("blog"); $this->node_id = $a_node_id; $this->access_handler = $a_access_handler; $this->enable_public_notes = (bool) $a_enable_public_notes; parent::__construct("blp", $a_id, $a_old_nr); // #11151 $this->may_contribute = (bool) $a_may_contribute; $this->setEnableEditing($a_may_contribute); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // #11190 $blga_set = new ilSetting("blga"); $this->setPreventHTMLUnmasking((bool) $blga_set->get("mask", false)); $this->setEnabledMaps(true); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); $this->setEnabledPCTabs(true); $this->setEnabledActivation(true); }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0, $a_wiki_ref_id = 0) { global $tpl; // needed for notifications $this->setWikiRefId($a_wiki_ref_id); parent::__construct("wpg", $a_id, $a_old_nr); $this->getPageObject()->setWikiRefId($this->getWikiRefId()); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0, $a_prevent_get_id = false, $a_lang = "") { global $tpl; parent::__construct("mep", $a_id, $a_old_nr, $a_prevent_get_id, $a_lang); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0) { global $tpl; parent::__construct("user", $a_id, $a_old_nr); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $this->setEnabledMaps(true); $this->setPreventHTMLUnmasking(true); $this->setEnabledInternalLinks(false); $this->setEnabledPCTabs(true); // $this->initPageObject($a_id, $a_old_nr); }
public function __construct($a_dcl_object) { global $tpl; $this->dcl_gui_object = $a_dcl_object; $this->record_id = $_GET['record_id']; $this->record_obj = ilDataCollectionCache::getRecordCache($this->record_id); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
/** * Constructor */ function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true) { global $tpl; $this->portfolio_id = (int) $a_portfolio_id; $this->enable_comments = (bool) $a_enable_comments; parent::__construct($this->getParentType(), $a_id, $a_old_nr); $this->getPageObject()->setPortfolioId($this->portfolio_id); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0, $a_prevent_get_id = false) { global $tpl; parent::__construct("mep", $a_id, $a_old_nr, $a_prevent_get_id); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $this->setEnabledMaps(false); $this->setPreventHTMLUnmasking(false); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); }
/** * Constructor */ public function __construct() { global $tpl; if (!ilImprint::_exists("impr", 1)) { $page = new ilImprint("impr"); $page->setId(1); $page->create(); } // there is only 1 imprint page parent::__construct("impr", 1); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
function __construct($a_parent_type, $a_id = 0, $a_old_nr = 0, $a_slm_id = 0) { global $tpl, $ilCtrl; parent::__construct($a_parent_type, $a_id, $a_old_nr); //associated object include_once "./Services/Style/classes/class.ilPageLayout.php"; $this->layout_object = new ilPageLayout($a_id); $this->layout_object->readObject(); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->layout_object->getStyleId())); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilObjStyleSheet::getPlaceHolderStylePath()); $tpl->parseCurrentBlock(); $this->setStyleId($this->layout_object->getStyleId()); $this->slm_id = $a_slm_id; }
/** * Constructor * * @param int $a_node * @param object $a_access_handler * @param int $a_id * @param int $a_old_nr * @param bool $a_enable_notes * @param bool $a_may_contribute * @return ilBlogPostingGUI */ function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes = true, $a_may_contribute = true) { global $tpl, $lng; $lng->loadLanguageModule("blog"); $this->node_id = $a_node_id; $this->access_handler = $a_access_handler; $this->enable_public_notes = (bool) $a_enable_public_notes; parent::__construct("blp", $a_id, $a_old_nr); // needed for notification $this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace()); // #11151 $this->may_contribute = (bool) $a_may_contribute; $this->setEnableEditing($a_may_contribute); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
/** * @param ilObjDataCollectionGUI $a_dcl_object */ public function __construct(ilObjDataCollectionGUI $a_dcl_object) { global $tpl, $ilCtrl; $this->dcl_gui_object = $a_dcl_object; $this->record_id = (int) $_REQUEST['record_id']; $this->record_obj = ilDataCollectionCache::getRecordCache($this->record_id); if (!$this->record_obj->hasPermissionToView((int) $_GET['ref_id'])) { ilUtil::sendFailure('dcl_msg_no_perm_view', true); $ilCtrl->redirectByClass('ildatacollectionrecordlistgui', 'listRecords'); } // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); $this->table = $this->record_obj->getTable(); // Comments include_once "./Services/Notes/classes/class.ilNoteGUI.php"; $repId = $this->dcl_gui_object->getDataCollectionObject()->getId(); $objId = (int) $this->record_id; $this->notesGUI = new ilNoteGUI($repId, $objId); $this->notesGUI->enablePublicNotes(true); $this->notesGUI->enablePublicNotesDeletion(true); $ilCtrl->setParameterByClass("ilnotegui", "record_id", $this->record_id); $ilCtrl->setParameterByClass("ilnotegui", "rep_id", $repId); if (isset($_GET['disable_paging']) && $_GET['disable_paging']) { $this->is_enabled_paging = false; } // Find current, prev and next records for navigation if ($this->is_enabled_paging) { $this->determineNextPrevRecords(); } }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0, $a_wiki_ref_id = 0) { global $tpl; // needed for notifications $this->setWikiRefId($a_wiki_ref_id); $this->setPageToc(ilObjWiki::_lookupPageToc(ilObject::_lookupObjId($a_wiki_ref_id))); parent::__construct("wpg", $a_id, $a_old_nr); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $this->setEnabledMaps(true); $this->setPreventHTMLUnmasking(true); $this->setEnabledInternalLinks(true); $this->setEnableAnchors(true); $this->setEnabledWikiLinks(true); $this->setEnabledPCTabs(true); $cfg = new ilPageConfig(); $cfg->setIntLinkFilterWhiteList(true); $cfg->addIntLinkFilter("RepositoryItem"); $this->setPageConfig($cfg); $this->setIntLinkHelpDefault("RepositoryItem", 0); }
/** * show abstract of digilib book */ function showAbstract($a_target_id) { if (count($_POST["tr_id"]) > 1) { $message = true; $message_text = $this->lng->txt("cont_select_one_translation_warning"); $show_full = false; } else { if (!$a_target_id and ($_POST["action"] == "show" or $_POST["action"] == "details")) { $message = true; $message_text = $this->lng->txt("cont_select_one_edition"); $show_full = false; } else { if (is_array($a_target_id) and count($a_target_id) > 1) { $message = true; $message_text = $this->lng->txt("cont_msg_multiple_editions"); $show_full = false; } else { if (is_array($a_target_id)) { $a_target_id = $a_target_id[0]; $show_full = true; } else { $a_target_id = 0; $show_full = false; } } } } $this->object->initBibItemObject(); // content style $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())); $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->setCurrentBlock("ilPage"); $tmp_tpl = new ilTemplate("tpl.bibliography.xsl", true, true, "Modules/LearningModule"); $tmp_tpl->setVariable("TITLE", $this->lng->txt("title")); $tmp_tpl->setVariable("EDITION", $this->lng->txt("cont_edition")); $tmp_tpl->setVariable("AUTHORS", $this->lng->txt("authors")); if ($show_full) { $this->ctrl->setParameterByClass("illmpresentationgui", "frame", "maincontent"); $action = $this->ctrl->getLinkTargetByClass("illmpresentationgui", "layout"); $params = array('mode' => "view_full", 'action' => $action, 'target_id' => "{$a_target_id}"); $tmp_tpl->setVariable("BOOKTITLE", $this->lng->txt("cont_booktitle")); $tmp_tpl->setVariable("CROSS_REFERENCE", $this->lng->txt("cont_cross_reference")); $tmp_tpl->setVariable("DETAILS", $this->lng->txt("cont_details")); $tmp_tpl->setVariable("EDITOR", $this->lng->txt("editor")); $tmp_tpl->setVariable("HOW_PUBLISHED", $this->lng->txt("cont_how_published")); $tmp_tpl->setVariable("WHERE_PUBLISHED", $this->lng->txt("cont_where_published")); $tmp_tpl->setVariable("INSTITUTION", $this->lng->txt("institution")); $tmp_tpl->setVariable("JOURNAL", $this->lng->txt("cont_journal")); $tmp_tpl->setVariable("KEYWORD", $this->lng->txt("cont_keyword")); $tmp_tpl->setVariable("PAGES", $this->lng->txt("cont_pages")); $tmp_tpl->setVariable("SCHOOL", $this->lng->txt("cont_school")); $tmp_tpl->setVariable("MONTH", $this->lng->txt("cont_month")); $tmp_tpl->setVariable("PUBLISHER", $this->lng->txt("cont_publisher")); $tmp_tpl->setVariable("SERIES", $this->lng->txt("cont_series")); $tmp_tpl->setVariable("SERIES_TITLE", $this->lng->txt("cont_series_title")); $tmp_tpl->setVariable("SERIES_EDITOR", $this->lng->txt("cont_series_editor")); $tmp_tpl->setVariable("SERIES_VOLUME", $this->lng->txt("cont_series_volume")); $tmp_tpl->setVariable("YEAR", $this->lng->txt("cont_year")); $tmp_tpl->setVariable("ISBN", $this->lng->txt("cont_isbn")); $tmp_tpl->setVariable("URL", $this->lng->txt("cont_url")); } else { $this->ctrl->setParameterByClass("illmpresentationgui", "frame", "maincontent"); $action = $this->ctrl->getLinkTargetByClass("illmpresentationgui", "layout"); $params = array('mode' => "view_simple", 'action' => $action); $this->ctrl->clearParametersByClass("illmpresentationgui"); if ($translations = $this->object->getTranslations()) { foreach ($translations as $tr_id) { $tmp_obj = ilObjectFactory::getInstanceByRefId($tr_id); $tmp_tpl->setCurrentBlock("TRANSLATION_ROW"); $tmp_tpl->setVariable("ROW_TITLE", $tmp_obj->getTitle()); $tmp_tpl->setVariable("ROW_ID", $tr_id); $tmp_tpl->parseCurrentBlock(); unset($tmp_obj); } $tmp_tpl->setCurrentBlock("TRANSLATION"); $tmp_tpl->setVariable("TRANSLATION_HEADER", $this->lng->txt("cont_translations")); $tmp_tpl->parseCurrentBlock(); } $tmp_tpl->setVariable("DETAILS", $this->lng->txt("cont_details")); $tmp_tpl->setVariable("SHOW", $this->lng->txt("cont_show")); $tmp_tpl->setVariable("SHOW_CITATION", $this->lng->txt("cont_show_citation")); $tmp_tpl->setVariable("GO", $this->lng->txt("go")); } // SHOW MESSAGE if ($message) { ilUtil::sendInfo($message_text); } $xsl = $tmp_tpl->get(); $xml = $this->object->bib_obj->getXML(); if (empty($xml)) { return true; } $args = array('/_xml' => $xml, '/_xsl' => $xsl); $xh = xslt_create(); $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params); $this->tpl->setVariable("PAGE_CONTENT", $output); return $output; }
/** * Export content style * * @param * @return */ function exportStyles() { include_once "Services/Style/classes/class.ilObjStyleSheet.php"; // export content style sheet if ($this->getContentStyleId() < 1) { $cont_stylesheet = "./Services/COPage/css/content.css"; $css = fread(fopen($cont_stylesheet, 'r'), filesize($cont_stylesheet)); preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files); foreach (array_unique($files[1]) as $fileref) { if (is_file(str_replace("..", ".", $fileref))) { copy(str_replace("..", ".", $fileref), $this->content_style_img_dir . "/" . basename($fileref)); } $css = str_replace($fileref, "images/" . basename($fileref), $css); } fwrite(fopen($this->content_style_dir . "/content.css", 'w'), $css); } else { $style = new ilObjStyleSheet($this->getContentStyleId()); $style->writeCSSFile($this->content_style_dir . "/content.css", "images"); $style->copyImagesToDir($this->content_style_img_dir); } // export syntax highlighting style $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath(); copy($syn_stylesheet, $this->exp_dir . "/syntaxhighlight.css"); }
/** * execute command * * @global ilLocatorGUI $ilLocator * @global ilAccessHandler $ilAccess * @global ilNavigationHistory $ilNavigationHistory * @global ilTemplate $tpl * @global ilCtrl $ilCtrl * @global ilTabsGUI $ilTabs * @global ilLanguage $lng * @global ILIAS $ilias */ function executeCommand() { global $ilUser, $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr, $ilTabs, $lng, $ilDB, $ilPluginAdmin; if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !$ilAccess->checkAccess("visible", "", $_GET["ref_id"])) { global $ilias; $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { if ('qpl' == $this->object->getType()) { $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "qpl"); } } $cmd = $this->ctrl->getCmd("questions"); $next_class = $this->ctrl->getNextClass($this); if (in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions') { $_GET['q_id'] = ''; } $this->prepareOutput(); $this->ctrl->setReturn($this, "questions"); $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print"); $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen"); if ($_GET["q_id"] < 1) { $q_type = $_POST["sel_question_types"] != "" ? $_POST["sel_question_types"] : $_GET["sel_question_types"]; } if ($cmd != "createQuestion" && $cmd != "createQuestionForTest" && $next_class != "ilassquestionpagegui") { if ($_GET["test_ref_id"] != "" or $_GET["calling_test"]) { $ref_id = $_GET["test_ref_id"]; if (!$ref_id) { $ref_id = $_GET["calling_test"]; } } } switch ($next_class) { case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case 'ilmdeditorgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case 'ilassquestionpreviewgui': $this->ctrl->saveParameter($this, "q_id"); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php'; $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB); $gui->initQuestion((int) $_GET['q_id'], $this->object->getId()); $gui->initPreviewSettings($this->object->getRefId()); $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']); $gui->initHintTracking(); $gui->initStyleSheets(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); $this->ctrl->forwardCommand($gui); break; case "ilassquestionpagegui": include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]); $q_gui->setQuestionTabs(); $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $q_gui->setTargetGuiClass(null); $q_gui->setQuestionActionCmd(null); $question = $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php"; $this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view"); $this->ctrl->setReturn($this, "questions"); $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]); $page_gui->setEditPreview(true); $page_gui->setEnabledTabs(false); if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode("edit"); $page_gui->setHeader($question->getTitle()); $page_gui->setPresentationTitle($question->getTitle()); $ret = $this->ctrl->forwardCommand($page_gui); $tpl->setContent($ret); break; case 'ilpermissiongui': include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui = new ilPermissionGUI($this); $ret = $this->ctrl->forwardCommand($perm_gui); break; case 'ilobjectcopygui': include_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('qpl'); $this->ctrl->forwardCommand($cp); break; case "ilquestionpoolexportgui": require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php'; $exp_gui = new ilQuestionPoolExportGUI($this); $exp_gui->addFormat('zip', $this->lng->txt('qpl_export_xml'), $this, 'createExportQTI'); $exp_gui->addFormat('xls', $this->lng->txt('qpl_export_excel'), $this, 'createExportExcel'); $ret = $this->ctrl->forwardCommand($exp_gui); break; case "ilinfoscreengui": $this->infoScreenForward(); break; case 'ilassquestionhintsgui': // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); // forward to ilAssQuestionHintsGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php'; $gui = new ilAssQuestionHintsGUI($questionGUI); $ilCtrl->forwardCommand($gui); break; case 'illocalunitconfigurationgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); $this->ctrl->setReturn($this, 'questions'); require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php'; require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php'; $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id'])); $ilCtrl->forwardCommand($gui); break; case 'ilassquestionfeedbackeditinggui': // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); // forward to ilAssQuestionFeedbackGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php'; $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng); $ilCtrl->forwardCommand($gui); break; case 'ilobjquestionpoolsettingsgeneralgui': require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php'; $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this); $this->ctrl->forwardCommand($gui); break; case "ilobjtaxonomygui": require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php'; $forwarder = new ilObjQuestionPoolTaxonomyEditingCommandForwarder($this->object, $ilDB, $ilPluginAdmin, $ilCtrl, $ilTabs, $lng); $forwarder->forward(); break; case 'ilquestionbrowsertablegui': $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array())); // no tax ids required break; case "ilobjquestionpoolgui": case "": if ($cmd == 'questions') { $this->ctrl->setParameter($this, 'q_id', ''); } $cmd .= "Object"; $ret = $this->{$cmd}(); break; default: $this->ctrl->setReturn($this, "questions"); include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]); $q_gui->object->setObjId($this->object->getId()); if ($this->object->getType() == 'qpl') { $q_gui->setTaxonomyIds($this->object->getTaxonomyIds()); $this->object->addQuestionChangeListeners($q_gui->object); } $q_gui->setQuestionTabs(); global $ilHelp; $ilHelp->setScreenIdComponent("qpl"); $ret = $this->ctrl->forwardCommand($q_gui); break; } if (!(strtolower($_GET["baseClass"]) == "iladministrationgui" || strtolower($_GET['baseClass']) == 'ilrepositorygui') && $this->getCreationMode() != true) { $this->tpl->show(); } }
/** * list definitions of a term */ function listDefinitions($a_ref_id = 0, $a_term_id = 0, $a_get_html = false) { global $ilUser, $ilAccess, $ilias, $lng, $ilCtrl; if ($a_ref_id == 0) { $ref_id = (int) $_GET["ref_id"]; } else { $ref_id = $a_ref_id; } if ($a_term_id == 0) { $term_id = $this->term_id; } else { $term_id = $a_term_id; } if (!$ilAccess->checkAccess("read", "", $ref_id)) { $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } // tabs if ($this->glossary->getPresentationMode() != "full_def") { $this->showDefinitionTabs("content"); } $term = new ilGlossaryTerm($term_id); if (!$a_get_html) { $tpl = $this->tpl; require_once "./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php"; $tpl->getStandardTemplate(); // $this->setTabs(); if ($this->offlineMode()) { $style_name = $ilUser->prefs["style"] . ".css"; $tpl->setVariable("LOCATION_STYLESHEET", "./" . $style_name); } else { $this->setLocator(); } // content style $tpl->setCurrentBlock("ContentStyle"); if (!$this->offlineMode()) { $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())); } else { $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content.css"); } $tpl->parseCurrentBlock(); // syntax style $tpl->setCurrentBlock("SyntaxStyle"); if (!$this->offlineMode()) { $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); } else { $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", "syntaxhighlight.css"); } $tpl->parseCurrentBlock(); $tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png")); $tpl->setTitle($this->lng->txt("cont_term") . ": " . $term->getTerm()); // load template for table $tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", "Modules/Glossary"); } else { // content style $this->tpl->setCurrentBlock("ContentStyle"); if (!$this->offlineMode()) { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())); } else { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content.css"); } $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); if (!$this->offlineMode()) { $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); } else { $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", "syntaxhighlight.css"); } $this->tpl->parseCurrentBlock(); $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary"); } $defs = ilGlossaryDefinition::getDefinitionList($term_id); $tpl->setVariable("TXT_TERM", $term->getTerm()); $this->mobs = array(); for ($j = 0; $j < count($defs); $j++) { $def = $defs[$j]; $page_gui = new ilGlossaryDefPageGUI($def["id"]); $page_gui->setStyleId($this->glossary->getStyleSheetId()); $page = $page_gui->getPageObject(); // internal links $page->buildDom(); $int_links = $page->getInternalLinks(); $link_xml = $this->getLinkXML($int_links); $page_gui->setLinkXML($link_xml); if ($this->offlineMode()) { $page_gui->setOutputMode("offline"); $page_gui->setOfflineDirectory($this->getOfflineDirectory()); } $page_gui->setSourcecodeDownloadScript($this->getLink($ref_id)); $page_gui->setFullscreenLink($this->getLink($ref_id, "fullscreen", $term_id, $def["id"])); $page_gui->setTemplateOutput(false); $page_gui->setRawPageContent(true); $page_gui->setFileDownloadLink($this->getLink($ref_id, "downloadFile")); if (!$this->offlineMode()) { $output = $page_gui->preview(); } else { $output = $page_gui->presentation($page_gui->getOutputMode()); } if (count($defs) > 1) { $tpl->setCurrentBlock("definition_header"); $tpl->setVariable("TXT_DEFINITION", $this->lng->txt("cont_definition") . " " . ($j + 1)); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock("definition"); $tpl->setVariable("PAGE_CONTENT", $output); $tpl->parseCurrentBlock(); } // display possible backlinks $sources = ilInternalLink::_getSourcesOfTarget('git', $_GET['term_id'], 0); if ($sources) { $backlist_shown = false; foreach ($sources as $src) { $type = explode(':', $src['type']); if ($type[0] == 'lm') { if ($type[1] == 'pg') { $title = ilLMPageObject::_getPresentationTitle($src['id']); $lm_id = ilLMObject::_lookupContObjID($src['id']); $lm_title = ilObject::_lookupTitle($lm_id); $tpl->setCurrentBlock('backlink_item'); $ref_ids = ilObject::_getAllReferences($lm_id); $access = false; foreach ($ref_ids as $rid) { if ($ilAccess->checkAccess("read", "", $rid)) { $access = true; } } if ($access) { $tpl->setCurrentBlock("backlink_item"); $tpl->setVariable("BACKLINK_LINK", ILIAS_HTTP_PATH . "/goto.php?target=" . $type[1] . "_" . $src['id']); $tpl->setVariable("BACKLINK_ITEM", $lm_title . ": " . $title); $tpl->parseCurrentBlock(); $backlist_shown = true; } } } } if ($backlist_shown) { $tpl->setCurrentBlock("backlink_list"); $tpl->setVariable("BACKLINK_TITLE", $this->lng->txt('glo_term_used_in')); $tpl->parseCurrentBlock(); } } if (!$a_get_html) { $tpl->setCurrentBlock("perma_link"); $tpl->setVariable("PERMA_LINK", ILIAS_HTTP_PATH . "/goto.php?target=" . "git" . "_" . $term_id . "_" . $ref_id . "&client_id=" . CLIENT_ID); $tpl->setVariable("TXT_PERMA_LINK", $this->lng->txt("perma_link")); $tpl->setVariable("PERMA_TARGET", "_top"); $tpl->parseCurrentBlock(); } // highlighting? if ($_GET["srcstring"] != "" && !$this->offlineMode()) { include_once './Services/Search/classes/class.ilUserSearchCache.php'; $cache = ilUserSearchCache::_getInstance($ilUser->getId()); $cache->switchSearchType(ilUserSearchCache::LAST_QUERY); $search_string = $cache->getQuery(); include_once "./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php"; include_once "./Services/Search/classes/class.ilQueryParser.php"; $p = new ilQueryParser($search_string); $p->parse(); $words = $p->getQuotedWords(); if (is_array($words)) { foreach ($words as $w) { ilTextHighlighterGUI::highlight("ilGloContent", $w, $tpl); } } $this->fill_on_load_code = true; } if ($this->offlineMode() || $a_get_html) { return $tpl->get(); } }
/** * Get HTML of ILIAS login page editor * @return string html */ protected function getLoginPageEditorHTML() { global $lng, $tpl; include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php'; $lpe = ilAuthLoginPageEditorSettings::getInstance(); $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey()); if (!$active_lang) { return ''; } // if page does not exist, return nothing include_once './Services/COPage/classes/class.ilPageUtil.php'; if (!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang))) { return ''; } include_once './Services/Authentication/classes/class.ilLoginPage.php'; include_once './Services/Authentication/classes/class.ilLoginPageGUI.php'; 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(); // get page object $page_gui = new ilLoginPageGUI(ilLanguage::lookupId($active_lang)); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(0, 'auth'); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $ret = $page_gui->showPage(); return $ret; }
/** * 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); }
/** * 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>"; } }
/** * execute command */ function executeCommand() { global $ilAccess, $ilNavigationHistory, $ilCtrl, $ilErr, $tpl, $lng, $ilTabs, $ilPluginAdmin, $ilDB, $tree, $ilias, $ilUser; if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); } $cmd = $this->ctrl->getCmd("infoScreen"); $cmdsDisabledDueToOfflineStatus = array('resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses'); if (!$this->getCreationMode() && !$this->object->isOnline() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) { $cmd = 'infoScreen'; } $next_class = $this->ctrl->getNextClass($this); $this->ctrl->setReturn($this, "infoScreen"); if (method_exists($this->object, "getTestStyleLocation")) { $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen"); } // add entry to navigation history if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) { $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"], "tst"); } if (!$this->getCreationMode()) { if (IS_PAYMENT_ENABLED) { require_once 'Services/Payment/classes/class.ilPaymentObject.php'; if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) { $this->setLocator(); $this->tpl->getStandardTemplate(); include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php'; $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']); $ret = $this->ctrl->forwardCommand($pp); $this->tpl->show(); exit; } } } // elba hack for storing question id for inserting new question after if ($_REQUEST['prev_qid']) { global $___prev_question_id; $___prev_question_id = $_REQUEST['prev_qid']; $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']); } if (!$this->getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken()) { if (!$this->isValidRequestOnBrokenQuestionSetDepencies($next_class, $cmd)) { $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen'); } } $this->determineObjectiveOrientedContainer(); switch ($next_class) { case 'iltestexportgui': if (!$ilAccess->checkAccess('write', '', $this->ref_id)) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilTestExportGUI.php'; $ilCtrl->forwardCommand(new ilTestExportGUI($this)); break; case "ilinfoscreengui": $this->prepareOutput(); $this->addHeaderAction(); $this->infoScreen(); // forwards command break; case 'ilmdeditorgui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING); } $this->prepareOutput(); $this->addHeaderAction(); require_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object, 'MDUpdateListener', 'General'); $this->ctrl->forwardCommand($md_gui); break; case "iltestplayerfixedquestionsetgui": require_once "./Modules/Test/classes/class.ilTestPlayerFixedQuestionSetGUI.php"; if (!$this->object->getKioskMode()) { $this->prepareOutput(); } $gui = new ilTestPlayerFixedQuestionSetGUI($this->object); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $this->ctrl->forwardCommand($gui); break; case "iltestplayerrandomquestionsetgui": require_once "./Modules/Test/classes/class.ilTestPlayerRandomQuestionSetGUI.php"; if (!$this->object->getKioskMode()) { $this->prepareOutput(); } $gui = new ilTestPlayerRandomQuestionSetGUI($this->object); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $this->ctrl->forwardCommand($gui); break; case "iltestplayerdynamicquestionsetgui": require_once "./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php"; if (!$this->object->getKioskMode()) { $this->prepareOutput(); } $gui = new ilTestPlayerDynamicQuestionSetGUI($this->object); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $this->ctrl->forwardCommand($gui); break; case "iltestevaluationgui": $this->forwardToEvaluationGUI(); break; case "iltestevalobjectiveorientedgui": $this->forwardToEvalObjectiveOrientedGUI(); break; case "iltestservicegui": $this->prepareOutput(); $this->addHeaderAction(); require_once "./Modules/Test/classes/class.ilTestServiceGUI.php"; $serviceGUI =& new ilTestServiceGUI($this->object); $this->ctrl->forwardCommand($serviceGUI); break; case 'ilpermissiongui': $this->prepareOutput(); $this->addHeaderAction(); include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case "illearningprogressgui": $this->prepareOutput(); $this->addHeaderAction(); require_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId()); $this->ctrl->forwardCommand($new_gui); break; case "ilcertificategui": $this->prepareOutput(); $this->addHeaderAction(); require_once "./Services/Certificate/classes/class.ilCertificateGUI.php"; require_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php"; $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object)); $this->ctrl->forwardCommand($output_gui); break; case "iltestscoringgui": $this->prepareOutput(); $this->addHeaderAction(); require_once "./Modules/Test/classes/class.ilTestScoringGUI.php"; $output_gui = new ilTestScoringGUI($this->object); $this->ctrl->forwardCommand($output_gui); break; case 'ilmarkschemagui': if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) { ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true); $this->ctrl->redirect($this, 'infoScreen'); } $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilMarkSchemaGUI.php'; $mark_schema_gui = new ilMarkSchemaGUI($this->object); $this->ctrl->forwardCommand($mark_schema_gui); break; case 'iltestscoringbyquestionsgui': $this->prepareOutput(); $this->addHeaderAction(); include_once 'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php'; $output_gui = new ilTestScoringByQuestionsGUI($this->object); $this->ctrl->forwardCommand($output_gui); break; case 'ilobjtestsettingsgeneralgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php'; $gui = new ilObjTestSettingsGeneralGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $ilUser, $this); $this->ctrl->forwardCommand($gui); break; case 'ilobjtestsettingsscoringresultsgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php'; $gui = new ilObjTestSettingsScoringResultsGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $this); $this->ctrl->forwardCommand($gui); break; case 'ilobjtestdynamicquestionsetconfiggui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php'; $gui = new ilObjTestDynamicQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object); $this->ctrl->forwardCommand($gui); break; case 'iltestrandomquestionsetconfiggui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php'; $gui = new ilTestRandomQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object); $this->ctrl->forwardCommand($gui); break; case 'iltestquestionbrowsertablegui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php'; $gui = new ilTestQuestionBrowserTableGUI($this->ctrl, $this->tpl, $ilTabs, $this->lng, $tree, $ilDB, $ilPluginAdmin, $this->object); $gui->setWriteAccess($ilAccess->checkAccess("write", "", $this->ref_id)); $gui->init(); $this->ctrl->forwardCommand($gui); break; case 'iltestskilladministrationgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/Test/classes/class.ilTestSkillAdministrationGUI.php'; $gui = new ilTestSkillAdministrationGUI($ilias, $this->ctrl, $ilAccess, $ilTabs, $this->tpl, $this->lng, $ilDB, $tree, $ilPluginAdmin, $this->object, $this->ref_id); $this->ctrl->forwardCommand($gui); break; case 'iltestskillevaluationgui': $this->prepareOutput(); $this->addHeaderAction(); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php'; if ($this->object->isDynamicTest()) { require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php'; $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object); $dynamicQuestionSetConfig->loadFromDb(); $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin); $questionList->setParentObjId($dynamicQuestionSetConfig->getSourceQuestionPoolId()); $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS); } else { $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin); $questionList->setParentObjId($this->object->getId()); $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_DUPLICATES); } $questionList->load(); require_once 'Modules/Test/classes/class.ilTestSessionFactory.php'; $testSessionFactory = new ilTestSessionFactory($this->object); $testSession = $testSessionFactory->getSession(); $testResults = $this->object->getTestResult($testSession->getActiveId(), $testSession->getPass(), true); require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php'; $gui = new ilTestSkillEvaluationGUI($this->ctrl, $ilTabs, $this->tpl, $this->lng, $ilDB, $this->object->getTestId(), $this->object->getRefId(), $this->object->getId()); $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer()); $gui->setQuestionList($questionList); $gui->setTestSession($testSession); $gui->setTestResults($testResults); $this->ctrl->forwardCommand($gui); break; case 'ilobjectcopygui': $this->prepareOutput(); $this->addHeaderAction(); require_once './Services/Object/classes/class.ilObjectCopyGUI.php'; $cp = new ilObjectCopyGUI($this); $cp->setType('tst'); $this->ctrl->forwardCommand($cp); break; case 'ilrepositorysearchgui': $this->prepareOutput(); $this->addHeaderAction(); require_once './Services/Search/classes/class.ilRepositorySearchGUI.php'; $rep_search =& new ilRepositorySearchGUI(); $rep_search->setCallback($this, 'addParticipantsObject', array()); // Set tabs $this->ctrl->setReturn($this, 'participants'); $ret =& $this->ctrl->forwardCommand($rep_search); $this->tabs_gui->setTabActive('participants'); break; case 'ilpageeditorgui': case 'iltestexpresspageobjectgui': require_once 'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php'; $incompleteQuestionPurger = new ilAssIncompleteQuestionPurger($ilDB); $incompleteQuestionPurger->setOwnerId($ilUser->getId()); $incompleteQuestionPurger->purge(); $qid = $_REQUEST['q_id']; // :FIXME: does not work // $this->ctrl->saveParameterByClass(array('iltestexpresspageobjectgui', 'assorderingquestiongui', 'ilpageeditorgui', 'ilpcquestion', 'ilpcquestiongui'), 'test_express_mode'); if (!$qid || $qid == 'Array') { $questions = $this->object->getQuestionTitlesAndIndexes(); if (!is_array($questions)) { $questions = array(); } $keys = array_keys($questions); $qid = $keys[0]; $_REQUEST['q_id'] = $qid; $_GET['q_id'] = $qid; $_POST['q_id'] = $qid; } $this->prepareOutput(); if (!in_array($cmd, array('addQuestion', 'browseForQuestions'))) { $this->buildPageViewToolbar($qid); } if (!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions'))) { require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php"; $pageObject = new ilTestExpressPageObjectGUI(0); $pageObject->test_object = $this->object; $ret =& $this->ctrl->forwardCommand($pageObject); break; } require_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI("", $qid); if (!$q_gui instanceof assQuestionGUI) { $this->ctrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', ''); $this->ctrl->redirectByClass('iltestexpresspageobjectgui', $this->ctrl->getCmd()); } $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $question = $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); #$this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view"); $this->ctrl->setReturn($this, "questions"); require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php"; require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php"; $page_gui = new ilTestExpressPageObjectGUI($qid); $page_gui->test_object = $this->object; $page_gui->setEditPreview(true); $page_gui->setEnabledTabs(false); if (strlen($this->ctrl->getCmd()) == 0) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview'); $page_gui->setHeader($question->getTitle()); $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile")); $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen")); $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this)); $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']'); $ret =& $this->ctrl->forwardCommand($page_gui); global $ilTabs; $ilTabs->activateTab('assQuestions'); $this->tpl->setContent($ret); break; case 'ilassquestionpreviewgui': $this->prepareOutput(); $this->ctrl->saveParameter($this, "q_id"); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php'; $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB); $gui->initQuestion((int) $_GET['q_id'], $this->object->getId()); $gui->initPreviewSettings($this->object->getRefId()); $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']); $gui->initHintTracking(); $gui->initStyleSheets(); $this->ctrl->forwardCommand($gui); break; case 'ilassquestionpagegui': require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php"; //echo $_REQUEST['prev_qid']; if ($_REQUEST['prev_qid']) { $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']); } $this->prepareOutput(); //global $___test_express_mode; //$___test_express_mode = true; $_GET['calling_test'] = $this->object->getRefId(); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]); $q_gui->setQuestionTabs(); $q_gui->outAdditionalOutput(); $q_gui->object->setObjId($this->object->getId()); $question =& $q_gui->object; $this->ctrl->saveParameter($this, "q_id"); $this->lng->loadLanguageModule("content"); $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view"); $this->ctrl->setReturn($this, "questions"); $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]); $page_gui->setEditPreview(true); if (strlen($this->ctrl->getCmd()) == 0) { $this->ctrl->setCmdClass(get_class($page_gui)); $this->ctrl->setCmd("preview"); } $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE))); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview'); $page_gui->setHeader($question->getTitle()); $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']'); $ret =& $this->ctrl->forwardCommand($page_gui); $this->tpl->setContent($ret); break; case 'ilassspecfeedbackpagegui': require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php"; $pg_gui = new ilAssSpecFeedbackPageGUI((int) $_GET["feedback_id"]); $this->ctrl->forwardCommand($pg_gui); break; case 'ilassgenfeedbackpagegui': require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php"; $pg_gui = new ilAssGenFeedbackPageGUI((int) $_GET["feedback_id"]); $this->ctrl->forwardCommand($pg_gui); break; case 'illocalunitconfigurationgui': $this->prepareSubGuiOutput(); // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php'; require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php'; $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id'])); $this->ctrl->forwardCommand($gui); break; case "ilcommonactiondispatchergui": require_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; case 'ilassquestionhintsgui': $this->prepareSubGuiOutput(); // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI =& assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); // forward to ilAssQuestionHintsGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php'; $gui = new ilAssQuestionHintsGUI($questionGUI); $ilCtrl->forwardCommand($gui); break; case 'ilassquestionfeedbackeditinggui': $this->prepareSubGuiOutput(); // set return target $this->ctrl->setReturn($this, "questions"); // set context tabs require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php'; $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']); $questionGUI->object->setObjId($this->object->getId()); $questionGUI->setQuestionTabs(); // forward to ilAssQuestionFeedbackGUI require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php'; $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng); $ilCtrl->forwardCommand($gui); break; case 'iltesttoplistgui': $this->prepareOutput(); require_once './Modules/Test/classes/class.ilTestToplistGUI.php'; $gui = new ilTestToplistGUI($this); $this->ctrl->forwardCommand($gui); break; case 'ilscoringadjustmentgui': $this->prepareOutput(); require_once './Modules/Test/classes/class.ilScoringAdjustmentGUI.php'; $gui = new ilScoringAdjustmentGUI($this->object); $this->ctrl->forwardCommand($gui); break; case '': case 'ilobjtestgui': $this->prepareOutput(); $this->addHeaderAction(); if (strcmp($cmd, "properties") == 0 && $_GET["browse"]) { $this->questionBrowser(); return; } if (strcmp($cmd, "properties") == 0 && ($_GET["up"] || $_GET["down"])) { $this->questionsObject(); return; } $cmd .= "Object"; $ret =& $this->{$cmd}(); break; default: // elba hack for storing question id for inserting new question after if ($_REQUEST['prev_qid']) { global $___prev_question_id; $___prev_question_id = $_REQUEST['prev_qid']; $this->ctrl->setParameterByClass('ilassquestionpagegui', 'prev_qid', $_REQUEST['prev_qid']); $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']); } $this->create_question_mode = true; $this->prepareOutput(); $this->ctrl->setReturn($this, "questions"); require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $q_gui =& assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $_GET["q_id"]); $q_gui->object->setObjId($this->object->getId()); if (!$_GET['sel_question_types']) { $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']); } else { $qType = $_GET['sel_question_types']; } $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']); $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']); $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']); if ($_REQUEST['test_express_mode']) { $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1); } #global $___test_express_mode; #$___test_express_mode = true; if (!$q_gui->isSaveCommand()) { $_GET['calling_test'] = $this->object->getRefId(); } $q_gui->setQuestionTabs(); #unset($___test_express_mode); $ret =& $this->ctrl->forwardCommand($q_gui); break; } if (!in_array(strtolower($_GET["baseClass"]), array('iladministrationgui', 'ilrepositorygui')) && $this->getCreationMode() != true) { $this->tpl->show(); } }
/** * deletion confirmation screen */ function confirmDefinitionDeletion() { global $ilTabs; $this->getTemplate(); $this->displayLocator(); $this->setTabs(); $ilTabs->activateTab("definitions"); // content style $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm()); $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png")); $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true); ilUtil::sendQuestion($this->lng->txt("info_delete_sure")); $this->tpl->setVariable("TXT_TERM", $this->term->getTerm()); $definition =& new ilGlossaryDefinition($_GET["def"]); //$page =& new ilPageObject("gdf", $definition->getId()); $page_gui =& new ilPageObjectGUI("gdf", $definition->getId()); $page_gui->setTemplateOutput(false); $page_gui->setStyleId($this->glossary->getStyleSheetId()); $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]); $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]); $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]); $output = $page_gui->preview(); $this->tpl->setCurrentBlock("definition"); $this->tpl->setVariable("PAGE_CONTENT", $output); $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $this->tpl->setVariable("LINK_CANCEL", $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion")); $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm")); $this->ctrl->setParameter($this, "def", $definition->getId()); $this->tpl->setVariable("LINK_CONFIRM", $this->ctrl->getLinkTarget($this, "deleteDefinition")); $this->tpl->parseCurrentBlock(); }
/** * export html package */ function exportHTML($a_target_dir, $log, $a_zip_file = true, $a_export_format = "html") { global $tpl, $ilBench, $ilLocator, $ilUser; // initialize temporary target directory ilUtil::delDir($a_target_dir); ilUtil::makeDir($a_target_dir); $mob_dir = $a_target_dir . "/mobs"; ilUtil::makeDir($mob_dir); $file_dir = $a_target_dir . "/files"; ilUtil::makeDir($file_dir); $teximg_dir = $a_target_dir . "/teximg"; ilUtil::makeDir($teximg_dir); $style_dir = $a_target_dir . "/style"; ilUtil::makeDir($style_dir); $style_img_dir = $a_target_dir . "/style/images"; ilUtil::makeDir($style_img_dir); $content_style_dir = $a_target_dir . "/content_style"; ilUtil::makeDir($content_style_dir); $content_style_img_dir = $a_target_dir . "/content_style/images"; ilUtil::makeDir($content_style_img_dir); $GLOBALS["teximgcnt"] = 0; // export system style sheet $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem"); $style_name = $ilUser->prefs["style"] . ".css"; copy($location_stylesheet, $style_dir . "/" . $style_name); $fh = fopen($location_stylesheet, "r"); $css = fread($fh, filesize($location_stylesheet)); preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files); foreach (array_unique($files[1]) as $fileref) { $fileref = dirname($location_stylesheet) . "/" . $fileref; if (is_file($fileref)) { copy($fileref, $style_img_dir . "/" . basename($fileref)); } } fclose($fh); $location_stylesheet = ilUtil::getStyleSheetLocation(); // export content style sheet $ilBench->start("ExportHTML", "exportContentStyle"); if ($this->getStyleSheetId() < 1) { $cont_stylesheet = "./Services/COPage/css/content.css"; $css = fread(fopen($cont_stylesheet, 'r'), filesize($cont_stylesheet)); preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files); foreach (array_unique($files[1]) as $fileref) { if (is_file(str_replace("..", ".", $fileref))) { copy(str_replace("..", ".", $fileref), $content_style_img_dir . "/" . basename($fileref)); } $css = str_replace($fileref, "images/" . basename($fileref), $css); } fwrite(fopen($content_style_dir . "/content.css", 'w'), $css); } else { $style = new ilObjStyleSheet($this->getStyleSheetId()); $style->writeCSSFile($content_style_dir . "/content.css", "images"); $style->copyImagesToDir($content_style_img_dir); } $ilBench->stop("ExportHTML", "exportContentStyle"); // export syntax highlighting style $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath(); copy($syn_stylesheet, $a_target_dir . "/syntaxhighlight.css"); // get learning module presentation gui class include_once "./Modules/LearningModule/classes/class.ilLMPresentationGUI.php"; $_GET["cmd"] = "nop"; $lm_gui =& new ilLMPresentationGUI(); $lm_gui->setOfflineMode(true); $lm_gui->setOfflineDirectory($a_target_dir); $lm_gui->setExportFormat($a_export_format); // export pages $ilBench->start("ExportHTML", "exportHTMLPages"); $this->exportHTMLPages($lm_gui, $a_target_dir); $ilBench->stop("ExportHTML", "exportHTMLPages"); // export glossary terms $ilBench->start("ExportHTML", "exportHTMLGlossaryTerms"); $this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir); $ilBench->stop("ExportHTML", "exportHTMLGlossaryTerms"); // export all media objects $ilBench->start("ExportHTML", "exportHTMLMediaObjects"); $linked_mobs = array(); foreach ($this->offline_mobs as $mob) { if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob") { $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs); } } $linked_mobs2 = array(); // mobs linked in link areas foreach ($linked_mobs as $mob) { if (ilObject::_exists($mob)) { $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2); } } $_GET["obj_type"] = "MediaObject"; $_GET["obj_id"] = $a_mob_id; $_GET["cmd"] = ""; $ilBench->stop("ExportHTML", "exportHTMLMediaObjects"); // export all file objects $ilBench->start("ExportHTML", "exportHTMLFileObjects"); foreach ($this->offline_files as $file) { $this->exportHTMLFile($a_target_dir, $file); } $ilBench->stop("ExportHTML", "exportHTMLFileObjects"); // export table of contents $ilBench->start("ExportHTML", "exportHTMLTOC"); $ilLocator->clearItems(); if ($this->isActiveTOC()) { $tpl = new ilTemplate("tpl.main.html", true, true); //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); $content =& $lm_gui->showTableOfContents(); $file = $a_target_dir . "/table_of_contents.html"; // open file if (!($fp = @fopen($file, "w+"))) { die("<b>Error</b>: Could not open \"" . $file . "\" for writing" . " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />"); } chmod($file, 0770); fwrite($fp, $content); fclose($fp); } $ilBench->stop("ExportHTML", "exportHTMLTOC"); // export images $ilBench->start("ExportHTML", "exportHTMLImages"); $image_dir = $a_target_dir . "/images"; ilUtil::makeDir($image_dir); ilUtil::makeDir($image_dir . "/browser"); copy(ilUtil::getImagePath("enlarge.png", false, "filesystem"), $image_dir . "/enlarge.png"); copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"), $image_dir . "/browser/plus.png"); copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"), $image_dir . "/browser/minus.png"); copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"), $image_dir . "/browser/blank.png"); copy(ilUtil::getImagePath("spacer.png", false, "filesystem"), $image_dir . "/spacer.png"); copy(ilUtil::getImagePath("icon_st.png", false, "filesystem"), $image_dir . "/icon_st.png"); copy(ilUtil::getImagePath("icon_pg.png", false, "filesystem"), $image_dir . "/icon_pg.png"); copy(ilUtil::getImagePath("icon_st_s.png", false, "filesystem"), $image_dir . "/icon_st_s.png"); copy(ilUtil::getImagePath("icon_pg_s.png", false, "filesystem"), $image_dir . "/icon_pg_s.png"); copy(ilUtil::getImagePath("icon_lm.png", false, "filesystem"), $image_dir . "/icon_lm.png"); copy(ilUtil::getImagePath("icon_lm_s.png", false, "filesystem"), $image_dir . "/icon_lm_s.png"); copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"), $image_dir . "/nav_arr_L.png"); copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"), $image_dir . "/nav_arr_R.png"); copy(ilUtil::getImagePath("browser/forceexp.png", false, "filesystem"), $image_dir . "/browser/forceexp.png"); copy(ilUtil::getImagePath("download.png", false, "filesystem"), $image_dir . "/download.png"); $ilBench->stop("ExportHTML", "exportHTMLImages"); // export flv/mp3 player $services_dir = $a_target_dir . "/Services"; ilUtil::makeDir($services_dir); $media_service_dir = $services_dir . "/MediaObjects"; ilUtil::makeDir($media_service_dir); include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php"; $flv_dir = $a_target_dir . "/" . ilPlayerUtil::getFlashVideoPlayerDirectory(); ilUtil::makeDir($flv_dir); $mp3_dir = $media_service_dir . "/flash_mp3_player"; ilUtil::makeDir($mp3_dir); // copy(ilPlayerUtil::getFlashVideoPlayerFilename(true), // $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename()); ilPlayerUtil::copyPlayerFilesToTargetDirectory($flv_dir); // js files ilUtil::makeDir($a_target_dir . '/js'); ilUtil::makeDir($a_target_dir . '/js/yahoo'); ilUtil::makeDir($a_target_dir . '/css'); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; foreach (self::getSupplyingExportFiles($a_target_dir) as $f) { if ($f["source"] != "") { copy($f["source"], $f["target"]); } } // template workaround: reset of template $tpl = new ilTemplate("tpl.main.html", true, true); $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet); $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); // zip everything $ilBench->start("ExportHTML", "zip"); if (true) { if ($a_zip_file) { // zip it all $date = time(); $zip_file = $this->getExportDirectory("html") . "/" . $date . "__" . IL_INST_ID . "__" . $this->getType() . "_" . $this->getId() . ".zip"; ilUtil::zip($a_target_dir, $zip_file); ilUtil::delDir($a_target_dir); } } $ilBench->stop("ExportHTML", "zip"); }
/** * Forward to page editor */ protected function forwardToPageObject() { global $lng, $tpl; $key = (int) $_REQUEST['key']; $this->ctrl->saveParameter($this, 'key', $key); include_once "./Services/Authentication/classes/class.ilLoginPage.php"; include_once "./Services/Authentication/classes/class.ilLoginPageGUI.php"; include_once './Services/Style/classes/class.ilObjStyleSheet.php'; $lng->loadLanguageModule("content"); if (!ilLoginPage::_exists('auth', $key)) { // doesn't exist -> create new one $new_page_object = new ilLoginPage(); $new_page_object->setParentId($key); $new_page_object->setId($key); $new_page_object->createFromXML(); } 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(); $this->ctrl->setReturnByClass('illoginpagegui', "edit"); $page_gui = new ilLoginPageGUI($key); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setLinkXML($link_xml); //$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments()); //$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile")); //$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen")); //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo // $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, "")); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); //$page_gui->setLocator($contObjLocator); $page_gui->setHeader(""); // style tab //$page_gui->setTabHook($this, "addPageTabs"); if ($this->ctrl->getCmd() == 'editPage') { $this->ctrl->setCmd('edit'); } $html = $this->ctrl->forwardCommand($page_gui); $tpl->setContent($html); }
function &executeCommand() { global $tpl, $ilCtrl, $lng; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); // content style $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); require_once "./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php"; $gloss_loc =& new ilGlossaryLocatorGUI(); $gloss_loc->setTerm($this->term); $gloss_loc->setGlossary($this->glossary); $gloss_loc->setDefinition($this->definition); $this->tpl->getStandardTemplate(); $this->tpl->setTitle($this->term->getTerm() . " - " . $this->lng->txt("cont_definition") . " " . $this->definition->getNr()); if ($this->ctrl->getNextClass() == "ilpageobjectgui") { $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_def_b.png")); } switch ($next_class) { case "ilpageobjectgui": // output number of usages if ($ilCtrl->getCmd() == "edit" && $ilCtrl->getCmdClass() == "ilpageobjectgui") { $nr = ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]); if ($nr > 0) { $link = "[<a href='" . $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages") . "'>" . $lng->txt("glo_list_usages") . "</a>]"; ilUtil::sendInfo(sprintf($lng->txt("glo_term_is_used_n_times"), $nr) . " " . $link); } } // not so nice, to do: revise locator handling if ($this->ctrl->getNextClass() == "ilpageobjectgui" || $this->ctrl->getCmdClass() == "ileditclipboardgui") { $gloss_loc->display(); } $this->setTabs(); $this->ctrl->setReturnByClass("ilPageObjectGUI", "edit"); $this->ctrl->setReturn($this, "listDefinitions"); $page_gui =& new ilPageObjectGUI("gdf", $this->definition->getId()); $page = $page_gui->getPageObject(); $this->definition->assignPageObject($page); $page->addUpdateListener($this, "saveShortText"); $page_gui->setEditPreview(true); // metadata // ... set title to term, if no title is given include_once "./Services/MetaData/classes/class.ilMD.php"; $md = new ilMD($this->glossary->getId(), $this->definition->getId(), "gdf"); $md_gen = $md->getGeneral(); if ($md_gen->getTitle() == "") { $md_gen->setTitle($this->term->getTerm()); $md_gen->update(); } $page_gui->activateMetaDataEditor($this->glossary->getId(), $this->definition->getId(), "gdf"); // $this->obj, "MDUpdateListener"); $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]); $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=" . $_GET["ref_id"]); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setOutputMode("edit"); $page_gui->setEnableKeywords(true); $page_gui->setStyleId($this->glossary->getStyleSheetId()); $page_gui->setLocator($gloss_loc); $page_gui->setEnabledInternalLinks(true); $page_gui->setIntLinkHelpDefault("GlossaryItem", $_GET["ref_id"]); $page_gui->setIntLinkReturn($this->ctrl->getLinkTargetByClass("ilobjglossarygui", "quickList", "", false, false)); $page_gui->setPageBackTitle($this->lng->txt("cont_definition")); $page_gui->setLinkParams("ref_id=" . $_GET["ref_id"]); $page_gui->setHeader($this->term->getTerm()); $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=" . $_GET["ref_id"]); $page_gui->setPresentationTitle($this->term->getTerm()); $ret =& $this->ctrl->forwardCommand($page_gui); $tpl->setContent($ret); break; default: $this->setTabs(); $gloss_loc->display(); $ret =& $this->{$cmd}(); break; } }