29 protected \ILIAS\Glossary\Editing\EditingGUIRequest
$request;
50 $this->
help = $DIC[
"ilHelp"];
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;
152 $ilTabs = $this->tabs_gui;
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(),
212 $this->record_gui->setPropertyForm($form);
213 $this->record_gui->parse();
215 $form->addCommandButton(
"updateTerm", $this->
lng->txt(
"save"));
222 $form = $this->getEditTermForm();
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());
233 $ta->deleteAssignmentsOfItem($this->term->getId());
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();
245 $this->editTerm($form);
249 string $a_close_el_id,
250 string $a_glo_ov_id =
"",
252 string $a_outputmode =
"offline"
257 $a_lang =
$lng->getLangKey();
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 !=
"") {
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);
274 $tpl->parseCurrentBlock();
276 $tpl->setVariable(
"TXT_CLOSE",
$lng->txtlng(
"common",
"close", $a_lang));
277 $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
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");
314 $page_gui->setOfflineDirectory($this->getOfflineDirectory());
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) {
324 $tpl->setCurrentBlock(
"definition_header");
327 $this->
lng->txt(
"cont_definition") .
" " . ($j + 1)
329 $tpl->parseCurrentBlock();
334 $tpl->setCurrentBlock(
"definition");
335 $tpl->setVariable(
"PAGE_CONTENT", $output);
336 $tpl->parseCurrentBlock();
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;
360 $ilTabs = $this->tabs_gui;
363 $this->displayLocator();
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()
384 $tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
386 $tpl->setCurrentBlock(
"add_def");
388 "TXT_ADD_DEFINITION",
389 $this->
lng->txt(
"cont_add_definition")
392 $tpl->parseCurrentBlock();
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) {
414 $tpl->setCurrentBlock(
"definition_header");
417 $this->
lng->txt(
"cont_definition") .
" " . ($j + 1)
419 $tpl->parseCurrentBlock();
423 $tpl->setCurrentBlock(
"up");
424 $tpl->setVariable(
"TXT_UP", $this->
lng->txt(
"up"));
425 $this->
ctrl->setParameter($this,
"def", $def[
"id"]);
428 $this->
ctrl->getLinkTarget($this,
"moveUp")
430 $tpl->parseCurrentBlock();
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"]);
439 $this->
ctrl->getLinkTarget($this,
"moveDown")
441 $tpl->parseCurrentBlock();
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"]);
449 $this->
ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI",
"ilGlossaryDefPageGUI"),
"edit")
451 $tpl->setVariable(
"TXT_DELETE", $this->
lng->txt(
"delete"));
454 $this->
ctrl->getLinkTarget($this,
"confirmDefinitionDeletion")
456 $tpl->parseCurrentBlock();
458 $tpl->setCurrentBlock(
"definition");
459 $tpl->setVariable(
"PAGE_CONTENT", $output);
460 $tpl->parseCurrentBlock();
466 $this->tpl->setContent(
$tpl->get());
472 $ilTabs = $this->tabs_gui;
475 $this->displayLocator();
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");
536 $definition->delete();
537 $this->
ctrl->redirect($this,
"listDefinitions");
543 $definition->moveUp();
544 $this->
ctrl->redirect($this,
"listDefinitions");
550 $definition->moveDown();
551 $this->
ctrl->redirect($this,
"listDefinitions");
556 $ilCtrl = $this->ctrl;
558 $ilCtrl->setParameterByClass(
"ilobjglossarygui",
"term_id", $this->term->getId());
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();
583 $ilHelp = $this->help;
585 $ilHelp->setScreenIdComponent(
"glo_term");
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();
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"),
680 $ilTabs = $this->tabs_gui;
685 $this->displayLocator();
687 $ilTabs->activateTab(
"usage");
689 $this->tpl->setTitle($this->
lng->txt(
"cont_term") .
": " . $this->term->getTerm());
694 $tpl->setContent($tab->getHTML());
707 $tpl->setLeftNavContent($tab->getHTML());
Class ilCtrl provides processing control methods.
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
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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getDefinitionList(int $a_term_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Style Content DomainService $content_style_domain
output(bool $a_offline=false, ilGlobalTemplateInterface $a_tpl=null, string $a_outputmode="presentation")
output glossary term definitions used in ilLMPresentationGUI->ilGlossary()
ilGlobalTemplateInterface $tpl
static _goto(string $a_target, int $a_ref_id=0)
setOfflineDirectory(string $offdir)
ILIAS Style Content GUIService $content_style_gui
setGlossary(ilObjGlossary $a_glossary)
ILIAS COPage PageLinker $page_linker
editTerm(ilPropertyFormGUI $a_form=null)
ilAdvancedMDRecordGUI $record_gui
quickList()
Set quick term list cmd into left navigation URL.
getOverlayHTML(string $a_close_el_id, string $a_glo_ov_id="", string $a_lang="", string $a_outputmode="offline")
string $offline_directory
ilObjGlossary $term_glossary
setPageLinker(\ILIAS\COPage\PageLinker $page_linker)
cancelDefinitionDeletion()
confirmDefinitionDeletion()
ILIAS Glossary Editing EditingGUIRequest $request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getNumberOfUsages(int $a_term_id)
static _lookGlossaryID(int $term_id)
get glossary id form term id
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
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...
static getSyntaxStylePath()
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _lookupObjectId(int $ref_id)
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...
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
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 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.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
if(!file_exists(getcwd() . '/ilias.ini.php'))
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...
setVariable(string $variable, $value='')
Sets the given variable to the given value.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Class ChatMainBarProvider \MainMenu\Provider.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples