4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
19 function __construct($a_parent_obj, $a_parent_cmd, $a_glossary, $a_offline,
24 $this->glossary = $a_glossary;
25 $this->offline = $a_offline;
26 $this->tax_node = $a_tax_node;
27 $this->
setId(
"glopr".$this->glossary->getId());
32 if ($this->glossary->getPresentationMode() ==
"full_def")
34 $this->
addColumn($lng->txt(
"cont_terms"));
39 $this->
addColumn($lng->txt(
"cont_definitions"));
40 if ($this->glossary->isVirtual())
49 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj));
55 $this->
setRowTemplate(
"tpl.term_tbl_pres_row.html",
"Modules/Glossary");
66 $this->
setData($this->glossary->getTermList($this->filter[
"term"],
$_GET[
"letter"],
67 $this->filter[
"definition"], $this->tax_node));
79 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
83 $ti->setSubmitFormOnEnter(
true);
85 $ti->readFromSession();
86 $this->filter[
"term"] = $ti->getValue();
89 if ($ilDB->getDBType() !=
"oracle")
91 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
92 $ti =
new ilTextInputGUI($lng->txt(
"cont_definition"),
"defintion");
95 $ti->setSubmitFormOnEnter(
true);
97 $ti->readFromSession();
98 $this->filter[
"definition"] = $ti->getValue();
110 $ilCtrl->setParameter($this->parent_obj,
"term_id", $term[
"id"]);
112 if ($this->glossary->getPresentationMode() ==
"full_def")
114 $this->tpl->setVariable(
"FULL_DEF",
115 $this->parent_obj->listDefinitions(
$_GET[
"ref_id"], $term[
"id"],
true));
119 for ($j=0; $j < count($defs); $j++)
122 if (count($defs) > 1)
124 $this->tpl->setCurrentBlock(
"definition");
125 $this->tpl->setVariable(
"DEF_TEXT", $lng->txt(
"cont_definition").
" ".($j + 1));
126 $this->tpl->parseCurrentBlock();
130 $this->tpl->setCurrentBlock(
"definition");
131 if ($def[
"short_text_dirty"])
134 $def->updateShortText();
135 $short_str = $def->getShortText();
139 $short_str = $def[
"short_text"];
143 $ltexs = strrpos($short_str,
"[tex]");
144 $ltexe = strrpos($short_str,
"[/tex]");
149 $short_str = $page->getFirstParagraphText();
150 $short_str = strip_tags($short_str,
"<br>");
151 $ltexe = strpos($short_str,
"[/tex]", $ltexs);
161 $this->parent_obj->getOfflineDirectory());
165 $this->tpl->setVariable(
"DEF_SHORT", $short_str);
166 $this->tpl->parseCurrentBlock();
168 $this->tpl->setCurrentBlock(
"definition_row");
169 $this->tpl->parseCurrentBlock();
174 if ($this->glossary->isVirtual())
176 $this->tpl->setCurrentBlock(
"glossary_row");
178 $this->tpl->setVariable(
"GLO_TITLE", $glo_title);
179 $this->tpl->parseCurrentBlock();
182 $this->tpl->setCurrentBlock(
"view_term");
183 $this->tpl->setVariable(
"TEXT_TERM", $term[
"term"]);
186 if (!empty ($filter))
188 $ilCtrl->setParameter($this,
"term", $filter);
189 $ilCtrl->setParameter($this,
"oldoffset",
$_GET[
"oldoffset"]);
191 $ilCtrl->setParameter($this,
"term_id", $term[
"id"]);
192 $ilCtrl->setParameter($this,
"offset",
$_GET[
"offset"]);
193 $this->tpl->setVariable(
"LINK_VIEW_TERM",
194 $ilCtrl->getLinkTarget($this->parent_obj,
"listDefinitions"));
195 $ilCtrl->clearParameters($this);
199 $this->tpl->setVariable(
"LINK_VIEW_TERM",
"term_".$term[
"id"].
".html");
201 $this->tpl->setVariable(
"ANCHOR_TERM",
"term_".$term[
"id"]);
202 $this->tpl->parseCurrentBlock();
205 $ilCtrl->clearParameters($this->parent_obj);