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