ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilGlossaryPresentationGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once("./Services/Object/classes/class.ilObjectGUI.php");
6require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
7require_once("./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
8require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
9require_once("./Modules/Glossary/classes/class.ilTermDefinitionEditorGUI.php");
10require_once("./Services/COPage/classes/class.ilPCParagraph.php");
11
25{
29 protected $ctrl;
30
34 protected $tabs_gui;
35
39 protected $access;
40
44 protected $error;
45
49 protected $nav_history;
50
54 protected $toolbar;
55
59 protected $user;
60
64 protected $help;
65
67 public $glossary;
68 public $tpl;
69 public $lng;
70
75 public function __construct()
76 {
77 global $DIC;
78
79 $this->access = $DIC->access();
80 $this->error = $DIC["ilErr"];
81 $this->nav_history = $DIC["ilNavigationHistory"];
82 $this->toolbar = $DIC->toolbar();
83 $this->user = $DIC->user();
84 $this->help = $DIC["ilHelp"];
85 $lng = $DIC->language();
86 $tpl = $DIC["tpl"];
87 $ilCtrl = $DIC->ctrl();
88 $ilTabs = $DIC->tabs();
89
90 $this->tabs_gui = $ilTabs;
91 $this->tpl = $tpl;
92 $this->lng = $lng;
93 $this->ctrl = $ilCtrl;
94 $this->offline = false;
95 $this->ctrl->saveParameter($this, array("ref_id", "letter", "tax_node"));
96
97 // Todo: check lm id
98 include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
99 $this->glossary_gui = new ilObjGlossaryGUI("", $_GET["ref_id"], true, "");
100 $this->glossary = $this->glossary_gui->object;
101
102 // determine term id and check whether it is valid (belongs to
103 // current glossary or a virtual (online) sub-glossary)
104 $this->term_id = (int) $_GET["term_id"];
105 $glo_ids = $this->glossary->getAllGlossaryIds();
106 if (!is_array($glo_ids)) {
107 $glo_ids = array($glo_ids);
108 }
109 $term_glo_id = ilGlossaryTerm::_lookGlossaryID($this->term_id);
110 include_once("./Modules/Glossary/classes/class.ilGlossaryTermReferences.php");
111 if (!in_array($term_glo_id, $glo_ids) && !ilGlossaryTermReferences::isReferenced($glo_ids, $this->term_id)) {
112 if ((int) $this->term_id > 0) {
113 include_once("./Modules/Glossary/exceptions/class.ilGlossaryException.php");
114 throw new ilGlossaryException("Term ID does not match the glossary.");
115 }
116 $this->term_id = "";
117 }
118
119 $this->tax_node = 0;
120 $this->tax_id = $this->glossary->getTaxonomyId();
121 if ($this->tax_id > 0 && $this->glossary->getShowTaxonomy()) {
122 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
123 $this->tax = new ilObjTaxonomy($this->tax_id);
124 }
125 if ((int) $_GET["tax_node"] > 1 && $this->tax->getTree()->readRootId() != $_GET["tax_node"]) {
126 $this->tax_node = (int) $_GET["tax_node"];
127 }
128 }
129
130
134 public function setOfflineMode($a_offline = true)
135 {
136 $this->offline = $a_offline;
137 }
138
142 public function offlineMode()
143 {
144 return $this->offline;
145 }
146
150 public function setOfflineDirectory($a_dir)
151 {
152 $this->offline_dir = $a_dir;
153 }
154
155
159 public function getOfflineDirectory()
160 {
161 return $this->offline_dir;
162 }
163
164
168 public function executeCommand()
169 {
171 $ilAccess = $this->access;
173
174 $lng->loadLanguageModule("content");
175
176 $next_class = $this->ctrl->getNextClass($this);
177 $cmd = $this->ctrl->getCmd("listTerms");
178
179 // check write permission
180 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) &&
181 !($ilAccess->checkAccess("visible", "", $_GET["ref_id"]) &&
182 ($cmd == "infoScreen" || strtolower($next_class) == "ilinfoscreengui"))) {
183 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
184 }
185
186 if ($cmd != "listDefinitions") {
187 $this->prepareOutput();
188 }
189
190 switch ($next_class) {
191 case "ilnotegui":
192 $this->setTabs();
193 $ret = $this->listDefinitions();
194 break;
195
196 case "ilinfoscreengui":
197 $ret = $this->outputInfoScreen();
198 break;
199
200 case "ilpresentationlisttablegui":
201 $prtab = $this->getPresentationTable();
202 $this->ctrl->forwardCommand($prtab);
203 return;
204 break;
205
206 default:
207 $ret = $this->$cmd();
208 break;
209 }
210 $this->tpl->show();
211 }
212
213 public function prepareOutput()
214 {
215 $this->tpl->getStandardTemplate();
216 $title = $this->glossary->getTitle();
217
218 $this->tpl->setTitle($title);
219 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
220
221 $this->setLocator();
222 }
223
224
228 public function listTerms()
229 {
230 $ilNavigationHistory = $this->nav_history;
231 $ilAccess = $this->access;
233 $ilToolbar = $this->toolbar;
235 $ilTabs = $this->tabs_gui;
237
238
239 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
240 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
241 }
242
243 if (!$this->offlineMode()) {
244 $ilNavigationHistory->addItem(
245 $_GET["ref_id"],
246 $this->ctrl->getLinkTarget($this, "listTerms"),
247 "glo"
248 );
249
250 // alphabetical navigation
251 include_once("./Services/Form/classes/class.ilAlphabetInputGUI.php");
252 $ai = new ilAlphabetInputGUI($lng->txt("glo_quick_navigation"), "first");
253
254 $ai->setFixDBUmlauts(true);
255
256 $first_letters = $this->glossary->getFirstLetters($this->tax_node);
257 if (!is_array($first_letters)) {
258 $first_letters = [];
259 }
260 if (!in_array($_GET["letter"], $first_letters)) {
261 $first_letters[] = ilUtil::stripSlashes($_GET["letter"]);
262 }
263 $ai->setLetters($first_letters);
264
265 $ai->setParentCommand($this, "chooseLetter");
266 $ai->setHighlighted($_GET["letter"]);
267 $ilToolbar->addInputItem($ai, true);
268 }
269
270 $ret = $this->listTermByGiven();
271 $ilCtrl->setParameter($this, "term_id", "");
272
273 $ilTabs->activateTab("terms");
274
275 // show taxonomy
276 $this->showTaxonomy();
277
278 return $ret;
279 }
280
284 public function listTermByGiven()
285 {
287 $ilAccess = $this->access;
290
291 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
292 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
293 }
294
295 $this->lng->loadLanguageModule("meta");
296
297 $this->setTabs();
298
299 // load template for table
300 // $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
301
302 $oldoffset = (is_numeric($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
303
304 if ($this->glossary->getPresentationMode() == "full_def") {
305 // content style
306 $this->tpl->setCurrentBlock("ContentStyle");
307 if (!$this->offlineMode()) {
308 $this->tpl->setVariable(
309 "LOCATION_CONTENT_STYLESHEET",
310 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())
311 );
312 } else {
313 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content.css");
314 }
315 $this->tpl->parseCurrentBlock();
316
317 // syntax style
318 $this->tpl->setCurrentBlock("SyntaxStyle");
319 if (!$this->offlineMode()) {
320 $this->tpl->setVariable(
321 "LOCATION_SYNTAX_STYLESHEET",
323 );
324 } else {
325 $this->tpl->setVariable(
326 "LOCATION_SYNTAX_STYLESHEET",
327 "syntaxhighlight.css"
328 );
329 }
330 $this->tpl->parseCurrentBlock();
331 }
332
333 $table = $this->getPresentationTable();
334
335 if (!$this->offlineMode()) {
336 // $tpl->setContent($table->getHTML());
337 $tpl->setContent($ilCtrl->getHTML($table));
338 } else {
339 $this->tpl->setVariable("ADM_CONTENT", $table->getHTML());
340 return $this->tpl->get();
341 }
342 }
343
350 public function getPresentationTable()
351 {
352 include_once("./Modules/Glossary/classes/class.ilPresentationListTableGUI.php");
354 $this,
355 "listTerms",
356 $this->glossary,
357 $this->offlineMode(),
358 $this->tax_node,
359 $this->glossary->getTaxonomyId()
360 );
361 return $table;
362 }
363
367 public function applyFilter()
368 {
369 $ilTabs = $this->tabs_gui;
370
371 $prtab = $this->getPresentationTable();
372 $prtab->resetOffset();
373 $prtab->writeFilterToSession();
374 $this->listTerms();
375 }
376
381 public function resetFilter()
382 {
383 $prtab = $this->getPresentationTable();
384 $prtab->resetOffset();
385 $prtab->resetFilter();
386 $this->listTerms();
387 }
388
392 public function listDefinitions($a_ref_id = 0, $a_term_id = 0, $a_get_html = false, $a_page_mode = IL_PAGE_PRESENTATION)
393 {
395 $ilAccess = $this->access;
398
399 if ($a_ref_id == 0) {
400 $ref_id = (int) $_GET["ref_id"];
401 } else {
402 $ref_id = $a_ref_id;
403 }
404 if ($a_term_id == 0) {
405 $term_id = $this->term_id;
406 } else {
407 $term_id = $a_term_id;
408 }
409
410 if (!$ilAccess->checkAccess("read", "", $ref_id)) {
411 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
412 }
413
414 // tabs
415 if ($this->glossary->getPresentationMode() != "full_def") {
416 $this->showDefinitionTabs("term_content");
417 }
418
419 $term = new ilGlossaryTerm($term_id);
420
421 if (!$a_get_html) {
423
424 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
425 $tpl->getStandardTemplate();
426 // $this->setTabs();
427
428 if ($this->offlineMode()) {
429 $style_name = $ilUser->prefs["style"] . ".css";
430 ;
431 $tpl->setVariable("LOCATION_STYLESHEET", "./" . $style_name);
432 } else {
433 $this->setLocator();
434 }
435
436 // content style
437 $tpl->setCurrentBlock("ContentStyle");
438 if (!$this->offlineMode()) {
439 $tpl->setVariable(
440 "LOCATION_CONTENT_STYLESHEET",
441 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())
442 );
443 } else {
444 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content.css");
445 }
446 $tpl->parseCurrentBlock();
447
448 // syntax style
449 $tpl->setCurrentBlock("SyntaxStyle");
450 if (!$this->offlineMode()) {
451 $tpl->setVariable(
452 "LOCATION_SYNTAX_STYLESHEET",
454 );
455 } else {
456 $tpl->setVariable(
457 "LOCATION_SYNTAX_STYLESHEET",
458 "syntaxhighlight.css"
459 );
460 }
461 $tpl->parseCurrentBlock();
462
463 $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
464 $tpl->setTitle($this->lng->txt("cont_term") . ": " . $term->getTerm());
465
466 // advmd block
467 $cmd = null;
468 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
469 $cmd = array("edit" => $this->ctrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui", "ilobjectmetadatagui"), ""));
470 }
471 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
472 $mdgui = new ilObjectMetaDataGUI($this->glossary, "term", $term->getId());
473 $tpl->setRightContent($mdgui->getBlockHTML($cmd));
474
475 // load template for table
476 $tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", "Modules/Glossary");
477 } else {
478 $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
479 }
480
482 $tpl->setVariable("TXT_TERM", $term->getTerm());
483 $this->mobs = array();
484
485 // toc
486 if (count($defs) > 1 && $a_page_mode == IL_PAGE_PRESENTATION) {
487 $tpl->setCurrentBlock("toc");
488 for ($j = 1; $j <= count($defs); $j++) {
489 $tpl->setCurrentBlock("toc_item");
490 $tpl->setVariable("TOC_DEF_NR", $j);
491 $tpl->setVariable("TOC_DEF", $lng->txt("cont_definition"));
492 $tpl->parseCurrentBlock();
493 }
494 $tpl->setCurrentBlock("toc");
495 $tpl->parseCurrentBlock();
496 }
497
498 for ($j = 0; $j < count($defs); $j++) {
499 $def = $defs[$j];
500 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
501 $page_gui->setGlossary($this->glossary);
502 $page_gui->setOutputMode($a_page_mode);
503 $page_gui->setStyleId($this->glossary->getStyleSheetId());
504 $page = $page_gui->getPageObject();
505
506 // internal links
507 $page->buildDom();
508 $int_links = $page->getInternalLinks();
509 $link_xml = $this->getLinkXML($int_links);
510 $page_gui->setLinkXML($link_xml);
511
512 if ($this->offlineMode()) {
513 $page_gui->setOutputMode("offline");
514 $page_gui->setOfflineDirectory($this->getOfflineDirectory());
515 }
516 $page_gui->setSourcecodeDownloadScript($this->getLink($ref_id));
517 $page_gui->setFullscreenLink($this->getLink($ref_id, "fullscreen", $term_id, $def["id"]));
518
519 $page_gui->setTemplateOutput(false);
520 $page_gui->setRawPageContent(true);
521 $page_gui->setFileDownloadLink($this->getLink($ref_id, "downloadFile"));
522 if (!$this->offlineMode()) {
523 $output = $page_gui->showPage();
524 } else {
525 $output = $page_gui->presentation($page_gui->getOutputMode());
526 }
527
528 if (count($defs) > 1) {
529 $tpl->setCurrentBlock("definition_header");
530 $tpl->setVariable(
531 "TXT_DEFINITION",
532 $this->lng->txt("cont_definition") . " " . ($j + 1)
533 );
534 $tpl->setVariable("DEF_NR", ($j + 1));
535 $tpl->parseCurrentBlock();
536 }
537
538 $tpl->setCurrentBlock("definition");
539 $tpl->setVariable("PAGE_CONTENT", $output);
540 $tpl->parseCurrentBlock();
541 }
542
543 // display possible backlinks
544 $sources = ilInternalLink::_getSourcesOfTarget('git', $_GET['term_id'], 0);
545
546 if ($sources) {
547 $backlist_shown = false;
548 foreach ($sources as $src) {
549 $type = explode(':', $src['type']);
550
551 if ($type[0] == 'lm') {
552 if ($type[1] == 'pg') {
554 $lm_id = ilLMObject::_lookupContObjID($src['id']);
555 $lm_title = ilObject::_lookupTitle($lm_id);
556 $tpl->setCurrentBlock('backlink_item');
557 $ref_ids = ilObject::_getAllReferences($lm_id);
558 $access = false;
559 foreach ($ref_ids as $rid) {
560 if ($ilAccess->checkAccess("read", "", $rid)) {
561 $access = true;
562 }
563 }
564 if ($access) {
565 $tpl->setCurrentBlock("backlink_item");
566 $tpl->setVariable("BACKLINK_LINK", ILIAS_HTTP_PATH . "/goto.php?target=" . $type[1] . "_" . $src['id']);
567 $tpl->setVariable("BACKLINK_ITEM", $lm_title . ": " . $title);
568 $tpl->parseCurrentBlock();
569 $backlist_shown = true;
570 }
571 }
572 }
573 }
574 if ($backlist_shown) {
575 $tpl->setCurrentBlock("backlink_list");
576 $tpl->setVariable("BACKLINK_TITLE", $this->lng->txt('glo_term_used_in'));
577 $tpl->parseCurrentBlock();
578 }
579 }
580
581 if (!$a_get_html) {
582 $tpl->setCurrentBlock("perma_link");
583 $tpl->setVariable("PERMA_LINK", ILIAS_HTTP_PATH .
584 "/goto.php?target=" .
585 "git" .
586 "_" . $term_id . "_" . $ref_id . "&client_id=" . CLIENT_ID);
587 $tpl->setVariable("TXT_PERMA_LINK", $this->lng->txt("perma_link"));
588 $tpl->setVariable("PERMA_TARGET", "_top");
589 $tpl->parseCurrentBlock();
590
591 // show taxonomy
592 $this->showTaxonomy();
593 }
594
595 // highlighting?
596 if ($_GET["srcstring"] != "" && !$this->offlineMode()) {
597 include_once './Services/Search/classes/class.ilUserSearchCache.php';
598 $cache = ilUserSearchCache::_getInstance($ilUser->getId());
599 $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
600 $search_string = $cache->getQuery();
601
602 include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
603 include_once("./Services/Search/classes/class.ilQueryParser.php");
604 $p = new ilQueryParser($search_string);
605 $p->parse();
606
607 $words = $p->getQuotedWords();
608 if (is_array($words)) {
609 foreach ($words as $w) {
610 ilTextHighlighterGUI::highlight("ilGloContent", $w, $tpl);
611 }
612 }
613 $this->fill_on_load_code = true;
614 }
615
616 if ($this->offlineMode() || $a_get_html) {
617 return $tpl->get();
618 }
619 }
620
627 public function showDefinitionTabs($a_act)
628 {
629 $ilTabs = $this->tabs_gui;
632 $ilHelp = $this->help;
633
634 if (!$this->offlineMode()) {
635 $ilHelp->setScreenIdComponent("glo");
636
637 $ilCtrl->setParameter($this, "term_id", "");
638 $this->ctrl->setParameter($this, "offset", $_GET["offset"]);
639 if (!empty($_REQUEST["term"])) {
640 $this->ctrl->setParameter($this, "term", $_REQUEST["term"]);
641 $this->ctrl->setParameter($this, "oldoffset", $_GET["oldoffset"]);
642 $back = $ilCtrl->getLinkTarget($this, "searchTerms");
643 } else {
644 $back = $ilCtrl->getLinkTarget($this, "listTerms");
645 }
646 $ilCtrl->setParameter($this, "term_id", $this->term_id);
647 $ilCtrl->saveParameter($this, "term_id");
648
649 $ilTabs->setBackTarget($this->lng->txt("obj_glo"), $back);
650
651 $ilTabs->addTab(
652 "term_content",
653 $lng->txt("content"),
654 $ilCtrl->getLinkTarget($this, "listDefinitions")
655 );
656
657 $ilTabs->addTab(
658 "print_view",
659 $lng->txt("print_view"),
660 $ilCtrl->getLinkTarget($this, "printViewSelection")
661 );
662
663 $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $this->term_id);
664 include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
665 if (ilGlossaryTerm::_lookGlossaryID($this->term_id) == $this->glossary->getId()) {
666 $ilTabs->addNonTabbedLink(
667 "editing_view",
668 $lng->txt("glo_editing_view"),
669 $ilCtrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui"), "listDefinitions")
670 );
671 //"ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".$_GET["ref_id"]."&amp;edit_term=".$this->term_id);
672 }
673 $ilTabs->activateTab($a_act);
674 }
675 }
676
677
681 public function fullscreen()
682 {
683 $html = $this->media("fullscreen");
684 return $html;
685 }
686
690 public function media($a_mode = "media")
691 {
692 $this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
693 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
694 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
695 $this->tpl->setVariable(
696 "LOCATION_CONTENT_STYLESHEET",
697 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())
698 );
699
700 //$int_links = $page_object->getInternalLinks();
701 $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
702
703 // later
704 //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
705
706 $link_xlm = "";
707
708 require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
709 $media_obj = new ilObjMediaObject($_GET["mob_id"]);
710
711 $xml = "<dummy>";
712 // todo: we get always the first alias now (problem if mob is used multiple
713 // times in page)
714 $xml .= $media_obj->getXML(IL_MODE_ALIAS);
715 $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
716 $xml .= $link_xml;
717 $xml .= "</dummy>";
718
719 $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
720 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
721 $xh = xslt_create();
722
723 if (!$this->offlineMode()) {
724 $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
725 $wb_path = ilUtil::getWebspaceDir("output") . "/";
726 } else {
727 $enlarge_path = "images/enlarge.svg";
728 $wb_path = "";
729 }
730
731 $mode = $a_mode;
732
733 $this->ctrl->setParameter($this, "obj_type", "MediaObject");
734 $fullscreen_link =
735 $this->getLink($_GET["ref_id"], "fullscreen");
736 $this->ctrl->clearParameters($this);
737
738 $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
739 'link_params' => "ref_id=" . $_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
740 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
741 $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
742 echo xslt_error($xh);
743 xslt_free($xh);
744
745 // unmask user html
746 $this->tpl->setVariable("MEDIA_CONTENT", $output);
747
748 $this->tpl->parseCurrentBlock();
749 if ($this->offlineMode()) {
750 $html = $this->tpl->get();
751 return $html;
752 }
753 }
754
758 public function showDownloadList()
759 {
760 $ilAccess = $this->access;
762 $ilTabs = $this->tabs_gui;
763
764 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
765 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
766 }
767
768 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.glo_download_list.html", "Modules/Glossary");
769
770 $this->setTabs();
771 $ilTabs->activateTab("download");
772
773 // set title header
774 $this->tpl->setTitle($this->glossary->getTitle());
775 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
776
777 // create table
778 require_once("./Services/Table/classes/class.ilTableGUI.php");
779 $tbl = new ilTableGUI();
780
781 // load files templates
782 $this->tpl->addBlockfile("DOWNLOAD_TABLE", "download_table", "tpl.table.html");
783
784 // load template for table content data
785 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/Glossary");
786
787 $export_files = array();
788 $types = array("xml", "html");
789 foreach ($types as $type) {
790 if ($this->glossary->getPublicExportFile($type) != "") {
791 $dir = $this->glossary->getExportDirectory($type);
792 if (is_file($this->glossary->getExportDirectory($type) . "/" .
793 $this->glossary->getPublicExportFile($type))) {
794 $size = filesize($this->glossary->getExportDirectory($type) . "/" .
795 $this->glossary->getPublicExportFile($type));
796 $export_files[] = array("type" => $type,
797 "file" => $this->glossary->getPublicExportFile($type),
798 "size" => $size);
799 }
800 }
801 }
802
803 $num = 0;
804
805 $tbl->setTitle($this->lng->txt("download"));
806
807 $tbl->setHeaderNames(array($this->lng->txt("cont_format"),
808 $this->lng->txt("cont_file"),
809 $this->lng->txt("size"), $this->lng->txt("date"),
810 ""));
811
812 $cols = array("format", "file", "size", "date", "download");
813 $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"],
814 "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this)));
815 $tbl->setHeaderVars($cols, $header_params);
816 $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
817 $tbl->disable("sort");
818
819 // control
820 $tbl->setOrderColumn($_GET["sort_by"]);
821 $tbl->setOrderDirection($_GET["sort_order"]);
822 $tbl->setLimit($_GET["limit"]);
823 $tbl->setOffset($_GET["offset"]);
824 $tbl->setMaxCount($this->maxcount); // ???
825
826 // $this->tpl->setVariable("COLUMN_COUNTS", 5);
827
828 // footer
829 //$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
830 $tbl->disable("footer");
831
832 $tbl->setMaxCount(count($export_files));
833 $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
834
835 $tbl->render();
836 if (count($export_files) > 0) {
837 $i = 0;
838 foreach ($export_files as $exp_file) {
839 $this->tpl->setCurrentBlock("tbl_content");
840 $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
841
842 $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
843 $this->tpl->setVariable("CSS_ROW", $css_row);
844
845 $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
846 $this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"]));
847 $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"] . ":" . $exp_file["file"]);
848
849 $file_arr = explode("__", $exp_file["file"]);
850 $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s", $file_arr[0]));
851
852 $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
853 $this->ctrl->setParameter($this, "type", $exp_file["type"]);
854 $this->tpl->setVariable(
855 "LINK_DOWNLOAD",
856 $this->ctrl->getLinkTarget($this, "downloadExportFile")
857 );
858
859 $this->tpl->parseCurrentBlock();
860 }
861 } //if is_array
862 else {
863 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
864 $this->tpl->setVariable("NUM_COLS", 5);
865 $this->tpl->parseCurrentBlock();
866 }
867
868 //$this->tpl->show();
869 }
870
874 public function downloadExportFile()
875 {
876 $ilAccess = $this->access;
879
880 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
881 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->error_obj->MESSAGE);
882 }
883
884 $file = $this->glossary->getPublicExportFile($_GET["type"]);
885 if ($this->glossary->getPublicExportFile($_GET["type"]) != "") {
886 $dir = $this->glossary->getExportDirectory($_GET["type"]);
887 if (is_file($dir . "/" . $file)) {
888 ilUtil::deliverFile($dir . "/" . $file, $file);
889 exit;
890 }
891 }
892 $ilErr->raiseError($this->lng->txt("file_not_found"), $ilErr->MESSAGE);
893 }
894
902 public function setLocator($a_tree = "", $a_id = "")
903 {
904 //$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
905 require_once("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
906 $gloss_loc = new ilGlossaryLocatorGUI();
907 $gloss_loc->setMode("presentation");
908 if (!empty($this->term_id)) {
909 $term = new ilGlossaryTerm($this->term_id);
910 $gloss_loc->setTerm($term);
911 }
912 $gloss_loc->setGlossary($this->glossary);
913 //$gloss_loc->setDefinition($this->definition);
914 $gloss_loc->display();
915 }
916
920 public function downloadFile()
921 {
922 $ilAccess = $this->access;
925
926 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
927 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
928 }
929
930 $file = explode("_", $_GET["file_id"]);
931 include_once("./Modules/File/classes/class.ilObjFile.php");
932 $fileObj = new ilObjFile($file[count($file) - 1], false);
933 $fileObj->sendFile();
934 exit;
935 }
936
940 public function setTabs()
941 {
942 $this->getTabs();
943 }
944
948 public function getLinkXML($a_int_links)
949 {
950 if ($a_layoutframes == "") {
951 $a_layoutframes = array();
952 }
953 $link_info = "<IntLinkInfos>";
954 foreach ($a_int_links as $int_link) {
955 //echo "<br>+".$int_link["Type"]."+".$int_link["TargetFrame"]."+".$int_link["Target"]."+";
956 $target = $int_link["Target"];
957 if (substr($target, 0, 4) == "il__") {
958 $target_arr = explode("_", $target);
959 $target_id = $target_arr[count($target_arr) - 1];
960 $type = $int_link["Type"];
961 $targetframe = ($int_link["TargetFrame"] != "")
962 ? $int_link["TargetFrame"]
963 : "None";
964
965 // anchor
966 $anc = $anc_add = "";
967 if ($int_link["Anchor"] != "") {
968 $anc = $int_link["Anchor"];
969 $anc_add = "_" . rawurlencode($int_link["Anchor"]);
970 }
971
972 if ($targetframe == "New") {
973 $ltarget = "_blank";
974 } else {
975 $ltarget = "";
976 }
977 $lcontent = "";
978 switch ($type) {
979 case "PageObject":
980 case "StructureObject":
982 $cont_obj = $this->content_object;
983 if ($type == "PageObject") {
984 $href = "./goto.php?target=pg_" . $target_id . $anc_add;
985 } else {
986 $href = "./goto.php?target=st_" . $target_id;
987 }
988 //$ltarget = "ilContObj".$lm_id;
989 break;
990
991 case "GlossaryItem":
992 if (ilGlossaryTerm::_lookGlossaryID($target_id) == $this->glossary->getId()) {
993 if ($this->offlineMode()) {
994 $href = "term_" . $target_id . ".html";
995 } else {
996 $this->ctrl->setParameter($this, "term_id", $target_id);
997 $href = $this->ctrl->getLinkTarget($this, "listDefinitions");
998 $href = str_replace("&", "&amp;", $href);
999 }
1000 } else {
1001 $href = "./goto.php?target=git_" . $target_id;
1002 }
1003 break;
1004
1005 case "MediaObject":
1006 if ($this->offlineMode()) {
1007 $href = "media_" . $target_id . ".html";
1008 } else {
1009 $this->ctrl->setParameter($this, "obj_type", $type);
1010 $this->ctrl->setParameter($this, "mob_id", $target_id);
1011 $href = $this->ctrl->getLinkTarget($this, "media");
1012 $href = str_replace("&", "&amp;", $href);
1013 }
1014 break;
1015
1016 case "RepositoryItem":
1017 $obj_type = ilObject::_lookupType($target_id, true);
1019 $href = "./goto.php?target=" . $obj_type . "_" . $target_id;
1020 $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
1021 $ltarget = $t_frame;
1022 break;
1023
1024 case "WikiPage":
1025 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1027 break;
1028
1029 case "User":
1030 $obj_type = ilObject::_lookupType($target_id);
1031 if ($obj_type == "usr") {
1032 include_once("./Services/User/classes/class.ilUserUtil.php");
1033 $back = $this->ctrl->getLinkTarget($this, "listDefinitions");
1034 //var_dump($back); exit;
1035 $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", $target_id);
1036 $this->ctrl->setParameterByClass(
1037 "ilpublicuserprofilegui",
1038 "back_url",
1039 rawurlencode($back)
1040 );
1041 $href = "";
1042 include_once("./Services/User/classes/class.ilUserUtil.php");
1044 $href = $this->ctrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML");
1045 }
1046 $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", "");
1047 $lcontent = ilUserUtil::getNamePresentation($target_id, false, false);
1048 }
1049 break;
1050
1051 }
1052
1053 $anc_par = 'Anchor="' . $anc . '"';
1054
1055 $link_info .= "<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
1056 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
1057
1058 $this->ctrl->clearParameters($this);
1059 }
1060 }
1061 $link_info .= "</IntLinkInfos>";
1062
1063 return $link_info;
1064 }
1065
1066
1070 public function getLink(
1071 $a_ref_id,
1072 $a_cmd = "",
1073 $a_term_id = "",
1074 $a_def_id = "",
1075 $a_frame = "",
1076 $a_type = ""
1077 ) {
1078 if ($a_cmd == "") {
1079 $a_cmd = "layout";
1080 }
1081 //$script = "glossary_presentation.php";
1082
1083 // handle online links
1084 if (!$this->offlineMode()) {
1085 //$link = $script."?ref_id=".$a_ref_id;
1086 switch ($a_cmd) {
1087 case "fullscreen":
1088 $this->ctrl->setParameter($this, "def_id", $a_def_id);
1089 $link = $this->ctrl->getLinkTarget($this, "fullscreen");
1090 break;
1091
1092 default:
1093 $link .= "&amp;cmd=" . $a_cmd;
1094 if ($a_frame != "") {
1095 $this->ctrl->setParameter($this, "frame", $a_frame);
1096 }
1097 if ($a_obj_id != "") {
1098 switch ($a_type) {
1099 case "MediaObject":
1100 $this->ctrl->setParameter($this, "mob_id", $a_obj_id);
1101 break;
1102
1103 default:
1104 $this->ctrl->setParameter($this, "def_id", $a_def_id);
1105 break;
1106 }
1107 }
1108 if ($a_type != "") {
1109 $this->ctrl->setParameter($this, "obj_type", $a_type);
1110 }
1111 $link = $this->ctrl->getLinkTarget($this, $a_cmd);
1112// $link = str_replace("&", "&amp;", $link);
1113 break;
1114 }
1115 } else { // handle offline links
1116 switch ($a_cmd) {
1117 case "downloadFile":
1118 break;
1119
1120 case "fullscreen":
1121 $link = "fullscreen.html"; // id is handled by xslt
1122 break;
1123
1124 case "layout":
1125 break;
1126
1127 case "glossary":
1128 $link = "term_" . $a_obj_id . ".html";
1129 break;
1130
1131 case "media":
1132 $link = "media_" . $a_obj_id . ".html";
1133 break;
1134
1135 default:
1136 break;
1137 }
1138 }
1139 $this->ctrl->clearParameters($this);
1140 return $link;
1141 }
1142
1149 public function printViewSelection()
1150 {
1152 $lng = $this->lng;
1153 $ilToolbar = $this->toolbar;
1155 $tpl = $this->tpl;
1156 $ilTabs = $this->tabs_gui;
1157
1158 $ilCtrl->saveParameter($this, "term_id");
1159
1160 if ((int) $this->term_id == 0) {
1161 $this->setTabs();
1162 $ilTabs->activateTab("print_view");
1163 } else {
1164 $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
1165 $term = new ilGlossaryTerm((int) $this->term_id);
1166 $tpl->setTitle($this->lng->txt("cont_term") . ": " . $term->getTerm());
1167 $this->showDefinitionTabs("print_view");
1168 }
1169
1171
1172 $tpl->setContent($this->form->getHTML());
1173 }
1174
1179 {
1180 $lng = $this->lng;
1182
1183 $terms = $this->glossary->getTermList();
1184
1185 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1186 $this->form = new ilPropertyFormGUI();
1187 $this->form->setTarget("print_view");
1188 $this->form->setFormAction($ilCtrl->getFormAction($this));
1189
1190 // selection type
1191 $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1192 $radg->setValue("glossary");
1193
1194 // current term
1195 if ((int) $this->term_id > 0) {
1196 $op1 = new ilRadioOption($lng->txt("cont_current_term"), "term");
1197 $radg->addOption($op1);
1198 $radg->setValue("term");
1199 }
1200
1201 // whole glossary
1202 $op2 = new ilRadioOption($lng->txt("cont_whole_glossary")
1203 . " (" . $lng->txt("cont_terms") . ": " . count($terms) . ")", "glossary");
1204 $radg->addOption($op2);
1205
1206 // selected topic
1207 if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
1208 $op4 = new ilRadioOption($lng->txt("cont_selected_topic"), "sel_topic");
1209 $radg->addOption($op4);
1210
1211 // topic drop down
1212 include_once("./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php");
1214 $t_id,
1215 false,
1216 $lng->txt("cont_topic"),
1217 "topic",
1218 false
1219 );
1220 if ($this->tax_node > 0) {
1221 $si->setValue((int) $this->tax_node);
1222 }
1223 $op4->addSubItem($si);
1224 }
1225
1226 // selected terms
1227 $op3 = new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
1228 $radg->addOption($op3);
1229
1230 include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
1231 $nl = new ilNestedListInputGUI("", "obj_id");
1232 $op3->addSubItem($nl);
1233 //var_dump($terms);
1234 foreach ($terms as $t) {
1235 $nl->addListNode($t["id"], $t["term"], 0, false, false);
1236 }
1237
1238 $this->form->addItem($radg);
1239
1240 $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
1241 $this->form->setPreventDoubleSubmission(false);
1242
1243 $this->form->setTitle($lng->txt("cont_print_selection"));
1244 }
1245
1252 public function printView()
1253 {
1254 $ilAccess = $this->access;
1255 $tpl = $this->tpl;
1256
1257 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
1258 return;
1259 }
1260
1261 $terms = array();
1262 switch ($_POST["sel_type"]) {
1263 case "glossary":
1264 $ts = $this->glossary->getTermList();
1265 foreach ($ts as $t) {
1266 $terms[] = $t["id"];
1267 }
1268 break;
1269
1270 case "sel_topic":
1271 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1272 $t_id = $this->glossary->getTaxonomyId();
1273 $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $_POST["topic"]);
1274 foreach ($items as $i) {
1275 if ($i["item_type"] == "term") {
1276 $terms[] = $i["item_id"];
1277 }
1278 }
1279 break;
1280
1281 case "selection":
1282 if (is_array($_POST["obj_id"])) {
1283 $terms = $_POST["obj_id"];
1284 } else {
1285 $terms = array();
1286 }
1287 break;
1288
1289 case "term":
1290 $terms = array($this->term_id);
1291 break;
1292 }
1293
1294 $tpl = new ilTemplate("tpl.main.html", true, true);
1295 $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1296
1297 /*
1298 // syntax style
1299 $this->tpl->setCurrentBlock("SyntaxStyle");
1300 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1301 ilObjStyleSheet::getSyntaxStylePath());
1302 $this->tpl->parseCurrentBlock();
1303
1304 // content style
1305 $this->tpl->setCurrentBlock("ContentStyle");
1306 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1307 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
1308 $this->tpl->parseCurrentBlock();*/
1309
1310 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1312
1313 // determine target frames for internal links
1314
1315 foreach ($terms as $t_id) {
1316 $page_content .= $this->listDefinitions($_GET["ref_id"], $t_id, true, IL_PAGE_PRINT);
1317 }
1318 $tpl->setVariable("CONTENT", $page_content .
1319 '<script type="text/javascript" language="javascript1.2">
1320 <!--
1321 il.Util.addOnLoad(function () {
1322 il.Util.print();
1323 });
1324 //-->
1325 </script>');
1326 $tpl->show(false);
1327 exit;
1328 }
1329
1333 public function getTabs()
1334 {
1335 $ilAccess = $this->access;
1336 $lng = $this->lng;
1338 $ilHelp = $this->help;
1339
1340 $ilHelp->setScreenIdComponent("glo");
1341
1342 $oldoffset = (is_numeric($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
1343
1344 if (!$this->offlineMode()) {
1345 if ($this->ctrl->getCmd() != "listDefinitions") {
1346 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
1347 $this->tabs_gui->addTab(
1348 "terms",
1349 $lng->txt("cont_terms"),
1350 $ilCtrl->getLinkTarget($this, "listTerms")
1351 );
1352 }
1353
1354 $this->tabs_gui->addTab(
1355 "info",
1356 $lng->txt("info_short"),
1357 $ilCtrl->getLinkTarget($this, "infoScreen")
1358 );
1359
1360 $this->tabs_gui->addTab(
1361 "print_view",
1362 $lng->txt("cont_print_view"),
1363 $ilCtrl->getLinkTarget($this, "printViewSelection")
1364 );
1365
1366 // glossary menu
1367 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
1368 //if ($this->glossary->isActiveGlossaryMenu())
1369 //{
1370 // download links
1371 if ($this->glossary->isActiveDownloads()) {
1372 $this->tabs_gui->addTab(
1373 "download",
1374 $lng->txt("download"),
1375 $ilCtrl->getLinkTarget($this, "showDownloadList")
1376 );
1377 }
1378 //}
1379 }
1380
1381 if ($ilAccess->checkAccess("write", "", (int) $_GET["ref_id"]) ||
1382 $ilAccess->checkAccess("edit_content", "", (int) $_GET["ref_id"])) {
1383 include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1384 $this->tabs_gui->addNonTabbedLink(
1385 "editing_view",
1386 $lng->txt("glo_editing_view"),
1387 "ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=" . (int) $_GET["ref_id"],
1388 "_top"
1389 );
1390 }
1391 }
1392 } else {
1393 $this->tabs_gui->addTarget(
1394 "cont_back",
1395 "index.html#term_" . $this->term_id,
1396 "",
1397 ""
1398 );
1399 }
1400 }
1401
1402 public function download_paragraph()
1403 {
1404 include_once("./Modules/Glossary/classes/class.ilGlossaryDefPage.php");
1405 $pg_obj = new ilGlossaryDefPage($_GET["pg_id"]);
1406 $pg_obj->send_paragraph($_GET["par_id"], $_GET["downloadtitle"]);
1407 }
1408
1409
1415 public function infoScreen()
1416 {
1417 $this->ctrl->setCmd("showSummary");
1418 $this->ctrl->setCmdClass("ilinfoscreengui");
1419 $this->outputInfoScreen();
1420 }
1421
1425 /*
1426 function showInfoScreen()
1427 {
1428 $this->outputInfoScreen(true);
1429 }*/
1430
1434 public function outputInfoScreen()
1435 {
1436 $ilAccess = $this->access;
1437 $ilTabs = $this->tabs_gui;
1438
1439 $this->setTabs();
1440 $ilTabs->activateTab("info");
1441 $this->lng->loadLanguageModule("meta");
1442
1443 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1444
1445 $info = new ilInfoScreenGUI($this->glossary_gui);
1446 $info->enablePrivateNotes();
1447 //$info->enableLearningProgress();
1448
1449 $info->enableNews();
1450 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1451 $info->enableNewsEditing();
1452 $news_set = new ilSetting("news");
1453 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1454 if ($enable_internal_rss) {
1455 $info->setBlockProperty("news", "settings", true);
1456 }
1457 }
1458
1459 // add read / back button
1460 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
1461 /*
1462 if ($_GET["obj_id"] > 0)
1463 {
1464 $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
1465 $info->addButton($this->lng->txt("back"),
1466 $this->ctrl->getLinkTarget($this, "layout"));
1467 }
1468 else
1469 {
1470 $info->addButton($this->lng->txt("view"),
1471 $this->ctrl->getLinkTarget($this, "layout"));
1472 }*/
1473 }
1474
1475 // show standard meta data section
1476 $info->addMetaDataSections($this->glossary->getId(), 0, $this->glossary->getType());
1477
1478 include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
1479 ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId());
1480
1481 if ($this->offlineMode()) {
1482 $this->tpl->setContent($info->getHTML());
1483 return $this->tpl->get();
1484 } else {
1485 // forward the command
1486 $this->ctrl->forwardCommand($info);
1487 }
1488 }
1489
1496 public function chooseLetter()
1497 {
1499
1500 $ilCtrl->redirect($this, "listTerms");
1501 }
1502
1509 public function showTaxonomy()
1510 {
1511 $tpl = $this->tpl;
1512 $lng = $this->lng;
1513 if (!$this->offlineMode() && $this->glossary->getShowTaxonomy()) {
1514 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1515 $tax_ids = ilObjTaxonomy::getUsageOfObject($this->glossary->getId());
1516 if (count($tax_ids) > 0) {
1517 include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
1518 $tax_exp = new ilTaxonomyExplorerGUI(
1519 $this,
1520 "showTaxonomy",
1521 $tax_ids[0],
1522 "ilglossarypresentationgui",
1523 "listTerms"
1524 );
1525 if (!$tax_exp->handleCommand()) {
1526 //$tpl->setLeftNavContent($tax_exp->getHTML());
1527 $tpl->setLeftContent($tax_exp->getHTML() . "&nbsp;");
1528 }
1529 return;
1530
1531
1532 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
1533 $tpl->setLeftNavContent(ilObjTaxonomyGUI::getTreeHTML(
1534 $tax_ids[0],
1535 "ilglossarypresentationgui",
1536 "listTerms",
1537 $lng->txt("cont_all_topics")
1538 ));
1539 }
1540 }
1541 }
1542}
user()
Definition: user.php:4
$size
Definition: RandomTest.php:84
exit
Definition: backend.php:16
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
const IL_PAGE_PRINT
const IL_PAGE_PRESENTATION
This class represents a text property in a property form.
static _getFrame($a_class, $a_type='')
Get content frame name.
Glossary definition page GUI class.
Glossary definition page object.
static getDefinitionList($a_term_id)
static
Class ilGlossaryPresentationGUI.
downloadFile()
download file of file lists
outputInfoScreen()
info screen call from inside learning module
getPresentationTable()
Get presentation table.
initPrintViewSelectionForm()
Init print view selection form.
media($a_mode="media")
show media object
getLink( $a_ref_id, $a_cmd="", $a_term_id="", $a_def_id="", $a_frame="", $a_type="")
handles links for learning module presentation
setOfflineDirectory($a_dir)
Set offline directory.
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
setOfflineMode($a_offline=true)
set offline mode (content is generated for offline package)
resetFilter()
Reset filter (note: this function existed before data table filter has been introduced.
getLinkXML($a_int_links)
get link targets
setLocator($a_tree="", $a_id="")
set Locator
__construct()
Constructor @access public.
listDefinitions($a_ref_id=0, $a_term_id=0, $a_get_html=false, $a_page_mode=IL_PAGE_PRESENTATION)
list definitions of a term
downloadExportFile()
send download file (xml/html)
offlineMode()
checks wether offline content generation is activated
static isReferenced($a_glo_id, $a_term_id)
Is a term referenced by one or multiple glossaries.
Class ilGlossaryTerm.
static _lookGlossaryID($term_id)
get glossary id form term id
Class ilInfoScreenGUI.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _getPresentationTitle( $a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
static _getMapAreasIntLinks($a_mob_id)
get all internal links of map areas of a mob
This class represents a (nested) list of checkboxes (could be extended for radio items,...
Class ilObjFile.
Class ilGlossaryGUI.
static addUsagesToInfo($info, $glo_id)
Add usages to info.
Class ilObjMediaObject.
static getContentPrintStyle()
get content print style
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static getTreeHTML( $a_tax_id, $a_class, $a_cmd, $a_target_class, $a_target_cmd, $a_root_node_title="")
Get tree html.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static getSubTreeItems($a_comp, $a_obj_id, $a_item_type, $a_tax_id, $a_node)
Get all assigned items under a node.
Class ilObjectMetaDataGUI.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
Term list table for presentation mode.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
ILIAS Setting Class.
Class ilTableGUI.
Input GUI class for taxonomy assignments.
Taxonomy explorer GUI class.
special template class to simplify handling of ITX/PEAR
static highlight($a_dom_node_id, $a_text, $a_tpl=null)
Searches for all occurences of a text (case-insensitive) and highlights it.
static _getInstance($a_usr_id)
Get singleton instance.
static hasPublicProfile($a_user_id)
Has public profile.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static getWebspaceDir($mode="filesystem")
get webspace directory
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getGotoForWikiPageTarget($a_target, $a_offline=false)
Get goto href for internal wiki page link target.
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
$def
Definition: croninfo.php:21
$i
Definition: disco.tpl.php:19
$html
Definition: example_001.php:87
$w
$tbl
Definition: example_048.php:81
$target_id
Definition: goto.php:49
$target_arr
Definition: goto.php:47
global $ilCtrl
Definition: ilias.php:18
xslt_error(&$proc)
xslt_free(&$proc)
xslt_create()
$ai
Definition: langwiz.php:238
$info
Definition: index.php:5
$target
Definition: test.php:19
$ret
Definition: parser.php:6
$type
if(empty($password)) $table
Definition: pwgen.php:24
$ilErr
Definition: raiseError.php:18
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92
$cols
Definition: xhr_table.php:11