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);
77 $this->offline_directory = $offdir;
86 return $this->offline_directory;
92 $this->glossary = $a_glossary;
97 $this->link_xml = $a_link_xml;
132 $ilTabs->activateTab(
"properties");
134 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
137 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
139 $form->setFormAction($this->ctrl->getFormAction($this,
"updateTerm"));
140 $form->setTitle($this->lng->txt(
"cont_edit_term"));
143 $term->setRequired(
true);
144 $term->setValue($this->term->getTerm());
145 $form->addItem(
$term);
148 $lang->setRequired(
true);
150 $lang->setValue($this->term->getLanguage());
151 $form->addItem(
$lang);
154 if ($this->glossary->getTaxonomyId() > 0)
156 include_once(
"./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php");
159 $form->addItem($tax_node_assign);
162 $form->addCommandButton(
"updateTerm", $this->lng->txt(
"save"));
164 $this->tpl->setContent($form->getHTML());
177 $this->term->setLanguage(
$_POST[
"term_language"]);
178 $this->term->update();
181 if ($this->glossary->getTaxonomyId() > 0)
183 include_once(
"./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php");
185 $tax_node_assign->
saveInput(
"glo",
"term", $this->term->getId());
189 $this->ctrl->redirect($this,
"editTerm");
198 function getOverlayHTML($a_close_el_id, $a_glo_ov_id =
"", $a_lang =
"", $a_outputmode =
"offline")
204 $a_lang = $lng->getLangKey();
207 $tpl =
new ilTemplate(
"tpl.glossary_overlay.html",
true,
true,
"Modules/Glossary");
209 if ($a_outputmode ==
"preview")
211 $a_outputmode =
"presentation";
213 if ($a_outputmode ==
"offline")
221 if ($a_glo_ov_id !=
"")
223 $tpl->setCurrentBlock(
"glovlink");
224 $tpl->setVariable(
"TXT_LINK", $lng->txtlng(
"content",
"cont_sco_glossary", $a_lang));
225 $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
226 $tpl->parseCurrentBlock();
228 $tpl->setVariable(
"TXT_CLOSE", $lng->txtlng(
"common",
"close", $a_lang));
229 $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
238 function output($a_offline =
false, $a_tpl =
"", $a_outputmode =
"presentation")
249 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
250 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
254 $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
256 for($j=0; $j<count($defs); $j++)
260 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
268 $page_gui->setFullscreenLink(
"fullscreen.html");
270 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=".
$_GET[
"ref_id"]);
274 $page_gui->setOutputMode($a_outputmode);
278 $page_gui->setOutputMode(
"offline");
285 $page_gui->setTemplateOutput(
false);
286 $output = $page_gui->presentation($page_gui->getOutputMode());
288 if (count($defs) > 1)
290 $tpl->setCurrentBlock(
"definition_header");
291 $tpl->setVariable(
"TXT_DEFINITION",
292 $this->lng->txt(
"cont_definition").
" ".($j+1));
293 $tpl->parseCurrentBlock();
296 $tpl->setCurrentBlock(
"definition");
297 $tpl->setVariable(
"PAGE_CONTENT", $output);
298 $tpl->parseCurrentBlock();
307 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
308 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
312 $term_links = array();
313 for($j=0; $j<count($defs); $j++)
318 $page_links = $page->getInternalLinks();
319 foreach($page_links as $key => $page_link)
321 $term_links[$key] = $page_link;
338 $ilTabs->activateTab(
"definitions");
339 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
342 $this->tpl->setCurrentBlock(
"ContentStyle");
343 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
345 $this->tpl->parseCurrentBlock();
348 $this->tpl->setCurrentBlock(
"SyntaxStyle");
349 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
351 $this->tpl->parseCurrentBlock();
354 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_list.html",
true);
357 $this->tpl->addBlockfile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
358 $this->tpl->setTitle(
359 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
362 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
364 $this->tpl->setCurrentBlock(
"add_def");
365 $this->tpl->setVariable(
"TXT_ADD_DEFINITION",
366 $this->lng->txt(
"cont_add_definition"));
367 $this->tpl->setVariable(
"BTN_ADD",
"addDefinition");
368 $this->tpl->parseCurrentBlock();
369 $this->tpl->setCurrentBlock(
"def_list");
373 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
375 for($j=0; $j<count($defs); $j++)
379 $page_gui->setStyleId($this->glossary->getStyleSheetId());
380 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
381 $page_gui->setTemplateOutput(
false);
382 $output = $page_gui->preview();
384 if (count($defs) > 1)
386 $this->tpl->setCurrentBlock(
"definition_header");
387 $this->tpl->setVariable(
"TXT_DEFINITION",
388 $this->lng->txt(
"cont_definition").
" ".($j+1));
389 $this->tpl->parseCurrentBlock();
394 $this->tpl->setCurrentBlock(
"up");
395 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
396 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
397 $this->tpl->setVariable(
"LINK_UP",
398 $this->ctrl->getLinkTarget($this,
"moveUp"));
399 $this->tpl->parseCurrentBlock();
402 if ($j+1 < count($defs))
404 $this->tpl->setCurrentBlock(
"down");
405 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
406 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
407 $this->tpl->setVariable(
"LINK_DOWN",
408 $this->ctrl->getLinkTarget($this,
"moveDown"));
409 $this->tpl->parseCurrentBlock();
411 $this->tpl->setCurrentBlock(
"submit_btns");
412 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
413 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
414 $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI",
"def", $def[
"id"]);
415 $this->tpl->setVariable(
"LINK_EDIT",
416 $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI",
"ilPageObjectGUI"),
"edit"));
417 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
418 $this->tpl->setVariable(
"LINK_DELETE",
419 $this->ctrl->getLinkTarget($this,
"confirmDefinitionDeletion"));
420 $this->tpl->parseCurrentBlock();
422 $this->tpl->setCurrentBlock(
"definition");
423 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
424 $this->tpl->parseCurrentBlock();
443 $ilTabs->activateTab(
"definitions");
446 $this->tpl->setCurrentBlock(
"ContentStyle");
447 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
449 $this->tpl->parseCurrentBlock();
452 $this->tpl->setCurrentBlock(
"SyntaxStyle");
453 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
455 $this->tpl->parseCurrentBlock();
457 $this->tpl->setTitle(
458 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
461 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_delete.html",
true);
464 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
470 $page_gui->setStyleId($this->glossary->getStyleSheetId());
471 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
472 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
473 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
474 $output = $page_gui->preview();
476 $this->tpl->setCurrentBlock(
"definition");
477 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
478 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
479 $this->tpl->setVariable(
"LINK_CANCEL",
480 $this->ctrl->getLinkTarget($this,
"cancelDefinitionDeletion"));
481 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
482 $this->ctrl->setParameter($this,
"def", $definition->getId());
483 $this->tpl->setVariable(
"LINK_CONFIRM",
484 $this->ctrl->getLinkTarget($this,
"deleteDefinition"));
485 $this->tpl->parseCurrentBlock();
490 $this->ctrl->redirect($this,
"listDefinitions");
497 $definition->delete();
498 $this->ctrl->redirect($this,
"listDefinitions");
508 $definition->moveUp();
509 $this->ctrl->redirect($this,
"listDefinitions");
519 $definition->moveDown();
520 $this->ctrl->redirect($this,
"listDefinitions");
534 $ilTabs->activateTab(
"definitions");
536 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
539 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
541 $form->setFormAction($this->ctrl->getFormAction($this,
"saveDefinition"));
542 $form->setTitle($this->lng->txt(
"gdf_new"));
545 $title->setRequired(
true);
549 $form->addItem($desc);
551 $form->addCommandButton(
"saveDefinition", $this->lng->txt(
"gdf_add"));
552 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
554 $this->tpl->setContent($form->getHTML());
562 $this->ctrl->redirect($this,
"listDefinitions");
571 $def->setTermId(
$_GET[
"term_id"]);
576 $this->ctrl->redirect($this,
"listDefinitions");
585 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
586 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
603 require_once (
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
605 $gloss_loc->setTerm($this->term);
606 $gloss_loc->setGlossary($this->glossary);
608 $gloss_loc->display();
617 global
$lng, $ilHelp;
620 $ilHelp->setScreenIdComponent(
"glo_term");
623 if (
$_GET[
"term_id"] !=
"")
625 $tabs_gui->addTab(
"properties",
626 $lng->txt(
"properties"),
627 $this->ctrl->getLinkTarget($this,
"editTerm"));
629 $tabs_gui->addTab(
"definitions",
630 $lng->txt(
"cont_definitions"),
631 $this->ctrl->getLinkTarget($this,
"listDefinitions"));
633 $tabs_gui->addTab(
"usage",
635 $this->ctrl->getLinkTarget($this,
"listUsages"));
637 $tabs_gui->addNonTabbedLink(
"presentation_view",
638 $this->lng->txt(
"glo_presentation_view"),
642 "_".$_GET[
"term_id"].
"_".
$_GET[
"ref_id"].
"&client_id=".CLIENT_ID,
649 $tabs_gui->setBackTarget($this->lng->txt(
"glossary"),
650 $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui",
"listTerms"));
659 function _goto($a_target, $a_ref_id =
"")
668 $ref_ids = array($a_ref_id);
679 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
681 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
682 $_GET[
"term_id"] = $a_target;
684 $_GET[
"cmd"] =
"listDefinitions";
685 include_once(
"ilias.php");
689 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
697 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
705 global $ilTabs,
$tpl;
711 $ilTabs->activateTab(
"usage");
713 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
716 include_once(
"./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
719 $tpl->setContent(
$tab->getHTML());
733 include_once(
"./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
735 $tpl->setLeftNavContent(
$tab->getHTML());