ILIAS  release_8 Revision v8.24
ilGlossaryTermGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilGlossaryTermGUI:

Public Member Functions

 __construct (int $a_id=0)
 
 executeCommand ()
 
 setOfflineDirectory (string $offdir)
 
 getOfflineDirectory ()
 
 setGlossary (ilObjGlossary $a_glossary)
 
 setPageLinker (\ILIAS\COPage\PageLinker $page_linker)
 
 editTerm (ilPropertyFormGUI $a_form=null)
 
 getEditTermForm ()
 
 updateTerm ()
 
 getOverlayHTML (string $a_close_el_id, string $a_glo_ov_id="", string $a_lang="", string $a_outputmode="offline")
 
 output (bool $a_offline=false, ilGlobalTemplateInterface $a_tpl=null, string $a_outputmode="presentation")
 output glossary term definitions used in ilLMPresentationGUI->ilGlossary() More...
 
 getInternalLinks ()
 
 listDefinitions ()
 
 confirmDefinitionDeletion ()
 
 cancelDefinitionDeletion ()
 
 deleteDefinition ()
 
 moveUp ()
 
 moveDown ()
 
 addDefinition ()
 
 cancel ()
 
 setTabs ()
 
 displayLocator ()
 
 getTabs ()
 
 listUsages ()
 
 quickList ()
 Set quick term list cmd into left navigation URL. More...
 

Static Public Member Functions

static _goto (string $a_target, int $a_ref_id=0)
 

Data Fields

ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilObjGlossary $glossary
 
ilGlossaryTerm $term
 

Protected Attributes

ilAdvancedMDRecordGUI $record_gui
 
int $ref_id
 
ILIAS Glossary Editing EditingGUIRequest $request
 
string $offline_directory
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilHelpGUI $help
 
ILIAS COPage PageLinker $page_linker
 
ilLogger $log
 
ilObjGlossary $term_glossary = null
 
ilToolbarGUI $toolbar
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content DomainService $content_style_domain
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning GUI class for glossary terms

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilGlossaryTermGUI: ilTermDefinitionEditorGUI, ilGlossaryDefPageGUI, ilPropertyFormGUI @ilCtrl_Calls ilGlossaryTermGUI: ilObjectMetaDataGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryTermGUI::__construct ( int  $a_id = 0)

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

47 {
48 global $DIC;
49
50 $this->help = $DIC["ilHelp"];
51 $lng = $DIC->language();
52 $tpl = $DIC["tpl"];
53 $ilCtrl = $DIC->ctrl();
54 $ilTabs = $DIC->tabs();
55
56 $this->lng = $lng;
57 $this->tpl = $tpl;
58 $this->ctrl = $ilCtrl;
59 $this->ctrl->saveParameter($this, array("term_id"));
60 $this->tabs_gui = $ilTabs;
61 $this->request = $DIC->glossary()
62 ->internal()
63 ->gui()
64 ->editing()
65 ->request();
66
67 $this->log = ilLoggerFactory::getLogger('glo');
68
69 $this->toolbar = $DIC->toolbar();
70
71 $this->ref_id = $this->request->getRefId();
72
73 if ($a_id != 0) {
74 $this->term = new ilGlossaryTerm($a_id);
76 $this->term_glossary = new ilObjGlossary($this->ref_id, true);
77 } else {
78 $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($a_id), false);
79 }
80 }
81 $cs = $DIC->contentStyle();
82 $this->content_style_gui = $cs->gui();
83 $this->content_style_domain = $cs->domain();
84 }
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookGlossaryID(int $term_id)
get glossary id form term id
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjectId(int $ref_id)
global $DIC
Definition: feed.php:28

References $DIC, $lng, $tpl, ilGlossaryTerm\_lookGlossaryID(), ilObject\_lookupObjectId(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilGlossaryTermGUI::_goto ( string  $a_target,
int  $a_ref_id = 0 
)
static

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

641 : void {
642 global $DIC;
643 $main_tpl = $DIC->ui()->mainTemplate();
644
645 $ctrl = $DIC->ctrl();
646 $lng = $DIC->language();
647 $ilAccess = $DIC->access();
648
649 $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
650
651 // get all references
652 if ($a_ref_id > 0) {
653 $ref_ids = array($a_ref_id);
654 } else {
655 $ref_ids = ilObject::_getAllReferences($glo_id);
656 }
657
658 // check read permissions
659 foreach ($ref_ids as $ref_id) {
660 // Permission check
661 if ($ilAccess->checkAccess("read", "", $ref_id)) {
662 $ctrl->setParameterByClass("ilGlossaryPresentationGUI", "term_id", $a_target);
663 $ctrl->setParameterByClass("ilGlossaryPresentationGUI", "ref_id", $ref_id);
664 $ctrl->redirectByClass("ilGlossaryPresentationGUI", "listDefinitions");
665 }
666 }
667 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
668 $main_tpl->setOnScreenMessage('failure', sprintf(
669 $lng->txt("msg_no_perm_read_item"),
671 ), true);
673 }
674
675 throw new ilPermissionException($lng->txt("msg_no_perm_read_lm"));
676 }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ROOT_FOLDER_ID
Definition: constants.php:32

◆ addDefinition()

ilGlossaryTermGUI::addDefinition ( )

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

554 : void
555 {
556 $ilCtrl = $this->ctrl;
557
558 $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
559 $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
560 }

◆ cancel()

ilGlossaryTermGUI::cancel ( )

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

562 : void
563 {
564 $this->ctrl->redirect($this, "listDefinitions");
565 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

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

527 : void
528 {
529 $this->ctrl->redirect($this, "listDefinitions");
530 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

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

470 : void
471 {
472 $ilTabs = $this->tabs_gui;
473
474 //$this->getTemplate();
475 $this->displayLocator();
476 $this->setTabs();
477 $ilTabs->activateTab("definitions");
478
479 $this->content_style_gui->addCss(
480 $this->tpl,
481 $this->term_glossary->getRefId(),
482 $this->term_glossary->getId()
483 );
484 $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
485
486 $this->tpl->setTitle(
487 $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
488 );
489 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
490
491 $dtpl = new ilTemplate("tpl.glossary_definition_delete.html", true, true, "Modules/Glossary");
492 $this->tpl->setOnScreenMessage('question', $this->lng->txt("info_delete_sure"));
493
494 $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
495
496 $definition = new ilGlossaryDefinition($this->request->getDefinitionId());
497 $page_gui = new ilGlossaryDefPageGUI($definition->getId());
498 $page_gui->setTemplateOutput(false);
499 $page_gui->setStyleId(
500 $this->content_style_domain->styleForObjId(
501 $this->term_glossary->getId()
502 )->getEffectiveStyleId()
503 );
504 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $this->ref_id);
505 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $this->ref_id);
506 $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $this->ref_id);
507 $output = $page_gui->preview();
508
509 $dtpl->setCurrentBlock("definition");
510 $dtpl->setVariable("PAGE_CONTENT", $output);
511 $dtpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
512 $dtpl->setVariable(
513 "LINK_CANCEL",
514 $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion")
515 );
516 $dtpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
517 $this->ctrl->setParameter($this, "def", $definition->getId());
518 $dtpl->setVariable(
519 "LINK_CONFIRM",
520 $this->ctrl->getLinkTarget($this, "deleteDefinition")
521 );
522 $dtpl->parseCurrentBlock();
523
524 $this->tpl->setContent($dtpl->get());
525 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilObjStyleSheet\getSyntaxStylePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ deleteDefinition()

ilGlossaryTermGUI::deleteDefinition ( )

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

533 : void
534 {
535 $definition = new ilGlossaryDefinition($this->request->getDefinitionId());
536 $definition->delete();
537 $this->ctrl->redirect($this, "listDefinitions");
538 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

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

572 : void
573 {
574 $gloss_loc = new ilGlossaryLocatorGUI();
575 $gloss_loc->setTerm($this->term);
576 $gloss_loc->setGlossary($this->glossary);
577 $gloss_loc->display();
578 }

◆ editTerm()

ilGlossaryTermGUI::editTerm ( ilPropertyFormGUI  $a_form = null)

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

151 : void {
152 $ilTabs = $this->tabs_gui;
153 $ilCtrl = $this->ctrl;
154
155 // $this->getTemplate();
156 $this->displayLocator();
157 $this->setTabs();
158 $ilTabs->activateTab("properties");
159
160 $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
161 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
162
163 if (!$a_form) {
164 $a_form = $this->getEditTermForm();
165 }
166
167 $this->tpl->setContent($ilCtrl->getHTML($a_form));
168
169 $this->quickList();
170 }
quickList()
Set quick term list cmd into left navigation URL.

◆ executeCommand()

ilGlossaryTermGUI::executeCommand ( )

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

86 : void
87 {
88 $ilTabs = $this->tabs_gui;
89
90 $next_class = $this->ctrl->getNextClass($this);
91 $cmd = $this->ctrl->getCmd();
92
93 $this->log->debug("glossary term, next class " . $next_class . ", cmd: " . $cmd);
94
95 switch ($next_class) {
96 case "iltermdefinitioneditorgui":
97 $def_edit = new ilTermDefinitionEditorGUI();
98 $this->ctrl->forwardCommand($def_edit);
99 $this->quickList();
100 break;
101
102 case "ilpropertyformgui":
103 $form = $this->getEditTermForm();
104 $this->ctrl->forwardCommand($form);
105 break;
106
107 case "ilobjectmetadatagui":
108 $this->setTabs();
109 $ilTabs->activateTab('meta_data');
110 $md_gui = new ilObjectMetaDataGUI(
111 $this->term_glossary,
112 'term',
113 $this->term->getId()
114 );
115 $this->ctrl->forwardCommand($md_gui);
116 $this->quickList();
117 break;
118
119 default:
120 $ret = $this->$cmd();
121 break;
122 }
123 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $tabs_gui, ILIAS\Repository\ctrl(), getEditTermForm(), quickList(), and setTabs().

+ Here is the call graph for this function:

◆ getEditTermForm()

ilGlossaryTermGUI::getEditTermForm ( )

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

173 {
174 $form = new ilPropertyFormGUI();
175 $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
176 $form->setTitle($this->lng->txt("cont_edit_term"));
177
178 $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
179 $term->setRequired(true);
180 $term->setValue($this->term->getTerm());
181 $form->addItem($term);
182
183 $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
184 $lang->setRequired(true);
186 $lang->setValue($this->term->getLanguage());
187 $form->addItem($lang);
188
189 // taxonomy
190 if ($this->term_glossary->getTaxonomyId() > 0) {
191 $tax_node_assign = new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), "tax_node", true);
192
193 $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
194 $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
195 $node_ids = array();
196 foreach ($assgnmts as $a) {
197 $node_ids[] = $a["node_id"];
198 }
199 $tax_node_assign->setValue($node_ids);
200
201 $form->addItem($tax_node_assign);
202 }
203
204 // advanced metadata
205 $this->record_gui = new ilAdvancedMDRecordGUI(
207 'glo',
208 $this->term_glossary->getId(),
209 'term',
210 $this->term->getId()
211 );
212 $this->record_gui->setPropertyForm($form);
213 $this->record_gui->parse();
214
215 $form->addCommandButton("updateTerm", $this->lng->txt("save"));
216
217 return $form;
218 }
This class represents a property form user interface.
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$lang
Definition: xapiexit.php:26

References Vendor\Package\$a, $lang, ilMDLanguageItem\_getLanguages(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilAdvancedMDRecordGUI\MODE_EDITOR.

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInternalLinks()

ilGlossaryTermGUI::getInternalLinks ( )

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

340 : array
341 {
342 $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
343
344 $term_links = array();
345 for ($j = 0, $jMax = count($defs); $j < $jMax; $j++) {
346 $def = $defs[$j];
347 $page = new ilGlossaryDefPage($def["id"]);
348 $page->buildDom();
349 $page_links = $page->getInternalLinks();
350 foreach ($page_links as $key => $page_link) {
351 $term_links[$key] = $page_link;
352 }
353 }
354
355 return $term_links;
356 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getDefinitionList(int $a_term_id)
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key, and ilGlossaryDefinition\getDefinitionList().

+ Here is the call graph for this function:

◆ getOfflineDirectory()

ilGlossaryTermGUI::getOfflineDirectory ( )

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

130 : string
131 {
133 }

References $offline_directory.

◆ getOverlayHTML()

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

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

253 : string {
255
256 if ($a_lang == "") {
257 $a_lang = $lng->getLangKey();
258 }
259
260 $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
261 // $this->output(true, $tpl);
262 if ($a_outputmode == "preview") {
263 $a_outputmode = "presentation";
264 }
265 if ($a_outputmode == "offline") {
266 $this->output(true, $tpl, $a_outputmode);
267 } else {
268 $this->output(false, $tpl, $a_outputmode);
269 }
270 if ($a_glo_ov_id != "") {
271 $tpl->setCurrentBlock("glovlink");
272 $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
273 $tpl->setVariable("ID_LINK", $a_glo_ov_id);
275 }
276 $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
277 $tpl->setVariable("ID_CLOSE", $a_close_el_id);
278 return $tpl->get();
279 }
output(bool $a_offline=false, ilGlobalTemplateInterface $a_tpl=null, string $a_outputmode="presentation")
output glossary term definitions used in ilLMPresentationGUI->ilGlossary()
getLangKey()
Return lang key.
txtlng(string $a_module, string $a_topic, string $a_language)
gets the text for a given topic in a given language if the topic is not in the list,...
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References $lng.

◆ getTabs()

ilGlossaryTermGUI::getTabs ( )

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

580 : void
581 {
583 $ilHelp = $this->help;
584
585 $ilHelp->setScreenIdComponent("glo_term");
586
587 if ($this->request->getTermId() > 0) {
588 $this->tabs_gui->addTab(
589 "properties",
590 $lng->txt("term"),
591 $this->ctrl->getLinkTarget($this, "editTerm")
592 );
593
594 $this->tabs_gui->addTab(
595 "definitions",
596 $lng->txt("cont_definitions"),
597 $this->ctrl->getLinkTarget($this, "listDefinitions")
598 );
599
600 $this->tabs_gui->addTab(
601 "usage",
602 $lng->txt("cont_usage") . " (" . ilGlossaryTerm::getNumberOfUsages($this->request->getTermId()) . ")",
603 $this->ctrl->getLinkTarget($this, "listUsages")
604 );
605
606 $mdgui = new ilObjectMetaDataGUI(
607 $this->term_glossary,
608 "term",
609 $this->term->getId()
610 );
611 $mdtab = $mdgui->getTab();
612 if ($mdtab) {
613 $this->tabs_gui->addTab(
614 "meta_data",
615 $lng->txt("meta_data"),
616 $mdtab
617 );
618 }
619
620 $this->tabs_gui->addNonTabbedLink(
621 "presentation_view",
622 $this->lng->txt("glo_presentation_view"),
623 ILIAS_HTTP_PATH .
624 "/goto.php?target=" .
625 "git" .
626 "_" . $this->request->getTermId() . "_" . $this->request->getRefId() . "&client_id=" . CLIENT_ID,
627 "_top"
628 );
629 }
630
631 // back to glossary
632 $this->tabs_gui->setBackTarget(
633 $this->lng->txt("glossary"),
634 $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms")
635 );
636 }
static getNumberOfUsages(int $a_term_id)
setScreenIdComponent(string $a_comp)
const CLIENT_ID
Definition: constants.php:41

References $lng, CLIENT_ID, ilGlossaryTerm\getNumberOfUsages(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ listDefinitions()

ilGlossaryTermGUI::listDefinitions ( )

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

358 : void
359 {
360 $ilTabs = $this->tabs_gui;
361
362 // $this->getTemplate();
363 $this->displayLocator();
364 $this->setTabs();
365 $ilTabs->activateTab("definitions");
366
367 // content style
368 $this->content_style_gui->addCss(
369 $this->tpl,
370 $this->term_glossary->getRefId(),
371 $this->term_glossary->getId()
372 );
373 $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
374
375
376 // load template for table
377 $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
378
379 $this->tpl->setTitle(
380 $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
381 );
382 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
383
384 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
385
386 $tpl->setCurrentBlock("add_def");
388 "TXT_ADD_DEFINITION",
389 $this->lng->txt("cont_add_definition")
390 );
391 $tpl->setVariable("BTN_ADD", "addDefinition");
393// $tpl->setCurrentBlock("def_list");
394
396 $this->request->getTermId()
397 );
398
399 $tpl->setVariable("TXT_TERM", $this->term->getTerm());
400
401 for ($j = 0, $jMax = count($defs); $j < $jMax; $j++) {
402 $def = $defs[$j];
403 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
404 $page_gui->setStyleId(
405 $this->content_style_domain->styleForObjId(
406 $this->term_glossary->getId()
407 )->getEffectiveStyleId()
408 );
409 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $this->ref_id);
410 $page_gui->setTemplateOutput(false);
411 $output = $page_gui->preview();
412
413 if (count($defs) > 1) {
414 $tpl->setCurrentBlock("definition_header");
416 "TXT_DEFINITION",
417 $this->lng->txt("cont_definition") . " " . ($j + 1)
418 );
420 }
421
422 if ($j > 0) {
423 $tpl->setCurrentBlock("up");
424 $tpl->setVariable("TXT_UP", $this->lng->txt("up"));
425 $this->ctrl->setParameter($this, "def", $def["id"]);
427 "LINK_UP",
428 $this->ctrl->getLinkTarget($this, "moveUp")
429 );
431 }
432
433 if ($j + 1 < count($defs)) {
434 $tpl->setCurrentBlock("down");
435 $tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
436 $this->ctrl->setParameter($this, "def", $def["id"]);
438 "LINK_DOWN",
439 $this->ctrl->getLinkTarget($this, "moveDown")
440 );
442 }
443 $tpl->setCurrentBlock("submit_btns");
444 $tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
445 $this->ctrl->setParameter($this, "def", $def["id"]);
446 $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
448 "LINK_EDIT",
449 $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit")
450 );
451 $tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
453 "LINK_DELETE",
454 $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion")
455 );
457
458 $tpl->setCurrentBlock("definition");
459 $tpl->setVariable("PAGE_CONTENT", $output);
461 }
462
463 // remove default "edit" entry from page preview
464 $this->toolbar->setItems([]);
465
466 $this->tpl->setContent($tpl->get());
467 $this->quickList();
468 }

References $tpl, ILIAS\Repository\ctrl(), ilGlossaryDefinition\getDefinitionList(), ilUtil\getImagePath(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setVariable(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ listUsages()

ilGlossaryTermGUI::listUsages ( )

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

678 : void
679 {
680 $ilTabs = $this->tabs_gui;
682
683 //$this->displayLocator();
684 // $this->getTemplate();
685 $this->displayLocator();
686 $this->setTabs();
687 $ilTabs->activateTab("usage");
688
689 $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
690 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
691
692 $tab = new ilTermUsagesTableGUI($this, "listUsages", $this->request->getTermId());
693
694 $tpl->setContent($tab->getHTML());
695
696 $this->quickList();
697 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.

References $tpl, ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ moveDown()

ilGlossaryTermGUI::moveDown ( )

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

547 : void
548 {
549 $definition = new ilGlossaryDefinition($this->request->getDefinitionId());
550 $definition->moveDown();
551 $this->ctrl->redirect($this, "listDefinitions");
552 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

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

540 : void
541 {
542 $definition = new ilGlossaryDefinition($this->request->getDefinitionId());
543 $definition->moveUp();
544 $this->ctrl->redirect($this, "listDefinitions");
545 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ output()

ilGlossaryTermGUI::output ( bool  $a_offline = false,
ilGlobalTemplateInterface  $a_tpl = null,
string  $a_outputmode = "presentation" 
)

output glossary term definitions used in ilLMPresentationGUI->ilGlossary()

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

289 : void {
290 if ($a_tpl != null) {
291 $tpl = $a_tpl;
292 } else {
294 }
295
296 $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
297
298 $tpl->setVariable("TXT_TERM", $this->term->getTerm());
299
300 for ($j = 0, $jMax = count($defs); $j < $jMax; $j++) {
301 $def = $defs[$j];
302 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
303 $page_gui->setTemplate($tpl);
304 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $this->ref_id);
305 if ($a_offline) {
306 $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
307 }
308 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=" . $this->ref_id);
309
310 if (!$a_offline) {
311 $page_gui->setOutputMode($a_outputmode);
312 } else {
313 $page_gui->setOutputMode("offline");
314 $page_gui->setOfflineDirectory($this->getOfflineDirectory());
315 }
316
317 //$page_gui->setOutputMode("edit");
318 //$page_gui->setPresentationTitle($this->term->getTerm());
319 $page_gui->setPageLinker($this->page_linker);
320 $page_gui->setTemplateOutput(false);
321 $output = $page_gui->presentation($page_gui->getOutputMode());
322
323 if (count($defs) > 1) {
324 $tpl->setCurrentBlock("definition_header");
326 "TXT_DEFINITION",
327 $this->lng->txt("cont_definition") . " " . ($j + 1)
328 );
330 }
331
332 ilMathJax::getInstance()->includeMathJax($tpl);
333
334 $tpl->setCurrentBlock("definition");
335 $tpl->setVariable("PAGE_CONTENT", $output);
337 }
338 }
static getInstance()
Singleton: get instance for use in ILIAS requests with a config loaded from the settings.

References $tpl.

◆ quickList()

ilGlossaryTermGUI::quickList ( )

Set quick term list cmd into left navigation URL.

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

702 : void
703 {
705
706 $tab = new ilTermQuickListTableGUI($this, "editTerm");
707 $tpl->setLeftNavContent($tab->getHTML());
708 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLeftNavContent(string $a_content)
Sets content of left navigation column.

References $tpl.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ setGlossary()

ilGlossaryTermGUI::setGlossary ( ilObjGlossary  $a_glossary)

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

136 : void
137 {
138 $this->glossary = $a_glossary;
139 if (!is_object($this->term_glossary)) {
140 $this->term_glossary = $a_glossary;
141 }
142 }

◆ setOfflineDirectory()

ilGlossaryTermGUI::setOfflineDirectory ( string  $offdir)

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

125 : void
126 {
127 $this->offline_directory = $offdir;
128 }

◆ setPageLinker()

ilGlossaryTermGUI::setPageLinker ( \ILIAS\COPage\PageLinker  $page_linker)

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

144 : void
145 {
146 $this->page_linker = $page_linker;
147 }
ILIAS COPage PageLinker $page_linker

References $page_linker.

◆ setTabs()

ilGlossaryTermGUI::setTabs ( )

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

567 : void
568 {
569 $this->getTabs();
570 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ updateTerm()

ilGlossaryTermGUI::updateTerm ( )

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

220 : void
221 {
222 $form = $this->getEditTermForm();
223 if ($form->checkInput() &&
224 $this->record_gui->importEditFormPostValues()) {
225 // update term
226 $this->term->setTerm($form->getInput("term"));
227 $this->term->setLanguage($form->getInput("term_language"));
228 $this->term->update();
229
230 // update taxonomy assignment
231 if ($this->term_glossary->getTaxonomyId() > 0) {
232 $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
233 $ta->deleteAssignmentsOfItem($this->term->getId());
234 foreach ($this->request->getTaxNodes() as $node_id) {
235 $ta->addAssignment($node_id, $this->term->getId());
236 }
237 }
238
239 $this->record_gui->writeEditForm();
240 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
241 $this->ctrl->redirect($this, "editTerm");
242 }
243
244 $form->setValuesByPost();
245 $this->editTerm($form);
246 }
editTerm(ilPropertyFormGUI $a_form=null)

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $content_style_domain

ILIAS Style Content DomainService ilGlossaryTermGUI::$content_style_domain
protected

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

◆ $content_style_gui

ILIAS Style Content GUIService ilGlossaryTermGUI::$content_style_gui
protected

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

◆ $ctrl

ilCtrl ilGlossaryTermGUI::$ctrl
protected

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

◆ $glossary

ilObjGlossary ilGlossaryTermGUI::$glossary

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

◆ $help

ilHelpGUI ilGlossaryTermGUI::$help
protected

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

◆ $lng

ilLanguage ilGlossaryTermGUI::$lng

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

Referenced by __construct().

◆ $log

ilLogger ilGlossaryTermGUI::$log
protected

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

◆ $offline_directory

string ilGlossaryTermGUI::$offline_directory
protected

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

Referenced by getOfflineDirectory().

◆ $page_linker

ILIAS COPage PageLinker ilGlossaryTermGUI::$page_linker
protected

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

Referenced by setPageLinker().

◆ $record_gui

ilAdvancedMDRecordGUI ilGlossaryTermGUI::$record_gui
protected

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

◆ $ref_id

int ilGlossaryTermGUI::$ref_id
protected

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

◆ $request

ILIAS Glossary Editing EditingGUIRequest ilGlossaryTermGUI::$request
protected

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

◆ $tabs_gui

ilTabsGUI ilGlossaryTermGUI::$tabs_gui
protected

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

Referenced by executeCommand().

◆ $term

ilGlossaryTerm ilGlossaryTermGUI::$term

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

◆ $term_glossary

ilObjGlossary ilGlossaryTermGUI::$term_glossary = null
protected

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

◆ $toolbar

ilToolbarGUI ilGlossaryTermGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilGlossaryTermGUI::$tpl

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

Referenced by __construct().


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