29 protected \ILIAS\Glossary\Editing\EditingGUIRequest
$request;
44 protected \ILIAS\Glossary\InternalDomainService
$domain;
52 $this->
help = $DIC[
"ilHelp"];
55 $ilCtrl =
$DIC->ctrl();
56 $ilTabs =
$DIC->tabs();
60 $this->
ctrl = $ilCtrl;
61 $this->
ctrl->saveParameter($this, array(
"term_id"));
62 $this->tabs_gui = $ilTabs;
63 $this->request =
$DIC->glossary()
68 $this->domain =
$DIC->glossary()->internal()->domain();
69 $this->ui_ren =
$DIC->ui()->renderer();
73 $this->
toolbar = $DIC->toolbar();
75 $this->ref_id = $this->request->getRefId();
80 $this->term_glossary =
new ilObjGlossary($this->ref_id,
true);
85 $cs =
$DIC->contentStyle();
86 $this->content_style_gui = $cs->gui();
87 $this->content_style_domain = $cs->domain();
94 $next_class = $this->
ctrl->getNextClass($this);
95 $cmd = $this->
ctrl->getCmd();
97 $this->log->debug(
"glossary term, next class " . $next_class .
", cmd: " . $cmd);
99 switch ($next_class) {
100 case "iltermdefinitioneditorgui":
102 $this->
ctrl->forwardCommand($def_edit);
105 case "ilpropertyformgui":
107 $this->
ctrl->forwardCommand($form);
110 case "ilobjectmetadatagui":
112 $ilTabs->activateTab(
'meta_data');
114 $this->term_glossary,
118 $this->
ctrl->forwardCommand($md_gui);
122 $ret = $this->$cmd();
129 $this->offline_directory = $offdir;
140 $this->glossary = $a_glossary;
141 if (!is_object($this->term_glossary)) {
142 $this->term_glossary = $a_glossary;
154 $ilTabs = $this->tabs_gui;
160 $ilTabs->activateTab(
"properties");
162 $this->tpl->setTitle($this->
lng->txt(
"cont_term") .
": " . $this->term->getTerm());
169 $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);
185 $lang->setOptions($this->domain->metadata()->getLOMLanguagesForSelectInputs());
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,
"components/ILIAS/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));
276 $tpl->
setVariable(
"TXT_CLOSE",
$lng->txtlng(
"common",
"close", $a_lang));
286 bool $a_offline =
false,
288 string $a_outputmode =
"presentation"
290 if ($a_tpl != null) {
296 $tpl->
setVariable(
"TXT_TERM", $this->term->getTerm());
299 $page_gui->setTemplate($tpl);
300 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $this->ref_id);
302 $page_gui->setFullscreenLink(
"fullscreen.html");
304 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=" . $this->ref_id);
307 $page_gui->setOutputMode($a_outputmode);
309 $page_gui->setOutputMode(
"offline");
310 $page_gui->setOfflineDirectory($this->getOfflineDirectory());
315 $page_gui->setPageLinker($this->page_linker);
316 $page_gui->setTemplateOutput(
false);
317 $output = $page_gui->presentation($page_gui->getOutputMode());
326 $term_links = array();
329 $page_links = $page->getInternalLinks();
330 foreach ($page_links as $key => $page_link) {
331 $term_links[$key] = $page_link;
345 $gloss_loc->setGlossary($this->glossary);
346 $gloss_loc->display();
352 $ilHelp = $this->help;
354 $ilHelp->setScreenIdComponent(
"glo_term");
357 if (!empty($this->request->getTableGlossaryTermListIds())
358 && $this->request->getTableGlossaryTermListIds()[0] > 0) {
359 $term_id = $this->request->getTableGlossaryTermListIds()[0];
360 } elseif ($this->request->getTermId() > 0) {
361 $term_id = $this->request->getTermId();
364 $this->tabs_gui->addTab(
367 $this->ctrl->getLinkTarget($this,
"editTerm")
370 $this->tabs_gui->addTab(
373 $this->ctrl->getLinkTarget($this,
"listUsages")
377 $this->term_glossary,
381 $mdtab = $mdgui->getTab();
383 $this->tabs_gui->addTab(
385 $lng->txt(
"meta_data"),
390 $this->tabs_gui->addNonTabbedLink(
392 $this->
lng->txt(
"glo_presentation_view"),
394 "/goto.php?target=" .
396 "_" . $term_id .
"_" . $this->request->getRefId() .
"&client_id=" .
CLIENT_ID
401 $this->tabs_gui->setBackTarget(
402 $this->
lng->txt(
"glossary"),
403 $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui",
"listTerms")
412 $main_tpl =
$DIC->ui()->mainTemplate();
414 $ctrl =
$DIC->ctrl();
416 $ilAccess =
$DIC->access();
422 $ref_ids = array($a_ref_id);
428 foreach ($ref_ids as
$ref_id) {
430 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
433 $ctrl->
redirectByClass(
"ilGlossaryPresentationGUI",
"listDefinitions");
437 $main_tpl->setOnScreenMessage(
'failure', sprintf(
438 $lng->txt(
"msg_no_perm_read_item"),
449 $ilTabs = $this->tabs_gui;
454 $this->displayLocator();
456 $ilTabs->activateTab(
"usage");
458 $this->tpl->setTitle($this->
lng->txt(
"cont_term") .
": " . $this->term->getTerm());
461 $table = $this->domain->table()->getTermUsagesTable($this->request->getTermId())->getComponent();
463 $tpl->
setContent($this->ui_ren->render($table));
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...
ILIAS UI Renderer $ui_ren
ILIAS Style Content DomainService $content_style_domain
ilGlobalTemplateInterface $tpl
output(bool $a_offline=false, ?ilGlobalTemplateInterface $a_tpl=null, string $a_outputmode="presentation")
output glossary term definitions used in ilLMPresentationGUI->ilGlossary()
editTerm(?ilPropertyFormGUI $a_form=null)
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
ilAdvancedMDRecordGUI $record_gui
ILIAS Glossary InternalDomainService $domain
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)
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
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 class represents a text property in a property form.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setContent(string $a_html)
Sets content for standard template.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
if(!file_exists('../ilias.ini.php'))