29 protected \ILIAS\Glossary\Editing\EditingGUIRequest
$request;
50 $this->
help = $DIC[
"ilHelp"];
51 $lng = $DIC->language();
53 $ilCtrl = $DIC->ctrl();
54 $ilTabs = $DIC->tabs();
58 $this->
ctrl = $ilCtrl;
59 $this->
ctrl->saveParameter($this, array(
"term_id"));
60 $this->tabs_gui = $ilTabs;
61 $this->request = $DIC->glossary()
69 $this->
toolbar = $DIC->toolbar();
71 $this->ref_id = $this->request->getRefId();
76 $this->term_glossary =
new ilObjGlossary($this->ref_id,
true);
81 $cs = $DIC->contentStyle();
82 $this->content_style_gui = $cs->gui();
83 $this->content_style_domain = $cs->domain();
90 $next_class = $this->
ctrl->getNextClass($this);
91 $cmd = $this->
ctrl->getCmd();
93 $this->log->debug(
"glossary term, next class " . $next_class .
", cmd: " . $cmd);
95 switch ($next_class) {
96 case "iltermdefinitioneditorgui":
98 $this->
ctrl->forwardCommand($def_edit);
102 case "ilpropertyformgui":
104 $this->
ctrl->forwardCommand($form);
107 case "ilobjectmetadatagui":
109 $ilTabs->activateTab(
'meta_data');
111 $this->term_glossary,
115 $this->
ctrl->forwardCommand($md_gui);
120 $ret = $this->$cmd();
127 $this->offline_directory = $offdir;
138 $this->glossary = $a_glossary;
139 if (!is_object($this->term_glossary)) {
140 $this->term_glossary = $a_glossary;
158 $ilTabs->activateTab(
"properties");
160 $this->tpl->setTitle($this->
lng->txt(
"cont_term") .
": " . $this->term->getTerm());
167 $this->tpl->setContent($ilCtrl->getHTML($a_form));
175 $form->setFormAction($this->
ctrl->getFormAction($this,
"updateTerm"));
176 $form->setTitle($this->
lng->txt(
"cont_edit_term"));
179 $term->setRequired(
true);
180 $term->setValue($this->term->getTerm());
181 $form->addItem($term);
184 $lang->setRequired(
true);
186 $lang->setValue($this->term->getLanguage());
187 $form->addItem(
$lang);
190 if ($this->term_glossary->getTaxonomyId() > 0) {
191 $tax_node_assign =
new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(),
"tax_node",
true);
193 $ta =
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(),
"term", $this->term_glossary->getTaxonomyId());
194 $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
196 foreach ($assgnmts as
$a) {
197 $node_ids[] = $a[
"node_id"];
199 $tax_node_assign->setValue($node_ids);
201 $form->addItem($tax_node_assign);
208 $this->term_glossary->getId(),
213 $this->record_gui->parse();
215 $form->addCommandButton(
"updateTerm", $this->
lng->txt(
"save"));
223 if ($form->checkInput() &&
224 $this->record_gui->importEditFormPostValues()) {
226 $this->term->setTerm($form->getInput(
"term"));
227 $this->term->setLanguage($form->getInput(
"term_language"));
228 $this->term->update();
231 if ($this->term_glossary->getTaxonomyId() > 0) {
232 $ta =
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(),
"term", $this->term_glossary->getTaxonomyId());
234 foreach ($this->request->getTaxNodes() as $node_id) {
235 $ta->addAssignment($node_id, $this->term->getId());
239 $this->record_gui->writeEditForm();
240 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
241 $this->
ctrl->redirect($this,
"editTerm");
244 $form->setValuesByPost();
249 string $a_close_el_id,
250 string $a_glo_ov_id =
"",
252 string $a_outputmode =
"offline" 260 $tpl =
new ilTemplate(
"tpl.glossary_overlay.html",
true,
true,
"Modules/Glossary");
262 if ($a_outputmode ==
"preview") {
263 $a_outputmode =
"presentation";
265 if ($a_outputmode ==
"offline") {
266 $this->
output(
true, $tpl, $a_outputmode);
268 $this->
output(
false, $tpl, $a_outputmode);
270 if ($a_glo_ov_id !=
"") {
272 $tpl->
setVariable(
"TXT_LINK", $lng->
txtlng(
"content",
"cont_sco_glossary", $a_lang));
286 bool $a_offline =
false,
288 string $a_outputmode =
"presentation" 290 if ($a_tpl != null) {
298 $tpl->
setVariable(
"TXT_TERM", $this->term->getTerm());
300 for ($j = 0, $jMax = count($defs); $j < $jMax; $j++) {
303 $page_gui->setTemplate($tpl);
304 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $this->ref_id);
306 $page_gui->setFullscreenLink(
"fullscreen.html");
308 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=" . $this->ref_id);
311 $page_gui->setOutputMode($a_outputmode);
313 $page_gui->setOutputMode(
"offline");
319 $page_gui->setPageLinker($this->page_linker);
320 $page_gui->setTemplateOutput(
false);
321 $output = $page_gui->presentation($page_gui->getOutputMode());
323 if (count($defs) > 1) {
327 $this->
lng->txt(
"cont_definition") .
" " . ($j + 1)
344 $term_links = array();
345 for ($j = 0, $jMax = count($defs); $j < $jMax; $j++) {
349 $page_links = $page->getInternalLinks();
350 foreach ($page_links as
$key => $page_link) {
351 $term_links[
$key] = $page_link;
365 $ilTabs->activateTab(
"definitions");
368 $this->content_style_gui->addCss(
370 $this->term_glossary->getRefId(),
371 $this->term_glossary->getId()
377 $tpl =
new ilTemplate(
"tpl.glossary_definition_list.html",
true,
true,
"Modules/Glossary");
379 $this->tpl->setTitle(
380 $this->
lng->txt(
"cont_term") .
": " . $this->term->getTerm()
388 "TXT_ADD_DEFINITION",
389 $this->
lng->txt(
"cont_add_definition")
396 $this->request->getTermId()
399 $tpl->
setVariable(
"TXT_TERM", $this->term->getTerm());
401 for ($j = 0, $jMax = count($defs); $j < $jMax; $j++) {
404 $page_gui->setStyleId(
405 $this->content_style_domain->styleForObjId(
406 $this->term_glossary->getId()
407 )->getEffectiveStyleId()
409 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $this->ref_id);
410 $page_gui->setTemplateOutput(
false);
411 $output = $page_gui->preview();
413 if (count($defs) > 1) {
417 $this->
lng->txt(
"cont_definition") .
" " . ($j + 1)
425 $this->
ctrl->setParameter($this,
"def", $def[
"id"]);
428 $this->
ctrl->getLinkTarget($this,
"moveUp")
433 if ($j + 1 < count($defs)) {
436 $this->
ctrl->setParameter($this,
"def", $def[
"id"]);
439 $this->
ctrl->getLinkTarget($this,
"moveDown")
445 $this->
ctrl->setParameter($this,
"def", $def[
"id"]);
446 $this->
ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI",
"def", $def[
"id"]);
449 $this->
ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI",
"ilGlossaryDefPageGUI"),
"edit")
454 $this->
ctrl->getLinkTarget($this,
"confirmDefinitionDeletion")
466 $this->tpl->setContent($tpl->
get());
477 $ilTabs->activateTab(
"definitions");
479 $this->content_style_gui->addCss(
481 $this->term_glossary->getRefId(),
482 $this->term_glossary->getId()
486 $this->tpl->setTitle(
487 $this->
lng->txt(
"cont_term") .
": " . $this->term->getTerm()
491 $dtpl =
new ilTemplate(
"tpl.glossary_definition_delete.html",
true,
true,
"Modules/Glossary");
492 $this->tpl->setOnScreenMessage(
'question', $this->
lng->txt(
"info_delete_sure"));
494 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
498 $page_gui->setTemplateOutput(
false);
499 $page_gui->setStyleId(
500 $this->content_style_domain->styleForObjId(
501 $this->term_glossary->getId()
502 )->getEffectiveStyleId()
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();
509 $dtpl->setCurrentBlock(
"definition");
510 $dtpl->setVariable(
"PAGE_CONTENT", $output);
511 $dtpl->setVariable(
"TXT_CANCEL", $this->
lng->txt(
"cancel"));
514 $this->
ctrl->getLinkTarget($this,
"cancelDefinitionDeletion")
516 $dtpl->setVariable(
"TXT_CONFIRM", $this->
lng->txt(
"confirm"));
517 $this->
ctrl->setParameter($this,
"def", $definition->getId());
520 $this->
ctrl->getLinkTarget($this,
"deleteDefinition")
522 $dtpl->parseCurrentBlock();
524 $this->tpl->setContent($dtpl->get());
529 $this->
ctrl->redirect($this,
"listDefinitions");
537 $this->
ctrl->redirect($this,
"listDefinitions");
544 $this->
ctrl->redirect($this,
"listDefinitions");
551 $this->
ctrl->redirect($this,
"listDefinitions");
559 $ilCtrl->redirectByClass(
"ilobjglossarygui",
"addDefinition");
564 $this->
ctrl->redirect($this,
"listDefinitions");
575 $gloss_loc->setTerm($this->term);
576 $gloss_loc->setGlossary($this->glossary);
577 $gloss_loc->display();
587 if ($this->request->getTermId() > 0) {
588 $this->tabs_gui->addTab(
591 $this->
ctrl->getLinkTarget($this,
"editTerm")
594 $this->tabs_gui->addTab(
596 $lng->
txt(
"cont_definitions"),
597 $this->
ctrl->getLinkTarget($this,
"listDefinitions")
600 $this->tabs_gui->addTab(
603 $this->
ctrl->getLinkTarget($this,
"listUsages")
607 $this->term_glossary,
611 $mdtab = $mdgui->
getTab();
613 $this->tabs_gui->addTab(
615 $lng->
txt(
"meta_data"),
620 $this->tabs_gui->addNonTabbedLink(
622 $this->
lng->txt(
"glo_presentation_view"),
624 "/goto.php?target=" .
626 "_" . $this->request->getTermId() .
"_" . $this->request->getRefId() .
"&client_id=" .
CLIENT_ID,
632 $this->tabs_gui->setBackTarget(
633 $this->
lng->txt(
"glossary"),
634 $this->
ctrl->getLinkTargetByClass(
"ilobjglossarygui",
"listTerms")
643 $main_tpl = $DIC->ui()->mainTemplate();
645 $ctrl = $DIC->ctrl();
646 $lng = $DIC->language();
647 $ilAccess = $DIC->access();
653 $ref_ids = array($a_ref_id);
659 foreach ($ref_ids as $ref_id) {
661 if ($ilAccess->checkAccess(
"read",
"", $ref_id)) {
664 $ctrl->
redirectByClass(
"ilGlossaryPresentationGUI",
"listDefinitions");
668 $main_tpl->setOnScreenMessage(
'failure', sprintf(
669 $lng->
txt(
"msg_no_perm_read_item"),
687 $ilTabs->activateTab(
"usage");
689 $this->tpl->setTitle($this->
lng->txt(
"cont_term") .
": " . $this->term->getTerm());
editTerm(ilPropertyFormGUI $a_form=null)
cancelDefinitionDeletion()
setPropertyForm(ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
confirmDefinitionDeletion()
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
static getLogger(string $a_component_id)
Get component logger.
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, the topic itself with "-" will be returned
ilAdvancedMDRecordGUI $record_gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
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...
Class ChatMainBarProvider .
static _getAllReferences(int $id)
get all reference ids for object ID
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getLangKey()
Return lang key.
deleteAssignmentsOfItem(int $a_item_id)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
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...
getOverlayHTML(string $a_close_el_id, string $a_glo_ov_id="", string $a_lang="", string $a_outputmode="offline")
ILIAS Style Content GUIService $content_style_gui
string $offline_directory
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ILIAS Glossary Editing EditingGUIRequest $request
quickList()
Set quick term list cmd into left navigation URL.
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...
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
static _goto(string $a_target, int $a_ref_id=0)
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjectId(int $ref_id)
ILIAS COPage PageLinker $page_linker
setOfflineDirectory(string $offdir)
setGlossary(ilObjGlossary $a_glossary)
static getSyntaxStylePath()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getDefinitionList(int $a_term_id)
setPageLinker(\ILIAS\COPage\PageLinker $page_linker)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjGlossary $term_glossary
static getInstance()
Singleton: get instance for use in ILIAS requests with a config loaded from the settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
ILIAS Style Content DomainService $content_style_domain
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static getNumberOfUsages(int $a_term_id)
ilGlobalTemplateInterface $tpl
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
setLeftNavContent(string $a_content)
Sets content of left navigation column.
output(bool $a_offline=false, ilGlobalTemplateInterface $a_tpl=null, string $a_outputmode="presentation")
output glossary term definitions used in ilLMPresentationGUI->ilGlossary()
static _lookGlossaryID(int $term_id)
get glossary id form term id