ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTermDefinitionEditorGUI Class Reference

GUI class for glossary term definition editor. More...

+ Collaboration diagram for ilTermDefinitionEditorGUI:

Public Member Functions

 __construct ()
 Constructor @access public. More...
 
 executeCommand ()
 
 main_header ($a_header_title)
 output main header (title and locator) More...
 
 setTabs ()
 output tabs More...
 
 getTabs ()
 get tabs More...
 
 saveShortText ()
 

Data Fields

 $ilias
 
 $tpl
 
 $lng
 
 $glossary
 
 $definition
 
 $term
 

Detailed Description

GUI class for glossary term definition editor.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilTermDefinitionEditorGUI: ilGlossaryDefPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilTermDefinitionEditorGUI::__construct ( )

Constructor @access public.

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

33 {
34 global $ilias, $tpl, $lng, $objDefinition, $ilCtrl, $ilTabs;
35
36 // initiate variables
37 $this->ilias = $ilias;
38 $this->tpl = $tpl;
39 $this->lng = $lng;
40 $this->ctrl = $ilCtrl;
41 $this->glossary = new ilObjGlossary($_GET["ref_id"], true);
42 $this->definition = new ilGlossaryDefinition($_GET["def"]);
43 $this->term = new ilGlossaryTerm($this->definition->getTermId());
44 $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($this->definition->getTermId()), false);
45 $this->tabs_gui = $ilTabs;
46
47 $this->ctrl->saveParameter($this, array("def"));
48 }
$_GET["client_id"]
Class ilGlossaryDefinition.
Class ilGlossaryTerm.
static _lookGlossaryID($term_id)
get glossary id form term id
Class ilObjGlossary.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, $ilCtrl, $ilias, $lng, $tpl, and ilGlossaryTerm\_lookGlossaryID().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilTermDefinitionEditorGUI::executeCommand ( )

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

52 {
53 global $tpl, $ilCtrl, $lng;
54
55 $next_class = $this->ctrl->getNextClass($this);
56 $cmd = $this->ctrl->getCmd();
57
58 // content style
59 $this->tpl->setCurrentBlock("ContentStyle");
60 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
61 ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
62 $this->tpl->parseCurrentBlock();
63
64 // syntax style
65 $this->tpl->setCurrentBlock("SyntaxStyle");
66 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
68 $this->tpl->parseCurrentBlock();
69
70 require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
71 $gloss_loc = new ilGlossaryLocatorGUI();
72 $gloss_loc->setTerm($this->term);
73 $gloss_loc->setGlossary($this->glossary);
74 $gloss_loc->setDefinition($this->definition);
75
76// $this->tpl->getStandardTemplate();
77 $this->tpl->setTitle($this->term->getTerm()." - ".
78 $this->lng->txt("cont_definition")." ".
79 $this->definition->getNr());
80 if ($this->ctrl->getNextClass() == "ilglossarydefpagegui")
81 {
82 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
83 }
84
85 switch ($next_class)
86 {
87
88 case "ilglossarydefpagegui":
89
90 // output number of usages
91 if ($ilCtrl->getCmd() == "edit" &&
92 $ilCtrl->getCmdClass() == "ilglossarydefpagegui")
93 {
95 if ($nr > 0)
96 {
97 $link = "[<a href='".
98 $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages").
99 "'>".$lng->txt("glo_list_usages")."</a>]";
100 ilUtil::sendInfo(sprintf($lng->txt("glo_term_is_used_n_times"),
101 $nr)." ".$link);
102 }
103 }
104
105 // not so nice, to do: revise locator handling
106 if ($this->ctrl->getNextClass() == "ilglossarydefpagegui"
107 || $this->ctrl->getCmdClass() == "ileditclipboardgui")
108 {
109 $gloss_loc->display();
110 }
111 $this->setTabs();
112 $this->ctrl->setReturnByClass("ilGlossaryDefPageGUI", "edit");
113 $this->ctrl->setReturn($this, "listDefinitions");
114 $page_gui = new ilGlossaryDefPageGUI($this->definition->getId());
115 $page = $page_gui->getPageObject();
116 $this->definition->assignPageObject($page);
117 $page->addUpdateListener($this, "saveShortText");
118 $page_gui->setEditPreview(true);
119
120 // metadata
121 // ... set title to term, if no title is given
122 include_once("./Services/MetaData/classes/class.ilMD.php");
123 $md = new ilMD($this->term_glossary->getId(), $this->definition->getId(), "gdf");
124 $md_gen = $md->getGeneral();
125 if ($md_gen->getTitle() == "")
126 {
127 $md_gen->setTitle($this->term->getTerm());
128 $md_gen->update();
129 }
130
131 $page_gui->activateMetaDataEditor($this->term_glossary, "gdf", $this->definition->getId());
132
133 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
134 $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=fullscreen&amp;ref_id=".$_GET["ref_id"]);
135 $page_gui->setTemplateTargetVar("ADM_CONTENT");
136 $page_gui->setOutputMode("edit");
137
139 $this->term_glossary->getStyleSheetId(), "glo"));
140 $page_gui->setLocator($gloss_loc);
141 $page_gui->setIntLinkReturn($this->ctrl->getLinkTargetByClass("ilobjglossarygui", "quickList",
142 "", false, false));
143 $page_gui->setPageBackTitle($this->lng->txt("cont_definition"));
144 $page_gui->setLinkParams("ref_id=".$_GET["ref_id"]);
145 $page_gui->setHeader($this->term->getTerm());
146 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=".$_GET["ref_id"]);
147 $page_gui->setPresentationTitle($this->term->getTerm());
148 $ret = $this->ctrl->forwardCommand($page_gui);
149 $tpl->setContent($ret);
150 break;
151
152 default:
153 $this->setTabs();
154 $gloss_loc->display();
155 $ret = $this->$cmd();
156 break;
157
158 }
159 }
sprintf('%.4f', $callTime)
Glossary definition page GUI class.
static getNumberOfUsages($a_term_id)
Get number of usages.
static getSyntaxStylePath()
get syntax style path
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getContentStylePath($a_style_id)
get content style path
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ilCtrl, $lng, $ret, $tpl, ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getEffectiveContentStyleId(), ilUtil\getImagePath(), ilGlossaryTerm\getNumberOfUsages(), ilObjStyleSheet\getSyntaxStylePath(), ilUtil\sendInfo(), setTabs(), and sprintf.

+ Here is the call graph for this function:

◆ getTabs()

ilTermDefinitionEditorGUI::getTabs ( )

get tabs

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

188 {
189 // back to glossary
190 $this->tabs_gui->setBack2Target($this->lng->txt("glossary"),
191 $this->ctrl->getParentReturn($this));
192
193 // back to upper context
194 $this->tabs_gui->setBackTarget($this->lng->txt("term"),
195 $this->ctrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
196
197 }

Referenced by setTabs().

+ Here is the caller graph for this function:

◆ main_header()

ilTermDefinitionEditorGUI::main_header (   $a_header_title)

output main header (title and locator)

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

166 {
167 global $lng;
168
169 $this->tpl->getStandardTemplate();
170 $this->tpl->setTitle($a_header_title);
171 $this->displayLocator();
172 //$this->setAdminTabs($a_type);
173 }

References $lng.

◆ saveShortText()

ilTermDefinitionEditorGUI::saveShortText ( )

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

201 {
202 $this->definition->updateShortText();
203 }

◆ setTabs()

ilTermDefinitionEditorGUI::setTabs ( )

output tabs

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

179 {
180 // catch feedback message
181 $this->getTabs();
182 }

References getTabs().

Referenced by executeCommand().

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

Field Documentation

◆ $definition

ilTermDefinitionEditorGUI::$definition

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

◆ $glossary

ilTermDefinitionEditorGUI::$glossary

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

◆ $ilias

ilTermDefinitionEditorGUI::$ilias

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

Referenced by __construct().

◆ $lng

ilTermDefinitionEditorGUI::$lng

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

Referenced by __construct(), executeCommand(), and main_header().

◆ $term

ilTermDefinitionEditorGUI::$term

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

◆ $tpl

ilTermDefinitionEditorGUI::$tpl

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

Referenced by __construct(), and executeCommand().


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