28 protected \ILIAS\COPage\Xsl\XslManager
$xsl;
30 protected \ILIAS\Glossary\InternalGUIService
$gui;
46 protected \ilGlobalTemplateInterface
$tpl;
47 protected \ilLanguage
$lng;
50 protected \ilObjTaxonomy
$tax;
64 string $export_dir =
""
73 $this->
access = $DIC->access();
74 $this->
user = $domain->user();
75 $this->
lng = $DIC->language();
77 $this->
toolbar = $gui->toolbar();
78 $this->
help = $gui->help();
79 $this->nav_history =
$DIC[
"ilNavigationHistory"];
80 $this->tpl =
$gui->ui()->mainTemplate();
81 $this->
ctrl = $gui->ctrl();
82 $this->tabs_gui =
$gui->tabs();
83 $this->global_screen =
$gui->globalScreen();
89 $this->
ctrl->saveParameter($this, array(
"ref_id",
"letter",
"tax_node"));
90 $this->content_style_service =
93 $this->xsl =
$DIC->copage()->internal()->domain()->xsl();
94 $this->tax_manager = $domain->taxonomy($this->glossary);
106 $request = $this->gui
108 ->request($query_params);
110 $this->requested_ref_id = $request->getRefId();
111 $this->term_id = $request->getTermId();
112 $this->glossary_gui = $this->gui->presentation()->ObjGlossaryGUI($this->requested_ref_id);
113 $this->glossary = $this->glossary_gui->getGlossary();
114 $this->requested_def_page_id = $request->getDefinitionPageId();
115 $this->requested_search_str = $request->getSearchString();
116 $this->requested_file_id = $request->getFileId();
117 $this->requested_mob_id = $request->getMobId();
121 $glo_ids = $this->glossary->getAllGlossaryIds();
124 if ($this->term_id > 0) {
131 $this->tax_id = $this->glossary->getTaxonomyId();
132 if ($this->tax_id > 0 && $this->glossary->getShowTaxonomy()) {
135 $requested_tax_node = $request->getTaxNode();
136 if ($requested_tax_node > 1 && $this->tax->getTree()->readRootId() != $requested_tax_node) {
137 $this->tax_node = $requested_tax_node;
140 $this->requested_letter = $request->getLetter();
142 $this->content_style_domain = $this->content_style_service->domain()->styleForRefId($this->glossary->getRefId());
143 $this->content_style_gui = $this->content_style_service->gui();
156 $this->offline = $a_offline;
169 $this->offline_dir = $a_dir;
187 $next_class = $this->
ctrl->getNextClass($this);
188 if ($this->glossary->isActiveFlashcards()) {
189 $cmd = $this->
ctrl->getCmd(
"showFlashcards");
191 $cmd = $this->
ctrl->getCmd(
"listTerms");
195 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id) &&
196 !($ilAccess->checkAccess(
"visible",
"", $this->requested_ref_id) &&
197 ($cmd ==
"infoScreen" || strtolower($next_class) ==
"ilinfoscreengui"))) {
201 if ($cmd !=
"listDefinitions") {
205 switch ($next_class) {
211 case "ilinfoscreengui":
215 case "ilpresentationfullgui":
218 $full_gui = $this->gui->presentation()
219 ->PresentationFullGUI($this, $this->glossary, $this->
offlineMode(), $this->tax_node);
220 $this->
ctrl->forwardCommand($full_gui);
223 case "ilpresentationtablegui":
226 $pt_gui = $this->gui->presentation()
227 ->PresentationTableGUI($this, $this->glossary, $this->
offlineMode(), $this->tax_node);
228 $this->
ctrl->forwardCommand($pt_gui);
231 case "ilglossarydefpagegui":
234 $this->
ctrl->forwardCommand($page_gui);
237 case "ilglossaryflashcardgui":
239 $this->
ctrl->forwardCommand($flash_gui);
242 case "ilglossaryflashcardboxgui":
244 $this->
ctrl->forwardCommand($flash_box_gui);
251 $this->tpl->printToStdout();
256 $this->tpl->loadStandardTemplate();
257 $title = $this->glossary->getTitle();
259 $this->tpl->setTitle($title);
272 $a_page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
275 $this->fill_on_load_code =
true;
279 $this->fill_on_load_code =
false;
282 $this->
ctrl->setParameter($this,
"pg_id", $a_page_gui->
getId());
290 $ilNavigationHistory = $this->nav_history;
291 $ilAccess = $this->access;
293 $ilToolbar = $this->toolbar;
294 $ilCtrl = $this->ctrl;
295 $ilTabs = $this->tabs_gui;
297 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
302 if ($this->glossary->getPresentationMode() ==
"full_def") {
303 $this->listTermByGivenAsPanel();
305 if (!$this->offlineMode()) {
306 $ilNavigationHistory->addItem(
307 $this->requested_ref_id,
308 $this->
ctrl->getLinkTarget($this,
"listTerms"),
312 $this->listTermByGivenAsTable();
321 $ilCtrl = $this->ctrl;
322 $ilAccess = $this->access;
326 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
330 $ilCtrl->redirectByClass(
"ilPresentationTableGUI",
"show");
338 $ilCtrl = $this->ctrl;
340 $ilCtrl->redirectByClass(
"ilPresentationFullGUI",
"show");
347 if (!$this->offlineMode()) {
348 $this->content_style_gui->addCss($tpl, $this->glossary->getRefId());
351 $tpl->addCss(
"content.css");
352 $tpl->addCss(
"syntaxhighlight.css");
361 $pres_table = $this->gui->presentation()->PresentationTableGUI(
364 $this->offlineMode(),
376 bool $a_get_html =
false,
377 bool $render_term =
true,
379 bool $render_page_container =
true
381 $ilUser = $this->
user;
382 $ilAccess = $this->access;
386 if ($a_ref_id == 0) {
391 if ($a_term_id == 0) {
392 $term_id = $this->term_id;
394 $term_id = $a_term_id;
397 if (!$ilAccess->checkAccess(
"read",
"",
$ref_id)) {
403 }
catch (Exception
$e) {
408 $tpl->loadStandardTemplate();
410 $this->setContentStyles();
412 if (!$this->offlineMode()) {
417 $tpl->setTitle($this->
lng->txt(
"cont_term") .
": " . $term->getTerm());
421 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
422 $cmd = array(
"edit" => $this->
ctrl->getLinkTargetByClass(array(
"ilglossaryeditorgui",
"ilobjglossarygui",
"ilglossarytermgui",
"ilobjectmetadatagui"),
""));
425 $tpl->setRightContent($mdgui->getBlockHTML($cmd));
428 $def_tpl =
new ilTemplate(
"tpl.glossary_definition_list.html",
true,
true,
"components/ILIAS/Glossary");
430 if ($render_page_container) {
431 $def_tpl->touchBlock(
"page_container_1");
432 $def_tpl->touchBlock(
"page_container_2");
436 $def_tpl->setVariable(
"TXT_TERM", $term->getTerm());
438 $this->mobs = array();
441 $this->basicPageGuiInit($page_gui);
442 $page_gui->setGlossary($this->glossary);
443 $page_gui->setOutputMode($a_page_mode);
444 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
445 $page = $page_gui->getPageObject();
450 if ($this->offlineMode()) {
451 $page_gui->setOutputMode(
"offline");
452 $page_gui->setOfflineDirectory($this->getOfflineDirectory());
454 $page_gui->setFullscreenLink($this->getLink(
$ref_id,
"fullscreen", $term_id));
456 $page_gui->setTemplateOutput(
false);
457 $page_gui->setRawPageContent(
true);
458 if (!$this->offlineMode()) {
459 $output = $page_gui->showPage();
461 $output = $page_gui->presentation($page_gui->getOutputMode());
464 $def_tpl->setCurrentBlock(
"definition");
465 $def_tpl->setVariable(
"PAGE_CONTENT", $output);
466 $def_tpl->parseCurrentBlock();
472 $backlist_shown =
false;
473 foreach ($sources as $src) {
474 $type = explode(
':', $src[
'type']);
476 if ($type[0] ==
'lm' && $type[1] ==
'pg') {
480 $def_tpl->setCurrentBlock(
'backlink_item');
483 foreach ($ref_ids as $rid) {
484 if ($ilAccess->checkAccess(
"read",
"", $rid)) {
489 $def_tpl->setCurrentBlock(
"backlink_item");
490 $def_tpl->setVariable(
"BACKLINK_LINK", ILIAS_HTTP_PATH .
"/goto.php?target=" . $type[1] .
"_" . $src[
'id']);
491 $def_tpl->setVariable(
"BACKLINK_ITEM", $lm_title .
": " . $title);
492 $def_tpl->parseCurrentBlock();
493 $backlist_shown =
true;
497 if ($backlist_shown) {
498 $def_tpl->setCurrentBlock(
"backlink_list");
499 $def_tpl->setVariable(
"BACKLINK_TITLE", $this->
lng->txt(
'glo_term_used_in'));
500 $def_tpl->parseCurrentBlock();
505 $tpl->setPermanentLink(
"git",
null, $term_id .
"_" .
$ref_id);
508 $this->showTaxonomy();
512 if ($this->requested_search_str !=
"" && !$this->offlineMode()) {
515 $search_string = $cache->getQuery();
520 $words = $p->getQuotedWords();
521 foreach ($words as $w) {
522 ilTextHighlighterGUI::highlight(
"ilGloContent", $w, $tpl);
524 $this->fill_on_load_code =
true;
526 $tpl->setContent($def_tpl->get());
527 if ($this->offlineMode()) {
528 return $tpl->printToString();
529 } elseif ($a_get_html) {
530 return $def_tpl->get();
537 $html = $this->media(
"fullscreen");
544 public function media(
string $a_mode =
"media"): string
546 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/COPage");
548 $this->tpl->setVariable(
549 "LOCATION_CONTENT_STYLESHEET",
571 if (!$this->offlineMode()) {
575 $enlarge_path =
"images/media/enlarge.svg";
581 $this->
ctrl->setParameter($this,
"obj_type",
"MediaObject");
583 $this->getLink($this->requested_ref_id,
"fullscreen");
584 $this->
ctrl->clearParameters($this);
586 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
587 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' => $fullscreen_link,
589 'ref_id' => $this->requested_ref_id,
'pg_frame' =>
"",
'webspace_path' => $wb_path);
590 $output = $this->xsl->process($xml,
$params);
593 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
595 $this->tpl->parseCurrentBlock();
596 if ($this->offlineMode()) {
597 $html = $this->tpl->get();
606 $gloss_loc->setMode(
"presentation");
607 if (!empty($this->term_id)) {
609 $gloss_loc->setTerm($term);
611 $gloss_loc->setGlossary($this->glossary);
612 $gloss_loc->display();
617 $ilAccess = $this->access;
620 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
624 $file = explode(
"_", $this->requested_file_id);
625 $fileObj =
new ilObjFile($file[count($file) - 1],
false);
626 $fileObj->sendFile();
639 string $a_frame =
"",
649 if (!$this->offlineMode()) {
653 $this->
ctrl->setParameter($this,
"term_id", $a_term_id);
654 $link = $this->
ctrl->getLinkTarget($this,
"fullscreen");
658 $link .=
"&cmd=" . $a_cmd;
659 if ($a_frame !=
"") {
660 $this->
ctrl->setParameter($this,
"frame", $a_frame);
663 $this->
ctrl->setParameter($this,
"obj_type", $a_type);
665 $link = $this->
ctrl->getLinkTarget($this, $a_cmd);
671 $link =
"fullscreen.html";
675 $link =
"term_" . $a_term_id .
".html";
684 $this->
ctrl->clearParameters($this);
690 $ilCtrl = $this->ctrl;
692 $ilTabs = $this->tabs_gui;
695 $ilTabs->activateTab(
"print_view");
697 $this->initPrintViewSelectionForm();
699 $tpl->setContent($this->
form->getHTML());
708 $ilCtrl = $this->ctrl;
710 $terms = $this->glossary->getTermList();
714 $this->
form->setFormAction($ilCtrl->getFormAction($this));
718 $radg->setValue(
"glossary");
722 .
" (" .
$lng->txt(
"cont_terms") .
": " . count($terms) .
")",
"glossary");
723 $radg->addOption($op1);
726 if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
728 $radg->addOption($op3);
734 $lng->txt(
"cont_topic"),
738 if ($this->tax_node > 0) {
739 $si->setValue($this->tax_node);
741 $op3->addSubItem($si);
746 $radg->addOption($op2);
749 $op2->addSubItem($nl);
750 foreach ($terms as $t) {
751 $nl->addListNode((
string) $t[
"id"], (
string) $t[
"term"],
"0",
false,
false);
754 $this->
form->addItem($radg);
756 $this->
form->addCommandButton(
"printView", $lng->txt(
"cont_show_print_view"));
757 $this->
form->setPreventDoubleSubmission(
false);
759 $this->
form->setTitle($lng->txt(
"cont_print_selection"));
764 $ilAccess = $this->access;
767 $this->tabs_gui->setBackTarget(
768 $this->
lng->txt(
"back"),
769 $this->ctrl->getLinkTarget($this,
"printViewSelection")
772 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
776 $this->initPrintViewSelectionForm();
777 $this->
form->checkInput();
780 switch ($this->
form->getInput(
"sel_type")) {
782 $ts = $this->glossary->getTermList();
783 foreach ($ts as $t) {
789 $t_id = $this->glossary->getTaxonomyId();
791 foreach ($items as $i) {
792 if ($i[
"item_type"] ==
"term") {
793 $terms[] = $i[
"item_id"];
799 $terms = $this->
form->getInput(
"obj_id");
804 $tpl->addOnLoadCode(
"il.Util.print();");
809 foreach ($terms as $t_id) {
812 $tpl->setContent($page_content);
817 $ilAccess = $this->access;
819 $ilCtrl = $this->ctrl;
820 $ilHelp = $this->help;
822 $ilHelp->setScreenIdComponent(
"glo");
824 if (!$this->offlineMode()) {
825 if ($this->
ctrl->getCmd() !=
"listDefinitions") {
826 if ($ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
827 if ($this->glossary->isActiveFlashcards()) {
828 $this->tabs_gui->addTab(
830 $lng->txt(
"glo_flashcards"),
831 $ilCtrl->getLinkTarget($this,
"showFlashcards")
834 $this->tabs_gui->addTab(
836 $lng->txt(
"content"),
837 $ilCtrl->getLinkTarget($this,
"listTerms")
841 $this->tabs_gui->addTab(
843 $lng->txt(
"info_short"),
844 $ilCtrl->getLinkTarget($this,
"infoScreen")
849 if ($ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
850 $this->tabs_gui->addTab(
852 $lng->txt(
"cont_print_view"),
853 $ilCtrl->getLinkTarget($this,
"printViewSelection")
857 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id) ||
858 $ilAccess->checkAccess(
"edit_content",
"", $this->requested_ref_id)) {
859 $this->tabs_gui->addNonTabbedLink(
861 $lng->txt(
"glo_editing_view"),
862 "ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=" . $this->requested_ref_id
864 } elseif ($ilAccess->checkAccess(
"edit_permission",
"", $this->requested_ref_id)) {
865 $this->tabs_gui->addNonTabbedLink(
867 $lng->txt(
"glo_editing_view"),
868 $ilCtrl->getLinkTargetByClass([
869 ilGlossaryEditorGUI::class,
870 ilObjGlossaryGUI::class,
871 ilPermissionGUI::class
877 $this->tabs_gui->addTarget(
879 "index.html#term_" . $this->term_id,
891 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
896 $ilAccess = $this->access;
897 $ilTabs = $this->tabs_gui;
900 $ilTabs->activateTab(
"info");
901 $this->
lng->loadLanguageModule(
"meta");
904 $info->enablePrivateNotes();
908 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
909 $info->enableNewsEditing();
911 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
912 if ($enable_internal_rss) {
913 $info->setBlockProperty(
"news",
"settings",
true);
918 $info->addMetaDataSections($this->glossary->getId(), 0, $this->glossary->getType());
922 if ($this->offlineMode()) {
923 $this->tpl->setContent(
$info->getHTML());
924 return $this->tpl->get();
936 if ($this->offlineMode() || !$this->tax_manager->showInPresentation()) {
940 $tax_id = $this->tax_manager->getTaxonomyId();
942 $tool_context = $this->global_screen->tool()->context()->current();
944 $tool_context->addAdditionalData(
948 $tool_context->addAdditionalData(
952 $tool_context->addAdditionalData(
956 $tool_context->addAdditionalData(
960 $tool_context->addAdditionalData(
968 $ilTabs = $this->tabs_gui;
969 $ilNavigationHistory = $this->nav_history;
972 $ilTabs->activateTab(
"flashcards");
973 $ilNavigationHistory->addItem(
974 $this->requested_ref_id,
975 $this->
ctrl->getLinkTarget($this,
"showFlashcards"),
979 $flashcards->listBoxes();
Class ilCtrl provides processing control methods.
static getWebspaceDir(string $mode="filesystem")
get webspace directory
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
GUI class for glossary flashcard boxes.
GUI class for glossary flashcards.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initByRequest(?array $query_params=null)
Init services and this class by request params.
string $requested_file_id
listTermByGivenAsTable()
list glossary terms
ILIAS Style Content Service $content_style_service
getPresentationTable()
Get presentation table.
basicPageGuiInit(\ilPageObjectGUI $a_page_gui)
Basic page gui initialisation.
initPrintViewSelectionForm()
Init print view selection form.
injectTemplate(ilGlobalTemplateInterface $tpl)
getLink(int $a_ref_id, string $a_cmd="", int $a_term_id=0, string $a_frame="", string $a_type="")
ILIAS COPage Xsl XslManager $xsl
string $requested_search_str
media(string $a_mode="media")
show media object
infoScreen()
this one is called from the info button in the repository
ilObjGlossaryGUI $glossary_gui
ILIAS GlobalScreen Services $global_screen
ILIAS Glossary InternalGUIService $gui
ILIAS Glossary Taxonomy TaxonomyManager $tax_manager
setOfflineMode(bool $a_offline=true)
set offline mode (content is generated for offline package)
ILIAS Style Content Object ObjectFacade $content_style_domain
listDefinitions(int $a_ref_id=0, int $a_term_id=0, bool $a_get_html=false, bool $render_term=true, string $a_page_mode=ilPageObjectGUI::PRESENTATION, bool $render_page_container=true)
list definitions of a term
ILIAS Style Content GUIService $content_style_gui
__construct(string $export_format="", string $export_dir="")
ilGlobalTemplateInterface $tpl
listTermByGivenAsPanel()
list glossary terms
ilNavigationHistory $nav_history
setOfflineDirectory(string $a_dir)
executeCommand()
execute command
offlineMode()
checks wether offline content generation is activated
int $requested_def_page_id
static isReferenced(array $a_glo_id, int $a_term_id)
Is a term referenced by a set of glossaries.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookGlossaryID(int $term_id)
get glossary id form term id
static _getSourcesOfTarget(string $a_target_type, int $a_target_id, int $a_target_inst)
get all sources of a link target
static _lookupContObjID(int $a_id)
get learning module id for lm object
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Last visited history for repository items.
static addUsagesToInfo(ilInfoScreenGUI $info, int $glo_id)
Add usages to info screen.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getSyntaxStylePath()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSubTreeItems(string $a_comp, int $a_obj_id, string $a_item_type, int $a_tax_id, $a_node)
Get all assigned items under a node.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
setOutputMode(string $a_mode=self::PRESENTATION)
setOfflineDirectory(string $offdir)
setFullscreenLink(string $a_fullscreen_link)
setFileDownloadLink(string $a_download_link)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
static _getInstance(int $a_usr_id)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
form( $class_path, string $cmd, string $submit_caption="")