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);
 
   65                         case "ilpropertyformgui";
 
   67                                 $this->ctrl->forwardCommand($form);
 
   82                 $this->offline_directory = $offdir;
 
   91                 return $this->offline_directory;
 
   97                 $this->glossary = $a_glossary;
 
  102                 $this->link_xml = $a_link_xml;
 
  137                 $ilTabs->activateTab(
"properties");
 
  139                 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  144                 $this->tpl->setContent($ilCtrl->getHTML($form));
 
  159                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  161                 $form->setFormAction($this->ctrl->getFormAction($this, 
"updateTerm"));
 
  162                 $form->setTitle($this->lng->txt(
"cont_edit_term"));
 
  165                 $term->setRequired(
true);
 
  166                 $term->setValue($this->term->getTerm());
 
  167                 $form->addItem(
$term);
 
  170                 $lang->setRequired(
true);
 
  172                 $lang->setValue($this->term->getLanguage());
 
  173                 $form->addItem(
$lang);
 
  176                 if ($this->glossary->getTaxonomyId() > 0)
 
  178                         include_once(
"./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
 
  179                         $tax_node_assign = 
new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(), 
"tax_node", 
true);
 
  181                         include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
 
  182                         $ta = 
new ilTaxNodeAssignment(
"glo", $this->glossary->getId(), 
"term", $this->glossary->getTaxonomyId());
 
  185                         foreach ($assgnmts as $a)
 
  187                                 $node_ids[] = $a[
"node_id"];
 
  189                         $tax_node_assign->setValue($node_ids);
 
  191                         $form->addItem($tax_node_assign);
 
  196                 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
 
  198                         $this->term->getId());
 
  200                 $record_gui->setSelectedOnly(
true);
 
  201                 $record_gui->parse();
 
  203                 $form->addCommandButton(
"updateTerm", $this->lng->txt(
"save"));
 
  217                 $this->term->setLanguage(
$_POST[
"term_language"]);
 
  218                 $this->term->update();
 
  221                 if ($this->glossary->getTaxonomyId() > 0)
 
  223                         include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
 
  224                         $ta = 
new ilTaxNodeAssignment(
"glo", $this->glossary->getId(), 
"term", $this->glossary->getTaxonomyId());
 
  226                         if (is_array(
$_POST[
"tax_node"]))
 
  228                                 foreach (
$_POST[
"tax_node"] as $node_id)
 
  230                                         $ta->addAssignment($node_id, $this->term->getId());
 
  237                 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
 
  239                         'glo',$this->glossary->getId(),
'term', $this->term->getId());
 
  241                 $record_gui->saveValues();
 
  244                 $this->ctrl->redirect($this, 
"editTerm");
 
  253         function getOverlayHTML($a_close_el_id, $a_glo_ov_id = 
"", $a_lang = 
"", $a_outputmode = 
"offline")
 
  259                         $a_lang = $lng->getLangKey();
 
  262                 $tpl = 
new ilTemplate(
"tpl.glossary_overlay.html", 
true, 
true, 
"Modules/Glossary");
 
  264                 if ($a_outputmode == 
"preview")
 
  266                         $a_outputmode = 
"presentation";
 
  268                 if ($a_outputmode == 
"offline")
 
  276                 if ($a_glo_ov_id != 
"")
 
  278                         $tpl->setCurrentBlock(
"glovlink");
 
  279                         $tpl->setVariable(
"TXT_LINK", $lng->txtlng(
"content", 
"cont_sco_glossary", $a_lang));
 
  280                         $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
 
  281                         $tpl->parseCurrentBlock();
 
  283                 $tpl->setVariable(
"TXT_CLOSE", $lng->txtlng(
"common", 
"close", $a_lang));
 
  284                 $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
 
  293         function output($a_offline = 
false, $a_tpl = 
"", $a_outputmode = 
"presentation")
 
  304                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  305                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
 
  309                 $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  311                 for($j=0; $j<count($defs); $j++)
 
  315                         $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  323                                 $page_gui->setFullscreenLink(
"fullscreen.html");        
 
  325                         $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=".
$_GET[
"ref_id"]);
 
  329                                 $page_gui->setOutputMode($a_outputmode);
 
  333                                 $page_gui->setOutputMode(
"offline");
 
  340                         $page_gui->setTemplateOutput(
false);
 
  341                         $output = $page_gui->presentation($page_gui->getOutputMode());
 
  343                         if (count($defs) > 1)
 
  345                                 $tpl->setCurrentBlock(
"definition_header");
 
  346                                                 $tpl->setVariable(
"TXT_DEFINITION",
 
  347                                 $this->lng->txt(
"cont_definition").
" ".($j+1));
 
  348                                 $tpl->parseCurrentBlock();
 
  353                         $tpl->setCurrentBlock(
"definition");
 
  354                         $tpl->setVariable(
"PAGE_CONTENT", $output);
 
  355                         $tpl->parseCurrentBlock();
 
  364                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  365                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
 
  369                 $term_links = array();
 
  370                 for($j=0; $j<count($defs); $j++)
 
  375                         $page_links = $page->getInternalLinks();
 
  376                         foreach($page_links as $key => $page_link)
 
  378                                 $term_links[$key] = $page_link;
 
  395                 $ilTabs->activateTab(
"definitions");
 
  396                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
 
  399                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  400                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  402                 $this->tpl->parseCurrentBlock();
 
  405                 $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  406                 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
  408                 $this->tpl->parseCurrentBlock();
 
  411                 $this->tpl->addBlockfile(
"ADM_CONTENT", 
"def_list", 
"tpl.glossary_definition_list.html", 
true);
 
  414                 $this->tpl->addBlockfile(
"STATUSLINE", 
"statusline", 
"tpl.statusline.html");
 
  415                 $this->tpl->setTitle(
 
  416                         $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  419                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  421                 $this->tpl->setCurrentBlock(
"add_def");
 
  422                 $this->tpl->setVariable(
"TXT_ADD_DEFINITION",
 
  423                         $this->lng->txt(
"cont_add_definition"));
 
  424                 $this->tpl->setVariable(
"BTN_ADD", 
"addDefinition");
 
  425                 $this->tpl->parseCurrentBlock();
 
  426                 $this->tpl->setCurrentBlock(
"def_list");
 
  430                 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  432                 for($j=0; $j<count($defs); $j++)
 
  436                         $page_gui->setStyleId($this->glossary->getStyleSheetId());
 
  437                         $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  438                         $page_gui->setTemplateOutput(
false);
 
  439                         $output = $page_gui->preview();
 
  441                         if (count($defs) > 1)
 
  443                                 $this->tpl->setCurrentBlock(
"definition_header");
 
  444                                                 $this->tpl->setVariable(
"TXT_DEFINITION",
 
  445                                 $this->lng->txt(
"cont_definition").
" ".($j+1));
 
  446                                 $this->tpl->parseCurrentBlock();
 
  451                                 $this->tpl->setCurrentBlock(
"up");
 
  452                                 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
 
  453                                 $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  454                                 $this->tpl->setVariable(
"LINK_UP",
 
  455                                         $this->ctrl->getLinkTarget($this, 
"moveUp"));
 
  456                                 $this->tpl->parseCurrentBlock();
 
  459                         if ($j+1 < count($defs))
 
  461                                 $this->tpl->setCurrentBlock(
"down");
 
  462                                 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
 
  463                                 $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  464                                 $this->tpl->setVariable(
"LINK_DOWN",
 
  465                                         $this->ctrl->getLinkTarget($this, 
"moveDown"));
 
  466                                 $this->tpl->parseCurrentBlock();
 
  468                         $this->tpl->setCurrentBlock(
"submit_btns");
 
  469                         $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
 
  470                         $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  471                         $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI", 
"def", $def[
"id"]);
 
  472                         $this->tpl->setVariable(
"LINK_EDIT",
 
  473                                 $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI", 
"ilGlossaryDefPageGUI"), 
"edit"));
 
  474                         $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
 
  475                         $this->tpl->setVariable(
"LINK_DELETE",
 
  476                                 $this->ctrl->getLinkTarget($this, 
"confirmDefinitionDeletion"));
 
  477                         $this->tpl->parseCurrentBlock();
 
  479                         $this->tpl->setCurrentBlock(
"definition");
 
  480                         $this->tpl->setVariable(
"PAGE_CONTENT", $output);
 
  481                         $this->tpl->parseCurrentBlock();
 
  500                 $ilTabs->activateTab(
"definitions");
 
  503                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  504                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  506                 $this->tpl->parseCurrentBlock();
 
  509                 $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  510                 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
  512                 $this->tpl->parseCurrentBlock();
 
  514                 $this->tpl->setTitle(
 
  515                         $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  518                 $this->tpl->addBlockfile(
"ADM_CONTENT", 
"def_list", 
"tpl.glossary_definition_delete.html", 
true);
 
  521                 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  526                 $page_gui->setStyleId($this->glossary->getStyleSheetId());
 
  527                 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  528                 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  529                 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  530                 $output = $page_gui->preview();
 
  532                 $this->tpl->setCurrentBlock(
"definition");
 
  533                 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
 
  534                 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  535                 $this->tpl->setVariable(
"LINK_CANCEL",
 
  536                         $this->ctrl->getLinkTarget($this, 
"cancelDefinitionDeletion"));
 
  537                 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
 
  538                 $this->ctrl->setParameter($this, 
"def", $definition->getId());
 
  539                 $this->tpl->setVariable(
"LINK_CONFIRM",
 
  540                         $this->ctrl->getLinkTarget($this, 
"deleteDefinition"));
 
  541                 $this->tpl->parseCurrentBlock();
 
  546                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  553                 $definition->delete();
 
  554                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  564                 $definition->moveUp();
 
  565                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  575                 $definition->moveDown();
 
  576                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  590                 $ilTabs->activateTab(
"definitions");
 
  592                 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  595                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  597                 $form->setFormAction($this->ctrl->getFormAction($this, 
"saveDefinition"));
 
  598                 $form->setTitle($this->lng->txt(
"gdf_new"));
 
  602                 $form->addItem($title);
 
  605                 $form->addItem($desc);
 
  607                 $form->addCommandButton(
"saveDefinition", $this->lng->txt(
"gdf_add"));
 
  608                 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  610                 $this->tpl->setContent($form->getHTML());
 
  618                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  627                 $def->setTermId(
$_GET[
"term_id"]);
 
  632                 $this->ctrl->redirect($this, 
"listDefinitions");
 
  641                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
  642                 $this->tpl->addBlockFile(
"STATUSLINE", 
"statusline", 
"tpl.statusline.html");
 
  659                 require_once (
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
 
  661                 $gloss_loc->setTerm($this->term);
 
  662                 $gloss_loc->setGlossary($this->glossary);
 
  664                 $gloss_loc->display();
 
  673                 global 
$lng, $ilHelp;
 
  676                 $ilHelp->setScreenIdComponent(
"glo_term");
 
  679                 if (
$_GET[
"term_id"] != 
"")
 
  681                         $tabs_gui->addTab(
"properties",
 
  682                                 $lng->txt(
"properties"),
 
  683                                 $this->ctrl->getLinkTarget($this, 
"editTerm"));
 
  685                         $tabs_gui->addTab(
"definitions",
 
  686                                 $lng->txt(
"cont_definitions"),
 
  687                                 $this->ctrl->getLinkTarget($this, 
"listDefinitions"));
 
  689                         $tabs_gui->addTab(
"usage",
 
  691                                 $this->ctrl->getLinkTarget($this, 
"listUsages"));
 
  693                         $tabs_gui->addNonTabbedLink(
"presentation_view",
 
  694                                 $this->lng->txt(
"glo_presentation_view"),
 
  698                                 "_".$_GET[
"term_id"].
"_".
$_GET[
"ref_id"].
"&client_id=".CLIENT_ID,
 
  705                 $tabs_gui->setBackTarget($this->lng->txt(
"glossary"),
 
  706                         $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui", 
"listTerms"));
 
  715         function _goto($a_target, $a_ref_id = 
"")
 
  724                         $ref_ids = array($a_ref_id);
 
  735                         if ($ilAccess->checkAccess(
"read", 
"", $ref_id))
 
  737                                 $_GET[
"baseClass"] = 
"ilGlossaryPresentationGUI";
 
  738                                 $_GET[
"term_id"] = $a_target;
 
  740                                 $_GET[
"cmd"] = 
"listDefinitions";
 
  741                                 include_once(
"ilias.php");
 
  745                 if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
  753                 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
 
  761                 global $ilTabs, 
$tpl;
 
  767                 $ilTabs->activateTab(
"usage");
 
  769                 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
 
  772                 include_once(
"./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
 
  775                 $tpl->setContent(
$tab->getHTML());
 
  789                 include_once(
"./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
 
  791                 $tpl->setLeftNavContent(
$tab->getHTML());