ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTermDefinitionEditorGUI Class Reference

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

+ Collaboration diagram for ilTermDefinitionEditorGUI:

Public Member Functions

 ilTermDefinitionEditorGUI ()
 Constructor @access public. More...
 
executeCommand ()
 
 main_header ($a_header_title)
 output main header (title and locator) More...
 
 setTabs ()
 output tabs More...
 
 getTabs (&$tabs_gui)
 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.

Member Function Documentation

◆ executeCommand()

& ilTermDefinitionEditorGUI::executeCommand ( )

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

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

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

+ Here is the call graph for this function:

◆ getTabs()

ilTermDefinitionEditorGUI::getTabs ( $tabs_gui)

get tabs

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

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

Referenced by setTabs().

+ Here is the caller graph for this function:

◆ ilTermDefinitionEditorGUI()

ilTermDefinitionEditorGUI::ilTermDefinitionEditorGUI ( )

Constructor @access public.

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

33 {
34 global $ilias, $tpl, $lng, $objDefinition, $ilCtrl;
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
45 $this->ctrl->saveParameter($this, array("def"));
46 }
Class ilGlossaryDefinition.
Class ilGlossaryTerm.
Class ilObjGlossary.
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, $ilCtrl, $ilias, $lng, and $tpl.

◆ main_header()

ilTermDefinitionEditorGUI::main_header (   $a_header_title)

output main header (title and locator)

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

162 {
163 global $lng;
164
165 $this->tpl->getStandardTemplate();
166 $this->tpl->setTitle($a_header_title);
167 $this->displayLocator();
168 //$this->setAdminTabs($a_type);
169 }

References $lng.

◆ saveShortText()

ilTermDefinitionEditorGUI::saveShortText ( )

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

199 {
200 $this->definition->updateShortText();
201 }

◆ setTabs()

ilTermDefinitionEditorGUI::setTabs ( )

output tabs

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

175 {
176 global $ilTabs;
177
178 // catch feedback message
179 $this->getTabs($ilTabs);
180 }

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 ilTermDefinitionEditorGUI().

◆ $lng

ilTermDefinitionEditorGUI::$lng

◆ $term

ilTermDefinitionEditorGUI::$term

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

◆ $tpl

ilTermDefinitionEditorGUI::$tpl

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