ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 
31  function ilGlossaryTermGUI($a_id = 0)
32  {
33  global $lng, $ilias, $tpl, $ilCtrl;
34 
35  $this->lng =& $lng;
36  $this->ilias =& $ilias;
37  $this->tpl =& $tpl;
38  $this->ctrl =& $ilCtrl;
39  $this->ctrl->saveParameter($this, array("term_id"));
40 
41  if($a_id != 0)
42  {
43  $this->term =& new ilGlossaryTerm($a_id);
44  }
45  }
46 
50  function executeCommand()
51  {
52  global $ilTabs;
53 
54  $next_class = $this->ctrl->getNextClass($this);
55  $cmd = $this->ctrl->getCmd();
56 
57  switch ($next_class)
58  {
59  case "iltermdefinitioneditorgui":
60  //$this->ctrl->setReturn($this, "listDefinitions");
61  $def_edit =& new ilTermDefinitionEditorGUI();
62  //$ret =& $def_edit->executeCommand();
63  $ret =& $this->ctrl->forwardCommand($def_edit);
64  $this->quickList("edit", $def_edit);
65  break;
66 
67  case "ilpropertyformgui";
68  $form = $this->getEditTermForm();
69  $this->ctrl->forwardCommand($form);
70  break;
71 
72  case "ilobjectmetadatagui";
73  $this->setTabs();
74  $ilTabs->activateTab('meta_data');
75  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
76  $md_gui = new ilObjectMetaDataGUI(new ilObjGlossary($this->term->getGlossaryId(), false),
77  'term', $this->term->getId());
78  $this->ctrl->forwardCommand($md_gui);
79  $this->quickList();
80  break;
81 
82  default:
83  $ret =& $this->$cmd();
84  break;
85  }
86  }
87 
93  function setOfflineDirectory ($offdir) {
94  $this->offline_directory = $offdir;
95  }
96 
97 
102  function getOfflineDirectory () {
103  return $this->offline_directory;
104  }
105 
106 
107  function setGlossary($a_glossary)
108  {
109  $this->glossary = $a_glossary;
110  }
111 
112  function setLinkXML($a_link_xml)
113  {
114  $this->link_xml = $a_link_xml;
115  }
116 
117  function getLinkXML()
118  {
119  return $this->link_xml;
120  }
121 
125  function create()
126  {
127  // deprecated
128  }
129 
133  function saveTerm()
134  {
135  // deprecated
136  }
137 
138 
142  function editTerm(ilPropertyFormGUI $a_form = null)
143  {
144  global $ilTabs, $ilCtrl;
145 
146  $this->getTemplate();
147  $this->displayLocator();
148  $this->setTabs();
149  $ilTabs->activateTab("properties");
150 
151  $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
152  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
153 
154  if(!$a_form)
155  {
156  $a_form = $this->getEditTermForm();
157  }
158 
159  $this->tpl->setContent($ilCtrl->getHTML($a_form));
160 
161  $this->quickList();
162  }
163 
170  function getEditTermForm()
171  {
172  global $ilTabs, $ilCtrl;
173 
174  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
175  $form = new ilPropertyFormGUI();
176  $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
177  $form->setTitle($this->lng->txt("cont_edit_term"));
178 
179  $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
180  $term->setRequired(true);
181  $term->setValue($this->term->getTerm());
182  $form->addItem($term);
183 
184  $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
185  $lang->setRequired(true);
186  $lang->setOptions(ilMDLanguageItem::_getLanguages());
187  $lang->setValue($this->term->getLanguage());
188  $form->addItem($lang);
189 
190  // taxonomy
191  if ($this->glossary->getTaxonomyId() > 0)
192  {
193  include_once("./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
194  $tax_node_assign = new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(), "tax_node", true);
195 
196  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
197  $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId());
198  $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
199  $node_ids = array();
200  foreach ($assgnmts as $a)
201  {
202  $node_ids[] = $a["node_id"];
203  }
204  $tax_node_assign->setValue($node_ids);
205 
206  $form->addItem($tax_node_assign);
207 
208  }
209 
210  // advanced metadata
211  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
212  $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR,'glo',$this->glossary->getId(),'term',
213  $this->term->getId());
214  $this->record_gui->setPropertyForm($form);
215  $this->record_gui->parse();
216 
217  $form->addCommandButton("updateTerm", $this->lng->txt("save"));
218 
219  return $form;
220  }
221 
222 
223 
227  function updateTerm()
228  {
229  $form = $this->getEditTermForm();
230  if($form->checkInput() &&
231  $this->record_gui->importEditFormPostValues())
232  {
233  // update term
234  $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
235  $this->term->setLanguage($_POST["term_language"]);
236  $this->term->update();
237 
238  // update taxonomy assignment
239  if ($this->glossary->getTaxonomyId() > 0)
240  {
241  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
242  $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId());
243  $ta->deleteAssignmentsOfItem($this->term->getId());
244  if (is_array($_POST["tax_node"]))
245  {
246  foreach ($_POST["tax_node"] as $node_id)
247  {
248  $ta->addAssignment($node_id, $this->term->getId());
249  }
250  }
251 
252  }
253 
254  $this->record_gui->writeEditForm();
255  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
256  $this->ctrl->redirect($this, "editTerm");
257  }
258 
259  $form->setValuesByPost();
260  $this->editTerm($form);
261  }
262 
269  function getOverlayHTML($a_close_el_id, $a_glo_ov_id = "", $a_lang = "", $a_outputmode = "offline")
270  {
271  global $lng;
272 
273  if ($a_lang == "")
274  {
275  $a_lang = $lng->getLangKey();
276  }
277 
278  $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
279 // $this->output(true, $tpl);
280  if ($a_outputmode == "preview")
281  {
282  $a_outputmode = "presentation";
283  }
284  if ($a_outputmode == "offline")
285  {
286  $this->output(true, $tpl, $a_outputmode);
287  }
288  else
289  {
290  $this->output(false, $tpl, $a_outputmode);
291  }
292  if ($a_glo_ov_id != "")
293  {
294  $tpl->setCurrentBlock("glovlink");
295  $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
296  $tpl->setVariable("ID_LINK", $a_glo_ov_id);
297  $tpl->parseCurrentBlock();
298  }
299  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
300  $tpl->setVariable("ID_CLOSE", $a_close_el_id);
301  return $tpl->get();
302  }
303 
309  function output($a_offline = false, $a_tpl = "", $a_outputmode = "presentation")
310  {
311  if ($a_tpl != "")
312  {
313  $tpl = $a_tpl;
314  }
315  else
316  {
317  $tpl = $this->tpl;
318  }
319 
320  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
321  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
322 
323  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
324 
325  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
326 
327  for($j=0; $j<count($defs); $j++)
328  {
329  $def = $defs[$j];
330  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
331  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
332  if (!$a_offline)
333  {
334  //$page_gui->setFullscreenLink(
335  // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
336  }
337  else
338  {
339  $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
340  }
341  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=".$_GET["ref_id"]);
342 
343  if (!$a_offline)
344  {
345  $page_gui->setOutputMode($a_outputmode);
346  }
347  else
348  {
349  $page_gui->setOutputMode("offline");
350  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
351  }
352 
353  //$page_gui->setOutputMode("edit");
354  //$page_gui->setPresentationTitle($this->term->getTerm());
355  $page_gui->setLinkXML($this->getLinkXML());
356  $page_gui->setTemplateOutput(false);
357  $output = $page_gui->presentation($page_gui->getOutputMode());
358 
359  if (count($defs) > 1)
360  {
361  $tpl->setCurrentBlock("definition_header");
362  $tpl->setVariable("TXT_DEFINITION",
363  $this->lng->txt("cont_definition")." ".($j+1));
364  $tpl->parseCurrentBlock();
365  }
366 
368 
369  $tpl->setCurrentBlock("definition");
370  $tpl->setVariable("PAGE_CONTENT", $output);
371  $tpl->parseCurrentBlock();
372  }
373  }
374 
378  function getInternalLinks()
379  {
380  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
381  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
382 
383  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
384 
385  $term_links = array();
386  for($j=0; $j<count($defs); $j++)
387  {
388  $def = $defs[$j];
389  $page = new ilGlossaryDefPage($def["id"]);
390  $page->buildDom();
391  $page_links = $page->getInternalLinks();
392  foreach($page_links as $key => $page_link)
393  {
394  $term_links[$key] = $page_link;
395  }
396  }
397 
398  return $term_links;
399  }
400 
404  function listDefinitions()
405  {
406  global $ilTabs;
407 
408  $this->getTemplate();
409  $this->displayLocator();
410  $this->setTabs();
411  $ilTabs->activateTab("definitions");
412  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
413 
414  // content style
415  $this->tpl->setCurrentBlock("ContentStyle");
416  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
417  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
418  $this->tpl->parseCurrentBlock();
419 
420  // syntax style
421  $this->tpl->setCurrentBlock("SyntaxStyle");
422  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
424  $this->tpl->parseCurrentBlock();
425 
426  // load template for table
427  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
428  //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
429  //ilUtil::sendInfo();
430  $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
431  $this->tpl->setTitle(
432  $this->lng->txt("cont_term").": ".$this->term->getTerm());
433  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
434 
435  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
436 
437  $this->tpl->setCurrentBlock("add_def");
438  $this->tpl->setVariable("TXT_ADD_DEFINITION",
439  $this->lng->txt("cont_add_definition"));
440  $this->tpl->setVariable("BTN_ADD", "addDefinition");
441  $this->tpl->parseCurrentBlock();
442  $this->tpl->setCurrentBlock("def_list");
443 
445 
446  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
447 
448  for($j=0; $j<count($defs); $j++)
449  {
450  $def = $defs[$j];
451  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
452  $page_gui->setStyleId($this->glossary->getStyleSheetId());
453  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
454  $page_gui->setTemplateOutput(false);
455  $output = $page_gui->preview();
456 
457  if (count($defs) > 1)
458  {
459  $this->tpl->setCurrentBlock("definition_header");
460  $this->tpl->setVariable("TXT_DEFINITION",
461  $this->lng->txt("cont_definition")." ".($j+1));
462  $this->tpl->parseCurrentBlock();
463  }
464 
465  if ($j > 0)
466  {
467  $this->tpl->setCurrentBlock("up");
468  $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
469  $this->ctrl->setParameter($this, "def", $def["id"]);
470  $this->tpl->setVariable("LINK_UP",
471  $this->ctrl->getLinkTarget($this, "moveUp"));
472  $this->tpl->parseCurrentBlock();
473  }
474 
475  if ($j+1 < count($defs))
476  {
477  $this->tpl->setCurrentBlock("down");
478  $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
479  $this->ctrl->setParameter($this, "def", $def["id"]);
480  $this->tpl->setVariable("LINK_DOWN",
481  $this->ctrl->getLinkTarget($this, "moveDown"));
482  $this->tpl->parseCurrentBlock();
483  }
484  $this->tpl->setCurrentBlock("submit_btns");
485  $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
486  $this->ctrl->setParameter($this, "def", $def["id"]);
487  $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
488  $this->tpl->setVariable("LINK_EDIT",
489  $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit"));
490  $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
491  $this->tpl->setVariable("LINK_DELETE",
492  $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion"));
493  $this->tpl->parseCurrentBlock();
494 
495  $this->tpl->setCurrentBlock("definition");
496  $this->tpl->setVariable("PAGE_CONTENT", $output);
497  $this->tpl->parseCurrentBlock();
498  }
499  //$this->tpl->setCurrentBlock("def_list");
500  //$this->tpl->parseCurrentBlock();
501 
502  $this->quickList();
503  }
504 
505 
510  {
511  global $ilTabs;
512 
513  $this->getTemplate();
514  $this->displayLocator();
515  $this->setTabs();
516  $ilTabs->activateTab("definitions");
517 
518  // content style
519  $this->tpl->setCurrentBlock("ContentStyle");
520  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
521  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
522  $this->tpl->parseCurrentBlock();
523 
524  // syntax style
525  $this->tpl->setCurrentBlock("SyntaxStyle");
526  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
528  $this->tpl->parseCurrentBlock();
529 
530  $this->tpl->setTitle(
531  $this->lng->txt("cont_term").": ".$this->term->getTerm());
532  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
533 
534  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
535  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
536 
537  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
538 
539  $definition =& new ilGlossaryDefinition($_GET["def"]);
540  $page_gui = new ilGlossaryDefPageGUI($definition->getId());
541  $page_gui->setTemplateOutput(false);
542  $page_gui->setStyleId($this->glossary->getStyleSheetId());
543  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
544  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
545  $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
546  $output = $page_gui->preview();
547 
548  $this->tpl->setCurrentBlock("definition");
549  $this->tpl->setVariable("PAGE_CONTENT", $output);
550  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
551  $this->tpl->setVariable("LINK_CANCEL",
552  $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion"));
553  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
554  $this->ctrl->setParameter($this, "def", $definition->getId());
555  $this->tpl->setVariable("LINK_CONFIRM",
556  $this->ctrl->getLinkTarget($this, "deleteDefinition"));
557  $this->tpl->parseCurrentBlock();
558  }
559 
561  {
562  $this->ctrl->redirect($this, "listDefinitions");
563  }
564 
565 
566  function deleteDefinition()
567  {
568  $definition =& new ilGlossaryDefinition($_GET["def"]);
569  $definition->delete();
570  $this->ctrl->redirect($this, "listDefinitions");
571  }
572 
573 
577  function moveUp()
578  {
579  $definition =& new ilGlossaryDefinition($_GET["def"]);
580  $definition->moveUp();
581  $this->ctrl->redirect($this, "listDefinitions");
582  }
583 
584 
588  function moveDown()
589  {
590  $definition =& new ilGlossaryDefinition($_GET["def"]);
591  $definition->moveDown();
592  $this->ctrl->redirect($this, "listDefinitions");
593  }
594 
595 
599  function addDefinition()
600  {
601  global $ilCtrl;
602 
603  $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
604  $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
605  }
606 
610  function cancel()
611  {
612  $this->ctrl->redirect($this, "listDefinitions");
613  }
614 
618  function saveDefinition()
619  {
620  $def =& new ilGlossaryDefinition();
621  $def->setTermId($_GET["term_id"]);
622  $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
623  $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
624  $def->create();
625 
626  $this->ctrl->redirect($this, "listDefinitions");
627  }
628 
629 
633  function getTemplate()
634  {
635  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
636  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
637  }
638 
642  function setTabs()
643  {
644  global $ilTabs;
645  $this->getTabs($ilTabs);
646  }
647 
651  function displayLocator()
652  {
653  require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
654  $gloss_loc =& new ilGlossaryLocatorGUI();
655  $gloss_loc->setTerm($this->term);
656  $gloss_loc->setGlossary($this->glossary);
657  //$gloss_loc->setDefinition($this->definition);
658  $gloss_loc->display();
659  }
660 
661 
665  function getTabs(&$tabs_gui)
666  {
667  global $lng, $ilHelp;
668 
669 
670  $ilHelp->setScreenIdComponent("glo_term");
671 
672 //echo ":".$_GET["term_id"].":";
673  if ($_GET["term_id"] != "")
674  {
675  $tabs_gui->addTab("properties",
676  $lng->txt("term"),
677  $this->ctrl->getLinkTarget($this, "editTerm"));
678 
679  $tabs_gui->addTab("definitions",
680  $lng->txt("cont_definitions"),
681  $this->ctrl->getLinkTarget($this, "listDefinitions"));
682 
683  $tabs_gui->addTab("usage",
684  $lng->txt("cont_usage")." (".ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]).")",
685  $this->ctrl->getLinkTarget($this, "listUsages"));
686 
687  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
688  $mdgui = new ilObjectMetaDataGUI(new ilObjGlossary($this->term->getGlossaryId(), false),
689  "term", $this->term->getId());
690  $mdtab = $mdgui->getTab();
691  if($mdtab)
692  {
693  $tabs_gui->addTab("meta_data",
694  $lng->txt("meta_data"),
695  $mdtab);
696  }
697 
698  $tabs_gui->addNonTabbedLink("presentation_view",
699  $this->lng->txt("glo_presentation_view"),
700  ILIAS_HTTP_PATH.
701  "/goto.php?target=".
702  "git".
703  "_".$_GET["term_id"]."_".$_GET["ref_id"]."&client_id=".CLIENT_ID,
704  "_top"
705  );
706 
707  }
708 
709  // back to glossary
710  $tabs_gui->setBackTarget($this->lng->txt("glossary"),
711  $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms"));
712 
713  }
714 
720  public static function _goto($a_target, $a_ref_id = "")
721  {
722  global $rbacsystem, $ilErr, $lng, $ilAccess;
723 
724  $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
725 
726  // get all references
727  if ($a_ref_id > 0)
728  {
729  $ref_ids = array($a_ref_id);
730  }
731  else
732  {
733  $ref_ids = ilObject::_getAllReferences($glo_id);
734  }
735 
736  // check read permissions
737  foreach ($ref_ids as $ref_id)
738  {
739  // Permission check
740  if ($ilAccess->checkAccess("read", "", $ref_id))
741  {
742  $_GET["baseClass"] = "ilGlossaryPresentationGUI";
743  $_GET["term_id"] = $a_target;
744  $_GET["ref_id"] = $ref_id;
745  $_GET["cmd"] = "listDefinitions";
746  include_once("ilias.php");
747  exit;
748  }
749  }
750  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
751  {
752  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
753  ilObject::_lookupTitle($glo_id)), true);
755  }
756 
757 
758  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
759  }
760 
764  function listUsages()
765  {
766  global $ilTabs, $tpl;
767 
768  //$this->displayLocator();
769  $this->getTemplate();
770  $this->displayLocator();
771  $this->setTabs();
772  $ilTabs->activateTab("usage");
773 
774  $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
775  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
776 
777  include_once("./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
778  $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
779 
780  $tpl->setContent($tab->getHTML());
781 
782  $this->quickList();
783  }
784 
788  function quickList()
789  {
790  global $tpl, $ilCtrl;
791 
792  //$tpl->setLeftNavUrl($ilCtrl->getLinkTarget($this, "showQuickList"));
793 
794  include_once("./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
795  $tab = new ilTermQuickListTableGUI($this, "editTerm");
796  $tpl->setLeftNavContent($tab->getHTML());
797  }
798 }
799 
800 ?>
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.
Class ilObjectMetaDataGUI.
saveDefinition()
save definition
exit
Definition: login.php:54
Taxonomy node <-> item assignment.
confirmDefinitionDeletion()
deletion confirmation screen
$_POST['username']
Definition: cron.php:12
Select taxonomy nodes input GUI.
This class represents a selection list property in a property form.
setTemplateOutput($a_output=true)
getDefinitionList($a_term_id)
static
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
getSyntaxStylePath()
get syntax style path
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.
GUI class for glossary term definition editor.
ilGlossaryTermGUI($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 sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
executeCommand()
execute command
Glossary definition page object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
includeMathjax($a_tpl=null)
Include Mathjax.
static _lookGlossaryID($term_id)
get glossary id form term id
Class ilGlossaryDefinition.
setOfflineDirectory($offdir)
set offline directory to offdir
$ref_id
Definition: sahs_server.php:39
getContentStylePath($a_style_id)
get content style path
Glossary definition page GUI class.
moveDown()
move definition downwards
getTabs(&$tabs_gui)
get tabs
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