24 require_once(
"classes/class.ilObjectGUI.php");
25 require_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
26 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
27 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
28 require_once(
"./Modules/Glossary/classes/class.ilTermDefinitionEditorGUI.php");
29 require_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
54 function ilObjGlossaryGUI($a_data,$a_id = 0,$a_call_by_reference =
true, $a_prepare_output =
true)
59 $this->ctrl->saveParameter($this, array(
"ref_id",
"offset"));
60 $lng->loadLanguageModule(
"content");
75 global
$lng, $ilAccess;
77 $cmd = $this->ctrl->getCmd();
78 $next_class = $this->ctrl->getNextClass($this);
87 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
89 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
90 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
92 $this->ctrl->forwardCommand($md_gui);
95 case "ilglossarytermgui":
96 $this->ctrl->setReturn($this,
"listTerms");
98 $term_gui->setGlossary($this->
object);
100 $ret =& $this->ctrl->forwardCommand($term_gui);
103 case "ilinfoscreengui":
107 $this->lng->loadLanguageModule(
"meta");
108 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
111 $info->enablePrivateNotes();
113 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
115 $info->enableNewsEditing();
117 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
118 if ($enable_internal_rss)
120 $info->setBlockProperty(
"news",
"settings",
true);
123 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
124 $this->ctrl->forwardCommand($info);
127 case 'ilpermissiongui':
128 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
138 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
140 $ret =& $this->ctrl->forwardCommand($perm_gui);
144 $cmd = $this->ctrl->getCmd(
"frameset");
146 if ((
$cmd ==
"create") && (
$_POST[
"new_type"] ==
"term"))
148 $this->ctrl->setCmd(
"create");
149 $this->ctrl->setCmdClass(
"ilGlossaryTermGUI");
155 if (!in_array(
$cmd, array(
"frameset",
"quickList")))
157 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
175 if (!in_array(
$cmd, array(
"frameset",
"quickList")))
177 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui")
187 $this->tpl->show(
false);
193 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
208 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
210 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
214 "none"=>$this->lng->txt(
"glo_mode_normal"),
215 "level"=>$this->lng->txt(
"glo_mode_level"),
216 "subtree"=>$this->lng->txt(
"glo_mode_subtree")
219 $glo_type =
$_SESSION[
"error_post_vars"][
"glo_type"];
225 $data[
"fields"] = array();
232 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_glo"));
234 foreach (
$data[
"fields"] as
$key => $val)
236 $this->tpl->setVariable(
"TXT_".strtoupper(
$key), $this->lng->txt(
$key));
237 $this->tpl->setVariable(strtoupper(
$key), $val);
239 if ($this->prepare_output)
241 $this->tpl->parseCurrentBlock();
245 $this->ctrl->setParameter($this,
"new_type", $new_type);
246 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"save"));
250 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
251 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
252 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
253 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
254 $this->tpl->setVariable(
"TARGET",
' target="'.
256 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
258 $this->tpl->setVariable(
"SELECT_GLO_MODE", $opts);
259 $this->tpl->setVariable(
"TXT_GLO_MODE", $this->lng->txt(
"glo_mode"));
260 $this->tpl->setVariable(
"TXT_GLO_MODE_DESC", $this->lng->txt(
"glo_mode_desc"));
262 $this->tpl->setVariable(
"TXT_IMPORT_GLO", $this->lng->txt(
"import_glossary"));
263 $this->tpl->setVariable(
"TXT_GLO_FILE", $this->lng->txt(
"glo_upload_file"));
264 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
277 global $rbacadmin, $rbacsystem;
282 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
$_GET[
"new_type"]))
284 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
288 if (empty(
$_POST[
"Fobject"][
"title"]))
290 $this->ilErr->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilErr->MESSAGE);
294 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
296 $newObj->setType($this->type);
297 $newObj->setTitle(
$_POST[
"Fobject"][
"title"]);
298 $newObj->setDescription(
$_POST[
"Fobject"][
"desc"]);
299 $newObj->setVirtualMode(
$_POST[
"glo_mode"]);
301 $newObj->createReference();
302 $newObj->putInTree(
$_GET[
"ref_id"]);
303 $newObj->setPermissions(
$_GET[
"ref_id"]);
304 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
308 ilUtil::redirect(
"ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
321 global $_FILES, $rbacsystem;
324 $source = $_FILES[
"xmldoc"][
"tmp_name"];
325 if (($source ==
'none') || (!$source))
327 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
338 $info = pathinfo($_FILES[
"xmldoc"][
"name"]);
339 if (strtolower($info[
"extension"]) !=
"zip")
341 $this->ilias->raiseError($this->lng->txt(
"cont_no_zip_file"),
342 $this->ilias->error_obj->MESSAGE);
346 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
348 $newObj->setType(
$_GET[
"new_type"]);
349 $newObj->setTitle($_FILES[
"xmldoc"][
"name"]);
350 $newObj->create(
true);
351 $newObj->createReference();
352 $newObj->putInTree(
$_GET[
"ref_id"]);
353 $newObj->setPermissions(
$_GET[
"ref_id"]);
354 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
357 $newObj->createImportDirectory();
360 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
361 $full_path = $newObj->getImportDirectory().
"/".$_FILES[
"xmldoc"][
"name"];
364 $_FILES[
"xmldoc"][
"name"], $full_path);
370 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
371 $xml_file = $newObj->getImportDirectory().
"/".$subdir.
"/".$subdir.
".xml";
374 if (!is_dir($newObj->getImportDirectory().
"/".$subdir))
376 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_no_subdir_in_zip"), $subdir),
377 $this->ilias->error_obj->MESSAGE);
381 if (!is_file($xml_file))
383 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml"),
384 $this->ilias->error_obj->MESSAGE);
387 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
389 $contParser->startParsing();
396 ilUtil::redirect(
"ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
405 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
411 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
413 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
417 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
419 $this->tpl->setCurrentBlock(
"btn_cell");
420 $this->tpl->setVariable(
"BTN_LINK",
421 "ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$this->object->getRefID());
422 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".
424 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
425 $this->tpl->parseCurrentBlock();
440 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.glossary_properties.html",
true);
441 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"saveProperties"));
442 $this->tpl->setVariable(
"TXT_PROPERTIES", $this->lng->txt(
"cont_glo_properties"));
445 $this->tpl->setVariable(
"TXT_ONLINE", $this->lng->txt(
"cont_online"));
446 $this->tpl->setVariable(
"CBOX_ONLINE",
"cobj_online");
447 $this->tpl->setVariable(
"VAL_ONLINE",
"y");
449 if ($this->object->getOnline())
451 $this->tpl->setVariable(
"CHK_ONLINE",
"checked");
456 "none"=>$this->lng->txt(
"glo_mode_normal"),
457 "level"=>$this->lng->txt(
"glo_mode_level"),
458 "subtree"=>$this->lng->txt(
"glo_mode_subtree")
461 $opts =
ilUtil::formSelect($this->object->getVirtualMode(),
"glo_mode",$stati,
false,
true);
463 $this->tpl->setVariable(
"SELECT_GLO_MODE", $opts);
464 $this->tpl->setVariable(
"TXT_GLO_MODE", $this->lng->txt(
"glo_mode"));
465 $this->tpl->setVariable(
"TXT_GLO_MODE_DESC", $this->lng->txt(
"glo_mode_desc"));
468 $this->tpl->setVariable(
"TXT_GLO_MENU", $this->lng->txt(
"cont_glo_menu"));
469 $this->tpl->setVariable(
"TXT_ACT_MENU", $this->lng->txt(
"cont_active"));
470 $this->tpl->setVariable(
"CBOX_GLO_MENU",
"glo_act_menu");
471 $this->tpl->setVariable(
"VAL_GLO_MENU",
"y");
473 if ($this->object->isActiveGlossaryMenu())
475 $this->tpl->setVariable(
"CHK_GLO_MENU",
"checked");
479 $this->tpl->setVariable(
"TXT_DOWNLOADS", $this->lng->txt(
"cont_downloads"));
480 $this->tpl->setVariable(
"TXT_DOWNLOADS_DESC", $this->lng->txt(
"cont_downloads_desc"));
481 $this->tpl->setVariable(
"CBOX_DOWNLOADS",
"glo_act_downloads");
482 $this->tpl->setVariable(
"VAL_DOWNLOADS",
"y");
483 if ($this->object->isActiveDownloads())
485 $this->tpl->setVariable(
"CHK_DOWNLOADS",
"checked");
489 $this->tpl->setCurrentBlock(
"commands");
490 $this->tpl->setVariable(
"BTN_NAME",
"saveProperties");
491 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
492 $this->tpl->parseCurrentBlock();
502 $this->
object->setVirtualMode(
$_POST[
"glo_mode"]);
505 $this->
object->update();
507 $this->ctrl->redirect($this,
"properties");
515 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
517 $fs_gui->setFramesetTitle($this->object->getTitle());
518 $fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this,
"listTerms"));
519 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this,
"quickList"));
520 $fs_gui->setMainFrameName(
"content");
521 $fs_gui->setSideFrameName(
"tree");
533 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.glossary_short_list.html",
536 $this->tpl->addBlockFile(
"EXPLORER_TOP",
"exp_top",
"tpl.explorer_top.html");
539 $this->tpl->setVariable(
"FORMACTION1", $this->ctrl->getFormAction($this));
540 $this->tpl->setVariable(
"CMD_REFR",
"quickList");
541 $this->tpl->setVariable(
"TXT_REFR", $this->lng->txt(
"refresh"));
543 include_once
"./Services/Table/classes/class.ilTableGUI.php";
548 $this->tpl->addBlockfile(
"SHORT_LIST",
"list",
"tpl.table.html");
551 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.term_short_tbl_row.html",
true);
555 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
561 $tbl->setTitle($this->lng->txt(
"cont_terms"));
564 $tbl->setHeaderNames(array($this->lng->txt(
"cont_term")));
566 $cols = array(
"term");
567 $header_params = $this->ctrl->getParameterArrayByClass(
"ilobjglossarygui",
"listTerms");
568 $header_params[
"cmd"] =
"quickList";
569 $tbl->setHeaderVars($cols, $header_params);
570 $tbl->setColumnWidth(array(
"100%"));
573 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
574 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
575 $tbl->setLimit(
$_GET[
"limit"]);
576 $tbl->setOffset(
$_GET[
"offset"]);
577 $tbl->disable(
"header");
579 $term_list = $this->
object->getTermList();
580 $tbl->setMaxCount(count($term_list));
582 $this->tpl->setVariable(
"COLUMN_COUNT", 1);
585 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
589 $term_list = array_slice($term_list,
$_GET[
"offset"],
$_GET[
"limit"]);
594 if (count($term_list) > 0)
602 for($j=0; $j<count($defs); $j++)
607 $this->tpl->setCurrentBlock(
"definition");
608 $this->tpl->setVariable(
"SEP", $sep);
609 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"term_id",
$term[
"id"]);
610 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"def", $def[
"id"]);
611 $this->tpl->setVariable(
"LINK_EDIT_DEF",
612 $this->ctrl->getLinkTargetByClass(array(
"ilglossarytermgui",
613 "iltermdefinitioneditorgui",
614 "ilpageobjectgui"),
"edit"));
615 $this->tpl->setVariable(
"TEXT_DEF", $this->lng->txt(
"glo_definition_abbr").($j+1));
616 $this->tpl->parseCurrentBlock();
620 $this->tpl->setCurrentBlock(
"tbl_content");
624 $this->tpl->setVariable(
"TEXT_TERM",
$term[
"term"]);
625 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
626 $this->tpl->setVariable(
"LINK_EDIT_TERM",
627 $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"editTerm"));
629 $this->tpl->setVariable(
"CSS_ROW", $css_row);
630 $this->tpl->parseCurrentBlock();
635 $this->tpl->setCurrentBlock(
"notfound");
636 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
637 $this->tpl->setVariable(
"NUM_COLS", $num);
638 $this->tpl->parseCurrentBlock();
653 $this->lng->loadLanguageModule(
"meta");
654 include_once
"./Services/Table/classes/class.ilTableGUI.php";
658 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
660 $this->tpl->setCurrentBlock(
"btn_cell");
661 $this->tpl->setVariable(
"BTN_LINK",
662 "ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$this->object->getRefID());
663 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".
665 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
666 $this->tpl->parseCurrentBlock();
669 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.glossary_term_list.html",
true);
670 $this->tpl->setVariable(
"FORMACTION1", $this->ctrl->getFormAction($this,
"addTerm"));
671 $this->tpl->setVariable(
"TXT_TERM", $this->lng->txt(
"cont_term"));
672 $this->tpl->setVariable(
"TXT_ADD2", $this->lng->txt(
"add"));
673 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
678 $s_lang =
$_SESSION[
"il_text_lang_".$_GET[
"ref_id"]];
682 $s_lang = $ilUser->getLanguage();
686 $this->tpl->setVariable(
"SELECT_LANGUAGE", $select_language);
690 $this->tpl->addBlockfile(
"TERM_TABLE",
"term_table",
"tpl.table.html");
693 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.term_tbl_row.html",
true);
697 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
703 $tbl->setTitle($this->lng->txt(
"cont_terms"));
706 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"cont_term"),
707 $this->lng->txt(
"language"), $this->lng->txt(
"cont_definitions")));
709 $cols = array(
"",
"term",
"language",
"definitions",
"id");
711 $header_params = $this->ctrl->getParameterArrayByClass(
"ilobjglossarygui",
"listTerms");
712 $tbl->setHeaderVars($cols, $header_params);
713 $tbl->setColumnWidth(array(
"1%",
"24%",
"15%",
"60%"));
716 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
717 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
718 $tbl->setLimit(
$_GET[
"limit"]);
719 $tbl->setOffset(
$_GET[
"offset"]);
720 $tbl->disable(
"sort");
722 $term_list = $this->
object->getTermList();
723 $tbl->setMaxCount(count($term_list));
726 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
730 $term_list = array_slice($term_list,
$_GET[
"offset"],
$_GET[
"limit"]);
735 if (count($term_list) > 0)
737 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
738 $this->
showActions(array(
"confirmTermDeletion" =>
"delete",
"addDefinition" =>
"cont_add_definition"));
745 for($j=0; $j<count($defs); $j++)
752 $this->tpl->setCurrentBlock(
"move_up");
753 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
754 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
755 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
756 $this->tpl->setVariable(
"LINK_UP",
757 $this->ctrl->getLinkTarget($this,
"moveDefinitionUp"));
758 $this->tpl->parseCurrentBlock();
762 if ($j+1 < count($defs))
764 $this->tpl->setCurrentBlock(
"move_down");
765 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
766 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
767 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
768 $this->tpl->setVariable(
"LINK_DOWN",
769 $this->ctrl->getLinkTarget($this,
"moveDefinitionDown"));
770 $this->tpl->parseCurrentBlock();
774 $this->tpl->setCurrentBlock(
"delete");
775 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
776 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
777 $this->tpl->setVariable(
"LINK_DELETE",
778 $this->ctrl->getLinkTarget($this,
"confirmDefinitionDeletion"));
779 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
780 $this->tpl->parseCurrentBlock();
783 $this->tpl->setCurrentBlock(
"edit");
784 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"term_id",
$term[
"id"]);
785 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"def", $def[
"id"]);
786 $this->tpl->setVariable(
"LINK_EDIT",
787 $this->ctrl->getLinkTargetByClass(array(
"ilglossarytermgui",
788 "iltermdefinitioneditorgui",
789 "ilpageobjectgui"),
"edit"));
790 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
791 $this->tpl->parseCurrentBlock();
794 $this->tpl->setCurrentBlock(
"definition");
795 $short_str = $def[
"short_text"];
799 $ltexs = strrpos($short_str,
"[tex]");
800 $ltexe = strrpos($short_str,
"[/tex]");
805 $short_str = $page->getFirstParagraphText();
806 $short_str = strip_tags($short_str,
"<br>");
807 $ltexe = strpos($short_str,
"[/tex]", $ltexs);
812 $this->tpl->setVariable(
"DEF_SHORT", $short_str);
813 $this->tpl->parseCurrentBlock();
815 $this->tpl->setCurrentBlock(
"definition_row");
816 $this->tpl->parseCurrentBlock();
819 $this->tpl->setCurrentBlock(
"check_col");
820 $this->tpl->setVariable(
"CHECKBOX_ID",
$term[
"id"]);
821 $this->tpl->setVariable(
"CSS_ROW", $css_row);
822 $this->tpl->parseCurrentBlock();
825 $this->tpl->setCurrentBlock(
"edit_term");
826 $this->tpl->setVariable(
"TEXT_TERM",
$term[
"term"]);
827 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
828 $this->tpl->setVariable(
"LINK_EDIT_TERM",
829 $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"editTerm"));
830 $this->tpl->setVariable(
"TXT_EDIT_TERM", $this->lng->txt(
"edit"));
831 $this->tpl->parseCurrentBlock();
833 $this->tpl->setCurrentBlock(
"tbl_content");
836 $this->tpl->setVariable(
"CSS_ROW", $css_row);
837 $this->tpl->setVariable(
"TEXT_LANGUAGE", $this->lng->txt(
"meta_l_".$term[
"language"]));
838 $this->tpl->setCurrentBlock(
"tbl_content");
839 $this->tpl->parseCurrentBlock();
844 $this->tpl->setCurrentBlock(
"notfound");
845 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
846 $this->tpl->setVariable(
"NUM_COLS", $num);
847 $this->tpl->parseCurrentBlock();
863 $notoperations = array();
864 $operations = array();
868 if (count($operations) > 0)
870 foreach ($operations as $val)
872 $this->tpl->setCurrentBlock(
"tbl_action_btn");
873 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
874 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
875 $this->tpl->parseCurrentBlock();
878 $this->tpl->setCurrentBlock(
"tbl_action_row");
880 $this->tpl->parseCurrentBlock();
891 if (trim(
$_POST[
"new_term"]) ==
"")
894 $ilCtrl->redirect($this,
"listTerms");
898 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
900 $term->setGlossary($this->
object);
908 $def->setTermId(
$term->getId());
912 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"term_id",
$term->getId());
913 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"def", $def->getId());
914 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
915 "iltermdefinitioneditorgui",
"ilpageobjectgui"),
"edit");
923 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
926 $definition->moveUp();
928 $this->ctrl->redirect($this,
"listTerms");
936 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
939 $definition->moveDown();
941 $this->ctrl->redirect($this,
"listTerms");
956 $this->tpl->setCurrentBlock(
"ContentStyle");
957 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
959 $this->tpl->parseCurrentBlock();
962 $this->tpl->setCurrentBlock(
"SyntaxStyle");
963 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
965 $this->tpl->parseCurrentBlock();
971 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_delete.html",
true);
974 $this->tpl->setVariable(
"TXT_TERM",
$term->getTerm());
980 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
981 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
982 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
983 $output = $page_gui->preview();
985 $this->tpl->setCurrentBlock(
"definition");
986 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
987 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
988 $this->tpl->setVariable(
"LINK_CANCEL",
989 $this->ctrl->getLinkTarget($this,
"cancelDefinitionDeletion"));
990 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
991 $this->ctrl->setParameter($this,
"def", $definition->getId());
992 $this->tpl->setVariable(
"LINK_CONFIRM",
993 $this->ctrl->getLinkTarget($this,
"deleteDefinition"));
994 $this->tpl->parseCurrentBlock();
1010 $this->ctrl->redirect($this,
"listTerms");
1017 $definition->delete();
1018 $this->ctrl->redirect($this,
"listTerms");
1059 $this->ctrl->redirect($this,
"listTerms");
1073 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1076 $this->tpl->setCurrentBlock(
"btn_cell");
1077 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"export"));
1078 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_xml"));
1079 $this->tpl->parseCurrentBlock();
1082 $this->tpl->setCurrentBlock(
"btn_cell");
1083 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportHTML"));
1084 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_html"));
1085 $this->tpl->parseCurrentBlock();
1088 if (is_file($this->object->getExportDirectory().
"/export.log"))
1090 $this->tpl->setCurrentBlock(
"btn_cell");
1091 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"viewExportLog"));
1092 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_view_last_export_log"));
1093 $this->tpl->parseCurrentBlock();
1097 $export_dir = $this->
object->getExportDirectory();
1099 $export_files = $this->
object->getExportFiles();
1102 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
1106 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1109 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.glo_export_file_row.html",
true);
1113 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1115 $tbl->setTitle($this->lng->txt(
"cont_export_files"));
1117 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"type"),
1118 $this->lng->txt(
"cont_file"),
1119 $this->lng->txt(
"cont_size"), $this->lng->txt(
"date") ));
1121 $cols = array(
"",
"type",
"file",
"size",
"date");
1122 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
1123 "cmd" =>
"exportList",
"cmdClass" => get_class($this));
1124 $tbl->setHeaderVars($cols, $header_params);
1125 $tbl->setColumnWidth(array(
"1%",
"9%",
"40%",
"25%",
"25%"));
1126 $tbl->disable(
"sort");
1129 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1130 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1131 $tbl->setLimit(
$_GET[
"limit"]);
1132 $tbl->setOffset(
$_GET[
"offset"]);
1133 $tbl->setMaxCount($this->maxcount);
1135 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
1139 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1140 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
1141 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
1142 $this->tpl->parseCurrentBlock();
1144 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1145 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
1146 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
1147 $this->tpl->parseCurrentBlock();
1150 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1151 $this->tpl->setVariable(
"BTN_NAME",
"publishExportFile");
1152 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_public_access"));
1153 $this->tpl->parseCurrentBlock();
1156 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1159 $tbl->setMaxCount(count($export_files));
1160 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
1163 if(count($export_files) > 0)
1166 foreach($export_files as $exp_file)
1168 $this->tpl->setCurrentBlock(
"tbl_content");
1169 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
1172 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1174 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
1176 $public_str = ($exp_file[
"file"] == $this->
object->getPublicExportFile($exp_file[
"type"]))
1177 ?
" <b>(".$this->lng->txt(
"public").
")<b>"
1179 $this->tpl->setVariable(
"TXT_TYPE", $exp_file[
"type"].$public_str);
1180 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
1182 $file_arr = explode(
"__", $exp_file[
"file"]);
1183 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
1185 $this->tpl->parseCurrentBlock();
1190 $this->tpl->setCurrentBlock(
"notfound");
1191 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1192 $this->tpl->setVariable(
"NUM_COLS", 3);
1193 $this->tpl->parseCurrentBlock();
1196 $this->tpl->parseCurrentBlock();
1205 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
1207 $glo_exp->buildExportFile();
1208 $this->ctrl->redirect($this,
"exportList");
1216 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
1218 $glo_exp->buildExportFile();
1220 $this->ctrl->redirect($this,
"exportList");
1229 if(!isset(
$_POST[
"file"]))
1231 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1234 if (count(
$_POST[
"file"]) > 1)
1236 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1240 $export_dir = $this->
object->getExportDirectory(
$file[0]);
1250 if(!isset(
$_POST[
"file"]))
1252 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1254 if (count(
$_POST[
"file"]) > 1)
1256 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1260 $export_dir = $this->
object->getExportDirectory(
$file[0]);
1262 if ($this->object->getPublicExportFile(
$file[0]) ==
1265 $this->
object->setPublicExportFile(
$file[0],
"");
1269 $this->
object->setPublicExportFile(
$file[0],
$file[1]);
1271 $this->
object->update();
1272 $this->ctrl->redirect($this,
"exportList");
1285 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1288 $this->tpl->setCurrentBlock(
"btn_cell");
1289 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportList"));
1290 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_export_files"));
1291 $this->tpl->parseCurrentBlock();
1294 $this->tpl->setVariable(
"ADM_CONTENT",
1295 nl2br(file_get_contents($this->object->getExportDirectory().
"/export.log")));
1297 $this->tpl->parseCurrentBlock();
1305 if(!isset(
$_POST[
"file"]))
1307 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1315 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Glossary");
1319 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1322 $this->tpl->setCurrentBlock(
"table_header");
1323 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
1324 $this->tpl->parseCurrentBlock();
1330 $file = explode(
":", $file);
1331 $this->tpl->setCurrentBlock(
"table_row");
1333 $this->tpl->setVariable(
"TEXT_CONTENT", $file[1].
" (".$file[0].
")");
1334 $this->tpl->parseCurrentBlock();
1339 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
1340 "deleteExportFile" => $this->lng->txt(
"confirm"));
1341 foreach ($buttons as
$name => $value)
1343 $this->tpl->setCurrentBlock(
"operation_btn");
1344 $this->tpl->setVariable(
"BTN_NAME",
$name);
1345 $this->tpl->setVariable(
"BTN_VALUE",$value);
1346 $this->tpl->parseCurrentBlock();
1355 session_unregister(
"ilExportFiles");
1356 $this->ctrl->redirect($this,
"exportList");
1366 $file = explode(
":", $file);
1367 $export_dir = $this->
object->getExportDirectory($file[0]);
1369 $exp_file = $export_dir.
"/".$file[1];
1370 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
1371 if (@is_file($exp_file))
1375 if (@is_dir($exp_dir))
1380 $this->ctrl->redirect($this,
"exportList");
1389 if (!isset(
$_POST[
"id"]))
1391 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1397 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.obj_confirm.html");
1400 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1403 $cols = array(
"cont_term");
1404 foreach ($cols as
$key)
1406 $this->tpl->setCurrentBlock(
"table_header");
1407 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1408 $this->tpl->parseCurrentBlock();
1411 foreach(
$_POST[
"id"] as $id)
1416 $this->tpl->setCurrentBlock(
"table_cell");
1417 $this->tpl->setVariable(
"TEXT_CONTENT",
$term->getTerm());
1418 $this->tpl->parseCurrentBlock();
1421 $this->tpl->setCurrentBlock(
"table_row");
1423 $this->tpl->parseCurrentBlock();
1427 $buttons = array(
"cancelTermDeletion" => $this->lng->txt(
"cancel"),
1428 "deleteTerms" => $this->lng->txt(
"confirm"));
1430 foreach($buttons as
$name => $value)
1432 $this->tpl->setCurrentBlock(
"operation_btn");
1433 $this->tpl->setVariable(
"BTN_NAME",
$name);
1434 $this->tpl->setVariable(
"BTN_VALUE",$value);
1435 $this->tpl->parseCurrentBlock();
1447 session_unregister(
"term_delete");
1448 $this->ctrl->redirect($this,
"listTerms");
1456 foreach(
$_SESSION[
"term_delete"] as $id)
1461 session_unregister(
"term_delete");
1462 $this->ctrl->redirect($this,
"listTerms");
1474 global $ilias_locator;
1476 if(strtolower(
$_GET[
"baseClass"]) !=
"ilglossaryeditorgui")
1482 if(is_object($this->
object))
1484 require_once(
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
1486 if (is_object($this->term))
1488 $gloss_loc->setTerm($this->term);
1490 $gloss_loc->setGlossary($this->
object);
1492 $gloss_loc->display();
1512 switch(
$_POST[
"new_type"])
1516 $term_gui->create();
1524 $term_gui->setGlossary($this->
object);
1530 $ilCtrl->redirect($this,
"listTerms");
1541 if (count(
$_POST[
"id"]) < 1)
1544 $ilCtrl->redirect($this,
"listTerms");
1547 if (count(
$_POST[
"id"]) > 1)
1550 $ilCtrl->redirect($this,
"listTerms");
1554 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1559 $def->setTermId(
$term->getId());
1563 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"term_id",
$term->getId());
1564 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"def", $def->getId());
1565 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
1566 "iltermdefinitioneditorgui",
"ilpageobjectgui"),
"edit");
1572 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
1573 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1575 $title = $this->
object->getTitle();
1578 if (
$_GET[
"term_id"] > 0)
1583 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"term").
": ".
1588 $this->tpl->setCurrentBlock(
"header_image");
1590 $this->tpl->parseCurrentBlock();
1591 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"glo").
": ".
$title);
1606 #include_once("classes/class.ilTabsGUI.php");
1607 #$tabs_gui =& new ilTabsGUI();
1608 $this->
getTabs($this->tabs_gui);
1610 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
1622 $force_active = (
$_GET[
"cmd"] ==
"" ||
$_GET[
"cmd"] ==
"listTerms")
1625 $tabs_gui->addTarget(
"cont_terms",
1626 $this->ctrl->getLinkTarget($this,
"listTerms"), array(
"listTerms",
""),
1627 get_class($this),
"", $force_active);
1629 $force_active =
false;
1630 if ($this->ctrl->getCmd() ==
"showSummary" ||
1631 strtolower($this->ctrl->getNextClass()) ==
"ilinfoscreengui")
1633 $force_active =
true;
1635 $tabs_gui->addTarget(
"information_abbr",
1636 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
1637 "ilInfoScreenGUI",
"", $force_active);
1641 $tabs_gui->addTarget(
"properties",
1642 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1646 $tabs_gui->addTarget(
"meta_data",
1647 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
1648 "",
"ilmdeditorgui");
1651 $tabs_gui->addTarget(
"export",
1652 $this->ctrl->getLinkTarget($this,
"exportList"),
1653 array(
"exportList",
"viewExportLog"), get_class($this));
1656 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1663 $tabs_gui->addTarget(
"perm_settings",
1664 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1678 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1680 $_GET[
"ref_id"] = $a_target;
1681 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
1682 include(
"ilias.php");
1685 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1687 $_GET[
"ref_id"] = $a_target;
1688 $_GET[
"cmd"] =
"infoScreen";
1689 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
1690 include(
"ilias.php");
1693 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1695 $_GET[
"cmd"] =
"frameset";
1696 $_GET[
"target"] =
"";
1697 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1700 include(
"repository.php");
1704 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);