ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilTermDefinitionEditorGUI 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 ilTermDefinitionEditorGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 setTabs ()
 
 getTabs ()
 
 saveShortText ()
 

Data Fields

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

Protected Attributes

ilObjGlossary $term_glossary
 
ILIAS Glossary Editing EditingGUIRequest $request
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content Object ObjectFacade $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 term definition editor

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

Definition at line 24 of file class.ilTermDefinitionEditorGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTermDefinitionEditorGUI::__construct ( )

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

39 {
40 global $DIC;
41
42 $tpl = $DIC["tpl"];
43 $lng = $DIC->language();
44 $ilCtrl = $DIC->ctrl();
45 $ilTabs = $DIC->tabs();
46
47 // initiate variables
48 $this->tpl = $tpl;
49 $this->lng = $lng;
50 $this->ctrl = $ilCtrl;
51 $this->request = $DIC->glossary()
52 ->internal()
53 ->gui()
54 ->editing()
55 ->request();
56
57
58 $this->glossary = new ilObjGlossary($this->request->getRefId(), true);
59 $this->definition = new ilGlossaryDefinition($this->request->getDefinitionId());
60 $this->term = new ilGlossaryTerm($this->definition->getTermId());
61 $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($this->definition->getTermId()), false);
62 $this->tabs_gui = $ilTabs;
63
64 $this->ctrl->saveParameter($this, array("def"));
65
66 $cs = $DIC->contentStyle();
67 $this->content_style_gui = $cs->gui();
68 $this->content_style_domain = $cs->domain()->styleForRefId($this->glossary->getRefId());
69 }
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 _lookGlossaryID(int $term_id)
get glossary id form term id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

References $DIC, $lng, $tpl, ilGlossaryTerm\_lookGlossaryID(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilTermDefinitionEditorGUI::executeCommand ( )

Definition at line 72 of file class.ilTermDefinitionEditorGUI.php.

72 : void
73 {
75 $ilCtrl = $this->ctrl;
77
78 $next_class = $this->ctrl->getNextClass($this);
79 $cmd = $this->ctrl->getCmd();
80
81 // content style
82 $this->content_style_gui->addCss(
83 $this->tpl,
84 $this->term_glossary->getRefId(),
85 $this->term_glossary->getId()
86 );
87
88 // syntax style
89 $this->tpl->setCurrentBlock("SyntaxStyle");
90 $this->tpl->setVariable(
91 "LOCATION_SYNTAX_STYLESHEET",
93 );
94 $this->tpl->parseCurrentBlock();
95
96 $gloss_loc = new ilGlossaryLocatorGUI();
97 $gloss_loc->setTerm($this->term);
98 $gloss_loc->setGlossary($this->glossary);
99 $gloss_loc->setDefinition($this->definition);
100
101 $this->tpl->setTitle($this->term->getTerm() . " - " .
102 $this->lng->txt("cont_definition") . " " .
103 $this->definition->getNr());
104 if ($this->ctrl->getNextClass() == "ilglossarydefpagegui") {
105 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
106 }
107
108 switch ($next_class) {
109
110 case "ilglossarydefpagegui":
111 // output number of usages
112 if ($ilCtrl->getCmd() == "edit" &&
113 $ilCtrl->getCmdClass() == "ilglossarydefpagegui") {
114 $nr = ilGlossaryTerm::getNumberOfUsages($this->request->getTermId());
115 if ($nr > 0) {
116 $link = "[<a href='" .
117 $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages") .
118 "'>" . $lng->txt("glo_list_usages") . "</a>]";
119 $this->tpl->setOnScreenMessage("info", sprintf(
120 $lng->txt("glo_term_is_used_n_times"),
121 $nr
122 ) . " " . $link);
123 }
124 }
125
126 // not so nice, to do: revise locator handling
127 if ($this->ctrl->getNextClass() == "ilglossarydefpagegui"
128 || $this->ctrl->getCmdClass() == "ileditclipboardgui") {
129 $gloss_loc->display();
130 }
131 $this->setTabs();
132 $this->ctrl->setReturnByClass("ilGlossaryDefPageGUI", "edit");
133 $this->ctrl->setReturn($this, "listDefinitions");
134 $page_gui = new ilGlossaryDefPageGUI($this->definition->getId());
135 // @var ilGlossaryDefPage $page
136 $page = $page_gui->getPageObject();
137 $this->definition->assignPageObject($page);
138 $page->addUpdateListener($this, "saveShortText");
139 $page_gui->setEditPreview(true);
140
141 // metadata
142 // ... set title to term, if no title is given
143 $md = new ilMD($this->term_glossary->getId(), $this->definition->getId(), "gdf");
144 $md_gen = $md->getGeneral();
145 if ($md_gen->getTitle() == "") {
146 $md_gen->setTitle($this->term->getTerm());
147 $md_gen->update();
148 }
149
150 $page_gui->activateMetaDataEditor($this->term_glossary, "gdf", $this->definition->getId());
151
152 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $this->request->getRefId());
153 $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=fullscreen&amp;ref_id=" . $this->request->getRefId());
154 $page_gui->setTemplateTargetVar("ADM_CONTENT");
155 $page_gui->setOutputMode("edit");
156
157 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
158
159 $page_gui->setIntLinkReturn($this->ctrl->getLinkTargetByClass(
160 "ilobjglossarygui",
161 "quickList",
162 "",
163 false,
164 false
165 ));
166 $page_gui->setPageBackTitle($this->lng->txt("cont_definition"));
167 $page_gui->setLinkParams("ref_id=" . $this->request->getRefId());
168 $page_gui->setHeader($this->term->getTerm());
169 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=" . $this->request->getRefId());
170 $page_gui->setPresentationTitle($this->term->getTerm());
171 $ret = $this->ctrl->forwardCommand($page_gui);
172 if ($ret != "") {
173 $tpl->setContent($ret);
174 }
175 break;
176
177 default:
178 $this->setTabs();
179 $gloss_loc->display();
180 $this->$cmd();
181 break;
182
183 }
184 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getNumberOfUsages(int $a_term_id)
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 getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setContent(string $a_html)
Sets content for standard template.

References $ctrl, $lng, $tpl, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilGlossaryTerm\getNumberOfUsages(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getTabs()

ilTermDefinitionEditorGUI::getTabs ( )

Definition at line 191 of file class.ilTermDefinitionEditorGUI.php.

191 : void
192 {
193 // back to glossary
194 $this->tabs_gui->setBack2Target(
195 $this->lng->txt("glossary"),
196 $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "")
197 );
198
199 // back to upper context
200 $this->tabs_gui->setBackTarget(
201 $this->lng->txt("term"),
202 $this->ctrl->getLinkTargetByClass("ilglossarytermgui", "editTerm")
203 );
204 }

References ILIAS\Repository\lng().

Referenced by setTabs().

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

◆ saveShortText()

ilTermDefinitionEditorGUI::saveShortText ( )

Definition at line 206 of file class.ilTermDefinitionEditorGUI.php.

206 : void
207 {
208 $this->definition->updateShortText();
209 }

◆ setTabs()

ilTermDefinitionEditorGUI::setTabs ( )

Definition at line 186 of file class.ilTermDefinitionEditorGUI.php.

186 : void
187 {
188 $this->getTabs();
189 }

References getTabs().

Referenced by executeCommand().

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

Field Documentation

◆ $content_style_domain

ILIAS Style Content Object ObjectFacade ilTermDefinitionEditorGUI::$content_style_domain
protected

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

◆ $content_style_gui

ILIAS Style Content GUIService ilTermDefinitionEditorGUI::$content_style_gui
protected

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

◆ $ctrl

ilCtrl ilTermDefinitionEditorGUI::$ctrl
protected

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

Referenced by executeCommand().

◆ $definition

ilGlossaryDefinition ilTermDefinitionEditorGUI::$definition

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

◆ $glossary

ilObjGlossary ilTermDefinitionEditorGUI::$glossary

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

◆ $lng

ilLanguage ilTermDefinitionEditorGUI::$lng

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

Referenced by __construct(), and executeCommand().

◆ $request

ILIAS Glossary Editing EditingGUIRequest ilTermDefinitionEditorGUI::$request
protected

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

◆ $tabs_gui

ilTabsGUI ilTermDefinitionEditorGUI::$tabs_gui
protected

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

◆ $term

ilGlossaryTerm ilTermDefinitionEditorGUI::$term

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

◆ $term_glossary

ilObjGlossary ilTermDefinitionEditorGUI::$term_glossary
protected

Definition at line 26 of file class.ilTermDefinitionEditorGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilTermDefinitionEditorGUI::$tpl

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

Referenced by __construct(), and executeCommand().


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