4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
24 $this->glossary = $a_parent_obj->object;
25 $this->
setId(
"glotl".$this->glossary->getId());
28 $this->
setTitle($lng->txt(
"cont_terms"));
31 $this->
addColumn($this->lng->txt(
"cont_term"));
32 $this->
addColumn($this->lng->txt(
"language"));
33 $this->
addColumn($this->lng->txt(
"cont_usage"));
34 $this->
addColumn($this->lng->txt(
"cont_definitions"));
36 if (in_array($this->glossary->getVirtualMode(),
37 array(
"level",
"subtree")))
39 $this->
addColumn($this->lng->txt(
"obj_glo"));
44 $this->
setRowTemplate(
"tpl.term_tbl_row.html",
"Modules/Glossary");
48 $this->
addMultiCommand(
"addDefinition", $lng->txt(
"cont_add_definition"));
51 $this->
setData($this->glossary->getTermList($this->filter[
"term"],
"",
52 $this->filter[
"definition"], 0,
true));
63 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
67 $ti->setSubmitFormOnEnter(
true);
69 $ti->readFromSession();
70 $this->filter[
"term"] = $ti->getValue();
73 if ($ilDB->getDBType() !=
"oracle")
75 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
76 $ti =
new ilTextInputGUI($lng->txt(
"cont_definition"),
"defintion");
79 $ti->setSubmitFormOnEnter(
true);
81 $ti->readFromSession();
82 $this->filter[
"definition"] = $ti->getValue();
94 $ilCtrl->setParameterByClass(
"ilglossarytermgui",
"term_id", $term[
"id"]);
96 for($j=0; $j<count($defs); $j++)
100 if ($this->glossary->getId() == $term[
"glo_id"])
105 $this->tpl->setCurrentBlock(
"move_up");
106 $this->tpl->setVariable(
"TXT_UP", $lng->txt(
"up"));
107 $ilCtrl->setParameter($this->parent_obj,
"term_id", $term[
"id"]);
108 $ilCtrl->setParameter($this->parent_obj,
"def", $def[
"id"]);
109 $this->tpl->setVariable(
"LINK_UP",
110 $ilCtrl->getLinkTarget($this->parent_obj,
"moveDefinitionUp"));
111 $this->tpl->parseCurrentBlock();
115 if ($j+1 < count($defs))
117 $this->tpl->setCurrentBlock(
"move_down");
118 $this->tpl->setVariable(
"TXT_DOWN", $lng->txt(
"down"));
119 $ilCtrl->setParameter($this->parent_obj,
"term_id", $term[
"id"]);
120 $ilCtrl->setParameter($this->parent_obj,
"def", $def[
"id"]);
121 $this->tpl->setVariable(
"LINK_DOWN",
122 $ilCtrl->getLinkTarget($this->parent_obj,
"moveDefinitionDown"));
123 $this->tpl->parseCurrentBlock();
127 $this->tpl->setCurrentBlock(
"delete");
128 $ilCtrl->setParameter($this->parent_obj,
"term_id", $term[
"id"]);
129 $ilCtrl->setParameter($this->parent_obj,
"def", $def[
"id"]);
130 $this->tpl->setVariable(
"LINK_DELETE",
131 $ilCtrl->getLinkTarget($this->parent_obj,
"confirmDefinitionDeletion"));
132 $this->tpl->setVariable(
"TXT_DELETE", $lng->txt(
"delete"));
133 $this->tpl->parseCurrentBlock();
136 $this->tpl->setCurrentBlock(
"edit");
137 $ilCtrl->setParameterByClass(
"ilpageobjectgui",
"term_id", $term[
"id"]);
138 $ilCtrl->setParameterByClass(
"ilpageobjectgui",
"def", $def[
"id"]);
139 $this->tpl->setVariable(
"LINK_EDIT",
140 $ilCtrl->getLinkTargetByClass(array(
"ilglossarytermgui",
141 "iltermdefinitioneditorgui",
142 "ilpageobjectgui"),
"edit"));
143 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
144 $this->tpl->parseCurrentBlock();
148 $this->tpl->setCurrentBlock(
"definition");
149 $short_str = $def[
"short_text"];
153 $ltexs = strrpos($short_str,
"[tex]");
154 $ltexe = strrpos($short_str,
"[/tex]");
159 $short_str = $page->getFirstParagraphText();
160 $short_str = strip_tags($short_str,
"<br>");
161 $ltexe = strpos($short_str,
"[/tex]", $ltexs);
166 $this->tpl->setVariable(
"DEF_SHORT", $short_str);
167 $this->tpl->parseCurrentBlock();
169 $this->tpl->setCurrentBlock(
"definition_row");
170 $this->tpl->parseCurrentBlock();
173 $this->tpl->setCurrentBlock(
"check_col");
174 $this->tpl->setVariable(
"CHECKBOX_ID", $term[
"id"]);
175 $this->tpl->parseCurrentBlock();
178 $this->tpl->setCurrentBlock(
"edit_term");
179 $this->tpl->setVariable(
"TEXT_TERM", $term[
"term"]);
180 $ilCtrl->setParameter($this->parent_obj,
"term_id", $term[
"id"]);
181 if ($this->glossary->getId() == $term[
"glo_id"])
183 $this->tpl->setVariable(
"LINK_EDIT_TERM",
184 $ilCtrl->getLinkTargetByClass(
"ilglossarytermgui",
"editTerm"));
185 $this->tpl->setVariable(
"TXT_EDIT_TERM", $lng->txt(
"edit"));
187 $this->tpl->parseCurrentBlock();
191 if ($nr_usage > 0 && $this->glossary->getId() == $term[
"glo_id"])
193 $this->tpl->setCurrentBlock(
"link_usage");
194 $ilCtrl->setParameterByClass(
"ilglossarytermgui",
"term_id", $term[
"id"]);
196 $this->tpl->setVariable(
"LINK_USAGE",
197 $ilCtrl->getLinkTargetByClass(
"ilglossarytermgui",
"listUsages"));
198 $ilCtrl->setParameterByClass(
"ilglossarytermgui",
"term_id",
"");
199 $this->tpl->parseCurrentBlock();
203 $this->tpl->setCurrentBlock(
"usage");
205 $this->tpl->parseCurrentBlock();
209 if (in_array($this->glossary->getVirtualMode(),
210 array(
"level",
"subtree")))
212 $this->tpl->setCurrentBlock(
"glossary");
214 $this->tpl->parseCurrentBlock();
218 $this->tpl->setVariable(
"TEXT_LANGUAGE", $lng->txt(
"meta_l_".$term[
"language"]));