Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 require_once("classes/class.ilObjStyleSheet.php");
00025 require_once ("content/classes/Pages/class.ilPageObjectGUI.php");
00026
00037 class ilTermDefinitionEditorGUI
00038 {
00039 var $ilias;
00040 var $tpl;
00041 var $lng;
00042 var $glossary;
00043 var $definition;
00044 var $term;
00045
00050 function ilTermDefinitionEditorGUI()
00051 {
00052 global $ilias, $tpl, $lng, $objDefinition, $ilCtrl;
00053
00054
00055 $this->ilias =& $ilias;
00056 $this->tpl =& $tpl;
00057 $this->lng =& $lng;
00058 $this->ctrl =& $ilCtrl;
00059 $this->glossary =& new ilObjGlossary($_GET["ref_id"], true);
00060 $this->definition =& new ilGlossaryDefinition($_GET["def"]);
00061 $this->term =& new ilGlossaryTerm($this->definition->getTermId());
00062
00063 $this->ctrl->saveParameter($this, array("def"));
00064 }
00065
00066
00067 function &executeCommand()
00068 {
00069 $next_class = $this->ctrl->getNextClass($this);
00070 $cmd = $this->ctrl->getCmd();
00071
00072
00073
00074 $this->tpl->setCurrentBlock("ContentStyle");
00075 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
00076 ilObjStyleSheet::getContentStylePath(0));
00077 $this->tpl->parseCurrentBlock();
00078
00079
00080 $this->tpl->setCurrentBlock("SyntaxStyle");
00081 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
00082 ilObjStyleSheet::getSyntaxStylePath());
00083 $this->tpl->parseCurrentBlock();
00084
00085
00086
00087
00088
00089
00090 require_once ("content/classes/class.ilGlossaryLocatorGUI.php");
00091 $gloss_loc =& new ilGlossaryLocatorGUI();
00092 $gloss_loc->setTerm($this->term);
00093 $gloss_loc->setGlossary($this->glossary);
00094 $gloss_loc->setDefinition($this->definition);
00095
00096 $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
00097 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
00098 $this->tpl->setTitle($this->term->getTerm()." - ".
00099 $this->lng->txt("cont_definition")." ".
00100 $this->definition->getNr());
00101 if ($this->ctrl->getCmdClass() == "ilpageobjectgui")
00102 {
00103 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_def_b.gif"));
00104 }
00105
00106 switch ($next_class)
00107 {
00108 case "ilmdeditorgui":
00109 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.gif"));
00110 $gloss_loc->display();
00111 $this->setTabs();
00112 include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
00113
00114 $md_gui =& new ilMDEditorGUI($this->glossary->getId(), $this->definition->getId(), "gdf");
00115
00116
00117 $this->ctrl->forwardCommand($md_gui);
00118 break;
00119
00120
00121 case "ilpageobjectgui":
00122
00123
00124 if ($this->ctrl->getCmdClass() == "ilpageobjectgui"
00125 || $this->ctrl->getCmdClass() == "ileditclipboardgui")
00126 {
00127 $gloss_loc->display();
00128 }
00129 $this->setTabs();
00130 $this->ctrl->setReturnByClass("ilPageObjectGUI", "view");
00131 $this->ctrl->setReturn($this, "listDefinitions");
00132 $page =& $this->definition->getPageObject();
00133 $page->addUpdateListener($this, "saveShortText");
00134 $page_gui =& new ilPageObjectGUI($page);
00135 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
00136 $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"] . "&cmd=fullscreen");
00137 $page_gui->setTemplateTargetVar("ADM_CONTENT");
00138 $page_gui->setOutputMode("edit");
00139 $page_gui->setLocator($gloss_loc);
00140 $page_gui->setIntLinkHelpDefault("GlossaryItem", $_GET["ref_id"]);
00141 $page_gui->setIntLinkReturn($this->ctrl->getLinkTargetByClass("ilobjglossarygui", "quickList"));
00142 $page_gui->setPageBackTitle($this->lng->txt("cont_definition"));
00143 $page_gui->setLinkParams("ref_id=".$_GET["ref_id"]);
00144 $page_gui->setHeader($this->term->getTerm());
00145 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"] . "&cmd=downloadFile");
00146
00147
00148
00149
00150
00151
00152 $page_gui->setPresentationTitle($this->term->getTerm());
00153
00154 $ret =& $this->ctrl->forwardCommand($page_gui);
00155
00156 break;
00157
00158 default:
00159 $this->setTabs();
00160 $gloss_loc->display();
00161 $ret =& $this->$cmd();
00162 break;
00163
00164 }
00165 }
00166
00167
00171 function main_header($a_header_title)
00172 {
00173 global $lng;
00174
00175 $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
00176 $this->tpl->setVariable("HEADER", $a_header_title);
00177 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
00178 $this->displayLocator();
00179
00180 }
00181
00185 function setTabs()
00186 {
00187 global $ilTabs;
00188
00189
00190 #include_once("classes/class.ilTabsGUI.php");
00191 #$tabs_gui =& new ilTabsGUI();
00192 $this->getTabs($ilTabs);
00193
00194 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
00195
00196 }
00197
00201 function getTabs(&$tabs_gui)
00202 {
00203
00204 $tabs_gui->addTarget("edit",
00205 $this->ctrl->getLinkTargetByClass("ilPageObjectGUI", "view"), "view",
00206 "ilPageObjectGUI");
00207
00208
00209 $tabs_gui->addTarget("cont_preview",
00210 $this->ctrl->getLinkTargetByClass("ilPageObjectGUI", "preview"), "preview",
00211 "ilPageObjectGUI");
00212
00213
00214 $tabs_gui->addTarget("meta_data",
00215 $this->ctrl->getLinkTargetByClass('ilmdeditorgui',''),
00216 "", "ilmdeditorgui");
00217
00218
00219
00220
00221
00222
00223 $tabs_gui->setBack2Target($this->lng->txt("glossary"),
00224 $this->ctrl->getParentReturn($this));
00225
00226
00227 $tabs_gui->setBackTarget($this->lng->txt("term"),
00228 $this->ctrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
00229
00230
00231
00232
00233
00234
00235 }
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271 function saveShortText()
00272 {
00273 $this->definition->updateShortText();
00274 }
00275 }
00276 ?>