/**
  * Fill table row
  */
 protected function fillRow($term)
 {
     global $lng, $ilCtrl;
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
     $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $term["id"]);
     $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]);
     $ilCtrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term["id"]);
     // actions drop down
     if ($this->glossary->getId() == $term["glo_id"]) {
         $list = new ilAdvancedSelectionListGUI();
         $list->addItem($lng->txt("cont_edit_term"), "", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
         if (count($defs) > 1) {
             $list->addItem($lng->txt("cont_edit_definitions"), "", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listDefinitions"));
         } else {
             if (count($defs) == 1) {
                 $ilCtrl->setParameterByClass("ilglossarydefpagegui", "def", $defs[0]["id"]);
                 $list->addItem($lng->txt("cont_edit_definition"), "", $ilCtrl->getLinkTargetByClass(array("ilglossarytermgui", "iltermdefinitioneditorgui", "ilglossarydefpagegui"), "edit"));
             }
         }
         $list->addItem($lng->txt("cont_add_definition"), "", $ilCtrl->getLinkTargetByClass("ilobjglossarygui", "addDefinition"));
         $ilCtrl->setParameterByClass("ilglossarydefpagegui", "def", "");
         $list->setId("act_term_" . $term["id"]);
         $list->setListTitle($lng->txt("actions"));
         $this->tpl->setVariable("ACTIONS", $list->getHTML());
     }
     for ($j = 0; $j < count($defs); $j++) {
         $def = $defs[$j];
         /*if ($this->glossary->getId() == $term["glo_id"])
         			{
         				// up
         				if ($j > 0)
         				{
         					$this->tpl->setCurrentBlock("move_up");
         					$this->tpl->setVariable("TXT_UP", $lng->txt("up"));
         					$ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
         					$ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
         					$this->tpl->setVariable("LINK_UP",
         						$ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionUp"));
         					$this->tpl->parseCurrentBlock();
         				}
         	
         				// down
         				if ($j+1 < count($defs))
         				{
         					$this->tpl->setCurrentBlock("move_down");
         					$this->tpl->setVariable("TXT_DOWN", $lng->txt("down"));
         					$ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
         					$ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
         					$this->tpl->setVariable("LINK_DOWN",
         						$ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionDown"));
         					$this->tpl->parseCurrentBlock();
         				}
         	
         				// delete
         				$this->tpl->setCurrentBlock("delete");
         				$ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
         				$ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
         				$this->tpl->setVariable("LINK_DELETE",
         					$ilCtrl->getLinkTarget($this->parent_obj, "confirmDefinitionDeletion"));
         				$this->tpl->setVariable("TXT_DELETE", $lng->txt("delete"));
         				$this->tpl->parseCurrentBlock();
         	
         				// edit
         				$this->tpl->setCurrentBlock("edit");
         				$ilCtrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term["id"]);
         				$ilCtrl->setParameterByClass("ilglossarydefpagegui", "def", $def["id"]);
         				$this->tpl->setVariable("LINK_EDIT",
         					$ilCtrl->getLinkTargetByClass(array("ilglossarytermgui",
         					"iltermdefinitioneditorgui",
         					"ilglossarydefpagegui"), "edit"));
         				$this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
         				$this->tpl->parseCurrentBlock();
         			}*/
         // text
         $this->tpl->setCurrentBlock("definition");
         $short_str = $def["short_text"];
         // replace tex
         // if a tex end tag is missing a tex end tag
         $ltexs = strrpos($short_str, "[tex]");
         $ltexe = strrpos($short_str, "[/tex]");
         if ($ltexs > $ltexe) {
             $page = new ilGlossaryDefPage($def["id"]);
             $page->buildDom();
             $short_str = $page->getFirstParagraphText();
             $short_str = strip_tags($short_str, "<br>");
             $ltexe = strpos($short_str, "[/tex]", $ltexs);
             $short_str = ilUtil::shortenText($short_str, $ltexe + 6, true);
         }
         $short_str = ilUtil::insertLatexImages($short_str);
         $short_str = ilPCParagraph::xml2output($short_str);
         $this->tpl->setVariable("DEF_SHORT", $short_str);
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("definition_row");
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("check_col");
     $this->tpl->setVariable("CHECKBOX_ID", $term["id"]);
     $this->tpl->parseCurrentBlock();
     $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
     // usage
     if (in_array("usage", $this->getSelectedColumns())) {
         $nr_usage = ilGlossaryTerm::getNumberOfUsages($term["id"]);
         if ($nr_usage > 0 && $this->glossary->getId() == $term["glo_id"]) {
             $this->tpl->setCurrentBlock("link_usage");
             $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]);
             $this->tpl->setVariable("LUSAGE", ilGlossaryTerm::getNumberOfUsages($term["id"]));
             $this->tpl->setVariable("LINK_USAGE", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages"));
             $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", "");
             $this->tpl->parseCurrentBlock();
         } else {
             $this->tpl->setCurrentBlock("usage");
             $this->tpl->setVariable("USAGE", ilGlossaryTerm::getNumberOfUsages($term["id"]));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("td_usage");
         $this->tpl->parseCurrentBlock();
     }
     // glossary title
     if (in_array($this->glossary->getVirtualMode(), array("level", "subtree"))) {
         $this->tpl->setCurrentBlock("glossary");
         $this->tpl->setVariable("GLO_TITLE", ilObject::_lookupTitle($term["glo_id"]));
         $this->tpl->parseCurrentBlock();
     }
     // output language
     if (in_array("language", $this->getSelectedColumns())) {
         $this->tpl->setCurrentBlock("td_lang");
         $this->tpl->setVariable("TEXT_LANGUAGE", $lng->txt("meta_l_" . $term["language"]));
         $this->tpl->parseCurrentBlock();
     }
     foreach ($this->adv_cols_order as $c) {
         if ($c["id"] == 0) {
             $this->tpl->setCurrentBlock("td");
             $this->tpl->setVariable("TD_VAL", $term["term"]);
             $this->tpl->parseCurrentBlock();
         } else {
             if (in_array("md_" . $c["id"], $this->selected_cols)) {
                 $id = (int) $c["id"];
                 $val = " ";
                 if (isset($term["md_" . $id . "_presentation"])) {
                     $pb = $term["md_" . $id . "_presentation"]->getHTML();
                     if ($pb) {
                         $val = $pb;
                     }
                 }
                 $this->tpl->setCurrentBlock("td");
                 $this->tpl->setVariable("TD_VAL", $val);
                 $this->tpl->parseCurrentBlock();
             }
         }
     }
 }
 /**
  * get tabs
  */
 function getTabs(&$tabs_gui)
 {
     global $lng, $ilHelp;
     $ilHelp->setScreenIdComponent("glo_term");
     //echo ":".$_GET["term_id"].":";
     if ($_GET["term_id"] != "") {
         $tabs_gui->addTab("properties", $lng->txt("properties"), $this->ctrl->getLinkTarget($this, "editTerm"));
         $tabs_gui->addTab("definitions", $lng->txt("cont_definitions"), $this->ctrl->getLinkTarget($this, "listDefinitions"));
         $tabs_gui->addTab("usage", $lng->txt("cont_usage") . " (" . ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]) . ")", $this->ctrl->getLinkTarget($this, "listUsages"));
         $tabs_gui->addNonTabbedLink("presentation_view", $this->lng->txt("glo_presentation_view"), ILIAS_HTTP_PATH . "/goto.php?target=" . "git" . "_" . $_GET["term_id"] . "_" . $_GET["ref_id"] . "&client_id=" . CLIENT_ID, "_top");
     }
     // back to glossary
     $tabs_gui->setBackTarget($this->lng->txt("glossary"), $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms"));
 }
 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&amp;ref_id=" . $_GET["ref_id"]);
             $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=fullscreen&amp;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&amp;cmd=downloadFile&amp;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;
     }
 }
示例#4
0
 /**
  * confirm term deletion
  */
 function confirmTermDeletion()
 {
     global $ilCtrl, $lng;
     //$this->prepareOutput();
     if (!isset($_POST["id"])) {
         ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
         $ilCtrl->redirect($this, "listTerms");
     }
     // check ids
     include_once "./Modules/Glossary/classes/class.ilGlossaryTerm.php";
     foreach ($_POST["id"] as $term_id) {
         $term_glo_id = ilGlossaryTerm::_lookGlossaryID((int) $term_id);
         if ($term_glo_id != $this->object->getId()) {
             ilUtil::sendFailure($this->lng->txt("glo_term_must_belong_to_glo"), true);
             $ilCtrl->redirect($this, "listTerms");
         }
     }
     // display confirmation message
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     $cgui = new ilConfirmationGUI();
     $cgui->setFormAction($this->ctrl->getFormAction($this));
     $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
     $cgui->setCancel($this->lng->txt("cancel"), "cancelTermDeletion");
     $cgui->setConfirm($this->lng->txt("confirm"), "deleteTerms");
     foreach ($_POST["id"] as $id) {
         $term = new ilGlossaryTerm($id);
         $add = "";
         $nr = ilGlossaryTerm::getNumberOfUsages($id);
         if ($nr > 0) {
             $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $id);
             $link = "[<a href='" . $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages") . "'>" . $lng->txt("glo_list_usages") . "</a>]";
             $add = "<div class='small'>" . sprintf($lng->txt("glo_term_is_used_n_times"), $nr) . " " . $link . "</div>";
         }
         $cgui->addItem("id[]", $id, $term->getTerm() . $add);
     }
     $this->tpl->setContent($cgui->getHTML());
 }
 /**
  * Fill table row
  */
 protected function fillRow($term)
 {
     global $lng, $ilCtrl;
     $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
     $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]);
     for ($j = 0; $j < count($defs); $j++) {
         $def = $defs[$j];
         if ($this->glossary->getId() == $term["glo_id"]) {
             // up
             if ($j > 0) {
                 $this->tpl->setCurrentBlock("move_up");
                 $this->tpl->setVariable("TXT_UP", $lng->txt("up"));
                 $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
                 $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
                 $this->tpl->setVariable("LINK_UP", $ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionUp"));
                 $this->tpl->parseCurrentBlock();
             }
             // down
             if ($j + 1 < count($defs)) {
                 $this->tpl->setCurrentBlock("move_down");
                 $this->tpl->setVariable("TXT_DOWN", $lng->txt("down"));
                 $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
                 $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
                 $this->tpl->setVariable("LINK_DOWN", $ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionDown"));
                 $this->tpl->parseCurrentBlock();
             }
             // delete
             $this->tpl->setCurrentBlock("delete");
             $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
             $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
             $this->tpl->setVariable("LINK_DELETE", $ilCtrl->getLinkTarget($this->parent_obj, "confirmDefinitionDeletion"));
             $this->tpl->setVariable("TXT_DELETE", $lng->txt("delete"));
             $this->tpl->parseCurrentBlock();
             // edit
             $this->tpl->setCurrentBlock("edit");
             $ilCtrl->setParameterByClass("ilpageobjectgui", "term_id", $term["id"]);
             $ilCtrl->setParameterByClass("ilpageobjectgui", "def", $def["id"]);
             $this->tpl->setVariable("LINK_EDIT", $ilCtrl->getLinkTargetByClass(array("ilglossarytermgui", "iltermdefinitioneditorgui", "ilpageobjectgui"), "edit"));
             $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
             $this->tpl->parseCurrentBlock();
         }
         // text
         $this->tpl->setCurrentBlock("definition");
         $short_str = $def["short_text"];
         // replace tex
         // if a tex end tag is missing a tex end tag
         $ltexs = strrpos($short_str, "[tex]");
         $ltexe = strrpos($short_str, "[/tex]");
         if ($ltexs > $ltexe) {
             $page =& new ilPageObject("gdf", $def["id"]);
             $page->buildDom();
             $short_str = $page->getFirstParagraphText();
             $short_str = strip_tags($short_str, "<br>");
             $ltexe = strpos($short_str, "[/tex]", $ltexs);
             $short_str = ilUtil::shortenText($short_str, $ltexe + 6, true);
         }
         $short_str = ilUtil::insertLatexImages($short_str);
         $short_str = ilPCParagraph::xml2output($short_str);
         $this->tpl->setVariable("DEF_SHORT", $short_str);
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("definition_row");
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("check_col");
     $this->tpl->setVariable("CHECKBOX_ID", $term["id"]);
     $this->tpl->parseCurrentBlock();
     // edit term link
     $this->tpl->setCurrentBlock("edit_term");
     $this->tpl->setVariable("TEXT_TERM", $term["term"]);
     $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
     if ($this->glossary->getId() == $term["glo_id"]) {
         $this->tpl->setVariable("LINK_EDIT_TERM", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
         $this->tpl->setVariable("TXT_EDIT_TERM", $lng->txt("edit"));
     }
     $this->tpl->parseCurrentBlock();
     // usage
     $nr_usage = ilGlossaryTerm::getNumberOfUsages($term["id"]);
     if ($nr_usage > 0 && $this->glossary->getId() == $term["glo_id"]) {
         $this->tpl->setCurrentBlock("link_usage");
         $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]);
         $this->tpl->setVariable("LUSAGE", ilGlossaryTerm::getNumberOfUsages($term["id"]));
         $this->tpl->setVariable("LINK_USAGE", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages"));
         $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", "");
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("usage");
         $this->tpl->setVariable("USAGE", ilGlossaryTerm::getNumberOfUsages($term["id"]));
         $this->tpl->parseCurrentBlock();
     }
     // glossary title
     if (in_array($this->glossary->getVirtualMode(), array("level", "subtree"))) {
         $this->tpl->setCurrentBlock("glossary");
         $this->tpl->setVariable("GLO_TITLE", ilObject::_lookupTitle($term["glo_id"]));
         $this->tpl->parseCurrentBlock();
     }
     // output term and language
     $this->tpl->setVariable("TEXT_LANGUAGE", $lng->txt("meta_l_" . $term["language"]));
 }
 /**
  * Fill table row
  */
 protected function fillRow($term)
 {
     global $lng, $ilCtrl;
     $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
     $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]);
     for ($j = 0; $j < count($defs); $j++) {
         $def = $defs[$j];
         if ($this->glossary->getId() == $term["glo_id"]) {
             // up
             if ($j > 0) {
                 $this->tpl->setCurrentBlock("move_up");
                 $this->tpl->setVariable("TXT_UP", $lng->txt("up"));
                 $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
                 $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
                 $this->tpl->setVariable("LINK_UP", $ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionUp"));
                 $this->tpl->parseCurrentBlock();
             }
             // down
             if ($j + 1 < count($defs)) {
                 $this->tpl->setCurrentBlock("move_down");
                 $this->tpl->setVariable("TXT_DOWN", $lng->txt("down"));
                 $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
                 $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
                 $this->tpl->setVariable("LINK_DOWN", $ilCtrl->getLinkTarget($this->parent_obj, "moveDefinitionDown"));
                 $this->tpl->parseCurrentBlock();
             }
             // delete
             $this->tpl->setCurrentBlock("delete");
             $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
             $ilCtrl->setParameter($this->parent_obj, "def", $def["id"]);
             $this->tpl->setVariable("LINK_DELETE", $ilCtrl->getLinkTarget($this->parent_obj, "confirmDefinitionDeletion"));
             $this->tpl->setVariable("TXT_DELETE", $lng->txt("delete"));
             $this->tpl->parseCurrentBlock();
             // edit
             $this->tpl->setCurrentBlock("edit");
             $ilCtrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term["id"]);
             $ilCtrl->setParameterByClass("ilglossarydefpagegui", "def", $def["id"]);
             $this->tpl->setVariable("LINK_EDIT", $ilCtrl->getLinkTargetByClass(array("ilglossarytermgui", "iltermdefinitioneditorgui", "ilglossarydefpagegui"), "edit"));
             $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
             $this->tpl->parseCurrentBlock();
         }
         // text
         $this->tpl->setCurrentBlock("definition");
         $short_str = $def["short_text"];
         // replace tex
         // if a tex end tag is missing a tex end tag
         $ltexs = strrpos($short_str, "[tex]");
         $ltexe = strrpos($short_str, "[/tex]");
         if ($ltexs > $ltexe) {
             $page = new ilGlossaryDefPage($def["id"]);
             $page->buildDom();
             $short_str = $page->getFirstParagraphText();
             $short_str = strip_tags($short_str, "<br>");
             $ltexe = strpos($short_str, "[/tex]", $ltexs);
             $short_str = ilUtil::shortenText($short_str, $ltexe + 6, true);
         }
         $short_str = ilUtil::insertLatexImages($short_str);
         $short_str = ilPCParagraph::xml2output($short_str);
         $this->tpl->setVariable("DEF_SHORT", $short_str);
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("definition_row");
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("check_col");
     $this->tpl->setVariable("CHECKBOX_ID", $term["id"]);
     $this->tpl->parseCurrentBlock();
     // edit term link
     $this->tpl->setCurrentBlock("edit_term");
     $this->tpl->setVariable("TEXT_TERM", $term["term"]);
     $ilCtrl->setParameter($this->parent_obj, "term_id", $term["id"]);
     if ($this->glossary->getId() == $term["glo_id"]) {
         $this->tpl->setVariable("LINK_EDIT_TERM", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
         $this->tpl->setVariable("TXT_EDIT_TERM", $lng->txt("edit"));
     }
     $this->tpl->parseCurrentBlock();
     // usage
     if (in_array("usage", $this->getSelectedColumns())) {
         $nr_usage = ilGlossaryTerm::getNumberOfUsages($term["id"]);
         if ($nr_usage > 0 && $this->glossary->getId() == $term["glo_id"]) {
             $this->tpl->setCurrentBlock("link_usage");
             $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $term["id"]);
             $this->tpl->setVariable("LUSAGE", ilGlossaryTerm::getNumberOfUsages($term["id"]));
             $this->tpl->setVariable("LINK_USAGE", $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages"));
             $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", "");
             $this->tpl->parseCurrentBlock();
         } else {
             $this->tpl->setCurrentBlock("usage");
             $this->tpl->setVariable("USAGE", ilGlossaryTerm::getNumberOfUsages($term["id"]));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("td_usage");
         $this->tpl->parseCurrentBlock();
     }
     // glossary title
     if (in_array($this->glossary->getVirtualMode(), array("level", "subtree"))) {
         $this->tpl->setCurrentBlock("glossary");
         $this->tpl->setVariable("GLO_TITLE", ilObject::_lookupTitle($term["glo_id"]));
         $this->tpl->parseCurrentBlock();
     }
     // output language
     if (in_array("language", $this->getSelectedColumns())) {
         $this->tpl->setCurrentBlock("td_lang");
         $this->tpl->setVariable("TEXT_LANGUAGE", $lng->txt("meta_l_" . $term["language"]));
         $this->tpl->parseCurrentBlock();
     }
     // adv metadata
     foreach ($this->getSelectedColumns() as $c) {
         if (substr($c, 0, 3) == "md_") {
             $id = (int) substr($c, 3);
             $this->tpl->setCurrentBlock("td_md");
             switch ($this->adv_fields[$id]["type"]) {
                 case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
                     $val = $term["md_" . $id] > 0 ? ilDatePresentation::formatDate(new ilDateTime($term["md_" . $id], IL_CAL_UNIX)) : " ";
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_DATE:
                     $val = $term["md_" . $id] > 0 ? ilDatePresentation::formatDate(new ilDate($term["md_" . $id], IL_CAL_UNIX)) : " ";
                     break;
                 default:
                     $val = $term["md_" . $id] != "" ? $term["md_" . $id] : " ";
                     breal;
             }
             $this->tpl->setVariable("MD_VAL", $val);
             $this->tpl->parseCurrentBlock();
         }
     }
 }