5 require_once(
"./Services/Object/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");
36 function ilObjGlossaryGUI($a_data,$a_id = 0,$a_call_by_reference =
true, $a_prepare_output =
true)
41 $this->ctrl->saveParameter($this, array(
"ref_id",
"offset"));
43 $lng->loadLanguageModule(
"content");
50 $this->term_id = (int)
$_GET[
"term_id"];
52 if ($this->term_id > 0 && $term_glo_id != $this->object->getId())
57 $this->tax_id = $this->
object->getTaxonomyId();
58 if ($this->tax_id > 0)
60 $this->ctrl->saveParameter($this, array(
"show_tax",
"tax_node"));
62 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
65 if ((
int)
$_GET[
"tax_node"] > 1 && $this->tax->getTree()->readRootId() !=
$_GET[
"tax_node"])
67 $this->tax_node = (int)
$_GET[
"tax_node"];
78 $cmd = $this->ctrl->getCmd();
79 $next_class = $this->ctrl->getNextClass($this);
91 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
93 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
94 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
96 $this->ctrl->forwardCommand($md_gui);
99 case "ilglossarytermgui":
101 $this->ctrl->setReturn($this,
"listTerms");
103 $term_gui->setGlossary($this->
object);
105 $ret =& $this->ctrl->forwardCommand($term_gui);
108 case "ilinfoscreengui":
113 case "ilobjstylesheetgui":
114 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
115 $this->ctrl->setReturn($this,
"editStyleProperties");
116 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
118 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
120 $style_gui->setCreationMode(
true);
123 if (
$cmd ==
"confirmedDelete")
125 $this->
object->setStyleSheetId(0);
126 $this->
object->update();
129 $ret = $this->ctrl->forwardCommand($style_gui);
131 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
134 $this->
object->setStyleSheetId($style_id);
135 $this->
object->update();
136 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
141 case 'ilpermissiongui':
142 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
153 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
155 $ret =& $this->ctrl->forwardCommand($perm_gui);
158 case "ilcommonactiondispatchergui":
159 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
161 $this->ctrl->forwardCommand($gui);
164 case "ilobjtaxonomygui":
169 $ilTabs->activateTab(
"settings");
172 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
173 $this->ctrl->setReturn($this,
"properties");
175 $tax_gui->setMultiple(
false);
181 $tax_gui->setAssignedObject($this->object->getId());
182 $ret = $this->ctrl->forwardCommand($tax_gui);
188 $ilTabs->activateTab(
"export");
190 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
193 $exp_gui->addFormat(
"xml");
194 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
195 $exp_gui->addCustomColumn($lng->txt(
"cont_public_access"),
196 $this,
"getPublicAccessColValue");
197 $exp_gui->addCustomMultiCommand($lng->txt(
"cont_public_access"),
198 $this,
"publishExportFile");
199 $ret = $this->ctrl->forwardCommand($exp_gui);
203 $cmd = $this->ctrl->getCmd(
"listTerms");
205 if ((
$cmd ==
"create") && (
$_POST[
"new_type"] ==
"term"))
207 $this->ctrl->setCmd(
"create");
208 $this->ctrl->setCmdClass(
"ilGlossaryTermGUI");
214 if (!in_array(
$cmd, array(
"frameset",
"quickList")))
216 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
235 if (!in_array(
$cmd, array(
"frameset",
"quickList")))
237 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui")
247 $this->tpl->show(
false);
253 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
270 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
272 $form->setTarget(
"_top");
273 $form->setFormAction($this->ctrl->getFormAction($this));
274 $form->setTitle($this->lng->txt($a_new_type.
"_new"));
280 $ti->setRequired(
true);
291 "none"=>$this->lng->txt(
"glo_mode_normal"),
292 "level"=>$this->lng->txt(
"glo_mode_level"),
293 "subtree"=>$this->lng->txt(
"glo_mode_subtree")
297 $tm->setInfo($this->lng->txt(
"glo_mode_desc"));
298 $tm->setRequired(
true);
301 $form->addCommandButton(
"save", $this->lng->txt($a_new_type.
"_add"));
302 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
324 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
327 $this->lng->loadLanguageModule($new_type);
328 $this->ctrl->setParameter($this,
"new_type", $new_type);
331 if ($form->checkInput())
333 $this->ctrl->setParameter($this,
"new_type",
"");
335 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
337 $newObj->setType($new_type);
338 $newObj->setTitle($form->getInput(
"title"));
339 $newObj->setDescription($form->getInput(
"desc"));
340 $newObj->setVirtualMode($form->getInput(
"glo_mode"));
347 ilUtil::redirect(
"ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
351 $form->setValuesByPost();
352 $tpl->setContent($form->getHtml());
368 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
371 $this->lng->loadLanguageModule($new_type);
372 $this->ctrl->setParameter($this,
"new_type", $new_type);
375 if ($form->checkInput())
377 $this->ctrl->setParameter($this,
"new_type",
"");
378 $upload = $_FILES[
"importfile"];
381 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
383 $newObj->setType($new_type);
384 $newObj->setTitle($upload[
"name"]);
385 $newObj->create(
true);
390 $newObj->createImportDirectory();
393 $file = pathinfo($upload[
"name"]);
394 $full_path = $newObj->getImportDirectory().
"/".$upload[
"name"];
403 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
404 $xml_file = $newObj->getImportDirectory().
"/".$subdir.
"/".$subdir.
".xml";
409 if (is_file($newObj->getImportDirectory().
"/".$subdir.
"/manifest.xml"))
411 include_once(
"./Services/Export/classes/class.ilImport.php");
413 $map = $imp->getMapping();
414 $map->addMapping(
"Modules/Glossary",
"glo",
"new_id", $newObj->getId());
415 $imp->importObject($newObj, $full_path, $upload[
"name"],
"glo",
416 "Modules/Glossary",
true);
418 ilUtil::redirect(
"ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
422 if (!is_dir($newObj->getImportDirectory().
"/".$subdir))
424 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_no_subdir_in_zip"), $subdir),
425 $this->ilias->error_obj->MESSAGE);
429 if (!is_file($xml_file))
431 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml"),
432 $this->ilias->error_obj->MESSAGE);
435 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
437 $contParser->startParsing();
444 ilUtil::redirect(
"ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
448 $form->setValuesByPost();
449 $tpl->setContent($form->getHtml());
465 $this->lng->loadLanguageModule(
"meta");
466 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
469 $info->enablePrivateNotes();
471 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
473 $info->enableNewsEditing();
475 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
476 if ($enable_internal_rss)
478 $info->setBlockProperty(
"news",
"settings",
true);
481 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
485 $this->ctrl->forwardCommand($info);
496 global
$lng, $ilAccess;
498 $info->addSection($lng->txt(
"glo_usages"));
499 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
501 foreach ($sms as $sm)
505 foreach ($refs as $ref)
509 if ($ilAccess->checkAccess(
"write",
"", $ref))
511 include_once(
"./Services/Link/classes/class.ilLink.php");
520 $entry =
"<a href='".$link.
"' target='_top'>".$entry.
"</a>";
523 $info->addProperty($lng->txt(
"obj_sahs"), $entry);
532 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
538 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
540 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
544 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
546 $this->tpl->setCurrentBlock(
"btn_cell");
547 $this->tpl->setVariable(
"BTN_LINK",
548 "ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$this->object->getRefID());
549 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".
551 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
552 $this->tpl->parseCurrentBlock();
573 include_once
'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
575 $ecs->addSettingsToForm($this->form,
'glo');
577 $tpl->setContent($this->form->getHTML());
589 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
595 $this->form->addItem($title);
599 $this->form->addItem($desc);
601 $lng->loadLanguageModule(
"rep");
603 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
609 $online->setInfo($lng->txt(
"glo_online_info"));
610 $this->form->addItem($online);
613 $section->setTitle($this->lng->txt(
'glo_content_settings'));
619 $op1 =
new ilRadioOption($lng->txt(
"glo_mode_normal"),
"none",$lng->txt(
"glo_mode_normal_info"));
620 $glo_mode->addOption($op1);
621 $op2 =
new ilRadioOption($lng->txt(
"glo_mode_level"),
"level",$lng->txt(
"glo_mode_level_info"));
622 $glo_mode->addOption($op2);
623 $op3 =
new ilRadioOption($lng->txt(
"glo_mode_subtree"),
"subtree",$lng->txt(
"glo_mode_subtree_info"));
624 $glo_mode->addOption($op3);
625 $this->form->addItem($glo_mode);
640 $section->setTitle($this->lng->txt(
'cont_presentation'));
646 $op1 =
new ilRadioOption($lng->txt(
"glo_table_form"),
"table", $lng->txt(
"glo_table_form_info"));
649 $snl =
new ilNumberInputGUI($lng->txt(
"glo_text_snippet_length"),
"snippet_length");
650 $snl->setMaxValue(3000);
651 $snl->setMinValue(100);
652 $snl->setMaxLength(4);
654 $snl->
setInfo($lng->txt(
"glo_text_snippet_length_info"));
658 $pres_mode->addOption($op1);
659 $op2 =
new ilRadioOption($lng->txt(
"glo_full_definitions"),
"full_def", $lng->txt(
"glo_full_definitions_info"));
660 $pres_mode->addOption($op2);
661 $this->form->addItem($pres_mode);
664 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
666 if (count($tax_ids) > 0)
669 $show_tax->
setInfo($this->lng->txt(
"glo_show_taxonomy_info"));
670 $this->form->addItem($show_tax);
676 $down->setInfo($lng->txt(
"cont_downloads_desc"));
677 $this->form->addItem($down);
679 if ($a_mode ==
"edit")
681 $title->setValue($this->object->getTitle());
682 $desc->setValue($this->object->getDescription());
683 $online->setChecked($this->object->getOnline());
684 $glo_mode->setValue($this->object->getVirtualMode());
685 $pres_mode->setValue($this->object->getPresentationMode());
686 $snl->
setValue($this->object->getSnippetLength());
687 if (count($tax_ids) > 0)
689 $show_tax->setChecked($this->object->getShowTaxonomy());
692 $down->setChecked($this->object->isActiveDownloads());
696 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
699 $record_gui->parseRecordSelection($this->lng->txt(
"glo_add_term_properties"));
702 include_once(
"./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php");
705 if (count($cols) > 1)
707 include_once
'./Modules/Glossary/classes/class.ilGloAdvColSortInputGUI.php';
709 $this->form->addItem($ti);
714 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
716 $this->form->setTitle($lng->txt(
"cont_glo_properties"));
717 $this->form->setFormAction($ilCtrl->getFormAction($this));
729 if ($this->form->checkInput())
731 $this->
object->setTitle(
$_POST[
'title']);
732 $this->
object->setDescription(
$_POST[
'description']);
734 $this->
object->setVirtualMode(
$_POST[
"glo_mode"]);
737 $this->
object->setPresentationMode(
$_POST[
"pres_mode"]);
738 $this->
object->setSnippetLength(
$_POST[
"snippet_length"]);
739 $this->
object->setShowTaxonomy(
$_POST[
"show_tax"]);
740 $this->
object->update();
743 include_once(
"./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php");
746 if (count($cols) > 1)
748 $adv_ap->saveColumnOrder(
$_POST[
"field_order"]);
752 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
756 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
761 include_once
'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
763 if($ecs->handleSettingsUpdate())
766 $this->ctrl->redirect($this,
"properties");
770 $this->form->setValuesByPost();
771 $tpl->setContent($this->form->getHTML());
781 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
783 $fs_gui->setFramesetTitle($this->object->getTitle());
784 if ((
int)
$_GET[
"edit_term"] > 0)
786 $ilCtrl->setParameterByClass(
"ilglossarytermgui",
"term_id", (
int)
$_GET[
"edit_term"]);
787 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"listDefinitions"));
791 $fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this,
"listTerms"));
793 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this,
"quickList"));
794 $fs_gui->setMainFrameName(
"content");
795 $fs_gui->setSideFrameName(
"tree");
808 include_once(
"./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
810 $tpl->setLeftContent(
$tab->getHTML());
812 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.glossary_short_list.html",
818 $this->tpl->setVariable(
"FORMACTION1", $this->ctrl->getFormAction($this));
819 $this->tpl->setVariable(
"CMD_REFR",
"quickList");
820 $this->tpl->setVariable(
"TXT_REFR", $this->lng->txt(
"refresh"));
821 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_terms"));
823 include_once
"./Services/Table/classes/class.ilTableGUI.php";
828 $this->tpl->addBlockfile(
"SHORT_LIST",
"list",
"tpl.table.html");
831 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.term_short_tbl_row.html",
true);
835 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
844 $tbl->setHeaderNames(array($this->lng->txt(
"cont_term")));
846 $cols = array(
"term");
847 $header_params = $this->ctrl->getParameterArrayByClass(
"ilobjglossarygui",
"listTerms");
848 $header_params[
"cmd"] =
"quickList";
849 $tbl->setHeaderVars($cols, $header_params);
850 $tbl->setColumnWidth(array(
"100%"));
851 $tbl->disable(
"title");
854 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
855 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
856 $tbl->setLimit(
$_GET[
"limit"]);
857 $tbl->setOffset(
$_GET[
"offset"]);
858 $tbl->disable(
"header");
860 $term_list = $this->
object->getTermList();
861 $tbl->setMaxCount(count($term_list));
863 $this->tpl->setVariable(
"COLUMN_COUNT", 1);
866 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
870 $term_list = array_slice($term_list,
$_GET[
"offset"],
$_GET[
"limit"]);
875 if (count($term_list) > 0)
878 foreach($term_list as $key =>
$term)
883 for($j=0; $j<count($defs); $j++)
888 $this->tpl->setCurrentBlock(
"definition");
889 $this->tpl->setVariable(
"SEP", $sep);
890 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"term_id",
$term[
"id"]);
891 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"def", $def[
"id"]);
892 $this->tpl->setVariable(
"LINK_EDIT_DEF",
893 $this->ctrl->getLinkTargetByClass(array(
"ilglossarytermgui",
894 "iltermdefinitioneditorgui",
895 "ilglossarydefpagegui"),
"edit"));
896 $this->tpl->setVariable(
"TEXT_DEF", $this->lng->txt(
"glo_definition_abbr").($j+1));
897 $this->tpl->parseCurrentBlock();
901 $this->tpl->setCurrentBlock(
"tbl_content");
905 $this->tpl->setVariable(
"TEXT_TERM",
$term[
"term"]);
906 $this->ctrl->setParameter($this,
"term_id",
$term[
"id"]);
907 $this->tpl->setVariable(
"LINK_EDIT_TERM",
908 $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"editTerm"));
910 $this->tpl->setVariable(
"CSS_ROW", $css_row);
911 $this->tpl->parseCurrentBlock();
917 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
918 $this->tpl->setVariable(
"NUM_COLS", $num);
931 if (
$_GET[
"show_tax"])
937 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
941 $ilToolbar->addInputItem($ti,
true);
944 $this->lng->loadLanguageModule(
"meta");
948 $s_lang =
$_SESSION[
"il_text_lang_".$_GET[
"ref_id"]];
952 $s_lang = $ilUser->getLanguage();
954 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
957 $si->setValue($s_lang);
958 $ilToolbar->addInputItem(
$si,
true);
960 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
961 $ilToolbar->addFormButton($lng->txt(
"glo_add_new_term"),
"addTerm");
965 if (is_object($this->tax))
967 $ilToolbar->addSeparator();
968 if (
$_GET[
"show_tax"])
970 $ilToolbar->addButton($lng->txt(
"glo_hide_taxonomy"),
971 $ilCtrl->getLinkTarget($this,
"deactTaxonomy"));
975 $ilToolbar->addButton($lng->txt(
"glo_show_taxonomy"),
976 $ilCtrl->getLinkTarget($this,
"actTaxonomy"));
980 include_once(
"./Modules/Glossary/classes/class.ilTermListTableGUI.php");
982 $tpl->setContent(
$tab->getHTML());
995 $ilCtrl->setParameter($this,
"show_tax", 1);
996 $ilCtrl->redirect($this,
"listTerms");
1009 $ilCtrl->setParameter($this,
"show_tax",
"");
1010 $ilCtrl->redirect($this,
"listTerms");
1021 foreach ($a_actions as $name =>
$lng)
1023 $d[$name] = array(
"name" => $name,
"lng" =>
$lng);
1026 $notoperations = array();
1027 $operations = array();
1031 if (count($operations) > 0)
1033 foreach ($operations as $val)
1035 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1036 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
1037 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
1038 $this->tpl->parseCurrentBlock();
1041 $this->tpl->setCurrentBlock(
"tbl_action_row");
1043 $this->tpl->parseCurrentBlock();
1054 if (trim(
$_POST[
"new_term"]) ==
"")
1057 $ilCtrl->redirect($this,
"listTerms");
1061 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1063 $term->setGlossary($this->
object);
1071 $def->setTermId(
$term->getId());
1075 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"term_id",
$term->getId());
1076 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"def", $def->getId());
1077 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
1078 "iltermdefinitioneditorgui",
"ilglossarydefpagegui"),
"edit");
1086 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
1089 $definition->moveUp();
1091 $this->ctrl->redirect($this,
"listTerms");
1099 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
1102 $definition->moveDown();
1104 $this->ctrl->redirect($this,
"listTerms");
1124 $ilCtrl->setParameterByClass(
"ilglossarytermgui",
1125 "term_id", $this->term_id);
1126 $link =
"[<a href='".
1127 $ilCtrl->getLinkTargetByClass(
"ilglossarytermgui",
"listUsages").
1128 "'>".$lng->txt(
"glo_list_usages").
"</a>]";
1129 $add =
"<br/>".sprintf($lng->txt(
"glo_term_is_used_n_times"), $nr).
" ".$link;
1132 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1134 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure").$add);
1136 $cgui->setFormAction($this->ctrl->getFormAction($this));
1137 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDefinitionDeletion");
1138 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteDefinition");
1144 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1145 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1147 $this->tpl->parseCurrentBlock();
1152 $page_gui->setStyleId($this->object->getStyleSheetId());
1153 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
1154 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
1155 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
1156 $output = $page_gui->preview();
1158 $cgui->addItem(
"def",
$_GET[
"def"],
$term->getTerm().$output);
1160 $this->tpl->setContent($cgui->getHTML());
1165 $this->ctrl->redirect($this,
"listTerms");
1172 $definition->delete();
1173 $this->ctrl->redirect($this,
"listTerms");
1196 $this->ctrl->redirect($this,
"listTerms");
1208 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
1210 $glo_exp->buildExportFile();
1211 $this->ctrl->redirectByClass(
"ilexportgui",
"");
1219 require_once(
"./Modules/Glossary/classes/class.ilGlossaryExport.php");
1221 $glo_exp->buildExportFile();
1223 $this->ctrl->redirectByClass(
"ilexportgui",
"");
1231 if(!isset(
$_POST[
"file"]))
1233 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1235 if (count(
$_POST[
"file"]) > 1)
1237 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1241 $export_dir = $this->
object->getExportDirectory(
$file[0]);
1243 if ($this->object->getPublicExportFile(
$file[0]) ==
1246 $this->
object->setPublicExportFile(
$file[0],
"");
1250 $this->
object->setPublicExportFile(
$file[0],
$file[1]);
1252 $this->
object->update();
1253 $this->ctrl->redirectByClass(
"ilexportgui",
"");
1289 if (!isset(
$_POST[
"id"]))
1292 $ilCtrl->redirect($this,
"listTerms");
1296 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1297 foreach (
$_POST[
"id"] as $term_id)
1300 if ($term_glo_id != $this->object->getId())
1303 $ilCtrl->redirect($this,
"listTerms");
1308 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1310 $cgui->setFormAction($this->ctrl->getFormAction($this));
1311 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
1312 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelTermDeletion");
1313 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteTerms");
1315 foreach(
$_POST[
"id"] as $id)
1323 $ilCtrl->setParameterByClass(
"ilglossarytermgui",
1325 $link =
"[<a href='".
1326 $ilCtrl->getLinkTargetByClass(
"ilglossarytermgui",
"listUsages").
1327 "'>".$lng->txt(
"glo_list_usages").
"</a>]";
1328 $add =
"<div class='small'>".
1329 sprintf($lng->txt(
"glo_term_is_used_n_times"), $nr).
" ".$link.
"</div>";
1332 $cgui->addItem(
"id[]", $id,
$term->getTerm().$add);
1335 $this->tpl->setContent($cgui->getHTML());
1345 $this->ctrl->redirect($this,
"listTerms");
1353 foreach(
$_POST[
"id"] as $id)
1358 $this->ctrl->redirect($this,
"listTerms");
1370 if(strtolower(
$_GET[
"baseClass"]) !=
"ilglossaryeditorgui")
1376 if(is_object($this->
object))
1378 require_once(
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
1380 if (is_object($this->term))
1382 $gloss_loc->setTerm($this->term);
1384 $gloss_loc->setGlossary($this->
object);
1386 $gloss_loc->display();
1406 switch(
$_POST[
"new_type"])
1410 $term_gui->create();
1418 $term_gui->setGlossary($this->
object);
1424 $ilCtrl->redirect($this,
"listTerms");
1435 $term_id = (int)
$_GET[
"term_id"];
1437 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1439 if ($term_glo_id != $this->object->getId())
1442 $ilCtrl->redirect($this,
"listTerms");
1446 include_once (
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1451 $def->setTermId(
$term->getId());
1455 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"term_id",
$term->getId());
1456 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"def", $def->getId());
1457 $this->ctrl->redirectByClass(array(
"ilglossarytermgui",
1458 "iltermdefinitioneditorgui",
"ilglossarydefpagegui"),
"edit");
1464 $this->tpl->getStandardTemplate();
1466 $title = $this->
object->getTitle();
1469 if ($this->term_id > 0)
1471 $this->tpl->setTitle($this->lng->txt(
"term").
": ".
1477 $this->tpl->setTitle($this->lng->txt(
"glo").
": ".$title);
1486 $this->
getTabs($this->tabs_gui);
1494 global $rbacsystem, $ilHelp;
1496 $ilHelp->setScreenIdComponent(
"glo");
1499 $force_active = (
$_GET[
"cmd"] ==
"" ||
$_GET[
"cmd"] ==
"listTerms")
1502 $tabs_gui->addTarget(
"cont_terms",
1503 $this->ctrl->getLinkTarget($this,
"listTerms"), array(
"listTerms",
""),
1504 get_class($this),
"", $force_active);
1506 $force_active =
false;
1507 if ($this->ctrl->getCmd() ==
"showSummary" ||
1508 strtolower($this->ctrl->getNextClass()) ==
"ilinfoscreengui")
1510 $force_active =
true;
1512 $tabs_gui->addTarget(
"info_short",
1513 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
1514 "ilInfoScreenGUI",
"", $force_active);
1517 if ($rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1519 $tabs_gui->addTarget(
"settings",
1520 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1524 $tabs_gui->addTarget(
"meta_data",
1525 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
1526 "",
"ilmdeditorgui");
1534 $tabs_gui->addTarget(
"export",
1535 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1540 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1547 $tabs_gui->addTarget(
"perm_settings",
1548 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1552 $tabs_gui->addNonTabbedLink(
"presentation_view",
1553 $this->lng->txt(
"glo_presentation_view"),
1554 "ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$this->object->getRefID(),
1567 if (in_array($a_active,
1568 array(
"general_settings",
"style",
"taxonomy")))
1571 $ilTabs->addSubTab(
"general_settings",
1572 $lng->txt(
"settings"),
1573 $ilCtrl->getLinkTarget($this,
'properties'));
1576 $ilTabs->addSubTab(
"style",
1577 $lng->txt(
"obj_sty"),
1578 $ilCtrl->getLinkTarget($this,
'editStyleProperties'));
1581 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1583 $ilTabs->addSubTab(
"taxonomy",
1584 $lng->txt(
"tax_taxonomy"),
1585 $ilCtrl->getLinkTargetByClass(
"ilobjtaxonomygui",
''));
1587 $ilTabs->activateSubTab($a_active);
1601 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1603 $_GET[
"ref_id"] = $a_target;
1604 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
1605 include(
"ilias.php");
1608 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1610 $_GET[
"ref_id"] = $a_target;
1611 $_GET[
"cmd"] =
"infoScreen";
1612 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
1613 include(
"ilias.php");
1616 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1623 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
1631 include_once(
"./Modules/Glossary/classes/class.ilTermListTableGUI.php");
1633 $prtab->resetOffset();
1634 $prtab->writeFilterToSession();
1644 include_once(
"./Modules/Glossary/classes/class.ilTermListTableGUI.php");
1646 $prtab->resetOffset();
1647 $prtab->resetFilter();
1672 $ctpl->setCurrentBlock(
"ContentStyle");
1673 $ctpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1675 $ctpl->parseCurrentBlock();
1684 global $ilTabs,
$tpl;
1689 $tpl->setContent($this->form->getHTML());
1691 $ilTabs->activateTab(
"settings");
1702 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1703 $lng->loadLanguageModule(
"style");
1705 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1708 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
1709 $style_id = $this->
object->getStyleSheetId();
1711 if ($fixed_style > 0)
1715 $this->lng->txt(
"global_fixed").
")");
1716 $this->form->addItem($st);
1723 $st_styles[0] = $this->lng->txt(
"default");
1733 $this->form->addItem($st);
1738 $this->form->addCommandButton(
"editStyle",
1739 $lng->txt(
"style_edit_style"));
1740 $this->form->addCommandButton(
"deleteStyle",
1741 $lng->txt(
"style_delete_style"));
1749 $st_styles,
false,
true);
1750 $style_sel =
new ilSelectInputGUI($lng->txt(
"style_current_style"),
"style_id");
1752 $style_sel->setValue($style_id);
1753 $this->form->addItem($style_sel);
1755 $this->form->addCommandButton(
"saveStyleSettings",
1757 $this->form->addCommandButton(
"createStyle",
1758 $lng->txt(
"sty_create_ind_style"));
1761 $this->form->setTitle($lng->txt(
"glo_style"));
1762 $this->form->setFormAction($ilCtrl->getFormAction($this));
1772 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
1782 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
1792 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
1802 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1803 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
1805 || $this->object->getStyleSheetId() == 0))
1808 $this->
object->update();
1811 $this->ctrl->redirect($this,
"editStyleProperties");
1821 if ($this->object->getPublicExportFile($a_type) == $a_file)
1823 return $lng->txt(
"yes");
1839 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1841 if (count($tax_ids) > 0)
1843 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
1845 "ilobjglossarygui",
"listTerms");
1846 if (!$tax_exp->handleCommand())
1849 $tpl->setLeftNavContent($tax_exp->getHTML().
" ");