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;
63 string $export_format =
"",
64 string $export_dir =
"" 68 $service = $DIC->glossary()->internal();
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();
87 $this->offline = ($export_format !==
"");
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;
185 $lng->loadLanguageModule(
"content");
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());
297 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
302 if ($this->glossary->getPresentationMode() ==
"full_def") {
306 $ilNavigationHistory->addItem(
307 $this->requested_ref_id,
308 $this->
ctrl->getLinkTarget($this,
"listTerms"),
326 if (!$ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
330 $ilCtrl->redirectByClass(
"ilPresentationTableGUI",
"show");
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(
376 bool $a_get_html =
false,
377 bool $render_term =
true,
379 bool $render_page_container =
true 386 if ($a_ref_id == 0) {
391 if ($a_term_id == 0) {
394 $term_id = $a_term_id;
397 if (!$ilAccess->checkAccess(
"read",
"",
$ref_id)) {
408 $tpl->loadStandardTemplate();
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();
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();
451 $page_gui->setOutputMode(
"offline");
454 $page_gui->setFullscreenLink($this->
getLink(
$ref_id,
"fullscreen", $term_id));
456 $page_gui->setTemplateOutput(
false);
457 $page_gui->setRawPageContent(
true);
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);
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());
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",
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();
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();
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 =
"",
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);
695 $ilTabs->activateTab(
"print_view");
699 $tpl->setContent($this->
form->getHTML());
710 $terms = $this->glossary->getTermList();
714 $this->
form->setFormAction($ilCtrl->getFormAction($this));
722 .
" (" . $lng->txt(
"cont_terms") .
": " . count($terms) .
")",
"glossary");
723 $radg->addOption($op1);
726 if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
727 $op3 =
new ilRadioOption($lng->txt(
"cont_selected_topic"),
"sel_topic");
728 $radg->addOption($op3);
734 $lng->txt(
"cont_topic"),
738 if ($this->tax_node > 0) {
741 $op3->addSubItem($si);
745 $op2 =
new ilRadioOption($lng->txt(
"cont_selected_terms"),
"selection");
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"));
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)) {
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);
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"),
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");
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());
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(
972 $ilTabs->activateTab(
"flashcards");
973 $ilNavigationHistory->addItem(
974 $this->requested_ref_id,
975 $this->
ctrl->getLinkTarget($this,
"showFlashcards"),
979 $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
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)
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.
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)
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.
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
static _lookGlossaryID(int $term_id)
get glossary id form term id