ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 {
23  protected $ctrl;
24 
28  protected $tabs_gui;
29 
33  protected $help;
34 
35  public $lng;
36  public $tpl;
37  public $glossary;
38  public $term;
39  public $link_xml;
40 
44  protected $log;
45 
49  protected $term_glossary = null;
50 
55  public function __construct($a_id = 0)
56  {
57  global $DIC;
58 
59  $this->help = $DIC["ilHelp"];
60  $lng = $DIC->language();
61  $tpl = $DIC["tpl"];
62  $ilCtrl = $DIC->ctrl();
63  $ilTabs = $DIC->tabs();
64 
65  $this->lng = $lng;
66  $this->tpl = $tpl;
67  $this->ctrl = $ilCtrl;
68  $this->ctrl->saveParameter($this, array("term_id"));
69  $this->tabs_gui = $ilTabs;
70 
71  $this->log = ilLoggerFactory::getLogger('glo');
72 
73  $this->ref_id = $_GET["ref_id"];
74 
75  if ($a_id != 0) {
76  $this->term = new ilGlossaryTerm($a_id);
77  require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
78  if (ilObject::_lookupObjectId($this->ref_id) == ilGlossaryTerm::_lookGlossaryID($a_id)) {
79  $this->term_glossary = new ilObjGlossary($this->ref_id, true);
80  } else {
81  $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($a_id), false);
82  }
83  }
84  }
85 
89  public function executeCommand()
90  {
91  $ilTabs = $this->tabs_gui;
92 
93  $next_class = $this->ctrl->getNextClass($this);
94  $cmd = $this->ctrl->getCmd();
95 
96  $this->log->debug("glossary term, next class " . $next_class . ", cmd: " . $cmd);
97 
98  switch ($next_class) {
99  case "iltermdefinitioneditorgui":
100  //$this->ctrl->setReturn($this, "listDefinitions");
101  $def_edit = new ilTermDefinitionEditorGUI();
102  //$ret = $def_edit->executeCommand();
103  $ret = $this->ctrl->forwardCommand($def_edit);
104  $this->quickList("edit", $def_edit);
105  break;
106 
107  case "ilpropertyformgui":
108  $form = $this->getEditTermForm();
109  $this->ctrl->forwardCommand($form);
110  break;
111 
112  case "ilobjectmetadatagui":
113  $this->setTabs();
114  $ilTabs->activateTab('meta_data');
115  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
116  $md_gui = new ilObjectMetaDataGUI(
117  $this->term_glossary,
118  'term',
119  $this->term->getId()
120  );
121  $this->ctrl->forwardCommand($md_gui);
122  $this->quickList();
123  break;
124 
125  default:
126  $ret = $this->$cmd();
127  break;
128  }
129  }
130 
136  public function setOfflineDirectory($offdir)
137  {
138  $this->offline_directory = $offdir;
139  }
140 
141 
146  public function getOfflineDirectory()
147  {
148  return $this->offline_directory;
149  }
150 
151 
152  public function setGlossary($a_glossary)
153  {
154  $this->glossary = $a_glossary;
155  if (!is_object($this->term_glossary)) {
156  $this->term_glossary = $a_glossary;
157  }
158  }
159 
160  public function setLinkXML($a_link_xml)
161  {
162  $this->link_xml = $a_link_xml;
163  }
164 
165  public function getLinkXML()
166  {
167  return $this->link_xml;
168  }
169 
173  public function create()
174  {
175  // deprecated
176  }
177 
181  public function saveTerm()
182  {
183  // deprecated
184  }
185 
186 
190  public function editTerm(ilPropertyFormGUI $a_form = null)
191  {
192  $ilTabs = $this->tabs_gui;
194 
195  // $this->getTemplate();
196  $this->displayLocator();
197  $this->setTabs();
198  $ilTabs->activateTab("properties");
199 
200  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
201  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
202 
203  if (!$a_form) {
204  $a_form = $this->getEditTermForm();
205  }
206 
207  $this->tpl->setContent($ilCtrl->getHTML($a_form));
208 
209  $this->quickList();
210  }
211 
218  public function getEditTermForm()
219  {
220  $ilTabs = $this->tabs_gui;
222 
223  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
224  $form = new ilPropertyFormGUI();
225  $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
226  $form->setTitle($this->lng->txt("cont_edit_term"));
227 
228  $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
229  $term->setRequired(true);
230  $term->setValue($this->term->getTerm());
231  $form->addItem($term);
232 
233  $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
234  $lang->setRequired(true);
235  $lang->setOptions(ilMDLanguageItem::_getLanguages());
236  $lang->setValue($this->term->getLanguage());
237  $form->addItem($lang);
238 
239  // taxonomy
240  if ($this->term_glossary->getTaxonomyId() > 0) {
241  include_once("./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
242  $tax_node_assign = new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), "tax_node", true);
243 
244  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
245  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
246  $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
247  $node_ids = array();
248  foreach ($assgnmts as $a) {
249  $node_ids[] = $a["node_id"];
250  }
251  $tax_node_assign->setValue($node_ids);
252 
253  $form->addItem($tax_node_assign);
254  }
255 
256  // advanced metadata
257  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
258  $this->record_gui = new ilAdvancedMDRecordGUI(
260  'glo',
261  $this->term_glossary->getId(),
262  'term',
263  $this->term->getId()
264  );
265  $this->record_gui->setPropertyForm($form);
266  $this->record_gui->parse();
267 
268  $form->addCommandButton("updateTerm", $this->lng->txt("save"));
269 
270  return $form;
271  }
272 
273 
274 
278  public function updateTerm()
279  {
280  $form = $this->getEditTermForm();
281  if ($form->checkInput() &&
282  $this->record_gui->importEditFormPostValues()) {
283  // update term
284  $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
285  $this->term->setLanguage($_POST["term_language"]);
286  $this->term->update();
287 
288  // update taxonomy assignment
289  if ($this->term_glossary->getTaxonomyId() > 0) {
290  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
291  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
292  $ta->deleteAssignmentsOfItem($this->term->getId());
293  if (is_array($_POST["tax_node"])) {
294  foreach ($_POST["tax_node"] as $node_id) {
295  $ta->addAssignment($node_id, $this->term->getId());
296  }
297  }
298  }
299 
300  $this->record_gui->writeEditForm();
301  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
302  $this->ctrl->redirect($this, "editTerm");
303  }
304 
305  $form->setValuesByPost();
306  $this->editTerm($form);
307  }
308 
315  public function getOverlayHTML($a_close_el_id, $a_glo_ov_id = "", $a_lang = "", $a_outputmode = "offline")
316  {
317  $lng = $this->lng;
318 
319  if ($a_lang == "") {
320  $a_lang = $lng->getLangKey();
321  }
322 
323  $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
324  // $this->output(true, $tpl);
325  if ($a_outputmode == "preview") {
326  $a_outputmode = "presentation";
327  }
328  if ($a_outputmode == "offline") {
329  $this->output(true, $tpl, $a_outputmode);
330  } else {
331  $this->output(false, $tpl, $a_outputmode);
332  }
333  if ($a_glo_ov_id != "") {
334  $tpl->setCurrentBlock("glovlink");
335  $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
336  $tpl->setVariable("ID_LINK", $a_glo_ov_id);
337  $tpl->parseCurrentBlock();
338  }
339  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
340  $tpl->setVariable("ID_CLOSE", $a_close_el_id);
341  return $tpl->get();
342  }
343 
349  public function output($a_offline = false, $a_tpl = "", $a_outputmode = "presentation")
350  {
351  if ($a_tpl != "") {
352  $tpl = $a_tpl;
353  } else {
354  $tpl = $this->tpl;
355  }
356 
357  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
358  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
359 
360  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
361 
362  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
363 
364  for ($j=0; $j<count($defs); $j++) {
365  $def = $defs[$j];
366  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
367  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
368  if (!$a_offline) {
369  //$page_gui->setFullscreenLink(
370  // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
371  } else {
372  $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
373  }
374  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=" . $_GET["ref_id"]);
375 
376  if (!$a_offline) {
377  $page_gui->setOutputMode($a_outputmode);
378  } else {
379  $page_gui->setOutputMode("offline");
380  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
381  }
382 
383  //$page_gui->setOutputMode("edit");
384  //$page_gui->setPresentationTitle($this->term->getTerm());
385  $page_gui->setLinkXML($this->getLinkXML());
386  $page_gui->setTemplateOutput(false);
387  $output = $page_gui->presentation($page_gui->getOutputMode());
388 
389  if (count($defs) > 1) {
390  $tpl->setCurrentBlock("definition_header");
391  $tpl->setVariable(
392  "TXT_DEFINITION",
393  $this->lng->txt("cont_definition") . " " . ($j+1)
394  );
395  $tpl->parseCurrentBlock();
396  }
397 
398  include_once './Services/MathJax/classes/class.ilMathJax.php';
399  ilMathJax::getInstance()->includeMathJax($tpl);
400 
401  $tpl->setCurrentBlock("definition");
402  $tpl->setVariable("PAGE_CONTENT", $output);
403  $tpl->parseCurrentBlock();
404  }
405  }
406 
410  public function getInternalLinks()
411  {
412  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
413  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
414 
415  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
416 
417  $term_links = array();
418  for ($j=0; $j<count($defs); $j++) {
419  $def = $defs[$j];
420  $page = new ilGlossaryDefPage($def["id"]);
421  $page->buildDom();
422  $page_links = $page->getInternalLinks();
423  foreach ($page_links as $key => $page_link) {
424  $term_links[$key] = $page_link;
425  }
426  }
427 
428  return $term_links;
429  }
430 
434  public function listDefinitions()
435  {
436  $ilTabs = $this->tabs_gui;
437 
438  // $this->getTemplate();
439  $this->displayLocator();
440  $this->setTabs();
441  $ilTabs->activateTab("definitions");
442  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
443 
444  // content style
445  $this->tpl->setCurrentBlock("ContentStyle");
446  $this->tpl->setVariable(
447  "LOCATION_CONTENT_STYLESHEET",
448  ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId())
449  );
450  $this->tpl->parseCurrentBlock();
451 
452  // syntax style
453  $this->tpl->setCurrentBlock("SyntaxStyle");
454  $this->tpl->setVariable(
455  "LOCATION_SYNTAX_STYLESHEET",
457  );
458  $this->tpl->parseCurrentBlock();
459 
460  // load template for table
461  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
462  //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
463  //ilUtil::sendInfo();
464  // $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
465  $this->tpl->setTitle(
466  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
467  );
468  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
469 
470  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
471 
472  $this->tpl->setCurrentBlock("add_def");
473  $this->tpl->setVariable(
474  "TXT_ADD_DEFINITION",
475  $this->lng->txt("cont_add_definition")
476  );
477  $this->tpl->setVariable("BTN_ADD", "addDefinition");
478  $this->tpl->parseCurrentBlock();
479  $this->tpl->setCurrentBlock("def_list");
480 
482 
483  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
484 
485  for ($j=0; $j<count($defs); $j++) {
486  $def = $defs[$j];
487  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
488  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
489  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
490  $page_gui->setTemplateOutput(false);
491  $output = $page_gui->preview();
492 
493  if (count($defs) > 1) {
494  $this->tpl->setCurrentBlock("definition_header");
495  $this->tpl->setVariable(
496  "TXT_DEFINITION",
497  $this->lng->txt("cont_definition") . " " . ($j+1)
498  );
499  $this->tpl->parseCurrentBlock();
500  }
501 
502  if ($j > 0) {
503  $this->tpl->setCurrentBlock("up");
504  $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
505  $this->ctrl->setParameter($this, "def", $def["id"]);
506  $this->tpl->setVariable(
507  "LINK_UP",
508  $this->ctrl->getLinkTarget($this, "moveUp")
509  );
510  $this->tpl->parseCurrentBlock();
511  }
512 
513  if ($j+1 < count($defs)) {
514  $this->tpl->setCurrentBlock("down");
515  $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
516  $this->ctrl->setParameter($this, "def", $def["id"]);
517  $this->tpl->setVariable(
518  "LINK_DOWN",
519  $this->ctrl->getLinkTarget($this, "moveDown")
520  );
521  $this->tpl->parseCurrentBlock();
522  }
523  $this->tpl->setCurrentBlock("submit_btns");
524  $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
525  $this->ctrl->setParameter($this, "def", $def["id"]);
526  $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
527  $this->tpl->setVariable(
528  "LINK_EDIT",
529  $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit")
530  );
531  $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
532  $this->tpl->setVariable(
533  "LINK_DELETE",
534  $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion")
535  );
536  $this->tpl->parseCurrentBlock();
537 
538  $this->tpl->setCurrentBlock("definition");
539  $this->tpl->setVariable("PAGE_CONTENT", $output);
540  $this->tpl->parseCurrentBlock();
541  }
542  //$this->tpl->setCurrentBlock("def_list");
543  //$this->tpl->parseCurrentBlock();
544 
545  $this->quickList();
546  }
547 
548 
552  public function confirmDefinitionDeletion()
553  {
554  $ilTabs = $this->tabs_gui;
555 
556  //$this->getTemplate();
557  $this->displayLocator();
558  $this->setTabs();
559  $ilTabs->activateTab("definitions");
560 
561  // content style
562  $this->tpl->setCurrentBlock("ContentStyle");
563  $this->tpl->setVariable(
564  "LOCATION_CONTENT_STYLESHEET",
565  ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId())
566  );
567  $this->tpl->parseCurrentBlock();
568 
569  // syntax style
570  $this->tpl->setCurrentBlock("SyntaxStyle");
571  $this->tpl->setVariable(
572  "LOCATION_SYNTAX_STYLESHEET",
574  );
575  $this->tpl->parseCurrentBlock();
576 
577  $this->tpl->setTitle(
578  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
579  );
580  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
581 
582  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
583  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
584 
585  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
586 
587  $definition = new ilGlossaryDefinition($_GET["def"]);
588  $page_gui = new ilGlossaryDefPageGUI($definition->getId());
589  $page_gui->setTemplateOutput(false);
590  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
591  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
592  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
593  $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
594  $output = $page_gui->preview();
595 
596  $this->tpl->setCurrentBlock("definition");
597  $this->tpl->setVariable("PAGE_CONTENT", $output);
598  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
599  $this->tpl->setVariable(
600  "LINK_CANCEL",
601  $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion")
602  );
603  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
604  $this->ctrl->setParameter($this, "def", $definition->getId());
605  $this->tpl->setVariable(
606  "LINK_CONFIRM",
607  $this->ctrl->getLinkTarget($this, "deleteDefinition")
608  );
609  $this->tpl->parseCurrentBlock();
610  }
611 
612  public function cancelDefinitionDeletion()
613  {
614  $this->ctrl->redirect($this, "listDefinitions");
615  }
616 
617 
618  public function deleteDefinition()
619  {
620  $definition = new ilGlossaryDefinition($_GET["def"]);
621  $definition->delete();
622  $this->ctrl->redirect($this, "listDefinitions");
623  }
624 
625 
629  public function moveUp()
630  {
631  $definition = new ilGlossaryDefinition($_GET["def"]);
632  $definition->moveUp();
633  $this->ctrl->redirect($this, "listDefinitions");
634  }
635 
636 
640  public function moveDown()
641  {
642  $definition = new ilGlossaryDefinition($_GET["def"]);
643  $definition->moveDown();
644  $this->ctrl->redirect($this, "listDefinitions");
645  }
646 
647 
651  public function addDefinition()
652  {
654 
655  $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
656  $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
657  }
658 
662  public function cancel()
663  {
664  $this->ctrl->redirect($this, "listDefinitions");
665  }
666 
670  public function saveDefinition()
671  {
672  $def = new ilGlossaryDefinition();
673  $def->setTermId($_GET["term_id"]);
674  $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
675  $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
676  $def->create();
677 
678  $this->ctrl->redirect($this, "listDefinitions");
679  }
680 
684  public function setTabs()
685  {
686  $this->getTabs();
687  }
688 
692  public function displayLocator()
693  {
694  require_once("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
695  $gloss_loc = new ilGlossaryLocatorGUI();
696  $gloss_loc->setTerm($this->term);
697  $gloss_loc->setGlossary($this->glossary);
698  //$gloss_loc->setDefinition($this->definition);
699  $gloss_loc->display();
700  }
701 
702 
706  public function getTabs()
707  {
708  $lng = $this->lng;
709  $ilHelp = $this->help;
710 
711 
712  $ilHelp->setScreenIdComponent("glo_term");
713 
714  //echo ":".$_GET["term_id"].":";
715  if ($_GET["term_id"] != "") {
716  $this->tabs_gui->addTab(
717  "properties",
718  $lng->txt("term"),
719  $this->ctrl->getLinkTarget($this, "editTerm")
720  );
721 
722  $this->tabs_gui->addTab(
723  "definitions",
724  $lng->txt("cont_definitions"),
725  $this->ctrl->getLinkTarget($this, "listDefinitions")
726  );
727 
728  $this->tabs_gui->addTab(
729  "usage",
730  $lng->txt("cont_usage") . " (" . ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]) . ")",
731  $this->ctrl->getLinkTarget($this, "listUsages")
732  );
733 
734  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
735  $mdgui = new ilObjectMetaDataGUI(
736  $this->term_glossary,
737  "term",
738  $this->term->getId()
739  );
740  $mdtab = $mdgui->getTab();
741  if ($mdtab) {
742  $this->tabs_gui->addTab(
743  "meta_data",
744  $lng->txt("meta_data"),
745  $mdtab
746  );
747  }
748 
749  $this->tabs_gui->addNonTabbedLink(
750  "presentation_view",
751  $this->lng->txt("glo_presentation_view"),
752  ILIAS_HTTP_PATH .
753  "/goto.php?target=" .
754  "git" .
755  "_" . $_GET["term_id"] . "_" . $_GET["ref_id"] . "&client_id=" . CLIENT_ID,
756  "_top"
757  );
758  }
759 
760  // back to glossary
761  $this->tabs_gui->setBackTarget(
762  $this->lng->txt("glossary"),
763  $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms")
764  );
765  }
766 
772  public static function _goto($a_target, $a_ref_id = "")
773  {
774  global $DIC;
775 
776  $rbacsystem = $DIC->rbac()->system();
777  $ilErr = $DIC["ilErr"];
778  $lng = $DIC->language();
779  $ilAccess = $DIC->access();
780 
781  $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
782 
783  // get all references
784  if ($a_ref_id > 0) {
785  $ref_ids = array($a_ref_id);
786  } else {
787  $ref_ids = ilObject::_getAllReferences($glo_id);
788  }
789 
790  // check read permissions
791  foreach ($ref_ids as $ref_id) {
792  // Permission check
793  if ($ilAccess->checkAccess("read", "", $ref_id)) {
794  $_GET["baseClass"] = "ilGlossaryPresentationGUI";
795  $_GET["term_id"] = $a_target;
796  $_GET["ref_id"] = $ref_id;
797  $_GET["cmd"] = "listDefinitions";
798  include_once("ilias.php");
799  exit;
800  }
801  }
802  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
803  ilUtil::sendFailure(sprintf(
804  $lng->txt("msg_no_perm_read_item"),
805  ilObject::_lookupTitle($glo_id)
806  ), true);
808  }
809 
810 
811  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
812  }
813 
817  public function listUsages()
818  {
819  $ilTabs = $this->tabs_gui;
820  $tpl = $this->tpl;
821 
822  //$this->displayLocator();
823  // $this->getTemplate();
824  $this->displayLocator();
825  $this->setTabs();
826  $ilTabs->activateTab("usage");
827 
828  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
829  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
830 
831  include_once("./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
832  $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
833 
834  $tpl->setContent($tab->getHTML());
835 
836  $this->quickList();
837  }
838 
842  public function quickList()
843  {
844  $tpl = $this->tpl;
846 
847  //$tpl->setLeftNavUrl($ilCtrl->getLinkTarget($this, "showQuickList"));
848 
849  include_once("./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
850  $tab = new ilTermQuickListTableGUI($this, "editTerm");
851  $tpl->setLeftNavContent($tab->getHTML());
852  }
853 }
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.
global $DIC
Definition: saml.php:7
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
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.
static _lookupObjectId($a_ref_id)
lookup object id
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.
if(isset($_POST['submit'])) $form
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.
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.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
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.
setOfflineDirectory($offdir)
set offline directory to offdir
static getInstance()
Singleton: get instance.
Glossary definition page GUI class.
$ret
Definition: parser.php:6
$def
Definition: croninfo.php:21
moveDown()
move definition downwards
static getLogger($a_component_id)
Get component logger.
$key
Definition: croninfo.php:18
$_POST["username"]
getOverlayHTML($a_close_el_id, $a_glo_ov_id="", $a_lang="", $a_outputmode="offline")
Get overlay html.
getOfflineDirectory()
get offline directory