5 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
38 $this->ctrl->saveParameter($this, array(
"term_id"));
51 $next_class = $this->ctrl->getNextClass($this);
52 $cmd = $this->ctrl->getCmd();
57 case "iltermdefinitioneditorgui":
61 $ret =& $this->ctrl->forwardCommand($def_edit);
76 $this->offline_directory = $offdir;
85 return $this->offline_directory;
91 $this->glossary =& $a_glossary;
96 $this->link_xml = $a_link_xml;
113 $this->tpl->setTitle($this->lng->txt(
"cont_new_term"));
118 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.glossary_term_new.html",
true);
119 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
120 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_new_term"));
121 $this->tpl->setVariable(
"TXT_TERM", $this->lng->txt(
"cont_term"));
122 $this->tpl->setVariable(
"INPUT_TERM",
"term");
123 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
128 $s_lang =
$_SESSION[
"il_text_lang_".$_GET[
"ref_id"]];
132 $s_lang = $ilUser->getLanguage();
136 $this->tpl->setVariable(
"SELECT_LANGUAGE", $select_language);
137 $this->tpl->setVariable(
"BTN_NAME",
"saveTerm");
138 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
147 $term->setGlossary($this->glossary);
154 $this->ctrl->returnToParent($this);
169 $ilTabs->activateTab(
"properties");
172 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
176 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.glossary_term_edit.html",
true);
177 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"updateTerm"));
178 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_edit_term"));
179 $this->tpl->setVariable(
"TXT_TERM", $this->lng->txt(
"cont_term"));
180 $this->tpl->setVariable(
"INPUT_TERM",
"term");
181 $this->tpl->setVariable(
"VALUE_TERM", htmlspecialchars($this->term->getTerm()));
182 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
185 $this->tpl->setVariable(
"SELECT_LANGUAGE", $select_language);
186 $this->tpl->setVariable(
"BTN_NAME",
"updateTerm");
187 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
197 $this->term->setLanguage(
$_POST[
"term_language"]);
198 $this->term->update();
200 $this->ctrl->redirect($this,
"editTerm");
209 function getOverlayHTML($a_close_el_id, $a_glo_ov_id =
"", $a_lang =
"", $a_outputmode =
"offline")
215 $a_lang = $lng->getLangKey();
218 $tpl =
new ilTemplate(
"tpl.glossary_overlay.html",
true,
true,
"Modules/Glossary");
220 if ($a_outputmode ==
"preview")
222 $a_outputmode =
"presentation";
224 if ($a_outputmode ==
"offline")
232 if ($a_glo_ov_id !=
"")
234 $tpl->setCurrentBlock(
"glovlink");
235 $tpl->setVariable(
"TXT_LINK", $lng->txtlng(
"content",
"cont_sco_glossary", $a_lang));
236 $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
237 $tpl->parseCurrentBlock();
239 $tpl->setVariable(
"TXT_CLOSE", $lng->txtlng(
"common",
"close", $a_lang));
240 $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
249 function output($a_offline =
false, $a_tpl =
"", $a_outputmode =
"presentation")
260 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
261 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
265 $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
267 for($j=0; $j<count($defs); $j++)
271 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
279 $page_gui->setFullscreenLink(
"fullscreen.html");
281 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=".
$_GET[
"ref_id"]);
285 $page_gui->setOutputMode($a_outputmode);
289 $page_gui->setOutputMode(
"offline");
296 $page_gui->setTemplateOutput(
false);
297 $output = $page_gui->presentation($page_gui->getOutputMode());
299 if (count($defs) > 1)
301 $tpl->setCurrentBlock(
"definition_header");
302 $tpl->setVariable(
"TXT_DEFINITION",
303 $this->lng->txt(
"cont_definition").
" ".($j+1));
304 $tpl->parseCurrentBlock();
307 $tpl->setCurrentBlock(
"definition");
308 $tpl->setVariable(
"PAGE_CONTENT", $output);
309 $tpl->parseCurrentBlock();
318 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
319 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
323 $term_links = array();
324 for($j=0; $j<count($defs); $j++)
329 $page_links = $page->getInternalLinks();
330 foreach($page_links as $key => $page_link)
332 $term_links[$key] = $page_link;
349 $ilTabs->activateTab(
"definitions");
351 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
354 $this->tpl->setCurrentBlock(
"ContentStyle");
355 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
357 $this->tpl->parseCurrentBlock();
360 $this->tpl->setCurrentBlock(
"SyntaxStyle");
361 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
363 $this->tpl->parseCurrentBlock();
366 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_list.html",
true);
369 $this->tpl->addBlockfile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
370 $this->tpl->setTitle(
371 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
374 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
376 $this->tpl->setCurrentBlock(
"add_def");
377 $this->tpl->setVariable(
"TXT_ADD_DEFINITION",
378 $this->lng->txt(
"cont_add_definition"));
379 $this->tpl->setVariable(
"BTN_ADD",
"addDefinition");
380 $this->tpl->parseCurrentBlock();
381 $this->tpl->setCurrentBlock(
"def_list");
385 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
387 for($j=0; $j<count($defs); $j++)
391 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
392 $page_gui->setTemplateOutput(
false);
393 $output = $page_gui->preview();
395 if (count($defs) > 1)
397 $this->tpl->setCurrentBlock(
"definition_header");
398 $this->tpl->setVariable(
"TXT_DEFINITION",
399 $this->lng->txt(
"cont_definition").
" ".($j+1));
400 $this->tpl->parseCurrentBlock();
405 $this->tpl->setCurrentBlock(
"up");
406 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
407 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
408 $this->tpl->setVariable(
"LINK_UP",
409 $this->ctrl->getLinkTarget($this,
"moveUp"));
410 $this->tpl->parseCurrentBlock();
413 if ($j+1 < count($defs))
415 $this->tpl->setCurrentBlock(
"down");
416 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
417 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
418 $this->tpl->setVariable(
"LINK_DOWN",
419 $this->ctrl->getLinkTarget($this,
"moveDown"));
420 $this->tpl->parseCurrentBlock();
422 $this->tpl->setCurrentBlock(
"submit_btns");
423 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
424 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
425 $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI",
"def", $def[
"id"]);
426 $this->tpl->setVariable(
"LINK_EDIT",
427 $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI",
"ilPageObjectGUI"),
"edit"));
428 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
429 $this->tpl->setVariable(
"LINK_DELETE",
430 $this->ctrl->getLinkTarget($this,
"confirmDefinitionDeletion"));
431 $this->tpl->parseCurrentBlock();
433 $this->tpl->setCurrentBlock(
"definition");
434 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
435 $this->tpl->parseCurrentBlock();
453 $this->tpl->setCurrentBlock(
"ContentStyle");
454 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
456 $this->tpl->parseCurrentBlock();
459 $this->tpl->setCurrentBlock(
"SyntaxStyle");
460 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
462 $this->tpl->parseCurrentBlock();
464 $this->tpl->setTitle(
465 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
468 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_delete.html",
true);
471 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
477 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
478 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
479 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
480 $output = $page_gui->preview();
482 $this->tpl->setCurrentBlock(
"definition");
483 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
484 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
485 $this->tpl->setVariable(
"LINK_CANCEL",
486 $this->ctrl->getLinkTarget($this,
"cancelDefinitionDeletion"));
487 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
488 $this->ctrl->setParameter($this,
"def", $definition->getId());
489 $this->tpl->setVariable(
"LINK_CONFIRM",
490 $this->ctrl->getLinkTarget($this,
"deleteDefinition"));
491 $this->tpl->parseCurrentBlock();
496 $this->ctrl->redirect($this,
"listDefinitions");
503 $definition->delete();
504 $this->ctrl->redirect($this,
"listDefinitions");
514 $definition->moveUp();
515 $this->ctrl->redirect($this,
"listDefinitions");
525 $definition->moveDown();
526 $this->ctrl->redirect($this,
"listDefinitions");
539 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
542 $term_id =
$_GET[
"term_id"];
544 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.obj_edit.html");
545 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"saveDefinition"));
546 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"gdf_new"));
547 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
548 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"gdf_add"));
549 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
550 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"description"));
551 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveDefinition");
553 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
554 $this->tpl->parseCurrentBlock();
563 $this->ctrl->redirect($this,
"listDefinitions");
572 $def->setTermId(
$_GET[
"term_id"]);
577 $this->ctrl->redirect($this,
"listDefinitions");
586 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
587 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
598 #include_once("classes/class.ilTabsGUI.php");
599 #$tabs_gui =& new ilTabsGUI();
602 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
611 require_once (
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
613 $gloss_loc->setTerm($this->term);
614 $gloss_loc->setGlossary($this->glossary);
616 $gloss_loc->display();
628 if (
$_GET[
"term_id"] !=
"")
630 $tabs_gui->addTab(
"properties",
631 $lng->txt(
"properties"),
632 $this->ctrl->getLinkTarget($this,
"editTerm"));
634 $tabs_gui->addTab(
"definitions",
635 $lng->txt(
"cont_definitions"),
636 $this->ctrl->getLinkTarget($this,
"listDefinitions"));
638 $tabs_gui->addTab(
"usage",
640 $this->ctrl->getLinkTarget($this,
"listUsages"));
644 $tabs_gui->setBackTarget($this->lng->txt(
"glossary"),
645 $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui",
"listTerms"));
654 function _goto($a_target, $a_ref_id =
"")
663 $ref_ids = array($a_ref_id);
674 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
676 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
677 $_GET[
"term_id"] = $a_target;
679 $_GET[
"cmd"] =
"listDefinitions";
680 include_once(
"ilias.php");
684 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
686 $_GET[
"cmd"] =
"frameset";
687 $_GET[
"target"] =
"";
688 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
691 include(
"repository.php");
696 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
704 global $ilTabs,
$tpl;
710 $ilTabs->activateTab(
"usage");
711 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
714 include_once(
"./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
717 $tpl->setContent(
$tab->getHTML());