24 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
57 $this->ctrl->saveParameter($this, array(
"term_id"));
70 $next_class = $this->ctrl->getNextClass($this);
71 $cmd = $this->ctrl->getCmd();
76 case "iltermdefinitioneditorgui":
80 $ret =& $this->ctrl->forwardCommand($def_edit);
95 $this->offline_directory = $offdir;
104 return $this->offline_directory;
110 $this->glossary =& $a_glossary;
115 $this->link_xml = $a_link_xml;
132 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"cont_new_term"));
137 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.glossary_term_new.html",
true);
138 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
139 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_new_term"));
140 $this->tpl->setVariable(
"TXT_TERM", $this->lng->txt(
"cont_term"));
141 $this->tpl->setVariable(
"INPUT_TERM",
"term");
142 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
147 $s_lang =
$_SESSION[
"il_text_lang_".$_GET[
"ref_id"]];
151 $s_lang = $ilUser->getLanguage();
155 $this->tpl->setVariable(
"SELECT_LANGUAGE", $select_language);
156 $this->tpl->setVariable(
"BTN_NAME",
"saveTerm");
157 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
166 $term->setGlossary($this->glossary);
173 $this->ctrl->returnToParent($this);
187 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
191 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.glossary_term_edit.html",
true);
192 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"updateTerm"));
193 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_edit_term"));
194 $this->tpl->setVariable(
"TXT_TERM", $this->lng->txt(
"cont_term"));
195 $this->tpl->setVariable(
"INPUT_TERM",
"term");
196 $this->tpl->setVariable(
"VALUE_TERM", htmlspecialchars($this->term->getTerm()));
197 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
200 $this->tpl->setVariable(
"SELECT_LANGUAGE", $select_language);
201 $this->tpl->setVariable(
"BTN_NAME",
"updateTerm");
202 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
212 $this->term->setLanguage(
$_POST[
"term_language"]);
213 $this->term->update();
215 $this->ctrl->redirect($this,
"editTerm");
225 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
226 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
230 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
232 for($j=0; $j<count($defs); $j++)
236 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
239 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".
$_GET[
"ref_id"]);
243 $page_gui->setFullscreenLink(
"fullscreen.html");
245 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=".
$_GET[
"ref_id"]);
249 $page_gui->setOutputMode(
"presentation");
253 $page_gui->setOutputMode(
"offline");
260 $page_gui->setTemplateOutput(
false);
261 $output = $page_gui->presentation($page_gui->getOutputMode());
263 if (count($defs) > 1)
265 $this->tpl->setCurrentBlock(
"definition_header");
266 $this->tpl->setVariable(
"TXT_DEFINITION",
267 $this->lng->txt(
"cont_definition").
" ".($j+1));
268 $this->tpl->parseCurrentBlock();
271 $this->tpl->setCurrentBlock(
"definition");
272 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
273 $this->tpl->parseCurrentBlock();
282 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
283 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
287 $term_links = array();
288 for($j=0; $j<count($defs); $j++)
293 $page_links = $page->getInternalLinks();
294 foreach($page_links as
$key => $page_link)
296 $term_links[
$key] = $page_link;
312 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
315 $this->tpl->setCurrentBlock(
"ContentStyle");
316 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
318 $this->tpl->parseCurrentBlock();
321 $this->tpl->setCurrentBlock(
"SyntaxStyle");
322 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
324 $this->tpl->parseCurrentBlock();
327 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_list.html",
true);
330 $this->tpl->addBlockfile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
331 $this->tpl->setVariable(
"HEADER",
332 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
335 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
337 $this->tpl->setCurrentBlock(
"add_def");
338 $this->tpl->setVariable(
"TXT_ADD_DEFINITION",
339 $this->lng->txt(
"cont_add_definition"));
340 $this->tpl->setVariable(
"BTN_ADD",
"addDefinition");
341 $this->tpl->parseCurrentBlock();
342 $this->tpl->setCurrentBlock(
"def_list");
346 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
348 for($j=0; $j<count($defs); $j++)
352 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
353 $page_gui->setTemplateOutput(
false);
354 $output = $page_gui->preview();
356 if (count($defs) > 1)
358 $this->tpl->setCurrentBlock(
"definition_header");
359 $this->tpl->setVariable(
"TXT_DEFINITION",
360 $this->lng->txt(
"cont_definition").
" ".($j+1));
361 $this->tpl->parseCurrentBlock();
366 $this->tpl->setCurrentBlock(
"up");
367 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
368 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
369 $this->tpl->setVariable(
"LINK_UP",
370 $this->ctrl->getLinkTarget($this,
"moveUp"));
371 $this->tpl->parseCurrentBlock();
374 if ($j+1 < count($defs))
376 $this->tpl->setCurrentBlock(
"down");
377 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
378 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
379 $this->tpl->setVariable(
"LINK_DOWN",
380 $this->ctrl->getLinkTarget($this,
"moveDown"));
381 $this->tpl->parseCurrentBlock();
383 $this->tpl->setCurrentBlock(
"submit_btns");
384 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
385 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
386 $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI",
"def", $def[
"id"]);
387 $this->tpl->setVariable(
"LINK_EDIT",
388 $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI",
"ilPageObjectGUI"),
"edit"));
389 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
390 $this->tpl->setVariable(
"LINK_DELETE",
391 $this->ctrl->getLinkTarget($this,
"confirmDefinitionDeletion"));
392 $this->tpl->parseCurrentBlock();
394 $this->tpl->setCurrentBlock(
"definition");
395 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
396 $this->tpl->parseCurrentBlock();
414 $this->tpl->setCurrentBlock(
"ContentStyle");
415 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
417 $this->tpl->parseCurrentBlock();
420 $this->tpl->setCurrentBlock(
"SyntaxStyle");
421 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
423 $this->tpl->parseCurrentBlock();
425 $this->tpl->setVariable(
"HEADER",
426 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
429 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_delete.html",
true);
432 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
438 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
439 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
440 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
441 $output = $page_gui->preview();
443 $this->tpl->setCurrentBlock(
"definition");
444 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
445 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
446 $this->tpl->setVariable(
"LINK_CANCEL",
447 $this->ctrl->getLinkTarget($this,
"cancelDefinitionDeletion"));
448 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
449 $this->ctrl->setParameter($this,
"def", $definition->getId());
450 $this->tpl->setVariable(
"LINK_CONFIRM",
451 $this->ctrl->getLinkTarget($this,
"deleteDefinition"));
452 $this->tpl->parseCurrentBlock();
457 $this->ctrl->redirect($this,
"listDefinitions");
464 $definition->delete();
465 $this->ctrl->redirect($this,
"listDefinitions");
475 $definition->moveUp();
476 $this->ctrl->redirect($this,
"listDefinitions");
486 $definition->moveDown();
487 $this->ctrl->redirect($this,
"listDefinitions");
500 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
503 $term_id =
$_GET[
"term_id"];
505 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.obj_edit.html");
506 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"saveDefinition"));
507 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"gdf_new"));
508 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
509 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"gdf_add"));
510 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
511 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"description"));
512 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveDefinition");
514 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
515 $this->tpl->parseCurrentBlock();
524 $this->ctrl->redirect($this,
"listDefinitions");
533 $def->setTermId(
$_GET[
"term_id"]);
538 $this->ctrl->redirect($this,
"listDefinitions");
547 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
548 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
559 #include_once("classes/class.ilTabsGUI.php");
560 #$tabs_gui =& new ilTabsGUI();
563 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
572 require_once (
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
574 $gloss_loc->setTerm($this->term);
575 $gloss_loc->setGlossary($this->glossary);
577 $gloss_loc->display();
587 if (
$_GET[
"term_id"] !=
"")
589 $tabs_gui->addTarget(
"properties",
590 $this->ctrl->getLinkTarget($this,
"editTerm"), array(
"editTerm"),
593 $tabs_gui->addTarget(
"cont_definitions",
594 $this->ctrl->getLinkTarget($this,
"listDefinitions"),
600 $tabs_gui->setBackTarget($this->lng->txt(
"glossary"),
601 $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui",
"listTerms"));
609 function _goto($a_target, $a_ref_id =
"")
618 $ref_ids = array($a_ref_id);
629 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
631 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
632 $_GET[
"term_id"] = $a_target;
634 $_GET[
"cmd"] =
"listDefinitions";
635 include_once(
"ilias.php");
639 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
641 $_GET[
"cmd"] =
"frameset";
642 $_GET[
"target"] =
"";
643 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
646 include(
"repository.php");
651 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);