5 require_once(
"classes/class.ilObjectGUI.php");
 
    6 require_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
 
    7 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
 
    8 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
    9 require_once(
"./Modules/Glossary/classes/class.ilTermDefinitionEditorGUI.php");
 
   10 require_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
 
   35         function ilObjGlossaryGUI($a_data,$a_id = 0,$a_call_by_reference = 
true, $a_prepare_output = 
true)
 
   40                 $this->ctrl->saveParameter($this, array(
"ref_id", 
"offset"));
 
   41                 $lng->loadLanguageModule(
"content");
 
   52                 global 
$lng, $ilAccess;
 
   54                 $cmd = $this->ctrl->getCmd();
 
   55                 $next_class = $this->ctrl->getNextClass($this);
 
   64                                 include_once 
'Services/MetaData/classes/class.ilMDEditorGUI.php';
 
   66                                 $md_gui =& 
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
 
   67                                 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
 
   69                                 $this->ctrl->forwardCommand($md_gui);
 
   72                         case "ilglossarytermgui":
 
   73                                 $this->ctrl->setReturn($this, 
"listTerms");
 
   75                                 $term_gui->setGlossary($this->
object);
 
   77                                 $ret =& $this->ctrl->forwardCommand($term_gui);
 
   80                         case "ilinfoscreengui":
 
   84                         case 'ilpermissiongui':
 
   85                                 if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui")
 
   95                                 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
   97                                 $ret =& $this->ctrl->forwardCommand($perm_gui);
 
  101                                 $cmd = $this->ctrl->getCmd(
"frameset");
 
  103                                 if ((
$cmd == 
"create") && (
$_POST[
"new_type"] == 
"term"))
 
  105                                         $this->ctrl->setCmd(
"create");
 
  106                                         $this->ctrl->setCmdClass(
"ilGlossaryTermGUI");
 
  112                                         if (!in_array(
$cmd, array(
"frameset", 
"quickList")))
 
  114                                                 if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui" ||
 
  132                 if (!in_array(
$cmd, array(
"frameset", 
"quickList")))
 
  134                         if (strtolower(
$_GET[
"baseClass"]) != 
"iladministrationgui")
 
  144                         $this->tpl->show(
false);
 
  150                 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
 
  165                 if (!$rbacsystem->checkAccess(
"create", 
$_GET[
"ref_id"], $new_type))
 
  167                         $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
 
  171                                                 "none"=>$this->lng->txt(
"glo_mode_normal"),
 
  172                                                 "level"=>$this->lng->txt(
"glo_mode_level"),
 
  173                                                 "subtree"=>$this->lng->txt(
"glo_mode_subtree")
 
  176                 $glo_type = 
$_SESSION[
"error_post_vars"][
"glo_type"];
 
  182                 $data[
"fields"] = array();
 
  189                 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_glo"));
 
  191                 foreach (
$data[
"fields"] as $key => $val)
 
  193                         $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
 
  194                         $this->tpl->setVariable(strtoupper($key), $val);
 
  196                         if ($this->prepare_output)
 
  198                                 $this->tpl->parseCurrentBlock();
 
  202                 $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
  203                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"save"));
 
  207                 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
 
  208                 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  209                 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
 
  210                 $this->tpl->setVariable(
"CMD_SUBMIT", 
"save");
 
  211                 $this->tpl->setVariable(
"TARGET", 
' target="'.
 
  213                 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
 
  215                 $this->tpl->setVariable(
"SELECT_GLO_MODE", $opts);
 
  216                 $this->tpl->setVariable(
"TXT_GLO_MODE", $this->lng->txt(
"glo_mode"));
 
  217                 $this->tpl->setVariable(
"TXT_GLO_MODE_DESC", $this->lng->txt(
"glo_mode_desc"));
 
  219                 $this->tpl->setVariable(
"TXT_IMPORT_GLO", $this->lng->txt(
"import_glossary"));
 
  220                 $this->tpl->setVariable(
"TXT_GLO_FILE", $this->lng->txt(
"glo_upload_file"));
 
  221                 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
 
  234                 global $rbacadmin, $rbacsystem;
 
  239                 if (!$rbacsystem->checkAccess(
"create", 
$_GET[
"ref_id"], 
$_GET[
"new_type"]))
 
  241                         $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
 
  245                 if (empty(
$_POST[
"Fobject"][
"title"]))
 
  247                         $this->ilErr->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilErr->MESSAGE);
 
  251                 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
 
  253                 $newObj->setType($this->type);
 
  254                 $newObj->setTitle(
$_POST[
"Fobject"][
"title"]);
 
  255                 $newObj->setDescription(
$_POST[
"Fobject"][
"desc"]);
 
  256                 $newObj->setVirtualMode(
$_POST[
"glo_mode"]);
 
  258                 $newObj->createReference();
 
  259                 $newObj->putInTree(
$_GET[
"ref_id"]);
 
  260                 $newObj->setPermissions(
$_GET[
"ref_id"]);
 
  261                 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
 
  265                 ilUtil::redirect(
"ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
 
  278                 global $_FILES, $rbacsystem;
 
  281                 $source = $_FILES[
"xmldoc"][
"tmp_name"];
 
  282                 if (($source == 
'none') || (!$source))
 
  284                         $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
 
  295                 $info = pathinfo($_FILES[
"xmldoc"][
"name"]);
 
  296                 if (strtolower($info[
"extension"]) != 
"zip")
 
  298                         $this->ilias->raiseError($this->lng->txt(
"cont_no_zip_file"),
 
  299                                 $this->ilias->error_obj->MESSAGE);
 
  303                 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
 
  305                 $newObj->setType(
$_GET[
"new_type"]);
 
  306                 $newObj->setTitle($_FILES[
"xmldoc"][
"name"]);
 
  307                 $newObj->create(
true);
 
  308                 $newObj->createReference();
 
  309                 $newObj->putInTree(
$_GET[
"ref_id"]);
 
  310                 $newObj->setPermissions(
$_GET[
"ref_id"]);
 
  311                 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
 
  314                 $newObj->createImportDirectory();
 
  317                 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
 
  318                 $full_path = $newObj->getImportDirectory().
"/".$_FILES[
"xmldoc"][
"name"];
 
  321                         $_FILES[
"xmldoc"][
"name"], $full_path);
 
  327                 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
 
  328                 $xml_file = $newObj->getImportDirectory().
"/".$subdir.
"/".$subdir.
".xml";
 
  331                 if (!is_dir($newObj->getImportDirectory().
"/".$subdir))
 
  333                         $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_no_subdir_in_zip"), $subdir),
 
  334                                 $this->ilias->error_obj->MESSAGE);
 
  338                 if (!is_file($xml_file))
 
  340                         $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml"),
 
  341                                 $this->ilias->error_obj->MESSAGE);
 
  344                 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
 
  346                 $contParser->startParsing();
 
  353                 ilUtil::redirect(
"ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
 
  370                 $this->lng->loadLanguageModule(
"meta");
 
  371                 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  374                 $info->enablePrivateNotes();
 
  376                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  378                         $info->enableNewsEditing();
 
  380                         $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  381                         if ($enable_internal_rss)
 
  383                                 $info->setBlockProperty(
"news", 
"settings", 
true);
 
  386                 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
 
  390                 $this->ctrl->forwardCommand($info);
 
  401                 global 
$lng, $ilAccess;
 
  403                 $info->addSection($lng->txt(
"glo_usages"));
 
  404                 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
 
  406                 foreach ($sms as $sm)
 
  410                         foreach ($refs as $ref)
 
  414                                         if ($ilAccess->checkAccess(
"write", 
"", $ref))
 
  416                                                 include_once(
"./classes/class.ilLink.php");
 
  425                                 $entry = 
"<a href='".$link.
"' target='_top'>".$entry.
"</a>";
 
  428                         $info->addProperty($lng->txt(
"obj_sahs"), $entry);
 
  437                 if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui")
 
  443                 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
 
  445                         $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
 
  449                 $this->tpl->addBlockfile(
"BUTTONS", 
"buttons", 
"tpl.buttons.html");
 
  451                 $this->tpl->setCurrentBlock(
"btn_cell");
 
  452                 $this->tpl->setVariable(
"BTN_LINK",
 
  453                         "ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$this->object->getRefID());
 
  454                 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".
 
  456                 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
 
  457                 $this->tpl->parseCurrentBlock();
 
  473                 $tpl->setContent($this->form->getHTML());
 
  485                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  491                 $this->form->addItem($cb);
 
  495                         "none"=>$this->lng->txt(
"glo_mode_normal"),
 
  496                         "level"=>$this->lng->txt(
"glo_mode_level"),
 
  497                         "subtree"=>$this->lng->txt(
"glo_mode_subtree")
 
  501                 $si->setInfo($lng->txt(
"glo_mode_desc"));
 
  502                 $this->form->addItem($si);
 
  507                 $op1 = 
new ilRadioOption($lng->txt(
"glo_table_form"), 
"table", $lng->txt(
"glo_table_form_info"));
 
  510                         $ni = 
new ilNumberInputGUI($lng->txt(
"glo_text_snippet_length"), 
"snippet_length");
 
  511                         $ni->setMaxValue(3000);
 
  512                         $ni->setMinValue(100);
 
  513                         $ni->setMaxLength(4);
 
  515                         $ni->
setInfo($lng->txt(
"glo_text_snippet_length_info"));
 
  517                         $op1->addSubItem($ni);
 
  519                 $radg->addOption($op1);
 
  520                 $op2 = 
new ilRadioOption($lng->txt(
"glo_full_definitions"), 
"full_def", $lng->txt(
"glo_full_definitions_info"));
 
  521                 $radg->addOption($op2);
 
  522                 $this->form->addItem($radg);
 
  534                 $cb->setInfo($lng->txt(
"cont_downloads_desc"));
 
  535                 $this->form->addItem($cb);
 
  538                 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
 
  540                 $this->form->setTitle($lng->txt(
"cont_glo_properties"));
 
  541                 $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  551                 $values[
"cobj_online"] = $this->
object->getOnline();
 
  552                 $values[
"glo_mode"] = $this->
object->getVirtualMode();
 
  554                 $values[
"glo_act_downloads"] = $this->
object->isActiveDownloads();
 
  555                 $values[
"pres_mode"] = $this->
object->getPresentationMode();
 
  556                 $values[
"snippet_length"] = $this->
object->getSnippetLength();
 
  558                 $this->form->setValuesByArray($values);
 
  569                 if ($this->form->checkInput())
 
  572                         $this->
object->setVirtualMode(
$_POST[
"glo_mode"]);
 
  575                         $this->
object->setPresentationMode(
$_POST[
"pres_mode"]);
 
  576                         $this->
object->setSnippetLength(
$_POST[
"snippet_length"]);
 
  577                         $this->
object->update();
 
  580                         include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  584                         $this->ctrl->redirect($this, 
"properties");
 
  586                 $this->form->setValuesByPost();
 
  587                 $tpl->setContent($this->form->getHTML());
 
  595                 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
 
  597                 $fs_gui->setFramesetTitle($this->object->getTitle());
 
  598                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this, 
"listTerms"));
 
  599                 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this, 
"quickList"));
 
  600                 $fs_gui->setMainFrameName(
"content");
 
  601                 $fs_gui->setSideFrameName(
"tree");
 
  613                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.glossary_short_list.html",
 
  619                 $this->tpl->setVariable(
"FORMACTION1", $this->ctrl->getFormAction($this));
 
  620                 $this->tpl->setVariable(
"CMD_REFR", 
"quickList");
 
  621                 $this->tpl->setVariable(
"TXT_REFR", $this->lng->txt(
"refresh"));
 
  622                 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_terms"));
 
  624                 include_once 
"./Services/Table/classes/class.ilTableGUI.php";
 
  629                 $this->tpl->addBlockfile(
"SHORT_LIST", 
"list", 
"tpl.table.html");
 
  632                 $this->tpl->addBlockfile(
"TBL_CONTENT", 
"tbl_content", 
"tpl.term_short_tbl_row.html", 
true);
 
  636                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  645                 $tbl->setHeaderNames(array($this->lng->txt(
"cont_term")));
 
  647                 $cols = array(
"term");
 
  648                 $header_params = $this->ctrl->getParameterArrayByClass(
"ilobjglossarygui", 
"listTerms");
 
  649                 $header_params[
"cmd"] = 
"quickList";
 
  650                 $tbl->setHeaderVars($cols, $header_params);
 
  651                 $tbl->setColumnWidth(array(
"100%"));
 
  652                 $tbl->disable(
"title");
 
  655                 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
 
  656                 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
 
  657                 $tbl->setLimit(
$_GET[
"limit"]);
 
  658                 $tbl->setOffset(
$_GET[
"offset"]);
 
  659                 $tbl->disable(
"header");
 
  661                 $term_list = $this->
object->getTermList();
 
  662                 $tbl->setMaxCount(count($term_list));
 
  664                 $this->tpl->setVariable(
"COLUMN_COUNT", 1);
 
  667                 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
 
  671                 $term_list = array_slice($term_list, 
$_GET[
"offset"], 
$_GET[
"limit"]);
 
  676                 if (count($term_list) > 0)
 
  679                         foreach($term_list as $key => 
$term)
 
  684                                 for($j=0; $j<count($defs); $j++)
 
  689                                         $this->tpl->setCurrentBlock(
"definition");
 
  690                                         $this->tpl->setVariable(
"SEP", $sep);
 
  691                                         $this->ctrl->setParameterByClass(
"ilpageobjectgui", 
"term_id", 
$term[
"id"]);
 
  692                                         $this->ctrl->setParameterByClass(
"ilpageobjectgui", 
"def", $def[
"id"]);
 
  693                                         $this->tpl->setVariable(
"LINK_EDIT_DEF",
 
  694                                                 $this->ctrl->getLinkTargetByClass(array(
"ilglossarytermgui",
 
  695                                                 "iltermdefinitioneditorgui",
 
  696                                                 "ilpageobjectgui"), 
"edit"));
 
  697                                         $this->tpl->setVariable(
"TEXT_DEF", $this->lng->txt(
"glo_definition_abbr").($j+1));
 
  698                                         $this->tpl->parseCurrentBlock();
 
  702                                 $this->tpl->setCurrentBlock(
"tbl_content");
 
  706                                 $this->tpl->setVariable(
"TEXT_TERM", 
$term[
"term"]);
 
  707                                 $this->ctrl->setParameter($this, 
"term_id", 
$term[
"id"]);
 
  708                                 $this->tpl->setVariable(
"LINK_EDIT_TERM",
 
  709                                         $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui", 
"editTerm"));
 
  711                                 $this->tpl->setVariable(
"CSS_ROW", $css_row);
 
  712                                 $this->tpl->parseCurrentBlock();
 
  718                         $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
 
  719                         $this->tpl->setVariable(
"NUM_COLS", $num);
 
  733                 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  737                 $ilToolbar->addInputItem($ti, 
true);
 
  740                 $this->lng->loadLanguageModule(
"meta");
 
  744                         $s_lang = 
$_SESSION[
"il_text_lang_".$_GET[
"ref_id"]];
 
  748                         $s_lang = $ilUser->getLanguage();
 
  750                 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  753                 $si->setValue($s_lang);
 
  754                 $ilToolbar->addInputItem($si, 
true);
 
  756                 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
 
  757                 $ilToolbar->addFormButton($lng->txt(
"glo_add_new_term"), 
"addTerm");
 
  761                 include_once(
"./Modules/Glossary/classes/class.ilTermListTableGUI.php");
 
  763                 $tpl->setContent(
$tab->getHTML());
 
  773                 foreach ($a_actions as $name => 
$lng)
 
  775                         $d[$name] = array(
"name" => $name, 
"lng" => 
$lng);
 
  778                 $notoperations = array();
 
  779                 $operations = array();
 
  783                 if (count($operations) > 0)
 
  785                         foreach ($operations as $val)
 
  787                                 $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
  788                                 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
 
  789                                 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
 
  790                                 $this->tpl->parseCurrentBlock();
 
  793                         $this->tpl->setCurrentBlock(
"tbl_action_row");
 
  795                         $this->tpl->parseCurrentBlock();
 
  806                 if (trim(
$_POST[
"new_term"]) == 
"")
 
  809                         $ilCtrl->redirect($this, 
"listTerms");
 
  813                 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
  815                 $term->setGlossary($this->
object);
 
  823                 $def->setTermId(
$term->getId());
 
  827                 $this->ctrl->setParameterByClass(
"ilpageobjectgui", 
"term_id", 
$term->getId());
 
  828                 $this->ctrl->setParameterByClass(
"ilpageobjectgui", 
"def", $def->getId());
 
  829                 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
 
  830                         "iltermdefinitioneditorgui", 
"ilpageobjectgui"), 
"edit");
 
  838                 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  841                 $definition->moveUp();
 
  843                 $this->ctrl->redirect($this, 
"listTerms");
 
  851                 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  854                 $definition->moveDown();
 
  856                 $this->ctrl->redirect($this, 
"listTerms");
 
  876                         $ilCtrl->setParameterByClass(
"ilglossarytermgui",
 
  877                                 "term_id", 
$_GET[
"term_id"]);
 
  878                         $link = 
"[<a href='".
 
  879                                 $ilCtrl->getLinkTargetByClass(
"ilglossarytermgui", 
"listUsages").
 
  880                                 "'>".$lng->txt(
"glo_list_usages").
"</a>]";
 
  881                         $add = 
"<br/>".sprintf($lng->txt(
"glo_term_is_used_n_times"), $nr).
" ".$link;
 
  886                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  887                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  889                 $this->tpl->parseCurrentBlock();
 
  892                 $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  893                 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
  895                 $this->tpl->parseCurrentBlock();
 
  901                 $this->tpl->addBlockfile(
"ADM_CONTENT", 
"def_list", 
"tpl.glossary_definition_delete.html", 
true);
 
  904                 $this->tpl->setVariable(
"TXT_TERM", 
$term->getTerm());
 
  910                 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  911                 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  912                 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
 
  913                 $output = $page_gui->preview();
 
  915                 $this->tpl->setCurrentBlock(
"definition");
 
  916                 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
 
  917                 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  918                 $this->tpl->setVariable(
"LINK_CANCEL",
 
  919                         $this->ctrl->getLinkTarget($this, 
"cancelDefinitionDeletion"));
 
  920                 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
 
  921                 $this->ctrl->setParameter($this, 
"def", $definition->getId());
 
  922                 $this->tpl->setVariable(
"LINK_CONFIRM",
 
  923                         $this->ctrl->getLinkTarget($this, 
"deleteDefinition"));
 
  924                 $this->tpl->parseCurrentBlock();
 
  940                 $this->ctrl->redirect($this, 
"listTerms");
 
  947                 $definition->delete();
 
  948                 $this->ctrl->redirect($this, 
"listTerms");
 
  989                 $this->ctrl->redirect($this, 
"listTerms");
 
 1003                 $this->tpl->addBlockfile(
"BUTTONS", 
"buttons", 
"tpl.buttons.html");
 
 1006                 $this->tpl->setCurrentBlock(
"btn_cell");
 
 1007                 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this, 
"export"));
 
 1008                 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_xml"));
 
 1009                 $this->tpl->parseCurrentBlock();
 
 1012                 $this->tpl->setCurrentBlock(
"btn_cell");
 
 1013                 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this, 
"exportHTML"));
 
 1014                 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_html"));
 
 1015                 $this->tpl->parseCurrentBlock();
 
 1018                 if (is_file($this->object->getExportDirectory().
"/export.log"))
 
 1020                         $this->tpl->setCurrentBlock(
"btn_cell");
 
 1021                         $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this, 
"viewExportLog"));
 
 1022                         $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_view_last_export_log"));
 
 1023                         $this->tpl->parseCurrentBlock();
 
 1027                 $export_dir = $this->
object->getExportDirectory();
 
 1029                 $export_files = $this->
object->getExportFiles();
 
 1032                 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
 1036                 $this->tpl->addBlockfile(
"ADM_CONTENT", 
"adm_content", 
"tpl.table.html");
 
 1039                 $this->tpl->addBlockfile(
"TBL_CONTENT", 
"tbl_content", 
"tpl.glo_export_file_row.html", 
true);
 
 1043                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 1045                 $tbl->setTitle($this->lng->txt(
"cont_export_files"));
 
 1047                 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"type"),
 
 1048                         $this->lng->txt(
"cont_file"),
 
 1049                         $this->lng->txt(
"cont_size"), $this->lng->txt(
"date") ));
 
 1051                 $cols = array(
"", 
"type", 
"file", 
"size", 
"date");
 
 1052                 $header_params = array(
"ref_id" => 
$_GET[
"ref_id"],
 
 1053                         "cmd" => 
"exportList", 
"cmdClass" => get_class($this));
 
 1054                 $tbl->setHeaderVars($cols, $header_params);
 
 1055                 $tbl->setColumnWidth(array(
"1%", 
"9%", 
"40%", 
"25%", 
"25%"));
 
 1056                 $tbl->disable(
"sort");
 
 1059                 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
 
 1060                 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
 
 1061                 $tbl->setLimit(
$_GET[
"limit"]);
 
 1062                 $tbl->setOffset(
$_GET[
"offset"]);
 
 1063                 $tbl->setMaxCount($this->maxcount);             
 
 1065                 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
 
 1069                 $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 1070                 $this->tpl->setVariable(
"BTN_NAME", 
"confirmDeleteExportFile");
 
 1071                 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
 
 1072                 $this->tpl->parseCurrentBlock();
 
 1074                 $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 1075                 $this->tpl->setVariable(
"BTN_NAME", 
"downloadExportFile");
 
 1076                 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
 
 1077                 $this->tpl->parseCurrentBlock();
 
 1080                 $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 1081                 $this->tpl->setVariable(
"BTN_NAME", 
"publishExportFile");
 
 1082                 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_public_access"));
 
 1083                 $this->tpl->parseCurrentBlock();
 
 1086                 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
 
 1089                 $tbl->setMaxCount(count($export_files));
 
 1090                 $export_files = array_slice($export_files, 
$_GET[
"offset"], 
$_GET[
"limit"]);
 
 1093                 if(count($export_files) > 0)
 
 1096                         foreach($export_files as $exp_file)
 
 1098                                 $this->tpl->setCurrentBlock(
"tbl_content");
 
 1099                                 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
 
 1102                                 $this->tpl->setVariable(
"CSS_ROW", $css_row);
 
 1104                                 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
 
 1106                                 $public_str = ($exp_file[
"file"] == $this->
object->getPublicExportFile($exp_file[
"type"]))
 
 1107                                         ? 
" <b>(".$this->lng->txt(
"public").
")<b>" 
 1109                                 $this->tpl->setVariable(
"TXT_TYPE", $exp_file[
"type"].$public_str);
 
 1110                                 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
 
 1112                                 $file_arr = explode(
"__", $exp_file[
"file"]);
 
 1113                                 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
 
 1115                                 $this->tpl->parseCurrentBlock();
 
 1121                         $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
 
 1122                         $this->tpl->setVariable(
"NUM_COLS", 3);
 
 1126                 $this->tpl->parseCurrentBlock();
 
 1135                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
 
 1137                 $glo_exp->buildExportFile();
 
 1138                 $this->ctrl->redirect($this, 
"exportList");
 
 1146                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
 
 1148                 $glo_exp->buildExportFile();
 
 1150                 $this->ctrl->redirect($this, 
"exportList");
 
 1159                 if(!isset(
$_POST[
"file"]))
 
 1161                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 1164                 if (count(
$_POST[
"file"]) > 1)
 
 1166                         $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 1170                 $export_dir = $this->
object->getExportDirectory(
$file[0]);
 
 1180                 if(!isset(
$_POST[
"file"]))
 
 1182                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 1184                 if (count(
$_POST[
"file"]) > 1)
 
 1186                         $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 1190                 $export_dir = $this->
object->getExportDirectory(
$file[0]);
 
 1192                 if ($this->object->getPublicExportFile(
$file[0]) ==
 
 1195                         $this->
object->setPublicExportFile(
$file[0], 
"");
 
 1199                         $this->
object->setPublicExportFile(
$file[0], 
$file[1]);
 
 1201                 $this->
object->update();
 
 1202                 $this->ctrl->redirect($this, 
"exportList");
 
 1215                 $this->tpl->addBlockfile(
"BUTTONS", 
"buttons", 
"tpl.buttons.html");
 
 1218                 $this->tpl->setCurrentBlock(
"btn_cell");
 
 1219                 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this, 
"exportList"));
 
 1220                 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_export_files"));
 
 1221                 $this->tpl->parseCurrentBlock();
 
 1224                 $this->tpl->setVariable(
"ADM_CONTENT",
 
 1225                         nl2br(file_get_contents($this->object->getExportDirectory().
"/export.log")));
 
 1227                 $this->tpl->parseCurrentBlock();
 
 1235                 if(!isset(
$_POST[
"file"]))
 
 1237                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 1245                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.confirm_deletion.html", 
"Modules/Glossary");
 
 1249                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 1252                 $this->tpl->setCurrentBlock(
"table_header");
 
 1253                 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
 
 1254                 $this->tpl->parseCurrentBlock();
 
 1260                                 $file = explode(
":", $file);
 
 1261                                 $this->tpl->setCurrentBlock(
"table_row");
 
 1263                                 $this->tpl->setVariable(
"TEXT_CONTENT", $file[1].
" (".$file[0].
")");
 
 1264                                 $this->tpl->parseCurrentBlock();
 
 1269                 $buttons = array( 
"cancelDeleteExportFile"  => $this->lng->txt(
"cancel"),
 
 1270                         "deleteExportFile"  => $this->lng->txt(
"confirm"));
 
 1271                 foreach ($buttons as $name => $value)
 
 1273                         $this->tpl->setCurrentBlock(
"operation_btn");
 
 1274                         $this->tpl->setVariable(
"BTN_NAME",$name);
 
 1275                         $this->tpl->setVariable(
"BTN_VALUE",$value);
 
 1276                         $this->tpl->parseCurrentBlock();
 
 1285                 session_unregister(
"ilExportFiles");
 
 1286                 $this->ctrl->redirect($this, 
"exportList");
 
 1296                         $file = explode(
":", $file);
 
 1297                         $export_dir = $this->
object->getExportDirectory($file[0]);
 
 1299                         $exp_file = $export_dir.
"/".$file[1];
 
 1300                         $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
 
 1301                         if (@is_file($exp_file))
 
 1305                         if (@is_dir($exp_dir))
 
 1310                 $this->ctrl->redirect($this, 
"exportList");
 
 1321                 if (!isset(
$_POST[
"id"]))
 
 1324                         $ilCtrl->redirect($this, 
"listTerms");
 
 1330                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.obj_confirm.html");
 
 1333                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 1336                 $cols = array(
"cont_term");
 
 1337                 foreach ($cols as $key)
 
 1339                         $this->tpl->setCurrentBlock(
"table_header");
 
 1340                         $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
 
 1341                         $this->tpl->parseCurrentBlock();
 
 1344                 foreach(
$_POST[
"id"] as $id)
 
 1352                                 $ilCtrl->setParameterByClass(
"ilglossarytermgui",
 
 1354                                 $link = 
"[<a href='".
 
 1355                                         $ilCtrl->getLinkTargetByClass(
"ilglossarytermgui", 
"listUsages").
 
 1356                                         "'>".$lng->txt(
"glo_list_usages").
"</a>]";
 
 1357                                 $add = 
"<div class='small'>".
 
 1358                                         sprintf($lng->txt(
"glo_term_is_used_n_times"), $nr).
" ".$link.
"</div>";
 
 1363                         $this->tpl->setCurrentBlock(
"table_cell");
 
 1364                         $this->tpl->setVariable(
"TEXT_CONTENT", 
$term->getTerm().$add);
 
 1365                         $this->tpl->parseCurrentBlock();
 
 1368                         $this->tpl->setCurrentBlock(
"table_row");
 
 1370                         $this->tpl->parseCurrentBlock();
 
 1374                 $buttons = array( 
"cancelTermDeletion"  => $this->lng->txt(
"cancel"),
 
 1375                         "deleteTerms"  => $this->lng->txt(
"confirm"));
 
 1377                 foreach($buttons as $name => $value)
 
 1379                         $this->tpl->setCurrentBlock(
"operation_btn");
 
 1380                         $this->tpl->setVariable(
"BTN_NAME",$name);
 
 1381                         $this->tpl->setVariable(
"BTN_VALUE",$value);
 
 1382                         $this->tpl->parseCurrentBlock();
 
 1394                 session_unregister(
"term_delete");
 
 1395                 $this->ctrl->redirect($this, 
"listTerms");
 
 1403                 foreach(
$_SESSION[
"term_delete"] as $id)
 
 1408                 session_unregister(
"term_delete");
 
 1409                 $this->ctrl->redirect($this, 
"listTerms");
 
 1421                 global $ilias_locator;
 
 1423                 if(strtolower(
$_GET[
"baseClass"]) != 
"ilglossaryeditorgui")
 
 1429                         if(is_object($this->
object))
 
 1431                                 require_once(
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
 
 1433                                 if (is_object($this->term))
 
 1435                                         $gloss_loc->setTerm($this->term);
 
 1437                                 $gloss_loc->setGlossary($this->
object);
 
 1439                                 $gloss_loc->display();
 
 1459                 switch(
$_POST[
"new_type"])
 
 1463                                 $term_gui->create();
 
 1471                 $term_gui->setGlossary($this->
object);
 
 1477                 $ilCtrl->redirect($this, 
"listTerms");
 
 1488                 if (count(
$_POST[
"id"]) < 1)
 
 1491                         $ilCtrl->redirect($this, 
"listTerms");
 
 1494                 if (count(
$_POST[
"id"]) > 1)
 
 1497                         $ilCtrl->redirect($this, 
"listTerms");
 
 1501                 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
 1506                 $def->setTermId(
$term->getId());
 
 1510                 $this->ctrl->setParameterByClass(
"ilpageobjectgui", 
"term_id", 
$term->getId());
 
 1511                 $this->ctrl->setParameterByClass(
"ilpageobjectgui", 
"def", $def->getId());
 
 1512                 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
 
 1513                         "iltermdefinitioneditorgui", 
"ilpageobjectgui"), 
"edit");
 
 1519                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
 1520                 $this->tpl->addBlockFile(
"STATUSLINE", 
"statusline", 
"tpl.statusline.html");
 
 1522                 $title = $this->
object->getTitle();
 
 1525                 if (
$_GET[
"term_id"] > 0)
 
 1530                         $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"term").
": ".
 
 1535                         $this->tpl->setCurrentBlock(
"header_image");
 
 1537                         $this->tpl->parseCurrentBlock();
 
 1538                         $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"glo").
": ".
$title);
 
 1553                 #include_once("classes/class.ilTabsGUI.php"); 
 1554                 #$tabs_gui =& new ilTabsGUI(); 
 1555                 $this->
getTabs($this->tabs_gui);
 
 1557                 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML()); 
 1569                 $force_active = (
$_GET[
"cmd"] == 
"" || 
$_GET[
"cmd"] == 
"listTerms")
 
 1572                 $tabs_gui->addTarget(
"cont_terms",
 
 1573                         $this->ctrl->getLinkTarget($this, 
"listTerms"), array(
"listTerms", 
""),
 
 1574                         get_class($this), 
"", $force_active);
 
 1576                 $force_active = 
false;
 
 1577                 if ($this->ctrl->getCmd() == 
"showSummary" ||
 
 1578                         strtolower($this->ctrl->getNextClass()) == 
"ilinfoscreengui")
 
 1580                         $force_active = 
true;
 
 1582                 $tabs_gui->addTarget(
"info_short",
 
 1583                         $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui", 
"showSummary"), 
"",
 
 1584                         "ilInfoScreenGUI", 
"", $force_active);
 
 1587                 $tabs_gui->addTarget(
"settings",
 
 1588                         $this->ctrl->getLinkTarget($this, 
"properties"), 
"properties",
 
 1592                 $tabs_gui->addTarget(
"meta_data",
 
 1593                          $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
 
 1594                          "", 
"ilmdeditorgui");
 
 1597                 $tabs_gui->addTarget(
"export",
 
 1598                          $this->ctrl->getLinkTarget($this, 
"exportList"),
 
 1599                          array(
"exportList", 
"viewExportLog"), get_class($this));
 
 1602                 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
 
 1609                         $tabs_gui->addTarget(
"perm_settings",
 
 1610                                 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"), array(
"perm",
"info",
"owner"), 
'ilpermissiongui');
 
 1614                 $tabs_gui->addNonTabbedLink(
"presentation_view",
 
 1615                         $this->lng->txt(
"glo_presentation_view"),
 
 1616                         "ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$this->object->getRefID(),
 
 1631                 if ($ilAccess->checkAccess(
"read", 
"", $a_target))
 
 1633                         $_GET[
"ref_id"] = $a_target;
 
 1634                         $_GET[
"baseClass"] = 
"ilGlossaryPresentationGUI";
 
 1635                         include(
"ilias.php");
 
 1638                 else if ($ilAccess->checkAccess(
"visible", 
"", $a_target))
 
 1640                         $_GET[
"ref_id"] = $a_target;
 
 1641                         $_GET[
"cmd"] = 
"infoScreen";
 
 1642                         $_GET[
"baseClass"] = 
"ilGlossaryPresentationGUI";
 
 1643                         include(
"ilias.php");
 
 1646                 else if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
 1648                         $_GET[
"cmd"] = 
"frameset";
 
 1649                         $_GET[
"target"] = 
"";
 
 1650                         $_GET[
"ref_id"] = ROOT_FOLDER_ID;
 
 1653                         include(
"repository.php");
 
 1657                 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
 
 1667                 include_once(
"./Modules/Glossary/classes/class.ilTermListTableGUI.php");
 
 1669                 $prtab->resetOffset();
 
 1670                 $prtab->writeFilterToSession();
 
 1681                 include_once(
"./Modules/Glossary/classes/class.ilTermListTableGUI.php");
 
 1683                 $prtab->resetOffset();
 
 1684                 $prtab->resetFilter();