/** * Print View * * @param * @return */ function printView() { global $ilAccess, $tpl; if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) { return; } $terms = array(); switch ($_POST["sel_type"]) { case "glossary": $ts = $this->glossary->getTermList(); foreach ($ts as $t) { $terms[] = $t["id"]; } break; case "sel_topic": include_once "./Services/Taxonomy/classes/class.ilObjTaxonomy.php"; $t_id = $this->glossary->getTaxonomyId(); $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $_POST["topic"]); foreach ($items as $i) { if ($i["item_type"] == "term") { $terms[] = $i["item_id"]; } } break; case "selection": if (is_array($_POST["obj_id"])) { $terms = $_POST["obj_id"]; } else { $terms = array(); } break; case "term": $terms = array($this->term_id); break; } $tpl = new ilTemplate("tpl.main.html", true, true); $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle()); /* // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); // content style $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())); $this->tpl->parseCurrentBlock();*/ include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery($tpl); // determine target frames for internal links foreach ($terms as $t_id) { $page_content .= $this->listDefinitions($_GET["ref_id"], $t_id, true); } $tpl->setVariable("CONTENT", $page_content . '<script type="text/javascript" language="javascript1.2"> <!-- il.Util.addOnLoad(function () { il.Util.print(); }); //--> </script>'); $tpl->show(false); exit; }
/** * Get all terms for given set of glossary ids. * * @param integer/array array of glossary ids for meta glossaries * @param string searchstring * @param string first letter * @return array array of terms */ static function getFirstLetters($a_glo_id, $a_tax_node = 0) { global $ilDB; $terms = array(); // meta glossary if (is_array($a_glo_id)) { $where = $ilDB->in("glo_id", $a_glo_id, false, "integer"); } else { $where = " glo_id = " . $ilDB->quote($a_glo_id, "integer") . " "; // get all term ids under taxonomy node (if given) if ($a_tax_node > 1) { include_once "./Services/Taxonomy/classes/class.ilObjTaxonomy.php"; $tax_ids = ilObjTaxonomy::getUsageOfObject($a_glo_id); if (count($tax_ids) > 0) { $items = ilObjTaxonomy::getSubTreeItems("glo", $a_glo_id, "term", $tax_ids[0], $a_tax_node); $sub_tree_ids = array(); foreach ($items as $i) { $sub_tree_ids[] = $i["item_id"]; } $in = " AND " . $ilDB->in("id", $sub_tree_ids, false, "integer"); } } $where .= $in; } $q = "SELECT DISTINCT " . $ilDB->upper($ilDB->substr("term", 1, 1)) . " let FROM glossary_term WHERE " . $where . " ORDER BY let"; $let_set = $ilDB->query($q); $lets = array(); while ($let_rec = $ilDB->fetchAssoc($let_set)) { $let[$let_rec["let"]] = $let_rec["let"]; } return $let; }