4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
19 function __construct($a_parent_obj, $a_parent_cmd, $a_glossary, $a_offline)
23 $this->glossary = $a_glossary;
24 $this->offline = $a_offline;
25 $this->
setId(
"glopr".$this->glossary->getId());
30 if ($this->glossary->getPresentationMode() ==
"full_def")
32 $this->
addColumn($lng->txt(
"cont_terms"));
37 $this->
addColumn($lng->txt(
"cont_definitions"));
38 if ($this->glossary->isVirtual())
47 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj));
53 $this->
setRowTemplate(
"tpl.term_tbl_pres_row.html",
"Modules/Glossary");
64 $this->
setData($this->glossary->getTermList($this->filter[
"term"],
$_GET[
"letter"],
65 $this->filter[
"definition"]));
77 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
81 $ti->setSubmitFormOnEnter(
true);
83 $ti->readFromSession();
84 $this->filter[
"term"] = $ti->getValue();
87 if ($ilDB->getDBType() !=
"oracle")
89 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
90 $ti =
new ilTextInputGUI($lng->txt(
"cont_definition"),
"defintion");
93 $ti->setSubmitFormOnEnter(
true);
95 $ti->readFromSession();
96 $this->filter[
"definition"] = $ti->getValue();
108 $ilCtrl->setParameter($this->parent_obj,
"term_id", $term[
"id"]);
110 if ($this->glossary->getPresentationMode() ==
"full_def")
112 $this->tpl->setVariable(
"FULL_DEF",
113 $this->parent_obj->listDefinitions(
$_GET[
"ref_id"], $term[
"id"],
true));
117 for ($j=0; $j < count($defs); $j++)
120 if (count($defs) > 1)
122 $this->tpl->setCurrentBlock(
"definition");
123 $this->tpl->setVariable(
"DEF_TEXT", $lng->txt(
"cont_definition").
" ".($j + 1));
124 $this->tpl->parseCurrentBlock();
128 $this->tpl->setCurrentBlock(
"definition");
129 if ($def[
"short_text_dirty"])
132 $def->updateShortText();
133 $short_str = $def->getShortText();
137 $short_str = $def[
"short_text"];
141 $ltexs = strrpos($short_str,
"[tex]");
142 $ltexe = strrpos($short_str,
"[/tex]");
147 $short_str = $page->getFirstParagraphText();
148 $short_str = strip_tags($short_str,
"<br>");
149 $ltexe = strpos($short_str,
"[/tex]", $ltexs);
159 $this->parent_obj->getOfflineDirectory());
163 $this->tpl->setVariable(
"DEF_SHORT", $short_str);
164 $this->tpl->parseCurrentBlock();
166 $this->tpl->setCurrentBlock(
"definition_row");
167 $this->tpl->parseCurrentBlock();
169 $this->tpl->touchBlock(
"def_td");
172 if ($this->glossary->isVirtual())
174 $this->tpl->setCurrentBlock(
"glossary_row");
176 $this->tpl->setVariable(
"GLO_TITLE", $glo_title);
177 $this->tpl->parseCurrentBlock();
180 $this->tpl->setCurrentBlock(
"view_term");
181 $this->tpl->setVariable(
"TEXT_TERM", $term[
"term"]);
184 if (!empty ($filter))
186 $ilCtrl->setParameter($this,
"term", $filter);
187 $ilCtrl->setParameter($this,
"oldoffset",
$_GET[
"oldoffset"]);
189 $ilCtrl->setParameter($this,
"term_id", $term[
"id"]);
190 $ilCtrl->setParameter($this,
"offset",
$_GET[
"offset"]);
191 $this->tpl->setVariable(
"LINK_VIEW_TERM",
192 $ilCtrl->getLinkTarget($this->parent_obj,
"listDefinitions"));
193 $ilCtrl->clearParameters($this);
197 $this->tpl->setVariable(
"LINK_VIEW_TERM",
"term_".$term[
"id"].
".html");
199 $this->tpl->setVariable(
"ANCHOR_TERM",
"term_".$term[
"id"]);
200 $this->tpl->parseCurrentBlock();
203 $ilCtrl->clearParameters($this);