ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilGlossaryLocatorGUI.php
Go to the documentation of this file.
1<?php
2
20
26{
28 protected ?ilGlossaryTerm $term = null;
29 protected ilCtrl $ctrl;
31
32 public string $mode;
33 public string $temp_var;
34 public ilTree $tree;
38
39 public function __construct()
40 {
41 global $DIC;
42
43 $this->ctrl = $DIC->ctrl();
44 $this->locator = $DIC["ilLocator"];
45 $lng = $DIC->language();
46 $tpl = $DIC["tpl"];
47 $tree = $DIC->repositoryTree();
48
49 $this->mode = "edit";
50 $this->temp_var = "LOCATOR";
51 $this->lng = $lng;
52 $this->tpl = $tpl;
53 $this->tree = $tree;
54 $this->presentation_request = $DIC->glossary()
55 ->internal()
56 ->gui()
57 ->presentation()
58 ->request();
59 }
60
61 public function setTemplateVariable(string $a_temp_var): void
62 {
63 $this->temp_var = $a_temp_var;
64 }
65
66 public function setTerm(ilGlossaryTerm $a_term): void
67 {
68 $this->term = $a_term;
69 }
70
71 public function setGlossary(ilObjGlossary $a_glossary): void
72 {
73 $this->glossary = $a_glossary;
74 }
75
76 public function setMode(string $a_mode): void
77 {
78 $this->mode = $a_mode;
79 }
80
84 public function display(): void
85 {
86 $ilCtrl = $this->ctrl;
87 $ilLocator = $this->locator;
89
90 // repository links
91 $ilLocator->addRepositoryItems();
92
93 // glossary link
94 $title = $this->glossary->getTitle();
95 if ($this->mode == "edit") {
96 $link = $ilCtrl->getLinkTargetByClass("ilobjglossarygui", "listTerms");
97 } else {
98 $ilCtrl->setParameterByClass("ilglossarypresentationgui", "term_id", "");
99 $link = $ilCtrl->getLinkTargetByClass("ilglossarypresentationgui");
100 if (is_object($this->term)) {
101 $ilCtrl->setParameterByClass("ilglossarypresentationgui", "term_id", $this->term->getId());
102 }
103 }
104 $ilLocator->addItem($title, $link, "");
105
106 if (is_object($this->term) && $this->mode != "edit") {
107 $ilCtrl->setParameterByClass("ilglossarypresentationgui", "term_id", $this->term->getId());
108 $ilLocator->addItem(
109 $this->term->getTerm(),
110 $ilCtrl->getLinkTargetByClass("ilglossarypresentationgui", "listDefinitions")
111 );
112 $ilCtrl->setParameterByClass(
113 "ilglossarypresentationgui",
114 "term_id",
115 $this->presentation_request->getTermId()
116 );
117 } elseif (is_object($this->term)) {
118 $title = $this->term->getTerm() . " (" . $this->lng->txt("cont_definition") . ")";
119 $link = $ilCtrl->getLinkTargetByClass("ilglossarydefpagegui", "edit");
120 $ilLocator->addItem($title, $link);
121 }
122
123 $tpl->setLocator();
124 }
125}
Class ilCtrl provides processing control methods.
ilGlobalTemplateInterface $tpl
setTemplateVariable(string $a_temp_var)
setGlossary(ilObjGlossary $a_glossary)
PresentationGUIRequest $presentation_request
setTerm(ilGlossaryTerm $a_term)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
setLocator()
Insert locator.
global $DIC
Definition: shib_login.php:26