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(
"./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");
206 $new_type = $_POST[
"new_type"] ? $_POST[
"new_type"] :
$_GET[
"new_type"];
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();
501 $this->
object->setOnline(
ilUtil::yn2tf($_POST[
"cobj_online"]));
502 $this->
object->setVirtualMode($_POST[
"glo_mode"]);
503 $this->
object->setActiveGlossaryMenu(
ilUtil::yn2tf($_POST[
"glo_act_menu"]));
504 $this->
object->setActiveDownloads(
ilUtil::yn2tf($_POST[
"glo_act_downloads"]));
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)
597 foreach($term_list as $key =>
$term)
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));
728 $this->
setActions(array(
"confirmTermDeletion" =>
"delete",
"addDefinition" =>
"cont_add_definition"));
732 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
736 $term_list = array_slice($term_list,
$_GET[
"offset"],
$_GET[
"limit"]);
741 if (count($term_list) > 0)
743 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
747 foreach($term_list as $key =>
$term)
751 for($j=0; $j<count($defs); $j++)
758 $this->tpl->setCurrentBlock(
"move_up");
759 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
760 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
761 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
762 $this->tpl->setVariable(
"LINK_UP",
763 $this->ctrl->getLinkTarget($this,
"moveDefinitionUp"));
764 $this->tpl->parseCurrentBlock();
768 if ($j+1 < count($defs))
770 $this->tpl->setCurrentBlock(
"move_down");
771 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
772 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
773 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
774 $this->tpl->setVariable(
"LINK_DOWN",
775 $this->ctrl->getLinkTarget($this,
"moveDefinitionDown"));
776 $this->tpl->parseCurrentBlock();
780 $this->tpl->setCurrentBlock(
"delete");
781 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
782 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
783 $this->tpl->setVariable(
"LINK_DELETE",
784 $this->ctrl->getLinkTarget($this,
"confirmDefinitionDeletion"));
785 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
786 $this->tpl->parseCurrentBlock();
789 $this->tpl->setCurrentBlock(
"edit");
790 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"term_id",
$term[
"id"]);
791 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"def", $def[
"id"]);
792 $this->tpl->setVariable(
"LINK_EDIT",
793 $this->ctrl->getLinkTargetByClass(array(
"ilglossarytermgui",
794 "iltermdefinitioneditorgui",
795 "ilpageobjectgui"),
"edit"));
796 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
797 $this->tpl->parseCurrentBlock();
800 $this->tpl->setCurrentBlock(
"definition");
801 $short_str = $def[
"short_text"];
805 $ltexs = strrpos($short_str,
"[tex]");
806 $ltexe = strrpos($short_str,
"[/tex]");
811 $short_str = $page->getFirstParagraphText();
812 $short_str = strip_tags($short_str,
"<br>");
813 $ltexe = strpos($short_str,
"[/tex]", $ltexs);
818 $this->tpl->setVariable(
"DEF_SHORT", $short_str);
819 $this->tpl->parseCurrentBlock();
821 $this->tpl->setCurrentBlock(
"definition_row");
822 $this->tpl->parseCurrentBlock();
825 $this->tpl->setCurrentBlock(
"check_col");
826 $this->tpl->setVariable(
"CHECKBOX_ID",
$term[
"id"]);
827 $this->tpl->setVariable(
"CSS_ROW", $css_row);
828 $this->tpl->parseCurrentBlock();
831 $this->tpl->setCurrentBlock(
"edit_term");
832 $this->tpl->setVariable(
"TEXT_TERM",
$term[
"term"]);
833 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
834 $this->tpl->setVariable(
"LINK_EDIT_TERM",
835 $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"editTerm"));
836 $this->tpl->setVariable(
"TXT_EDIT_TERM", $this->lng->txt(
"edit"));
837 $this->tpl->parseCurrentBlock();
839 $this->tpl->setCurrentBlock(
"tbl_content");
842 $this->tpl->setVariable(
"CSS_ROW", $css_row);
843 $this->tpl->setVariable(
"TEXT_LANGUAGE", $this->lng->txt(
"meta_l_".$term[
"language"]));
844 $this->tpl->setCurrentBlock(
"tbl_content");
845 $this->tpl->parseCurrentBlock();
850 $this->tpl->setCurrentBlock(
"notfound");
851 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
852 $this->tpl->setVariable(
"NUM_COLS", $num);
853 $this->tpl->parseCurrentBlock();
863 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
865 $term->setGlossary($this->
object);
867 $term->setLanguage($_POST[
"term_language"]);
868 $_SESSION[
"il_text_lang_".$_GET[
"ref_id"]] = $_POST[
"term_language"];
873 $def->setTermId(
$term->getId());
877 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"term_id",
$term->getId());
878 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"def", $def->getId());
879 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
880 "iltermdefinitioneditorgui",
"ilpageobjectgui"),
"edit");
888 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
891 $definition->moveUp();
893 $this->ctrl->redirect($this,
"listTerms");
901 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
904 $definition->moveDown();
906 $this->ctrl->redirect($this,
"listTerms");
921 $this->tpl->setCurrentBlock(
"ContentStyle");
922 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
924 $this->tpl->parseCurrentBlock();
927 $this->tpl->setCurrentBlock(
"SyntaxStyle");
928 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
930 $this->tpl->parseCurrentBlock();
936 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_delete.html",
true);
939 $this->tpl->setVariable(
"TXT_TERM",
$term->getTerm());
945 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
946 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
947 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
948 $output = $page_gui->preview();
950 $this->tpl->setCurrentBlock(
"definition");
951 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
952 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
953 $this->tpl->setVariable(
"LINK_CANCEL",
954 $this->ctrl->getLinkTarget($this,
"cancelDefinitionDeletion"));
955 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
956 $this->ctrl->setParameter($this,
"def", $definition->getId());
957 $this->tpl->setVariable(
"LINK_CONFIRM",
958 $this->ctrl->getLinkTarget($this,
"deleteDefinition"));
959 $this->tpl->parseCurrentBlock();
976 $this->ctrl->redirect($this,
"listTerms");
983 $definition->delete();
984 $this->ctrl->redirect($this,
"listTerms");
1022 $term->setLanguage($_POST[
"term_language"]);
1025 $this->ctrl->redirect($this,
"listTerms");
1039 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1042 $this->tpl->setCurrentBlock(
"btn_cell");
1043 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"export"));
1044 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_xml"));
1045 $this->tpl->parseCurrentBlock();
1048 $this->tpl->setCurrentBlock(
"btn_cell");
1049 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportHTML"));
1050 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_html"));
1051 $this->tpl->parseCurrentBlock();
1054 if (is_file($this->object->getExportDirectory().
"/export.log"))
1056 $this->tpl->setCurrentBlock(
"btn_cell");
1057 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"viewExportLog"));
1058 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_view_last_export_log"));
1059 $this->tpl->parseCurrentBlock();
1063 $export_dir = $this->
object->getExportDirectory();
1065 $export_files = $this->
object->getExportFiles();
1068 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
1072 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1075 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.glo_export_file_row.html",
true);
1079 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1081 $tbl->setTitle($this->lng->txt(
"cont_export_files"));
1083 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"type"),
1084 $this->lng->txt(
"cont_file"),
1085 $this->lng->txt(
"cont_size"), $this->lng->txt(
"date") ));
1087 $cols = array(
"",
"type",
"file",
"size",
"date");
1088 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
1089 "cmd" =>
"exportList",
"cmdClass" => get_class($this));
1090 $tbl->setHeaderVars($cols, $header_params);
1091 $tbl->setColumnWidth(array(
"1%",
"9%",
"40%",
"25%",
"25%"));
1092 $tbl->disable(
"sort");
1095 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1096 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1097 $tbl->setLimit(
$_GET[
"limit"]);
1098 $tbl->setOffset(
$_GET[
"offset"]);
1099 $tbl->setMaxCount($this->maxcount);
1101 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
1105 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1106 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
1107 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
1108 $this->tpl->parseCurrentBlock();
1110 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1111 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
1112 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
1113 $this->tpl->parseCurrentBlock();
1116 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1117 $this->tpl->setVariable(
"BTN_NAME",
"publishExportFile");
1118 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_public_access"));
1119 $this->tpl->parseCurrentBlock();
1122 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1125 $tbl->setMaxCount(count($export_files));
1126 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
1129 if(count($export_files) > 0)
1132 foreach($export_files as $exp_file)
1134 $this->tpl->setCurrentBlock(
"tbl_content");
1135 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
1138 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1140 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
1142 $public_str = ($exp_file[
"file"] == $this->
object->getPublicExportFile($exp_file[
"type"]))
1143 ?
" <b>(".$this->lng->txt(
"public").
")<b>"
1145 $this->tpl->setVariable(
"TXT_TYPE", $exp_file[
"type"].$public_str);
1146 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
1148 $file_arr = explode(
"__", $exp_file[
"file"]);
1149 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
1151 $this->tpl->parseCurrentBlock();
1156 $this->tpl->setCurrentBlock(
"notfound");
1157 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1158 $this->tpl->setVariable(
"NUM_COLS", 3);
1159 $this->tpl->parseCurrentBlock();
1162 $this->tpl->parseCurrentBlock();
1171 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
1173 $glo_exp->buildExportFile();
1174 $this->ctrl->redirect($this,
"exportList");
1182 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
1184 $glo_exp->buildExportFile();
1186 $this->ctrl->redirect($this,
"exportList");
1195 if(!isset($_POST[
"file"]))
1197 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1200 if (count($_POST[
"file"]) > 1)
1202 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1205 $file = explode(
":", $_POST[
"file"][0]);
1206 $export_dir = $this->
object->getExportDirectory(
$file[0]);
1216 if(!isset($_POST[
"file"]))
1218 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1220 if (count($_POST[
"file"]) > 1)
1222 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1225 $file = explode(
":", $_POST[
"file"][0]);
1226 $export_dir = $this->
object->getExportDirectory(
$file[0]);
1228 if ($this->object->getPublicExportFile(
$file[0]) ==
1231 $this->
object->setPublicExportFile(
$file[0],
"");
1235 $this->
object->setPublicExportFile(
$file[0],
$file[1]);
1237 $this->
object->update();
1238 $this->ctrl->redirect($this,
"exportList");
1251 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1254 $this->tpl->setCurrentBlock(
"btn_cell");
1255 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportList"));
1256 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_export_files"));
1257 $this->tpl->parseCurrentBlock();
1260 $this->tpl->setVariable(
"ADM_CONTENT",
1261 nl2br(file_get_contents($this->object->getExportDirectory().
"/export.log")));
1263 $this->tpl->parseCurrentBlock();
1271 if(!isset($_POST[
"file"]))
1273 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1279 $_SESSION[
"ilExportFiles"] = $_POST[
"file"];
1281 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Glossary");
1285 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1288 $this->tpl->setCurrentBlock(
"table_header");
1289 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
1290 $this->tpl->parseCurrentBlock();
1294 foreach($_POST[
"file"] as
$file)
1296 $file = explode(
":", $file);
1297 $this->tpl->setCurrentBlock(
"table_row");
1299 $this->tpl->setVariable(
"TEXT_CONTENT", $file[1].
" (".$file[0].
")");
1300 $this->tpl->parseCurrentBlock();
1305 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
1306 "deleteExportFile" => $this->lng->txt(
"confirm"));
1307 foreach ($buttons as $name => $value)
1309 $this->tpl->setCurrentBlock(
"operation_btn");
1310 $this->tpl->setVariable(
"BTN_NAME",$name);
1311 $this->tpl->setVariable(
"BTN_VALUE",$value);
1312 $this->tpl->parseCurrentBlock();
1321 session_unregister(
"ilExportFiles");
1322 $this->ctrl->redirect($this,
"exportList");
1332 $file = explode(
":", $file);
1333 $export_dir = $this->
object->getExportDirectory($file[0]);
1335 $exp_file = $export_dir.
"/".$file[1];
1336 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
1337 if (@is_file($exp_file))
1341 if (@is_dir($exp_dir))
1346 $this->ctrl->redirect($this,
"exportList");
1355 if (!isset($_POST[
"id"]))
1357 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1361 $_SESSION[
"term_delete"] = $_POST[
"id"];
1363 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.obj_confirm.html");
1366 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1369 $cols = array(
"cont_term");
1370 foreach ($cols as $key)
1372 $this->tpl->setCurrentBlock(
"table_header");
1373 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1374 $this->tpl->parseCurrentBlock();
1377 foreach($_POST[
"id"] as $id)
1382 $this->tpl->setCurrentBlock(
"table_cell");
1383 $this->tpl->setVariable(
"TEXT_CONTENT",
$term->getTerm());
1384 $this->tpl->parseCurrentBlock();
1387 $this->tpl->setCurrentBlock(
"table_row");
1389 $this->tpl->parseCurrentBlock();
1393 $buttons = array(
"cancelTermDeletion" => $this->lng->txt(
"cancel"),
1394 "deleteTerms" => $this->lng->txt(
"confirm"));
1396 foreach($buttons as $name => $value)
1398 $this->tpl->setCurrentBlock(
"operation_btn");
1399 $this->tpl->setVariable(
"BTN_NAME",$name);
1400 $this->tpl->setVariable(
"BTN_VALUE",$value);
1401 $this->tpl->parseCurrentBlock();
1413 session_unregister(
"term_delete");
1415 $this->ctrl->redirect($this,
"listTerms");
1423 foreach(
$_SESSION[
"term_delete"] as $id)
1428 session_unregister(
"term_delete");
1429 $this->ctrl->redirect($this,
"listTerms");
1441 global $ilias_locator;
1443 if(strtolower(
$_GET[
"baseClass"]) !=
"ilglossaryeditorgui")
1449 if(is_object($this->
object))
1451 require_once(
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
1453 if (is_object($this->term))
1455 $gloss_loc->setTerm($this->term);
1457 $gloss_loc->setGlossary($this->
object);
1459 $gloss_loc->display();
1479 switch($_POST[
"new_type"])
1483 $term_gui->create();
1491 $term_gui->setGlossary($this->
object);
1497 $ilCtrl->redirect($this,
"listTerms");
1506 if (count($_POST[
"id"]) < 1)
1508 $this->ilias->raiseError($this->lng->txt(
"cont_select_term"),$this->ilias->error_obj->MESSAGE);
1511 if (count($_POST[
"id"]) > 1)
1513 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_term"),$this->ilias->error_obj->MESSAGE);
1517 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1522 $def->setTermId(
$term->getId());
1526 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"term_id",
$term->getId());
1527 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"def", $def->getId());
1528 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
1529 "iltermdefinitioneditorgui",
"ilpageobjectgui"),
"edit");
1535 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
1536 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1538 $title = $this->
object->getTitle();
1543 if (
$_GET[
"term_id"] > 0)
1548 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"term").
": ".
1553 $this->tpl->setCurrentBlock(
"header_image");
1555 $this->tpl->parseCurrentBlock();
1556 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"glo").
": ".
$title);
1571 #include_once("classes/class.ilTabsGUI.php");
1572 #$tabs_gui =& new ilTabsGUI();
1573 $this->
getTabs($this->tabs_gui);
1575 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
1587 $force_active = (
$_GET[
"cmd"] ==
"" ||
$_GET[
"cmd"] ==
"listTerms")
1590 $tabs_gui->addTarget(
"cont_terms",
1591 $this->ctrl->getLinkTarget($this,
"listTerms"), array(
"listTerms",
""),
1592 get_class($this),
"", $force_active);
1594 $force_active =
false;
1595 if ($this->ctrl->getCmd() ==
"showSummary" ||
1596 strtolower($this->ctrl->getNextClass()) ==
"ilinfoscreengui")
1598 $force_active =
true;
1600 $tabs_gui->addTarget(
"information_abbr",
1601 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
1602 "ilInfoScreenGUI",
"", $force_active);
1606 $tabs_gui->addTarget(
"properties",
1607 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1611 $tabs_gui->addTarget(
"meta_data",
1612 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
1613 "",
"ilmdeditorgui");
1616 $tabs_gui->addTarget(
"export",
1617 $this->ctrl->getLinkTarget($this,
"exportList"),
1618 array(
"exportList",
"viewExportLog"), get_class($this));
1621 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1628 $tabs_gui->addTarget(
"perm_settings",
1629 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1643 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1645 $_GET[
"ref_id"] = $a_target;
1646 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
1647 include(
"ilias.php");
1650 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1652 $_GET[
"ref_id"] = $a_target;
1653 $_GET[
"cmd"] =
"infoScreen";
1654 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
1655 include(
"ilias.php");
1658 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1660 $_GET[
"cmd"] =
"frameset";
1661 $_GET[
"target"] =
"";
1662 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1665 include(
"repository.php");
1669 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);