ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilGlossaryTermGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
5 require_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
6 
19 {
20  var $ilias;
21  var $lng;
22  var $tpl;
23  var $glossary;
24  var $term;
25  var $link_xml;
26 
30  protected $log;
31 
36  function __construct($a_id = 0)
37  {
38  global $lng, $ilias, $tpl, $ilCtrl, $ilTabs;
39 
40  $this->lng = $lng;
41  $this->ilias = $ilias;
42  $this->tpl = $tpl;
43  $this->ctrl = $ilCtrl;
44  $this->ctrl->saveParameter($this, array("term_id"));
45  $this->tabs_gui = $ilTabs;
46 
47  $this->log = ilLoggerFactory::getLogger('glo');
48 
49  if($a_id != 0)
50  {
51  $this->term = new ilGlossaryTerm($a_id);
52  require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
53  $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($a_id), false);
54  }
55  }
56 
60  function executeCommand()
61  {
62  global $ilTabs;
63 
64  $next_class = $this->ctrl->getNextClass($this);
65  $cmd = $this->ctrl->getCmd();
66 
67  $this->log->debug("glossary term, next class ".$next_class.", cmd: ".$cmd);
68 
69  switch ($next_class)
70  {
71  case "iltermdefinitioneditorgui":
72  //$this->ctrl->setReturn($this, "listDefinitions");
73  $def_edit = new ilTermDefinitionEditorGUI();
74  //$ret = $def_edit->executeCommand();
75  $ret = $this->ctrl->forwardCommand($def_edit);
76  $this->quickList("edit", $def_edit);
77  break;
78 
79  case "ilpropertyformgui";
80  $form = $this->getEditTermForm();
81  $this->ctrl->forwardCommand($form);
82  break;
83 
84  case "ilobjectmetadatagui";
85  $this->setTabs();
86  $ilTabs->activateTab('meta_data');
87  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
88  $md_gui = new ilObjectMetaDataGUI(new ilObjGlossary($this->term->getGlossaryId(), false),
89  'term', $this->term->getId());
90  $this->ctrl->forwardCommand($md_gui);
91  $this->quickList();
92  break;
93 
94  default:
95  $ret = $this->$cmd();
96  break;
97  }
98  }
99 
105  function setOfflineDirectory ($offdir) {
106  $this->offline_directory = $offdir;
107  }
108 
109 
114  function getOfflineDirectory () {
115  return $this->offline_directory;
116  }
117 
118 
119  function setGlossary($a_glossary)
120  {
121  $this->glossary = $a_glossary;
122  if (!is_object($this->term_glossary))
123  {
124  $this->term_glossary = $a_glossary;
125  }
126  }
127 
128  function setLinkXML($a_link_xml)
129  {
130  $this->link_xml = $a_link_xml;
131  }
132 
133  function getLinkXML()
134  {
135  return $this->link_xml;
136  }
137 
141  function create()
142  {
143  // deprecated
144  }
145 
149  function saveTerm()
150  {
151  // deprecated
152  }
153 
154 
158  function editTerm(ilPropertyFormGUI $a_form = null)
159  {
160  global $ilTabs, $ilCtrl;
161 
162 // $this->getTemplate();
163  $this->displayLocator();
164  $this->setTabs();
165  $ilTabs->activateTab("properties");
166 
167  $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
168  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
169 
170  if(!$a_form)
171  {
172  $a_form = $this->getEditTermForm();
173  }
174 
175  $this->tpl->setContent($ilCtrl->getHTML($a_form));
176 
177  $this->quickList();
178  }
179 
186  function getEditTermForm()
187  {
188  global $ilTabs, $ilCtrl;
189 
190  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
191  $form = new ilPropertyFormGUI();
192  $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
193  $form->setTitle($this->lng->txt("cont_edit_term"));
194 
195  $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
196  $term->setRequired(true);
197  $term->setValue($this->term->getTerm());
198  $form->addItem($term);
199 
200  $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
201  $lang->setRequired(true);
202  $lang->setOptions(ilMDLanguageItem::_getLanguages());
203  $lang->setValue($this->term->getLanguage());
204  $form->addItem($lang);
205 
206  // taxonomy
207  if ($this->term_glossary->getTaxonomyId() > 0)
208  {
209  include_once("./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
210  $tax_node_assign = new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), "tax_node", true);
211 
212  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
213  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
214  $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
215  $node_ids = array();
216  foreach ($assgnmts as $a)
217  {
218  $node_ids[] = $a["node_id"];
219  }
220  $tax_node_assign->setValue($node_ids);
221 
222  $form->addItem($tax_node_assign);
223 
224  }
225 
226  // advanced metadata
227  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
228  $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR,'glo',$this->term_glossary->getId(),'term',
229  $this->term->getId());
230  $this->record_gui->setPropertyForm($form);
231  $this->record_gui->parse();
232 
233  $form->addCommandButton("updateTerm", $this->lng->txt("save"));
234 
235  return $form;
236  }
237 
238 
239 
243  function updateTerm()
244  {
245  $form = $this->getEditTermForm();
246  if($form->checkInput() &&
247  $this->record_gui->importEditFormPostValues())
248  {
249  // update term
250  $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
251  $this->term->setLanguage($_POST["term_language"]);
252  $this->term->update();
253 
254  // update taxonomy assignment
255  if ($this->term_glossary->getTaxonomyId() > 0)
256  {
257  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
258  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
259  $ta->deleteAssignmentsOfItem($this->term->getId());
260  if (is_array($_POST["tax_node"]))
261  {
262  foreach ($_POST["tax_node"] as $node_id)
263  {
264  $ta->addAssignment($node_id, $this->term->getId());
265  }
266  }
267 
268  }
269 
270  $this->record_gui->writeEditForm();
271  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
272  $this->ctrl->redirect($this, "editTerm");
273  }
274 
275  $form->setValuesByPost();
276  $this->editTerm($form);
277  }
278 
285  function getOverlayHTML($a_close_el_id, $a_glo_ov_id = "", $a_lang = "", $a_outputmode = "offline")
286  {
287  global $lng;
288 
289  if ($a_lang == "")
290  {
291  $a_lang = $lng->getLangKey();
292  }
293 
294  $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
295 // $this->output(true, $tpl);
296  if ($a_outputmode == "preview")
297  {
298  $a_outputmode = "presentation";
299  }
300  if ($a_outputmode == "offline")
301  {
302  $this->output(true, $tpl, $a_outputmode);
303  }
304  else
305  {
306  $this->output(false, $tpl, $a_outputmode);
307  }
308  if ($a_glo_ov_id != "")
309  {
310  $tpl->setCurrentBlock("glovlink");
311  $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
312  $tpl->setVariable("ID_LINK", $a_glo_ov_id);
313  $tpl->parseCurrentBlock();
314  }
315  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
316  $tpl->setVariable("ID_CLOSE", $a_close_el_id);
317  return $tpl->get();
318  }
319 
325  function output($a_offline = false, $a_tpl = "", $a_outputmode = "presentation")
326  {
327  if ($a_tpl != "")
328  {
329  $tpl = $a_tpl;
330  }
331  else
332  {
333  $tpl = $this->tpl;
334  }
335 
336  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
337  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
338 
339  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
340 
341  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
342 
343  for($j=0; $j<count($defs); $j++)
344  {
345  $def = $defs[$j];
346  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
347  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
348  if (!$a_offline)
349  {
350  //$page_gui->setFullscreenLink(
351  // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
352  }
353  else
354  {
355  $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
356  }
357  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=".$_GET["ref_id"]);
358 
359  if (!$a_offline)
360  {
361  $page_gui->setOutputMode($a_outputmode);
362  }
363  else
364  {
365  $page_gui->setOutputMode("offline");
366  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
367  }
368 
369  //$page_gui->setOutputMode("edit");
370  //$page_gui->setPresentationTitle($this->term->getTerm());
371  $page_gui->setLinkXML($this->getLinkXML());
372  $page_gui->setTemplateOutput(false);
373  $output = $page_gui->presentation($page_gui->getOutputMode());
374 
375  if (count($defs) > 1)
376  {
377  $tpl->setCurrentBlock("definition_header");
378  $tpl->setVariable("TXT_DEFINITION",
379  $this->lng->txt("cont_definition")." ".($j+1));
380  $tpl->parseCurrentBlock();
381  }
382 
383  include_once './Services/MathJax/classes/class.ilMathJax.php';
384  ilMathJax::getInstance()->includeMathJax($tpl);
385 
386  $tpl->setCurrentBlock("definition");
387  $tpl->setVariable("PAGE_CONTENT", $output);
388  $tpl->parseCurrentBlock();
389  }
390  }
391 
395  function getInternalLinks()
396  {
397  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
398  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
399 
400  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
401 
402  $term_links = array();
403  for($j=0; $j<count($defs); $j++)
404  {
405  $def = $defs[$j];
406  $page = new ilGlossaryDefPage($def["id"]);
407  $page->buildDom();
408  $page_links = $page->getInternalLinks();
409  foreach($page_links as $key => $page_link)
410  {
411  $term_links[$key] = $page_link;
412  }
413  }
414 
415  return $term_links;
416  }
417 
421  function listDefinitions()
422  {
423  global $ilTabs;
424 
425 // $this->getTemplate();
426  $this->displayLocator();
427  $this->setTabs();
428  $ilTabs->activateTab("definitions");
429  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
430 
431  // content style
432  $this->tpl->setCurrentBlock("ContentStyle");
433  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
434  ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
435  $this->tpl->parseCurrentBlock();
436 
437  // syntax style
438  $this->tpl->setCurrentBlock("SyntaxStyle");
439  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
441  $this->tpl->parseCurrentBlock();
442 
443  // load template for table
444  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
445  //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
446  //ilUtil::sendInfo();
447 // $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
448  $this->tpl->setTitle(
449  $this->lng->txt("cont_term").": ".$this->term->getTerm());
450  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
451 
452  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
453 
454  $this->tpl->setCurrentBlock("add_def");
455  $this->tpl->setVariable("TXT_ADD_DEFINITION",
456  $this->lng->txt("cont_add_definition"));
457  $this->tpl->setVariable("BTN_ADD", "addDefinition");
458  $this->tpl->parseCurrentBlock();
459  $this->tpl->setCurrentBlock("def_list");
460 
462 
463  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
464 
465  for($j=0; $j<count($defs); $j++)
466  {
467  $def = $defs[$j];
468  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
469  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
470  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
471  $page_gui->setTemplateOutput(false);
472  $output = $page_gui->preview();
473 
474  if (count($defs) > 1)
475  {
476  $this->tpl->setCurrentBlock("definition_header");
477  $this->tpl->setVariable("TXT_DEFINITION",
478  $this->lng->txt("cont_definition")." ".($j+1));
479  $this->tpl->parseCurrentBlock();
480  }
481 
482  if ($j > 0)
483  {
484  $this->tpl->setCurrentBlock("up");
485  $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
486  $this->ctrl->setParameter($this, "def", $def["id"]);
487  $this->tpl->setVariable("LINK_UP",
488  $this->ctrl->getLinkTarget($this, "moveUp"));
489  $this->tpl->parseCurrentBlock();
490  }
491 
492  if ($j+1 < count($defs))
493  {
494  $this->tpl->setCurrentBlock("down");
495  $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
496  $this->ctrl->setParameter($this, "def", $def["id"]);
497  $this->tpl->setVariable("LINK_DOWN",
498  $this->ctrl->getLinkTarget($this, "moveDown"));
499  $this->tpl->parseCurrentBlock();
500  }
501  $this->tpl->setCurrentBlock("submit_btns");
502  $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
503  $this->ctrl->setParameter($this, "def", $def["id"]);
504  $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
505  $this->tpl->setVariable("LINK_EDIT",
506  $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit"));
507  $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
508  $this->tpl->setVariable("LINK_DELETE",
509  $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion"));
510  $this->tpl->parseCurrentBlock();
511 
512  $this->tpl->setCurrentBlock("definition");
513  $this->tpl->setVariable("PAGE_CONTENT", $output);
514  $this->tpl->parseCurrentBlock();
515  }
516  //$this->tpl->setCurrentBlock("def_list");
517  //$this->tpl->parseCurrentBlock();
518 
519  $this->quickList();
520  }
521 
522 
527  {
528  global $ilTabs;
529 
530  //$this->getTemplate();
531  $this->displayLocator();
532  $this->setTabs();
533  $ilTabs->activateTab("definitions");
534 
535  // content style
536  $this->tpl->setCurrentBlock("ContentStyle");
537  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
538  ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
539  $this->tpl->parseCurrentBlock();
540 
541  // syntax style
542  $this->tpl->setCurrentBlock("SyntaxStyle");
543  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
545  $this->tpl->parseCurrentBlock();
546 
547  $this->tpl->setTitle(
548  $this->lng->txt("cont_term").": ".$this->term->getTerm());
549  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
550 
551  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
552  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
553 
554  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
555 
556  $definition = new ilGlossaryDefinition($_GET["def"]);
557  $page_gui = new ilGlossaryDefPageGUI($definition->getId());
558  $page_gui->setTemplateOutput(false);
559  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
560  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
561  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
562  $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
563  $output = $page_gui->preview();
564 
565  $this->tpl->setCurrentBlock("definition");
566  $this->tpl->setVariable("PAGE_CONTENT", $output);
567  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
568  $this->tpl->setVariable("LINK_CANCEL",
569  $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion"));
570  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
571  $this->ctrl->setParameter($this, "def", $definition->getId());
572  $this->tpl->setVariable("LINK_CONFIRM",
573  $this->ctrl->getLinkTarget($this, "deleteDefinition"));
574  $this->tpl->parseCurrentBlock();
575  }
576 
578  {
579  $this->ctrl->redirect($this, "listDefinitions");
580  }
581 
582 
583  function deleteDefinition()
584  {
585  $definition = new ilGlossaryDefinition($_GET["def"]);
586  $definition->delete();
587  $this->ctrl->redirect($this, "listDefinitions");
588  }
589 
590 
594  function moveUp()
595  {
596  $definition = new ilGlossaryDefinition($_GET["def"]);
597  $definition->moveUp();
598  $this->ctrl->redirect($this, "listDefinitions");
599  }
600 
601 
605  function moveDown()
606  {
607  $definition = new ilGlossaryDefinition($_GET["def"]);
608  $definition->moveDown();
609  $this->ctrl->redirect($this, "listDefinitions");
610  }
611 
612 
616  function addDefinition()
617  {
618  global $ilCtrl;
619 
620  $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
621  $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
622  }
623 
627  function cancel()
628  {
629  $this->ctrl->redirect($this, "listDefinitions");
630  }
631 
635  function saveDefinition()
636  {
637  $def = new ilGlossaryDefinition();
638  $def->setTermId($_GET["term_id"]);
639  $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
640  $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
641  $def->create();
642 
643  $this->ctrl->redirect($this, "listDefinitions");
644  }
645 
649  function setTabs()
650  {
651  $this->getTabs();
652  }
653 
657  function displayLocator()
658  {
659  require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
660  $gloss_loc = new ilGlossaryLocatorGUI();
661  $gloss_loc->setTerm($this->term);
662  $gloss_loc->setGlossary($this->glossary);
663  //$gloss_loc->setDefinition($this->definition);
664  $gloss_loc->display();
665  }
666 
667 
671  function getTabs()
672  {
673  global $lng, $ilHelp;
674 
675 
676  $ilHelp->setScreenIdComponent("glo_term");
677 
678 //echo ":".$_GET["term_id"].":";
679  if ($_GET["term_id"] != "")
680  {
681  $this->tabs_gui->addTab("properties",
682  $lng->txt("term"),
683  $this->ctrl->getLinkTarget($this, "editTerm"));
684 
685  $this->tabs_gui->addTab("definitions",
686  $lng->txt("cont_definitions"),
687  $this->ctrl->getLinkTarget($this, "listDefinitions"));
688 
689  $this->tabs_gui->addTab("usage",
690  $lng->txt("cont_usage")." (".ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]).")",
691  $this->ctrl->getLinkTarget($this, "listUsages"));
692 
693  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
694  $mdgui = new ilObjectMetaDataGUI(new ilObjGlossary($this->term->getGlossaryId(), false),
695  "term", $this->term->getId());
696  $mdtab = $mdgui->getTab();
697  if($mdtab)
698  {
699  $this->tabs_gui->addTab("meta_data",
700  $lng->txt("meta_data"),
701  $mdtab);
702  }
703 
704  $this->tabs_gui->addNonTabbedLink("presentation_view",
705  $this->lng->txt("glo_presentation_view"),
706  ILIAS_HTTP_PATH.
707  "/goto.php?target=".
708  "git".
709  "_".$_GET["term_id"]."_".$_GET["ref_id"]."&client_id=".CLIENT_ID,
710  "_top"
711  );
712 
713  }
714 
715  // back to glossary
716  $this->tabs_gui->setBackTarget($this->lng->txt("glossary"),
717  $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms"));
718 
719  }
720 
726  public static function _goto($a_target, $a_ref_id = "")
727  {
728  global $rbacsystem, $ilErr, $lng, $ilAccess;
729 
730  $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
731 
732  // get all references
733  if ($a_ref_id > 0)
734  {
735  $ref_ids = array($a_ref_id);
736  }
737  else
738  {
739  $ref_ids = ilObject::_getAllReferences($glo_id);
740  }
741 
742  // check read permissions
743  foreach ($ref_ids as $ref_id)
744  {
745  // Permission check
746  if ($ilAccess->checkAccess("read", "", $ref_id))
747  {
748  $_GET["baseClass"] = "ilGlossaryPresentationGUI";
749  $_GET["term_id"] = $a_target;
750  $_GET["ref_id"] = $ref_id;
751  $_GET["cmd"] = "listDefinitions";
752  include_once("ilias.php");
753  exit;
754  }
755  }
756  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
757  {
758  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
759  ilObject::_lookupTitle($glo_id)), true);
761  }
762 
763 
764  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
765  }
766 
770  function listUsages()
771  {
772  global $ilTabs, $tpl;
773 
774  //$this->displayLocator();
775 // $this->getTemplate();
776  $this->displayLocator();
777  $this->setTabs();
778  $ilTabs->activateTab("usage");
779 
780  $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
781  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
782 
783  include_once("./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
784  $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
785 
786  $tpl->setContent($tab->getHTML());
787 
788  $this->quickList();
789  }
790 
794  function quickList()
795  {
796  global $tpl, $ilCtrl;
797 
798  //$tpl->setLeftNavUrl($ilCtrl->getLinkTarget($this, "showQuickList"));
799 
800  include_once("./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
801  $tab = new ilTermQuickListTableGUI($this, "editTerm");
802  $tpl->setLeftNavContent($tab->getHTML());
803  }
804 }
805 
806 ?>
editTerm(ilPropertyFormGUI $a_form=null)
Edit term.
addDefinition()
add definition
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getAssignmentsOfItem($a_item_id)
Get assignments for item.
global $ilErr
Definition: raiseError.php:16
Class ilObjectMetaDataGUI.
saveDefinition()
save definition
static getDefinitionList($a_term_id)
static
Taxonomy node <-> item assignment.
confirmDefinitionDeletion()
deletion confirmation screen
Select taxonomy nodes input GUI.
This class represents a selection list property in a property form.
setTemplateOutput($a_output=true)
getInternalLinks()
get internal links
This class represents a property form user interface.
setPropertyForm($form)
set property form object
$_GET["client_id"]
static getNumberOfUsages($a_term_id)
Get number of usages.
Class ilGlossaryTerm.
Class ilObjGlossary.
output($a_offline=false, $a_tpl="", $a_outputmode="presentation")
output glossary term definitions
$cmd
Definition: sahs_server.php:35
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
TableGUI class for media object usages listing.
static _lookupTitle($a_id)
lookup object title
create()
form for new content object creation
moveUp()
move definition upwards
static _getAllReferences($a_id)
get all reference ids of object
displayLocator()
display locator
static _goto($a_target, $a_ref_id="")
redirect script
getEditTermForm()
Get edit term form.
global $ilCtrl
Definition: ilias.php:18
deleteAssignmentsOfItem($a_item_id)
Delete assignments of item.
quickList()
Set quick term list cmd into left navigation URL.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
GUI class for glossary term definition editor.
__construct($a_id=0)
Constructor public.
getId()
get object id public
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
cancel()
cancel adding definition
special template class to simplify handling of ITX/PEAR
listDefinitions()
list definitions
This class represents a text property in a property form.
GUI class for glossary terms.
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getSyntaxStylePath()
get syntax style path
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
executeCommand()
execute command
Glossary definition page object.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookGlossaryID($term_id)
get glossary id form term id
Class ilGlossaryDefinition.
static getContentStylePath($a_style_id)
get content style path
setOfflineDirectory($offdir)
set offline directory to offdir
$ref_id
Definition: sahs_server.php:39
static getInstance()
Singleton: get instance.
Glossary definition page GUI class.
$ret
Definition: parser.php:6
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
moveDown()
move definition downwards
static getLogger($a_component_id)
Get component logger.
$_POST["username"]
getOverlayHTML($a_close_el_id, $a_glo_ov_id="", $a_lang="", $a_outputmode="offline")
Get overlay html.
setRequired($a_required)
Set Required.
getOfflineDirectory()
get offline directory