ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilGlossaryTermGUI Class Reference

GUI class for glossary terms. More...

+ Collaboration diagram for ilGlossaryTermGUI:

Public Member Functions

 __construct ($a_id=0)
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 setOfflineDirectory ($offdir)
 set offline directory to offdir More...
 
 getOfflineDirectory ()
 get offline directory More...
 
 setGlossary ($a_glossary)
 
 setPageLinker ($page_linker)
 
 create ()
 form for new content object creation More...
 
 saveTerm ()
 save term More...
 
 editTerm (ilPropertyFormGUI $a_form=null)
 Edit term. More...
 
 getEditTermForm ()
 Get edit term form. More...
 
 updateTerm ()
 update term More...
 
 getOverlayHTML ($a_close_el_id, $a_glo_ov_id="", $a_lang="", $a_outputmode="offline")
 Get overlay html. More...
 
 output ($a_offline=false, $a_tpl="", $a_outputmode="presentation")
 output glossary term definitions More...
 
 getInternalLinks ()
 get internal links More...
 
 listDefinitions ()
 list definitions More...
 
 confirmDefinitionDeletion ()
 deletion confirmation screen More...
 
 cancelDefinitionDeletion ()
 
 deleteDefinition ()
 
 moveUp ()
 move definition upwards More...
 
 moveDown ()
 move definition downwards More...
 
 addDefinition ()
 add definition More...
 
 cancel ()
 cancel adding definition More...
 
 saveDefinition ()
 save definition More...
 
 setTabs ()
 output tabs More...
 
 displayLocator ()
 display locator More...
 
 getTabs ()
 get tabs More...
 
 listUsages ()
 List usage. More...
 
 quickList ()
 Set quick term list cmd into left navigation URL. More...
 

Static Public Member Functions

static _goto ($a_target, $a_ref_id="")
 redirect script More...
 

Data Fields

 $lng
 
 $tpl
 
 $glossary
 
 $term
 
 $link_xml
 

Protected Attributes

 $ctrl
 
 $tabs_gui
 
 $help
 
 $page_linker
 
 $log
 
 $term_glossary = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryTermGUI::__construct (   $a_id = 0)

Constructor public.

Definition at line 54 of file class.ilGlossaryTermGUI.php.

References $_GET, $DIC, $ilCtrl, $lng, $tpl, ilGlossaryTerm\_lookGlossaryID(), ilObject\_lookupObjectId(), ilLoggerFactory\getLogger(), and help().

55  {
56  global $DIC;
57 
58  $this->help = $DIC["ilHelp"];
59  $lng = $DIC->language();
60  $tpl = $DIC["tpl"];
61  $ilCtrl = $DIC->ctrl();
62  $ilTabs = $DIC->tabs();
63 
64  $this->lng = $lng;
65  $this->tpl = $tpl;
66  $this->ctrl = $ilCtrl;
67  $this->ctrl->saveParameter($this, array("term_id"));
68  $this->tabs_gui = $ilTabs;
69 
70  $this->log = ilLoggerFactory::getLogger('glo');
71 
72  $this->ref_id = $_GET["ref_id"];
73 
74  if ($a_id != 0) {
75  $this->term = new ilGlossaryTerm($a_id);
76  if (ilObject::_lookupObjectId($this->ref_id) == ilGlossaryTerm::_lookGlossaryID($a_id)) {
77  $this->term_glossary = new ilObjGlossary($this->ref_id, true);
78  } else {
79  $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($a_id), false);
80  }
81  }
82  }
$_GET["client_id"]
Glossary terms.
Class ilObjGlossary.
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
help()
Definition: help.php:2
static _lookGlossaryID($term_id)
get glossary id form term id
$DIC
Definition: xapitoken.php:46
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilGlossaryTermGUI::_goto (   $a_target,
  $a_ref_id = "" 
)
static

redirect script

Parameters
string$a_target

Definition at line 728 of file class.ilGlossaryTermGUI.php.

References $_GET, $DIC, $ilErr, $lng, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilGlossaryTerm\_lookGlossaryID(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

729  {
730  global $DIC;
731 
732  $rbacsystem = $DIC->rbac()->system();
733  $ilErr = $DIC["ilErr"];
734  $lng = $DIC->language();
735  $ilAccess = $DIC->access();
736 
737  $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
738 
739  // get all references
740  if ($a_ref_id > 0) {
741  $ref_ids = array($a_ref_id);
742  } else {
743  $ref_ids = ilObject::_getAllReferences($glo_id);
744  }
745 
746  // check read permissions
747  foreach ($ref_ids as $ref_id) {
748  // Permission check
749  if ($ilAccess->checkAccess("read", "", $ref_id)) {
750  $_GET["baseClass"] = "ilGlossaryPresentationGUI";
751  $_GET["term_id"] = $a_target;
752  $_GET["ref_id"] = $ref_id;
753  $_GET["cmd"] = "listDefinitions";
754  include_once("ilias.php");
755  exit;
756  }
757  }
758  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
759  ilUtil::sendFailure(sprintf(
760  $lng->txt("msg_no_perm_read_item"),
761  ilObject::_lookupTitle($glo_id)
762  ), true);
764  }
765 
766 
767  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
768  }
exit
Definition: login.php:29
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
$ilErr
Definition: raiseError.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookGlossaryID($term_id)
get glossary id form term id
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ addDefinition()

ilGlossaryTermGUI::addDefinition ( )

add definition

Definition at line 609 of file class.ilGlossaryTermGUI.php.

References $ctrl, and $ilCtrl.

610  {
612 
613  $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
614  $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
615  }
global $ilCtrl
Definition: ilias.php:18

◆ cancel()

ilGlossaryTermGUI::cancel ( )

cancel adding definition

Definition at line 620 of file class.ilGlossaryTermGUI.php.

621  {
622  $this->ctrl->redirect($this, "listDefinitions");
623  }

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

Definition at line 570 of file class.ilGlossaryTermGUI.php.

571  {
572  $this->ctrl->redirect($this, "listDefinitions");
573  }

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

Definition at line 521 of file class.ilGlossaryTermGUI.php.

References $_GET, $tabs_gui, displayLocator(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), ilObjStyleSheet\getSyntaxStylePath(), ilUtil\sendQuestion(), setTabs(), and ilPageObjectGUI\setTemplateOutput().

522  {
523  $ilTabs = $this->tabs_gui;
524 
525  //$this->getTemplate();
526  $this->displayLocator();
527  $this->setTabs();
528  $ilTabs->activateTab("definitions");
529 
530  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
531  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
532 
533  $this->tpl->setTitle(
534  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
535  );
536  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
537 
538  $dtpl = new ilTemplate("tpl.glossary_definition_delete.html", true, true, "Modules/Glossary");
539  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
540 
541  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
542 
543  $definition = new ilGlossaryDefinition($_GET["def"]);
544  $page_gui = new ilGlossaryDefPageGUI($definition->getId());
545  $page_gui->setTemplateOutput(false);
546  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
547  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
548  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
549  $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
550  $output = $page_gui->preview();
551 
552  $dtpl->setCurrentBlock("definition");
553  $dtpl->setVariable("PAGE_CONTENT", $output);
554  $dtpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
555  $dtpl->setVariable(
556  "LINK_CANCEL",
557  $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion")
558  );
559  $dtpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
560  $this->ctrl->setParameter($this, "def", $definition->getId());
561  $dtpl->setVariable(
562  "LINK_CONFIRM",
563  $this->ctrl->getLinkTarget($this, "deleteDefinition")
564  );
565  $dtpl->parseCurrentBlock();
566 
567  $this->tpl->setContent($dtpl->get());
568  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
setTemplateOutput($a_output=true)
$_GET["client_id"]
displayLocator()
display locator
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getSyntaxStylePath()
get syntax style path
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
Class ilGlossaryDefinition.
Glossary definition page GUI class.
+ Here is the call graph for this function:

◆ create()

ilGlossaryTermGUI::create ( )

form for new content object creation

Definition at line 165 of file class.ilGlossaryTermGUI.php.

166  {
167  // deprecated
168  }

◆ deleteDefinition()

ilGlossaryTermGUI::deleteDefinition ( )

Definition at line 576 of file class.ilGlossaryTermGUI.php.

References $_GET.

577  {
578  $definition = new ilGlossaryDefinition($_GET["def"]);
579  $definition->delete();
580  $this->ctrl->redirect($this, "listDefinitions");
581  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

display locator

Definition at line 650 of file class.ilGlossaryTermGUI.php.

Referenced by confirmDefinitionDeletion(), editTerm(), listDefinitions(), and listUsages().

651  {
652  $gloss_loc = new ilGlossaryLocatorGUI();
653  $gloss_loc->setTerm($this->term);
654  $gloss_loc->setGlossary($this->glossary);
655  //$gloss_loc->setDefinition($this->definition);
656  $gloss_loc->display();
657  }
+ Here is the caller graph for this function:

◆ editTerm()

ilGlossaryTermGUI::editTerm ( ilPropertyFormGUI  $a_form = null)

Edit term.

Definition at line 182 of file class.ilGlossaryTermGUI.php.

References $ctrl, $ilCtrl, $tabs_gui, displayLocator(), getEditTermForm(), ilUtil\getImagePath(), quickList(), and setTabs().

Referenced by updateTerm().

183  {
184  $ilTabs = $this->tabs_gui;
186 
187  // $this->getTemplate();
188  $this->displayLocator();
189  $this->setTabs();
190  $ilTabs->activateTab("properties");
191 
192  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
193  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
194 
195  if (!$a_form) {
196  $a_form = $this->getEditTermForm();
197  }
198 
199  $this->tpl->setContent($ilCtrl->getHTML($a_form));
200 
201  $this->quickList();
202  }
displayLocator()
display locator
getEditTermForm()
Get edit term form.
global $ilCtrl
Definition: ilias.php:18
quickList()
Set quick term list cmd into left navigation URL.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilGlossaryTermGUI::executeCommand ( )

execute command

Definition at line 87 of file class.ilGlossaryTermGUI.php.

References $ret, $tabs_gui, getEditTermForm(), quickList(), and setTabs().

88  {
89  $ilTabs = $this->tabs_gui;
90 
91  $next_class = $this->ctrl->getNextClass($this);
92  $cmd = $this->ctrl->getCmd();
93 
94  $this->log->debug("glossary term, next class " . $next_class . ", cmd: " . $cmd);
95 
96  switch ($next_class) {
97  case "iltermdefinitioneditorgui":
98  //$this->ctrl->setReturn($this, "listDefinitions");
99  $def_edit = new ilTermDefinitionEditorGUI();
100  //$ret = $def_edit->executeCommand();
101  $ret = $this->ctrl->forwardCommand($def_edit);
102  $this->quickList("edit", $def_edit);
103  break;
104 
105  case "ilpropertyformgui":
106  $form = $this->getEditTermForm();
107  $this->ctrl->forwardCommand($form);
108  break;
109 
110  case "ilobjectmetadatagui":
111  $this->setTabs();
112  $ilTabs->activateTab('meta_data');
113  $md_gui = new ilObjectMetaDataGUI(
114  $this->term_glossary,
115  'term',
116  $this->term->getId()
117  );
118  $this->ctrl->forwardCommand($md_gui);
119  $this->quickList();
120  break;
121 
122  default:
123  $ret = $this->$cmd();
124  break;
125  }
126  }
Class ilObjectMetaDataGUI.
getEditTermForm()
Get edit term form.
quickList()
Set quick term list cmd into left navigation URL.
GUI class for glossary term definition editor.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getEditTermForm()

ilGlossaryTermGUI::getEditTermForm ( )

Get edit term form.

Parameters

Definition at line 210 of file class.ilGlossaryTermGUI.php.

References Vendor\Package\$a, $ctrl, $ilCtrl, $lang, $tabs_gui, $term, ilMDLanguageItem\_getLanguages(), ilAdvancedMDRecordGUI\MODE_EDITOR, and ilAdvancedMDRecordGUI\setPropertyForm().

Referenced by editTerm(), executeCommand(), and updateTerm().

211  {
212  $ilTabs = $this->tabs_gui;
214 
215  $form = new ilPropertyFormGUI();
216  $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
217  $form->setTitle($this->lng->txt("cont_edit_term"));
218 
219  $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
220  $term->setRequired(true);
221  $term->setValue($this->term->getTerm());
222  $form->addItem($term);
223 
224  $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
225  $lang->setRequired(true);
226  $lang->setOptions(ilMDLanguageItem::_getLanguages());
227  $lang->setValue($this->term->getLanguage());
228  $form->addItem($lang);
229 
230  // taxonomy
231  if ($this->term_glossary->getTaxonomyId() > 0) {
232  $tax_node_assign = new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), "tax_node", true);
233 
234  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
235  $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
236  $node_ids = array();
237  foreach ($assgnmts as $a) {
238  $node_ids[] = $a["node_id"];
239  }
240  $tax_node_assign->setValue($node_ids);
241 
242  $form->addItem($tax_node_assign);
243  }
244 
245  // advanced metadata
246  $this->record_gui = new ilAdvancedMDRecordGUI(
248  'glo',
249  $this->term_glossary->getId(),
250  'term',
251  $this->term->getId()
252  );
253  $this->record_gui->setPropertyForm($form);
254  $this->record_gui->parse();
255 
256  $form->addCommandButton("updateTerm", $this->lng->txt("save"));
257 
258  return $form;
259  }
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.
This class represents a property form user interface.
setPropertyForm($form)
set property form object
global $ilCtrl
Definition: ilias.php:18
$lang
Definition: xapiexit.php:8
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInternalLinks()

ilGlossaryTermGUI::getInternalLinks ( )

get internal links

Definition at line 393 of file class.ilGlossaryTermGUI.php.

References ilGlossaryDefinition\getDefinitionList().

394  {
395  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
396 
397  $term_links = array();
398  for ($j = 0; $j < count($defs); $j++) {
399  $def = $defs[$j];
400  $page = new ilGlossaryDefPage($def["id"]);
401  $page->buildDom();
402  $page_links = $page->getInternalLinks();
403  foreach ($page_links as $key => $page_link) {
404  $term_links[$key] = $page_link;
405  }
406  }
407 
408  return $term_links;
409  }
static getDefinitionList($a_term_id)
static
Glossary definition page object.
+ Here is the call graph for this function:

◆ getOfflineDirectory()

ilGlossaryTermGUI::getOfflineDirectory ( )

get offline directory

Returns
directory where to store offline files

Definition at line 143 of file class.ilGlossaryTermGUI.php.

Referenced by output().

144  {
145  return $this->offline_directory;
146  }
+ Here is the caller graph for this function:

◆ getOverlayHTML()

ilGlossaryTermGUI::getOverlayHTML (   $a_close_el_id,
  $a_glo_ov_id = "",
  $a_lang = "",
  $a_outputmode = "offline" 
)

Get overlay html.

Parameters

Definition at line 302 of file class.ilGlossaryTermGUI.php.

References $lng, $tpl, and output().

303  {
304  $lng = $this->lng;
305 
306  if ($a_lang == "") {
307  $a_lang = $lng->getLangKey();
308  }
309 
310  $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
311  // $this->output(true, $tpl);
312  if ($a_outputmode == "preview") {
313  $a_outputmode = "presentation";
314  }
315  if ($a_outputmode == "offline") {
316  $this->output(true, $tpl, $a_outputmode);
317  } else {
318  $this->output(false, $tpl, $a_outputmode);
319  }
320  if ($a_glo_ov_id != "") {
321  $tpl->setCurrentBlock("glovlink");
322  $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
323  $tpl->setVariable("ID_LINK", $a_glo_ov_id);
324  $tpl->parseCurrentBlock();
325  }
326  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
327  $tpl->setVariable("ID_CLOSE", $a_close_el_id);
328  return $tpl->get();
329  }
output($a_offline=false, $a_tpl="", $a_outputmode="presentation")
output glossary term definitions
+ Here is the call graph for this function:

◆ getTabs()

ilGlossaryTermGUI::getTabs ( )

get tabs

Definition at line 663 of file class.ilGlossaryTermGUI.php.

References $_GET, $help, $lng, ilGlossaryTerm\getNumberOfUsages(), ilObjectMetaDataGUI\getTab(), and ILIAS_HTTP_PATH.

Referenced by setTabs().

664  {
665  $lng = $this->lng;
666  $ilHelp = $this->help;
667 
668 
669  $ilHelp->setScreenIdComponent("glo_term");
670 
671  //echo ":".$_GET["term_id"].":";
672  if ($_GET["term_id"] != "") {
673  $this->tabs_gui->addTab(
674  "properties",
675  $lng->txt("term"),
676  $this->ctrl->getLinkTarget($this, "editTerm")
677  );
678 
679  $this->tabs_gui->addTab(
680  "definitions",
681  $lng->txt("cont_definitions"),
682  $this->ctrl->getLinkTarget($this, "listDefinitions")
683  );
684 
685  $this->tabs_gui->addTab(
686  "usage",
687  $lng->txt("cont_usage") . " (" . ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]) . ")",
688  $this->ctrl->getLinkTarget($this, "listUsages")
689  );
690 
691  $mdgui = new ilObjectMetaDataGUI(
692  $this->term_glossary,
693  "term",
694  $this->term->getId()
695  );
696  $mdtab = $mdgui->getTab();
697  if ($mdtab) {
698  $this->tabs_gui->addTab(
699  "meta_data",
700  $lng->txt("meta_data"),
701  $mdtab
702  );
703  }
704 
705  $this->tabs_gui->addNonTabbedLink(
706  "presentation_view",
707  $this->lng->txt("glo_presentation_view"),
709  "/goto.php?target=" .
710  "git" .
711  "_" . $_GET["term_id"] . "_" . $_GET["ref_id"] . "&client_id=" . CLIENT_ID,
712  "_top"
713  );
714  }
715 
716  // back to glossary
717  $this->tabs_gui->setBackTarget(
718  $this->lng->txt("glossary"),
719  $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms")
720  );
721  }
Class ilObjectMetaDataGUI.
$_GET["client_id"]
static getNumberOfUsages($a_term_id)
Get number of usages.
getTab($a_base_class=null)
Get tab link if available.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listDefinitions()

ilGlossaryTermGUI::listDefinitions ( )

list definitions

Definition at line 414 of file class.ilGlossaryTermGUI.php.

References $_GET, $tabs_gui, $tpl, displayLocator(), ilObjStyleSheet\getContentStylePath(), ilGlossaryDefinition\getDefinitionList(), ilUtil\getImagePath(), ilObjStyleSheet\getSyntaxStylePath(), quickList(), and setTabs().

415  {
416  $ilTabs = $this->tabs_gui;
417 
418  // $this->getTemplate();
419  $this->displayLocator();
420  $this->setTabs();
421  $ilTabs->activateTab("definitions");
422 
423  // content style
424  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
425  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
426 
427 
428  // load template for table
429  $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
430 
431  $this->tpl->setTitle(
432  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
433  );
434  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
435 
436  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
437 
438  $tpl->setCurrentBlock("add_def");
439  $tpl->setVariable(
440  "TXT_ADD_DEFINITION",
441  $this->lng->txt("cont_add_definition")
442  );
443  $tpl->setVariable("BTN_ADD", "addDefinition");
444  $tpl->parseCurrentBlock();
445 // $tpl->setCurrentBlock("def_list");
446 
448 
449  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
450 
451  for ($j = 0; $j < count($defs); $j++) {
452  $def = $defs[$j];
453  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
454  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
455  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
456  $page_gui->setTemplateOutput(false);
457  $output = $page_gui->preview();
458 
459  if (count($defs) > 1) {
460  $tpl->setCurrentBlock("definition_header");
461  $tpl->setVariable(
462  "TXT_DEFINITION",
463  $this->lng->txt("cont_definition") . " " . ($j + 1)
464  );
465  $tpl->parseCurrentBlock();
466  }
467 
468  if ($j > 0) {
469  $tpl->setCurrentBlock("up");
470  $tpl->setVariable("TXT_UP", $this->lng->txt("up"));
471  $this->ctrl->setParameter($this, "def", $def["id"]);
472  $tpl->setVariable(
473  "LINK_UP",
474  $this->ctrl->getLinkTarget($this, "moveUp")
475  );
476  $tpl->parseCurrentBlock();
477  }
478 
479  if ($j + 1 < count($defs)) {
480  $tpl->setCurrentBlock("down");
481  $tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
482  $this->ctrl->setParameter($this, "def", $def["id"]);
483  $tpl->setVariable(
484  "LINK_DOWN",
485  $this->ctrl->getLinkTarget($this, "moveDown")
486  );
487  $tpl->parseCurrentBlock();
488  }
489  $tpl->setCurrentBlock("submit_btns");
490  $tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
491  $this->ctrl->setParameter($this, "def", $def["id"]);
492  $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
493  $tpl->setVariable(
494  "LINK_EDIT",
495  $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit")
496  );
497  $tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
498  $tpl->setVariable(
499  "LINK_DELETE",
500  $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion")
501  );
502  $tpl->parseCurrentBlock();
503 
504  $tpl->setCurrentBlock("definition");
505  $tpl->setVariable("PAGE_CONTENT", $output);
506  $tpl->parseCurrentBlock();
507  }
508 
509  $this->tpl->setContent($tpl->get());
510 
511  //$this->tpl->setCurrentBlock("def_list");
512  //$this->tpl->parseCurrentBlock();
513 
514  $this->quickList();
515  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getDefinitionList($a_term_id)
static
$_GET["client_id"]
displayLocator()
display locator
quickList()
Set quick term list cmd into left navigation URL.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getSyntaxStylePath()
get syntax style path
Glossary definition page GUI class.
+ Here is the call graph for this function:

◆ listUsages()

ilGlossaryTermGUI::listUsages ( )

List usage.

Definition at line 773 of file class.ilGlossaryTermGUI.php.

References $_GET, $tab, $tabs_gui, $tpl, displayLocator(), ilUtil\getImagePath(), quickList(), and setTabs().

774  {
775  $ilTabs = $this->tabs_gui;
776  $tpl = $this->tpl;
777 
778  //$this->displayLocator();
779  // $this->getTemplate();
780  $this->displayLocator();
781  $this->setTabs();
782  $ilTabs->activateTab("usage");
783 
784  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
785  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
786 
787  $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
788 
789  $tpl->setContent($tab->getHTML());
790 
791  $this->quickList();
792  }
$_GET["client_id"]
TableGUI class for media object usages listing.
displayLocator()
display locator
quickList()
Set quick term list cmd into left navigation URL.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ moveDown()

ilGlossaryTermGUI::moveDown ( )

move definition downwards

Definition at line 598 of file class.ilGlossaryTermGUI.php.

References $_GET.

599  {
600  $definition = new ilGlossaryDefinition($_GET["def"]);
601  $definition->moveDown();
602  $this->ctrl->redirect($this, "listDefinitions");
603  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

move definition upwards

Definition at line 587 of file class.ilGlossaryTermGUI.php.

References $_GET.

588  {
589  $definition = new ilGlossaryDefinition($_GET["def"]);
590  $definition->moveUp();
591  $this->ctrl->redirect($this, "listDefinitions");
592  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ output()

ilGlossaryTermGUI::output (   $a_offline = false,
  $a_tpl = "",
  $a_outputmode = "presentation" 
)

output glossary term definitions

used in ilLMPresentationGUI->ilGlossary()

Definition at line 336 of file class.ilGlossaryTermGUI.php.

References $_GET, $tpl, ilGlossaryDefinition\getDefinitionList(), ilMathJax\getInstance(), and getOfflineDirectory().

Referenced by getOverlayHTML().

337  {
338  if ($a_tpl != "") {
339  $tpl = $a_tpl;
340  } else {
341  $tpl = $this->tpl;
342  }
343 
344  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
345 
346  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
347 
348  for ($j = 0; $j < count($defs); $j++) {
349  $def = $defs[$j];
350  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
351  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
352  if (!$a_offline) {
353  //$page_gui->setFullscreenLink(
354  // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
355  } else {
356  $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
357  }
358  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=" . $_GET["ref_id"]);
359 
360  if (!$a_offline) {
361  $page_gui->setOutputMode($a_outputmode);
362  } else {
363  $page_gui->setOutputMode("offline");
364  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
365  }
366 
367  //$page_gui->setOutputMode("edit");
368  //$page_gui->setPresentationTitle($this->term->getTerm());
369  $page_gui->setPageLinker($this->page_linker);
370  $page_gui->setTemplateOutput(false);
371  $output = $page_gui->presentation($page_gui->getOutputMode());
372 
373  if (count($defs) > 1) {
374  $tpl->setCurrentBlock("definition_header");
375  $tpl->setVariable(
376  "TXT_DEFINITION",
377  $this->lng->txt("cont_definition") . " " . ($j + 1)
378  );
379  $tpl->parseCurrentBlock();
380  }
381 
382  ilMathJax::getInstance()->includeMathJax($tpl);
383 
384  $tpl->setCurrentBlock("definition");
385  $tpl->setVariable("PAGE_CONTENT", $output);
386  $tpl->parseCurrentBlock();
387  }
388  }
static getDefinitionList($a_term_id)
static
$_GET["client_id"]
static getInstance()
Singleton: get instance.
Glossary definition page GUI class.
getOfflineDirectory()
get offline directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quickList()

ilGlossaryTermGUI::quickList ( )

Set quick term list cmd into left navigation URL.

Definition at line 797 of file class.ilGlossaryTermGUI.php.

References $tab, and $tpl.

Referenced by editTerm(), executeCommand(), listDefinitions(), and listUsages().

798  {
799  $tpl = $this->tpl;
800 
801  $tab = new ilTermQuickListTableGUI($this, "editTerm");
802  $tpl->setLeftNavContent($tab->getHTML());
803  }
+ Here is the caller graph for this function:

◆ saveDefinition()

ilGlossaryTermGUI::saveDefinition ( )

save definition

Definition at line 628 of file class.ilGlossaryTermGUI.php.

References $_GET, $_POST, and ilUtil\stripSlashes().

629  {
630  $def = new ilGlossaryDefinition();
631  $def->setTermId($_GET["term_id"]);
632  $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
633  $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
634  $def->create();
635 
636  $this->ctrl->redirect($this, "listDefinitions");
637  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class ilGlossaryDefinition.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveTerm()

ilGlossaryTermGUI::saveTerm ( )

save term

Definition at line 173 of file class.ilGlossaryTermGUI.php.

174  {
175  // deprecated
176  }

◆ setGlossary()

ilGlossaryTermGUI::setGlossary (   $a_glossary)

Definition at line 149 of file class.ilGlossaryTermGUI.php.

150  {
151  $this->glossary = $a_glossary;
152  if (!is_object($this->term_glossary)) {
153  $this->term_glossary = $a_glossary;
154  }
155  }

◆ setOfflineDirectory()

ilGlossaryTermGUI::setOfflineDirectory (   $offdir)

set offline directory to offdir

Parameters
offdircontains diretory where to store files

Definition at line 133 of file class.ilGlossaryTermGUI.php.

134  {
135  $this->offline_directory = $offdir;
136  }

◆ setPageLinker()

ilGlossaryTermGUI::setPageLinker (   $page_linker)

Definition at line 157 of file class.ilGlossaryTermGUI.php.

References $page_linker.

158  {
159  $this->page_linker = $page_linker;
160  }

◆ setTabs()

ilGlossaryTermGUI::setTabs ( )

output tabs

Definition at line 642 of file class.ilGlossaryTermGUI.php.

References getTabs().

Referenced by confirmDefinitionDeletion(), editTerm(), executeCommand(), listDefinitions(), and listUsages().

643  {
644  $this->getTabs();
645  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateTerm()

ilGlossaryTermGUI::updateTerm ( )

update term

Definition at line 266 of file class.ilGlossaryTermGUI.php.

References $_POST, ilTaxNodeAssignment\deleteAssignmentsOfItem(), editTerm(), getEditTermForm(), and ilUtil\stripSlashes().

267  {
268  $form = $this->getEditTermForm();
269  if ($form->checkInput() &&
270  $this->record_gui->importEditFormPostValues()) {
271  // update term
272  $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
273  $this->term->setLanguage($_POST["term_language"]);
274  $this->term->update();
275 
276  // update taxonomy assignment
277  if ($this->term_glossary->getTaxonomyId() > 0) {
278  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
279  $ta->deleteAssignmentsOfItem($this->term->getId());
280  if (is_array($_POST["tax_node"])) {
281  foreach ($_POST["tax_node"] as $node_id) {
282  $ta->addAssignment($node_id, $this->term->getId());
283  }
284  }
285  }
286 
287  $this->record_gui->writeEditForm();
288  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
289  $this->ctrl->redirect($this, "editTerm");
290  }
291 
292  $form->setValuesByPost();
293  $this->editTerm($form);
294  }
editTerm(ilPropertyFormGUI $a_form=null)
Edit term.
Taxonomy node <-> item assignment.
getEditTermForm()
Get edit term form.
deleteAssignmentsOfItem($a_item_id)
Delete assignments of item.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilGlossaryTermGUI::$ctrl
protected

Definition at line 17 of file class.ilGlossaryTermGUI.php.

Referenced by addDefinition(), editTerm(), and getEditTermForm().

◆ $glossary

ilGlossaryTermGUI::$glossary

Definition at line 36 of file class.ilGlossaryTermGUI.php.

◆ $help

ilGlossaryTermGUI::$help
protected

Definition at line 27 of file class.ilGlossaryTermGUI.php.

Referenced by getTabs().

◆ $link_xml

ilGlossaryTermGUI::$link_xml

Definition at line 38 of file class.ilGlossaryTermGUI.php.

◆ $lng

ilGlossaryTermGUI::$lng

Definition at line 34 of file class.ilGlossaryTermGUI.php.

Referenced by __construct(), _goto(), getOverlayHTML(), and getTabs().

◆ $log

ilGlossaryTermGUI::$log
protected

Definition at line 43 of file class.ilGlossaryTermGUI.php.

◆ $page_linker

ilGlossaryTermGUI::$page_linker
protected

Definition at line 32 of file class.ilGlossaryTermGUI.php.

Referenced by setPageLinker().

◆ $tabs_gui

ilGlossaryTermGUI::$tabs_gui
protected

◆ $term

ilGlossaryTermGUI::$term

Definition at line 37 of file class.ilGlossaryTermGUI.php.

Referenced by getEditTermForm().

◆ $term_glossary

ilGlossaryTermGUI::$term_glossary = null
protected

Definition at line 48 of file class.ilGlossaryTermGUI.php.

◆ $tpl

ilGlossaryTermGUI::$tpl

The documentation for this class was generated from the following file: