ILIAS  release_8 Revision v8.23
ilGlossaryPresentationGUI Class Reference
+ Inheritance diagram for ilGlossaryPresentationGUI:
+ Collaboration diagram for ilGlossaryPresentationGUI:

Public Member Functions

 __construct (string $export_format="", string $export_dir="")
 
 initByRequest (?array $query_params=null)
 Init services and this class by request params. More...
 
 injectTemplate (ilGlobalTemplateInterface $tpl)
 
 setOfflineMode (bool $a_offline=true)
 set offline mode (content is generated for offline package) More...
 
 offlineMode ()
 checks wether offline content generation is activated More...
 
 setOfflineDirectory (string $a_dir)
 
 getOfflineDirectory ()
 
 executeCommand ()
 execute command More...
 
 prepareOutput ()
 
 basicPageGuiInit (\ilPageObjectGUI $a_page_gui)
 Basic page gui initialisation. More...
 
 listTerms ()
 
 listTermByGiven ()
 list glossary terms More...
 
 getPresentationTable ()
 Get presentation table. More...
 
 applyFilter ()
 
 resetFilter ()
 
 listDefinitions (int $a_ref_id=0, int $a_term_id=0, bool $a_get_html=false, string $a_page_mode=ilPageObjectGUI::PRESENTATION)
 list definitions of a term More...
 
 showDefinitionTabs (string $a_act)
 
 fullscreen ()
 
 media (string $a_mode="media")
 show media object More...
 
 showDownloadList ()
 show download list More...
 
 downloadExportFile ()
 send download file (xml/html) More...
 
 setLocator ()
 
 downloadFile ()
 
 setTabs ()
 
 getLink (int $a_ref_id, string $a_cmd="", int $a_term_id=0, int $a_def_id=0, string $a_frame="", string $a_type="")
 
 printViewSelection ()
 
 initPrintViewSelectionForm ()
 Init print view selection form. More...
 
 printView ()
 
 getTabs ()
 
 infoScreen ()
 this one is called from the info button in the repository More...
 
 outputInfoScreen ()
 
 chooseLetter ()
 
 showTaxonomy ()
 

Protected Member Functions

 setContentStyles ()
 

Protected Attributes

array $mobs
 
bool $fill_on_load_code
 
string $offline_dir
 
ilPropertyFormGUI $form
 
ILIAS Glossary InternalService $service
 
bool $offline
 
string $export_format
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilAccessHandler $access
 
ilNavigationHistory $nav_history
 
ilToolbarGUI $toolbar
 
ilObjUser $user
 
ilHelpGUI $help
 
ilObjGlossary $glossary
 
ilObjGlossaryGUI $glossary_gui
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
int $tax_node
 
int $tax_id
 
ilObjTaxonomy $tax
 
int $term_id
 
int $requested_ref_id
 
string $requested_letter
 
int $requested_def_page_id
 
string $requested_search_str
 
string $requested_file_id
 
int $requested_mob_id
 
string $requested_export_type
 
ILIAS Style Content Service $content_style_service
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content Object ObjectFacade $content_style_domain
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryPresentationGUI::__construct ( string  $export_format = "",
string  $export_dir = "" 
)

Definition at line 60 of file class.ilGlossaryPresentationGUI.php.

References $DIC, $export_format, $lng, $tpl, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), initByRequest(), ILIAS\Repository\lng(), setOfflineDirectory(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

63  {
64  global $DIC;
65 
66  $this->export_format = $export_format;
67  $this->setOfflineDirectory($export_dir);
68  $this->offline = ($export_format != "");
69  $this->access = $DIC->access();
70  $this->nav_history = $DIC["ilNavigationHistory"];
71  $this->toolbar = $DIC->toolbar();
72  $this->user = $DIC->user();
73  $this->help = $DIC["ilHelp"];
74  $lng = $DIC->language();
75  $tpl = $DIC->ui()->mainTemplate();
76  $ilCtrl = $DIC->ctrl();
77  $ilTabs = $DIC->tabs();
78 
79  $this->tabs_gui = $ilTabs;
80  $this->tpl = $tpl;
81  $this->lng = $lng;
82  $this->ctrl = $ilCtrl;
83  $this->ctrl->saveParameter($this, array("ref_id", "letter", "tax_node"));
84  $this->service = $DIC->glossary()
85  ->internal();
86  $this->content_style_service =
87  $DIC->contentStyle();
88  $this->initByRequest();
89  }
initByRequest(?array $query_params=null)
Init services and this class by request params.
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilGlossaryPresentationGUI::applyFilter ( )

Definition at line 375 of file class.ilGlossaryPresentationGUI.php.

References getPresentationTable(), and listTerms().

375  : void
376  {
377  $prtab = $this->getPresentationTable();
378  $prtab->resetOffset();
379  $prtab->writeFilterToSession();
380  $this->listTerms();
381  }
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ basicPageGuiInit()

ilGlossaryPresentationGUI::basicPageGuiInit ( \ilPageObjectGUI  $a_page_gui)

Basic page gui initialisation.

Definition at line 242 of file class.ilGlossaryPresentationGUI.php.

References ILIAS\Repository\ctrl(), ilPageObjectGUI\getId(), getLink(), getOfflineDirectory(), offlineMode(), ilPageObjectGUI\setFileDownloadLink(), ilPageObjectGUI\setFullscreenLink(), ilPageObjectGUI\setOfflineDirectory(), ilPageObjectGUI\setOutputMode(), and ilPageObjectGUI\setStyleId().

Referenced by executeCommand(), and listDefinitions().

244  : void {
245  $a_page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
246  if (!$this->offlineMode()) {
247  $a_page_gui->setOutputMode("presentation");
248  $this->fill_on_load_code = true;
249  } else {
250  $a_page_gui->setOutputMode("offline");
251  $a_page_gui->setOfflineDirectory($this->getOfflineDirectory());
252  $this->fill_on_load_code = false;
253  }
254  if (!$this->offlineMode()) {
255  $this->ctrl->setParameter($this, "pg_id", $a_page_gui->getId());
256  }
257  $a_page_gui->setFileDownloadLink($this->getLink($this->requested_ref_id, "downloadFile"));
258  $a_page_gui->setFullscreenLink($this->getLink($this->requested_ref_id, "fullscreen"));
259  }
getLink(int $a_ref_id, string $a_cmd="", int $a_term_id=0, int $a_def_id=0, string $a_frame="", string $a_type="")
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ chooseLetter()

ilGlossaryPresentationGUI::chooseLetter ( )

Definition at line 1165 of file class.ilGlossaryPresentationGUI.php.

References $ctrl, and ilCtrl\redirect().

1165  : void
1166  {
1167  $ilCtrl = $this->ctrl;
1168  $ilCtrl->redirect($this, "listTerms");
1169  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ downloadExportFile()

ilGlossaryPresentationGUI::downloadExportFile ( )

send download file (xml/html)

Definition at line 797 of file class.ilGlossaryPresentationGUI.php.

References $access, $lng, ilFileDelivery\deliverFileLegacy(), and exit.

797  : void
798  {
799  $ilAccess = $this->access;
800  $lng = $this->lng;
801 
802  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
803  throw new ilPermissionException($lng->txt("permission_denied"));
804  }
805 
806  $file = $this->glossary->getPublicExportFile($this->requested_export_type);
807  if ($this->glossary->getPublicExportFile($this->requested_export_type) != "") {
808  $dir = $this->glossary->getExportDirectory($this->requested_export_type);
809  if (is_file($dir . "/" . $file)) {
810  ilFileDelivery::deliverFileLegacy($dir . "/" . $file, $file);
811  exit;
812  }
813  }
814  throw new ilGlossaryException($lng->txt("file_not_found"));
815  }
exit
Definition: login.php:28
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...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
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...
+ Here is the call graph for this function:

◆ downloadFile()

ilGlossaryPresentationGUI::downloadFile ( )

Definition at line 829 of file class.ilGlossaryPresentationGUI.php.

References $access, $lng, and exit.

829  : void
830  {
831  $ilAccess = $this->access;
832  $lng = $this->lng;
833 
834  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
835  throw new ilPermissionException($lng->txt("permission_denied"));
836  }
837 
838  $file = explode("_", $this->requested_file_id);
839  $fileObj = new ilObjFile($file[count($file) - 1], false);
840  $fileObj->sendFile();
841  exit;
842  }
exit
Definition: login.php:28
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjFile.

◆ executeCommand()

ilGlossaryPresentationGUI::executeCommand ( )

execute command

Definition at line 178 of file class.ilGlossaryPresentationGUI.php.

References $access, $lng, basicPageGuiInit(), ILIAS\Repository\ctrl(), getPresentationTable(), listDefinitions(), outputInfoScreen(), prepareOutput(), and setTabs().

178  : void
179  {
180  $lng = $this->lng;
181  $ilAccess = $this->access;
182 
183  $lng->loadLanguageModule("content");
184 
185  $next_class = $this->ctrl->getNextClass($this);
186  $cmd = $this->ctrl->getCmd("listTerms");
187 
188  // check write permission
189  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id) &&
190  !($ilAccess->checkAccess("visible", "", $this->requested_ref_id) &&
191  ($cmd == "infoScreen" || strtolower($next_class) == "ilinfoscreengui"))) {
192  throw new ilPermissionException($lng->txt("permission_denied"));
193  }
194 
195  if ($cmd != "listDefinitions") {
196  $this->prepareOutput();
197  }
198 
199  switch ($next_class) {
200  case "ilnotegui":
201  $this->setTabs();
202  $ret = $this->listDefinitions();
203  break;
204 
205  case "ilinfoscreengui":
206  $ret = $this->outputInfoScreen();
207  break;
208 
209  case "ilpresentationlisttablegui":
210  $prtab = $this->getPresentationTable();
211  $this->ctrl->forwardCommand($prtab);
212  return;
213 
214  case "ilglossarydefpagegui":
215  $page_gui = new ilGlossaryDefPageGUI($this->requested_def_page_id);
216  $this->basicPageGuiInit($page_gui);
217  $this->ctrl->forwardCommand($page_gui);
218  break;
219 
220  default:
221  $this->$cmd();
222  break;
223  }
224  $this->tpl->printToStdout();
225  }
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...
basicPageGuiInit(\ilPageObjectGUI $a_page_gui)
Basic page gui initialisation.
loadLanguageModule(string $a_module)
Load language module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
listDefinitions(int $a_ref_id=0, int $a_term_id=0, bool $a_get_html=false, string $a_page_mode=ilPageObjectGUI::PRESENTATION)
list definitions of a term
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ fullscreen()

ilGlossaryPresentationGUI::fullscreen ( )

Definition at line 625 of file class.ilGlossaryPresentationGUI.php.

References media().

625  : string
626  {
627  $html = $this->media("fullscreen");
628  return $html;
629  }
media(string $a_mode="media")
show media object
+ Here is the call graph for this function:

◆ getLink()

ilGlossaryPresentationGUI::getLink ( int  $a_ref_id,
string  $a_cmd = "",
int  $a_term_id = 0,
int  $a_def_id = 0,
string  $a_frame = "",
string  $a_type = "" 
)

Definition at line 849 of file class.ilGlossaryPresentationGUI.php.

References ILIAS\Repository\ctrl(), and offlineMode().

Referenced by basicPageGuiInit(), listDefinitions(), and media().

856  : string {
857  $link = "";
858  if ($a_cmd == "") {
859  $a_cmd = "layout";
860  }
861  //$script = "glossary_presentation.php";
862 
863  // handle online links
864  if (!$this->offlineMode()) {
865  //$link = $script."?ref_id=".$a_ref_id;
866  switch ($a_cmd) {
867  case "fullscreen":
868  $this->ctrl->setParameter($this, "def_id", $a_def_id);
869  $link = $this->ctrl->getLinkTarget($this, "fullscreen");
870  break;
871 
872  default:
873  $link .= "&cmd=" . $a_cmd;
874  if ($a_frame != "") {
875  $this->ctrl->setParameter($this, "frame", $a_frame);
876  }
877  if ($a_type != "") {
878  $this->ctrl->setParameter($this, "obj_type", $a_type);
879  }
880  $link = $this->ctrl->getLinkTarget($this, $a_cmd);
881  break;
882  }
883  } else { // handle offline links
884  switch ($a_cmd) {
885 
886  case "fullscreen":
887  $link = "fullscreen.html"; // id is handled by xslt
888  break;
889 
890  case "glossary":
891  $link = "term_" . $a_term_id . ".html";
892  break;
893 
894  case "downloadFile":
895  case "layout":
896  default:
897  break;
898  }
899  }
900  $this->ctrl->clearParameters($this);
901  return $link;
902  }
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOfflineDirectory()

ilGlossaryPresentationGUI::getOfflineDirectory ( )

Definition at line 170 of file class.ilGlossaryPresentationGUI.php.

References $offline_dir.

Referenced by basicPageGuiInit(), and listDefinitions().

170  : string
171  {
172  return $this->offline_dir;
173  }
+ Here is the caller graph for this function:

◆ getPresentationTable()

ilGlossaryPresentationGUI::getPresentationTable ( )

Get presentation table.

Definition at line 362 of file class.ilGlossaryPresentationGUI.php.

References offlineMode().

Referenced by applyFilter(), executeCommand(), listTermByGiven(), and resetFilter().

363  {
364  $table = new ilPresentationListTableGUI(
365  $this,
366  "listTerms",
367  $this->glossary,
368  $this->offlineMode(),
369  $this->tax_node,
370  $this->glossary->getTaxonomyId()
371  );
372  return $table;
373  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilGlossaryPresentationGUI::getTabs ( )

Definition at line 1052 of file class.ilGlossaryPresentationGUI.php.

References $access, $ctrl, $help, $lng, $requested_ref_id, ILIAS\Repository\ctrl(), offlineMode(), and ilHelpGUI\setScreenIdComponent().

Referenced by setTabs().

1052  : void
1053  {
1054  $ilAccess = $this->access;
1055  $lng = $this->lng;
1056  $ilCtrl = $this->ctrl;
1057  $ilHelp = $this->help;
1058 
1059  $ilHelp->setScreenIdComponent("glo");
1060 
1061  if (!$this->offlineMode()) {
1062  if ($this->ctrl->getCmd() != "listDefinitions") {
1063  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1064  $this->tabs_gui->addTab(
1065  "terms",
1066  $lng->txt("cont_terms"),
1067  $ilCtrl->getLinkTarget($this, "listTerms")
1068  );
1069  }
1070 
1071  $this->tabs_gui->addTab(
1072  "info",
1073  $lng->txt("info_short"),
1074  $ilCtrl->getLinkTarget($this, "infoScreen")
1075  );
1076 
1077 
1078  // glossary menu
1079  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1080  $this->tabs_gui->addTab(
1081  "print_view",
1082  $lng->txt("cont_print_view"),
1083  $ilCtrl->getLinkTarget($this, "printViewSelection")
1084  );
1085 
1086  // download links
1087  if ($this->glossary->isActiveDownloads()) {
1088  $this->tabs_gui->addTab(
1089  "download",
1090  $lng->txt("download"),
1091  $ilCtrl->getLinkTarget($this, "showDownloadList")
1092  );
1093  }
1094  //}
1095  }
1096 
1097  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) ||
1098  $ilAccess->checkAccess("edit_content", "", $this->requested_ref_id)) {
1099  $this->tabs_gui->addNonTabbedLink(
1100  "editing_view",
1101  $lng->txt("glo_editing_view"),
1102  "ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=" . $this->requested_ref_id,
1103  "_top"
1104  );
1105  }
1106  }
1107  } else {
1108  $this->tabs_gui->addTarget(
1109  "cont_back",
1110  "index.html#term_" . $this->term_id,
1111  "",
1112  ""
1113  );
1114  }
1115  }
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...
setScreenIdComponent(string $a_comp)
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilGlossaryPresentationGUI::infoScreen ( )

this one is called from the info button in the repository

Definition at line 1120 of file class.ilGlossaryPresentationGUI.php.

References ILIAS\Repository\ctrl(), and outputInfoScreen().

1120  : void
1121  {
1122  $this->ctrl->setCmd("showSummary");
1123  $this->ctrl->setCmdClass("ilinfoscreengui");
1124  $this->outputInfoScreen();
1125  }
+ Here is the call graph for this function:

◆ initByRequest()

ilGlossaryPresentationGUI::initByRequest ( ?array  $query_params = null)

Init services and this class by request params.

The request params are usually retrieved by HTTP request, but also adjusted during HTML exports, this is, why this method needs to be public.

Exceptions
ilGlossaryException

Definition at line 98 of file class.ilGlossaryPresentationGUI.php.

References $service, ilGlossaryTerm\_lookGlossaryID(), and ilGlossaryTermReferences\isReferenced().

Referenced by __construct().

98  : void
99  {
101  $request = $service
102  ->gui()
103  ->presentation()
104  ->request($query_params);
105 
106  $this->requested_ref_id = $request->getRefId();
107  $this->term_id = $request->getTermId();
108  $this->glossary_gui = $service->gui()->presentation()->ObjGlossaryGUI($this->requested_ref_id);
109  $this->glossary = $this->glossary_gui->getGlossary();
110  $this->requested_def_page_id = $request->getDefinitionPageId();
111  $this->requested_search_str = $request->getSearchString();
112  $this->requested_file_id = $request->getFileId();
113  $this->requested_mob_id = $request->getMobId();
114  $this->requested_export_type = $request->getExportType();
115 
116 
117  // determine term id and check whether it is valid (belongs to
118  // current glossary or a virtual (online) sub-glossary)
119  $glo_ids = $this->glossary->getAllGlossaryIds();
120  $term_glo_id = ilGlossaryTerm::_lookGlossaryID($this->term_id);
121  if (!in_array($term_glo_id, $glo_ids) && !ilGlossaryTermReferences::isReferenced($glo_ids, $this->term_id)) {
122  if ($this->term_id > 0) {
123  throw new ilGlossaryException("Term ID does not match the glossary.");
124  }
125  $this->term_id = 0;
126  }
127 
128  $this->tax_node = 0;
129  $this->tax_id = $this->glossary->getTaxonomyId();
130  if ($this->tax_id > 0 && $this->glossary->getShowTaxonomy()) {
131  $this->tax = new ilObjTaxonomy($this->tax_id);
132  }
133  $requested_tax_node = $request->getTaxNode();
134  if ($requested_tax_node > 1 && $this->tax->getTree()->readRootId() != $requested_tax_node) {
135  $this->tax_node = $requested_tax_node;
136  }
137 
138  $this->requested_letter = $request->getLetter();
139 
140  $this->content_style_domain = $this->content_style_service->domain()->styleForRefId($this->glossary->getRefId());
141  $this->content_style_gui = $this->content_style_service->gui();
142  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Glossary InternalService $service
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPrintViewSelectionForm()

ilGlossaryPresentationGUI::initPrintViewSelectionForm ( )

Init print view selection form.

Definition at line 930 of file class.ilGlossaryPresentationGUI.php.

References $ctrl, $lng, ILIAS\Repository\form(), ilRadioGroupInputGUI\setValue(), ilSelectInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by printView(), and printViewSelection().

930  : void
931  {
932  $lng = $this->lng;
933  $ilCtrl = $this->ctrl;
934 
935  $terms = $this->glossary->getTermList();
936 
937  $this->form = new ilPropertyFormGUI();
938  //$this->form->setTarget("print_view");
939  $this->form->setFormAction($ilCtrl->getFormAction($this));
940 
941  // selection type
942  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
943  $radg->setValue("glossary");
944 
945  // current term
946  if ($this->term_id > 0) {
947  $op1 = new ilRadioOption($lng->txt("cont_current_term"), "term");
948  $radg->addOption($op1);
949  $radg->setValue("term");
950  }
951 
952  // whole glossary
953  $op2 = new ilRadioOption($lng->txt("cont_whole_glossary")
954  . " (" . $lng->txt("cont_terms") . ": " . count($terms) . ")", "glossary");
955  $radg->addOption($op2);
956 
957  // selected topic
958  if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
959  $op4 = new ilRadioOption($lng->txt("cont_selected_topic"), "sel_topic");
960  $radg->addOption($op4);
961 
962  // topic drop down
963  $si = new ilTaxAssignInputGUI(
964  $t_id,
965  false,
966  $lng->txt("cont_topic"),
967  "topic",
968  false
969  );
970  if ($this->tax_node > 0) {
971  $si->setValue($this->tax_node);
972  }
973  $op4->addSubItem($si);
974  }
975 
976  // selected terms
977  $op3 = new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
978  $radg->addOption($op3);
979 
980  $nl = new ilNestedListInputGUI("", "obj_id");
981  $op3->addSubItem($nl);
982  //var_dump($terms);
983  foreach ($terms as $t) {
984  $nl->addListNode((string) $t["id"], (string) $t["term"], "0", false, false);
985  }
986 
987  $this->form->addItem($radg);
988 
989  $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
990  $this->form->setPreventDoubleSubmission(false);
991 
992  $this->form->setTitle($lng->txt("cont_print_selection"));
993  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
This class represents a property in a property form.
setValue($a_value)
Set Value.
setValue(string $a_value)
form( $class_path, string $cmd)
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ injectTemplate()

ilGlossaryPresentationGUI::injectTemplate ( ilGlobalTemplateInterface  $tpl)

Definition at line 144 of file class.ilGlossaryPresentationGUI.php.

References $tpl.

144  : void
145  {
146  $this->tpl = $tpl;
147  }

◆ listDefinitions()

ilGlossaryPresentationGUI::listDefinitions ( int  $a_ref_id = 0,
int  $a_term_id = 0,
bool  $a_get_html = false,
string  $a_page_mode = ilPageObjectGUI::PRESENTATION 
)

list definitions of a term

Definition at line 394 of file class.ilGlossaryPresentationGUI.php.

References $access, $ilUser, $lng, $ref_id, $requested_ref_id, $term_id, $tpl, $type, $user, ilObject\_getAllReferences(), ilUserSearchCache\_getInstance(), ilLMPageObject\_getPresentationTitle(), ilInternalLink\_getSourcesOfTarget(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), basicPageGuiInit(), ILIAS\Repository\ctrl(), ilGlossaryDefinition\getDefinitionList(), ilUtil\getImagePath(), getLink(), getOfflineDirectory(), ilUserSearchCache\LAST_QUERY, ILIAS\Repository\lng(), offlineMode(), ilPageObjectGUI\PRESENTATION, ilPageObjectGUI\PRINTING, setContentStyles(), setLocator(), showDefinitionTabs(), and showTaxonomy().

Referenced by executeCommand(), and printView().

399  : string {
401  $ilAccess = $this->access;
402  $lng = $this->lng;
403  $tpl = $this->tpl;
404 
405  if ($a_ref_id == 0) {
407  } else {
408  $ref_id = $a_ref_id;
409  }
410  if ($a_term_id == 0) {
412  } else {
413  $term_id = $a_term_id;
414  }
415 
416  if (!$ilAccess->checkAccess("read", "", $ref_id)) {
417  throw new ilPermissionException($lng->txt("permission_denied"));
418  }
419 
420  // tabs
421  if ($this->glossary->getPresentationMode() != "full_def" &&
422  $a_page_mode != ilPageObjectGUI::PRINTING) {
423  $this->showDefinitionTabs("term_content");
424  }
425 
426  $term = new ilGlossaryTerm($term_id);
427 
428  if (!$a_get_html) {
430 
431  $this->setContentStyles();
432 
433  if (!$this->offlineMode()) {
434  $this->setLocator();
435  }
436 
437  $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
438  $tpl->setTitle($this->lng->txt("cont_term") . ": " . $term->getTerm());
439 
440  // advmd block
441  $cmd = null;
442  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
443  $cmd = array("edit" => $this->ctrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui", "ilobjectmetadatagui"), ""));
444  }
445  $mdgui = new ilObjectMetaDataGUI($this->glossary, "term", $term->getId());
446  $tpl->setRightContent($mdgui->getBlockHTML($cmd));
447  }
448 
449  $def_tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
450 
452  $def_tpl->setVariable("TXT_TERM", $term->getTerm());
453  $this->mobs = array();
454 
455  // toc
456  if (count($defs) > 1 && $a_page_mode == ilPageObjectGUI::PRESENTATION) {
457  $def_tpl->setCurrentBlock("toc");
458  for ($j = 1, $jMax = count($defs); $j <= $jMax; $j++) {
459  $def_tpl->setCurrentBlock("toc_item");
460  $def_tpl->setVariable("TOC_DEF_NR", $j);
461  $def_tpl->setVariable("TOC_DEF", $lng->txt("cont_definition"));
462  $def_tpl->parseCurrentBlock();
463  }
464  $def_tpl->setCurrentBlock("toc");
465  $def_tpl->parseCurrentBlock();
466  }
467 
468  for ($j = 0, $jMax = count($defs); $j < $jMax; $j++) {
469  $def = $defs[$j];
470  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
471  $this->basicPageGuiInit($page_gui);
472  $page_gui->setGlossary($this->glossary);
473  $page_gui->setOutputMode($a_page_mode);
474  $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
475  $page = $page_gui->getPageObject();
476 
477  // internal links
478  $page->buildDom();
479 
480  if ($this->offlineMode()) {
481  $page_gui->setOutputMode("offline");
482  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
483  }
484  $page_gui->setFullscreenLink($this->getLink($ref_id, "fullscreen", $term_id, $def["id"]));
485 
486  $page_gui->setTemplateOutput(false);
487  $page_gui->setRawPageContent(true);
488  if (!$this->offlineMode()) {
489  $output = $page_gui->showPage();
490  } else {
491  $output = $page_gui->presentation($page_gui->getOutputMode());
492  }
493 
494  if (count($defs) > 1) {
495  $def_tpl->setCurrentBlock("definition_header");
496  $def_tpl->setVariable(
497  "TXT_DEFINITION",
498  $this->lng->txt("cont_definition") . " " . ($j + 1)
499  );
500  $def_tpl->setVariable("DEF_NR", ($j + 1));
501  $def_tpl->parseCurrentBlock();
502  }
503 
504  $def_tpl->setCurrentBlock("definition");
505  $def_tpl->setVariable("PAGE_CONTENT", $output);
506  $def_tpl->parseCurrentBlock();
507  }
508 
509  // display possible backlinks
510  $sources = ilInternalLink::_getSourcesOfTarget('git', $this->term_id, 0);
511 
512  if ($sources) {
513  $backlist_shown = false;
514  foreach ($sources as $src) {
515  $type = explode(':', $src['type']);
516 
517  if ($type[0] == 'lm' && $type[1] == 'pg') {
518  $title = ilLMPageObject::_getPresentationTitle($src['id']);
519  $lm_id = ilLMObject::_lookupContObjID($src['id']);
520  $lm_title = ilObject::_lookupTitle($lm_id);
521  $def_tpl->setCurrentBlock('backlink_item');
522  $ref_ids = ilObject::_getAllReferences($lm_id);
523  $access = false;
524  foreach ($ref_ids as $rid) {
525  if ($ilAccess->checkAccess("read", "", $rid)) {
526  $access = true;
527  }
528  }
529  if ($access) {
530  $def_tpl->setCurrentBlock("backlink_item");
531  $def_tpl->setVariable("BACKLINK_LINK", ILIAS_HTTP_PATH . "/goto.php?target=" . $type[1] . "_" . $src['id']);
532  $def_tpl->setVariable("BACKLINK_ITEM", $lm_title . ": " . $title);
533  $def_tpl->parseCurrentBlock();
534  $backlist_shown = true;
535  }
536  }
537  }
538  if ($backlist_shown) {
539  $def_tpl->setCurrentBlock("backlink_list");
540  $def_tpl->setVariable("BACKLINK_TITLE", $this->lng->txt('glo_term_used_in'));
541  $def_tpl->parseCurrentBlock();
542  }
543  }
544 
545  if (!$a_get_html) {
546  $tpl->setPermanentLink("git", null, $term_id . "_" . $ref_id);
547 
548  // show taxonomy
549  $this->showTaxonomy();
550  }
551 
552  // highlighting?
553  if ($this->requested_search_str != "" && !$this->offlineMode()) {
554  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
555  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
556  $search_string = $cache->getQuery();
557 
558  $p = new ilQueryParser($search_string);
559  $p->parse();
560 
561  $words = $p->getQuotedWords();
562  foreach ($words as $w) {
563  ilTextHighlighterGUI::highlight("ilGloContent", $w, $tpl);
564  }
565  $this->fill_on_load_code = true;
566  }
567  $tpl->setContent($def_tpl->get());
568  if ($this->offlineMode()) {
569  return $tpl->printToString();
570  } elseif ($a_get_html) {
571  return $def_tpl->get();
572  }
573  return "";
574  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
basicPageGuiInit(\ilPageObjectGUI $a_page_gui)
Basic page gui initialisation.
$type
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstance(int $a_usr_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
printToString()
Use this method to get the finally rendered page as string.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
getLink(int $a_ref_id, string $a_cmd="", int $a_term_id=0, int $a_def_id=0, string $a_frame="", string $a_type="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
static getDefinitionList(int $a_term_id)
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
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&#39;t have to be page title, it may be chapter title + page title or chapter tit...
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...
$ilUser
Definition: imgupload.php:34
static _lookupContObjID(int $a_id)
get learning module id for lm object
setRightContent(string $a_html)
Sets content of right column.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTermByGiven()

ilGlossaryPresentationGUI::listTermByGiven ( )

list glossary terms

Definition at line 313 of file class.ilGlossaryPresentationGUI.php.

References $access, $ctrl, $lng, $tpl, getPresentationTable(), ILIAS\Repository\lng(), offlineMode(), setContentStyles(), and setTabs().

Referenced by listTerms().

313  : string
314  {
315  $ilCtrl = $this->ctrl;
316  $ilAccess = $this->access;
317  $lng = $this->lng;
318  $tpl = $this->tpl;
319 
320  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
321  throw new ilPermissionException($lng->txt("permission_denied"));
322  }
323 
324  $this->lng->loadLanguageModule("meta");
325 
326  $this->setTabs();
327 
328  // load template for table
329  // $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
330 
331  if ($this->glossary->getPresentationMode() == "full_def") {
332  $this->setContentStyles();
333  }
334 
335  $table = $this->getPresentationTable();
336 
337  if (!$this->offlineMode()) {
338  $tpl->setContent($ilCtrl->getHTML($table));
339  } else {
340  $this->tpl->setVariable("ADM_CONTENT", $table->getHTML());
341  return $this->tpl->printToString();
342  }
343  return "";
344  }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
offlineMode()
checks wether offline content generation is activated
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTerms()

ilGlossaryPresentationGUI::listTerms ( )

Definition at line 261 of file class.ilGlossaryPresentationGUI.php.

References $access, $ctrl, $lng, $nav_history, $tabs_gui, $toolbar, ILIAS\Repository\ctrl(), listTermByGiven(), offlineMode(), ilAlphabetInputGUI\setFixDBUmlauts(), showTaxonomy(), and ilUtil\stripSlashes().

Referenced by applyFilter(), and resetFilter().

261  : string
262  {
263  $ilNavigationHistory = $this->nav_history;
264  $ilAccess = $this->access;
265  $lng = $this->lng;
266  $ilToolbar = $this->toolbar;
267  $ilCtrl = $this->ctrl;
268  $ilTabs = $this->tabs_gui;
269 
270  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
271  throw new ilPermissionException($lng->txt("permission_denied"));
272  }
273 
274  if (!$this->offlineMode()) {
275  $ilNavigationHistory->addItem(
276  $this->requested_ref_id,
277  $this->ctrl->getLinkTarget($this, "listTerms"),
278  "glo"
279  );
280 
281  // alphabetical navigation
282  $ai = new ilAlphabetInputGUI($lng->txt("glo_quick_navigation"), "first");
283 
284  $ai->setFixDBUmlauts(true);
285 
286  $first_letters = $this->glossary->getFirstLetters($this->tax_node);
287  if (!in_array($this->requested_letter, $first_letters)) {
288  $first_letters[] = ilUtil::stripSlashes($this->requested_letter);
289  }
290  $ai->setLetters($first_letters);
291 
292  $ai->setParentCommand($this, "chooseLetter");
293  $ai->setHighlighted($this->requested_letter);
294  $ilToolbar->addInputItem($ai, true);
295  }
296 
297  $ret = $this->listTermByGiven();
298  $ilCtrl->setParameter($this, "term_id", "");
299 
300  $ilTabs->activateTab("terms");
301 
302  // show taxonomy
303  $this->showTaxonomy();
304 
305  $this->tpl->setPermanentLink("glo", $this->glossary->getRefId());
306 
307  return $ret;
308  }
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...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
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...
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ media()

ilGlossaryPresentationGUI::media ( string  $a_mode = "media")

show media object

Definition at line 634 of file class.ilGlossaryPresentationGUI.php.

References $params, $xml, ilMediaItem\_getMapAreasIntLinks(), ILIAS\Repository\ctrl(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), getLink(), ilUtil\getStyleSheetLocation(), ilFileUtils\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, ilObjMediaObject\isTypeAllowed(), offlineMode(), xslt_create(), and xslt_free().

Referenced by fullscreen().

634  : string
635  {
636  $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
637  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
638  $this->tpl->setVariable(
639  "LOCATION_CONTENT_STYLESHEET",
640  ilObjStyleSheet::getContentStylePath($this->content_style_domain->getEffectiveStyleId())
641  );
642 
643  //$int_links = $page_object->getInternalLinks();
644  $med_links = ilMediaItem::_getMapAreasIntLinks($this->requested_mob_id);
645 
646  // later
647  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
648 
649  $link_xml = "";
650 
651  $media_obj = new ilObjMediaObject($this->requested_mob_id);
652 
653  $xml = "<dummy>";
654  // todo: we get always the first alias now (problem if mob is used multiple
655  // times in page)
656  $xml .= $media_obj->getXML(IL_MODE_ALIAS);
657  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
658  $xml .= $link_xml;
659  $xml .= "</dummy>";
660 
661  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
662  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
663  $xh = xslt_create();
664 
665  if (!$this->offlineMode()) {
666  $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
667  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
668  } else {
669  $enlarge_path = "images/enlarge.svg";
670  $wb_path = "";
671  }
672 
673  $mode = $a_mode;
674 
675  $this->ctrl->setParameter($this, "obj_type", "MediaObject");
676  $fullscreen_link =
677  $this->getLink($this->requested_ref_id, "fullscreen");
678  $this->ctrl->clearParameters($this);
679 
680  $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
681  'link_params' => "ref_id=" . $this->requested_ref_id,'fullscreen_link' => $fullscreen_link,
682  'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
683  'ref_id' => $this->requested_ref_id, 'pg_frame' => "", 'webspace_path' => $wb_path);
684  $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
685  xslt_free($xh);
686 
687  // unmask user html
688  $this->tpl->setVariable("MEDIA_CONTENT", $output);
689 
690  $this->tpl->parseCurrentBlock();
691  if ($this->offlineMode()) {
692  $html = $this->tpl->get();
693  return $html;
694  }
695  return "";
696  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
xslt_create()
special template class to simplify handling of ITX/PEAR
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
xslt_free(&$proc)
static getImagePath(string $img, 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="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
getLink(int $a_ref_id, string $a_cmd="", int $a_term_id=0, int $a_def_id=0, string $a_frame="", string $a_type="")
static isTypeAllowed(string $a_type)
static _getMapAreasIntLinks(int $a_mob_id)
get all internal links of map areas of a mob
$xml
Definition: metadata.php:351
const IL_MODE_ALIAS
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
offlineMode()
checks wether offline content generation is activated
const IL_MODE_OUTPUT
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ offlineMode()

ilGlossaryPresentationGUI::offlineMode ( )

checks wether offline content generation is activated

Definition at line 160 of file class.ilGlossaryPresentationGUI.php.

References $offline.

Referenced by basicPageGuiInit(), getLink(), getPresentationTable(), getTabs(), listDefinitions(), listTermByGiven(), listTerms(), media(), outputInfoScreen(), setContentStyles(), showDefinitionTabs(), and showTaxonomy().

160  : bool
161  {
162  return $this->offline;
163  }
+ Here is the caller graph for this function:

◆ outputInfoScreen()

ilGlossaryPresentationGUI::outputInfoScreen ( )

Definition at line 1127 of file class.ilGlossaryPresentationGUI.php.

References $access, $tabs_gui, ilObjGlossaryGUI\addUsagesToInfo(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), offlineMode(), and setTabs().

Referenced by executeCommand(), and infoScreen().

1127  : string
1128  {
1129  $ilAccess = $this->access;
1130  $ilTabs = $this->tabs_gui;
1131 
1132  $this->setTabs();
1133  $ilTabs->activateTab("info");
1134  $this->lng->loadLanguageModule("meta");
1135 
1136  $info = new ilInfoScreenGUI($this->glossary_gui);
1137  $info->enablePrivateNotes();
1138  //$info->enableLearningProgress();
1139 
1140  $info->enableNews();
1141  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1142  $info->enableNewsEditing();
1143  $news_set = new ilSetting("news");
1144  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1145  if ($enable_internal_rss) {
1146  $info->setBlockProperty("news", "settings", true);
1147  }
1148  }
1149 
1150  // show standard meta data section
1151  $info->addMetaDataSections($this->glossary->getId(), 0, $this->glossary->getType());
1152 
1153  ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId());
1154 
1155  if ($this->offlineMode()) {
1156  $this->tpl->setContent($info->getHTML());
1157  return $this->tpl->get();
1158  } else {
1159  // forward the command
1160  $this->ctrl->forwardCommand($info);
1161  }
1162  return "";
1163  }
Class ilInfoScreenGUI.
static addUsagesToInfo(ilInfoScreenGUI $info, int $glo_id)
Add usages to info screen.
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilGlossaryPresentationGUI::prepareOutput ( )

Definition at line 227 of file class.ilGlossaryPresentationGUI.php.

References ilUtil\getImagePath(), and setLocator().

Referenced by executeCommand().

227  : void
228  {
229  $this->tpl->loadStandardTemplate();
230  $title = $this->glossary->getTitle();
231 
232  $this->tpl->setTitle($title);
233  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
234 
235  $this->setLocator();
236  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printView()

ilGlossaryPresentationGUI::printView ( )

Definition at line 995 of file class.ilGlossaryPresentationGUI.php.

References $access, $i, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilObjTaxonomy\getSubTreeItems(), initPrintViewSelectionForm(), ILIAS\Repository\int(), listDefinitions(), ILIAS\Repository\lng(), and ilPageObjectGUI\PRINTING.

995  : void
996  {
997  $ilAccess = $this->access;
998  $tpl = $this->tpl;
999 
1000  $this->tabs_gui->setBackTarget(
1001  $this->lng->txt("back"),
1002  $this->ctrl->getLinkTarget($this, "printViewSelection")
1003  );
1004 
1005  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1006  return;
1007  }
1008 
1009  $this->initPrintViewSelectionForm();
1010  $this->form->checkInput();
1011 
1012  $terms = array();
1013  switch ($this->form->getInput("sel_type")) {
1014  case "glossary":
1015  $ts = $this->glossary->getTermList();
1016  foreach ($ts as $t) {
1017  $terms[] = $t["id"];
1018  }
1019  break;
1020 
1021  case "sel_topic":
1022  $t_id = $this->glossary->getTaxonomyId();
1023  $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $this->form->getInput("topic"));
1024  foreach ($items as $i) {
1025  if ($i["item_type"] == "term") {
1026  $terms[] = $i["item_id"];
1027  }
1028  }
1029  break;
1030 
1031  case "selection":
1032  $terms = $this->form->getInput("obj_id");
1033  break;
1034 
1035  case "term":
1036  $terms = array($this->term_id);
1037  break;
1038  }
1039 
1040  //$tpl->addCss(ilObjStyleSheet::getContentPrintStyle());
1041  $tpl->addOnLoadCode("il.Util.print();");
1042 
1043  // determine target frames for internal links
1044 
1045  $page_content = "";
1046  foreach ($terms as $t_id) {
1047  $page_content .= $this->listDefinitions($this->requested_ref_id, $t_id, true, ilPageObjectGUI::PRINTING);
1048  }
1049  $tpl->setContent($page_content);
1050  }
initPrintViewSelectionForm()
Init print view selection form.
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.
setContent(string $a_html)
Sets content for standard template.
listDefinitions(int $a_ref_id=0, int $a_term_id=0, bool $a_get_html=false, string $a_page_mode=ilPageObjectGUI::PRESENTATION)
list definitions of a term
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
form( $class_path, string $cmd)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ printViewSelection()

ilGlossaryPresentationGUI::printViewSelection ( )

Definition at line 904 of file class.ilGlossaryPresentationGUI.php.

References $ctrl, $tabs_gui, $tpl, ILIAS\Repository\form(), ilUtil\getImagePath(), initPrintViewSelectionForm(), ILIAS\Repository\lng(), setTabs(), and showDefinitionTabs().

904  : void
905  {
906  $ilCtrl = $this->ctrl;
907  $tpl = $this->tpl;
908  $ilTabs = $this->tabs_gui;
909 
910  $ilCtrl->saveParameter($this, "term_id");
911 
912  if ($this->term_id == 0) {
913  $this->setTabs();
914  $ilTabs->activateTab("print_view");
915  } else {
916  $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
917  $term = new ilGlossaryTerm($this->term_id);
918  $tpl->setTitle($this->lng->txt("cont_term") . ": " . $term->getTerm());
919  $this->showDefinitionTabs("print_view");
920  }
921 
923 
924  $tpl->setContent($this->form->getHTML());
925  }
initPrintViewSelectionForm()
Init print view selection form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ resetFilter()

ilGlossaryPresentationGUI::resetFilter ( )

Definition at line 383 of file class.ilGlossaryPresentationGUI.php.

References getPresentationTable(), and listTerms().

383  : void
384  {
385  $prtab = $this->getPresentationTable();
386  $prtab->resetOffset();
387  $prtab->resetFilter();
388  $this->listTerms();
389  }
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ setContentStyles()

ilGlossaryPresentationGUI::setContentStyles ( )
protected

Definition at line 346 of file class.ilGlossaryPresentationGUI.php.

References $tpl, ilGlobalTemplateInterface\addCss(), ilObjStyleSheet\getSyntaxStylePath(), and offlineMode().

Referenced by listDefinitions(), and listTermByGiven().

346  : void
347  {
348  $tpl = $this->tpl;
349 
350  if (!$this->offlineMode()) {
351  $this->content_style_gui->addCss($tpl, $this->glossary->getRefId());
353  } else {
354  $tpl->addCss("content.css");
355  $tpl->addCss("syntaxhighlight.css");
356  }
357  }
offlineMode()
checks wether offline content generation is activated
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLocator()

ilGlossaryPresentationGUI::setLocator ( )

Definition at line 817 of file class.ilGlossaryPresentationGUI.php.

Referenced by listDefinitions(), and prepareOutput().

817  : void
818  {
819  $gloss_loc = new ilGlossaryLocatorGUI();
820  $gloss_loc->setMode("presentation");
821  if (!empty($this->term_id)) {
822  $term = new ilGlossaryTerm($this->term_id);
823  $gloss_loc->setTerm($term);
824  }
825  $gloss_loc->setGlossary($this->glossary);
826  $gloss_loc->display();
827  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ setOfflineDirectory()

ilGlossaryPresentationGUI::setOfflineDirectory ( string  $a_dir)

Definition at line 165 of file class.ilGlossaryPresentationGUI.php.

Referenced by __construct().

165  : void
166  {
167  $this->offline_dir = $a_dir;
168  }
+ Here is the caller graph for this function:

◆ setOfflineMode()

ilGlossaryPresentationGUI::setOfflineMode ( bool  $a_offline = true)

set offline mode (content is generated for offline package)

Definition at line 152 of file class.ilGlossaryPresentationGUI.php.

152  : void
153  {
154  $this->offline = $a_offline;
155  }

◆ setTabs()

ilGlossaryPresentationGUI::setTabs ( )

Definition at line 844 of file class.ilGlossaryPresentationGUI.php.

References getTabs().

Referenced by executeCommand(), listTermByGiven(), outputInfoScreen(), printViewSelection(), and showDownloadList().

844  : void
845  {
846  $this->getTabs();
847  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDefinitionTabs()

ilGlossaryPresentationGUI::showDefinitionTabs ( string  $a_act)

Definition at line 576 of file class.ilGlossaryPresentationGUI.php.

References $ctrl, $help, $lng, $tabs_gui, ilGlossaryTerm\_lookGlossaryID(), ILIAS\Repository\access(), ILIAS\Repository\lng(), offlineMode(), and ilHelpGUI\setScreenIdComponent().

Referenced by listDefinitions(), and printViewSelection().

576  : void
577  {
578  $ilTabs = $this->tabs_gui;
579  $lng = $this->lng;
580  $ilCtrl = $this->ctrl;
581  $ilHelp = $this->help;
582 
583  if (!$this->offlineMode()) {
584  $ilHelp->setScreenIdComponent("glo");
585 
586  $ilCtrl->setParameter($this, "term_id", "");
587  $back = $ilCtrl->getLinkTarget($this, "listTerms");
588  $ilCtrl->setParameter($this, "term_id", $this->term_id);
589  $ilCtrl->saveParameter($this, "term_id");
590 
591  $ilTabs->setBackTarget($this->lng->txt("obj_glo"), $back);
592 
593  $ilTabs->addTab(
594  "term_content",
595  $lng->txt("content"),
596  $ilCtrl->getLinkTarget($this, "listDefinitions")
597  );
598 
599  $ilTabs->addTab(
600  "print_view",
601  $lng->txt("print_view"),
602  $ilCtrl->getLinkTarget($this, "printViewSelection")
603  );
604 
605  $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $this->term_id);
606  if (ilGlossaryTerm::_lookGlossaryID($this->term_id) == $this->glossary->getId()) {
607  if ($this->access->checkAccess("write", "", (int) $this->requested_ref_id) ||
608  $this->access->checkAccess("edit_content", "", (int) $this->requested_ref_id)) {
609  $ilTabs->addNonTabbedLink(
610  "editing_view",
611  $lng->txt("glo_editing_view"),
612  $ilCtrl->getLinkTargetByClass(array("ilglossaryeditorgui",
613  "ilobjglossarygui",
614  "ilglossarytermgui"
615  ), "listDefinitions")
616  );
617  }
618  //"ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".$this->requested_ref_id."&amp;edit_term=".$this->term_id);
619  }
620  $ilTabs->activateTab($a_act);
621  }
622  }
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...
setScreenIdComponent(string $a_comp)
offlineMode()
checks wether offline content generation is activated
static _lookGlossaryID(int $term_id)
get glossary id form term id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDownloadList()

ilGlossaryPresentationGUI::showDownloadList ( )

show download list

Definition at line 701 of file class.ilGlossaryPresentationGUI.php.

References $access, $cols, $i, $lng, $tabs_gui, $type, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ILIAS\Repository\lng(), and setTabs().

701  : void
702  {
703  $ilAccess = $this->access;
704  $lng = $this->lng;
705  $ilTabs = $this->tabs_gui;
706 
707  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
708  throw new ilPermissionException($lng->txt("permission_denied"));
709  }
710 
711  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.glo_download_list.html", "Modules/Glossary");
712 
713  $this->setTabs();
714  $ilTabs->activateTab("download");
715 
716  // set title header
717  $this->tpl->setTitle($this->glossary->getTitle());
718  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
719 
720  // create table
721  $tbl = new ilTableGUI();
722 
723  // load files templates
724  $this->tpl->addBlockFile("DOWNLOAD_TABLE", "download_table", "tpl.table.html");
725 
726  // load template for table content data
727  $this->tpl->addBlockFile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/Glossary");
728 
729  $export_files = array();
730  $types = array("xml", "html");
731  foreach ($types as $type) {
732  if ($this->glossary->getPublicExportFile($type) != "") {
733  $dir = $this->glossary->getExportDirectory($type);
734  if (is_file($this->glossary->getExportDirectory($type) . "/" .
735  $this->glossary->getPublicExportFile($type))) {
736  $size = filesize($this->glossary->getExportDirectory($type) . "/" .
737  $this->glossary->getPublicExportFile($type));
738  $export_files[] = array("type" => $type,
739  "file" => $this->glossary->getPublicExportFile($type),
740  "size" => $size);
741  }
742  }
743  }
744 
745  $num = 0;
746 
747  $tbl->setTitle($this->lng->txt("download"));
748 
749  $tbl->setHeaderNames(array($this->lng->txt("cont_format"),
750  $this->lng->txt("cont_file"),
751  $this->lng->txt("size"), $this->lng->txt("date"),
752  ""));
753 
754  $cols = array("format", "file", "size", "date", "download");
755  $header_params = array("ref_id" => $this->requested_ref_id,
756  "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this)));
757  $tbl->setHeaderVars($cols, $header_params);
758  $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
759  $tbl->disable("sort");
760  // footer
761  $tbl->disable("footer");
762  $tbl->setMaxCount(count($export_files));
763 
764  $tbl->render();
765  if (count($export_files) > 0) {
766  $i = 0;
767  foreach ($export_files as $exp_file) {
768  $this->tpl->setCurrentBlock("tbl_content");
769  $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
770 
771  $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
772  $this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"]));
773  $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"] . ":" . $exp_file["file"]);
774 
775  $file_arr = explode("__", $exp_file["file"]);
776  $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s", $file_arr[0]));
777 
778  $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
779  $this->ctrl->setParameter($this, "type", $exp_file["type"]);
780  $this->tpl->setVariable(
781  "LINK_DOWNLOAD",
782  $this->ctrl->getLinkTarget($this, "downloadExportFile")
783  );
784 
785  $this->tpl->parseCurrentBlock();
786  }
787  } else {
788  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
789  $this->tpl->setVariable("NUM_COLS", 5);
790  $this->tpl->parseCurrentBlock();
791  }
792  }
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...
$type
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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...
$cols
Definition: xhr_table.php:11
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ showTaxonomy()

ilGlossaryPresentationGUI::showTaxonomy ( )

Definition at line 1171 of file class.ilGlossaryPresentationGUI.php.

References $ctrl, $DIC, ilObjTaxonomy\getUsageOfObject(), offlineMode(), ilTaxonomyGSToolProvider\SHOW_TAX_TREE, ilTaxonomyGSToolProvider\TAX_ID, ilTaxonomyGSToolProvider\TAX_TREE_CMD, ilTaxonomyGSToolProvider\TAX_TREE_GUI_PATH, and ilTaxonomyGSToolProvider\TAX_TREE_PARENT_CMD.

Referenced by listDefinitions(), and listTerms().

1171  : void
1172  {
1173  global $DIC;
1174  $ctrl = $this->ctrl;
1175  if (!$this->offlineMode() && $this->glossary->getShowTaxonomy()) {
1176  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->glossary->getId());
1177  if (count($tax_ids) > 0) {
1178  $tax_id = $tax_ids[0];
1179  $DIC->globalScreen()->tool()->context()->current()
1180  ->addAdditionalData(
1182  true
1183  );
1184  $DIC->globalScreen()->tool()->context()->current()
1185  ->addAdditionalData(
1187  [self::class]
1188  );
1189  $DIC->globalScreen()->tool()->context()->current()
1190  ->addAdditionalData(
1192  $tax_id
1193  );
1194  $DIC->globalScreen()->tool()->context()->current()
1195  ->addAdditionalData(
1197  "listTerms"
1198  );
1199  $DIC->globalScreen()->tool()->context()->current()
1200  ->addAdditionalData(
1202  "showTaxonomy"
1203  );
1204 
1205  $tax_exp = new ilTaxonomyExplorerGUI(
1206  get_class($this),
1207  "showTaxonomy",
1208  $tax_id,
1209  "ilglossarypresentationgui",
1210  "listTerms"
1211  );
1212  /*
1213  if (!$tax_exp->handleCommand()) {
1214  //$tpl->setLeftNavContent($tax_exp->getHTML());
1215  //$tpl->setLeftContent($tax_exp->getHTML()."&nbsp;");
1216  }*/
1217  }
1218  }
1219  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
global $DIC
Definition: feed.php:28
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

◆ $content_style_domain

ILIAS Style Content Object ObjectFacade ilGlossaryPresentationGUI::$content_style_domain
protected

Definition at line 58 of file class.ilGlossaryPresentationGUI.php.

◆ $content_style_gui

ILIAS Style Content GUIService ilGlossaryPresentationGUI::$content_style_gui
protected

Definition at line 57 of file class.ilGlossaryPresentationGUI.php.

◆ $content_style_service

ILIAS Style Content Service ilGlossaryPresentationGUI::$content_style_service
protected

Definition at line 56 of file class.ilGlossaryPresentationGUI.php.

◆ $ctrl

◆ $export_format

string ilGlossaryPresentationGUI::$export_format
protected

Definition at line 33 of file class.ilGlossaryPresentationGUI.php.

Referenced by __construct().

◆ $fill_on_load_code

bool ilGlossaryPresentationGUI::$fill_on_load_code
protected

Definition at line 28 of file class.ilGlossaryPresentationGUI.php.

◆ $form

ilPropertyFormGUI ilGlossaryPresentationGUI::$form
protected

Definition at line 30 of file class.ilGlossaryPresentationGUI.php.

◆ $glossary

ilObjGlossary ilGlossaryPresentationGUI::$glossary
protected

Definition at line 41 of file class.ilGlossaryPresentationGUI.php.

◆ $glossary_gui

ilObjGlossaryGUI ilGlossaryPresentationGUI::$glossary_gui
protected

Definition at line 42 of file class.ilGlossaryPresentationGUI.php.

◆ $help

ilHelpGUI ilGlossaryPresentationGUI::$help
protected

Definition at line 40 of file class.ilGlossaryPresentationGUI.php.

Referenced by getTabs(), and showDefinitionTabs().

◆ $lng

◆ $mobs

array ilGlossaryPresentationGUI::$mobs
protected

Definition at line 27 of file class.ilGlossaryPresentationGUI.php.

◆ $nav_history

ilNavigationHistory ilGlossaryPresentationGUI::$nav_history
protected

Definition at line 37 of file class.ilGlossaryPresentationGUI.php.

Referenced by listTerms().

◆ $offline

bool ilGlossaryPresentationGUI::$offline
protected

Definition at line 32 of file class.ilGlossaryPresentationGUI.php.

Referenced by offlineMode().

◆ $offline_dir

string ilGlossaryPresentationGUI::$offline_dir
protected

Definition at line 29 of file class.ilGlossaryPresentationGUI.php.

Referenced by getOfflineDirectory().

◆ $requested_def_page_id

int ilGlossaryPresentationGUI::$requested_def_page_id
protected

Definition at line 51 of file class.ilGlossaryPresentationGUI.php.

◆ $requested_export_type

string ilGlossaryPresentationGUI::$requested_export_type
protected

Definition at line 55 of file class.ilGlossaryPresentationGUI.php.

◆ $requested_file_id

string ilGlossaryPresentationGUI::$requested_file_id
protected

Definition at line 53 of file class.ilGlossaryPresentationGUI.php.

◆ $requested_letter

string ilGlossaryPresentationGUI::$requested_letter
protected

Definition at line 50 of file class.ilGlossaryPresentationGUI.php.

◆ $requested_mob_id

int ilGlossaryPresentationGUI::$requested_mob_id
protected

Definition at line 54 of file class.ilGlossaryPresentationGUI.php.

◆ $requested_ref_id

int ilGlossaryPresentationGUI::$requested_ref_id
protected

Definition at line 49 of file class.ilGlossaryPresentationGUI.php.

Referenced by getTabs(), and listDefinitions().

◆ $requested_search_str

string ilGlossaryPresentationGUI::$requested_search_str
protected

Definition at line 52 of file class.ilGlossaryPresentationGUI.php.

◆ $service

ILIAS Glossary InternalService ilGlossaryPresentationGUI::$service
protected

Definition at line 31 of file class.ilGlossaryPresentationGUI.php.

Referenced by initByRequest().

◆ $tabs_gui

ilTabsGUI ilGlossaryPresentationGUI::$tabs_gui
protected

◆ $tax

ilObjTaxonomy ilGlossaryPresentationGUI::$tax
protected

Definition at line 47 of file class.ilGlossaryPresentationGUI.php.

◆ $tax_id

int ilGlossaryPresentationGUI::$tax_id
protected

Definition at line 46 of file class.ilGlossaryPresentationGUI.php.

◆ $tax_node

int ilGlossaryPresentationGUI::$tax_node
protected

Definition at line 45 of file class.ilGlossaryPresentationGUI.php.

◆ $term_id

int ilGlossaryPresentationGUI::$term_id
protected

Definition at line 48 of file class.ilGlossaryPresentationGUI.php.

Referenced by listDefinitions().

◆ $toolbar

ilToolbarGUI ilGlossaryPresentationGUI::$toolbar
protected

Definition at line 38 of file class.ilGlossaryPresentationGUI.php.

Referenced by listTerms().

◆ $tpl

◆ $user

ilObjUser ilGlossaryPresentationGUI::$user
protected

Definition at line 39 of file class.ilGlossaryPresentationGUI.php.

Referenced by listDefinitions().


The documentation for this class was generated from the following file: