/**
  * View media pool page.
  */
 function preview()
 {
     global $ilCtrl, $ilAccess, $lng;
     return parent::preview();
 }
 /**
  * list definitions
  */
 function listDefinitions()
 {
     global $ilTabs;
     $this->getTemplate();
     $this->displayLocator();
     $this->setTabs();
     $ilTabs->activateTab("definitions");
     require_once "./Services/COPage/classes/class.ilPageObjectGUI.php";
     // 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();
     // load template for table
     $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
     //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
     //ilUtil::sendInfo();
     $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
     $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
     $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setCurrentBlock("add_def");
     $this->tpl->setVariable("TXT_ADD_DEFINITION", $this->lng->txt("cont_add_definition"));
     $this->tpl->setVariable("BTN_ADD", "addDefinition");
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock("def_list");
     $defs = ilGlossaryDefinition::getDefinitionList($_GET["term_id"]);
     $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
     for ($j = 0; $j < count($defs); $j++) {
         $def = $defs[$j];
         $page_gui = new ilPageObjectGUI("gdf", $def["id"]);
         $page_gui->setStyleId($this->glossary->getStyleSheetId());
         $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
         $page_gui->setTemplateOutput(false);
         $output = $page_gui->preview();
         if (count($defs) > 1) {
             $this->tpl->setCurrentBlock("definition_header");
             $this->tpl->setVariable("TXT_DEFINITION", $this->lng->txt("cont_definition") . " " . ($j + 1));
             $this->tpl->parseCurrentBlock();
         }
         if ($j > 0) {
             $this->tpl->setCurrentBlock("up");
             $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
             $this->ctrl->setParameter($this, "def", $def["id"]);
             $this->tpl->setVariable("LINK_UP", $this->ctrl->getLinkTarget($this, "moveUp"));
             $this->tpl->parseCurrentBlock();
         }
         if ($j + 1 < count($defs)) {
             $this->tpl->setCurrentBlock("down");
             $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
             $this->ctrl->setParameter($this, "def", $def["id"]);
             $this->tpl->setVariable("LINK_DOWN", $this->ctrl->getLinkTarget($this, "moveDown"));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("submit_btns");
         $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
         $this->ctrl->setParameter($this, "def", $def["id"]);
         $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
         $this->tpl->setVariable("LINK_EDIT", $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilPageObjectGUI"), "edit"));
         $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
         $this->tpl->setVariable("LINK_DELETE", $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion"));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("definition");
         $this->tpl->setVariable("PAGE_CONTENT", $output);
         $this->tpl->parseCurrentBlock();
     }
     //$this->tpl->setCurrentBlock("def_list");
     //$this->tpl->parseCurrentBlock();
     $this->quickList();
 }
예제 #3
0
 /**
  * Preview blog posting
  */
 function preview($a_mode = null)
 {
     global $ilCtrl, $tpl, $ilSetting;
     $this->getBlogPosting()->increaseViewCnt();
     $wtpl = new ilTemplate("tpl.blog_page_view_main_column.html", true, true, "Modules/Blog");
     // page commands
     if (!$a_mode) {
         /*
         // delete
         $page_commands = false;
         if ($this->checkAccess("write"))
         {
         	$wtpl->setCurrentBlock("page_command");
         	$wtpl->setVariable("HREF_PAGE_CMD",
         		$ilCtrl->getLinkTarget($this, "deleteBlogPostingConfirmationScreen"));
         	$wtpl->setVariable("TXT_PAGE_CMD", $lng->txt("delete"));
         	$wtpl->parseCurrentBlock();
         }		
         if ($page_commands)
         {
         	$wtpl->setCurrentBlock("page_commands");
         	$wtpl->parseCurrentBlock();
         }			  
         */
     } else {
         $callback = array($this, "observeNoteAction");
         // notes
         $may_delete_comments = $this->checkAccess("contribute") && $ilSetting->get("comments_del_tutor", 1);
         $wtpl->setVariable("NOTES", $this->getNotesHTML($this->getBlogPosting(), false, $this->enable_public_notes, $may_delete_comments, $callback));
     }
     // permanent link
     if ($a_mode != "embedded") {
         $append = $_GET["blpg"] != "" ? "_" . $_GET["blpg"] : "";
         if ($this->isInWorkspace()) {
             $append .= "_wsp";
         }
         $tpl->setPermanentLink("blog", $this->node_id, $append);
     }
     $wtpl->setVariable("PAGE", parent::preview());
     $tpl->setLoginTargetPar("blog_" . $this->node_id . $append);
     $ilCtrl->setParameter($this, "blpg", $this->getBlogPosting()->getId());
     return $wtpl->get();
 }
 /**
  * View wiki page.
  */
 function preview()
 {
     global $ilCtrl, $ilAccess, $lng, $tpl, $ilUser, $ilSetting, $ilToolbar;
     // block/unblock
     if ($this->getPageObject()->getBlocked()) {
         ilUtil::sendInfo($lng->txt("wiki_page_status_blocked"));
     }
     $this->increaseViewCount();
     $this->addHeaderAction();
     // content
     $this->setSideBlock();
     $wtpl = new ilTemplate("tpl.wiki_page_view_main_column.html", true, true, "Modules/Wiki");
     $callback = array($this, "observeNoteAction");
     // notes
     if (!$ilSetting->get("disable_comments") && ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
         $wtpl->setVariable("NOTES", $this->getNotesHTML($this->getPageObject(), true, ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()), $ilAccess->checkAccess("write", "", $_GET["ref_id"]), $callback));
     }
     // permanent link
     $append = $_GET["page"] != "" ? "_" . ilWikiUtil::makeUrlTitle($_GET["page"]) : "";
     include_once "./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php";
     $perma_link = new ilPermanentLinkGUI("wiki", $_GET["ref_id"], $append);
     $wtpl->setVariable("PERMA_LINK", $perma_link->getHTML());
     // page content
     $wtpl->setVariable("PAGE", parent::preview());
     $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
     // last edited info
     $wtpl->setVariable("LAST_EDITED_INFO", $lng->txt("wiki_last_edited") . ": " . ilDatePresentation::formatDate(new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)) . ", " . ilUserUtil::getNamePresentation($this->getPageObject()->getLastChangeUser(), false, true, $ilCtrl->getLinkTarget($this, "preview")));
     $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
     //highlighting
     if ($_GET["srcstring"] != "") {
         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("ilCOPageContent", $w, $tpl);
             }
         }
         $this->fill_on_load_code = true;
     }
     return $wtpl->get();
 }