ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
5 require_once("classes/class.ilObjectGUI.php");
6 require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
7 require_once("./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
8 require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
9 require_once("./Modules/Glossary/classes/class.ilTermDefinitionEditorGUI.php");
10 require_once("./Services/COPage/classes/class.ilPCParagraph.php");
11 
25 {
27  var $glossary;
28  var $ilias;
29  var $tpl;
30  var $lng;
31 
37  {
38  global $lng, $ilias, $tpl, $ilCtrl;
39 
40  $this->tpl =& $tpl;
41  $this->lng =& $lng;
42  $this->ilias =& $ilias;
43  $this->ctrl =& $ilCtrl;
44  $this->offline = false;
45  $this->ctrl->saveParameter($this, array("ref_id", "letter"));
46 
47  // Todo: check lm id
48  include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
49  $this->glossary_gui =& new ilObjGlossaryGUI("", $_GET["ref_id"], true, "");
50  $this->glossary =& $this->glossary_gui->object;
51 
52  }
53 
54 
58  function setOfflineMode($a_offline = true)
59  {
60  $this->offline = $a_offline;
61  }
62 
66  function offlineMode()
67  {
68  return $this->offline;
69  }
70 
74  function setOfflineDirectory($a_dir)
75  {
76  $this->offline_dir = $a_dir;
77  }
78 
79 
84  {
85  return $this->offline_dir;
86  }
87 
88 
92  function &executeCommand()
93  {
94  global $lng, $ilAccess, $ilias;
95 
96  $lng->loadLanguageModule("content");
97 
98  $next_class = $this->ctrl->getNextClass($this);
99  $cmd = $this->ctrl->getCmd("listTerms");
100 
101  // check write permission
102  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) &&
103  !($ilAccess->checkAccess("visible", "", $_GET["ref_id"]) &&
104  ($cmd == "infoScreen" || strtolower($next_class) == "ilinfoscreengui")))
105  {
106  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
107  }
108 
109  if ($cmd != "listDefinitions")
110  {
111  $this->prepareOutput();
112  }
113 
114  switch($next_class)
115  {
116  case "ilnotegui":
117  $this->setTabs();
118  $ret =& $this->listDefinitions();
119  break;
120 
121  case "ilinfoscreengui":
122  $ret =& $this->outputInfoScreen();
123  break;
124 
125  default:
126  $ret =& $this->$cmd();
127  break;
128  }
129 
130  $this->tpl->show();
131  }
132 
133  function prepareOutput()
134  {
135  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
136  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
137  $title = $this->glossary->getTitle();
138 
139  $this->tpl->setTitle($title);
140  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo_b.gif"));
141 
142  $this->setLocator();
143  }
144 
145 
149  function listTerms()
150  {
151  global $ilNavigationHistory, $ilAccess, $ilias, $lng, $ilToolbar, $ilCtrl, $ilTabs;
152 
153 
154  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
155  {
156  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
157  }
158 
159  if (!$this->offlineMode())
160  {
161  $ilNavigationHistory->addItem($_GET["ref_id"],
162  $this->ctrl->getLinkTarget($this, "listTerms"), "glo");
163 
164  // alphabetical navigation
165  include_once("./Services/Form/classes/class.ilAlphabetInputGUI.php");
166  $ai = new ilAlphabetInputGUI($lng->txt("glo_quick_navigation"), "first");
167  $ai->setLetters($this->glossary->getFirstLetters());
168  $ai->setParentCommand($this, "chooseLetter");
169  $ai->setHighlighted($_GET["letter"]);
170  $ilToolbar->addInputItem($ai, true);
171 
172  }
173 
174 // $term_list = $this->glossary->getTermList();
175 
176  $ret = $this->listTermByGiven($term_list);
177  $ilCtrl->setParameter($this, "term_id", "");
178 
179  $ilTabs->activateTab("terms");
180  return $ret;
181  }
182 
186  function listTermByGiven($term_list, $filter ="")
187  {
188  global $ilCtrl, $ilAccess, $ilias, $lng, $tpl;
189 
190  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
191  {
192  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
193  }
194 
195  $this->lng->loadLanguageModule("meta");
196  include_once "./Services/Table/classes/class.ilTableGUI.php";
197 
198  $this->setTabs();
199 
200  // load template for table
201 // $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
202 
203  $oldoffset = (is_numeric ($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
204 
205 if (!false)
206 {
207  include_once("./Modules/Glossary/classes/class.ilPresentationListTableGUI.php");
208  $table = new ilPresentationListTableGUI($this, "listTerms", $this->glossary,
209  $this->offlineMode());
210 
211  if (!$this->offlineMode())
212  {
213  $tpl->setContent($table->getHTML());
214  }
215  else
216  {
217  $this->tpl->setVariable("ADM_CONTENT", $table->getHTML());
218  return $this->tpl->get();
219  }
220 
221  return;
222 }
223 
224 
225  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.glossary_presentation.html", "Modules/Glossary");
226 
227  // search form
228  if (!$this->offlineMode())
229  {
230  $this->tpl->setCurrentBlock("search_form");
231  $this->ctrl->setParameter($this, "offset", 0);
232  $this->ctrl->setParameter($this, "oldoffset", $oldoffset);
233  $this->tpl->setVariable("FORMACTION1",
234  $this->ctrl->getFormAction($this, "searchTerms"));
235  $this->tpl->setVariable("TXT_TERM", $this->lng->txt("cont_term"));
236  $this->tpl->setVariable("TXT_SEARCH", $this->lng->txt("search"));
237  $this->tpl->setVariable("TXT_CLEAR", $this->lng->txt("clear"));
238  $this->tpl->setVariable("TERM", $filter);
239  $this->tpl->parseCurrentBlock();
240  }
241 
242 
243  // load template for table
244  $this->tpl->addBlockfile("TERM_TABLE", "term_table", "tpl.table.html");
245  // load template for table content data
246  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.term_tbl_pres_row.html", "Modules/Glossary");
247 
248  $num = 2;
249 
250  // create table
251  $tbl = new ilTableGUI();
252 
253  // title & header columns
254  $tbl->setTitle($this->lng->txt("cont_terms").(($filter=="")?"":"*"));
255  $tbl->disable("sort");
256  //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
257 
258  // display additional column 'glossary' for meta glossaries
259  if ($this->glossary->isVirtual())
260  {
261  $tbl->setHeaderNames(array($this->lng->txt("cont_term"),
262  $this->lng->txt("cont_definitions"),$this->lng->txt("obj_glo")));
263 
264  $cols = array("term", "definitions", "glossary");
265 
266  $tbl->setColumnWidth(array("30%", "35%", "35%"));
267  }
268  else
269  {
270  $tbl->setHeaderNames(array($this->lng->txt("cont_term"),
271  $this->lng->txt("cont_definitions")));
272 
273  $cols = array("term", "definitions");
274 
275  $tbl->setColumnWidth(array("30%", "70%"));
276  }
277 
278  if (!$this->offlineMode())
279  {
280  $header_params = $this->ctrl->getParameterArrayByClass("ilglossarypresentationgui", "listTerms");
281  }
282  //$header_params = array("ref_id" => $_GET["ref_id"], "cmd" => "listTerms");
283 
284  if (!empty ($filter)) {
285  $header_params ["cmd"] = "searchTerms";
286  $header_params ["term"] = $filter;
287  $header_params ["oldoffset"] = $_GET["oldoffset"];
288  }
289 
290  $tbl->setHeaderVars($cols, $header_params);
291 
292  // control
293  $tbl->setOrderColumn($_GET["sort_by"]);
294  $tbl->setOrderDirection($_GET["sort_order"]);
295  if ($this->offlineMode())
296  {
297  $_GET["limit"] = 99999;
298  $_GET["offset"] = 0;
299  $tbl->disable("sort");
300  $tbl->disable("footer");
301  }
302  $tbl->setOffset($_GET["offset"]);
303  $tbl->setLimit($_GET["limit"]);
304 
305  // footer
306  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
307 
308 // $term_list = $this->glossary->getTermList();
309  $tbl->setMaxCount(count($term_list));
310 
311  // sorting array
312  //$term_list = ilUtil::sortArray($term_list, $_GET["sort_by"], $_GET["sort_order"]);
313 
314  $term_list = array_slice($term_list, $_GET["offset"], $_GET["limit"]);
315  // render table
316 
317  $tbl->setBase("ilias.php");
318  $tbl->render();
319 
320  if (count($term_list) > 0)
321  {
322  $i=1;
323  foreach($term_list as $key => $term)
324  {
325  $css_row = ilUtil::switchColor($i++,"tblrow1","tblrow2");
326  $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
327 
328  for($j=0; $j<count($defs); $j++)
329  {
330  $def = $defs[$j];
331  if (count($defs) > 1)
332  {
333  $this->tpl->setCurrentBlock("definition");
334  $this->tpl->setVariable("DEF_TEXT", $this->lng->txt("cont_definition")." ".($j + 1));
335  $this->tpl->parseCurrentBlock();
336  }
337 
338  //
339  $this->tpl->setCurrentBlock("definition");
340  $short_str = $def["short_text"];
341  // replace tex
342  // if a tex end tag is missing a tex end tag
343  $ltexs = strrpos($short_str, "[tex]");
344  $ltexe = strrpos($short_str, "[/tex]");
345  if ($ltexs > $ltexe)
346  {
347  $page =& new ilPageObject("gdf", $def["id"]);
348  $page->buildDom();
349  $short_str = $page->getFirstParagraphText();
350  $short_str = strip_tags($short_str, "<br>");
351  $ltexe = strpos($short_str, "[/tex]", $ltexs);
352  $short_str = ilUtil::shortenText($short_str, $ltexe+6, true);
353  }
354  if (!$this->offlineMode())
355  {
356  $short_str = ilUtil::insertLatexImages($short_str);
357  }
358  else
359  {
360  $short_str = ilUtil::buildLatexImages($short_str,
361  $this->getOfflineDirectory());
362  }
363  $short_str = ilPCParagraph::xml2output($short_str);
364 
365  $this->tpl->setVariable("DEF_SHORT", $short_str);
366  $this->tpl->parseCurrentBlock();
367 
368  $this->tpl->setCurrentBlock("definition_row");
369  $this->tpl->parseCurrentBlock();
370  }
371 
372  // display additional column 'glossary' for meta glossaries
373  if ($this->glossary->isVirtual())
374  {
375  $this->tpl->setCurrentBlock("glossary_row");
376  $glo_title = ilObject::_lookupTitle($term["glo_id"]);
377  $this->tpl->setVariable("GLO_TITLE", $glo_title);
378  $this->tpl->parseCurrentBlock();
379  }
380 
381  $this->tpl->setCurrentBlock("view_term");
382  $this->tpl->setVariable("TEXT_TERM", $term["term"]);
383  if (!$this->offlineMode())
384  {
385  if (!empty ($filter))
386  {
387  $this->ctrl->setParameter($this, "term", $filter);
388  $this->ctrl->setParameter($this, "oldoffset", $_GET["oldoffset"]);
389  }
390  $this->ctrl->setParameter($this, "term_id", $term["id"]);
391  $this->ctrl->setParameter($this, "offset", $_GET["offset"]);
392  $this->tpl->setVariable("LINK_VIEW_TERM",
393  $this->ctrl->getLinkTarget($this, "listDefinitions"));
394  $this->ctrl->clearParameters($this);
395  }
396  else
397  {
398  $this->tpl->setVariable("LINK_VIEW_TERM", "term_".$term["id"].".html");
399  }
400  $this->tpl->setVariable("ANCHOR_TERM", "term_".$term["id"]);
401  $this->tpl->parseCurrentBlock();
402 
403  $this->tpl->setVariable("CSS_ROW", $css_row);
404  $this->tpl->setVariable("TEXT_LANGUAGE", $this->lng->txt("meta_l_".$term["language"]));
405  $this->tpl->setCurrentBlock("tbl_content");
406  $this->tpl->parseCurrentBlock();
407 
408  $this->ctrl->clearParameters($this);
409  }
410  } //if is_array
411  else
412  {
413  $this->tpl->setCurrentBlock("notfound");
414  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
415  $this->tpl->setVariable("NUM_COLS", $num);
416  $this->tpl->parseCurrentBlock();
417  }
418 
419  // edit link
420  if (!$this->offlineMode() && $ilAccess->checkAccess("write", "", $_GET["ref_id"]))
421  {
422  $this->tpl->setCurrentBlock("edit_glossary");
423  $this->tpl->setVariable("EDIT_TXT", $this->lng->txt("edit"));
424  $this->tpl->setVariable("EDIT_LINK",
425  "ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$_GET["ref_id"]);
426  $this->tpl->setVariable("EDIT_TARGET", "_top");
427  $this->tpl->parseCurrentBlock();
428  }
429 
430  // permanent link
431  $this->tpl->setCurrentBlock("perma_link");
432  $this->tpl->setVariable("PERMA_LINK", ILIAS_HTTP_PATH.
433  "/goto.php?target=glo_".$_GET["ref_id"]."&client_id=".CLIENT_ID);
434  $this->tpl->setVariable("TXT_PERMA_LINK", $this->lng->txt("perma_link"));
435  $this->tpl->setVariable("PERMA_TARGET", "_top");
436  $this->tpl->parseCurrentBlock();
437 
438  if ($this->offlineMode())
439  {
440  return $this->tpl->get();
441  }
442  }
443 
447  function applyFilter()
448  {
449  global $ilTabs;
450 
451  include_once("./Modules/Glossary/classes/class.ilPresentationListTableGUI.php");
452  $prtab = new ilPresentationListTableGUI($this, "listTerms", $this->glossary,
453  $this->offlineMode());
454  $prtab->resetOffset();
455  $prtab->writeFilterToSession();
456  $this->listTerms();
457 
458  }
459 
464  function resetFilter()
465  {
466  include_once("./Modules/Glossary/classes/class.ilPresentationListTableGUI.php");
467  $prtab = new ilPresentationListTableGUI($this, "listTerms", $this->glossary,
468  $this->offlineMode());
469  $prtab->resetOffset();
470  $prtab->resetFilter();
471  $this->listTerms();
472  }
473 
477  function listDefinitions($a_ref_id = 0, $a_term_id = 0, $a_get_html = false)
478  {
479  global $ilUser, $ilAccess, $ilias, $lng;
480 
481  if ($a_ref_id == 0)
482  {
483  $ref_id = (int) $_GET["ref_id"];
484  }
485  else
486  {
487  $ref_id = $a_ref_id;
488  }
489  if ($a_term_id == 0)
490  {
491  $term_id = (int) $_GET["term_id"];
492  }
493  else
494  {
495  $term_id = $a_term_id;
496  }
497 
498  if (!$ilAccess->checkAccess("read", "", $ref_id))
499  {
500  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
501  }
502 
503  $term = new ilGlossaryTerm($term_id);
504 
505  if (!$a_get_html)
506  {
507  $tpl = $this->tpl;
508 
509  require_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
510  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
511  $tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
512  //$this->setLocator();
513  $this->setTabs();
514 
515  if ($this->offlineMode())
516  {
517  $style_name = $ilUser->prefs["style"].".css";;
518  $tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
519  }
520  else
521  {
522  $this->setLocator();
523  }
524 
525  // content style
526  $tpl->setCurrentBlock("ContentStyle");
527  if (!$this->offlineMode())
528  {
529  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
531  }
532  else
533  {
534  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET","content.css");
535  }
536  $tpl->parseCurrentBlock();
537 
538  // syntax style
539  $tpl->setCurrentBlock("SyntaxStyle");
540  if (!$this->offlineMode())
541  {
542  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
544  }
545  else
546  {
547  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
548  "syntaxhighlight.css");
549  }
550  $tpl->parseCurrentBlock();
551 
552  $tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.gif"));
553  $tpl->setTitle($this->lng->txt("cont_term").": ".$term->getTerm());
554 
555  // load template for table
556  $tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", "Modules/Glossary");
557  }
558  else
559  {
560  // content style
561  $this->tpl->setCurrentBlock("ContentStyle");
562  if (!$this->offlineMode())
563  {
564  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
566  }
567  else
568  {
569  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET","content.css");
570  }
571  $this->tpl->parseCurrentBlock();
572 
573  // syntax style
574  $this->tpl->setCurrentBlock("SyntaxStyle");
575  if (!$this->offlineMode())
576  {
577  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
579  }
580  else
581  {
582  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
583  "syntaxhighlight.css");
584  }
585  $this->tpl->parseCurrentBlock();
586 
587  $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
588  }
589 
590  $defs = ilGlossaryDefinition::getDefinitionList($term_id);
591 
592  $tpl->setVariable("TXT_TERM", $term->getTerm());
593  $this->mobs = array();
594 
595  for($j=0; $j<count($defs); $j++)
596  {
597  $def = $defs[$j];
598  $page_gui =& new ilPageObjectGUI("gdf", $def["id"]);
599  $page = $page_gui->getPageObject();
600 
601  // internal links
602  $page->buildDom();
603  $int_links = $page->getInternalLinks();
604  $link_xml = $this->getLinkXML($int_links);
605  $page_gui->setLinkXML($link_xml);
606 
607  if ($this->offlineMode())
608  {
609  $page_gui->setOutputMode("offline");
610  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
611  }
612  $page_gui->setSourcecodeDownloadScript($this->getLink($ref_id));
613  $page_gui->setFullscreenLink($this->getLink($ref_id, "fullscreen", $term_id, $def["id"]));
614 
615  $page_gui->setTemplateOutput(false);
616  $page_gui->setRawPageContent(true);
617  $page_gui->setFileDownloadLink($this->getLink($ref_id, "downloadFile"));
618  if (!$this->offlineMode())
619  {
620  $output = $page_gui->preview();
621  }
622  else
623  {
624  $output = $page_gui->presentation($page_gui->getOutputMode());
625  }
626 
627  if (count($defs) > 1)
628  {
629  $tpl->setCurrentBlock("definition_header");
630  $tpl->setVariable("TXT_DEFINITION",
631  $this->lng->txt("cont_definition")." ".($j+1));
632  $tpl->parseCurrentBlock();
633  }
634 
635  $tpl->setCurrentBlock("definition");
636  $tpl->setVariable("PAGE_CONTENT", $output);
637  $tpl->parseCurrentBlock();
638  }
639 
640  // display possible backlinks
641  $sources = ilInternalLink::_getSourcesOfTarget('git',$_GET['term_id'],0);
642 
643  if ($sources)
644  {
645  $backlist_shown = false;
646  foreach ($sources as $src)
647  {
648  $type = explode(':',$src['type']);
649 
650  if ($type[0] == 'lm')
651  {
652  if ($type[1] == 'pg')
653  {
655  $lm_id = ilLMObject::_lookupContObjID($src['id']);
656  $lm_title = ilObject::_lookupTitle($lm_id);
657  $tpl->setCurrentBlock('backlink_item');
658  $ref_ids = ilObject::_getAllReferences($lm_id);
659  $access = false;
660  foreach($ref_ids as $rid)
661  {
662  if ($ilAccess->checkAccess("read", "", $rid))
663  {
664  $access = true;
665  }
666  }
667  if ($access)
668  {
669  $tpl->setCurrentBlock("backlink_item");
670  $tpl->setVariable("BACKLINK_LINK",ILIAS_HTTP_PATH."/goto.php?target=".$type[1]."_".$src['id']);
671  $tpl->setVariable("BACKLINK_ITEM",$lm_title.": ".$title);
672  $tpl->parseCurrentBlock();
673  $backlist_shown = true;
674  }
675  }
676  }
677  }
678  if ($backlist_shown)
679  {
680  $tpl->setCurrentBlock("backlink_list");
681  $tpl->setVariable("BACKLINK_TITLE",$this->lng->txt('glo_term_used_in'));
682  $tpl->parseCurrentBlock();
683  }
684  }
685 
686  if (!$a_get_html)
687  {
688  $tpl->setCurrentBlock("perma_link");
689  $tpl->setVariable("PERMA_LINK", ILIAS_HTTP_PATH.
690  "/goto.php?target=".
691  "git".
692  "_".$term_id."_".$ref_id."&client_id=".CLIENT_ID);
693  $tpl->setVariable("TXT_PERMA_LINK", $this->lng->txt("perma_link"));
694  $tpl->setVariable("PERMA_TARGET", "_top");
695  $tpl->parseCurrentBlock();
696  }
697 
698  // highlighting?
699  if ($_GET["srcstring"] != "" && !$this->offlineMode())
700  {
701  include_once './Services/Search/classes/class.ilUserSearchCache.php';
702  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
703  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
704  $search_string = $cache->getQuery();
705 
706  include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
707  include_once("./Services/Search/classes/class.ilQueryParser.php");
708  $p = new ilQueryParser($search_string);
709  $p->parse();
710 
711  $words = $p->getQuotedWords();
712  if (is_array($words))
713  {
714  foreach ($words as $w)
715  {
716  ilTextHighlighterGUI::highlight("ilGloContent", $w, $tpl);
717  }
718  }
719  $this->fill_on_load_code = true;
720  }
721 
722  if ($this->offlineMode() || $a_get_html)
723  {
724  return $tpl->get();
725  }
726  }
727 
728 
732  function fullscreen()
733  {
734  $html = $this->media("fullscreen");
735  return $html;
736  }
737 
741  function media($a_mode = "media")
742  {
743  $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
744  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
745  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
746  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
748 
749  //$int_links = $page_object->getInternalLinks();
750  $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
751 
752  // later
753  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
754 
755  $link_xlm = "";
756 
757  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
758  $media_obj =& new ilObjMediaObject($_GET["mob_id"]);
759 
760  $xml = "<dummy>";
761  // todo: we get always the first alias now (problem if mob is used multiple
762  // times in page)
763  $xml.= $media_obj->getXML(IL_MODE_ALIAS);
764  $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
765  $xml.= $link_xml;
766  $xml.="</dummy>";
767 
768  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
769  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
770  $xh = xslt_create();
771 
772  if (!$this->offlineMode())
773  {
774  $enlarge_path = ilUtil::getImagePath("enlarge.gif", false, "output");
775  $wb_path = ilUtil::getWebspaceDir("output")."/";
776  }
777  else
778  {
779  $enlarge_path = "images/enlarge.gif";
780  $wb_path = "";
781  }
782 
783  $mode = $a_mode;
784 
785  $this->ctrl->setParameter($this, "obj_type", "MediaObject");
786  $fullscreen_link =
787  $this->getLink($_GET["ref_id"], "fullscreen");
788  $this->ctrl->clearParameters($this);
789 
790  $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
791  'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
792  'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
793  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
794  echo xslt_error($xh);
795  xslt_free($xh);
796 
797  // unmask user html
798  $this->tpl->setVariable("MEDIA_CONTENT", $output);
799 
800  $this->tpl->parseCurrentBlock();
801  if ($this->offlineMode())
802  {
803  $html = $this->tpl->get();
804  return $html;
805  }
806 
807  }
808 
812  function showDownloadList()
813  {
814  global $ilBench, $ilAccess, $ilias, $lng, $ilTabs;
815 
816  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
817  {
818  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
819  }
820 
821  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.glo_download_list.html", "Modules/Glossary");
822 
823  $this->setTabs();
824  $ilTabs->activateTab("download");
825 
826  // set title header
827  $this->tpl->setTitle($this->glossary->getTitle());
828  //$this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_glo_b.gif"));
829  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo_b.gif"));
830 
831  // create table
832  require_once("./Services/Table/classes/class.ilTableGUI.php");
833  $tbl = new ilTableGUI();
834 
835  // load files templates
836  $this->tpl->addBlockfile("DOWNLOAD_TABLE", "download_table", "tpl.table.html");
837 
838  // load template for table content data
839  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/Glossary");
840 
841  $export_files = array();
842  $types = array("xml", "html");
843  foreach($types as $type)
844  {
845  if ($this->glossary->getPublicExportFile($type) != "")
846  {
847  $dir = $this->glossary->getExportDirectory($type);
848  if (is_file($this->glossary->getExportDirectory($type)."/".
849  $this->glossary->getPublicExportFile($type)))
850  {
851  $size = filesize($this->glossary->getExportDirectory($type)."/".
852  $this->glossary->getPublicExportFile($type));
853  $export_files[] = array("type" => $type,
854  "file" => $this->glossary->getPublicExportFile($type),
855  "size" => $size);
856  }
857  }
858  }
859 
860  $num = 0;
861 
862  $tbl->setTitle($this->lng->txt("download"));
863 
864  $tbl->setHeaderNames(array($this->lng->txt("cont_format"),
865  $this->lng->txt("cont_file"),
866  $this->lng->txt("size"), $this->lng->txt("date"),
867  ""));
868 
869  $cols = array("format", "file", "size", "date", "download");
870  $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"],
871  "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this)));
872  $tbl->setHeaderVars($cols, $header_params);
873  $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
874  $tbl->disable("sort");
875 
876  // control
877  $tbl->setOrderColumn($_GET["sort_by"]);
878  $tbl->setOrderDirection($_GET["sort_order"]);
879  $tbl->setLimit($_GET["limit"]);
880  $tbl->setOffset($_GET["offset"]);
881  $tbl->setMaxCount($this->maxcount); // ???
882 
883  $this->tpl->setVariable("COLUMN_COUNTS", 5);
884 
885  // footer
886  //$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
887  $tbl->disable("footer");
888 
889  $tbl->setMaxCount(count($export_files));
890  $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
891 
892  $tbl->render();
893  if(count($export_files) > 0)
894  {
895  $i=0;
896  foreach($export_files as $exp_file)
897  {
898  $this->tpl->setCurrentBlock("tbl_content");
899  $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
900 
901  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
902  $this->tpl->setVariable("CSS_ROW", $css_row);
903 
904  $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
905  $this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"]));
906  $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"].":".$exp_file["file"]);
907 
908  $file_arr = explode("__", $exp_file["file"]);
909  $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s",$file_arr[0]));
910 
911  $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
912  $this->ctrl->setParameter($this, "type", $exp_file["type"]);
913  $this->tpl->setVariable("LINK_DOWNLOAD",
914  $this->ctrl->getLinkTarget($this, "downloadExportFile"));
915 
916  $this->tpl->parseCurrentBlock();
917  }
918  } //if is_array
919  else
920  {
921  $this->tpl->setCurrentBlock("notfound");
922  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
923  $this->tpl->setVariable("NUM_COLS", 5);
924  $this->tpl->parseCurrentBlock();
925  }
926 
927  //$this->tpl->show();
928  }
929 
934  {
935  global $ilAccess, $ilias, $lng;
936 
937  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
938  {
939  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
940  }
941 
942  $file = $this->glossary->getPublicExportFile($_GET["type"]);
943  if ($this->glossary->getPublicExportFile($_GET["type"]) != "")
944  {
945  $dir = $this->glossary->getExportDirectory($_GET["type"]);
946  if (is_file($dir."/".$file))
947  {
949  exit;
950  }
951  }
952  $this->ilias->raiseError($this->lng->txt("file_not_found"),$this->ilias->error_obj->MESSAGE);
953  }
954 
962  function setLocator($a_tree = "", $a_id = "")
963  {
964  global $ilias_locator;
965 
966  //$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
967  require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
968  $gloss_loc =& new ilGlossaryLocatorGUI();
969  $gloss_loc->setMode("presentation");
970  if (!empty($_GET["term_id"]))
971  {
972  $term =& new ilGlossaryTerm($_GET["term_id"]);
973  $gloss_loc->setTerm($term);
974  }
975  $gloss_loc->setGlossary($this->glossary);
976  //$gloss_loc->setDefinition($this->definition);
977  $gloss_loc->display();
978  }
979 
983  function downloadFile()
984  {
985  global $ilAccess, $ilias, $lng;
986 
987  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
988  {
989  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
990  }
991 
992  $file = explode("_", $_GET["file_id"]);
993  include_once("./Modules/File/classes/class.ilObjFile.php");
994  $fileObj =& new ilObjFile($file[count($file) - 1], false);
995  $fileObj->sendFile();
996  exit;
997  }
998 
1002  function setTabs()
1003  {
1004  global $ilTabs;
1005  // catch feedback message
1006  #include_once("classes/class.ilTabsGUI.php");
1007  #$tabs_gui =& new ilTabsGUI();
1008  $this->getTabs($ilTabs);
1009 
1010  #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
1011 
1012  }
1013 
1017  function getLinkXML($a_int_links)
1018  {
1019 
1020  if ($a_layoutframes == "")
1021  {
1022  $a_layoutframes = array();
1023  }
1024  $link_info = "<IntLinkInfos>";
1025  foreach ($a_int_links as $int_link)
1026  {
1027 //echo "<br>+".$int_link["Type"]."+".$int_link["TargetFrame"]."+".$int_link["Target"]."+";
1028  $target = $int_link["Target"];
1029  if (substr($target, 0, 4) == "il__")
1030  {
1031  $target_arr = explode("_", $target);
1032  $target_id = $target_arr[count($target_arr) - 1];
1033  $type = $int_link["Type"];
1034  $targetframe = ($int_link["TargetFrame"] != "")
1035  ? $int_link["TargetFrame"]
1036  : "None";
1037 
1038  // anchor
1039  $anc = $anc_add = "";
1040  if ($int_link["Anchor"] != "")
1041  {
1042  $anc = $int_link["Anchor"];
1043  $anc_add = "_".rawurlencode($int_link["Anchor"]);
1044  }
1045 
1046  if ($targetframe == "New")
1047  {
1048  $ltarget = "_blank";
1049  }
1050  else
1051  {
1052  $ltarget = "";
1053  }
1054 
1055  switch($type)
1056  {
1057  case "PageObject":
1058  case "StructureObject":
1060  $cont_obj =& $this->content_object;
1061  if ($type == "PageObject")
1062  {
1063  $href = "./goto.php?target=pg_".$target_id.$anc_add;
1064  }
1065  else
1066  {
1067  $href = "./goto.php?target=st_".$target_id;
1068  }
1069  //$ltarget = "ilContObj".$lm_id;
1070  break;
1071 
1072  case "GlossaryItem":
1073  if (ilGlossaryTerm::_lookGlossaryID($target_id) == $this->glossary->getId())
1074  {
1075  if ($this->offlineMode())
1076  {
1077  $href = "term_".$target_id.".html";
1078  }
1079  else
1080  {
1081  $this->ctrl->setParameter($this, "term_id", $target_id);
1082  $href = $this->ctrl->getLinkTarget($this, "listDefinitions");
1083  $href = str_replace("&", "&amp;", $href);
1084  }
1085  }
1086  else
1087  {
1088  $href = "./goto.php?target=git_".$target_id;
1089  }
1090  break;
1091 
1092  case "MediaObject":
1093  if ($this->offlineMode())
1094  {
1095  $href = "media_".$target_id.".html";
1096  }
1097  else
1098  {
1099  $this->ctrl->setParameter($this, "obj_type", $type);
1100  $this->ctrl->setParameter($this, "mob_id", $target_id);
1101  $href = $this->ctrl->getLinkTarget($this, "media");
1102  $href = str_replace("&", "&amp;", $href);
1103  }
1104  break;
1105 
1106  case "RepositoryItem":
1107  $obj_type = ilObject::_lookupType($target_id, true);
1109  $href = "./goto.php?target=".$obj_type."_".$target_id;
1110  $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
1111  $ltarget = $t_frame;
1112  break;
1113 
1114  }
1115 
1116  $anc_par = 'Anchor="'.$anc.'"';
1117 
1118  $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
1119  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
1120 
1121  $this->ctrl->clearParameters($this);
1122  }
1123  }
1124  $link_info.= "</IntLinkInfos>";
1125 
1126  return $link_info;
1127  }
1128 
1129 
1133  function getLink($a_ref_id, $a_cmd = "", $a_term_id = "", $a_def_id = "",
1134  $a_frame = "", $a_type = "")
1135  {
1136  if ($a_cmd == "")
1137  {
1138  $a_cmd = "layout";
1139  }
1140  //$script = "glossary_presentation.php";
1141 
1142  // handle online links
1143  if (!$this->offlineMode())
1144  {
1145  //$link = $script."?ref_id=".$a_ref_id;
1146  switch ($a_cmd)
1147  {
1148  case "fullscreen":
1149  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1150  $link = $this->ctrl->getLinkTarget($this, "fullscreen");
1151  break;
1152 
1153  default:
1154  $link.= "&amp;cmd=".$a_cmd;
1155  if ($a_frame != "")
1156  {
1157  $this->ctrl->setParameter($this, "frame", $a_frame);
1158  }
1159  if ($a_obj_id != "")
1160  {
1161  switch ($a_type)
1162  {
1163  case "MediaObject":
1164  $this->ctrl->setParameter($this, "mob_id", $a_obj_id);
1165  break;
1166 
1167  default:
1168  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1169  break;
1170  }
1171  }
1172  if ($a_type != "")
1173  {
1174  $this->ctrl->setParameter($this, "obj_type", $a_type);
1175  }
1176  $link = $this->ctrl->getLinkTarget($this, $a_cmd);
1177 // $link = str_replace("&", "&amp;", $link);
1178  break;
1179  }
1180  }
1181  else // handle offline links
1182  {
1183  switch ($a_cmd)
1184  {
1185  case "downloadFile":
1186  break;
1187 
1188  case "fullscreen":
1189  $link = "fullscreen.html"; // id is handled by xslt
1190  break;
1191 
1192  case "layout":
1193  break;
1194 
1195  case "glossary":
1196  $link = "term_".$a_obj_id.".html";
1197  break;
1198 
1199  case "media":
1200  $link = "media_".$a_obj_id.".html";
1201  break;
1202 
1203  default:
1204  break;
1205  }
1206  }
1207  $this->ctrl->clearParameters($this);
1208  return $link;
1209  }
1210 
1218  {
1219  global $ilUser, $lng, $ilToolbar, $ilCtrl, $tpl, $ilTabs;
1220 
1221  $this->setTabs();
1222  $ilTabs->activateTab("print_view");
1223 
1224  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "printView"),
1225  false, "print_view");
1226  $ilToolbar->addFormButton($lng->txt("cont_show_print_view"), "printView");
1227  $ilToolbar->setCloseFormTag(false);
1228 
1229  $this->initPrintViewSelectionForm();
1230 
1231  $tpl->setContent($this->form->getHTML());
1232  }
1233 
1237  public function initPrintViewSelectionForm()
1238  {
1239  global $lng, $ilCtrl;
1240 
1241  $terms = $this->glossary->getTermList();
1242 
1243  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1244  $this->form = new ilPropertyFormGUI();
1245  // selection type
1246  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1247  $radg->setValue("glossary");
1248  //$op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
1249  //$radg->addOption($op1);
1250  $op2 = new ilRadioOption($lng->txt("cont_whole_glossary")
1251  ." (".$lng->txt("cont_terms").": ".count($terms).")", "glossary");
1252  $radg->addOption($op2);
1253  $op3= new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
1254  $radg->addOption($op3);
1255 
1256  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
1257  $nl = new ilNestedListInputGUI("", "obj_id");
1258  $op3->addSubItem($nl);
1259 //var_dump($terms);
1260  foreach ($terms as $t)
1261  {
1262  $nl->addListNode($t["id"], $t["term"], 0, false, false);
1263  }
1264 
1265  $this->form->addItem($radg);
1266 
1267  $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
1268  $this->form->setCloseTag(false);
1269 
1270  $this->form->setTitle($lng->txt("cont_print_selection"));
1271  }
1272 
1279  function printView()
1280  {
1281  global $ilAccess;
1282 
1283  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1284  {
1285  return;
1286  }
1287 
1288  $terms = array();
1289  switch ($_POST["sel_type"])
1290  {
1291  case "glossary":
1292  $ts = $this->glossary->getTermList();
1293  foreach ($ts as $t)
1294  {
1295  $terms[] = $t["id"];
1296  }
1297  break;
1298 
1299  case "selection":
1300  if (is_array($_POST["obj_id"]))
1301  {
1302  $terms = $_POST["obj_id"];
1303  }
1304  else
1305  {
1306  $terms = array();
1307  }
1308  break;
1309  }
1310 
1311  $tpl = new ilTemplate("tpl.main.html", true, true);
1312  $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1313 
1314  // syntax style
1315  $this->tpl->setCurrentBlock("SyntaxStyle");
1316  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1318  $this->tpl->parseCurrentBlock();
1319 
1320  // content style
1321  $this->tpl->setCurrentBlock("ContentStyle");
1322  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1324  $this->tpl->parseCurrentBlock();
1325 
1326  // determine target frames for internal links
1327 
1328  foreach ($terms as $t_id)
1329  {
1330  $page_content.= $this->listDefinitions($_GET["ref_id"], $t_id, true);
1331  }
1332  $tpl->setVariable("CONTENT", '<div class="ilInvisibleBorder">'.$page_content.'</div>'.
1333  '<script type="text/javascript" language="javascript1.2">
1334  <!--
1335  // Do print the page
1336  if (typeof(window.print) != \'undefined\')
1337  {
1338  window.print();
1339  }
1340  //-->
1341  </script>');
1342  $tpl->show(false);
1343  exit;
1344  }
1345 
1349  function getTabs(&$tabs_gui)
1350  {
1351  global $ilAccess, $lng, $ilCtrl;
1352 
1353  $oldoffset = (is_numeric ($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
1354 
1355  if (!$this->offlineMode())
1356  {
1357  if ($this->ctrl->getCmd() != "listDefinitions")
1358  {
1359  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1360  {
1361  $tabs_gui->addTab("terms",
1362  $lng->txt("cont_terms"),
1363  $ilCtrl->getLinkTarget($this, "listTerms"));
1364  }
1365 
1366  $tabs_gui->addTab("info",
1367  $lng->txt("info_short"),
1368  $ilCtrl->getLinkTarget($this, "infoScreen"));
1369 
1370  $tabs_gui->addTab("print_view",
1371  $lng->txt("cont_print_view"),
1372  $ilCtrl->getLinkTarget($this, "printViewSelection"));
1373 
1374  // glossary menu
1375  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1376  {
1377  //if ($this->glossary->isActiveGlossaryMenu())
1378  //{
1379  // download links
1380  if ($this->glossary->isActiveDownloads())
1381  {
1382  $tabs_gui->addTab("download",
1383  $lng->txt("download"),
1384  $ilCtrl->getLinkTarget($this, "showDownloadList"));
1385  }
1386  //}
1387  }
1388 
1389  if ($ilAccess->checkAccess("write", "", (int) $_GET["ref_id"]))
1390  {
1391  $tabs_gui->addNonTabbedLink("editing_view",
1392  $lng->txt("glo_editing_view"),
1393  "ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".(int) $_GET["ref_id"],
1394  "_top");
1395  }
1396 
1397  }
1398  else
1399  {
1400  $this->ctrl->setParameter($this, "offset", $_GET["offset"]);
1401  if (!empty ($_REQUEST["term"]))
1402  {
1403  $this->ctrl->setParameter($this, "term", $_REQUEST["term"]);
1404  $this->ctrl->setParameter($this, "oldoffset", $_GET["oldoffset"]);
1405  $back = $ilCtrl->getLinkTarget($this, "searchTerms");
1406  }
1407  else
1408  {
1409  $back = $ilCtrl->getLinkTarget($this, "listTerms");
1410  }
1411  $tabs_gui->setBackTarget($this->lng->txt("obj_glo"), $back);
1412  }
1413 
1414  }
1415  else
1416  {
1417  $tabs_gui->addTarget("cont_back",
1418  "index.html#term_".$_GET["term_id"], "",
1419  "");
1420  }
1421  }
1422 
1423  function download_paragraph () {
1424  include_once("./Services/COPage/classes/class.ilPageObject.php");
1425  $pg_obj =& new ilPageObject("gdf", $_GET["pg_id"]);
1426  $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
1427  }
1428 
1429 
1435  function infoScreen()
1436  {
1437  $this->ctrl->setCmd("showSummary");
1438  $this->ctrl->setCmdClass("ilinfoscreengui");
1439  $this->outputInfoScreen();
1440  }
1441 
1445  /*
1446  function showInfoScreen()
1447  {
1448  $this->outputInfoScreen(true);
1449  }*/
1450 
1454  function outputInfoScreen()
1455  {
1456  global $ilBench, $ilAccess, $ilTabs;
1457 
1458  $this->setTabs();
1459  $ilTabs->activateTab("info");
1460  $this->lng->loadLanguageModule("meta");
1461 
1462  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1463 
1464  $info = new ilInfoScreenGUI($this->glossary_gui);
1465  $info->enablePrivateNotes();
1466  //$info->enableLearningProgress();
1467 
1468  $info->enableNews();
1469  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1470  {
1471  $info->enableNewsEditing();
1472  $news_set = new ilSetting("news");
1473  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1474  if ($enable_internal_rss)
1475  {
1476  $info->setBlockProperty("news", "settings", true);
1477  }
1478  }
1479 
1480  // add read / back button
1481  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1482  {
1483  /*
1484  if ($_GET["obj_id"] > 0)
1485  {
1486  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
1487  $info->addButton($this->lng->txt("back"),
1488  $this->ctrl->getLinkTarget($this, "layout"));
1489  }
1490  else
1491  {
1492  $info->addButton($this->lng->txt("view"),
1493  $this->ctrl->getLinkTarget($this, "layout"));
1494  }*/
1495  }
1496 
1497  // show standard meta data section
1498  $info->addMetaDataSections($this->glossary->getId(),0, $this->glossary->getType());
1499 
1500  include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
1501  ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId());
1502 
1503  if ($this->offlineMode())
1504  {
1505  $this->tpl->setContent($info->getHTML());
1506  return $this->tpl->get();
1507  }
1508  else
1509  {
1510  // forward the command
1511  $this->ctrl->forwardCommand($info);
1512  }
1513  }
1514 
1521  function chooseLetter()
1522  {
1523  global $ilCtrl;
1524 
1525  $ilCtrl->redirect($this, "listTerms");
1526  }
1527 
1528 }
1529 
1530 ?>