ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 
 $toolbar
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryTermGUI::__construct (   $a_id = 0)

Constructor public.

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

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

60  {
61  global $DIC;
62 
63  $this->help = $DIC["ilHelp"];
64  $lng = $DIC->language();
65  $tpl = $DIC["tpl"];
66  $ilCtrl = $DIC->ctrl();
67  $ilTabs = $DIC->tabs();
68 
69  $this->lng = $lng;
70  $this->tpl = $tpl;
71  $this->ctrl = $ilCtrl;
72  $this->ctrl->saveParameter($this, array("term_id"));
73  $this->tabs_gui = $ilTabs;
74 
75  $this->log = ilLoggerFactory::getLogger('glo');
76 
77  $this->toolbar = $DIC->toolbar();
78 
79  $this->ref_id = $_GET["ref_id"];
80 
81  if ($a_id != 0) {
82  $this->term = new ilGlossaryTerm($a_id);
83  if (ilObject::_lookupObjectId($this->ref_id) == ilGlossaryTerm::_lookGlossaryID($a_id)) {
84  $this->term_glossary = new ilObjGlossary($this->ref_id, true);
85  } else {
86  $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($a_id), false);
87  }
88  }
89  }
$_GET["client_id"]
Glossary terms.
Class ilObjGlossary.
static _lookupObjectId($a_ref_id)
lookup object id
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
static _lookGlossaryID($term_id)
get glossary id form term id
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 738 of file class.ilGlossaryTermGUI.php.

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

739  {
740  global $DIC;
741 
742  $rbacsystem = $DIC->rbac()->system();
743  $ilErr = $DIC["ilErr"];
744  $lng = $DIC->language();
745  $ilAccess = $DIC->access();
746 
747  $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
748 
749  // get all references
750  if ($a_ref_id > 0) {
751  $ref_ids = array($a_ref_id);
752  } else {
753  $ref_ids = ilObject::_getAllReferences($glo_id);
754  }
755 
756  // check read permissions
757  foreach ($ref_ids as $ref_id) {
758  // Permission check
759  if ($ilAccess->checkAccess("read", "", $ref_id)) {
760  $_GET["baseClass"] = "ilGlossaryPresentationGUI";
761  $_GET["term_id"] = $a_target;
762  $_GET["ref_id"] = $ref_id;
763  $_GET["cmd"] = "listDefinitions";
764  include_once("ilias.php");
765  exit;
766  }
767  }
768  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
769  ilUtil::sendFailure(sprintf(
770  $lng->txt("msg_no_perm_read_item"),
771  ilObject::_lookupTitle($glo_id)
772  ), true);
774  }
775 
776 
777  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
778  }
exit
Definition: login.php:29
const ROOT_FOLDER_ID
Definition: constants.php:30
$_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
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookGlossaryID($term_id)
get glossary id form term id
+ Here is the call graph for this function:

◆ addDefinition()

ilGlossaryTermGUI::addDefinition ( )

add definition

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

References $ctrl.

620  {
621  $ilCtrl = $this->ctrl;
622 
623  $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
624  $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
625  }

◆ cancel()

ilGlossaryTermGUI::cancel ( )

cancel adding definition

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

631  {
632  $this->ctrl->redirect($this, "listDefinitions");
633  }

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

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

581  {
582  $this->ctrl->redirect($this, "listDefinitions");
583  }

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

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

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

532  {
533  $ilTabs = $this->tabs_gui;
534 
535  //$this->getTemplate();
536  $this->displayLocator();
537  $this->setTabs();
538  $ilTabs->activateTab("definitions");
539 
540  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
541  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
542 
543  $this->tpl->setTitle(
544  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
545  );
546  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
547 
548  $dtpl = new ilTemplate("tpl.glossary_definition_delete.html", true, true, "Modules/Glossary");
549  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
550 
551  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
552 
553  $definition = new ilGlossaryDefinition($_GET["def"]);
554  $page_gui = new ilGlossaryDefPageGUI($definition->getId());
555  $page_gui->setTemplateOutput(false);
556  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
557  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
558  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
559  $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
560  $output = $page_gui->preview();
561 
562  $dtpl->setCurrentBlock("definition");
563  $dtpl->setVariable("PAGE_CONTENT", $output);
564  $dtpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
565  $dtpl->setVariable(
566  "LINK_CANCEL",
567  $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion")
568  );
569  $dtpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
570  $this->ctrl->setParameter($this, "def", $definition->getId());
571  $dtpl->setVariable(
572  "LINK_CONFIRM",
573  $this->ctrl->getLinkTarget($this, "deleteDefinition")
574  );
575  $dtpl->parseCurrentBlock();
576 
577  $this->tpl->setContent($dtpl->get());
578  }
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 172 of file class.ilGlossaryTermGUI.php.

173  {
174  // deprecated
175  }

◆ deleteDefinition()

ilGlossaryTermGUI::deleteDefinition ( )

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

References $_GET.

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

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

display locator

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

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

661  {
662  $gloss_loc = new ilGlossaryLocatorGUI();
663  $gloss_loc->setTerm($this->term);
664  $gloss_loc->setGlossary($this->glossary);
665  //$gloss_loc->setDefinition($this->definition);
666  $gloss_loc->display();
667  }
+ Here is the caller graph for this function:

◆ editTerm()

ilGlossaryTermGUI::editTerm ( ilPropertyFormGUI  $a_form = null)

Edit term.

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

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

Referenced by updateTerm().

190  {
191  $ilTabs = $this->tabs_gui;
192  $ilCtrl = $this->ctrl;
193 
194  // $this->getTemplate();
195  $this->displayLocator();
196  $this->setTabs();
197  $ilTabs->activateTab("properties");
198 
199  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
200  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
201 
202  if (!$a_form) {
203  $a_form = $this->getEditTermForm();
204  }
205 
206  $this->tpl->setContent($ilCtrl->getHTML($a_form));
207 
208  $this->quickList();
209  }
displayLocator()
display locator
getEditTermForm()
Get edit term form.
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 94 of file class.ilGlossaryTermGUI.php.

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

95  {
96  $ilTabs = $this->tabs_gui;
97 
98  $next_class = $this->ctrl->getNextClass($this);
99  $cmd = $this->ctrl->getCmd();
100 
101  $this->log->debug("glossary term, next class " . $next_class . ", cmd: " . $cmd);
102 
103  switch ($next_class) {
104  case "iltermdefinitioneditorgui":
105  //$this->ctrl->setReturn($this, "listDefinitions");
106  $def_edit = new ilTermDefinitionEditorGUI();
107  //$ret = $def_edit->executeCommand();
108  $ret = $this->ctrl->forwardCommand($def_edit);
109  $this->quickList("edit", $def_edit);
110  break;
111 
112  case "ilpropertyformgui":
113  $form = $this->getEditTermForm();
114  $this->ctrl->forwardCommand($form);
115  break;
116 
117  case "ilobjectmetadatagui":
118  $this->setTabs();
119  $ilTabs->activateTab('meta_data');
120  $md_gui = new ilObjectMetaDataGUI(
121  $this->term_glossary,
122  'term',
123  $this->term->getId()
124  );
125  $this->ctrl->forwardCommand($md_gui);
126  $this->quickList();
127  break;
128 
129  default:
130  $ret = $this->$cmd();
131  break;
132  }
133  }
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 217 of file class.ilGlossaryTermGUI.php.

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

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

218  {
219  $ilTabs = $this->tabs_gui;
220  $ilCtrl = $this->ctrl;
221 
222  $form = new ilPropertyFormGUI();
223  $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
224  $form->setTitle($this->lng->txt("cont_edit_term"));
225 
226  $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
227  $term->setRequired(true);
228  $term->setValue($this->term->getTerm());
229  $form->addItem($term);
230 
231  $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
232  $lang->setRequired(true);
233  $lang->setOptions(ilMDLanguageItem::_getLanguages());
234  $lang->setValue($this->term->getLanguage());
235  $form->addItem($lang);
236 
237  // taxonomy
238  if ($this->term_glossary->getTaxonomyId() > 0) {
239  $tax_node_assign = new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), "tax_node", true);
240 
241  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
242  $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
243  $node_ids = array();
244  foreach ($assgnmts as $a) {
245  $node_ids[] = $a["node_id"];
246  }
247  $tax_node_assign->setValue($node_ids);
248 
249  $form->addItem($tax_node_assign);
250  }
251 
252  // advanced metadata
253  $this->record_gui = new ilAdvancedMDRecordGUI(
255  'glo',
256  $this->term_glossary->getId(),
257  'term',
258  $this->term->getId()
259  );
260  $this->record_gui->setPropertyForm($form);
261  $this->record_gui->parse();
262 
263  $form->addCommandButton("updateTerm", $this->lng->txt("save"));
264 
265  return $form;
266  }
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.
This class represents a property form user interface.
setPropertyForm($form)
set property form object
$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 400 of file class.ilGlossaryTermGUI.php.

References ilGlossaryDefinition\getDefinitionList().

401  {
402  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
403 
404  $term_links = array();
405  for ($j = 0; $j < count($defs); $j++) {
406  $def = $defs[$j];
407  $page = new ilGlossaryDefPage($def["id"]);
408  $page->buildDom();
409  $page_links = $page->getInternalLinks();
410  foreach ($page_links as $key => $page_link) {
411  $term_links[$key] = $page_link;
412  }
413  }
414 
415  return $term_links;
416  }
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 150 of file class.ilGlossaryTermGUI.php.

Referenced by output().

151  {
152  return $this->offline_directory;
153  }
+ 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 309 of file class.ilGlossaryTermGUI.php.

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

310  {
311  $lng = $this->lng;
312 
313  if ($a_lang == "") {
314  $a_lang = $lng->getLangKey();
315  }
316 
317  $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
318  // $this->output(true, $tpl);
319  if ($a_outputmode == "preview") {
320  $a_outputmode = "presentation";
321  }
322  if ($a_outputmode == "offline") {
323  $this->output(true, $tpl, $a_outputmode);
324  } else {
325  $this->output(false, $tpl, $a_outputmode);
326  }
327  if ($a_glo_ov_id != "") {
328  $tpl->setCurrentBlock("glovlink");
329  $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
330  $tpl->setVariable("ID_LINK", $a_glo_ov_id);
331  $tpl->parseCurrentBlock();
332  }
333  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
334  $tpl->setVariable("ID_CLOSE", $a_close_el_id);
335  return $tpl->get();
336  }
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 673 of file class.ilGlossaryTermGUI.php.

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

Referenced by setTabs().

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

◆ listDefinitions()

ilGlossaryTermGUI::listDefinitions ( )

list definitions

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

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

422  {
423  $ilTabs = $this->tabs_gui;
424 
425  // $this->getTemplate();
426  $this->displayLocator();
427  $this->setTabs();
428  $ilTabs->activateTab("definitions");
429 
430  // content style
431  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
432  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
433 
434 
435  // load template for table
436  $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
437 
438  $this->tpl->setTitle(
439  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
440  );
441  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
442 
443  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
444 
445  $tpl->setCurrentBlock("add_def");
446  $tpl->setVariable(
447  "TXT_ADD_DEFINITION",
448  $this->lng->txt("cont_add_definition")
449  );
450  $tpl->setVariable("BTN_ADD", "addDefinition");
451  $tpl->parseCurrentBlock();
452 // $tpl->setCurrentBlock("def_list");
453 
455 
456  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
457 
458  for ($j = 0; $j < count($defs); $j++) {
459  $def = $defs[$j];
460  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
461  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
462  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
463  $page_gui->setTemplateOutput(false);
464  $output = $page_gui->preview();
465 
466  if (count($defs) > 1) {
467  $tpl->setCurrentBlock("definition_header");
468  $tpl->setVariable(
469  "TXT_DEFINITION",
470  $this->lng->txt("cont_definition") . " " . ($j + 1)
471  );
472  $tpl->parseCurrentBlock();
473  }
474 
475  if ($j > 0) {
476  $tpl->setCurrentBlock("up");
477  $tpl->setVariable("TXT_UP", $this->lng->txt("up"));
478  $this->ctrl->setParameter($this, "def", $def["id"]);
479  $tpl->setVariable(
480  "LINK_UP",
481  $this->ctrl->getLinkTarget($this, "moveUp")
482  );
483  $tpl->parseCurrentBlock();
484  }
485 
486  if ($j + 1 < count($defs)) {
487  $tpl->setCurrentBlock("down");
488  $tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
489  $this->ctrl->setParameter($this, "def", $def["id"]);
490  $tpl->setVariable(
491  "LINK_DOWN",
492  $this->ctrl->getLinkTarget($this, "moveDown")
493  );
494  $tpl->parseCurrentBlock();
495  }
496  $tpl->setCurrentBlock("submit_btns");
497  $tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
498  $this->ctrl->setParameter($this, "def", $def["id"]);
499  $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
500  $tpl->setVariable(
501  "LINK_EDIT",
502  $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit")
503  );
504  $tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
505  $tpl->setVariable(
506  "LINK_DELETE",
507  $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion")
508  );
509  $tpl->parseCurrentBlock();
510 
511  $tpl->setCurrentBlock("definition");
512  $tpl->setVariable("PAGE_CONTENT", $output);
513  $tpl->parseCurrentBlock();
514  }
515 
516  // remove default "edit" entry from page preview
517  $this->toolbar->setItems([]);
518 
519  $this->tpl->setContent($tpl->get());
520 
521  //$this->tpl->setCurrentBlock("def_list");
522  //$this->tpl->parseCurrentBlock();
523 
524  $this->quickList();
525  }
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 783 of file class.ilGlossaryTermGUI.php.

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

784  {
785  $ilTabs = $this->tabs_gui;
786  $tpl = $this->tpl;
787 
788  //$this->displayLocator();
789  // $this->getTemplate();
790  $this->displayLocator();
791  $this->setTabs();
792  $ilTabs->activateTab("usage");
793 
794  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
795  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
796 
797  $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
798 
799  $tpl->setContent($tab->getHTML());
800 
801  $this->quickList();
802  }
$_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 608 of file class.ilGlossaryTermGUI.php.

References $_GET.

609  {
610  $definition = new ilGlossaryDefinition($_GET["def"]);
611  $definition->moveDown();
612  $this->ctrl->redirect($this, "listDefinitions");
613  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

move definition upwards

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

References $_GET.

598  {
599  $definition = new ilGlossaryDefinition($_GET["def"]);
600  $definition->moveUp();
601  $this->ctrl->redirect($this, "listDefinitions");
602  }
$_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 343 of file class.ilGlossaryTermGUI.php.

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

Referenced by getOverlayHTML().

344  {
345  if ($a_tpl != "") {
346  $tpl = $a_tpl;
347  } else {
348  $tpl = $this->tpl;
349  }
350 
351  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
352 
353  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
354 
355  for ($j = 0; $j < count($defs); $j++) {
356  $def = $defs[$j];
357  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
358  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
359  if (!$a_offline) {
360  //$page_gui->setFullscreenLink(
361  // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
362  } else {
363  $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
364  }
365  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=" . $_GET["ref_id"]);
366 
367  if (!$a_offline) {
368  $page_gui->setOutputMode($a_outputmode);
369  } else {
370  $page_gui->setOutputMode("offline");
371  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
372  }
373 
374  //$page_gui->setOutputMode("edit");
375  //$page_gui->setPresentationTitle($this->term->getTerm());
376  $page_gui->setPageLinker($this->page_linker);
377  $page_gui->setTemplateOutput(false);
378  $output = $page_gui->presentation($page_gui->getOutputMode());
379 
380  if (count($defs) > 1) {
381  $tpl->setCurrentBlock("definition_header");
382  $tpl->setVariable(
383  "TXT_DEFINITION",
384  $this->lng->txt("cont_definition") . " " . ($j + 1)
385  );
386  $tpl->parseCurrentBlock();
387  }
388 
389  ilMathJax::getInstance()->includeMathJax($tpl);
390 
391  $tpl->setCurrentBlock("definition");
392  $tpl->setVariable("PAGE_CONTENT", $output);
393  $tpl->parseCurrentBlock();
394  }
395  }
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 807 of file class.ilGlossaryTermGUI.php.

References $tpl.

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

808  {
809  $tpl = $this->tpl;
810 
811  $tab = new ilTermQuickListTableGUI($this, "editTerm");
812  $tpl->setLeftNavContent($tab->getHTML());
813  }
+ Here is the caller graph for this function:

◆ saveDefinition()

ilGlossaryTermGUI::saveDefinition ( )

save definition

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

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

639  {
640  $def = new ilGlossaryDefinition();
641  $def->setTermId($_GET["term_id"]);
642  $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
643  $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
644  $def->create();
645 
646  $this->ctrl->redirect($this, "listDefinitions");
647  }
$_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 180 of file class.ilGlossaryTermGUI.php.

181  {
182  // deprecated
183  }

◆ setGlossary()

ilGlossaryTermGUI::setGlossary (   $a_glossary)

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

157  {
158  $this->glossary = $a_glossary;
159  if (!is_object($this->term_glossary)) {
160  $this->term_glossary = $a_glossary;
161  }
162  }

◆ setOfflineDirectory()

ilGlossaryTermGUI::setOfflineDirectory (   $offdir)

set offline directory to offdir

Parameters
offdircontains diretory where to store files

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

141  {
142  $this->offline_directory = $offdir;
143  }

◆ setPageLinker()

ilGlossaryTermGUI::setPageLinker (   $page_linker)

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

References $page_linker.

165  {
166  $this->page_linker = $page_linker;
167  }

◆ setTabs()

ilGlossaryTermGUI::setTabs ( )

output tabs

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

References getTabs().

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

653  {
654  $this->getTabs();
655  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateTerm()

ilGlossaryTermGUI::updateTerm ( )

update term

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

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

274  {
275  $form = $this->getEditTermForm();
276  if ($form->checkInput() &&
277  $this->record_gui->importEditFormPostValues()) {
278  // update term
279  $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
280  $this->term->setLanguage($_POST["term_language"]);
281  $this->term->update();
282 
283  // update taxonomy assignment
284  if ($this->term_glossary->getTaxonomyId() > 0) {
285  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
286  $ta->deleteAssignmentsOfItem($this->term->getId());
287  if (is_array($_POST["tax_node"])) {
288  foreach ($_POST["tax_node"] as $node_id) {
289  $ta->addAssignment($node_id, $this->term->getId());
290  }
291  }
292  }
293 
294  $this->record_gui->writeEditForm();
295  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
296  $this->ctrl->redirect($this, "editTerm");
297  }
298 
299  $form->setValuesByPost();
300  $this->editTerm($form);
301  }
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.

◆ $toolbar

ilGlossaryTermGUI::$toolbar
protected

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

◆ $tpl

ilGlossaryTermGUI::$tpl

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