28 protected \ILIAS\COPage\Xsl\XslManager
$xsl;
30 protected \ILIAS\Glossary\InternalGUIService
$gui;
31 protected \ILIAS\Glossary\InternalDomainService
$domain;
47 protected \ilGlobalTemplateInterface
$tpl;
48 protected \ilLanguage
$lng;
51 protected \ilObjTaxonomy
$tax;
71 string $export_format =
"",
72 string $export_dir =
"" 76 $service = $DIC->glossary()->internal();
78 $this->domain = $domain =
$service->domain();
81 $this->
access = $DIC->access();
82 $this->
user = $domain->user();
83 $this->
lng = $DIC->language();
85 $this->
toolbar = $gui->toolbar();
86 $this->
help = $gui->help();
87 $this->nav_history = $DIC[
"ilNavigationHistory"];
88 $this->tpl = $gui->ui()->mainTemplate();
89 $this->
ctrl = $gui->ctrl();
90 $this->tabs_gui = $gui->tabs();
91 $this->global_screen = $gui->globalScreen();
95 $this->offline = ($export_format !=
"");
96 $this->ui_fac = $DIC->ui()->factory();
97 $this->ui_ren = $DIC->ui()->renderer();
98 $this->offline = ($export_format !==
"");
100 $this->
ctrl->saveParameter($this, array(
"ref_id",
"letter",
"tax_node"));
101 $this->content_style_service =
102 $DIC->contentStyle();
104 $this->xsl = $DIC->copage()->internal()->domain()->xsl();
105 $this->tax_manager = $domain->taxonomy($this->glossary);
117 $request = $this->gui
119 ->request($query_params);
121 $this->requested_ref_id = $request->getRefId();
122 $this->term_id = $request->getTermId();
123 $this->glossary_gui = $this->gui->presentation()->ObjGlossaryGUI($this->requested_ref_id);
124 $this->glossary = $this->glossary_gui->getGlossary();
125 $this->requested_def_page_id = $request->getDefinitionPageId();
126 $this->requested_search_str = $request->getSearchString();
127 $this->requested_file_id = $request->getFileId();
128 $this->requested_mob_id = $request->getMobId();
129 $this->requested_table_glossary_download_list_action = $request->getTableGlossaryDownloadListAction();
130 $this->requested_table_glossary_download_file_ids = $request->getTableGlossaryDownloadFileIds();
135 $glo_ids = $this->glossary->getAllGlossaryIds();
138 if ($this->term_id > 0) {
145 $this->tax_id = $this->glossary->getTaxonomyId();
146 if ($this->tax_id > 0 && $this->glossary->getShowTaxonomy()) {
149 $requested_tax_node = $request->getTaxNode();
150 if ($requested_tax_node > 1 && $this->tax->getTree()->readRootId() != $requested_tax_node) {
151 $this->tax_node = $requested_tax_node;
154 $this->requested_letter = $request->getLetter();
156 $this->content_style_domain = $this->content_style_service->domain()->styleForRefId($this->glossary->getRefId());
157 $this->content_style_gui = $this->content_style_service->gui();
170 $this->offline = $a_offline;
183 $this->offline_dir = $a_dir;
199 $lng->loadLanguageModule(
"content");
201 $next_class = $this->
ctrl->getNextClass($this);
202 if ($this->glossary->isActiveFlashcards()) {
203 $cmd = $this->
ctrl->getCmd(
"showFlashcards");
205 $cmd = $this->
ctrl->getCmd(
"listTerms");
209 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id) &&
210 !($ilAccess->checkAccess(
"visible",
"", $this->requested_ref_id) &&
211 ($cmd ==
"infoScreen" || strtolower($next_class) ==
"ilinfoscreengui"))) {
215 if ($cmd !=
"listDefinitions") {
219 switch ($next_class) {
225 case "ilinfoscreengui":
229 case "ilpresentationfullgui":
232 $full_gui = $this->gui->presentation()
233 ->PresentationFullGUI($this, $this->glossary, $this->
offlineMode(), $this->tax_node);
234 $this->
ctrl->forwardCommand($full_gui);
237 case "ilpresentationtablegui":
240 $pt_gui = $this->gui->presentation()
241 ->PresentationTableGUI($this, $this->glossary, $this->
offlineMode(), $this->tax_node);
242 $this->
ctrl->forwardCommand($pt_gui);
245 case "ilglossarydefpagegui":
248 $this->
ctrl->forwardCommand($page_gui);
251 case "ilglossaryflashcardgui":
253 $this->
ctrl->forwardCommand($flash_gui);
256 case "ilglossaryflashcardboxgui":
258 $this->
ctrl->forwardCommand($flash_box_gui);
265 $this->tpl->printToStdout();
270 $this->tpl->loadStandardTemplate();
271 $title = $this->glossary->getTitle();
273 $this->tpl->setTitle($title);
286 $a_page_gui->
setStyleId($this->content_style_domain->getEffectiveStyleId());
289 $this->fill_on_load_code =
true;
293 $this->fill_on_load_code =
false;
296 $this->
ctrl->setParameter($this,
"pg_id", $a_page_gui->
getId());
311 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
316 if ($this->glossary->getPresentationMode() ==
"full_def") {
320 $ilNavigationHistory->addItem(
321 $this->requested_ref_id,
322 $this->
ctrl->getLinkTarget($this,
"listTerms"),
340 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
344 $ilCtrl->redirectByClass(
"ilPresentationTableGUI",
"show");
362 $this->content_style_gui->
addCss($tpl, $this->glossary->getRefId());
365 $tpl->addCss(
"content.css");
366 $tpl->addCss(
"syntaxhighlight.css");
375 $pres_table = $this->gui->presentation()->PresentationTableGUI(
390 bool $a_get_html =
false,
391 bool $render_term =
true,
393 bool $render_page_container =
true 400 if ($a_ref_id == 0) {
405 if ($a_term_id == 0) {
408 $term_id = $a_term_id;
411 if (!$ilAccess->checkAccess(
"read",
"",
$ref_id)) {
422 $tpl->loadStandardTemplate();
431 $tpl->setTitle($this->
lng->txt(
"cont_term") .
": " . $term->getTerm());
435 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
436 $cmd = array(
"edit" => $this->
ctrl->getLinkTargetByClass(array(
"ilglossaryeditorgui",
"ilobjglossarygui",
"ilglossarytermgui",
"ilobjectmetadatagui"),
""));
439 $tpl->setRightContent($mdgui->getBlockHTML($cmd));
442 $def_tpl =
new ilTemplate(
"tpl.glossary_definition_list.html",
true,
true,
"components/ILIAS/Glossary");
444 if ($render_page_container) {
445 $def_tpl->touchBlock(
"page_container_1");
446 $def_tpl->touchBlock(
"page_container_2");
450 $def_tpl->setVariable(
"TXT_TERM", $term->getTerm());
452 $this->mobs = array();
456 $page_gui->setGlossary($this->glossary);
457 $page_gui->setOutputMode($a_page_mode);
458 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
459 $page = $page_gui->getPageObject();
465 $page_gui->setOutputMode(
"offline");
468 $page_gui->setFullscreenLink($this->
getLink(
$ref_id,
"fullscreen", $term_id));
470 $page_gui->setTemplateOutput(
false);
471 $page_gui->setRawPageContent(
true);
473 $output = $page_gui->showPage();
475 $output = $page_gui->presentation($page_gui->getOutputMode());
478 $def_tpl->setCurrentBlock(
"definition");
479 $def_tpl->setVariable(
"PAGE_CONTENT", $output);
480 $def_tpl->parseCurrentBlock();
486 $backlist_shown =
false;
487 foreach ($sources as $src) {
488 $type = explode(
':', $src[
'type']);
490 if ($type[0] ==
'lm' && $type[1] ==
'pg') {
494 $def_tpl->setCurrentBlock(
'backlink_item');
497 foreach ($ref_ids as $rid) {
498 if ($ilAccess->checkAccess(
"read",
"", $rid)) {
503 $def_tpl->setCurrentBlock(
"backlink_item");
504 $def_tpl->setVariable(
"BACKLINK_LINK", ILIAS_HTTP_PATH .
"/goto.php?target=" . $type[1] .
"_" . $src[
'id']);
505 $def_tpl->setVariable(
"BACKLINK_ITEM", $lm_title .
": " . $title);
506 $def_tpl->parseCurrentBlock();
507 $backlist_shown =
true;
511 if ($backlist_shown) {
512 $def_tpl->setCurrentBlock(
"backlink_list");
513 $def_tpl->setVariable(
"BACKLINK_TITLE", $this->
lng->txt(
'glo_term_used_in'));
514 $def_tpl->parseCurrentBlock();
519 $tpl->setPermanentLink(
"git",
null, $term_id .
"_" .
$ref_id);
526 if ($this->requested_search_str !=
"" && !$this->
offlineMode()) {
529 $search_string = $cache->getQuery();
534 $words = $p->getQuotedWords();
535 foreach ($words as $w) {
536 ilTextHighlighterGUI::highlight(
"ilGloContent", $w, $tpl);
538 $this->fill_on_load_code =
true;
540 $tpl->setContent($def_tpl->get());
542 return $tpl->printToString();
543 } elseif ($a_get_html) {
544 return $def_tpl->get();
551 $html = $this->
media(
"fullscreen");
558 public function media(
string $a_mode =
"media"): string
560 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/COPage");
562 $this->tpl->setVariable(
563 "LOCATION_CONTENT_STYLESHEET",
589 $enlarge_path =
"images/media/enlarge.svg";
595 $this->
ctrl->setParameter($this,
"obj_type",
"MediaObject");
597 $this->
getLink($this->requested_ref_id,
"fullscreen");
598 $this->
ctrl->clearParameters($this);
600 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
601 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' => $fullscreen_link,
603 'ref_id' => $this->requested_ref_id,
'pg_frame' =>
"",
'webspace_path' => $wb_path);
604 $output = $this->xsl->process($xml,
$params);
607 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
609 $this->tpl->parseCurrentBlock();
611 $html = $this->tpl->get();
626 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
631 $ilTabs->activateTab(
"download");
634 $this->tpl->setTitle($this->glossary->getTitle());
637 $table = $this->domain->table()->getDownloadListTable($this->glossary)->getComponent();
639 $this->tpl->setContent($this->ui_ren->render($table));
650 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
655 if (($this->requested_table_glossary_download_list_action ==
"downloadExportFile")
656 && !empty($this->requested_table_glossary_download_file_ids)) {
657 $file_id = $this->requested_table_glossary_download_file_ids[0];
658 $file_type = explode(
":", $file_id)[0];
661 $file = $this->glossary->getPublicExportFile($file_type);
663 $dir = $this->glossary->getExportDirectory($file_type);
664 if (is_file($dir .
"/" . $file)) {
675 $gloss_loc->setMode(
"presentation");
676 if (!empty($this->term_id)) {
678 $gloss_loc->setTerm($term);
680 $gloss_loc->setGlossary($this->glossary);
681 $gloss_loc->display();
689 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
693 $file = explode(
"_", $this->requested_file_id);
694 $fileObj =
new ilObjFile($file[count($file) - 1],
false);
695 $fileObj->sendFile();
708 string $a_frame =
"",
722 $this->
ctrl->setParameter($this,
"term_id", $a_term_id);
723 $link = $this->
ctrl->getLinkTarget($this,
"fullscreen");
727 $link .=
"&cmd=" . $a_cmd;
728 if ($a_frame !=
"") {
729 $this->
ctrl->setParameter($this,
"frame", $a_frame);
732 $this->
ctrl->setParameter($this,
"obj_type", $a_type);
734 $link = $this->
ctrl->getLinkTarget($this, $a_cmd);
740 $link =
"fullscreen.html";
744 $link =
"term_" . $a_term_id .
".html";
753 $this->
ctrl->clearParameters($this);
764 $ilTabs->activateTab(
"print_view");
768 $tpl->setContent($this->
form->getHTML());
779 $terms = $this->glossary->getTermList();
783 $this->
form->setFormAction($ilCtrl->getFormAction($this));
791 .
" (" . $lng->txt(
"cont_terms") .
": " . count($terms) .
")",
"glossary");
792 $radg->addOption($op1);
795 if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
796 $op3 =
new ilRadioOption($lng->txt(
"cont_selected_topic"),
"sel_topic");
797 $radg->addOption($op3);
803 $lng->txt(
"cont_topic"),
807 if ($this->tax_node > 0) {
810 $op3->addSubItem($si);
814 $op2 =
new ilRadioOption($lng->txt(
"cont_selected_terms"),
"selection");
815 $radg->addOption($op2);
818 $op2->addSubItem($nl);
819 foreach ($terms as $t) {
820 $nl->addListNode((
string) $t[
"id"], (
string) $t[
"term"],
"0",
false,
false);
823 $this->
form->addItem($radg);
825 $this->
form->addCommandButton(
"printView", $lng->txt(
"cont_show_print_view"));
826 $this->
form->setPreventDoubleSubmission(
false);
828 $this->
form->setTitle($lng->txt(
"cont_print_selection"));
836 $this->tabs_gui->setBackTarget(
837 $this->
lng->txt(
"back"),
838 $this->
ctrl->getLinkTarget($this,
"printViewSelection")
841 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
846 $this->
form->checkInput();
849 switch ($this->
form->getInput(
"sel_type")) {
851 $ts = $this->glossary->getTermList();
852 foreach ($ts as $t) {
858 $t_id = $this->glossary->getTaxonomyId();
860 foreach ($items as $i) {
861 if ($i[
"item_type"] ==
"term") {
862 $terms[] = $i[
"item_id"];
868 $terms = $this->
form->getInput(
"obj_id");
873 $tpl->addOnLoadCode(
"il.Util.print();");
878 foreach ($terms as $t_id) {
881 $tpl->setContent($page_content);
894 if ($this->
ctrl->getCmd() !=
"listDefinitions") {
895 if ($ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
896 if ($this->glossary->isActiveFlashcards()) {
897 $this->tabs_gui->addTab(
899 $lng->txt(
"glo_flashcards"),
900 $ilCtrl->getLinkTarget($this,
"showFlashcards")
903 $this->tabs_gui->addTab(
905 $lng->txt(
"content"),
906 $ilCtrl->getLinkTarget($this,
"listTerms")
910 $this->tabs_gui->addTab(
912 $lng->txt(
"info_short"),
913 $ilCtrl->getLinkTarget($this,
"infoScreen")
918 if ($ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
919 $this->tabs_gui->addTab(
921 $lng->txt(
"cont_print_view"),
922 $ilCtrl->getLinkTarget($this,
"printViewSelection")
926 if ($this->glossary->isActiveDownloads()) {
927 $this->tabs_gui->addTab(
929 $lng->txt(
"download"),
930 $ilCtrl->getLinkTarget($this,
"showDownloadList")
936 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id) ||
937 $ilAccess->checkAccess(
"edit_content",
"", $this->requested_ref_id)) {
938 $this->tabs_gui->addNonTabbedLink(
940 $lng->txt(
"glo_editing_view"),
946 $this->tabs_gui->addTarget(
948 "index.html#term_" . $this->term_id,
960 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
969 $ilTabs->activateTab(
"info");
970 $this->
lng->loadLanguageModule(
"meta");
973 $info->enablePrivateNotes();
977 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
978 $info->enableNewsEditing();
980 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
981 if ($enable_internal_rss) {
982 $info->setBlockProperty(
"news",
"settings",
true);
987 $info->addMetaDataSections($this->glossary->getId(), 0, $this->glossary->getType());
992 $this->tpl->setContent($info->getHTML());
993 return $this->tpl->get();
996 $this->
ctrl->forwardCommand($info);
1005 if ($this->
offlineMode() || !$this->tax_manager->showInPresentation()) {
1009 $tax_id = $this->tax_manager->getTaxonomyId();
1011 $tool_context = $this->global_screen->tool()->context()->current();
1013 $tool_context->addAdditionalData(
1017 $tool_context->addAdditionalData(
1021 $tool_context->addAdditionalData(
1025 $tool_context->addAdditionalData(
1029 $tool_context->addAdditionalData(
1041 $ilTabs->activateTab(
"flashcards");
1042 $ilNavigationHistory->addItem(
1043 $this->requested_ref_id,
1044 $this->
ctrl->getLinkTarget($this,
"showFlashcards"),
1048 $flashcards->listBoxes();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getWebspaceDir(string $mode="filesystem")
get webspace directory
ILIAS Style Content Service $content_style_service
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
This class represents an option in a radio group.
listTermByGivenAsTable()
list glossary terms
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static addUsagesToInfo(ilInfoScreenGUI $info, int $glo_id)
Add usages to info screen.
listTermByGivenAsPanel()
list glossary terms
string $requested_table_glossary_download_list_action
static _getSourcesOfTarget(string $a_target_type, int $a_target_id, int $a_target_inst)
get all sources of a link target
initPrintViewSelectionForm()
Init print view selection form.
setOfflineMode(bool $a_offline=true)
set offline mode (content is generated for offline package)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
basicPageGuiInit(\ilPageObjectGUI $a_page_gui)
Basic page gui initialisation.
int $requested_def_page_id
special template class to simplify handling of ITX/PEAR
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.
setOutputMode(string $a_mode=self::PRESENTATION)
ILIAS UI Renderer $ui_ren
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $requested_file_id
static _getInstance(int $a_usr_id)
static _getAllReferences(int $id)
get all reference ids for object ID
executeCommand()
execute command
initByRequest(?array $query_params=null)
Init services and this class by request params.
GUI class for glossary flashcard boxes.
infoScreen()
this one is called from the info button in the repository
ILIAS Style Content GUIService $content_style_gui
setOfflineDirectory(string $offdir)
setStyleId(int $a_styleid)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
static isReferenced(array $a_glo_id, int $a_term_id)
Is a term referenced by a set of glossaries.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
ILIAS Style Content Object ObjectFacade $content_style_domain
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjGlossaryGUI $glossary_gui
static _lookupTitle(int $obj_id)
__construct(string $export_format="", string $export_dir="")
setScreenIdComponent(string $a_comp)
GUI class for glossary flashcards.
ILIAS Glossary InternalGUIService $gui
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ILIAS Glossary InternalDomainService $domain
setFullscreenLink(string $a_fullscreen_link)
injectTemplate(ilGlobalTemplateInterface $tpl)
static getSyntaxStylePath()
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
Last visited history for repository items.
media(string $a_mode="media")
show media object
setFileDownloadLink(string $a_download_link)
form( $class_path, string $cmd, string $submit_caption="")
setOfflineDirectory(string $a_dir)
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
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...
ilGlobalTemplateInterface $tpl
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
offlineMode()
checks wether offline content generation is activated
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupContObjID(int $a_id)
get learning module id for lm object
ILIAS GlobalScreen Services $global_screen
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $requested_search_str
getPresentationTable()
Get presentation table.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $requested_table_glossary_download_file_ids
showDownloadList()
show download list
getLink(int $a_ref_id, string $a_cmd="", int $a_term_id=0, string $a_frame="", string $a_type="")
ilNavigationHistory $nav_history
ILIAS Glossary Taxonomy TaxonomyManager $tax_manager
ILIAS COPage Xsl XslManager $xsl
downloadExportFile()
send download file (xml/html)
static _lookGlossaryID(int $term_id)
get glossary id form term id