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->setVariable(
"HEADER", $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->setVariable(
"HEADER", $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");
 
  213                 $tpl = 
new ilTemplate(
"tpl.glossary_overlay.html", 
true, 
true, 
"Modules/Glossary");
 
  215                 if ($a_glo_ov_id != 
"")
 
  217                         $tpl->setCurrentBlock(
"glovlink");
 
  218                         $tpl->setVariable(
"TXT_LINK", $lng->txt(
"cont_sco_glossary"));
 
  219                         $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
 
  220                         $tpl->parseCurrentBlock();
 
  222                 $tpl->setVariable(
"TXT_CLOSE", $lng->txt(
"close"));
 
  223                 $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
 
  232         function output($a_offline = 
false, $a_tpl = 
"")
 
  243                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  244                 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
 
  248                 $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  250                 for($j=0; $j<count($defs); $j++)
 
  254                         $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  262                                 $page_gui->setFullscreenLink(
"fullscreen.html");        
 
  264                         $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=".
$_GET[
"ref_id"]);
 
  268                                 $page_gui->setOutputMode(
"presentation");
 
  272                                 $page_gui->setOutputMode(
"offline");
 
  279                         $page_gui->setTemplateOutput(
false);
 
  280                         $output = $page_gui->presentation($page_gui->getOutputMode());
 
  282                         if (count($defs) > 1)
 
  284                                 $tpl->setCurrentBlock(
"definition_header");
 
  285                                                 $tpl->setVariable(
"TXT_DEFINITION",
 
  286                                 $this->lng->txt(
"cont_definition").
" ".($j+1));
 
  287                                 $tpl->parseCurrentBlock();
 
  290                         $tpl->setCurrentBlock(
"definition");
 
  291                         $tpl->setVariable(
"PAGE_CONTENT", $output);
 
  292                         $tpl->parseCurrentBlock();
 
  301                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  302                 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
 
  306                 $term_links = array();
 
  307                 for($j=0; $j<count($defs); $j++)
 
  312                         $page_links = $page->getInternalLinks();
 
  313                         foreach($page_links as $key => $page_link)
 
  315                                 $term_links[$key] = $page_link;
 
  332                 $ilTabs->activateTab(
"definitions");
 
  334                 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
 
  337                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  338                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  340                 $this->tpl->parseCurrentBlock();
 
  343                 $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  344                 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
  346                 $this->tpl->parseCurrentBlock();
 
  349                 $this->tpl->addBlockfile(
"ADM_CONTENT", 
"def_list", 
"tpl.glossary_definition_list.html", 
true);
 
  352                 $this->tpl->addBlockfile(
"STATUSLINE", 
"statusline", 
"tpl.statusline.html");
 
  353                 $this->tpl->setVariable(
"HEADER",
 
  354                         $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  357                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  359                 $this->tpl->setCurrentBlock(
"add_def");
 
  360                 $this->tpl->setVariable(
"TXT_ADD_DEFINITION",
 
  361                         $this->lng->txt(
"cont_add_definition"));
 
  362                 $this->tpl->setVariable(
"BTN_ADD", 
"addDefinition");
 
  363                 $this->tpl->parseCurrentBlock();
 
  364                 $this->tpl->setCurrentBlock(
"def_list");
 
  368                 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  370                 for($j=0; $j<count($defs); $j++)
 
  374                         $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  375                         $page_gui->setTemplateOutput(
false);
 
  376                         $output = $page_gui->preview();
 
  378                         if (count($defs) > 1)
 
  380                                 $this->tpl->setCurrentBlock(
"definition_header");
 
  381                                                 $this->tpl->setVariable(
"TXT_DEFINITION",
 
  382                                 $this->lng->txt(
"cont_definition").
" ".($j+1));
 
  383                                 $this->tpl->parseCurrentBlock();
 
  388                                 $this->tpl->setCurrentBlock(
"up");
 
  389                                 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
 
  390                                 $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  391                                 $this->tpl->setVariable(
"LINK_UP",
 
  392                                         $this->ctrl->getLinkTarget($this, 
"moveUp"));
 
  393                                 $this->tpl->parseCurrentBlock();
 
  396                         if ($j+1 < count($defs))
 
  398                                 $this->tpl->setCurrentBlock(
"down");
 
  399                                 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
 
  400                                 $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  401                                 $this->tpl->setVariable(
"LINK_DOWN",
 
  402                                         $this->ctrl->getLinkTarget($this, 
"moveDown"));
 
  403                                 $this->tpl->parseCurrentBlock();
 
  405                         $this->tpl->setCurrentBlock(
"submit_btns");
 
  406                         $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
 
  407                         $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  408                         $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI", 
"def", $def[
"id"]);
 
  409                         $this->tpl->setVariable(
"LINK_EDIT",
 
  410                                 $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI", 
"ilPageObjectGUI"), 
"edit"));
 
  411                         $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
 
  412                         $this->tpl->setVariable(
"LINK_DELETE",
 
  413                                 $this->ctrl->getLinkTarget($this, 
"confirmDefinitionDeletion"));
 
  414                         $this->tpl->parseCurrentBlock();
 
  416                         $this->tpl->setCurrentBlock(
"definition");
 
  417                         $this->tpl->setVariable(
"PAGE_CONTENT", $output);
 
  418                         $this->tpl->parseCurrentBlock();
 
  436                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  437                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  439                 $this->tpl->parseCurrentBlock();
 
  442                 $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  443                 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
  445                 $this->tpl->parseCurrentBlock();
 
  447                 $this->tpl->setVariable(
"HEADER",
 
  448                         $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  451                 $this->tpl->addBlockfile(
"ADM_CONTENT", 
"def_list", 
"tpl.glossary_definition_delete.html", 
true);
 
  454                 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  460                 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  461                 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  462                 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  463                 $output = $page_gui->preview();
 
  465                 $this->tpl->setCurrentBlock(
"definition");
 
  466                 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
 
  467                 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  468                 $this->tpl->setVariable(
"LINK_CANCEL",
 
  469                         $this->ctrl->getLinkTarget($this, 
"cancelDefinitionDeletion"));
 
  470                 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
 
  471                 $this->ctrl->setParameter($this, 
"def", $definition->getId());
 
  472                 $this->tpl->setVariable(
"LINK_CONFIRM",
 
  473                         $this->ctrl->getLinkTarget($this, 
"deleteDefinition"));
 
  474                 $this->tpl->parseCurrentBlock();
 
  479                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  486                 $definition->delete();
 
  487                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  497                 $definition->moveUp();
 
  498                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  508                 $definition->moveDown();
 
  509                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  522                 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  525                 $term_id = 
$_GET[
"term_id"];
 
  527                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.obj_edit.html");
 
  528                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"saveDefinition"));
 
  529                 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"gdf_new"));
 
  530                 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  531                 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"gdf_add"));
 
  532                 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
 
  533                 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"description"));
 
  534                 $this->tpl->setVariable(
"CMD_SUBMIT", 
"saveDefinition");
 
  536                 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
 
  537                 $this->tpl->parseCurrentBlock();
 
  546                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  555                 $def->setTermId(
$_GET[
"term_id"]);
 
  560                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  569                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
  570                 $this->tpl->addBlockFile(
"STATUSLINE", 
"statusline", 
"tpl.statusline.html");
 
  581                 #include_once("classes/class.ilTabsGUI.php"); 
  582                 #$tabs_gui =& new ilTabsGUI(); 
  585                 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML()); 
  594                 require_once (
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
 
  596                 $gloss_loc->setTerm($this->term);
 
  597                 $gloss_loc->setGlossary($this->glossary);
 
  599                 $gloss_loc->display();
 
  611                 if (
$_GET[
"term_id"] != 
"")
 
  613                         $tabs_gui->addTab(
"properties",
 
  614                                 $lng->txt(
"properties"),
 
  615                                 $this->ctrl->getLinkTarget($this, 
"editTerm"));
 
  617                         $tabs_gui->addTab(
"definitions",
 
  618                                 $lng->txt(
"cont_definitions"),
 
  619                                 $this->ctrl->getLinkTarget($this, 
"listDefinitions"));
 
  621                         $tabs_gui->addTab(
"usage",
 
  623                                 $this->ctrl->getLinkTarget($this, 
"listUsages"));
 
  627                 $tabs_gui->setBackTarget($this->lng->txt(
"glossary"),
 
  628                         $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui", 
"listTerms"));
 
  637         function _goto($a_target, $a_ref_id = 
"")
 
  646                         $ref_ids = array($a_ref_id);
 
  657                         if ($ilAccess->checkAccess(
"read", 
"", $ref_id))
 
  659                                 $_GET[
"baseClass"] = 
"ilGlossaryPresentationGUI";
 
  660                                 $_GET[
"term_id"] = $a_target;
 
  662                                 $_GET[
"cmd"] = 
"listDefinitions";
 
  663                                 include_once(
"ilias.php");
 
  667                 if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
  669                         $_GET[
"cmd"] = 
"frameset";
 
  670                         $_GET[
"target"] = 
"";
 
  671                         $_GET[
"ref_id"] = ROOT_FOLDER_ID;
 
  674                         include(
"repository.php");
 
  679                 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
 
  687                 global $ilTabs, 
$tpl;
 
  693                 $ilTabs->activateTab(
"usage");
 
  694                 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  697                 include_once(
"./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
 
  700                 $tpl->setContent(
$tab->getHTML());